TopicwiseSQLDBA Interview Questions.docx

download TopicwiseSQLDBA Interview Questions.docx

of 65

Transcript of TopicwiseSQLDBA Interview Questions.docx

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    1/65

    1

    schttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.html

    SQL SERVER DBA

    TOPIC WISE FAQs

    SQL SERVER1) What is SQL Server?

    Microsoft SQL Server 2005 is a database platform for large-scale online transaction processing (OLTP),data warehousing, and e-commerce applications; it is also a business intelligence platform for dataintegration, analysis, and reporting solutions.

    2) What is the Versions Available in SQL Server?

    SQL Server was developed by Microsoft in 1987 and the versions are 6.0, 6.5, 7.0, 8.0(2000), 9.0(2005),10(2008), 10.5(2008R2), 11(2012).

    3) What is the Difference between SQL Server 2000 and 2005?

    SQL Server-2000 SQL Server-2005

    T-SQL T-SQL as well as CLR

    Enterprise manager SSMS

    Query Analyzer Query editor

    DTS

    SSIS

    No Reporting Tools SSRS

    No Exception handling in DTS Exception handling in SSIS

    Can create up to 16 Instances Can create up to 50 instances

    No exception handling in DTS. Exception handling in SSIS.

    sa blank password. Enforce password policy.

    No database mirroring Database mirroring.

    Object oriented programming

    Common language runtime

    4) What are the Editions available for SQL Server 2005?

    There are 6 six editions available in SQL Server 2005

    a) Enterprise Editionb) Standard Edition

    http://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.htmlhttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.htmlhttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.htmlhttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.htmlhttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.htmlhttp://rajusqldba.blogspot.com/2013/06/sql-server-dba-topic-wise-faqs.html
  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    2/65

    2

    c) Developer edition

    d) Workgroup editione) Mobile edition

    f) Express edition

    5) What are the Tools are available in SQL Server 2000 and 2005?

    Sl 2000 2005

    1 Enterprise manager & Query Analyzer Management Studio

    2 Network Client Utilities Configuration manager

    3 SQL Profiler Profiler

    4 Service manager Surface area configuration

    5 Reporting Services Configuration

    6 Database Tuning Advisor

    7 Command Prompt Utilities

    6) What are Services available in SQL Server?There are three services available in SQL Server 2005.

    a) SQL server service:- It is responsible for running Databases, System Stored Procedures, SystemIndexes, User Login information and Passwords

    b) SQL server agent service:- It is responsible for running Jobs, Alerts, Notifying the operatorsc) Distributed Transaction Coordinator:- It is responsible for moving data among instances (One DB to

    another DB)

    7) How many ways to run services?Services are run by 5 ways they are

    1) At task pane > Right click on server and click start / stop2) Management Studio > Right click on Server and click start / stop / restart3) Surface Area Configuration4) Command Prompt > Net start/stop mssqlserver

    5) SQL Server configuration manager > Right click on server and click start / stop / restart.

    8) What is Windows Authentication?

    When Windows authentication is used to connect SQL Server, Microsoft Windows is completelyresponsible for authenticating the client by identifying its windows user account.

    9) What is SQL Server Authentication?When SQL Server authentication is used, SQL Server authenticates the client by comparing user nameand password with user names and passwords maintained within SQL Server.

    10)What is the difference between Windows Authentication and SQL Server authentication?1) Windows authentication is highly secure than SQL Server authentication why because we need not

    provide any login details. So the chance of tracing login details from code by the unauthorized personswill be less. Windows authentication uses the default windows login credentials.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    3/65

    3

    2) Windows authentication will uses the credentials of the currently logged user to login in to the SQL Server

    database. Your application need not to supply the user name and password.3) For SQL Server authentication we have to supply the SQL database user name and password. That will be

    used to get the privileges and right of the user.

    11)What is AWE? How configure Dynamic Memory Allocation?

    Generally SQL Server reserves only a small portion of memory. Sometimes reserved memory is notsufficient to SQL server and required additional memory. AWE is used to support very large amounts ofphysical memory. When AWE is enabled the operating system dynamically allocates memory to SQLServer based on the Min server memory and max server memory settings. (1) Win. Server 2003 SEsupports utpo 4GB (2) EE upto 32GB. (3) DC upto 64GB)

    To Configure AWE:- Right click on instance > Properties > Memory > Enable AWE > Set Min and Maxmemory etc.

    Note:- AWE is not needed and cannot be configured on 64-bit operating systems.

    12) What is Linked Server? How to connect Linked server? How to test linked Server?

    One server connected with another server to execute queries against OLE DB data sources on remoteservers.OLEDB Provider:- An OLE DB provideris a DLL that manages and interacts with a specific data sourcessuch as SQL Server 7.0, Access, Excel, ODBC, Oracle, DB2, Local file system, Exchange Server etc. SQLNative Client (PROGID: SQLNCLI) is the official OLE DB provider for SQL Server.

    To connect linked server using OLE DB provider:-sp_addlinkedserver @server=servername, @srvproduct=SQL Server/OracleTests the connection to a linked server:-

    sp_testlinkedserver

    13) What is purpose of Registered Servers?

    Registering a server to store the server connection information for future connections.

    14) What do you mean by Collation?

    Collation is basically the sort order. There are three types of sort orders

    (1) Dictionary case sensitive , (2) Dictionary case insensitive, (3) Binary

    15)What are the Protocols used in Networking? What is the Default Port number of TCP/IP?The protocols used in networking are TCP/IP, NAMED PIPPES, VIA, SHARED MEMORY. The default portno of TCP/IP is 1433.

    16)What is the Syntax used for find the SQL Server version?

    1) Select @@version

    2) Click on Server > Summary Reports> Server Dashboard > configuration details > See product version.

    17) What is blocking? How to identify and resolve the blockings?

    Blocking happens when one user holds an exclusive lock on an object and a second user requires anexclusive lock on the same object. This forces the second user to wait, block on the first.

    Determine Blocking sessions:- Activity Monitor, sp_who2, sp_lock, sys.sysprocess,sys.dm_exec_requests, sys.dm_os_waiting_tasks

    Resolve Blocking Session:- (1) Right click on session and Kill in Activity Monitor (2) Kill Session_id

    18) What is Deadlock?Adeadlock occurs when users try to place exclusive locks on each others objects.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    4/65

    4

    Ex:- User1 places an exclusive lock on Table1 and then tries to place an exclusive lock on Table2. User2

    already has an exclusive lock on table2, and User2 tries to put an exclusive lock on Table1. This conditioncauses endless loop of waiting for the locks to be released.

    The Database engine picks one of the victim (users) and kills their query and send a errormessage to users You are the victim of a deadlock and try again later.

    Deadlock Information Tools

    1) Trace Flags:- DBCC TRACEON (1204) & DBCC TRACEON (1222). When these trace flags is enabling, thedeadlock information captured by the SQL Server error log.

    2) Deadlock graph event in SQL Profiler:- SQL Server Profiler graphically representation of tasks andresources involved in a deadlock. (Lock:Deadlock and Lock:Deadlock chain events in the Locks events)

    3) System View:- We can find the blocking sessions by writing the following query

    Select session_id, status, blocking_session_id from sys.dm_exec_requestswhere blocking_session_id> 0

    Resolving Deadlock:- After find the session causing the problem we can use KILL command.

    > KILL process_id

    19) What are the Types of Locks? Explain each?

    There are 7 locks types are available in SQL Server 2005.a) Shared Lock:- Shared (S) locks allow concurrent transactions to read (SELECT) a resource under

    pessimistic concurrency control.b) Update Lock:- Used on resources that can be updated. Prevents a common form of deadlock that occurs

    when multiple sessions are reading, locking, and potentially updating resources later.

    c) Exclusive Lock:- Exclusive (X) locks prevent access to a resource by concurrent transactionsd) Intent Lock:- Used to establish a lock hierarchy. The types of intent locks are: intent shared (IS), intent

    exclusive (IX), and shared with intent exclusive (SIX).e) Schema:- Used when an operation dependent on the schema of a table is executing.

    f) Bulk Update:- Used when bulk copying data into a table and the TABLOCKhint is specifiedg) Key-Range:- Protects the range of rows read by a query when using the serializable transaction isolation

    level

    20)What are the Components can be installed with SQL Server 2005?

    We can install the following components with Microsoft SQL Server 2005a) SQL Server Database Engineb) Analysis Servicesc) Reporting Servicesd) Notification Servicese) Integration Servicesf) Management Toolsg) Documentation and Samples

    21)What are the SQL Server Editions of SQL Server 2005?SQL Server 2005 is available in 32-bit and 64-bit editions.

    a) SQL Server 2005 Enterprise Edition (32-bit and 64-bit)b) SQL Server 2005 Evaluation Edition (32-bit and 64-bit)

    c) SQL Server 2005 Standard Edition (32-bit and 64-bit)d) SQL Server 2005 Workgroup Edition (32-bit only)e) SQL Server 2005 Developer Edition (32-bit and 64-bit)

    f) SQL Server 2005 Express Edition (32-bit only)g) SQL Server 2005 Compact Edition (32-bit only)

    h) SQL Server 2005 Runtime Edition (32-bit and 64-bit)

    22)What is the process of Installation?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    5/65

    5

    a) Prepare Your Computer to Install SQL Server 2005:- To prepare your computer for SQL Server

    2005, review hardware and software requirements, System Configuration Checker requirements andblocking issues, and security considerations.

    b) Install SQL Server 2005:- To install SQL Server 2005, run Setup using the SQL Server 2005Installation Wizard or install from the command prompt. You can also add components to an instance ofSQL Server 2005, or upgrade to SQL Server 2005 from a previous SQL Server version.

    c) Configure Your SQL Server 2005 Installation:- After Setup completes the installation of SQL Server2005, you can configure SQL Server using graphical and command prompt utilities

    23)What is the Virtual Memory? How to assign virtual memory & how much space required forVirtual memory?

    A reserved disk space to maintain transactions whenever Memory (RAM) is full. Virtual memory size is atleast 3 times of the physical memory installed in the computer.

    To Set Virtual memory:- Right click on System > Select System Properties > Advanced > PerformanceSettings > Advanced > Virtual memory > Change > Select directory > Provide min and max values.

    DATABASE1) What is Database? What are the files created while creating a Database?

    A Database is a collection of meaningful and related data that are stored in row and columns format(Tables). While creating a Database in SQL Server there are two data files are created called master datafile (.mdf), log data file (.ldf) and we can add one or more optional N-Dimensional data files (.ndf).

    2) Explain about Data files (.mdf, .ndf, .ldf) (File structure)?

    a) Primary Data file (.ldf):- Primary data files holds user data and objects. Every database has oneprimary data file.

    b) Secondary Data file (.ndf):- Secondary Data file (.ndf) is optional and hold user data and objects that

    do not fit in the Primary data file. We can add N no. of Secondary data files for a DB.c) Log Data file (.ldf):- T.Log records all the transactions and database modifications made by each

    transaction and it is used to recover the database. At least one transaction log file required for each DB.Min. log file size is 512 KB.

    3) How store the data in SQL Server? What is Page and Page size? What is Extent and Extentsize?The fundamental unit of data storage in SQL server is the PAGE. The size of the page is 8 kb. Collection

    of eight contiguous pages is known as an EXTENT. The size of an extent is 64 kb (8x8).

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    6/65

    6

    4) What is Fill factor? How to assign Fill factor?A Fill factor is a reserved free space on each leaf level page which is used for future growth of data orindex in a table and reduces the page splits.

    Assign Fill Factor:- Right Click on Server > Properties > Database Settings > Default Index Fill Factor >Provide the value

    5) Tell me about System Database and User Databases in 2000 and 2005?SQL Server 2000:- 1) Master 2) Model 3) MSDB 4) TempDB

    SQL Server 2005:- 1) Master 2) Model 3) MSDB 4) TempDB 5) Resource DB

    6) Explain about System Databases in SQL Server 2005?

    There are five system databases available in SQL Server 2005.

    a) Master Database:- Records Server level objects such as Login Accounts, End Points, Linked Servers,System Configuration settings, location of the database files and initialization information for SQL server.SQL Server Cannot starts if Master DB is unavailable.

    b) Model Database:- The Model DB is used as a template for all databases created on instances of SQLServer. If we create a new Database the Model DB structure will be inherited to new Database.

    c) MSDB Database:- The msdb database is used by SQL Server Agent for scheduling alerts and jobs and

    by other features such as Service Broker and Database Mail. SQL Server automatically maintaincompleted online backup and restore history in MSDB.

    d) TempDB:- Temp DB is a global resource DB. It stores user objects (global or local temporary tables,

    stored procedures, table variables, or cursors), Internal objects (intermediate results for spools orsorting) and versions (online index operations, Multiple Active Result Sets (MARS), and AFTER triggers).

    We cannot backup the Temp DB because when SQL Server Start (or) Stop the Temp DB can be deletedpermanently (or) refresh Temp DB.

    e) Resource Database :- The Resource database is a hidden (read-only) database that contains all the

    system objects such as sys.objects that are included with SQL Server 2005. The Resource databasemakes upgrading process easier and faster.

    7) If Model and MSDB Database will crash what you will do? How to rebuild Master Database?

    We can re-create Model and MSDB databases by rebuild the Master Database.SQL Server 2000 (Rebuild MasterDB):- Start > Run > rebuildm.exe

    SQL Server 2005 (Rebuild MasterDB):- Start > Run > setup.exe8) How to move Model, MSDB, TempDB?a. Check the Path of TempDB through sp_HelpDB TempDBb. ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = 'E:\tempdb.mdf');

    c. Stop the Servicesd. Move the files to desired locatione. Restart the Services

    f. Check the Path of TempDB through sp_HelpDB TempDB

    9) How to move Master Database?

    a. Check the Path of Master DB through sp_HelpDB Masterb. Stop the Services

    c. Change the path at Startup parameters

    SQL Server Configuration manager > Services > Right click on Service > Properties > Advanced > Addnew_path at Startup parameters

    d. Move the files to desired locatione. Restart the Services

    f. Check the Path of Master DB through sp_HelpDB Master

    10)What are the Database States and explain them?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    7/65

    7

    The main database states are online, offline, restoring, recovering, resource pending, suspect and

    emergency.

    11)What is Database Snapshot? Give the Syntax?

    A Database snapshot is a read-only static view of the database. Snapshots must be located on the sameserver. Snapshots doesnt contain un-committed transactions at the time of snapshot was taken. It is

    very useful for report queries. (This option is available in 2005 EE edition)Ex:- CREATE DATABASE AdventureWorks_dbss1800 ON ( NAME = AdventureWorks_Data, FILENAME ='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ AdventureWorks_data_1800.ss') ASSNAPSHOT OF AdventureWorks;

    12)What is Transaction? What is Transaction (ACID) Properties?

    Transaction is a set of Logical unit of work and it contains one or more database operations. A validtransaction should be met (ACID) Atomicity, Consistency, Isolation, Durability properties.

    a)Atomicity:- A transaction must be an atomic unit of work, either all of it data modification are performed(or) none of them is performed.

    b) Consistency:- When completed a transaction must leave all data in consistent state. In a relationaldatabase, all rules must be applied to transactions modifications to maintain all data integrity. All internaldata structures, such as B-tree indexes (or) double linked lists must be correct at end of transaction.

    c) Isolation:- Modifications made by concurrent transactions must be isolated from the modifications made

    by the other consequent transactions. A transaction either sees a data in the state it was in beforeanother concurrent transaction modified it, (or) sees the data after second transaction completed.

    d) Durability:- After a transaction has completed, its effects are permanently in place in the system. Themodification persists even in the event of a system failure.

    13)What are Transaction Isolation levels?An Isolation level determines the degree of isolation of data between concurrent transactions. The default

    isolation level is Read committed.a) Read uncommittedb) Read committed

    c) Repeatable readd) Serializable

    14)What is purpose of LSN numbers?Every record in the transaction log is uniquely identified by a log sequence number (LSN). LSNs are usedinternally during a RESTORE sequence to track the point in time to which data has been restored.

    15)Explain about RAID and RAID levels?

    RAID stands for Redundant Array of Independent Disks. RAID is a disk system that contains arrays toprovide greater performance, reliability, storage capacity, and lower cost. Typically 0, 1, and 5 RAIDlevels are used in SQL Server.

    16)If a Database in Single User mode? How to change into Multi-user mode?

    Alter database set multi_user

    17) Minimal Mode and Single user mode?Minimal mode: - Start ->run -> command prompt > SQLSERVER.EXEf

    Single user mode: - Start ->run -> command prompt> SQLSERVER.EXEm

    18)Orphaned Users? How to find Orphaned Users and Resolve them?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    8/65

    8

    When a DB is move, attach & detach, restoring to different instance or corresponding login is dropped,

    the users of the Database becomes Orphaned users and they cant access the database because thedatabase users are not mapped to SID (Security Identifier) in the new instance.

    To detect Orphaned users:- sp_change_users_login 'Report'To Resolve Orphaned Users:-sp_change_users_login 'Update_One', 'db_user', 'login_name'

    19)What is Row size of a Database?Row size of a database is 8060 bytes.

    20)What is Heap table?A table without a clustered index is called as heap table.

    21)What is Check point?

    Check Point is a operations that synchronizes the physical data with the current state of the buffer cacheby writing out all modified data pages in buffer cache to disk.

    22)How many ways you can move the data or databases between servers and databases?SSIS, DTS, Attach& Detach, Bulk copy program, Bulk Insert & Import and Export wizard

    23)Syntax for find out the Database ID?Select db_id (db_name)

    24)Syntax for find out Logins? Current User?To find out logins: - select * from sys.syslogins

    To find out current user:- Select current_user

    25)Is it possible to take Backups and Restores of System Databases?

    Recovery Models1) What is Recovery Model? Benefits of Recovery Models?

    A recovery model is a Database property that control the basic behavior of the backup and restore

    operations for a DB. Recovery models are designed to control transaction log maintenance.

    2) Explain Full, Bulk-Logged & Simple Recovery Models?

    a) Full:- With Full Recovery Model we can recover the data up to the minute of crash, because it recordsevery operation in the transaction log.

    a) Bulk-Logged:- With Bulk-Logged recovery model we can recover most of the data, but we will lost bulk-operations because those are not recorded in to the log. We can set this option just before performing abulk insert operation to speed up the bulk insert.

    b) Simple:- With Simple Recovery Model we can recover the data only up to the last backup, becausenothing is recorded in the transactional log. Any changes made to database after the last backup wasperformed will be lost because they are not recorded in the transaction log. Generally it is useful for test

    and development databases or data warehouses, but it is not appropriate choice for Production Database.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    9/65

    9

    3) Which DBs can we use Simple Recovery Model?Simple Recovery Model is useful for Development, Test databases, Data warehouses or not oftenchanged Databases.

    4) In Which Recovery Models Point-in-time recovery is possible?

    Point-in-Time Recovery is Possible only in Full and Bulk-Logged Recovery Models. But in Bulk-LoggedRecovery model Point-in-time recovery is may or may not possible.

    5) In System DBs what are the default Recovery Models used?

    Master - SimpleModel - Full

    MSDB - Simple

    TempDB - Simple

    6) Why in Simple Recovery model we cant take T.Log backups?

    In Simple Recovery Model the Transaction Logs are truncated.

    7) Can we take Diff. backup in Simple recovery Model?We can take Differential backup in Simple recovery model because it belongs to .mdf

    Backups1) What is Backups? Types of backups?

    A copy of data that is used to restore and recover the data after a system failure. There are four typesof Backups available (1) Full Backup (2) Differential Backup (3) Transaction Log Backup (4) File /File

    Group Backup

    2) What is Use of Backups?

    Backups is Safe Guard to Databases because Data may can loss due to many failures such as MediaFailures, User errors, Hardware Failures and Natural Disasters etc. With good backups, we can recoverdatabase from failures.

    3) What is Full, Diff, T.Log Bakups? Explain Each?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    10/65

    10

    a) Full Backup:- Full backup, backs up the entire Database including Transaction Log. With full Backup

    Point-in-time recovery is possible because it contains .mdf and .ldf. It offers complete protection againstmedia failures.

    b) Differential Backup:- Differential backup records only the data that has change or modified extentssince the last full backup.

    c) T.Log Backup:- Transaction Log that records all transactions since last transaction log backup or

    differential backup. It can be used for recover the data to the point of failure (or) specific point-in-timed) File/File Group backup:- File and File group backups are a specialized form of DB backup. In which

    only certain individual file (or) file groups from a DB are backup.

    4) Can we take Diff. backups without Full backups?

    No, it is not possible.

    5) What are the Syntaxes for Backups?

    a) Full Backup: - Backup database dbname to disk = pathb) Diff. Backup: -Backup database dbname to disk = path with differential

    c) T.Log Backup:-Backup log dbname to disk = path

    6) Explain about Tail of Log? Give the syntax?

    The tail-log backup is the last backup that have not been backed up earlier, to recover the database tothe point of a failure. (A backup taken that have not been backed up just before restoring a database).Syntax :- 1) BACKUP LOG database_name TO< backup_device> WITH NORECOVERY

    2) BACKUP LOG database_name TO< backup_device> [WITH{ CONTINUE_AFTER_ ERROR | NO_TRUNCATE }

    7) Backups strategy?Generally Backups are done by client requirement. But Most of the companies are following this strategy.

    1) Full Backup:- Every Saturday evening 6.00 PM

    2) Differential Backup:- Every Day evening 6.00 PM3) Transactional Log Backup:- Every one hour

    Restore1) What is Restore? What are the recovery states? Explain Each?

    Restore means recover the data from backups. There are three recovery states for Restore. (1) WithRecovery (2) With No-Recovery (3) Standby.a) With Recovery:- With Recovery, Database will comes to Online and get ready to using Database.

    Generally while restoring recent (last) T.Log we can choose with recovery option.b) With No-Recovery:- With No-Recovery Databases will comes to Offline and we cant access DB.

    Generally except recent log we can choose With No-Recovery option.

    c) Standby:- With Standby, Databases will comes to Offline and users can have read only access.Generally except recent log we can choose Standby option for Read only access.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    11/65

    11

    2) What are the common scenarios to Restoring the Data?

    1) To restore the lost and corrupted data after a system failure2) To restore a database onto a development system for user by application developers while developing

    and testing new code.3) To restore a database onto a test system to load test applications and database features.4) To restore a database on separate server as a read-only database to perform queries for reports.

    3) In which edition On-line restoration is possible?

    On-line restoration is possible only in Enterprise edition.4) What are the Syntaxes for Restore?a) With Recovery:-Restore database dbname from disk = Path with recovery

    b) With No-Recovery:- Restore database dbname from disk = Path with no recoveryc) Standby:- Restore database dbname from disk = Path with no standby

    5) What is Point-in-time restore and use of that? Point-in-time restore is used to restore the Database to a particular time just before a failure hasoccurred or before corrupt data.

    6) Explain about STOPAT clause?

    STOPAT clause is used to restore a data base at point of time.

    7) Restore Strategy?1. First restore recent last full backup

    2. Then restore last Diff. backup3. Then restore all Transaction Log backups.

    Logshipping1) What is Log shipping and purpose of Log shipping?

    To achieve high availability and high protection, Log shipping copies transactions from a primary server

    to one or more secondary servers. In Log shipping, T.Log backups are sent to one or more secondaryservers and then restored to the destination servers individually. If the Primary database becomesunavailable, any of the secondary database can brought into online manually. The Secondary server acts

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    12/65

    12

    as a Backup server and provides read-only query processing to reduce the load on the Primary server.

    (For query processing, secondary servers should be configure in stand-by mode).

    2) What is Primary Server, Secondary Server & Monitor Server?

    a) Primary Server: - Primary Server is a Production server which holds the original copy of the database.Log shipping configuration and administrating will be done from Primary Server.

    b) Secondary Server: - Secondary servers hold the standby copy of the database. We must initialize theDB on a secondary server by restoring a backup from the Primary server using either NORECOVERYoption or the STANDBY option. By using STANDBY option Users can have read-only access to it.

    c) Monitor Server: - An optional Server is called as Monitor Server that records history and status ofbackup, copy and restore operations and raises alerts if any operations fail. The Monitor Sever should beon separate server to avoid losing critical information. Single Monitor Server monitors multiple Logshipping configurations.

    3) What are the Jobs running for Log shipping and explain them?Log shipping having four operations which are handled by SQL Server Agent Job.

    a) Backup Job: - Backup job is created on Primary Server instance and it performs backup operation. Itlogs history on the local server and monitor severs and deletes old backup files and history information.

    b) Copy Job: - Copy Job is created on Secondary server instance and it performs copies the backup filesfrom primary sever to secondary server. It logs history on the secondary server and monitor server.

    c) Restore Job: - Restore Job is created on the Secondary server instance and it performs restore

    operation. It logs history on the local server and monitor sever and deletes old files and historyinformation.

    d)Alert Job: - If a Monitor Server is used, the Alert Jobs is created on the Monitor server instance and it

    raises Alerts if any operations have not completed successfully.

    4) Requirements for Log shipping?

    a) SQL Server 2005 Standard Edition, Workgroup Edition, or Enterprise Edition must be installed on all serverinstances involved in log shipping.

    b) All servers should have the same case sensitivity settings.

    c) The databases must use the full recovery model or bulk-logged recovery model.

    5) How to configure Log shipping?

    a. Choose Primary Server, Secondary Servers, and optional Monitor server.b. Create a File share to keep Transaction log backups (Best to place on a separate computer)c. Create a folder for each Secondary server into which transaction log backup copies.d. Choose Backup Schedule for Primary Database

    e. Choose Copy and Restore Schedules for Secondary Databasef. Choose Alert Job schedule for Monitor Server if configured

    6) What are permissions required for Log shipping?

    We must have sysadminon each server instance to configure Log shipping.

    7)

    In Logshipping which Recovery Models can we used?

    We can use either full or bulk logged recovery model for log shipping.

    8) Where you monitoring Log shipping and how?

    We can monitoring the Log shipping in the following ways.a) Monitor server (History Tables):- Monitor Server tracks all statistics, status and errors that could be

    happen during Log shipping.1) Log_shipping_monitor_primary:- Stores primary server status

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    13/65

    13

    2) Log_shipping_monitor_secondary:- Stores secondary servers status

    3) Log_shipping_monitor_history_detail:- Contains history details for logshipping agents.4) Log_shipping_monitor_error_detail:- Stores error details for log shipping jobs.

    5) Log_shipping_monitor_alert:- Stores Alert Job IDb) System Stored Procedures (MSDB):- System Stored procedures gives the history information about

    the specified server that are configured in Log shipping.

    1) sp_help_log_shipping_monitor (Run at Monitor Server)2) sp_help_log_shipping_monitor_primary @Primary_Database = DBName (Run at MS)3) sp_help_log_shipping_monitor_secondary @ Secondary_Database = DBName (Run at MS)4) sp_help_log_shipping_alert_job (Run at Mon Server)

    5) sp_help_log_shipping_primary_database @ Database = DBName (Run at Primary Server)6) sp_help_log_shipping_secondary_database @ Database = DBName (Run at Sec Server)

    c) Transaction Log shipping Status report (Summary Reports):- This report shows the status of logshipping configurations for which this server instance is a primary, secondary or monitor.

    d) SQL Server Agent Job History

    e) Checking the SQL Server Log

    9) How Secondary Server will brought into Online, if the Primary Server becomes Unavailable?

    If the Primary Server will become un-available, do the following steps.

    a) Take the Tail of Log from Primary serverb) Restore Tail of log into all Secondary Database

    c) Remove Log-shipping configuration from Primary Serverd) Select any one of Secondary server and bring into online with Alter Database DBName set Online

    e) Right click on Primary Database and Generate script for Users and Logins.f) Then move the script to Secondary server to create Users and Logins

    g) Re-configure log shipping from New Server (Secondary server)

    10)What are errors occurred in Log shipping?

    There are two errors are occurred during Log shipping

    1) 14420:- This error occurs when the Backup job fails2) 14421:- This error occurs when the Restoring job fails

    Mirroring1) What is Database Mirroring? What are the benefits of that?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    14/65

    14

    Database mirroring is a method of increasing database availability, which supports automatic failover

    with no loss of data.Benefits:-

    h) Increases data protectioni) Increases availability of a databasej) Improves the availability of the production database during upgrades

    2) What are the prerequisites for Database Mirroring?

    a) Both Servers are requires same edition either Standard Edition or Enterprise Edition.b) If Witness server configured, the server should be installed Standard Edition, Enterprise Edition,

    Workgroup Edition, or Express Edition.

    c) All Servers should use the same master code page and collation.d) Mirror Server has same database name and use only With NoRecovery option.

    e) Mirroring uses the full recovery model. (Simple and bulk-logged not supported)

    f) All logins for connecting Principal Database should be reside on Mirror database

    3) What are the Restrictions for Database Mirroring?

    a) Maximum 10 databases per instance can support on a 32-bit system.b) Database mirroring is not supported with either cross-database transactions or distributed transactions.

    4) Explain about Principal, Mirror and Witness Servers?1) Principal Server:- One Server serves the database to client is called Principal server and it having

    original data. Can have only one Principal Server and it has to be on a separate server.2) Mirror Server:- Other server instance acts as a hot or warm standby server is called Mirror server and it

    having copy of database.3) Witness Server:- The witness server is an optional server and it controls automatic failover to the mirror

    if the principal becomes unavailable. To support automatic failover, a database mirroring session must be

    configured in high-availability.

    5) In which Operations are running the Operating Modes?

    Asynchronous:- Under asynchronous operation, the Principal server does not wait for a response from

    the mirror server after sending the log buffer.Synchronous:- Under synchronous operation, the Principal server sends the log buffer to the mirror

    server, and then waits for a response from the mirror server.

    6) What are the Operating Modes and explain them?a. High Availability:- High-availability mode, runs synchronously. Requires a Witness Server instance. The

    Principal server sends the log buffer to the mirror server, and then waits for a response from the mirrorserver.

    b. High Protection:- High-protection mode, runs synchronously. Always commit changes at both thePrincipal and Mirror.

    c. High Performance:- High-performance mode, runs asynchronously and the transaction safety set to off.The Principal server does not wait for a response from the mirror server after sending the log buffer. Theprincipal server running nice and fast, but could lose data on the mirror server.

    7) What is the default of Port numbers of Principal and Mirror servers? How to find the Portnumbers?The default port numbers of principal and mirror servers are 5022 and 5023.

    To Find Port Number:- SELECT name, port FROM sys.tcp_endpoints

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    15/65

    15

    8) What is End Point? How u create end point?

    An endpoint is a network protocol which is used to communicate over the network.Creation of an end point:

    Create endpoint State=started/stopped/disabledas tcp (listener port=5022/5023) for database_mirroring (role=partner/witness)

    9) Which Trace flag is used in Mirroring?Trace flags are used to temporarily set specific server characteristics or to switch off/on a particularbehavior. 1400 Trace flag is used in mirroring.To set trace flag for Database mirroring:- Configuration Manager > Right click on server instance >Properties > Advanced tab > Startup parameters > -t1400 (add)

    10)In which Recovery model we can use in Mirroring?In mirroring the principal and mirror databases are used only full recovery model

    11)What is Role-switching?Inter changing of roles like principal and mirror are called role switching.

    12)What is the Syntax to stop the Database Mirroring?

    Alter database set partner off

    13)How to configure Mirroring?a) Choose Principal Server, Mirror Server, and optional Witness server.

    b) The principal and mirror server instances must be running the same edition either Standard Edition orEnterprise Edition

    c) The Witness server instance can run on SQL Server Standard Edition, Enterprise Edition, Workgroup

    Edition, or Express Editiond) Mirror database requires restoring a recent backup and one or more T.log backups of the principal

    database (with Norecovery)

    14)How to monitoring Mirroring?

    There are six methods are available for monitoring the Database Mirroringa) SQL Server Management Studio:- A green arrow on the mirror server is indicates running well. A red

    arrow indicates problems that need to investigate.b) SQL Server Log:- It provides information of Mirroring establishment and status. If any errors occurs it

    will be logged to SQL Server log and Windows event log.

    c) Performance Monitor:- It can provides real-time information about Database mirroring. We can useperformance counters to get status of the database mirroring such as Bytes received/sec, Bytes sent/sec,Transaction delay etc.

    d) Profiler:- Profiler many events are providing the status of the Database mirroringe) Database Mirroring Monitor:- Database Mirroring Monitor is a GUI tool that shows update status and

    to configure warning thresholds.

    To open DM Monitor:- Right click on Principal Database > Tasks > Select Launch Database Mirroring

    Monitor.

    f) System Stored Procedures:-2. sp_dbmmonitoraddmonitoring

    3. sp_dbmmonitorchangemonitoring4. sp_dbmmonitorhelpmonitoring

    5. sp_dbmmonitordropmonitoring

    15)What is Hardening?As quickly as possible, the log buffer is written to the transaction log on disk, a process called hardening.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    16/65

    16

    16)What is Log buffer?A log buffer is a special location in memory (RAM). SQL Server stores the changes in the databases logbuffer.

    17)How to Set a Witness Server to Database Mirroring?SSMS:- Right Click on Principal Database > Tasks > Mirror > Click on Configure Security > Provide the

    End point for Witness server > Click oKT-SQL:- ALTER DATABASE AdventureWorks SET WITNESS = 'TCP://prasad.local:5024' (Do this from thePrincipal Server)

    18)How to Remove a Witness Server from Database Mirroring?

    SSMS:- Right Click on Principal Database > Tasks > Mirror > Remove TCP address from the Witness >Click oKT-SQL:- ALTER DATABASE AdventureWorks SET WITNESS OFF

    19)How to Setup Fully Qualified Names for Database Mirroring?I. FQDN Error

    One or more of the server network addresses lacks a fully qualified domain name (FQDN). Specify theFQDN for each server, and click Start Mirroring again.

    The syntax for a fully-qualified TCP address is:

    TCP://.[.]:

    II. RECTIFYING FULLY QUALIFYED NAMES

    1) To View Endpoints:-SELECT * FROM sys.database_mirroring_endpoints;

    2) Remove existing all Endpoints from Principal, Mirror and Witness servers :- DROP ENDPOINT[ENDPOINT_NAME]

    3) Adding "local" as the primary DNS suffix as follows:-

    a) Right-clickMy Computer, and then clickProperties. The System Properties dialog box will appear.b) Click the Computer Name tab.

    c) ClickChange. The Computer Name Changes dialog box will appear.d) ClickMore. The DNS Suffix and NetBIOS Computer Name dialog box will appear.

    e) Enter the appropriate DNS suffix for the domain.

    f) Select the Change primary DNS suffix when domain membership changes check box.g) ClickOKto save the changes, and then clickOKto exit the Computer Name Changes dialog box.

    h) ClickOKto close the System Properties dialog box, and then restart the computer for the change totake effect.

    4) Reconfigure the Database mirroring either GUI or T-SQL

    20)What are the Database Mirroring states?1) SYNCHRONIZING:-

    The contents of the mirror database are lagging behind the contents of the principal database. Theprincipal server is sending log records to the mirror server, which is applying the changes to the mirror

    database to roll it forward.At the start of a database mirroring session, the database is in the SYNCHRONIZING state. The

    principal server is serving the database, and the mirror is trying to catch up.

    2) SYNCHRONIZED:-When the mirror server becomes sufficiently caught up to the principal server, the mirroring state

    changes to SYNCHRONIZED. The database remains in this state as long as the principal server continuesto send changes to the mirror server and the mirror server continues to apply changes to the mirrordatabase.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    17/65

    17

    If transaction safety is set to FULL, automatic failover and manual failover are both supported in the

    SYNCHRONIZED state, there is no data loss after a failover.If transaction safety is off, some data loss is always possible, even in the SYNCHRONIZED state.

    3) SUSPENDED:-The mirror copy of the database is not available. The principal database is running without sending

    any logs to the mirror server, a condition known as running exposed. This is the state after a failover.A session can also become SUSPENDED as a result of redo errors or if the administrator pauses the

    sessionSUSPENDED is a persistent state that survives partner shutdowns and startups.

    4) PENDING_FAILOVER:-

    This state is found only on the principal server after a failover has begun, but the server has nottransitioned into the mirror role.

    When the failover is initiated, the principal database goes into the PENDING_FAILOVER state,quickly terminates any user connections, and takes over the mirror role soon thereafter.

    5) DISCONNECTED:-The partner has lost communication with the other partner

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    18/65

    18

    Replication1) What is Replication?

    Replication is the process of copying and distributing data between databases to different serversthroughout the enterprise.Replication is a set of technologies for copying and distributing data and database objects from one

    database to another and then synchronizing between databases to maintain consistency.

    2) What are the uses of Replication?

    a) Server to Server Replication:-1. Improving scalability and availability2. Data warehousing and reporting

    3. Integrating data from multiple sites4. Integrating heterogeneous data5. Offloading batch processingb) Server to Client Replication:-

    1. Exchanging data with mobile users

    2. Retail point of sale (POS) applications3. Integrating data from multiple sites

    3) Types of Replication and explain each?a) Snapshot replication:- Snapshot replication takes a picture or a snapshot of the database and

    propagated to the subscribers. It reduces the overhead on the Publishers and Subscribers because it doesnot monitor data updates. Snapshot replication is very useful, when the source data is changesoccasionally (Reporting).

    b) Transactional replication:- Transactional Replication starts with a snapshot of the publisher database.With Transactional Replication, any changes made to the articles are captured from the transactional logand propagated to the distributors continuously and automatically. Using Transactional Replication wecan keep the publisher and subscriber in almost exactly the same state.

    c) Merge replication:- Merge Replication starts with a snapshot of the publisher database. Subsequentdata changes and schema modifications made at the Publisher and Subscribers are tracked with triggers.

    The Subscriber synchronizes with the Publisher when connected to the network and exchanges all rowsthat have changed between the Publisher and Subscriber since the last time synchronization occurred.

    4) Explain about Publisher, Subscriber and Distributer?

    a) Publisher:- The Publisher is a database that makes data available for replication. The Publisher can haveone or more publications.

    b) Distributor:- The distributoris the intermediary between the publisher and subscriber. It receivespublished transactions or snapshots and then stores and forwards these publications to the subscribers.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    19/65

    19

    c) Subscribers:- Subscribers are database servers that store the replicated data and receive updates. A

    subscriber can receive data from multiple publishers. Based on the replication type, the Subscriber canalso pass data changes back to the Publisher or republish the data to other Subscribers.

    5) Explain about Article, Publication, Subscription?a)Article:- An Article is the data, transactions, or stored procedures that are stored within a publication.

    This is the actual information that is going to be replicated.b) Publication:- The publicationis the storage container for different articles. A subscriber can subscribe to

    an individual article or an entire publication.c) Subscription:-Subscription is a request by the subscriber to receive the publication.

    6) Which recovery models are used for Replication?

    Full and Bulk-logged Recovery models

    7) How to monitor the Replication?

    a) Replication Monitor:- Replication Monitor is a GUI tool provides detailed information on the status andperformance of publications and subscriptions. By using replication monitor we can find out (1) which

    subscriptions are slow (2) Why is an agent not running (3) Time taken to transaction commit (4) Whymerge replication is slow (5) How far behind subscription etc.

    To launch Replication Monitor :- Connect Instance > Right Click on Replication folder > Select launchReplication monitor

    b) Management Studio:- By using management Studio we can see View Snapshot Agent Status, View LogReader Agent Status, View Synchronization Status etc. Through SSMS:- Connect Instance > Right Click on Publication > Select the option

    c) System Monitor:- Provides information on the performance of various processes of Replication.

    Agent Performance object Counter

    All agents Replication Agents Running

    Snapshot Agent Replication Snapshot Snapshot: Delivered Cmds/sec

    Snapshot Agent Replication Snapshot Snapshot: Delivered Trans/sec

    Log Reader Agent Replication Logreader Logreader: Delivered Cmds/sec

    Log Reader Agent Replication Logreader Logreader: Delivered Trans/sec

    Log Reader Agent Replication Logreader Logreader: Delivery Latency

    Distribution Agent Replication Dist. Dist: Delivered Cmds/sec

    Distribution Agent Replication Dist. Dist: Delivered Trans/sec

    Distribution Agent

    Replication Dist.

    Dist: Delivery Latency

    Merge Agent Replication Merge Conflicts/sec

    Merge Agent Replication Merge Downloaded Changes/sec

    Merge Agent Replication Merge Uploaded Changes/sec

    8) What are the Agents available for Replication and explain each?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    20/65

    20

    SQL Server Agent hosts and schedules the agents used in replication and also controls and monitors

    operations outside of replication.b) Snapshot Agent:-The Snapshot Agent is typically used for all types of replication. It is responsible for

    copying the schema and data from the publisher to the subscribers, stores the snapshot files, and recordsinformation about synchronization in the distribution database. The Snapshot Agent runs at theDistributor.

    c) Log Reader Agent:- The Log Reader Agent is used for transactional replication. It moves informationfrom the transaction log on the publisher to the distribution database.

    d) Distribution Agent:- The Distribution Agent is used for snapshot replication and transactionalreplication. It is responsible for moving the stored transactions from the distributor to the subscribers.

    e) Merge Agent:- The Merge Agent is used for merge replication. It is responsible for converging recordsfrom multiple sites and then redistributing the converged records back to the subscribers.

    f) Queue Reader Agent:- The Queue Reader Agent is used for transactional replication with the queuedupdating option. It runs on the Distributor and is responsible for reading messages from the queue onthe subscribers and applying them to the appropriate publication.

    9) What are the Agents used for Transactional Replication?a) Snapshot Agent

    b) Log Reader Agent

    c) Distribution Agent

    10)What are the Agents used for Merge Replication?

    a) Snapshot Agentb) Merge Agent

    11)What is the Process of Transactional Replication?Three Agents are doing the Process for Transactional Replication

    MANAGEMENT

    1) What is Maintenance Plan?

    Maintenance plans create a workflow for database optimization, and make free from inconsistencies.

    2) What the tasks in Maintenance Plans?

    3) SQL Server Logs?

    4) Database Mail?

    Database Mail is an enterprise solution for sending e-mail messages from the Microsoft SQL Server 2005Database Engine. Using Database Mail, your database applications can send e-mail messages to users.

    The messages can contain query results, and can also include files from any resource on your network.Database Mail is designed for reliability, scalability, security, and supportability.

    5) Full Text Search?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    21/65

    21

    PERFORMANCE TUNING1) Which Tools are used for Performance Tuning?

    There are many tools are used for Performance tuninga) Windows tools for monitoring applications:- Performance monitor, Performance Counters and Logs,

    Task manager, Network manager

    b) SQL Server tools for monitoring components:- SQL trace, SQL Profiler, DMVs, System Storedprocedures, Graphical show plan, Activity Monitor, DBCC, Built-in Functions, Trace flags

    2) How to identify longest running queries?There are two ways to identify slow running queries

    1) Profiler (By using duration of the query)

    2) sys.dm_exec_query_statsandsys.dm_exec_requestsDMVs3) DBCC OPENTRAN

    3) Reasons for Slow Running Query?There are a number of common reasons for slow-running queries

    http://msdn.microsoft.com/en-us/library/ms189741.aspxhttp://msdn.microsoft.com/en-us/library/ms189741.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms177648.aspxhttp://msdn.microsoft.com/en-us/library/ms189741.aspx
  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    22/65

    22

    a) Lack of useful indexes, Lack of useful data striping (RAID).

    b) Blockings, Table scans, Lack of useful partitioningc) Missing or out of date statistics (update statistics)

    d) Slow network communication.e) Insufficient memory available for SQL Server.f) Insufficient disk space.

    g) Excess recompilations of Stored Proceduresh) Procedures and Triggers without SET NOCOUNT On

    4) How to analyze query performance?We can analyze query performance in three ways

    1) T-SQL:- SET SHOWPLAN_ALL ON/OFF, SET SHOWPLAN_TEXT ON/OFF2) SSMS:- Estimated Execution Plan & Actual Execution plan

    3) Profiler:- To display text and XML execution plans, seeDisplaying Execution Plans by Using SQL ServerProfiler Event Classes

    5) How to increase Query performance?

    We can improve query performance in the following ways1) Add indexes if required

    2) Run Update statistics for out of date statistics3) Resolving Blocking issues

    4) Add space to DB files or TempDB, if that are not having enough space

    5) Reduce the too much normalization6) Using Temporary tables instead of Cursors

    7) SPs and Triggers are with Set NOCOUNT On8) Unnecessarily complicated joins

    6) Explain about Profiler? What are the Uses of Profiler?SQL Profiler can capture SQL Server events from the server to analyze or troubleshoot performanceproblems such as Finding Slow-running queries and Monitoring performance etc. Profiler is useful for

    maintaining security, troubleshooting, monitoring and optimization.

    Uses of SQL Profiler:-a) Find the worst-performing queries.b) Identify the cause of a deadlock.

    c) Monitor stored procedure performanced) Audit SQL Server activity.e) Monitoring T-SQL activity per user.f) Collect a representative sample of events for stress testing.g) Collect a sample of events for tuning the physical database design by using Database Engine Tuning

    Advisor.

    7) What are the Events is captured SQL Profiler?

    We can capture the events such asa) T-SQL Statements, Stored Procedures

    b) Cursors, Locks (deadlocks)c) Databases objects and auto growth of size of data & log filesd) Errors & warnings (syntax errors)

    e) Performance (show plan)f) Table Scans

    g) Security audits (failed logins, password changes)

    h) Monitor server control, memory changes (CPU, Reads, Writes)i) Sessions, Transactions, Tuning

    http://msdn.microsoft.com/en-us/library/ms190233.aspxhttp://msdn.microsoft.com/en-us/library/ms190233.aspxhttp://msdn.microsoft.com/en-us/library/ms190233.aspxhttp://msdn.microsoft.com/en-us/library/ms190233.aspxhttp://msdn.microsoft.com/en-us/library/ms190233.aspxhttp://msdn.microsoft.com/en-us/library/ms190233.aspx
  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    23/65

    23

    8) Explain about Database Tuning Advisor? What is Workload?

    Database Tuning Advisor can analyze the performance effects of workloads run against one or moreDatabases or a SQL Profiler trace (they may contain T-SQL batch or remote procedure call). After

    analyzing, it recommends to add, remove or modify physical design structures such as clustered and non-clustered indexes, indexed views and partitioning.Workload:- A workload is a set of Transact-SQL statements that executes against databases you want

    to tune

    9) What is Dynamic Management Views?DMVs return server state information that we can use to monitor the health of a server instance,diagnose problems, and tune performance. There are two types of DMVs:

    a) Server-scoped DMVs:- Require the VIEW SERVER STATE permission on the server.b) Database-scoped DMVs:- Require the VIEW DATABASE STATE permission on the database.

    10)What is DAC? How to connect DAC?DAC is stands for Dedicated Administrator Connection. This diagnostic connection allows an administratorto access running instance to troubleshoot problems or execute diagnostic queries on the server - evenwhen SQL Server is not responding to standard connection requests. This connection uses 1434 port andcan connect only one connection per instance.

    To connect DAC:-1) SQLCMD:- -Sadmin:

    2) GUI:- SSMS Query Editor by connecting toADMIN:

    11)Explain about Database Console Commands (DBCC)?

    DBCC Commands are used to check the consistency of the Databases or Database Objects. Whileexecuting DBCC commands the DB engine creates a database snapshot and then runs the checks againstthis snapshot. After the DBCC command is completed, this snapshot is dropped.

    12) What is Stored Procure? What are the types of stored Procedures available in SQL server andexplain each?

    A stored procedure is a precompiled executable object that contains one or more Transact-SQL

    statements.a) User Defined Stored Procedure:- Stored procedures are modules or routines that encapsulate code for

    reuse. A stored procedure can take input parameters, return tabular or scalar results and messages tothe client

    b) System Stored Procedure:- System stored procedures are used to perform many administrative andinformational activities.

    c) Extended stored procedure:- Extended stored procedures are used to create own external routines ina programming language such as C. Extended stored procedures are DLLs that an instance of MicrosoftSQL Server can dynamically load and run.

    13) What is Activity Monitor and use of that? What are the permissions required to use Activity

    Monitor?

    Activity Monitor is used to get information about users connections to the Database Engine and the locksthat they hold. Activity Monitor is used to troubleshooting database locking issues, and to terminate adeadlocked or unresponsive process.To use activity monitor:-VIEW SERVER STATE permission on Server and SELECT permission to the

    sysprocesses &syslocks tables in the master database.

    To Kill a Process:- sysadmin and processadmin database roles and permission are required to KILLa process.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    24/65

    24

    14) What is Execution Plan and explain it?

    Execution Plan graphically displays the data retrieval methods chosen by SQL Server. It represents theexecution cost of specific statements and queries in SQL Server. This graphical approach is very useful for

    understanding the performance of the query.

    21) What is Trace flag? Give some Trace flags?

    Trace flags are used to temporarily set specific server characteristics or to switch off/on a particularbehavior. There are two types of trace flags: session and global. Session trace flags are active for aconnection and are visible only to that connection. Global trace flags are set at the server level and arevisible to every connection on the server. Some flags can only be enabled as global, and some can beenabled at either global or session scope.

    (1) 260 (2) 1204 (3) 1211 (4) 1222 (5) 1224 (6) 2528 (7) 3205 (8) 3625 (9) 4616 (10) 7806 (11) 1400 To set on/off Traceflag:- (1) DBCC TRACEON (2) DBCC TRACEOFF

    To Enable Trace flag globally :- DBCC TRACEON with the -1 argument (Ex:- DBCC TRACEON 2528, -1)-T startup option:- Indicates that an instance of SQL Server should be started with a specified traceflag (trace#) in effect.To Determine trace Flags are currently active:- DBCC TRACESTATUS

    15)What are the common failures occur in SQL Server 2005?There are three common failures occur in SQL Server 2005.

    1) Database Failures

    2) Physical Server Failures3) SQL Server Service failures

    16)What are the causes of Database Failures?There are three common issues will causes Database failures. Log File viewer is very useful to diagnose

    these problems that will occur in SQL Server 2005.1) Database has run out of Disk space:-a) If a Database is online, and running out of disk space the data cannot be inserted into the database.

    b) If the Database during recovery, and the data file becomes full the Database engine marks the Database

    as Resource Pending.2) T. Log is full:-a) If the Database is Online, and the T.Log becomes full the Database Engine issues 9002 error and it is in

    read-only state and will not allow updates.b) If the Database during recovery, and the T.Log becomes full the Database engine marks the Database as

    Resource Pending.3) TempDB has run out of Disk space:- TempDB stores User objects, Internal Objects and Version

    stores. If the TempDB database runs out of space, it causes significant problems for SQL Server 2005.The errors are written to SQL Server log and these errors (1101, 1105, 3959, 3967, 3958, 3966)indicates TempDB has insufficient space.

    17)How to understand Database Engine Errors?If any error occurs, the server writes error messages to logs (Database mail, SQL Agent, SQL Server &Windows NT). These logs having Error number, Error message, Severity, State, Procedure name, Linenumber. We can easy to understand errors by viewing Log file viewer.

    18)What is Severity level in Event log? At what severity levels are written to the SQL Serverlog?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    25/65

    25

    The Severity level tells how bad the error is. Above 19 Severity level errors are written to the SQL Server

    log.

    19)What is State Attribute of an error message in Event log?

    The state attributes provides details of what caused the error.

    20)What are the Causes of Physical Server Failures?There are five common issues will causes Physical Server failures.

    1) Disk failures

    2) Memory failures3) Processor failures

    4) Network card failures

    5) RAID failures

    21)If Log file is full what you will do?

    If the T.Log file is full the Database issues 9002 error and it is in Read-only state and will not allowupdates.

    The following tasks will responding T.Log file1) Backing up the log

    2) Adding one or more log files

    3) Moving the Log to another disk4) Increasing log file size or enabling auto growth

    5) Teminating long-running transactins.

    22)If Data file is full what you will do?

    If the primary data file is full we can add secondary data files. Adding a file to database: - Right click on database > Properties > Files > click add > give the valuesfor logical name, file type, file group, initial size, auto growth, path and file name .

    23)If a Database is under Suspect mode? What you will do?sp_resetstatus:- Resets the status of a suspect database (sp_resetstatus Adventureworks)

    24) If the server has completely failed, and how to all the backups restored onto a new server? a) Build the Windows server and restore the domain logins to support Windows authentication.b) Install SQL Server and any service-pack upgrades.c) Put SQL Server in single-user mode and restore the master database.

    d) Restore the msdb database.e) If the model database was modified, restore it.f) Restore the user databases.

    25) If a Server performance is slow? How you can troubles shoot a problem?26) If a Database Performance is slow? How can you do Performance Tuning?

    27) What are the Performance Issues? Explain them?

    MISCELLANEOUS

    1) What are the Differences between Delete & Truncate?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    26/65

    26

    Delete:- Delete command removes the rows in a table and records in transaction log which makes it

    slow. Rollback is possible.Truncate:- Truncate command removes all the rows in a table, but it wont write log which makes it

    faster. Rollback is not possible.

    2) What is an Index? Types of Indexes? How many clustered indexes and non-clustered

    indexes created on a table?Generally SQL Server examines (table scan) every row in the table to satisfy the query results. Index is aphysical structure containing pointers to the data which is used for retrieving data more quickly andimproves the query performance.Clustered Index:- Only one Clustered index can create on a Table. When we create a clustered indexon a table, all the rows in the table are stored in the order of the clustered index key.Non-clustered index:- 249 Non-Clustered indexes can create on a Table. Non-clustered indexes arestored as B-Tree structures with the leaf level nodes having the index key and its row locator.

    3) How can we rebuild an Index?

    By using DBCC DBREINDEX

    4) What's the difference between a primary key and a unique key?

    Both primary key and unique key enforces uniqueness of the column on which they are defined.

    Sl

    Primary Key Unique Key

    1 Primary key creates a clustered index Unique key creates a non-clustered index

    2 Primary Key doesnt allow Nulls Unique key allows one Null only

    5) What is Stored Procedure?A stored procedure is a pre-compiled SQL statements that are stored in Sever database to performing a

    task. A single procedure can be used over the network by several clients using different input data. And

    when the procedure is modified, all clients automatically get the new version.Advantages:-1) Stored procedure can reduce network traffic because queries executed as a batch.

    2) Improving the performance because the SPs are pre-compiled.3) Stored procedures provide better security to your data4) Easily modify the SPs when business rules change.

    6) What is User Defined Function? Types of UDFs?User-Defined Functions that allow you to define your own T-SQL functions that can accept zero or moreparameters and return a single scalar data value or a table data type. There are three types of UDFs areavailable in SQL Server 2005.

    a) Scalar Valued UDFs:- A scalar-valued UDF accepts parameters and returns a single scalar data types(Text, ntext, image).

    b) Table Valued UDFs:- A table-valued UDF is a function that accepts parameters and returns the resultsin the form of a table.

    7) What are the differences between Stored Procedure and User Defined Function?

    Sl User Defined Functions Stored Procedures

    1 Functions are compiled and executed at runtime.

    Stored procedures are stored inparsed and compiled format in the

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    27/65

    27

    database.

    2 Functions cannot affect the state of thedatabase which means we cannot performinsert,delete,update and create operations onthe database.

    Stored Procedures can affect thestate of the database by using insert,delete, update and create operations.

    3 Functions are basically used to computevalues. We passes some parameters tofunctions as input and then it performs someoperations on the parameter and returnoutput.

    Stored procedures are basically usedto process the task.

    4 Function can not change server environmentand our operating system environment.

    Stored procedures can change serverenvironment and our operating

    system environment

    5 Functions can not be invoked from SQLStatements. Execute. SELECT

    operating system can be invokedfrom SQL Statements. Execute.SELECT

    6 Functions can run an executable file from SQLSELECT or an action query.

    operating system use Execute orExec to run

    8) What is a Trigger?What are the trigger models are available in SQL Server 2005?A trigger is a set of T-SQL Statements stored permanently in the Database and automatically fired when

    an event occurs. They are used to impose user defined restrictions or business rules and also provides

    high security on Database/ tables.There are two types of trigger models are available in SQL Server 2005

    DML Triggers:- DML triggers created on DML statements like Insert, Update and Delete of Databaseobjects

    DDL Triggers:- DDL triggers created on DDL statements like Create, Alter and Drop of DB objects or DB.

    9) Types of Triggers?There are two types of triggers

    6)After Triggers:- After Triggers will fires after the data is inserted into the table. The typical use for anAfter trigger is to log the action to an Audit or logging table

    7) Before Triggers:- Before triggers will fire before the data is inserted into the table.

    Note:- DML triggers fires before or after issue, DDL triggers fires after the issue.

    10)What is a View and advantages of Views?

    A view is a pre-defined SQL Statements that the DB engine executes and retrieves dynamically. Astandard view acts as a virtual table based on the result set of a select statement. The fields in a view arefields from one or more real tables or another views.

    Advantages:-1) To restrict the users to specific rows & columns and hide the columns with sensitive data

    2) User friendly names can be provided instead of base table column names

    3) Frequently used complex Joins, Queries and Unions can be coded once as a View and View can bereferenced for simplicity and consistency of coding.

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    28/65

    28

    4)Aggregate information such as Sums, Counts, Avg and so on can be calculated in a view to simplify

    coding when those aggregation information will be referenced multiple times. 5)Views can be used for Data security, allowing users access certain data without granted permissions to

    directly access the base tables.

    11)Types of Views? Explain about Indexed View?

    There are two types of Views 1) Standard View 2) Indexed Views.An indexed View (materialized view) is like a standard view, and it has a unique clustered index createdon it. It stored physically just like a table.

    Advantage:- Indexed views works best for queries that aggregates many rows or have joins that causeresponse time of the standard view to be slow.

    12) What is the difference between a Local and a Global temporary table?Local temporary table:- It exists only for the duration of a connection or, if defined inside a compoundstatement, for the duration of the compound statement.Global temporary table:- remains in the database permanently, but the rows exist only within a givenconnection. When connection is closed, the data in the global temporary table disappears. However, thetable definition remains with the database for access when database is opened next time.

    13) What is PRIMARY KEY?A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table shouldhave a primary key constraint to uniquely identify each row and only one primary key constraint can becreated for each table. The primary key constraints are used to enforce entity integrity.

    14) What is UNIQUE KEY constraint?

    A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate valuesare entered. The unique key constraints are used to enforce entity integrity as the primary key

    constraints.

    15) What is FOREIGN KEY?

    A FOREIGN KEY constraint prevents any actions that would destroy links between tables with thecorresponding data values. A foreign key in one table points to a primary key in another table. Foreignkeys prevent actions that would leave rows with foreign key values when there are no primary keys withthat value. The foreign key constraints are used to enforce referential integrity.

    16) What is CHECK Constraint?A CHECK constraint is used to limit the values that can be placed in a column. The check constraints areused to enforce domain integrity.

    17) What is NOT NULL Constraint?

    A NOT NULL constraint enforces that the column will not accept null values. The not null constraints areused to enforce domain integrity, as the check constraints.

    http://thesqldbateam.blogspot.com/2013/05/sql-server-dba-topic-wise-faqs.html

    http://thesqldbateam.blogspot.com/2013/05/sql-server-dba-topic-wise-faqs.htmlhttp://thesqldbateam.blogspot.com/2013/05/sql-server-dba-topic-wise-faqs.htmlhttp://thesqldbateam.blogspot.com/2013/05/sql-server-dba-topic-wise-faqs.htmlhttp://thesqldbateam.blogspot.com/2013/05/sql-server-dba-topic-wise-faqs.html
  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    29/65

    29

    SQL Server DBA Topic Wise FAQsSQL SERVER

    1) What is SQL Server?

    2) What is the Versions Available in SQL Server?

    3) What is the Difference between SQL Server 2000 and 2005?

    4) What are the Editions Available for SQL Server 2005?

    5) What is the Syntax used for find the SQL Server version?

    6) What are the Tools are available in SQL Server 2000 and 2005?

    7) What are the Protocols used in Networking? What is the Default Port number of TCP/IP?

    8) What are Services available in SQL Server?

    9) How many ways to run services?

    10) What is AWE? How configure Dynamic Memory Allocation?

    11) What is Linked Server? How to connect Linked server? How to test linked Server?

    DATABASE

    1) What is Database? What are the files created while creating a Database?

    2) Explain about Data files (.mdf, .ndf, .ldf) (File structure)?

    3) What is Page and Page size? What is Extent and Extent size?

    4) What is Fill factor?

    5) What is Row size of a Database?

    6) Tell me about System Database and User Databases in 2000 and 2005?

    7) What is Log? What is LSN numbers?

    8) What is Check point?

    9) If Model and MSDB Database will crash what you will do? How to rebuild Master Database?

    10) What is Transaction? What is Transaction (ACID) Properties?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    30/65

    30

    11) What are Transaction Isolation levels?

    12) Explain about RAID and RAID levels?

    13) Explain about System Databases and Purpose of them?

    14) What is Orphaned Users? How to find Orphaned Users and Resolve them?

    15) If a Database in Single User mode? How to change into Multi-user mode?

    16) Minimal Mode and Single user mode?

    17) What is Database Snapshot? Give the Syntax?

    18) What is Heap table?

    19) What are the Database States and explain them?

    20) How many ways you can move the data or databases between servers and databases?

    21) Syntax for find out the Database ID?

    22) Syntax for find out Logins? Current User?

    23) How to Create Logins and Permissions?

    24) Is it possible to take Backups and Restores of System Databases?

    25) what is schema?

    Recovery Models

    1) What is Recovery Model? Benefits of Recovery Models?

    2) Explain Full, Bulk-Logged & Simple Recovery Models?

    3) Which DBs can we use Simple Recovery Model?

    4) In Which Recovery Models Point-in-time recovery is possible?

    5) In System DBs what are the Recovery Models used?

    6) Why in Simple Recovery model we cant take T.Log backups?

    7) Can we take Diff. backup in Simple recovery Model?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    31/65

    31

    Backups

    1) What is Backups? Types of backups?

    2) What is Use of Backups?

    3) What is Full, Diff, T.Log Backups? Explain Each?

    4) Can we take Diff. backups without Full backups?

    5) What are the Syntaxes for Backups?

    6) Explain about Tail of Log? Give the syntax?

    Restore

    1) What is Restore? What are the options used in Restoration? Explain Each?

    2) In which edition On-line restoration is possible?

    3) What are the Syntaxes for Restore?

    4) What is Point-in-time recovery and use of that?

    5) Explain about STOPAT clause?

    Log shipping

    1) What is Log shipping and purpose of Log shipping?

    2) What is Primary Server, Secondary Server & Monitor Server?

    3) What are the Jobs running for Log shipping and explain them?

    4) Requirements for Log shipping?

    5) How to configure Log shipping?

    6) What are permissions required for Log shipping?

    7) In Log shipping which Recovery Models can we used?

    8) Where you monitoring Log shipping and how?

    9) If primary server crashed? How to get secondary server online?

    Mirroring

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    32/65

    32

    1) What is Database Mirroring? What are the benefits of that?

    2) What are the prerequisites for Database Mirroring?

    3) What are the Restrictions for Database Mirroring?

    4) Explain about Principal, Mirror and Witness Servers?

    5) In which Operations are running the Operating Modes?

    6) What are the Operating Modes and explain them?

    7) What is the default of Port numbers of Principal and Mirror servers? How to find the Port numbers?

    8) What is End Point? How u create end point?

    9) Which Trace flag is used in Mirroring?

    10) In which Recovery model we can use in Mirroring?

    11) What is Role-switching?

    12) What is the Syntax to stop the Database Mirroring?

    13) How to configure Mirroring?

    14) How to monitoring Mirroring?

    15) What is Hardening?

    16) What is Log buffer?

    17) What is quorum and what is query governor?

    Replication

    1) What is Replication?

    2) What are the uses of Replication?

    3) Types of Replication and explain each?

    4) Explain about Publisher, Subscriber and Distributer?

    5) Explain about Article, Publication, Subscription?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    33/65

    33

    6) Which recovery models are used for Replication?

    7) How to monitor the Replication?

    8) What are the Agents available for Replication and explain each?

    9) What are the files created? While replication configured?

    10) What are the Stored Procedure created? While Replication configured?

    Clustering

    1) What is clustering?

    2) What are the types of clustering?

    3) How many shared disks using clustering?

    4) Explain active/active and active/passive clustering?

    5) Clustering configure database level or server level? Why?

    Maintenance Plans

    1) What is Maintenance Plan?

    2) What the tasks in Maintenance Plans?

    PERFORMANCE TUNING

    1) Which Tools are used for Performance Tuning?

    2) How to identify longest running queries?

    3) Reasons for Slow Running Query?

    4) How to analyze query performance?

    5) How to increase Query performance?

    6) Explain about Profiler? What are the Uses of Profiler?

    7) What are the Events is captured SQL Profiler?

    8) Explain about Database Tuning Advisor? What is Workload?

    9) What is Dynamic Management Views?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    34/65

    34

    10) What is DAC? How to connect DAC?

    11) Explain about Database Console Commands (DBCC)?

    12) What is Stored Procure? What are the types of stored Procedures available in SQL server and explain

    each?

    13) What is Activity Monitor and use of that? What are the permissions required to

    14) What is Execution Plan and explain it?

    18) What is Trace flag? Give some Trace flags?

    15) What are the common failures occur in SQL Server 2005?

    16) What are the causes of Database Failures?

    17) How to understand Database Engine Errors?

    18) What is Severity level in Event log? At what severity levels are written to the SQL Server log?

    19) What is State Attribute of an error message in Event log?

    20) What are the Causes of Physical Server Failures?

    21) If Log file is full what you will do?

    22) If Data file is full what you will do?

    23) If a Database is under Suspect mode? What you will do?

    24) If a Server performance is slow? How you can troubles shoot a problem?

    25) If a Database Performance is slow? How can you do Performance Tuning?

    26) What are the Performance Issues? Explain them?

    MISCELLANEOUS

    1) What are the DBA Roles & Responsibilities?

    2) What are the Day-to-Day activities of DBA?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    35/65

    35

    3) What is Index? Types of Indexes? Explain Clustered and Non-clustered Index? How many indexs can we

    create in a Table?

    4) What is Stored Procedure and Function? What are the Difference between SP and Function?

    5) How can we rebuild an Index?

    6) What is a Lock?

    7) What is blocking? How to identify and resolve the blockings?

    8) What is Deadlock?How to identify and resolve the blockings?

    9) What are the Types of Locks? Explain each?

    10) What is dirty read?

    11) What is phantom read?

    12) What is cover index?

    13) How to shrink log file?

    14) What is up gradation? Explain types?

    15) What is a DTS package? Explain it?

    16) Types of constraints? Explain it?

    17) What is trigger? Types of Trigger?

    18) What is the difference b\w UNION and UNION ALL?

    19) Tell me database and server role? Explain it?

    20) What is difference b\w rebuild and reorganize index?

    21) What is parallel server?

    22) If database is crashed? What will I do?

    23) What is Extended Stored procedure?

    24) What are the new features in sql server 2005?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    36/65

    36

    25) If error log is full? What will I do?

    26) Diff between Truncate and Delete

    27) Difference b\w authentication modes?

    28) Where user passwords and login stored?

    29) What is online backup?

    30) What is Identity?

    31) How do you load large data to the SQL server database?

    32) What is BCP? When does it used?

    33) Can we take backup for tempdb?

    34) What are new data types came in 2005?

    35) Difference b/t mirroring and log shipping?

    36) What is the default isolation level?

    37) What are the new isolation levels in 2005?

    38) What are mars?

    39) What is the maximum size of the database?

    40) Can we configure mirroring, log shipping and replication on one db?

    41) Which database the information of jobs is stored?

    42) In which table login information is stored?

    43) What u will do if urdb goes to suspect mode?

    44) What are the precautions u take while restoring master db?

    45) What is MSDTC?

    46) What are diff b/t witness server and monitoring server?

    47) Can we create index for a file group?

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    37/65

    37

    48) What is the size of page in sqlserver?

    49) In how many ways we can restore the db?

    50) What is high availability and disaster recovery?

    51) In log shipping can we make any modification in secondary server db?

    52) Can us access mirroring server db?

    53) What is diff b/t log shipping and replication?

    54) What is up gradation?

    55) What is migration?

    56) Why we have to create maintenance plans, what is the use of them?

    57) Through 2000 maintenance plan can we take diff backup?

    58) What are jobs created when we create maintenance plan, how many jobs?

    59) Where will be the maintenance plans in for is stored?

    60) Where do you find error in for of job if it is failed?

    61) Tell me Daily tasks of the db?

    62) What are the tasks in maintenance plan 2000 and in 2005?

    63) What is the diff b/w full and bulk recovery models

    64) What is the diff b/w sp_who and sp_who2?

    65) What is the diff b/w SSEM and SSMS?

    66) Where does u find the error in for of sql server installation failure?

    67) What is lock, how many types of locks are there?

    68) What is lsn, what you do if u get lsn mismatch while restoring db

    69) What is the third party tools used for backup?

    70) What is the backup strategy u are using

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    38/65

    38

    71) How many ways u can connect to sqlserver?

    72) What you do if primary file is full?

    73) Can we move tables of one file group to another file group?

    http://prodsqldba.wordpress.com/2011/08/02/sqldba/

    SQL Server Database Administrators BreakfastPosted onAugust 2, 2011byProdSqlDba

    SQL SERVER DBATOPIC WISE FAQs

    SQL SERVER

    1) What is SQL Server?

    Microsoft SQL Server 2005 is a database platform for large-scale online transaction processing (OLTP),data warehousing, and e-commerce applications; it is also a business intelligence platform for data

    integration, analysis, and reporting solutions.

    2) What is the Versions Available in SQL Server?

    SQL Server was developed by Microsoft in 1987 and the versions are 6.0, 6.5, 7.0, 8.0(2000), 9.0(2005),10(2008).

    3) What is the Difference between SQL Server 2000 and 2005?

    SQL Server-2000 SQL Server-2005

    T-SQL T-SQL as well as CLR

    Enterprisemanager SSMS

    Query Analyzer Query editor

    DTS SSIS

    No Reporting Tools SSRS

    http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/author/prodsqldba/http://prodsqldba.wordpress.com/author/prodsqldba/http://prodsqldba.wordpress.com/author/prodsqldba/http://prodsqldba.wordpress.com/author/prodsqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/http://prodsqldba.wordpress.com/2011/08/02/sqldba/
  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    39/65

    39

    No Exception handling in DTS Exception handling in SSIS

    Can create up to 16 Instances Can create up to 50 instances

    No exception handling in DTS. Exception handling in SSIS.

    sa blank password. Enforce password policy.

    No database mirroring Database mirroring.

    Object oriented programming

    Common language runtime

    4) What are the Editions available for SQL Server 2005?

    There are 6 six editions available in SQL Server 2005

    a) EnterpriseEdition

    b) Standard Edition

    c) Developer edition

    d) Workgroup edition

    e) Mobile edition

    f) Express edition

    5) What are the Tools are available in SQL Server 2000 and 2005?

    Sl 2000 2005

    1 Enterprisemanager & Query Analyzer Management Studio

    2 Network Client Utilities Configuration manager

    3 SQL Profiler Profiler

    4 Service manager Surface area configuration

    5 Reporting Services Configuration

    6 Database Tuning Advisor

  • 7/27/2019 TopicwiseSQLDBA Interview Questions.docx

    40/65

    40

    7 Command Prompt Utilities

    6) What are Services available in SQL Server?

    There are three services available in SQL Server 2005.

    a) SQL server service:- It is responsible for running Databases, System Stored Procedures, SystemIndexes, User Login information and Passwords

    b) SQL server agent service:- It is responsible for running Jobs, Alerts, Notifying the operators

    c) Distributed Transaction Coordinator:- It is responsible for moving data among instances (One DB

    to another DB)

    7) How many ways to run services?

    Services are run by 5 ways they are

    1) At task pane > Right click on server and click start / stop

    2) Management Studio > Right click on Server and click start / stop / restart

    3) Surface Area Configuration4) Command Prompt >Net start/stop mssqlserver

    5) SQL Server configuration manager > Right click on server and click start / stop / restart.

    8) What is Windows Authentication?

    When Windows authentication is used to connect SQL Server, Microsoft Windows is completelyresponsible for authenticating the client by identifying its windows user account.

    9) What is SQL Server Authentication?

    When SQL Server authentication is used, SQL Server authentica