TOP SQL Server DBA Interview Questions & Answers | Learn NOW
SQL Server DBA Interview Questions and Answers

TOP SQL Server DBA Interview Questions & Answers | Learn NOW

Last updated on 19th Jun 2020, Blog, Interview Questions

About author

Narendran (TL / Sr Engineer - SQL DBA )

Delegates in Corresponding Technical Domain with 7+ Years of Experience. Also, He is a Technology Writer for Past 3 Years & Share's this Informative Blogs for us.

(5.0) | 15212 Ratings 4594

The SQL Server DBA advertise is relied upon to develop to more than $5 billion by 2020, from just $180 million, as per SQL Server DBA industry gauges. In this way, despite everything you have the chance to push forward in your vocation in SQL Server DBA Development. GangBoard offers Advanced SQL Server DBA Interview Questions and answers that assist you in splitting your SQL Server DBA interview and procure dream vocation as SQL Server Developer. A database administrator is responsible for a wide range of tasks of varying complexity having to do with data and data storage. In a business environment that’s driven by high velocity and high volume data of various types, skilled database administrators play a vital role in a company’s overall success and are in high demand. SQL Server DBA Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for a new challenging job from the reputed company. Our SQL Server DBA Questions and answers are very simple and have more examples for your better understanding.

1. MS SQL Server Vs MySQL


MS SQL Server Vs MySQL

Name MS SQL Server MySQL
Define Microsoft  Relational DataBase  Management System Wide usage of Relational DataBase  Management system
Primary DB  Model Relational DB Management System Relational DB  Management System
Secondary DB Model Graph DBMS, Document & Value store Document & Key-Value store
Developer It is developed by Microsoft It is developed by Oracle
Server OS It supports Windows, Linux It supports Linux, Solaris, Windows, OS X
Supporting Languages Java, PHP, Ruby, C#, C++, R etc Python, TCL, Scheme, Haskell, Javascript, Ruby, C, C++, C# few more
FK(Foreign Key) Yes they support Yes they support
License Permit Only Commercial OpenSource (Free)

2. What purpose does the model database server?


The model database, as its name implies, serves as the model (or template) for all databases created on the same instance. If the model database is modified, all subsequent databases created on that instance will pick up those changes, but earlier created databases will not. Note that TEMPDB is also created from the model every time SQL Server starts up.

3. How do you trace the traffic hitting a SQL Server?


SQL profiler is the SQL Server utility you can use to trace the traffic on the SQL Server instance. Traces can be filtered to narrow down the transactions that are captured and reduce the overhead incurred for the trace. The trace files can be searched, saved off, and even replayed to facilitate troubleshooting.

4. What types of replication are supported in SQL Server?


SQL Server has three types of replication: Snapshot, Merge, and Transaction. Snapshot replication creates a snapshot of the data (point-in-time picture of the data) to deliver to the subscribers. This is a good type to use when the data changes infrequently, there is a small amount of data to replicate, or large changes occur over a small period of time.

Merge replication uses a snapshot to seed the replication. Changes on both sides of the publication are tracked so the subscriber can synchronize with the publisher when connected. A typical use for this type of replication is in a client and server scenario. A server would act as a central repository and multiple clients would independently update their copies of the data until connected. At which time, they would all send up their modifications to the central store.

Transaction replication also begins with a snapshot only this time changes are tracked as transactions (as the name implies). Changes are replicated from publisher to subscriber the same as they occurred on the publisher, in the same order as they occurred, and in near real-time. This type of replication is useful when the subscriber needs to know every change that occurred to the data (not point-in-time), when the change volume is high, and when the subscriber needs near real-time access to the changes.

5. Why would you use SQL Agent?


SQL Agent is the job scheduling mechanism in SQL Server. Jobs can be scheduled to run at a set time or when a specific event occurs. Jobs can also be executed on demand. SQL Agent is most often used to schedule administrative jobs such as backups.

6. What happens at the checkpoint?


Checkpoints, whether scheduled or manually executed, cause the transaction log to be truncated up to the beginning of the oldest open transaction (the active portion of the log). That is, the dirty pages from the buffer cache are written to disk. Storing committed transactions in the cache provides a performance gain for SQL Server. However, you do not want the transaction log to get too big because it might consume too many resources and, should your database fail, take too long to process to recover the database.

7. What is a SQL Server differential backup?

One important thing to note here is that SQL Server can only truncate up to the oldest open transaction. Therefore, if you are not seeing the expected relief from a checkpoint, it could very well be that someone forgot to commit or rollback their transaction. It is very important to finalize all transactions as soon as possible.


SQL Server differential database backups contain only extents that have changed since the last full backup.  The changes are denoted by flipping a bit at the extent level to determine if the extent needs to be backed up or not.

8. How do you calculate the SQL Server database compression ratio for a backup?


We can use the below query to calculate the backup compression ratio

9. What happens if we enable SQL Server Trace Flag 3042 for compressed backups?


SQL Server compressed backups use a pre-allocation algorithm to determine how much space the compressed backup will require and will allocate this space at the start of the backup process. A later backup process might expand or shrink the backup file. This helps SQL Server save the overhead of constantly growing the backup file, but it might require more space for taking backups as in most cases it allocates more space than required. If we enable trace flag 3042, SQL Server will not pre-allocate space for the backup file. Instead, it grows the backup file as required. This is useful with limited disk space.

10.  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.

11. 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.

12. What are the different SQL Server Versions you have worked on?


The answer would be depending on the versions you have worked on, I would say I have experience working in SQL Server 7, SQL Server 2000, 2005 and 2008. If you have worked only some versions, be honest in saying that, remember, no one would be working on all versions, it varies from individual to individual.

13. What is DBCC?


DBCC Stands for database console commands it is available in 4 types.They are

  • Maintenance
  • Miscellaneous
  • Validation
  • Informational

14. How can you control the amount of free space in your index pages?


This will tell SQL Server what proportion of free house to depart within the index pages once re-indexing.

The performance of profit here is some page to split (where the SQL Server needs to row copy from the one index page associate to another to the different} to create space for the row inserted) as a result of there is space for growth engineered into the index.

15. Why would you call?


It is employed to force the computation of question optimization statistics for a table or indexed read.

Query optimization statistics are unit mechanically re-computed, but it is sometimes a query might benefit from updating those kinds of statistics more frequently, Beware although that re-compute the question statistics are causes to queries to be re-compiled.

16. What is a correlated subquery?


It is the nested query which is linked to the outer side query. For instance, we can say that we need to search out all the workers in WHO they do not enter time for the whole week.

17. 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.

18. Explain about your SQL Server DBA Experience.


This is a generic question typically asked by several interviewers. Explain what are the various SQL Server Versions you have got worked on, what kind of administration of those instances has been done by you. Your role and responsibilities carried out in your earlier projects that would be of significance to the potential employer. This is the solution that lets the asker skills appropriate for you for the position to which you’re being interviewed.

19. What are the least permissions required for issuing a SQL Server database backup?


In order to issue a SQL Server database backup, the minimum permissions are:

  • Server level – PUBLIC ROLE
  • Database level – DB_BACKUPOPERATOR

20. What are the different types of Indexes available in SQL Server?


It is mainly divided into two types. They are  Non-Clustered Indexes and Clustered

    Subscribe For Free Demo

    21. What is the difference between Clustered and Non-Clustered Index?


     When the clustered index is formed on a table, the data pages are arranged according to its key. There will solely be a Clustered index on a table.

    In a Non-Clustered index, the leaf level pages do not contain data pages instead it contains pointers to the data pages. There will be multiple non-clustered indexes on one table.

    22.  What are the new features in SQL Server 2005 when compared to SQL Server 2000?


    Below is the list:

    • Database Snapshots
    • Dynamic Management Views
    • Resource Database
    • SQL Server Integration Services
    • Database Partitioning
    • System Catalog Views
    • Support for Analysis Services on a Failover Cluster.

    23. What are the High-Availability solutions in SQL Server and differentiate them briefly.


    Log Shipping, Database Mirroring, Failover agglomeration and Replication are the features  High-available in SQL Server.

    24. How do you troubleshoot errors in a SQL Server Agent Job?


    The job activity monitor displays the present standing of all the roles in the instance. Choose the actual job that is unsuccessful, right-click and choose view history from the drop-down menu. The execution history of the duty is displayed and you will select the execution time (if the duty unsuccessful multiple times throughout the constant day). There would info like the time it took to execute that Job and details concerning the error occurred.

    25. What is the default Port No on which SQL Server listens?



    26. What number files will a piece of information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?


    • A piece of information will contain most of thirty-two,767 files.
    • There are Primarily 2 types of data files Primary data file and Secondary data file(s)
    • There are just one Primary file and multiple secondary information files as long as the total # of files is a smaller amount than thirty-two,767 files

    27. What is DCL?


    DCL stands for Data Control Language.

    28. What are the commands used in DCL?



    29. What is the Fill Factor?


    Fill issue could be a setting that’s applicable to Indexes in SQL Server. The fill issue price determines what proportion information is written to the AN index page once it’s created/rebuilt.

    30. What is the default fill factor value?


    By default, the fill issue price is about to zero.

    31. Where do you find the default Index fill factor and how to change it?


    The easiest thanks to noticing and altering the default fill issue price are from Management Studio, right-click the SQL Server and choose properties. You can change to the desired value there and click OK to save the changes.

    The other possibility of viewing and dynamic  this price is victimization

    32. What is a system database and what is a user database?


    System databases area unit the default databases that area unit put in once the SQL Server is put in. Basically, there are unit four system databases: Master, MSDB, TempDB, and Model. It is highly recommended that these databases are not modified or altered for the smooth functioning of the SQL System.

    User info could be info that we have a tendency to produce to store information and begin operating with the info.

    33. What function does a database engine serve in the SQL Server?


    Database Engine is a type of service in the SQL Server which starts as soon as the Operating System starts. This may run by default depending upon the settings in the O/S.

    34. 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.

    35. 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.

    Course Curriculum

    Become a Database Administrator By Enrolling SQL Server DBA Certification Course

    Weekday / Weekend BatchesSee Batch Details

    36. What are the advantages of having an index on the SQL Server?


    The index has the following advantages:

    • Index supports the mechanism of having faster data retrieval from the database.
    • This forms a data structure in a way that helps in minimizing data comparisons.
    • This improves the performance of the retrieval of the data from the database.

    37. Compare SQL Server with Oracle.


    Criteria SQL Server Oracle
    Supported platforms Windows and Linux Windows, Solaris, Linux, and Unix
    Language used T-SQL (Transact-SQL) PL/SQL (Procedural Language/ SQL)
    Usage Simpler and easy to use Complex but powerful
    Syntax Simple Complex

    38. How can SQL Server instances be hidden?


    To hide a SQL Server instance, we need to make a change in SQL Server Configuration Manager. To do this, we have to follow the below steps:

    • First, in SQL Server Configuration Manager, we have to expand ‘SQL Server Network Configuration’
    • Right-click on Protocols for <server instance> and select ‘Properties’
    • Once we do that, we will find a ‘HideInstance’ box in which, on the ‘Flags’ tab, we have to select ‘Yes’
    • After that, click on ‘OK’

    Note: While hiding a named instance, we need to provide the port number in the connection string so that even if the browser is running it is possible to connect to the hidden instance.

    39. Can we add a CPU to SQL Server?


    Yes. we can add CPUs physically by adding new hardware, either logically by online hardware partitioning or virtually through a virtualization layer. Starting with its 2008 version, SQL Server supports CPU Hot Add. There are a few requirements to use CPU Hot Add:

    • Hardware that supports CPU hot add
    • 64-bit edition of Windows Server 2008 Datacenter or Windows Server 2008 Enterprise Edition for Itanium-based system OS
    • SQL Server Enterprise

    Once the CPU is added, we need to run RECONFIGURE, and then SQL Server recognizes the newly added CPU.

    40. Suppose, there is a trigger defined for INSERT operations on a table in an OLTP system. The trigger is written to instantiate a COM object and passes the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?


    Instantiating COM objects is a time-consuming process and since it is done within a trigger, it impedes the data insertion process. The same is the case with sending emails from triggers. This rundown can be better implemented by logging all the necessary data into a separate table and having a job that checks this table and does the needful.

    41. What different steps will a SQL Server Developer take to secure SQL Server?


    • Preferring NT authentication
    • Using server, database, and application roles to control access to data
    • Securing physical database files using NTFS permissions
    • Using an unusable SA password for restricting physical access to SQL Server
    • Renaming the Administrator account on the SQL Server computer
    • Disabling the Guest account
    • Enabling auditing using multiprotocol encryption
    • Setting up SSL and firewalls
    • Isolating SQL Server from the web server

    42. What command is used to delete a table from the database in the SQL Server and how?


    DELETE Command is used to delete any table from the database in the SQL Server.

    Syntax: DELETE Name of the table

    Example: If the name of a table is “employee” then DELETE command to delete this table can be written as

    43. How do you troubleshoot a performance issue on your SQL Server?


    As a database administrator, troubleshooting database issues should be your specialty and is an essential function of the job. Answering this question allows you to show, by example, that you understand how to handle performance issues that are a part of the DBA role.

    In the example below, you’ll see the STAR method of answering interview questions is used in part of the answer. This is a method that asks you to speak from your experience by considering a challenging situation, your role in the situation, what tasks were performed to solve it and what overall outcome was achieved.

    Example: “The most common SQL server issues relate to CPU, memory, networking, and I/O bottlenecks. In order to get to the bottom of the problem, there are a few troubleshooting tools you can use.

    • Performance Monitor: This is a Windows system monitoring tool that displays metrics with regard to key system components such as CPU, memory, disks, and networking.
    • Execution Plan: This is a useful SQL server tool, as query execution plans can be used to establish processes that need to be fine-tuned in order for a query to run faster.
    • SQL Profiler: This tool helps you trace and troubleshoot problems in SQL server, by, for instance, tracing and evaluating database queries.
    • DMV and DMF Queries: Dynamic Management Views and Functions are system views and functions that allow administrators to monitor the performance of the SQL server instance, in this way diagnosing issues.
    • SP_WHO2: This is a defined stored procedure that will give you information on current users, sessions and processes in a SQL server instance.

    44. 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

    45. Which types of backups are not supported by SQL Write Service?


    SQL Writer does not support:

    • Log backup
    • File and filegroup backup
    • Page restore

    46. 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.

    47. What is a 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.

    48. When setting Replication, can you have a Distributor on SQL Server 2005, Publisher of SQL Server 2008?


    No, you cannot have a Distributor on a previous version than the Publisher.

    49. What happens if we lose both mirror and the witness in database mirroring?


    Assume you have configured database mirroring with a witness. When the mirror is unavailable, the principal runs exposed. While the mirror is unavailable, if the witness is also lost, the principal becomes isolated and can’t service the clients. Even though the principal database is running, it is not available to the clients. If you attempt to connect to the database, you get the message “Database <dbname> is enabled for database mirroring, but neither the partner nor witness server instances are available: the database cannot be opened.” If the mirror or the witness cannot be brought back online quickly, then the only way to resume database service is to terminate the database mirroring session. To do this, we need to execute the following command after connecting to the master database of the principal server:


    50. Can I perform point in time recovery if the recovery model is Bulk Logged recovery model?


    If a log backup taken under the bulk-logged recovery model contains bulk-logged changes, point-in-time recovery is not allowed. Trying to perform point-in-time recovery on a log backup that contains bulk changes will cause the restore operation to fail.

    Course Curriculum

    Enhance Your Career with SQL Server DBA Training from Certified Experts

    • Instructor-led Sessions
    • Real-life Case Studies
    • Assignments
    Explore Curriculum

    51. What is the system function to get the current user’s user id?


    USER_ID(). Also check out other system functions like USER_NAME(), SYSTEM_USER, SESSION_USER, CURRENT_USER, USER, SUSER_SID(), HOST_NAME().

    52. Write down the general syntax for a SELECT statement covering all the options.


    Here’s the basic syntax: (Also checkout SELECT in books online for advanced syntax).

    53. What is a join and explain different types of joins.


     Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.


    54. What are Hotfixes and Patches?


    Hotfixes are software patches applied to live systems (the ones still running). A hotfix is a single, cumulative package that includes one or more files used to address a problem in a software product (i.e., a software bug).

    In the Microsoft SQL SERVER context, hotfixes are small patches designed to address specific issues, most commonly to freshly-discovered security holes. For example, if a select query returns duplicate rows with aggregations, the result may be wrong. This can be fixed by a hotfix.

    55. Why is SHRINKFILE/SHRINKDB/AUTOSHRINK not preferable?


    • In the SHRINKFILE command, SQL Server isn’t careful about where it puts the pages that are moved from the end of the file toward the beginning of the file.
    • Data becomes fragmented, potentially up to 100 percent, and hence it is a performance killer for the database.
    • Slow operation: All pointers, being moved to/from the page/rows, have to be fixed and the SHRINKFILE operation is single-threaded, so it can be really slow (the single-threaded nature of SHRINKFILE is not going to change any time soon)


    • First, use TRUNCATEONLY to shrink the file. It removes the inactive part of the log and then performs the shrink operation.
    • Rebuild/reorganize indexes once the shrink is done so that the fragmentation level is decreased.

    56. Which key provides the strongest encryption in SQL Server DBA?


    AES (256-bit).

    If we choose a longer key, then encryption will be better. Hence, we need to choose longer keys for more encryption. However, there is a larger performance penalty for longer keys. DES (Data Encryption Standard) is a relatively old and weaker algorithm than AES (Advanced Encryption Standard).

    57. Which port do you need to open on your server firewall to enable named pipe connections?


    To enable named pipe connections, we need to open Port 445. Named pipes communicate across TCP Port 445.

    58. Suppose, we have 300 SSIS packages to be deployed to production. How can we make it easier? What are the easy and short ways to deploy all SSIS packages at once?


    • We have to store this data as XML-based files, not in the MSDB database.
    • With the configuration files, we can point the packages from prod to dev (and vice versa) in just a few seconds.
    • The packages and the config files are stored in a directory of our choice.
    • Resources permit to create a standalone SSIS server away from the primary SQL Server

    59. How to decide between active and passive nodes?


    Cluster Administrator checks the SQL Server group where we can see the current owner. The current owner is the active node and the other nodes are passive nodes.

    60. What are the common trace flags used with SQL Server?


    •  Deadlock Information: 1204, 1205, and 1222
    • Network Database Files: 1807
    • Log Record for Connections: 4013
    • Skip Startup Stored Procedures: 4022
    • Disable Locking Hints: 8755
    • Forces uniform extent allocations instead of mixed page allocations 1118 (SQL Server 2005 and 2008) to reduce TempDB contention

    61. Does SQL Server Upgrade Advisor analyze remote instances?


    Upgrade Advisor can analyze remote instances of SQL Server, except for SQL Server Reporting Services. To analyze Reporting Services, Upgrade Advisor must be installed and executed on the Report Server.

    62. How to upgrade SQL Server 2000 to SQL Server 2008?


    To upgrade SQL Server 2000 to SQL Server 2008, the safest approach would be a side-by-side upgrade. We can do this either by using backup and restore or by detaching/attaching the database files. However, it is suggested to use the former as it is a safer approach. The steps are as follows:

    • Run the Upgrade Analysis tool from Microsoft. Address any issues raised there, first
    • Identify DTS packages. These must be migrated manually unless we buy Pragmatic Works
    • Rebuild the DTS packages as SSIS
    • Script out all SQL Agent jobs
    • Script out all security
    • Backup the systems and validate the backups (preferably by restoring them to another system)
    • Run the security script on the new system
    • Run restore on the new system
    • Validate the databases by running DBCC
    • Manually update all statistics
    • Run the SQL Agent script

    63. Can you detach SQL Server 2005 database and attach it to a SQL Server 2008?


     Yes. SQL Server 2005 databases are compatible with SQL Server 2008. Attaching a SQL Server 2005 database to SQL Server 2008 automatically upgrades the SQL Server 2005 database to the latter, and the database is then no longer usable by the SQL Server 2005 installation.

    64. How do you generate file output from SQL?


     While using SQL Server Management Studio or Query Analyzer, we have an option in Menu BAR. QUERY >> RESULT TO >> Result to FILE

    65. When you upgrade a SQL Server, the upgrade wizard seems to stop responding and fails. Why?


    If applications or services have opened ODBC connections to SQL Server 2005 during the conversion process, they may not allow SQL Server to shut down completely. The conversion process will not proceed to the next step if it does not receive verification that SQL Server has been completely stopped.

    66. How to rollback the upgrade?


    If the legacy SQL Server instance is replaced by a new SQL Server 2008 instance, rolling back an in-place upgrade can be complex and time-consuming; whereas, in a side-by-side upgrade, the legacy instance remains available if a rollback is needed.

    67. How to speed up the DBCC CHECKDB execution process?


    The below command enforces an exclusive lock on the database, which makes the process faster:




    The PHYSICAL_ONLY command limits checking the integrity of the physical structure of a page and record headers and can also detect torn pages, checksum failures, and common hardware failures. Using this option may cause shorter run-time for DBCC CHECKDB on large databases and is recommended for frequent use on production systems. Specifying the PHYSICAL_ONLY option causes DBCC CHECKDB to skip all checks of the FILESTREAM data.


    69. How to check data purity using DBCC CHECKDB?


    The below command causes DBCC CHECKDB to check the database for column values that are not valid or out of range:


    With this command, DBCC CHECKDB detects columns with date and time values, which are either larger or less than the acceptable range for the DATETIME data type. It also limits checking the integrity of the physical structure of the page and record.

    70. How long are locks held/retained within the REPEATABLE_READ and SERIALIZABLE isolation levels during a read operation, assuming a row-level locking?


    Within the REPEATABLE_READ and SERIALIZABLE isolation levels, locks are held/retained for the duration of the transaction, unlike within the READ_COMMITTED isolation level.

    SQL Server DBA Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

    71. Which two isolation levels support optimistic/row-version-based concurrency control?


    • One is the READ_COMMITTED isolation level. This is the only level that supports both a pessimistic (locking-based) and an optimistic (version-based) concurrency control model.
    • The other is the SNAPSHOT isolation level that supports only an optimistic concurrency control model.

    72. What are the recovery models for a database?


    There are unit three recovery models on the market for info. Full, Bulk-Logged and straightforward area unit the 3 recovery models on the market.

    73. What is the importance of a recovery model?


    Primarily, the recovery model is chosen keeping in view the amount of data loss one can afford to. If one expects to own a token or no information loss, selecting the complete recovery model could be a good selection. Depending on the recovery model of info, the behavior of database log file changes. I would suggest you scan a lot of material on log backups and log file behavior and then on to grasp comprehensive information.

    74. What is Replication?


     Replication could be a feature in SQL Server that helps America publish info objects and information and duplicate (replicate) it to at least one or a lot of destinations. It is typically thought of as part of the High-Availability choices. One of the advantages of Replication is that it can be configured on databases which are in a simple recovery model.

    75. What command is used to create a database in the SQL Server and how?


    CREATEDATABASE Command is used to create any database in the SQL Server.

    Syntax: CREATEDATABASE Name of the Database

    Example: If the name of a database is “employee” then create a command to create this database that can be written as CREATEDATABASE employee.

    76.  What are the different components of Replication and what is their use?


    The 3 main elements in the Replication area unit Publisher, Distributor, and Subscriber. The publisher is the data source of a publication. The distributor is chargeable for distributing the info objects to at least one or a lot of destinations. The subscriber is that the destination wherever the publisher’s knowledge is copied/replicated.

    77. What are the different Topologies in which Replication can be configured?


     Replication is often designed in any topology relying on keeping visible of the quality and therefore the work of the complete Replication. It can be any of the following:

    • Publisher, Distributor, and Subscriber on the same SQL Instance.
    • Publisher and Distributor on constant SQL Instance and Subscriber on a separate Instance.
    • Publisher, Distributor, and Subscriber on individual SQL Instances.

    78. If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?


    I would go to the SQL Server Configuration Manager. In the left pane of the tool, I would select SQL Server Services, the right side pane displays all of the SQL Server Services/components that are installed on that machine. If the Service is displayed as (MSSQLSERVER), then it indicates it is a default instance, else there will be the Instance name displayed.

    79. What are the different Authentication modes in SQL Server and how can you change authentication mode?


    SQL Server has 2 Authentication modes; Windows Authentication and SQL Server and Windows Authentication mode also referred to as Mixed Mode.

    80. What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?


    On SQL Server 2005, installing the SQL Server failover cluster is a single step process whereas on SQL Server 2008 or above it is a multi-step process. That is, in SQL Server 2005, the Installation process itself installs on all of the nodes (be it 2 nodes or 3 nodes). In 2008 or on top of this, we would need to install separately on all the nodes. 2 times if it’s a two-node cluster or three times in an exceedingly three-node cluster so on.

    81. What is meant by Active-Passive and Active-Active clustering setup?


    An Active-Passive cluster may be a failover cluster designed in an exceeding manner that just one cluster node is active at any given time. The other node, called the Passive node is always online but in an idle condition, waiting for a failure of the Active Node, upon which the Passive Node takes over the SQL Server Services and this becomes the Active Node, the previous Active Node now being a Passive Node.

    An Active-Active cluster is a failover cluster configured in a way that both the cluster nodes are active at any given point in time. That is, one Instance of SQL Server is running on every of the nodes always; once one amongst the nodes encompasses a failure, both the Instances run on the only one node till the unsuccessful node is remarked (after fixing the difficulty that caused the node failure). The instance is then unsuccessful over back to its selected node.

    82.  List out a number of the wants to setup a SQL Server failover cluster.


     Virtual network name for the SQL Server, Virtual IP address for SQL Server, IP addresses for the Public Network and Private Network(also referred as Heartbeat) for each node in the failover cluster, shared drives for SQL Server Data and Log files, Quorum Disk, and MSDTC Disk.

    83. What is Transparent Data Encryption?


     Introduced in SQL Server 2008 clear coding|encoding|encryption} (TDE) may be a mechanism through which you’ll defend SQL Server info files from unauthorized access through encryption. Also, TDE will defend the info backups of the instance on which TDE was set up.

    84. Does Transparent Data Encryption provide encryption when transmitting data across the network?


    No, clear cypherion|encoding|encryption} (TDE) doesn’t encrypt the info throughout transfer over a communication.

    85. What are the operating modes in which Database Mirroring runs?


    Database Mirroring runs in two operational modes High-Safety Mode and superior Mode.

    86. What is the difference between the 2 operating modes of Database Mirroring (mentioned in the above answer)?


    • High-Safety Mode is to make sure that the Principal and reflected info area unit synchronal state, that is the transactions are committed at the same time on both servers to ensure consistency, but there is/might be a time lag.
    • High-Performance Mode is to ensure that the Principal database run faster, by not waiting for the Mirrored database to commit the transactions. There is a small likelihood of knowledge loss and conjointly the reflected info may be insulating material behind (in terms being up so far with the Principal database) .

    87. once setting Replication, is it potential to own a Publisher as sixty-four Bit SQL Server and Distributor or Subscribers as a thirty-two Bit SQL Server.


    Yes, it’s potential to own numerous configurations in a very Replication atmosphere.

    88. What’s the distinction between dropping info and taking info offline?


    Drop info deletes the info alongside the physical files, it’s unacceptable to bring back the info unless you have got a backup of the info. When you take a database offline, the database is not available for users, it is not deleted physically, it can be brought back online.

    89. Which autogrowth database setting is good?


     Setting associate autogrowth in multiples of MB could be a higher possibility than setting autogrowth in proportion (%).

    90. What area unit the various kinds of info compression introduced in SQL Server 2008?


    Row compression and Page Compression.

    91. What are the different types of Upgrades that can be performed in SQL Server?


    In-place upgrade and Side-by-Side Upgrade.

    92. On a Windows Server 2003 Active – Passive failover cluster, how do you find the node which is active?


    Using Cluster Administrator, connect to the cluster and select the SQL Server cluster. Once you have selected the SQL Server group, on the right-hand side of the console, the column“Owner” gives us the information of the node on which the SQL Server group is currently active.

    93. How do you open a Cluster Administrator?


    From begin: Run and sort CluAdmin (case insensitive) and therefore the Cluster Administrator console is displayed otherwise you can even head to begin -> All Programs -> body Tools -> Cluster Administrator.

    94. thanks to some maintenance being done, the SQL Server on a failover cluster needs to be brought down. How do you bring the SQL Server down?


    In the Cluster Administrator, rick click on the SQL Server Group and from the popup menu item choose to Take Offline.

    95. What are the different ways you can create Databases in SQL Server?


    • T-SQL
    • Create Database command.
    • Using Management Studio
    • Restoring a database backup
    • Copy Database wizard

    96. Suppose you have 5 databases in an Availability Group. One database becomes inaccessible. Will the Availability Group initiate an automatic failover?


    Until SQL Server 2014, the AlwaysOn Availability Group will not initiate a failover process if anything goes wrong at the database level. Microsoft introduced an option named Enhanced Database Failover in SQL Server 2016 to trigger the failover in case any database participating in an Availability Group loses the ability to write transactions. We also call it Database Level Health Detection in an Availability Group. By default, this option is not enabled. You need to configure it if you want to initiate a failover if anything goes wrong at the database level.

    97. Can we add additional database files to a database that is part of an AlwaysOn Availability Group?


    Yes, we can add database files to the databases that are configured as a portion of the AlwaysOn Availability Group.

    Here are the high-level steps:

    • First remove the database from the secondary replica. Now, the secondary database will be in a restoring state.
    • Add the data file to your Availability database on the primary replica.
    • Issue a transaction log backup of this availability database on the primary replica.
    • Copy this transaction log backup to the secondary replica and restore it on its corresponding secondary replica using NORECOVERY and the WITH MOVE option.
    • Now add the database back to AlwaysOn Availability Group.

    98. Can we configure an Availability Group between SQL Server instances that are hosted on servers that are part of two different Windows server failover cluster groups?


    No, we cannot configure AlwaysOn Availability Group between different Windows server failover cluster groups. All replicas must be part of the same Windows server failover group. This is a basic prerequisite for AOAG.

    99. Have you heard the term “Automatic Seeding” in SQL Server AlwaysOn Availability Group? If yes, can you explain it?



      Automatic Seeding is a term that is used for automatically initialization of Availability Groups. This feature was introduced in SQL Server 2016. When you create an Availability Group with automatic seeding, SQL Server automatically creates the secondary replicas for every database in the group. You no longer have to manually backup and restore the secondary replicas.

    100. How many secondary replicas can we configure in a SQL Server AlwaysOn Availability Group?


    We can configure eight secondary replicas for any Availability Group:

    • They prevent other transactions from modifying a higher-level resource in a way that would invalidate the lock at the lower level.
    • They improve the efficiency of the database engine in detecting lock conflicts at a higher level of granularity.

    Are you looking training with Right Jobs?

    Contact Us
    Get Training Quote for Free