Data Base Administration
IT-242
Birkinesh
Content
1. Why DBA Course?
2. What is DBA functions and roles?
3. What are the required software?
4. How we install and related issues?
WHY IS DBA COURSE?
Why is DBA?
To maintain the health of data
◦ Availability
◦ Reliability
◦ Efficiency
◦ Privacy
Introduction
Database Administration: A technical function that is
responsible for physical database design and for
dealing with technical issues such as security
enforcement, database performance, and backup and
recovery
Database Administrators use specialized software to
store and organize data. The role may include capacity
planning, installation, configuration, database design,
migration, performance monitoring, security,
troubleshooting as well as back up and data recovery
Data base administartion 5
Database Administration
1. Installation
◦ Planning, edition, reliability, requirement
2. Security
3. Performance
4. Upgrade
Performance
1. Performance
Monitor the performance using monitoring tools
Database cleaning
2. Upgrading the system
to increase security and
performance enhancement
What are the software and hardware requirement
Security
3. Security can be made by DBA
Physical level
Windows level
Server level
Database level
File level
Installation
4. Installation
Hardware Requirement Analysis
Software Requirement Analysis
System Requirement Analysis
Planning and Configuration
Common DBA Tasks
Installing DBMS software, new versions and applying
fixes
Data Modeling Architecture
Performing upgrades of the database and software to
new release levels
Managing the storage structures of the database
Managing users and security
Managing database objects, such as tables, indexes, and
views
Data base administartion 10
Common DBA Tasks
Monitoring and tuning the state of the database,
performance and taking preventive or corrective action as
required
Setting and tuning system parameters, operating system,
network and transaction processors to work with the DBMS
Ensuring appropriate storage and memory is available
Analyzing data access requirements to ensure optimal
database design and efficient SQL access to maintain
security
Diagnosing and reporting critical errors to DBMS Support
Services
Common DBA Tasks
Backing up the database and performing recovery
operations when necessary
Starting and shutting down the database instance
DBMS Software
Potential DBMS Software
1. Access
2. SQL – Structured Query Language
3. Oracle
MS SQL Introduction
MS SQL Server is a relational database management
system (RDBMS) developed by Microsoft
This product is built for the basic function of storing
retrieving data as required by other applications
It can be run either on the same computer or on another
across a network
Data base administartion 14
MS SQL Server - Overview
What is SQL Server?
It is a software, developed by Microsoft, which is
implemented from the specification of RDBMS
It is also an ORDBMS
It is platform dependent
It is both GUI and command based software
It supports SQL language which is an IBM product,
non-procedural, and common database
Data base administartion 15
Usage of SQL Server
To create databases
To maintain databases
To analyze the data through SQL Server Analysis
Services (SSAS)
To generate reports through SQL Server Reporting
Services (SSRS)
To carry out ETL operations through SQL Server
Integration Services (SSIS)
Data base administartion 16
SQL Server Components
SQL Server works in client-server architecture, hence it
supports two types of components
(a) Workstation and (b) Server
Workstation components are installed in every
device/SQL Server operator’s machine. These are just
interfaces to interact with Server components. Example:
SSMS, SSCM, Profiler, BIDS, SQLEM etc.
Server components are installed in centralized server.
These are services. Example: SQL Server, SQL Server
Agent, SSIS, SSAS, SSRS, SQL browser, SQL Server full
text search etc.
Data base administartion 17
SQL Server Edition
SQL Server is available in various editions.
Enterprise − This is the top-end edition with a full feature set.
◦ It meets high demands of enterprise online transaction processing and data warehousing
Standard − This has less features than Enterprise, when there is no
requirement of advanced features.
◦ Includes the essential functionality needed for e-line-of-commerce, data warehousing,
and line of business solutions
Workgroup − This is suitable for remote offices of a larger company.
Web − This is designed for web applications.
Developer − This is similar to Enterprise, but licensed to only one user for
development, testing and demo. It can be easily upgraded to Enterprise
without reinstallation.
Express − This is free entry level database. It can utilize only 1 CPU and 1
GB memory, the maximum size of the database is 10 GB.
Data base administartion 18
SQL Server Edition
Compact − This is free embedded database for mobile application
development. The maximum size of the database is 4 GB
Datacenter − The major change in new SQL Server 2008 R2 is
Datacenter Edition. The Datacenter edition has no memory limitation
and offers support for more than 25 instances
Business Intelligence − Business Intelligence Edition is a new
introduction in SQL Server 2012. This edition includes all the features
in the Standard edition and support for advanced BI features such as
Enterprise Evaluation − The SQL Server Evaluation Edition is a
great way to get a fully functional and free instance of SQL Server for
learning and developing solutions. This edition has a built-in expiry of
6 months from the time that you install it
Data base administartion 19
SQL Server Edition
Data base administartion 20
Instance of SQL Server
An instance is an installation of SQL Server
An instance is an exact copy of the same software
If we install 'n' times, then 'n' instances will be created
There are two types of instances in SQL Server
1. Default
2. Named
Data base administartion 21
Instance of SQL Server
Only one default instance will be supported in one
Server
Multiple named instances will be supported in one
Server
Default instance will take the server name as Instance
name
Default instance service name is MSSQLSERVER
No of instances varies according to the version
Ex. 16 instances in 2000 version, and 50 instances will
supported in 2005 and later versions
Advantages of Instances
To install different versions in one machine
To reduce cost
To maintain production, development, and test
environments separately
To reduce temporary database problems
To separate security privileges
To maintain standby server
Data base administartion 23
MS SQL Server - Installation
SQL Server supports two types of installation −
1. Standalone
2. Cluster based
STANDARD mode you can install the server when the
server is down the service stop giving service
CLUSTER mode is using windows server clustering to
maintain high availability of the server and service
If the sql server of one node is down, the other node
continue providing the same service that is high
availabelity
Data base administartion 24
Stand Alone - Installation
1. Operating system
2. Disk
3. Power supply
4. Internal LAN
IF you have one server which provides service for
many clients, if one your disk, network or battery fails,
your server are unable to provide the service.
But if you make your server with redundancy like
operating system, hardware raid as disk 1 and 2, LAN 1
and 2, power supply 1 and 2, teaming and bonding
connected with network switch maintains high
availability
Stand Alone - Installation
Operating system
How do we make sure our
server will not go down
1. Buying a server with
redundant power supply
Hard Disk 1
2. Configuring a hardware
raid and installing our OS
3. Having multiple
network cards
configured teaming
LAN 1
or bonding with
single IP
Power supply 1
To maintain high availability in stand
alone system
Operating system
Hard Ware Wired
Hard Disk 1 Hard Disk 2
LAN 1 Teaming /Bonding
LAN 2
Power supply 1 Power supply 1
Cluster Based- Installation
Cluster is a group of servers and other resources that
act like a single system and enable high availability and
in some cases load balancing and parallel processing
Any problem in services affect the business, any losses
to that service is a huge looses for that organization
100% operational never failures or without down time,
is high availability
How do we make sure our server is available
Cluster Based- Installation
Operating system doesn’t have redundancy in a single
server system
A high availability cluster(HA cluster) is a group of a
computer hardware pieces that provide solutions for
redundant operations in the event of component failure
CLUSTER is a group of server that works as one
system
Cluster Based- Installation
Server A Server B
Operating system Operating system
Hard Ware Wired Hard Ware Wired
Hard Disk 1 Hard Disk 2 Hard Disk 1 Hard Disk 2
[Link]
LAN 1 Teaming LAN 1 Teaming
/Bonding /Bonding
LAN 2 LAN 2
Power supply Power supply Power supply Power supply
1 1 1 1
Cluster Based- Installation
There are two ways of clusters
1. |Manual cluster- which is nothing but you wil have
some downtime to bring up the other node with same
data dn ip address. End users still able to access the
nfs shares but they don’t from which server they are
accessing. This is manual cluster
2. Automatic Cluster- here we use some sort of cluster
software’s as veritas cluster, HP service-guard cluster,
Red Hat Linux Native cluster, Sun Cluster
These software’s will do the necessary switchover
automatically which is already configured by us in the
respective configuration
Cluster Based- Installation
There are four major types of clusters for our needs
1. High availability(Active-Passive Cluster)- A high
availability cluster is a group of hosts that act like a
single system and provide continuous uptime. High
availability clusters are often used for load balancing,
backup and failover purposes
2. Load balancing(Active-Active) Load balancing
scales the performance of server based programs, such
as a web server, by distributing client requests across
multiple servers
3. High performance- As name says, to have high
performance we use this clusters\4. Storage- Storage
Installation Analysis
Review installation requirements
System configuration checks
Security consideration for a SQL Server installation
What is new in system edition
Determine hardware and software requirement
◦ OS
◦ RAM
◦ Storage
Installation Analysis
Analyze your device
Click on mycomputer
Select properties
See the operating system, memory, cpu and bits
Click on explorer
Select your server capacity or computer capacity
You can check details in device managers
Analyze the installed software
requirement
Go to internet and type SQL server download
Type the hardware and software requirement of specific
SQL server version
check the requirement of the SQL software installation
with your requirement
Planning
Includes hardware and software requirement is needed
to install to improve security, to maintain security, to
improver performance, back up and recover
Requirements
Which version, edition,
Service accounts for database engine, agent, SSAS,
SSIS, SSRS
Named instance name
Location for system, user databases
Authentication mode
Data base administartion 37
Installation
Security considerations
◦ Using Firewalls
◦ Put firewall between the server and internet
◦ Divide network into security zones separated by fire walls
◦ Isolate Services
◦ Run separate SQL Server Services under separate Windows
account
◦ Do not run SQL Server services on a domain controller under a
local service account
Installation
Security
◦ Use windows Authentication
◦ Use strong password for sa
◦ Always enable password policy
◦ Always use strong password for SQL login
◦ Run SQL Server Setup to install or upgrade to a later version
◦ Use SQL Server utilities to configure SQL Server
Installation
What are security zones
One services that check the performance monitoring or provides back
up services should be separated with windows account
if one of your service fails the other will continue running since their
windows account are different
Windows authentication- you can use to access sql server if you have
computer access
If I give windows authentication all users should access the sql server
Policy enable should be ON
It includes expiration period, size limitation, change user name,
capitals and so on
Utilities – stop and start automatically,
How to give windows level or server
level access
Click on security
Right click on log in
Set username and password
Give windows level or server level authentication
System Requirements for SQL
1. Hardware
Laptop or desktop
2. Software
SQL Server and SQL Management Studio
SQL Server is a database system that allows you to store
tables and databases
SQL Management Studio enables you to write sql
statements
R2 2008
Hard disk - 2.2. GB
RAM - 512 MB
Processor 1.0 GHZ
Operating system windows xp or above
Edition - Sql server 2008 r2 expression
Check bits - 64bits or 32 bits
SQL SERVER 2019
Hard disk - 6GB
Ram 1 GB
Processor 1.4 GHZ
Operating system windows 10 or above
R2 Installation
Download the exe file
Click on new installation
Accept agreement
Click next as a default
Instance configuration – Default and named instance use default for first
time and use named if it is second or more time you are installing you
have to choose named give name for your server
Server configuration sql browser change the startup type into automatic
Database engine configuration - Windows authentication mode as it is
Click on add current
Click next
Click close all
2019 Installation
Find the sql server 2019 download
It will give you two options Developer and Express edition
Developer edition: gives you four features of the standard MS SQL
server when it comes to the license you can only use for
development and testing but you can not use for production
Express edition: gives you 10GB of storage and 1 GB of ram can be
used for production development. you do not have to worry
about license you can use it for production development desktop
and web application
And download under the developer edition
2019 Installation
Find the downloaded file and install the setup file
It will give you three options as Basic, Custom, Download Media
- Custom: you can choose what features what you want to include
- Basic : comes with all the tools you need to start with MS SQL server
- Download Media: for the first time use BASIC
Click Basic
Accept the agreement
Specify the location where you want to install and click next
And gives you an information about where the instance, log file, resource
folder and media folder is installed
Choose installation location as default
Click connect- gives you the current version of SQL server , it indicates the
successful installation
When it finishes click connect now, it will give you the version name which indicates the
success of your installation
Back to the installation window to install SQL management studio
SQL Server Management Studio
SQL server Management Studio helps us to connect with the
main server
A client tool which can be installed at any place
SQL server helps us to install all SQL objects including tool
SQL management studio is separate tool and linked with the
server through network
Download SQL server Management Studio
Install SQL server Management Studio
When it completes close
2019 Installation
Step 2. Install SQL server management studio
Click on install SSMSS
Download SSSMSQL server management studio
Go where it is stored and run the executable files
of SSMS
Specify the location where you want to install
Click on install
Close the installation when it finishes
Now you have SQL server to store and SQL server
management studio to write sql statments
To Start with SQL Server
Find Management Studio from your programs
and click
You will see the dialogue box, if you do not
see the server name is displayed, click on
drop down arrow and click on browse more
and under database engine and select the
server name
Click on connect
Click file, new, query and type
SELECT@@ServerName
SQL Server System Databases
What are the available software and databases when
you install software
1. Master database
2. MSDB- all files
3. Model- Template
4. RDB – Resource DB all system level objects
5. Tempdb – Transaction files
6. Configure Distribution
SQL Server System Databases
Master- the database that all of the system level
information for SQL server system
◦ It will reveal all databases, who log in a system
Model : the template for all databases that are created
on the instance of SQL server
SQL Server System Databases
Msdb: the database used by SQL Server Agent for
scheduling alerts and jobs, and for recording operators.
To remember what and when the database is backup,
Msdb also contains history tables such as the backup
and restore history tables
Resource(RDB): A read only database that contains
copies of all system objects that ship with SQL Server ,
if you fail the server you can reinstall it but if your
database corrupted it you can take a back up for system
level database you can use the resource dba
SQL Server System Databases
Tempdb: A workspace for holding temporary
intermediate result sets. This database is re-created
every time an instance of SQL Server is started. When
the server instance is shut down, any data in tempdb is
deleted permanently
Configure Distribution a database that exists only if the
server is configured as a replication Distributor. This
database stores metadata and history data for all types
of replication, and transactions for transactional
replication
How to start SQL server
Click sql server management studio
Database engine
Select server name ex. .dat
Windows authentication
Connect
Object explorer will come
If the object explorer is not appear
Click on view menu and click on object explorer
How to see the system database
Click on file, select new, query with current connection
To reveal all databases, you can use the following
commands
◦ SELECT name, database_id, create_date FROM [Link]
Use master will change it to master database
Use model will change it to model database
How to start SQL server
Click on database
All of them are objects
Click on new
Type database name
Click ok, two files will be created automatically
Click refresh to get the created file
In new files there are many objects
Database Files
When you create any database , the two data files will
be created
Primary data and Secondary data files
Primary data file is the starting point of the database
and points to the other files in the database. Every
database has one primary data file. The recommended
file name extension for primary data file is .mdf
Database Files
Secondary data files make up all the data files, other
than the primary data file. Some databases may not
have any secondary data files, while others have
several secondary data files. The recommended file
name extension for secondary data files is .ndf
Log files: hold all the log information that is used to
recover the database. There must be at least one log
file for each database, although there can be more than
one . The recommended file name extension for log
files is .ldf
Comparison between MDF and LDF
files
MDF file is the primary file in SQL server database
MDF contains database record data
MDF vary in its file size with the change of the table and
record data
The LDF is a supporting file, it stores the information
related to transaction logs
LDF records information related to changes made in the
server as well as all the actions performed
LDF files can go on to consume a lot of storage space
depending on the number of changes made in the server as
well as the number of transactions that took place,