InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Explain The Different Types Of Backups Available In Sql Server? |
|
Answer» Types of backups available in SQL Server:
Types of backups available in SQL Server: |
|
| 2. |
What Is A Deadlock And What Is A Live Lock? How Will You Go About Resolving Deadlocks? |
Answer»
|
|
| 3. |
What Are Sparse Columns In Sql Server? |
|
Answer» A SPARSE column is ANOTHER tool used to REDUCE the amount of physical storage used in a database. They are the ORDINARY columns that have an optimized storage for null values. Sparse columns reduce the space requirements for null values at the COST of more overhead to retrieve non null values. A sparse column is another tool used to reduce the amount of physical storage used in a database. They are the ordinary columns that have an optimized storage for null values. Sparse columns reduce the space requirements for null values at the cost of more overhead to retrieve non null values. |
|
| 4. |
What Is Replication With Database Mirroring? |
|
Answer» Database mirroring can be used with replication to provide availability for the publication database. Database mirroring involves two COPIES of a single database that typically reside on different computers. At any given time, only one copy of the database is CURRENTLY available to clients which are known as the PRINCIPAL database. Updates made by clients to the principal database are applied on the other copy of the database, known as the mirror database. Mirroring involves APPLYING the transaction log from EVERY insertion, update, or deletion made on the principal database onto the mirror database. Database mirroring can be used with replication to provide availability for the publication database. Database mirroring involves two copies of a single database that typically reside on different computers. At any given time, only one copy of the database is currently available to clients which are known as the principal database. Updates made by clients to the principal database are applied on the other copy of the database, known as the mirror database. Mirroring involves applying the transaction log from every insertion, update, or deletion made on the principal database onto the mirror database. |
|
| 5. |
What Is Policy Based Management (pbm)? |
|
Answer» Policy BASED Management in SQL SERVER 2012 Administration ALLOWS you to define and enforce policies for CONFIGURING and managing SQL Server ACROSS the enterprise. Policy-Based Management is configured in SQL Server Management Studio (SSMS). Navigate to the Object Explorer and expand the Management node and the Policy Management node; you will see the Policies, Conditions, and Facets nodes. Policy Based Management in SQL SERVER 2012 Administration allows you to define and enforce policies for configuring and managing SQL Server across the enterprise. Policy-Based Management is configured in SQL Server Management Studio (SSMS). Navigate to the Object Explorer and expand the Management node and the Policy Management node; you will see the Policies, Conditions, and Facets nodes. |
|
| 6. |
What Is Service Broker? |
|
Answer» Service Broker is a message-queuing technology in SQL Server that allows developers to integrate SQL Server FULLY into distributed applications. Service Broker is feature which provides facility to SQL Server to send an asynchronous, transactional message. it allows a DATABASE to send a message to another database without waiting for the response, so the APPLICATION will continue to function if the REMOTE database is temporarily unavailable. Service Broker is a message-queuing technology in SQL Server that allows developers to integrate SQL Server fully into distributed applications. Service Broker is feature which provides facility to SQL Server to send an asynchronous, transactional message. it allows a database to send a message to another database without waiting for the response, so the application will continue to function if the remote database is temporarily unavailable. |
|
| 7. |
What Are The Basic Functions For Master, Msdb, Model, Tempdb And Resource System Databases? |
Answer»
|
|
| 8. |
What Happens If We Start The Full Text Service On Passive Node. |
|
Answer» This can be started on both the nodes as this doesn't have any dependency on SQL service or any resource which is POSSESSED by ACTIVE NODE. This can be started on both the nodes as this doesn't have any dependency on SQL service or any resource which is possessed by active node. |
|
| 9. |
Can You Move The Resources After Pausing The Node? |
|
Answer» YES RESOURCES can be MOVED after pausing the node. But we can't move them back till the node is PAUSED. Yes resources can be moved after pausing the node. But we can't move them back till the node is paused. |
|
| 10. |
What Is The Status Of Services On Passive Node For Failover Cluster In Sql Server? |
|
Answer» SQL SERVICES will be in MANUAL and stopped. Cluster service will be in automatic and started mode on both the NODES. SQL services will be in manual and stopped. Cluster service will be in automatic and started mode on both the nodes. |
|
| 11. |
Where Can You Find The Error Log Information? |
|
Answer» We can make use of SQL Profiler , SQL Server LOG or use xp_readerrorlog EXTENDED Stored PROCEDURE to retrieve the error log INFORMATION. We can make use of SQL Profiler , SQL Server Log or use xp_readerrorlog extended Stored Procedure to retrieve the error log information. |
|
| 12. |
What Are Recommended Options To Be Used While Using Db Mirroring? |
|
Answer» Database Mirroring is to be configured with TCP Protocol and ensure that data over each endpoint is ENCRYPTED. Better to MAKE use of TDE for more SECURITY. Database Mirroring is to be configured with TCP Protocol and ensure that data over each endpoint is encrypted. Better to make use of TDE for more security. |
|
| 13. |
When Does Error 3154 Occur? |
|
Answer» The error comes when you are TRYING to restore the DB which ALREADY exists. USE WITH REPLACE OPTION to restore the DB with a different database name. The error comes when you are trying to restore the DB which already exists. Use WITH REPLACE option to restore the DB with a different database name. |
|
| 14. |
What Are The Uses Of Standby Mode In Log Shipping? |
|
Answer» If the Restore JOBS is scheduled / delayed for longer intervals this option can be used. As uses needs to be disconnected every time Restore JOB runs(to ENSURE timely shipping of Transaction Logs) its recommended not to use this option for regular, less interval Log Shipping configurations. Using this option gives us advantage of Load BALANCING for READONLY connections and Reporting purposes at the cost of timely disconnections to HELP success of Restore Jobs. If the Restore Jobs is scheduled / delayed for longer intervals this option can be used. As uses needs to be disconnected every time Restore Job runs(to ensure timely shipping of Transaction Logs) its recommended not to use this option for regular, less interval Log Shipping configurations. Using this option gives us advantage of Load Balancing for READONLY connections and Reporting purposes at the cost of timely disconnections to help success of Restore Jobs. |
|
| 15. |
What Options We Use To Secure Replication Data? |
|
Answer» Ensure that SQL BROWSER is running and TCP/IP is ENABLED. Enforce TDE (Transparent DATA Encryption) so that every data bit is encrypted. Ensure that SQL Browser is running and TCP/IP is enabled. Enforce TDE (Transparent Data Encryption) so that every data bit is encrypted. |
|
| 16. |
What Are Advantages Of Peer-peer Replication? |
|
Answer» Peer-Peer Replication decreases / nullifies the dependency on Distributor. In this Replication TOPOLOGY each node is Publisher, Distributor and Subscriber. This INCREASES availability of the database system and Failure of any node does not impact the health of Replication PROCESS. This topology ALSO offers automatic conflict detection and correction. Hence, recommended in Realtime. Peer-Peer Replication decreases / nullifies the dependency on Distributor. In this Replication topology each node is Publisher, Distributor and Subscriber. This increases availability of the database system and Failure of any node does not impact the health of Replication process. This topology also offers automatic conflict detection and correction. Hence, recommended in Realtime. |
|
| 17. |
What Are Truncate Options Available In Sql Server? |
|
Answer» Use TRUNCATE_ONLY OPTION for SQL Server 2005 systems while performing Backup. This option is not AVAILABLE in SQL Sever 2008 and R2. INSTEAD, we use ON_TRUNCATE option available in the Backup statement. Use TRUNCATE_ONLY option for SQL Server 2005 systems while performing Backup. This option is not available in SQL Sever 2008 and R2. Instead, we use ON_TRUNCATE option available in the Backup statement. |
|
| 18. |
What Is Copyonly Data Backup? How This Is Useful? |
|
Answer» There are 21 types of BACKUPS in SQL Server. A non-base FULL BACKUP is called COPYONLY Data Backup. This is used to service 'on demand' Backup requests from END users. Using this type of Backups, we can service the 'on demand' backup requests from end users without disturbing the Backup sequence of Jobs / Maintenance Plans or other DIFFERENTIAL Backups. This gives us easy restore PATHS as well in case of DR process. There are 21 types of Backups in SQL Server. A non-base FULL BACKUP is called COPYONLY Data Backup. This is used to service 'on demand' Backup requests from end users. Using this type of Backups, we can service the 'on demand' backup requests from end users without disturbing the Backup sequence of Jobs / Maintenance Plans or other differential Backups. This gives us easy restore paths as well in case of DR process. |
|
| 19. |
What Is The Purpose Of Sql Profiler In Sql Server? |
|
Answer» SQL profiler is a tool to monitor performance of various STORED procedures. It is used to debug the QUERIES and procedures. Based on performance, it identifies the SLOW executing queries. Capture any problems by capturing the events on PRODUCTION environment so that they can be solved. SQL profiler is a tool to monitor performance of various stored procedures. It is used to debug the queries and procedures. Based on performance, it identifies the slow executing queries. Capture any problems by capturing the events on production environment so that they can be solved. |
|
| 20. |
How To Truncate The Log In Sql Server 2012? |
|
Answer» BACKUP LOG TestDB WITH TRUNCATE_ONLY is gone. SQL server does not allow you to truncate the log now otherwise whole purpose of a DB is defeated. You have to make SURE whether you need log or not. If you do not need log then have the recovery model simple instead of FULL. If you do not want the log to be accumulated in some particular bulk logging then CHANGE the recovery model BULK LOGGED for that duration and take one TLog Backup just before and after this change. I shall discuss this later in my later BLOG. BACKUP LOG COMMAND backs up the t-log and frees the space in the log file. BACKUP LOG TestDB WITH TRUNCATE_ONLY is gone. SQL server does not allow you to truncate the log now otherwise whole purpose of a DB is defeated. You have to make sure whether you need log or not. If you do not need log then have the recovery model simple instead of full. If you do not want the log to be accumulated in some particular bulk logging then change the recovery model BULK LOGGED for that duration and take one TLog Backup just before and after this change. I shall discuss this later in my later blog. BACKUP LOG command backs up the t-log and frees the space in the log file. |
|
| 21. |
What Is The Syntax To Execute The Sys.dm_db_missing_index_details? |
|
Answer» SELECT * from sys.dm_db_missing_index_details Select * from sys.dm_db_missing_index_details |
|
| 22. |
What Are The Dmvs? |
|
Answer» DYNAMIC Management Views (DMV) return server state information that can be used to MONITOR the health of a server INSTANCE, diagnose PROBLEMS, and tune performance. Dynamic Management Views (DMV) return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance. |
|
| 23. |
What Is Sql Profiler. What Are The Default Templates With It? |
|
Answer» SQL Server PROFILER is a graphical user interface to SQL Trace for monitoring an instance of the DATABASE Engine or ANALYSIS Services. You can capture and save data about each EVENT to a file or table to ANALYZE later. SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the Database Engine or Analysis Services. You can capture and save data about each event to a file or table to analyze later. |
|
| 24. |
What Is Scan Table/view And Seek Table/view When Its Occurs? |
|
Answer» A Table/view SCAN OCCURS when no USEFUL indexes exist. A TABLE SCAN reads all data, ROW by row, to find the MATCH. A Table/view SCAN occurs when no useful indexes exist. A TABLE SCAN reads all data, row by row, to find the match. |
|
| 25. |
What Is Mean By Clustered Index And Non Clustered Index, Give Syntax Of Creation? |
|
Answer» CREATE CLUSTERED INDEX index_name on empmst(CARD) create clustered index index_name on empmst(card) |
|
| 26. |
What Are The Difference Between Primary Key And Unique Key? |
|
Answer» An unique KEY CANT not be REFERENCED as FOREIGN key. And it may allow on NULL. An unique key cant not be referenced as foreign key. And it may allow on null. |
|
| 27. |
How To Find The Service Pack Installed? |
|
Answer» SELECT @@VERSION Or select serverproperty (‘productlevel’) Select @@version Or select serverproperty (‘productlevel’) |
|
| 29. |
Describe The Left Outer Join & Right Outer Join. |
|
Answer» LEFT Outer join Retrieves the all RECORDS from LEFT table and matching from the RIGHT table, and null values where is no MATCH. Right Outer Join just OPPOSITE. Left Outer join Retrieves the all records from LEFT table and matching from the RIGHT table, and null values where is no match. Right Outer Join just opposite. |
|
| 30. |
What Are The Joins In Sql Server? |
|
Answer» Inner JOIN, OUTER (LEFT Outer & Right Outer) Joins and CROSS join. Inner Join, Outer (Left Outer & Right Outer) Joins and Cross join. |
|
| 31. |
Where The Sql Logs Gets Stored? |
|
Answer» It’s stored into ROOT FOLDER SQL server, LOG folder. It’s stored into root folder SQL server, LOG folder. |
|
| 32. |
What Is Stored In The Mssqlsystemresource Database? |
|
Answer» Definition of SYS objects, which LOGICALLY SHOWS into all DATABASE and DMVS. Definition of sys objects, which logically shows into all database and DMVs. |
|
| 33. |
Can We Perform Backup Restore Operation On Tempdb? |
|
Answer» NO NO |
|
| 34. |
What Stored By The Msdb? |
|
Answer» SCHEDULED JOBS, Backup/Restore and DTA INFORMATION. Scheduled jobs, Backup/Restore and DTA information. |
|
| 35. |
What Stored By The Master? |
|
Answer» SERVER’s CONFIGURATIONS and LOGINS. Server’s configurations and logins. |
|
| 36. |
What Stored By The Model? |
|
Answer» TEMPLATES of new DATABASE OBJECTS, like tables and COLUMN. Templates of new database objects, like tables and column. |
|
| 38. |
What Are System Databases Into Sql Server (2005/2008) |
|
Answer» TEMPDB, MSDEB, MASTER, MSDB, mssqlsystemresource. TEMPDB, MSDEB, MASTER, MSDB, mssqlsystemresource. |
|
| 39. |
How Do You Test Your Database? |
|
Answer» This is a very generic question. I would like to describe my generic DATABASE testing method as well as stored procedure testing methods. Testing Databases: Table Column data type and data value validation. Testing Stored Procedures: Understand the requirements in terms of Business Logic. This is a very generic question. I would like to describe my generic database testing method as well as stored procedure testing methods. Testing Databases: Table Column data type and data value validation. Testing Stored Procedures: Understand the requirements in terms of Business Logic. |
|
| 40. |
Which Feature In Sql Server 2008 Has Surprised You? You Can Name Just One. |
|
Answer» Plan Freezing is a new feature I never thought of. I FIND it very interesting! It is included in SQL Server 2008 CTP5. SQL Server 2008 ENABLES greater query performance stability and PREDICTABILITY by providing new functionality to lock down query plans. This empowers organizations to promote STABLE query plans across hardware server replacements, server UPGRADES, and production deployments. Plan Freezing is a new feature I never thought of. I find it very interesting! It is included in SQL Server 2008 CTP5. SQL Server 2008 enables greater query performance stability and predictability by providing new functionality to lock down query plans. This empowers organizations to promote stable query plans across hardware server replacements, server upgrades, and production deployments. |
|
| 41. |
What Should Be The Fill Factor For Indexes Created On Tables? |
|
Answer» Fill factor specifies a PERCENTAGE that indicates how full the Database ENGINE should make the leaf LEVEL of each INDEX PAGE during index creation or alteration. Fill factor must be an integer value from 1 to 100. The default is 0. I prefer to keep my servers default fill factor as 90. Fill factor specifies a percentage that indicates how full the Database Engine should make the leaf level of each index page during index creation or alteration. Fill factor must be an integer value from 1 to 100. The default is 0. I prefer to keep my servers default fill factor as 90. |
|
| 42. |
What Is Your Recommendation For A Query Running Very Slow? |
|
Answer» Well, your question is very difficult to answer without looking at the code, application and PHYSICAL server. In such situations, there are a few things that MUST be paid attention to right away. RESTART Server Check Indexes on Tables and Create Indexes if necessary Make sure SQL Server has priority over other operating system processes in SQL Server settings. Update STATISTICS on the database tables. Well, your question is very difficult to answer without looking at the code, application and physical server. In such situations, there are a few things that must be paid attention to right away. Restart Server Check Indexes on Tables and Create Indexes if necessary Make sure SQL Server has priority over other operating system processes in SQL Server settings. Update statistics on the database tables. |
|
| 43. |
What Is Bi? I Have Heard This Term Before But I Have No Idea About It? |
|
Answer» BI stands for Business Intelligence. Microsoft started to promote the acronym BI SINCE the launch of SQL Server 2005. However, it has been in use for a LONG time. The basic idea of BI is quite similar to Data Warehousing. Business intelligence is a method for storing and presenting accurate and TIMELY key enterprise data to CXO, IT Managers, Business Consultants, and distributed teams of a company, to provide them with up-to-date information to drive intelligent decisions for business success, which ultimately leads to enhanced revenue, reduced risk, decreased cost, and BETTER operational control for business agility and competitiveness. An effective BI empowers end users to use data to understand the cause that led to a particular business result, to decide on the course of action based on past data, and to accurately FORECAST future results. BI stands for Business Intelligence. Microsoft started to promote the acronym BI since the launch of SQL Server 2005. However, it has been in use for a long time. The basic idea of BI is quite similar to Data Warehousing. Business intelligence is a method for storing and presenting accurate and timely key enterprise data to CXO, IT Managers, Business Consultants, and distributed teams of a company, to provide them with up-to-date information to drive intelligent decisions for business success, which ultimately leads to enhanced revenue, reduced risk, decreased cost, and better operational control for business agility and competitiveness. An effective BI empowers end users to use data to understand the cause that led to a particular business result, to decide on the course of action based on past data, and to accurately forecast future results. |
|
| 44. |
What Is The Difference Between Sql Server 2000 Object Owner And Sql Server 2005 Schema? |
|
Answer» Let us first see the fully QUALIFIED query name to access a table for SQL Server 2000 and SQL Server 2005. SQL Server 2000: [DataBaseServer].[DataBaseName].[ObjectOwner].[Table] In SQL Server 2000, prior to dropping the USER who owns database objects, all the objects belonging to that user either need to be dropped or their owner has to be changed. Every time a user is dropped or modified, system admin has to undergo this inconvenient process. In SQL Server 2005 and the later versions, instead of accessing a database through database owner, it can be accessed through a schema. Users are assigned to schemas, and by USING this schema a user can access database objects. Multiple users can be assigned to a single schema, and they all can automatically receive the same permissions and credentials as the schema to which they are assigned. Because of the same reason in SQL Server 2005 and the later versions – when a user is dropped from database – there is no NEGATIVE effect on the database itself. Let us first see the fully qualified query name to access a table for SQL Server 2000 and SQL Server 2005. SQL Server 2000: [DataBaseServer].[DataBaseName].[ObjectOwner].[Table] In SQL Server 2000, prior to dropping the user who owns database objects, all the objects belonging to that user either need to be dropped or their owner has to be changed. Every time a user is dropped or modified, system admin has to undergo this inconvenient process. In SQL Server 2005 and the later versions, instead of accessing a database through database owner, it can be accessed through a schema. Users are assigned to schemas, and by using this schema a user can access database objects. Multiple users can be assigned to a single schema, and they all can automatically receive the same permissions and credentials as the schema to which they are assigned. Because of the same reason in SQL Server 2005 and the later versions – when a user is dropped from database – there is no negative effect on the database itself. |
|
| 45. |
One Of The Developers In My Company Moved One Of The Columns From One Table To Some Other Table In The Same Database. How Can I Find The Name Of The New Table Where The Column Has Been Moved? |
|
Answer» This question can be answered by querying SYSTEM views. For SQL Server 2005 run the FOLLOWING code: SELECT OBJECT_NAME(OBJECT_ID) TableName The previous QUERY will return all the tables that use the column name specified in the WHERE condition. This is a very small but a very handy script. This question can be answered by querying system views. For SQL Server 2005 run the following code: SELECT OBJECT_NAME(OBJECT_ID) TableName The previous query will return all the tables that use the column name specified in the WHERE condition. This is a very small but a very handy script. |
|
| 46. |
As Per Your Opinion What Are The Five Top Responsibilities Of A Dba? |
|
Answer» I rate the following five tasks as the key responsibilities of a DBA.
I rate the following five tasks as the key responsibilities of a DBA.
|
|
| 47. |
I Have All The Primary Data Files, Secondary Data Files As Well As Logs. Now, Tell Me Can I Still Restore The Database Without Having A Full Backup? |
|
Answer» You cannot restore the database without having a FULL database BACKUP. However, if you have the copy of all the DATA files (.mdf and .ndf) and logs (.ldf) when database was in working condition (or your desired state) it is POSSIBLE to attach the database using sp_attach_db. You cannot restore the database without having a full database backup. However, if you have the copy of all the data files (.mdf and .ndf) and logs (.ldf) when database was in working condition (or your desired state) it is possible to attach the database using sp_attach_db. |
|
| 48. |
According To You What Goes Into Making The Best Database Administrator? |
|
Answer» The primary job of DBAs is to secure the data. They should be able to keep it safe as WELL as reproduce it efficiently, whenever required. So as PER my view, a DATABASE Administrator who can fulfill the REQUIREMENTS of Securing Data and Retrieving Data is the best DBA. When I hire a DBA I always ASK them questions about backup strategies and efficient restoring methodologies. The primary job of DBAs is to secure the data. They should be able to keep it safe as well as reproduce it efficiently, whenever required. So as per my view, a Database Administrator who can fulfill the requirements of Securing Data and Retrieving Data is the best DBA. When I hire a DBA I always ask them questions about backup strategies and efficient restoring methodologies. |
|
| 49. |
How To View The Error Log For Any Specific Instance? |
|
Answer» There are MANY ways but I prefer following method. Take a scenario when you WANT to find the error log when the DB was put in a single USER mode. CREATE TABLE #Errorlog (Logdate Datetime, Processinfo There are many ways but I prefer following method. Take a scenario when you want to find the error log when the DB was put in a single user mode. CREATE TABLE #Errorlog (Logdate Datetime, Processinfo |
|
| 50. |
Does Dbcc Checkdb Requires Db To Be In Single_user Mode? |
|
Answer» Yes and No. This is tricky question. If you are using repair option with CHECKDB then you have to have the DB in single user mode. Following is the METHOD to have your DB in a single user mode. Use master Following is the error which you get when you RUN the DBCC CHECKDB with repair option WO having the DB in single user mode. The same is true for DBCC CHECKDB ALSO Yes and No. This is tricky question. If you are using repair option with CHECKDB then you have to have the DB in single user mode. Following is the method to have your DB in a single user mode. Use master Following is the error which you get when you run the DBCC CHECKDB with repair option wo having the DB in single user mode. The same is true for DBCC CHECKDB also |
|