Topics In This Module.
- Environments
- Installation of SQL Server
- SQL Server Instances
- SQL Server Services
- Ports, Protocols and Service Accounts.
- Patching
- Migration & Upgradation.
Environments
There are two types of environments in general they are:- Pre-Prod Environments.
=> Which Involves Dev environment and UAT environment. - Prod Environments.
=> We do have OLAP(Online Analytical Processing) and OLTP(Online Transactional Processing) Servers in production.
SQL Server -> Instance -> database -> File groups -> Files -> as two types below
The Files in SQL Server are of two types they are
- Data files -> Extends -> Pages -> Header part, Data part(8060 Bytes), Row off Set
- Log files -> Virtual logs -> LSN ->
1 page = 8KB of size =
8*1024bytes
1 extent has 8 Pages =
8pages*8Kb = 64 Kb size
Based
on file size we get number of extents
Instance: A copy of SQL Servers and Its services present on a system is a instance.
==================================================================================
Installation
of SQL Server
There are few steps to be
followed for complete installation of an Instance\SQL Server they are Installation steps can be classified as few steps they are:
- Prerequisites
- Pre-Installation
- Installation
- Post-Installation
=> Prerequisites: Gather all Prerequisites and make sure all of them are meet before installation of SQL Server instance.
- .NET Framework as per server Version/Edition
- Windows Installer.
- Resources.
- Gather the type of installation,
- Gather the type of instance need to install,
- Check OS compatibility: Check does that SQL sits in the windows or not.
- Software components: .NET Framework, OS and Latest patch
- Hardware Components: RAM, CPU and storage.
- Components selection(Services)
- Instance type selection
- Service account/Admins
- Authentication screen
- Collation Setting
- Summary
- Check the path of installation and Binaries.
- Check the Services Installed.
- Verify the Connection to instance.
- Stand alone Installation: Application, SQL Server, Client Tools will be on same server, All in one machine.
- Client-Server Installation:
- On Client Machine: Client connectivity tools + Application
- On Server Machine: SQL Server components + Client Tool Components
- SQL Server (Instance
Name) – Engine Service
- SQL Server Agent
(Instance Name) – Agent Service
- SQL Full-text Filter
Daemon Launcher (Instance Name)
- SQL Server Analysis
Services (Instance Name)
- SQL Server Reporting
Services (Instance Name)
- SQL Server
Integration Services
- SQL Server writer
- SQL Server ADH
- SQL Server Browser
- SSMS (SQL Server Management Studio)
- SQLCMD (SQL Command),
- BDC (Big Data Cluster),
- SCM (SQL Server Configuration Manager),
- SSAC (SQL Server Surface Area Configuration),
- SQL Profiler,
- DTA (Data Tuning Advisor),
- Book Online,
- BCP (Bulk Copy Programming)
The Client connectivity drivers or tool used are listed below:
- ODBC - Open Database Connectivity
- OLAP Drivers,
- SQL Native Clients.
- Database Engine Services (sqlservr.exe)
- Analysis Services (msmdsrv.exe)
- Integration Services (MsDtsSrvr.exe)
- Reporting services (ReportingServicesService.exe)
Database Engine Services
- The engines is divided into two engines they are:
1. Relational Engine:
- Handles the execution of queries which are received from client application this engine contains the following components they are:
b. Optimizer or Planner.
c. Query Executor.
- Simply said its an interface between the client application and storage engine.
2. Storage Engine:
- Handles actual accessing the data from the physical files as requested by Query executor, This engine contains of the following components they are:
b. Access Methods.
c. Buffer Manager.
- These components interacts with the databases(data and log files) to select/ insert/ update/ delete data as required.
SQL Server Instances
An Instance is also a SQL Server, simply said a copy of SQL server with its related services (Instance Aware Services) is called an instance.- Default Instance.
- Named instance.
A server can contain only max 50
number of Instances - in which only 1 instance can be the default instance,
rest all can be named instance, or call be all 50 named instances.
in one case we can keep all 50
instances as named instances in a server, else we can have 49 named instance
and 1 default instances.
Note:
- For SQL Server 7.0 we can have 1 instance per sever (No Named instances)
- For SQL Server 2000 we can have 16 Instances per server
- For SQL Server 2008 We can have 50 Instance per server
SQL Server Services
There are different services provided by MS-SQL server, These different SQL Server services are also called as SQL Server components they are- SQL server Engine Services.
- SQL server Agent.
- SQL server full text demon launcher.
- SQL server browser.
- SQL server Integration Services
- SQL server Reporting Services.
- SQL server Analysis Services.
- SQL server ADH: Integration of SQL with AD on SQL server 2000(Not shown in configuration manager).
- SQL server writer: Added functionality to backup and restore VSS (Not Shown in configuration manager).
- Instance Aware services.
- Instance Unaware services
- SQL server Engine Services
- SQL server Agent.
- SQL server full text demon launcher.
- SQL server Reporting Services.
- SQL server Analysis Services.
- SQL server Browser.
- SQL server Integration Services.
- SQL server ADH.
- SQL server writer.
Protocols Ports & Service Accounts
- Shared Memory: We use this when server and client are on the same machine
- Named pipes: We use this when server and client are on same LAN
- TCP/IP: We Use this when server and client are on different networks, uses WAN.
- VIA: Virtual interface Adapter.
- TDS:
- Static port: Will be same always, default is 1433
- Dynamic port: Will be changing whenever services are restarted.
Service accounts used to run the SQL Server Services are
- NT Service\MSSQL$instance_name for Engine Service
- NT Service\SQLAgent$ instance_name for Agent Service
- NT Service\MSSQLFDLauncher$ instance_name for full text demon launcher
- NT Service\ReportServer$ instance_name for reporting services
- SQLServerMSASUser$Server_name$ instance_name for Analysis services
- NT AUTHORITY\LOCALSERVICE for SQL Server browser
- NT Service\MsDtsServer130 for integration services
- NT Service\SQLWriter for SQL Server writer service.
Note: NT Service means Network Service
"Once after instance is installed and connection to instance is successful, we see some by-default databases in instance which are called system databases, and per requirement the user defined databases to load data to use it as requirement"
Patching
What are Hotfixes/CU’s/SP’s?
- Hotfixes: Hotfix is a solution to a Bug, these are released whenever a bug is found, and need to be fixed.
- CU (Cumulative Update): Collection of all Hotfixes released till date and any more bugs to be fixed are released in this, usually these are released quarterly.
- SP (Service pack): Any additional features to current versions are released in this release and also all the previous Hotfixes and CU features are present here in this update. Usually these are released half yearly.
Steps to follow when patching an instance:
- Login to server with Service Account or admin account.
- Copy the patch file to the server.
- Take System Db Backup. (Used to recovery instance if anything goes wrong)
- Check the version before patch (as well as 32/64 bit and how many instances, HA) and check the space in C - Drive (Min 5 GB should be there)
- If in HA, then the instance should be a secondary instance
- Apply the patch
- Reboot the server.
- Check the version post patching (Reboot/service/Recovery/version)
- Remove the patch file from server.
Migration and Upgradation
Migration: The process of moving data from one database to other databases in same SQL or from oracle to SQL or from one instance to another instance.
Upgradation: Upgradation can be done as version upgradation, edition upgradation.
There are two types of Upgradations they are:
- In place Migration/In place Upgradation
- Side by Side Migration/Side by Side Upgradation
In place: Taking the action (Migration/upgradation) on the same instance which is already installed. Simply said Replacing the existing instance.
Side by Side: Create a new server and install a new instance with the new upgraded properties, so that the old instance will be running as usual whenever the new instance is upgraded then the connection will be sifted to this new one. And later the old is decommissioned once the new instance is perfect.
Pre-Migration:
- Gathering the data and planning for migration.
- Checking new server specifications.
- Running upgrade advisor or Migration Tool.
- And also follow the recommendations of advisor or migration.
Migration:
- Installation of SQL server if Side by Side migration.
- Backups and restore/Attach and detach/CDW the databases.
- Move Logins, Jobs, Maintenance plans, and linked servers (if any)
Post-Migration:
- Compatibility changes, and any server configuration changes.
- Fix Orphan users if any.
Comments
Post a Comment