solving sql server problems for millions of dbas and developers since 2006


Identify and resolve SQL Server problems BEFORE they happen with SQL diagnostic manager

SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Whitepapers SQL Server Tools SQL Server Webcasts SQL Server Questions and Answers SQL Server Questions and Answers


SQL Product Highlight

SQL Sentry, Inc. - SQL Sentry Performance Advisor for SQL Server

SQL Sentry Performance Advisor for SQL Server delivers an advanced performance dashboard with relevant Windows and SQL Server metrics in a single view along with detailed insight of heavy SQL, blocking, deadlocks, and disk bottlenecks. Performance Advisor is packed with ground-breaking features that are not found in any other performance monitoring software, all designed with the singular goal of simplifying the process of optimizing your SQL Server performance.

Learn more!








SQL Server DBA Backup and Recovery Interview Questions

By: | Read Comments (7) | Print

Jeremy is a co-founder of MSSQLTips, a SQL Server MVP and a regular contributor with over 200 published tips.

Related Tips: More

Problem

If you are preparing for a SQL Server DBA interview as the interviewer or interviewee, today's tip should offer value to you. This tip has interview style questions graded as either easy, moderate or advanced related to SQL Server backup and recovery. Check out the questions and good luck!

Solution

Question Difficulty = Easy

  • Question 1: How does the database recovery model impact database backups?
    • First the database recovery model is responsible for the retention of the transaction log entries.  So the setting determines if transaction log backups need to be issued on a regular basis i.e. every minute, five minutes, hourly, etc. in order to keep the transaction log small and/or maintain a log shipping solution.
    • Here are the SQL Server database recovery models:
      • Simple - Committed transactions are removed from the log when the check point process occurs.
      • Bulk Logged - Committed transactions are only removed when the transaction log backup process occurs.
      • Full - Committed transactions are only removed when the transaction log backup process occurs.
    • Additional information:

 

 

  • Question 3: How can I verify that backups are occurring on a daily basis?

 

  • Question 4: How do you know if your database backups are restorable?

 

  • Question 5: From a best practices perspective, what is your backup retention policy?
    • Store as many backups locally on the network as would need to be restored to a standby server.
    • Do not store the backups and online databases on the same disks.  If a disk failure occurs, you could lose both backups and online backups with a single failure.
    • Ensure the long term backup policy meets all industry and regulatory requirements based on the organization.  This could be as long as seven years in some industries.
    • Additional information:

Question Difficulty = Moderate

  • Question 1: What are some common reasons why database restores fail?

 

  • Question 2: How can you be notified if a native SQL Server database backup or restore fails via the native tools?

 

 

  • Question 4: What are some common post restore processes?
    • Sync the logins and users
    • Validate the data is accurate
    • Notify the team\user community
    • Cleanse the data to remove sensitive data i.e. SSN's, credit card information, customer names, personal information, etc.
    • Change database properties i.e. recovery model, read-only, etc.
    • Additional information:

 


Question Difficulty = Difficult

  • Question 1: What is the database that has the backup and restore system tables?  What are the backup and restore system tables?  What do each of the tables do?
    • The MSDB database is the database with the backup and restore system tables.
    • Here are the backup and restore system tables and their purpose:
      • backupfile - contains one row for each data file or log file backed up
      • backupmediafamily - contains one row for each media family
      • backupmediaset - contains one row for each backup media set
      • backupset - contains one row for each backup set
      • restorefile - contains one row for each restored file
      • restorefilegroup - contains one row for each restored filegroup
      • restorehistory - contains one row for each restore operation
    • Additional information:

 

  • Question 2: For differential backups, how is the data determined for those backups?

 

  • Question 3: In a situation with full, differential and transaction log backups being issued for a database, how can an out of sequence full backup be issued without interrupting the LSN's?

 

  • Question 4: How is a point in time recovery performed independent of a server down situation?
    • It depends on which backup types are issued.  In this example let's assume that full, differential and transaction log backups are issued.
      • Restore the most recent full backup with the NORECOVERY clause
      • Restore the most recent differential backup with the NORECOVERY clause
      • Restore all of the subsequent transaction log backups with the NORECOVERY clause except the last transaction log backup
      • Restore the last transaction log backup with the RECOVERY clause and a STOPAT statement if the entire transaction log does not need to be applied
    • Additional information:

 

  • Question 5: What are your recommendations to design a backup and recovery solution?
    • Determine What is Needed
    • Recovery Model
    • Select Backup Types
    • Backup Schedule
    • Backup Process
    • Document
    • Backup to Disk
    • Archive to Tape
    • Backup to Different Drives
    • Secure Backup Files
    • Encrypt or Password Protect Backup Files
    • Compress Backup Files
    • How Much to Keep on Disk
    • Online Backups
    • Run Restore Verifyonly
    • Offsite Storage
    • Additional information:

Next Steps

  • As you prepare for an upcoming SQL Server DBA technical interview, review the SQL Server interview questions in this tip as a means to prepare for the technical portion of the interview.
  • As you continue to prepare for the interview, check out all of the MSSQLTips.com Interview Questions:
  • Stay tuned for future SQL Server interview questions related to core SQL Server features. If you have some key interview questions related to backup and recovery that you always include in your interview process, please share your knowledge with the community by posting the questions in the forum.


Related Tips: More | Become a paid author


Last Update: 1/28/2012

Share: Share 






Comments and Feedback:

Sunday, January 29, 2012 - 12:10:47 PM - Jason read the tip flag as SPAM

Difficult level, Question 3, you don't need the "COPY_ONLY" option... a regular full backup will not break the log chain.  It's a common myth that it does.

 

http://blogs.msdn.com/b/sqlserverfaq/archive/2010/08/26/transaction-log-backup-and-restore-sequence-myths-amp-truths.aspx

Great article, BTW!


Monday, January 30, 2012 - 10:55:01 AM - Jeremy Kadlec read the tip flag as SPAM

Jason,

Thank you for the post and URL. Maybe I need to change the question a little bit, but the scenario I am referencing is outlined in this tip - http://www.mssqltips.com/sqlservertip/1075/copyonly-backups-with-sql-server-2005/. Although this was originally written for SQL Server 2005, I have worked through the four sets of code and the examples remain accurate based on this build:

"Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64) Apr 22 2011 19:23:43 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)"

In my test from the aforementioned tip, the database recovery model is full, the database compatibility level is 100 and no non-logged operations were issued.

I think here are some test cases and the associated status:

·          Full and transaction log backups

o    Full backups can be issued without the copy_only option and you are still able to restore the transaction logs in sequence

o    Full backups can be issued without the copy_only option and transaction log backups can be issued with the copy_only option to skip restoring specific transaction logs

·          Full, differential and transaction log backups

o    Once differential backups gets introduced into the equation then using the copy_only option with the full backup is necessary to issue an out of schedule backup without disrupting the process

Let me take a look at that question again and see if I can further clarify it. If you have a minute run through the example (http://www.mssqltips.com/sqlservertip/1075/copyonly-backups-with-sql-server-2005/) I have outlined in the tip and let me know your results.

Thank you,
Jeremy Kadlec


Monday, January 30, 2012 - 11:10:13 AM - Jeremy Kadlec read the tip flag as SPAM

Jason,

I have updated the question.  Please let me know if this makes more sense.

Thank you,
Jeremy Kadlec


Tuesday, January 31, 2012 - 7:57:22 AM - Jason read the tip flag as SPAM

Jeremy,  Yes, the wording of the question is better.  Thanks!


Sunday, February 05, 2012 - 6:54:34 AM - jrara read the tip flag as SPAM

Question 4: How is a point in time recovery performed?

I thought the first thing to do is to take a tail log backup?


Monday, February 06, 2012 - 10:28:35 AM - Jeremy Kadlec read the tip flag as SPAM

jrara,

Thank you for the feedback.  Let me try to clarify that question a little bit more.

I have been in some circumstances where a tail log backup is possible and other times when it is not.

I will re-post the question and ask you to let me know if it makes more sense.

Thank you,
Jeremy Kadlec


Monday, February 06, 2012 - 10:32:25 AM - Jeremy Kadlec read the tip flag as SPAM

jrara,

I have updated the question.  Please let me know if it makes more sense now.

Thank you,
Jeremy Kadlec



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email   Notify for updates
Comments
*Enter Code refresh code


 
Sponsor Information
"Amazing, Amazing, Amazing! SQL doctor is truly one of the most powerful tools I have seen."

SQL Backup Pro was the smartest kid at school. Head of the class for compression, encryption and centralized management. Discover why.

SQL Server Consultants - What you don't know could be your biggest asset - Guaranteed Results

Join the over million SQL Server Professionals who get their issues resolved daily.

Free Web Cast - What Are You Waiting For? Delivered by Jason Strate on Wednesday, March 14 @ 3:00 PM EST


Copyright (c) 2006-2012 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com