Monday, 18 May 2020

SQL Server DBA Interview Questions and Answers-Data File and Transaction Log File Architecture

Hi friend posted questions related to SQL SERVER Data File and Transaction Log File Architecture.

1) Explain the SQL Server Database Data File structure?


SQL server divides the data file into 8 KB pages and page is the smallest unit of any IO operation. SQL server refer the first page in the data file as page number 0.In all the data file first 9  pages (till page number 8) are in same order as shown below. In the primary data file, the 10th page (Page number 9) will be the boot page which stores the metadata about the database.

2) What is a Data Page?
Data rows with all data, except text, ntext, image, nvarchar(max), varchar(max), varbinary(max), and xml data.

3) What is an Index Page?
Contains information related to Indexes. This holds index records in the upper levels of a clustered index and all levels of non-clustered indexes.

4) What is a Page Header?
Page number 0- the file header (page type 15). It holds the file header information. There will be only one header page for each data file and that reside in the 0th position. The header page store the file level information like file size, minimum size, max size and file growth.

5) What is PFS?
PFS page is the second page (Page Number 1) in the data file followed by file header (Page Number 0). PFS pages are used to track page level allocation. PFS page repeat after every 8088 pages

6) What is a GAM Page?
GAM pages records what extents have been allocated for any use. GAM has bit for every extent. If the bit is 1, the corresponding extent is free, if the bit is 0, the corresponding extent is in use as uniform or mixed extent.

7) How many GAM pages will be there in a 7GB data file?
A GAM page can hold information of around 64000 extents. That is, a GAM page can hold information of (64000X8X8)/1024 = 4000 MB approximately. In short, a data file of size 7 GB will have two GAM pages.

8) What is SGAM page?
SGAM (Shared Global Allocation Map) page (Page type 8). SGAM pages record what extents are currently being used as mixed extent and also have at least one unused page. SGAM has bit for every extent. If the bit is 1, the corresponding extent is used as a mixed extent and has at least one page free to allocate. If the bit is 0, the extent is either not used as a mixed extent or it is mixed extent and with all its pages being used.

9) How many SGAM pages will be there in a 7GB data file?
A SGAM page can hold information of 64000 extents. That is, a SGAM page can hold information of (64000X8X8)/1024 = 4000 MB. In short, a data file of size 7 GB will have two SGAM page.

10) What is a DCM and its significance?
SQL Server uses DCM pages to track extent modified after the last full backup operation. DCM pages track the extents modified after the full backup.DCM has a bit for every extent it tracks. If the bit is 1, the corresponding extent is modified after the last full backup, if the bit is 0, there is no change in the corresponding extent after the last full backup

11) How SQL Server engine will decide which extents need to be added into a differential backup?
A differential backup process scans through DCP page to identify the extents which are modified after the last full backup and add those extents in the Differential backup.

12) What is a BCM and its significance?
This tracks the extents that have been modified by bulk logged operations since the last BACKUP LOG statement. If the bit for an extent is 1, the extent has been modified by a bulk logged operation after the last BACKUP LOG statement. If the bit is 0, the extent has not been modified by bulk logged operations.

Although BCM pages appear in all databases, they are only relevant when the database is using the bulk-logged recovery model. In this recovery model, when a BACKUP LOG is performed, the backup process scans the BCMs for extents that have been modified. It then includes those extents in the log backup.

13) What is Boot Page?
There is one special data page that exists only once per database. It is the database boot page. The database boot page is always stored in page 9 of file 1, the first file in the primary file group.

The database boot page contains a broad variety of data about the database itself. Here you can find the internal database version, the compatibility level, the database name and the date of the last log backup.

14) How many types of Allocation units are there?
There are three types of allocation units.

IN_ROW_DATA (default): If a table is relatively simple in design (meaning record size is less than 8000 and no LOB data types are present), all records are stored in a pages refereed as IN_ROW_DATA pages.

ROW_OVERFLOW_DATA: assume that a table is created with record size 12000 bytes having 4 varchar data types of size 4000 bytes. Whenever user inserts a record with size greater than 8000 (page size is 8K), then the excess data is moved to ROW_OVERFLOW_DATA pages. In simple terms, ROW_OVERFLOW_DATA pages will come in  to picture only when the row size exceed page maximum limit.

LOB_DATA: LOB data like text not stored along with data pages. LOB data is stored in pecial pages called LOB_DATA pages. 16 byte pointer in data page will be used to refer LOB_DATA page.

15) What is an IAM page?
IAM stands for Index Allocation Map: To catalog all the pages that belong to a single allocation unit, SQL Server utilizes a special type of pages, the Index Allocation Map or IAM pages. Each allocation unit has at least one IAM Page; depending on the size of the table there might be many. The page type of an IAM page is 10.

16) What is a ROW OFFSET and its importance?
Page header stored system information about the page. After the page header data row is stored serially. Row offset information is stored at the end of the page, after the data rows. Every data row has a row offset. Row offset stores information about how far the row is from the start of the page.

17) What are LOB pages?
SQL Server stores all data in 8192-byte sized blocks called pages. Several types of pages are in use within a typical database. One particularly interesting group is formed by the type-3 pages or Large Object Pages.

LOB_DATA Allocation Units
Most data types in SQL Server take up no more than 8000 bytes of storage. However, there are a few data types, which allow for larger pieces of information to be stored. Examples include the VARCHAR(MAX), VARBINARY(MAX) or XML data types.

Normal data pages that belong to a table are grouped in IN_ROW_DATA allocation units. However, if a value that is larger than 8000 bytes needs to be stored, SQL Server does not attempt to store it in those data pages anymore. It does not even store those values in the same allocation unit. Instead, Large Object data or LOB data is stored in special LOB_DATA allocation units.

18) What is a PAGE SPLIT?
Page splits are performed when there is no space in a data page to accommodate more inserts or updates. In a page spilt, SQL server removes some data from the current data page and moves it to another data page. This is done in order to make space for the new rows.

19) How Page Splits impacts the database performance?
Too many page splits can decrease the performance of the SQL server because of the large number of I/O operations.
Following remedies can be taken to avoid too many page splits:-

  • Rebuild indexes frequently to empty the fill factor space for more data.
  • Increased the Fill factor value after observing the page split behavior

20) How can we monitor or detect Page Splits?
Number of page splits can be observed by using the Performance Monitor and watch the SQLServer:Access Methods:Page Splits/sec counter

21) What is a Fill Factor?
The fill-factor option is provided for fine-tuning index data storage and performance. When an index is created or rebuilt, the fill-factor value determines the percentage of space on each leaf-level page to be filled with data, reserving the remainder on each page as free space for future growth. For example, specifying a fill-factor value of 80 means that 20 percent of each leaf-level page will be left empty, providing space for index expansion as data is added to the underlying table. The empty space is reserved between the index rows rather than at the end of the index.

22) What is a Logical Read?
Logical Reads:
Logical read indicates total number of data pages that are found in the data cache and read from Data cache without reading anything from Disk.

23) What is a Physical read?
Physical Reads
Physical read indicates total number of data pages that are read from disk. In case no data in data cache, the physical read will be equal to number of logical read. And usually it happens for first query request. And for subsequent same query request the number will be substantially decreased because the data pages have been in data cache.

24) How can we view the content of a page?
To see the row data stored in that page , we have to use the DBCC PAGE command. The syntax of DBCC PAGE

dbcc page ( {'dbname' | dbid}, filenum, pagenum [, printopt={0|1|2|3} ]);

Print opt:
0 – print just the page header
1 – page header plus per-row hex dumps and a dump of the page slot array
2 – page header plus whole page hex dump
3 – page header plus detailed per-row interpretation

 DBCC TRACEON(3604)GO
 DBCC page('test',1,114,3)


25) What is a Transaction log file?
A transaction log is a physical file in which SQL server stores the details of all transactions and data modifications performed on the database.  In the event of disaster, that causes SQL server to shutdown unexpectedly (Power failure/hardware failure), the transaction log is used to bring the database in a consistent state while restarting the server. On restarting the server, database goes through the recovery process.

During this recovery process, the transaction log is used to make sure that all committed transactions are written to respective data file (rolled forward) and rollback the uncommitted transaction.

Logically transaction log is a set of log records. Each record is identified by a log sequence number (LSN). The new log records are always written at the logical end of log file with a LSN which is greater than the previous one

26) What are Virtual Log files? How these are created?
SQL Server Database Engine divides each physical log file internally into a number of virtual log files. Virtual log files have no fixed size, and there is no fixed number of virtual log files for a physical log file. The Database Engine chooses the size of the virtual log files dynamically while it is creating or extending log files. The Database Engine tries to maintain a small number of virtual files. The size of the virtual files after a log file has been extended is the sum of the size of the existing log and the size of the new file increment. The size or number of virtual log files cannot be configured or set by administrators.

27) How VLFs are created SQL Server in a Transaction log file?
SQL server decides the size and number of VLF in a log file based on the size of the log file growth as given below.

Growth upto 64 MB        = 4 VLF
From 64 MB to 1 GB      = 8 VLF
Larger than 1 GB           = 16 VLF

28) What is the way to check Virtual Log file details?
DBCC loginfo(‘mydb’)

29) What is Log Sequence No?
Every record in the SQL Server transaction log is uniquely identified by a log sequence number (LSN). LSNs are ordered such that if LSN2 is greater than LSN1, the change described by the log record referred to by LSN2 occurred after the change described by the log record LSN.

30) What is a Log Truncation?
Log truncation is essential to keep the log from filling. Log truncation deletes inactive virtual log files from the logical transaction log of a SQL Server database, freeing space in the logical log for reuse by the physical transaction log. If a transaction log were never truncated, it would eventually fill all the disk space that is allocated to its physical log files. 

However, before the log can be truncated, a checkpoint operation must occur. A checkpoint writes the current in-memory modified pages (known as dirty pages) and transaction log information from memory to disk. When the checkpoint is performed, the inactive portion of the transaction log is marked as reusable. Thereafter, the inactive portion can be freed by log truncation.

31) How Does Log Truncation occurs?
Log truncation occurs automatically after the following events, except when delayed for some reason:
  • Under the simple recovery model, after a checkpoint.
  • Under the full recovery model or bulk-logged recovery model, after a log backup, if a checkpoint has occurred since the previous backup.

Wednesday, 13 May 2020

SQL Server DBA Interview Questions and Answers – SQL Server Services

Hi friend posted questions related to SQL SERVER  services in this section I have mentioned all services.


1) List out various services which are important for SQL Server and its 
components functionality?
  • SQL Server Service
  • SQL Server Agent service
  • SQL Server Analysis Service
  • SQL Server Browser service
  • SQL Server Integration Service
  • SQL Server Reporting Service
  • SQL Server VSS Writer service
  • Distributed Transaction Coordinator
  • SQL Server Active Directory Helper
  • SQL Full-Text Filter Daemon Launcher
  • SQL Server Distributed Replay Client service
  • SQL Server Distributed Replay Client service

2) What is SQL Server service and its importance?
SQL Server service is core of SQL Server instance. It runs the Database Engine and 
executes the client requests related to data processing. If this service is not 
running, no users can connect to the any of the database, hence users will not be 
able to fetch, insert, update or delete the data.

3) What is SQL Server Agent service and its importance?
SQL Server Agent is the primary scheduling engine in SQL Server. This is used to 
execute scheduled administrative tasks like SSIS Packages, T-SQL Scripts, Batch 
Files and Subscriptions etc. which are referred to as Jobs. It uses msdb database 
to store the configuration, processing, and metadata information. Apart from SQL Server Agent related information, msdb database also stores similar information 
related to Backup, Restore, Log Shipping, SSIS Packages etc.

4) What is SQL Server Analysis service and its importance?
Microsoft SQL Server Analysis Services (SSAS) delivers online analytical 
processing (OLAP) and data mining functionality for business intelligence 
applications. Analysis Services supports OLAP by letting you design, create, and 
manage multidimensional structures that contain data aggregated from other 
data sources, such as relational databases. For data mining applications, Analysis 
Services lets you design, create, and visualize data mining models that are 
constructed from other data sources by using a wide variety of industry-standard 
data mining algorithms.

5) What is SQL Server Integration service and its importance?
SQL Server Integration Services (SSIS) is a component of the Microsoft SQL Server 
database software that can be used to perform a broad range of data migration 
tasks. SSIS is a platform for data integration and workflow applications. It features 
a fast and flexible data warehousing tool used for data extraction, transformation, 
and loading (ETL). The tool may also be used to automate maintenance of SQL 
Server databases and updates to multidimensional cube data.

6) What is SQL Server Browser?
This service acts as a listener for the incoming requests for Microsoft SQL Server 
resources. It provides information about the list of installed SQL Server instances on the computer to the client computers/applications. It helps in browsing the list 
of servers, locating and connecting to the correct server.
This listener service responds to client requests with the names of the installed 
instances, and the ports or named pipes used by the instance.

7) What is SQL Server Reporting Services?
This service is primarily used by SQL Server Reporting Services (SSRS) for 
browsing and viewing the reports on Reports Server, through Report Server or 
Report Manager interface. It is used to manage the shared data sources, reports, 
shared data sets, report parts, folder, etc. hosted on the Report Server. Reporting 
services are managed using the Reporting Services Configuration Manager.

8) What is SQL Server VSS Writer?
The SQL Writer Service provides added functionality for backup and restore of 
SQL Server through the Volume Shadow Copy Service framework. When running, 
Database Engine locks and has exclusive access to the data files. When the SQL 
Writer Service is not running, backup programs running in Windows do not have 
access to the data files, and backups must be performed using SQL Server 
backup.

Use the SQL Writer Service to permit Windows backup programs to copy SQL 
Server data files while SQL Server is running. It must be running when the Volume 
Shadow Copy Service (VSS) application requests a backup or restore. To 
configure the service, use the Microsoft Windows Services applet. The SQL Writer 
Service installs on all operating systems.

9) Which types of backups are supported by SQL Write Service?
SQL Writer supports:
  • Full database backup and restore including full-text catalogs
  • Differential backup and restore
  • Restore with move
  • Copy-only backup
  • Auto-recovery of database snapshot
10) Which types of backups are not supported by SQL Write Service?
SQL Writer does not support:
  • Log backups
  • File and filegroup backup
  • Page restore
11) What is Full-Text Search service?
This service is used by the full-text search feature of SQL Server. It helps in 
starting the filter daemon host process, which manages the full-text indexing, 
querying, search filtering and word processing as part of the full-text search 
feature.

12) What is SQL Server Active Directory Helper?
This service enables the integration with the Active Directory. Irrespective of 
number of instances of SQL Servers installed on a computer, there is always only 
one instance of SQL Server Active Directory Helper service. This service is 
automatically started by SQL Server when required and is stopped once the 
operation is completed. This service is required whenever an SQL Server object 
needs to be created in the Active Directory to register an instance of SQL Server.

13) What is Distributed Transaction Coordinator?
This service coordinates distributed transactions between two or more database 
servers. Client applications use this service to work with data from multiple 
sources in one transaction. There is always only one instance of MSDTC service 
running on a computer irrespective of how many SQL server instances are 
installed. This service should be running on each of the servers which handle 
distributed transactions. This service is not a part of SQL Server installation. This 
service is installed with Windows OS installation.

14) How to check how many SQL Server instances are installed on a Window 
Server?
There are multiple ways through which we can check the No. of SQL Server 
instances which are running on a server like:
  • Check the SQL services for different Instances
  • SQL Server Configuration Manager Start- all programs – Microsoft SQL Server 
  • 2008 R2 -> configuration tools –> Microsoft SQL Server configuration 
  • Manager
  • List out SQL Services from Net Start command
  • Using Powershell commands
  • Readging the Registry Keys, Regedit-> HKEY_LOCAL_MACHINE–>SOFTWARE ->Microsoft ->Microsoft SQL Server –> InstalledInstance
15) What are the different ways to start and Stop SQL Server services?
There are different ways through which we can start or stop SQL Server services.

a) Go to Services –> Look for SQL server service related to the Instance
Named Instance: SQL Server(Instance Name)
Default Instance: SQL Server(MSSQLServer)

b) Right Click on the SQL Server instance in management studio and click on 
restart

c) Go to SQL Server Configuration Mananger (SQLServermanager10.msc) and 
right click on the services and click restart.

d) Net stop command
e) use “Net START” command to list all the running services

f) Use “Net STOP MSSQL$Instancename” to stop the SQL Service for a particular 
instance

17) What are the default parameters of SQL Server service start up process 
and from where these parameters can be changed?
master database data and log file and error log files are the default parameters 
which are passed to SQL Server service.
-dC:\Program Files\Microsoft SQL 
Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf;
-eC:\Program Files\Microsoft SQL
Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG;
-lC:\Program Files\Microsoft SQL
Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
We can add trace flags and other parameters to the startup process from SQL 
Server Configuration manager.

18) How to start the SQL Server with minimal configuration?
If there are any configuration problems that prevent the server from starting, you 
can start an instance of Microsoft SQL Server by using the minimal configuration 
startup option. This is the startup option -f. Starting an instance of SQL Server 
with minimal configuration automatically puts the server in single-user mode.

19) How to start SQL Server with single user model?
Under certain circumstances, we may have to start an instance of SQL Server in 
single-user mode by using the startup option -m. For example, you may want to 
change server configuration options or recover a damaged master database or 
other system database. Both actions require starting an instance of SQL Server in 
single-user mode.

20) What are trace flags and how can we apply trace flags on a SQL Server 
instance?
Trace flags are used to temporarily set specific server characteristics or to switch 
off a particular behavior.

For example, if trace flag 3205 is set when an instance of 

SQL Server starts, hardware compression for tape drivers is disabled. Trace flags 
are frequently used to diagnose performance issues or to debug stored 
procedures or complex computer systems.

21) How the trace flags are enabled?
Trace flags are enabled at different levels.
  • Global
  • Session
Instance level
We can use the -T option in the startup configuration for the SQL Server Service 
to enable trace at instance level.

Session Level
We can use the DBCC TRACEON and DBCC TRACEOFF commands to enable it on 
a session level.

22) How do I know what Trace Flags are turned on at the moment?
We can use the DBCC TRACESTATUS command

23) Name some of the Important Trace flags and their functionality?
Trace Flag: 1204

This trace flag lets SQL Server to log detailed deadlock information to SQL Server Error Log in text format. In SQL Server 2008, this trace flag is only available at the 
Global Level (i.e. applies to the SQL Server instance). In my experience, it is worth 
turning this trace flag on, only for debugging purposes.

Trace Flag: 1222
Similar to trace flag 1204, this trace flag lets SQL Server to log detailed deadlock 
information to SQL Server Error Log in XML format.

Trace Flag: 3226
In an environment where database backup is frequently performed, it is a good 
idea to turn trace flag 3226 on, to suppress an entry to the SQL Server Error Log 
for each backup. This is beneficial as the bigger the log, the harder it is to find 
other messages. However, you will need to ensure that none of your scripts or 
systems rely on the backup entry detail on the SQL Server Error Log.

24) What are the mandatory databases to bring SQL Services up?
master, model, resource db, tempdb location.

25) Which system database is associated with SQL Server agent service?
msdb

26) What is Protocol is used by SQL Server Browser service?
SQL Server Browser service uses UDP protocol.

27) Which Port no. is used by SQL Server Browser service ?
1434

28) What will happen if SQL Server Browser service is stopped?
If the SQL Server Browser service is not running, the following connections do not 
work:

  • If we have just one instance installed on machine and it is running on default port 1433, then status of SQL Server Browser service does not make any difference in our connection parameters.
  • If there are more than one instances running on the same machine, in that case either we have to start SQL Server Browser service or provide the port number along with IP (or server name) and instance name, to access any other instance than default
  • If SQL Server Browser service is stopped and IP along with port number is not provided then connection will be refused.
  • If SQL Server instance is configured using dynamic ports then browser service is required to connect to correct port number.
  • Also our named instances will not be published in the list of SQL Server instances on the network (which could be a good thing)


29) What is the high Level SQL Server start up process?

  • The service is authenticated by verifying the credentials provided in the logon account and the service is started.
  • PID is allocated at windows level
  • Authentication mode details are verified i.e either MIXED or WINDOWS
  • Information of the startup parameters is captured i.e mdf location of master database, SQL Server error log location and ldf file location
  • Some memory and CPU settings done at windows level, this is an informational message only
  • Starts the master database
  • model is the next database to start
  • set the port related information
  • Tempdb is recreated each time when we restart sql server
  • Start msdb and other user databases based on dbid
30) What is Distributed Replay?
Distributed Replay is a new functionality of Microsoft SQL Server 2012. It helps 
you assess the impact of future upgrades (SQL Server, hardware, OS) or SQL 
Server tunings by replaying a trace captured from a productive SQL Server 
environment to a new SQL Server test environment.

This new functionality is similar to SQL Server Profiler, but with more possibilities: 
e. g. replaying the trace from multiple clients (up to sixteen), use a stress or
synchronization mode, configure options like think time, or connect time etc.

31) What are the various components involved in Distributed Replay 
Concepts?
The following components make up the Distributed Replay environment:

Distributed Replay administration tool: A console application, DReplay.exe, 
used to communicate with the distributed replay controller. Use the 
administration tool to control the distributed replay.

Distributed Replay controller: A computer running the Windows service named 
SQL Server Distributed Replay controller. The Distributed Replay controller 
orchestrates the actions of the distributed replay clients. There can only be one 
controller instance in each Distributed Replay environment.

Distributed Replay clients: One or more computers (physical or virtual) running 
the Windows service named SQL Server Distributed Replay client. The Distributed 
Replay clients work together to simulate workloads against an instance of SQL 
Server. There can be one or more clients in each Distributed Replay environment.

Target server: An instance of SQL Server that the Distributed Replay clients can 
use to replay trace data. We recommend that the target server be located in a 
test environment.



Saturday, 9 May 2020

SQL Server DBA Interview Questions and Answers-MS SQL Installation



Hi friend

I posted SQL server installation related question and answer for interview.

SQL Server DBA Interview Questions and Answers-MS SQL Installation







Q1. What are the various Editions available in SQL Server 2012 version?
Below are the various editions available in Microsoft SQL Server 2012


  • SQL Server 2012 Standard Edition
  • SQL Server 2012 Enterprise Edition
  • SQL Server 2012 Business Edition
  • SQL Server 2012 Express Editions
  • SQL Server 2012 Web and Developer Editions

Q2. What are the major differences between paid editions – Standard,
Enterprise and Business Editions in SQL Server 2012?


SQL Server 2012 Capabilities Enterprise Business Intelligence Standard
Maximum No. of Cores OS Max* 16 Cores for DB –
OS Max for BI
16 Core
Basic Reporting & Analytics Yes Yes Yes
Enterprise data Management (Data Quality Services, Master Data Services) Yes Yes No
Self-Service Business Intelligence (Power View, PowerPivot for SPS) Yes Yes No
Corporate Business Intelligence (Semantic model, advanced analytics) Yes Yes No
Advanced Security (Advanced auditing, transparent data encryption) Yes No No
Data Warehousing (ColumnStore, compression, partitioning) Yes No No
High Availability (Always ON) Advanced Basic Basic
Maximum memory utilized (per instance of SQL Server Database Engine) OS max 64 GB 64 GB
Server Core support Yes Yes Yes
Backup compression Yes Yes Yes
Database snapshot Yes No No
Online indexing Yes No No
Data compression Yes No No
Resource Governor Yes No No


Q3. What are the minimum Software requirements to install SQL Server
2012?


  • Internet Explorer 7 or a later version is required for Microsoft Management Console (MMC), SQL Server Data Tools (SSDT), the Report Designer component of Reporting Services, and HTML Help
  • SQL Server 2012 does not install or enable Windows PowerShell 2.0; however Windows PowerShell 2.0 is an installation prerequisite for Database Engine components and SQL Server Management Studio.
  • NET 3.5 SP1 is a requirement for SQL Server 2012 when you select Database Engine, Reporting Services, Replication, Master Data Services, Data Quality Services, or SQL Server Management Studio, and it is no longer installed by SQL Server Setup.
  • Dot NET 4.0 is a requirement for SQL Server 2012. SQL Server installs .NET 4.0 during the feature installation step.  SQL Server Express does not install .NET 4.0 when installing on the Windows 2008 R2 SP1 Server core operating system. You must install .NET4.0 before you install SQL Server Express on a Windows 2008 R2 SP1 Server core operating system.


SQL Server Setup installs the following software components required by the product:
  • Dot NET Framework 4 1
  • SQL Server Native Client
  • SQL Server Setup support files

Q4. What are the minimum Hardware requirements to install SQL Server
2012 Paid editions?
   
SQL Server EditionsMemory(RAM) CPU
SQL Server 2012 Enterprise (64-bit) x64 1GB 1.4 GHz AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support, Intel Pentium IV with EM64T support
SQL Server 2012 Business Intelligence (64-bit) x64 1GB 1.4GHz AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support, Intel Pentium IV with EM64T support
SQL Server 2012 Standard (64-bit) 1GB 1.4GHz AMD Opteron, AMD Athlon 64, Intel Xeon with Intel EM64T support, Intel Pentium IV with EM64T support
SQL Server 2012 Enterprise (32-bit) 1GB 1GHz Pentium III-compatible processor or faster
SQL Server 2012 Business Intelligence (32-bit) 1GB 1GHz Pentium III-compatible processor or faster
SQL Server 2012 Standard (32-bit) 1GB 1GHz Pentium III-compatible processor or faster


Q5. Where will you find the SQL Server installation related logs?
Installation related logs are stored under the shared feature directory folder which was selected at the time of first SQL Server instance installation.  e.g. If Shared Features were selected to  be placed on the “C:\Program Files\Microsoft SQL Server” then logs will be created under
 %PROGRAMFILES%\MICROSOFT SQL SERVER\110\SETUP BOOTSTRAP\LOG\<YYYYMMDD_HHMM>\
C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20190910_222838 

Q6. What is “ConfigurationFile.ini” file?
SQL Server Setup generates a configuration file named ConfigurationFile.ini, based upon the system default and run-time inputs. The ConfigurationFile.ini file is a text file which contains the set of parameters in name/value pairs along with descriptive comments. Many of the parameter names correspond to the screens and options which you see while installing SQL Server through the wizard.  We can then use the configuration file to install SQL Server with the same configuration instead of going through each of the installation screens.

Q7. What is the location of ConfigurationFile.ini file?
We can find the configuration file in the C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log folder. There will a subfolder based on a timestamp of when the SQL Server 2012 installation was done.

Q8. What is a service account?
Based on the selected components while doing the installation we will find respective service to each component in the Windows Services. e.g. SQL Server, SQL Server Agent, SQL Analysis Services, SQL Server integration Services etc. There will be a user for each and every service through which each service will run. That use is called Service Account of that service.

Mainly we categorize the Service account as below:
Local User Account: This user account is created in the server where SQL Server is installed; this account does not have access to network resources.
Local Service Account: This is a builtin windows account that is available for configuring services in windows. This account has permissions as same as accounts that are in the users group, thus it has limited access to the resources in the server.
Local System Account: This is a builtin windows account that is available for configuring services in windows. This is a highly privileged account that has access to all resources in the server with administrator rights.
Network Service Account: This is a builtin windows account that is available for configuring services in windows. This has permissions to access resources in the network under the computer account.
Domain Account: This account is a part of our domain that has access to network resources for which it is intended to have permission. It is always advised to run SQL Server and related services under a domain account with minimum privilege need to run SQL Server and its related services.

Q9. Do we need to grant Administrator permissions on the Windows
server to SQL Service account to run the services or not, why?
No, it is not required. It’s not mandatory to grant Administrator permissions to the service account.

Q10. What permissions are required to install SQL Server on a server?
User through which we are installing SQL Server must have administrator permissions on the Windows server.

Q11. What are Shared Features Directory and its usages?
This directory contains the common files used by all instances on a single computer e.g. SSMS, sqlcmd, bcp, DTExec etc. These are installed in the folder <drive>:\Program Files\Microsoft SQL Server\110\ , where <drive> is the drive letter where components are installed. The default is usually drive C.

Q12. What is an Instance?
An instance of the Database Engine is a copy of the sqlservr.exe executable that runs as an operating system service. Each instance manages its own system databases and one or more user databases. An instance is a complete copy of an SQL Server installation.


Q13. Type of Instance and maximum no. of instances which can be
installed on a server
There are two types of Instances.
  • Default instance
  • Named Instance
Each computer can run maximum of 50 instances of the Database Engine.  One instance can be the default instance.
The default instance has no name. If a connection request specifies only the name of the computer, the connection is made to the default instance.
A named instance is one where you specify an instance name when installing the instance. A connection request must specify both the computer name and instance name in order to connect to the instance.

Q14. Can we install multiple instances on the same disk drive?
Yes, we can install multiple instances on the same disk drive because each installation creates its own folder with the below format.

MSSQL11.INSTANCENAME

Q15. What is a collation and what is the default collation?
Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.
DEFAULT COLLATION:  SQL_LATIN1_GENERAL_CP1_CI_AS
Q16. What is an RTM setup of SQL Server?
RTM stands for release to manufacturing.

Q17. What is a Service Pack, Patch, Hot fix and its difference?
Service Pack is abbreviated as SP, a service pack is a collection of updates and fixes, called patches, for an operating system or a software program. Many of these patches are often released before the larger service pack, but the service pack allows for an easy, single installation.
Patch – Publicly released update to fix a known bug/issue
Hotfix – update to fix a very specific issue, not always publicly released
Q18. What is the latest Service pack available for SQL Server 2012 in the market?
SQL Server 2012   Service Pack 2 (SP2)
Version: 11.0.5058.0
Release Date: 6/10/2014
Q19. What’s the practical approach of installing Service Pack?
Steps to install Service pack in Production environments:
  • First of all raise a change order and get the necessary approvals for the downtime window. Normally it takes around 45-60 minutes to install Service pack if there are no issues.
  • Once the downtime window is started, take a full backup of the user databases and system databases including the Resource database.
  • List down all the Startup parameters, Memory Usage, CPU Usage etc and save it in a separate file.
  • Install the service pack on SQL Servers.
  • Verify all the SQL Services are up and running as expected.
  • Validate the application functionality.

Note: There is a different approach to install Service pack on SQL Server cluster instances. That will be covered in SQL Server cluster.
Q20. Is it mandatory to restart the Windows server after installing SQL server service pack?
No, it’s not mandatory to restart Windows server after installing SQL Server service pack but it is always a good practice to do so.
Q21. How to check the SQL Server version and Service pack installed on the server?
select convert(varchar(50),SERVERPROPERTY('productversion')) ,
convert(varchar(50),SERVERPROPERTY ('productlevel')) ,
convert(varchar(50),SERVERPROPERTY ('edition'))
Or
select @@VERSION
Q22. How to check SQL Server name?
Select @@Servername


Q23. What is a slip stream installation and its usages?
SQL Server 2008 introduced a concept that’s called “Slipstream Installation”. This is a way to deploy a SQL Server instance with all the needed Service pack as part of the installation. Everything will be installed in one go, hence there is no need to deploy any other service packs on the installation.
Q24. What is a silent installation and how can we use this feature?
The procedure to install SQL Server instance through command line using ConfigurationFile.ini file in Quite mode is known as Silent installation.
Q25. What is the default port of a SQL Server instance?
SQL Server default instance by default listen on 1433 port.
Q26. Can we change the default port of SQL Server, How?
Yes, it is possible to change the Default port on which SQL Server is listening.
Step 1. Click Start > All Programs > Microsoft SQL Server 2012 > Configuration Tools >SQL Server Configuration Manager
Step 2. Go to SQL Server Configuration Manager > SQL Server Network Configuration >Protocols for <Instance Name>

Step 3. Right Click on TCP/IP and select Properties

Step 4. In TCP/IP Properties dialog box, go to IP Addresses tab and scroll down to IPAllgroup. Now change the value to static value which you want to set for SQL Server port.

Q27. How to get the port number where the SQL Server instance is listening?
Below are the methods using which we can get the port information.
Method 1: SQL Server Configuration Manager
Method 2: Windows Event Viewer
Method 3: SQL Server Error Logs
Method 4: sys.dm_exec_connections DMV
Method 5: Reading registry using xp_instance_regread


Q28. What is a Filestream?
FILESTREAM was introduced in SQL Server 2008 for the storage and management of unstructured data. The FILESTREAM feature allows storing BLOB data (example: word documents, image files, music and videos etc) in the NT file system and ensures transactional consistency between the unstructured data stored in the NT file system and the structured data stored in the table.
Q29. What’s the location of SQL Server log files?
SQL Server error logs are stored in the below location.
INSTANCE ROOT DIRECTORY\MSSQL\LOG
Q30. How many SQL Server log files can be retained in the SQL Server error logs by default?
By default, there are seven SQL Server error logs; Errorlog and Errorlog.1 through Errorlog.6. The name of the current, most recent log is Errorlog with no extension. The log is re-created every time that you restart SQL Server. When the Error log file is re-created, the previous log is renamed to Errorlog.1, and the next previous log (Errorlog.1) is renamed to Errorlog.2, and so on. Errorlog.6 is deleted.
Q31. Is it possible to increase the retention of Error log files and How?
Yes it is possible to change the no. of Error logs retention. We can follow the below steps to change the Error log file retention.

  • Open SQL Server Management Studio and then connect to SQL Server Instance
  • InObject Explorer, ExpandManagement Node and then right click SQL Server Logs and click Configure as shown in the snippet below.
  • In Configure SQL Server Error Logs window you can enter the value between 6 and 99 for the number of error logs and click OK to save the changes