\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{nymark} \pdfinfo{ /Title (sql-database.pdf) /Creator (Cheatography) /Author (nymark) /Subject (SQL Database Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A33C3C} \definecolor{LightBackground}{HTML}{F9F2F2} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{SQL Database Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{nymark} via \textcolor{DarkBackground}{\uline{cheatography.com/46272/cs/13472/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}nymark \\ \uline{cheatography.com/nymark} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 10th November, 2017.\\ Updated 1st December, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{HyperV Specs:}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{CPU: i7 7700 4 kerner / 8 tråde} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{RAM: 32GB} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{HDD: 250GB} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Windows Server 2016 VM specs (DHCP, DNS, AD):}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Kerner/Tråde: 1} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{RAM: 512 til 4096MB (Dynamisk)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{HDD: 30GB} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Netkort: Intel(R) Gigabit CT Desktop} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{IP: Statisk -\textgreater{} 192.168.0.10} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Windows Server 2016 VM specs (SQL):}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Kerner/Tråde: 1} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{RAM: 512 til 4096MB (Dynamisk)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{HDD: 30GB} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Netkort: Intel(R) Gigabit CT Desktop (Switch)} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{IP: Statisk -\textgreater{} 192.168.0.7} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Windows 10 klient VM specs:}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Kerner/Tråde: 1} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{RAM: 512 til 4096MB (Dynamisk)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{HDD: 30GB} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Netkort: Intel(R) Gigabit CT Desktop} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{IP: fra DHCP} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{DHCP}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Domain name: grp5.local \newline % Row Count 1 (+ 1) Scope name: Scope \newline % Row Count 2 (+ 1) Scope range: 192.168.0.1 til 192.168.0.200 \newline % Row Count 3 (+ 1) Subnet mask: 255:255:255:0 \newline % Row Count 4 (+ 1) Lease: 10 dage \newline % Row Count 5 (+ 1) Excluded IP's: 192.168.0.1 til 192.168.0.20% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{DNS}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{DNS Server IP: 192.168.0.10 \newline % Row Count 1 (+ 1) Forward lookup zone: grp5-local \newline % Row Count 2 (+ 1) Ingen Reverse lookup zone \newline % Row Count 3 (+ 1) Type: Host A record% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Opsætning af AD}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{5 Brugere oprettet \newline % Row Count 1 (+ 1) - Test1, Test2, Test3, Test 4, Test 5 \newline % Row Count 2 (+ 1) 2 Grupper oprettet \newline % Row Count 3 (+ 1) - Gruppemedlemmer 1 og 2 \newline % Row Count 4 (+ 1) - Gruppemedlemmer 1, 2 og 3 \newline % Row Count 5 (+ 1) AD tilmeldte maskiner i computers OU% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Hvad er en relations database platform?}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{En database opbygget i relations format.} \tn % Row Count 1 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Sikkerhedsgrupper}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{db\_owner -\textgreater{} Medlemmer kan udføre alt konfiguration \newline % Row Count 2 (+ 2) db\_securityadmin -\textgreater{} Medlemmer kan modificere rettigheder \newline % Row Count 4 (+ 2) db\_accesadmin -\textgreater{} Medlemmer kan tilføje/fjerne adgang til databasen \newline % Row Count 6 (+ 2) db\_backupoperator -\textgreater{} Medlemmer kan lave backup af databasen \newline % Row Count 8 (+ 2) db\_ddladmin -\textgreater{} Medlemmer kan køre DDL i databasen \newline % Row Count 10 (+ 2) db\_datawriter -\textgreater{} Medlemmer kan ændre i tabellerne \newline % Row Count 12 (+ 2) db\_datareader -\textgreater{} Medlemmer kan læse i tabellerne \newline % Row Count 13 (+ 1) db\_denydatawriter -\textgreater{} Medlemmer kan IKKE ændre i tabellerne \newline % Row Count 15 (+ 2) db\_denydatareader -\textgreater{} Medlemmer kan IKKE læse i tabellerne% Row Count 17 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Hvordan anvender MS SQL 2016 logfiler?:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Hver SQL Server har en transaktionslog database der registrerer alle transaktioner. \newline % Row Count 2 (+ 2) Hvis der er en systemfejl, skal du logge for at bringe din database tilbage til normalen igen. \newline % Row Count 4 (+ 2) Gendannelse af alle ufuldstændige transaktioner, når SQL Server startes. \newline % Row Count 6 (+ 2) Individuel transaktions gendannelse.% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Indexering i MS SQL}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Indexing bruges til optimering af informationsøgning i en database% Row Count 2 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Services i MS SQL}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Opdelt I 3 kategorier \newline % Row Count 1 (+ 1) Komponenter til serveren \newline % Row Count 2 (+ 1) Management tools til brugere \newline % Row Count 3 (+ 1) Dokumentation.% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{MS SQL System requirements}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{CPU -\textgreater{} AMD Opteron, AMD Athlon 64, Intel Xeon, Intel Pentium \newline % Row Count 2 (+ 2) Minimum processor hastighed -\textgreater{} 1.4 GHz, anbefalet 2 GHz eller hurtigere \newline % Row Count 4 (+ 2) Minimum RAM -\textgreater{} 1GB, anbefalet 4GB \newline % Row Count 5 (+ 1) Software: \newline % Row Count 6 (+ 1) .Net 4.0 \newline % Row Count 7 (+ 1) Windows Powershell 2.0 eller nyere \newline % Row Count 8 (+ 1) Internet explorer 7 eller nyere% Row Count 9 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Beskrivelse af MS SQL installation}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{System configuration checker: succes \newline % Row Count 1 (+ 1) Developer edition \newline % Row Count 2 (+ 1) Features: Database engine services, Client tools connectivity \newline % Row Count 4 (+ 2) Default instance (MSSQLSERVER) \newline % Row Count 5 (+ 1) Mixed mode: Kode: Password123, Added current user.% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{System databaser}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{master -\textgreater{} Indholder alt system level informationer \newline % Row Count 2 (+ 2) model -\textgreater{} Template for alle databaser \newline % Row Count 3 (+ 1) msdb -\textgreater{} Management for alerts og job samt Studio m.m. \newline % Row Count 5 (+ 2) tempdb -\textgreater{} Global resource tilgængelig for alle brugere% Row Count 7 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Import / Eksport af database formater:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{.BAK \newline % Row Count 1 (+ 1) .DIF \newline % Row Count 2 (+ 1) .FIL \newline % Row Count 3 (+ 1) .FLG \newline % Row Count 4 (+ 1) .TRN% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Monitoreringsværktøjer i MS SQL}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Error Logs - Indeholder et overordnet billede af begivenheder der opstår. \newline % Row Count 2 (+ 2) SQL Backup Status Reporter - Ser på SQL Server backup historie. \newline % Row Count 4 (+ 2) SQL Column Search - Identificer potentielt følsomme data i SQL Server Tables.% Row Count 6 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Brugere i MS SQL Database}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Login -\textgreater{} Bruger -\textgreater{} Rettigheder \newline % Row Count 1 (+ 1) oh -\textgreater{} Ole\_Hansen -\textgreater{} Select \newline % Row Count 2 (+ 1) lp -\textgreater{} Lis\_Petersen -\textgreater{} Select, Insert \newline % Row Count 3 (+ 1) ll -\textgreater{} Lars\_Larsen -\textgreater{} Select, Insert, Delete \newline % Row Count 4 (+ 1) cn -\textgreater{} Casper\_Nymark -\textgreater{} All \newline % Row Count 5 (+ 1) sh -\textgreater{} Sebastian\_Henriksen -\textgreater{} All% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Backup Database MS SQL}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Typer af backup: \newline % Row Count 1 (+ 1) Full backups. \newline % Row Count 2 (+ 1) Differential backups. \newline % Row Count 3 (+ 1) File backups. \newline % Row Count 4 (+ 1) Filegroup backups. \newline % Row Count 5 (+ 1) Partial backups. \newline % Row Count 6 (+ 1) Copy-Only backups. \newline % Row Count 7 (+ 1) Mirror backups. \newline % Row Count 8 (+ 1) Transaction log backups. \newline % Row Count 9 (+ 1) Gendannelse af databaser kan gøres på flere forskellige \newline % Row Count 11 (+ 2) måder igennem MS SQL server og tredjeparts software.% Row Count 13 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}