Serverteknologi Database Cheat Sheet
by Nicholade via cheatography.com/62330/cs/16133/
Made by MS SQL Architecture (cont) Database Design and Resource use
(cont)
Nevzat Tokmak Query Parser - Optimizer - SQL
Nicholas Johansson Proces Manager - Database Manager - Naming Even if you consider naming
Rune Andreasen sor Query Executer conven‐ your tables, columns etc. to be
Serverteknologi Database tions easy – It is very important to
SQL Lock Manager – Synchronization
OS API Services – Thread Scheduler – use clear and understandable
Relation Database Buffer Pool – Memory Manger – name giving for your database
I/O Manager – So it can be understood by
A relational database is a set of formally
everyone who need to work on
described tables from which data can be Reference: http://udayarumilli.com/sql-se‐
the database.
accessed or reassembled in many different rver-architecture-qa-3/
ways without having to reorganize the Normalize It very important to know the
database tables. The standard user and rules of normalization in terms
Database Design and Resource use
application programming interface (API) of a of relational database
Database Planning the database is very
relational database is the Structured Query structure. If the principles of
planning important in terms of creating a
Language (SQL). SQL statements are used normalization are done right.
resourceful and working
both for interactive queries for information Your database will be efficient
database. Even though it
from a relational database and for gathering and logical to everyone. It is
seems obvious – It can be one
data for reports. very important that your
of the most demanding tasks,
normalization is done right up
Reference: https://en.wikipedia.org/wiki/Mic‐ when creating a relational
to the Third Normalization.
rosoft_SQL_Server database.
Data Giving your design the right
Docume‐ The importance of docume‐
MS SQL Architecture types data types is crucial for a
ntation ntation of a database, will make
working database. Therefore is
External Shared memory - Named pipes it easier for maintaining and
very important to give your
Protoc‐ - TCP/IP - Virtual Interface altering changes further ahead
columns in your database the
ols Adapter (VIA) in the database.
most appropriate data type for
Database Database Tables/Indexes - each and give you better
Engine Type System Transactions - understanding of the data.
Events/Exception Triggers -
TSQL - Stored Procedure -
SQLCLR
Storage Transaction Services & File
Engine Manager (Utilities) – Buffer
Manager & Lock Manager
(Access Methods)
By Nicholade Published 12th February, 2021. Sponsored by CrosswordCheats.com
cheatography.com/nicholade/ Last updated 22nd June, 2018. Learn to solve cryptic crosswords!
Page 1 of 3. http://crosswordcheats.com
Serverteknologi Database Cheat Sheet
by Nicholade via cheatography.com/62330/cs/16133/
Database Design and Resource use Install SQL Server Configure Windows Firewall
(cont)
Hardware Minimum Requirements Open TCP port 1433
Primary It is very important in terms of SQL Server requires a minimum of 6 GB of Run netsh.exe with admin permissions
keys relational database, that your available hard-disk space. firewall set portopening
primary and natural key is set protocol = TCP port = 1433 name
SQL Server requires Super-VGA (800x600)
correctly. Be sure that you = SQLPort mode = ENABLE scope =
or higher resolution monitor.
define a primary key and natural SUBNET profile = CURRENT
Memory: Express Edition 512 MB, All other
key for your tables – It can be
Editions 1 GB
very important when you start to Tabeller
break up your tables when you Processor Speed: x64 Processor: 1.4 GHz
MASTER The master database records
start to normalize. Processor Type: x64 Processor: AMD
all the system-level information
Data Data integrity is very important Opteron, AMD Athlon 64, Intel Xeon with
for a SQL Server system.
Integrity when you work with RDBMS Intel EM64T support, Intel Pentium IV with
MODEL The model database is used as
and it is one of the core EM64T support
the template for all databases
functions to uphold the data Install SQL Server
created on an instance of SQL
integrity in your database.
Run setup.exe from your media -> Server.
Indexing A proper indexing is a key to a Installation -> Choose "New SQL
MSDB The msdb database is used by
successful database. It can be Server stand-alone installation
SQL Server Agent for
very complexed to index your or add features to an existing scheduling alerts and jobs and
database and deserves quite
installation" -> Next -> Check I by other features such as SQL
focus when creating your
agree to the terms -> Next Server Management Studio,
database.
Advance to Install Setup Files and check for Service Broker and Database
Testing Testing your relational database
updates, if not move on and check your Mail
is very important and can be
installation is correct. Click Next. TEMPDB The tempdb system database
crucial to avoid system failures.
On Installation type choose new is a global resource that is
Quality assurance is there for
or add features to existing and available to all users connected
key in database creating.
click Next -> Advance -> Name to the instance of SQL Server
Reference: https://www.quora.com/What-‐ or connected to SQL Database.
your Instance ID -> Create
are-good-resources-to-learn-Database-de‐ Tempdb is used to hold:
Service Account -> Advance to
sign-best-practices Temporary user objects that
Install page -> Reboot when
are explicitly created. Internal
Required to -> Your installation
objects that are created by the
is now complete
database engine. tempdb is re-
https://docs.microsoft.com/en-us/sql/sql-s‐ created every time SQL Server
erver/install/hardware-and-software-requir‐ is started
ements-for-installing-sql-server?view=sql-‐
server-2017
By Nicholade Published 12th February, 2021. Sponsored by CrosswordCheats.com
cheatography.com/nicholade/ Last updated 22nd June, 2018. Learn to solve cryptic crosswords!
Page 2 of 3. http://crosswordcheats.com
Serverteknologi Database Cheat Sheet
by Nicholade via cheatography.com/62330/cs/16133/
Add users (RDMS) Backup of Database (cont) Setup Replication
Powershell Create a Full Backup to non-default 1. Configure Distributor and publisher
$newUser = New-RDMUser -Name "‐ location SSMS > "SQL-Server" > Right click Replic‐
LoginName" -CreateSQLServerLogin Go to your Database in Object Explorer ation > Configure Distribution > Act as own
Right click NORTHWIND -> Tasks - Distributor > When asked for publisher add
-IntegratedSecurity
> Back UP second server
GUI
From here go to Destination -> 2. Creating Snapshot Publication
SSMS > "SQL-Server" > Right click on SSMS > "Publisher Server" > Replication >
General -> Select Disk from
Security > New - Login Right click Local Publications > New public‐
Drop-down menu
Creating an user in Query Click Remove until all existing backup files ations > Use following server > Add >
CREATE LOGIN "USERNAME" have been removed. Select Distributor > Select Database >
WITH PASSWORD = 'Pa$$w0rd' Click Add and enter your desired Path. Snapshot Publication > Choose Tables >
The Password need to follow the Windows It creates our backup and sets it to your Create Snapshot Immediately
policy requirement changed path 3. Create Subscription
GO SSMS > "Publisher server" > Replication >
Recovery of Database Local Publications > Right click the new
CREATE USER "USERNAME" FOR LOGIN
replication > New Subscription > Add
"USERNAME" Recovery of Full Database Backup
Subscription > Run all Agents at Distribution
GO
Right click NORTHWIND -> Restore > Add SQL Server Subscription > Choose a
Database... -> From Device -> Add -> Path > Add New Database > Agent
User Permissions (RDMS)
Browse your file -> OK -> Select point to Schedule > Run Continuously > Initialize >
Powershell restore Immediately
Set-RDMUserProperty -User Snapshot Agent
$newUser -Property "Add" -Value Optimize Database Operations The Snapshot agent stores an executable
$TRUE In SSMS open SQL Activity Monitor by file which stores schema and data of
Set-RDMUserProperty -User pressing published tables and db objects. It's
$newUser -Property "Edit" -Value CTRL + ALT + A updated when synchronization jobs are
$TRUE View Log Files gathered from SQL recorded.
Set-RDMUserProperty -User %ProgramFiles%\Microsoft SQL Server\13‐ Distribution Agent
$newUser -Property "Delete" - 0\Setup Bootstrap\LOG\ Works with Snaphot to distribute to subscr‐
Value $TRUE ibers. Moves transactions held at the distri‐
Import & Export Database MS Tool bution db out to the subscribers.
GUI
Merge Agent
SSMS > "SQL-Server" > Databases > "Dat‐ Import and Export Wizard
It applies the initial snapshot to the
abase" > Security > Users > Right Click on Run the SQL server 2016 Import and Export
Subscriber and moves incremental data
an user > Permissions > Owned Schemas Data Wizard
changes that occur.
Alter User with Query Click Next -> Pick Excel as Data source ->
Queue Reader Agent
EXEC sp_addrolemember ' "SCHEMA‐ Choose Destination SQL server and modify
It runs at the Distributor and moves changes
S" ', ' "USERNAME" ' the settings -> Choose Copy Data -> Next -
made at the Subscriber back to the
> Pick your Table to copy -> OK -> Check
Publisher.
Backup of Database Run Immediately -> Finish
https://www.codeproject.com/Articles/71‐
Create a Full Backup
5550/SQL-Server-Replication-Step-by-Step
Go to your Database in Object Explorer
Right click NORTHWIND -> Tasks -
> Back UP -> OK
It creates our backup and sets it to default
location
By Nicholade Published 12th February, 2021. Sponsored by CrosswordCheats.com
cheatography.com/nicholade/ Last updated 22nd June, 2018. Learn to solve cryptic crosswords!
Page 3 of 3. http://crosswordcheats.com