What is your sql server backup strategy tech_republic


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

What is your sql server backup strategy tech_republic

  1. 1. What is your SQL Server backup strategy? | TechRepublic ZDNet Asia SmartPlanet TechRepublic Log In Join TechRepublic FAQ Go Pro! Blogs Downloads Newsletters Galleries Q&A Discussions News Research Library IT Management Development IT Support Data Center Networks Security Home / Blogs / The Enterprise Cloud Follow this blog: The Enterprise Cloud What is your SQL Server backup strategy? By Steven Warren August 28, 2007, 9:00 AM PDT Takeaway: Most database administrators (DBAs) know what it’s like to be called away from home or dinner or even awakened in the middle of the night to answer a page or a cell-phone call concerning some type of database disaster. These are the times you’re glad that you have a systematic backup plan. Of course, conversely, [...] Most database administrators (DBAs) know what it’s like to be called away from home or dinner or even awakened in the middle of the night to answer a page or a cell-phone call concerning some type of database disaster. These are the times you’re glad that you have a systematic backup MapR Hadoop plan. Of course, conversely, if you don’t have a good backup plan, these are the times you regret it. Download Most Open, Enterprise-Grade Distribution for In this article, we will discuss various types of backup strategies and demonstrate how to Hadoop. Try Now. implement each of these types of backups using Enterprise Manager, the graphical user interface www.mapr.com/Free-download (GUI), and Transact SQL (T-SQL) in Microsoft SQL Server 2000. Google Docs For Business Start with 5 GB of Included Storage Get Additional 20 GB Just $4/month! www.google.com/apps Put together a backup plan Before developing your backup strategy, you need to develop a plan of action. Evaluate your Data Masking Software Secure your sensitive data with Grid-Tools company and ask, “What is the maximum amount of downtime we can live with?” Once this is Enterprise Data Masking established, you can decide on the appropriate course of action by matching your company’s www.grid-tools.com needs to the appropriate level of database backup. Full backups A full backup is the easiest type of backup to implement in SQL Server. It takes a complete picture Keep Up with TechRepublic of your database that includes backing up users and permissions. In addition, this backup can occur while transactions are still occurring in your system. When the backup begins, the date is recorded, the data pages are backed up, and all transactions that occur while the backup runs are appended to the backup. Five Apps Author’s note Google in the Enterprise A full backup backs up your users but not your logins. If you want to back up your logins, remember to back up the Master database. Furthermore, if you ever restore your database to a Subscribe Today different server, you must synchronize your logins by using the sp_change_users_login. For a more detailed explanation of this stored procedure, see SQL Books Online. Follow us however you choose! Using Enterprise Managerhttp://www.techrepublic.com/blog/datacenter/what-is-your-sql-server-backup-strategy/165[08/29/2012 3:08:59 PM]
  2. 2. What is your SQL Server backup strategy? | TechRepublic To implement a full backup using Enterprise Manager, expand the SQL Server to display your databases. Right-click on the database and select All Tasks | Backup Database to access the options shown in Figure A. Under Backup, choose Database - Complete. Then, select a destination (tape or disk). If this is the first backup of your database, you will have to create a backup device or file. A backup device is Media Gallery simply a location that stores your backups. A backup file can also hold multiple “backups.” To create a backup device or file, start by clicking Add. Next, select either File Name or Backup Device. (Figure B shows the dialog box you’ll see if you choose Backup Device.) Then, just define the appropriate path and click OK. Once you’ve created the device or file, you can select it from the Destination list box. The SQL Server Backup dialog box also includes options to append to a backup or overwrite it. PHOTO GALLERY (1 of 15) This means that you can add multiple backups to your file or device or overwrite previous backups Curiositys autonomous seven minutes of... with the most current one. If you want to schedule your backups, select the Schedule check box and then click the button that has three dots on it. In the Edit Schedule dialog box, shown in More Galleries » Figure C, make your scheduling specifications. You can choose from the following options: Start Automatically When SQL Server Agent Starts Start Whenever CPU(s) Become Idle One Time VIDEO (1 of 13) Recurring Cracking Open: HTC Titan II You can use the Change button to set a time for recurring backups. More Videos » Enterprise Manager also allows you to set a variety of other options via the SQL Server Backup dialog box. If you click on the Options tab, you can choose the following: Hot Questions View All Verify Backup Upon Completion 3 SSL redirection Eject Tape After Backup Remove Inactive Entries From Transaction Log Check Media Set Name And Backup Set Expiration 3 Switching from a Job to a career in Backup Set Will Expire (You supply an expiration date.) the IT field: Need an IT pros advice Initialize And Label Media Using T-SQL 2 windows 7 wont shutdown and You can also back up a database using T-SQL, which offers options that Enterprise Manager keeps switching on doesn’t. The syntax for a full backup is as follows: BACKUP DATABASE { database_name | @database_name_var } 2 can anyone suggest if any such TO backup_device [ ,…n ] software exist with similar [ WITH functionality? [ BLOCKSIZE = { blocksize | @blocksize_variable } ] [ [ , ] DESCRIPTION = { ‘text‘ | @text_variable } ] Ask a Question [ [ , ] DIFFERENTIAL ] [ [ , ] EXPIREDATE = { date | @date_var } | RETAINDAYS = { days | @days_var } ] [ [ , ] PASSWORD = { password | @password_variable } ] Hot Discussions View All [ [ , ] FORMAT | NOFORMAT ] [ [ , ] { INIT | NOINIT } ] Should developers be sued for 221 [ [ , ] MEDIADESCRIPTION = { ‘text‘ | @text_variable } ] security holes? [ [ , ] MEDIANAME = { media_name | @media_name_variable } ] [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ] 79 The sitting duck that is open [ [ , ] NAME = { backup_set_name | @backup_set_name_var } ] source [ [ , ] { NOSKIP | SKIP } ] [ [ , ] { NOREWIND | REWIND } ] Five fast Windows desktop search [ [ , ] { NOUNLOAD | UNLOAD } ] 27 utilities [ [ , ] RESTART ] [ [ , ] STATS [ =percentage ] ] 24 Five speedy Windows desktop For a definition of each option, see the description in SQL Books Online. search appshttp://www.techrepublic.com/blog/datacenter/what-is-your-sql-server-backup-strategy/165[08/29/2012 3:08:59 PM]
  3. 3. What is your SQL Server backup strategy? | TechRepublic Figure D shows an example of how I backed up the Pubs database. By adding NOINIT, I appended the information to the end of the backup. By adding Stats to the argument, I received an Start a Discussion output of the percentage of the backup completed. Differential backups A differential backup backs up only the data that has changed since the last full backup. These Blog Archive backups are generally smaller than a full backup and can be used frequently since they run much faster. To perform a differential backup in Enterprise Manager, choose the Database-Differential August 2012 December 2011 option in the SQL Server Backup dialog box (which we saw in Figure A). July 2012 November 2011 June 2012 October 2011 To perform a differential backup using T-SQL, use the Backup command but add the differential argument, as shown in Figure E. May 2012 September 2011 April 2012 August 2011 Transaction-log backups March 2012 July 2011 A transaction-log backup will back up all transactions that occur in the database and purge or February 2012 June 2011 clean up the log after the backup completes. Using a transaction-log backup gives you point-in- time recovery for a database. To perform transaction-log backups with Enterprise Manager, January 2012 choose the Transaction Log option in the SQL Server Backup dialog box. Keep in mind that you must be using Full or Bulk-Logged Recovery Models, which will be explained below, in order to perform transaction-log backups. To perform a transaction-log backup with T-SQL, use the following syntax: BACKUP LOG { database_name | @database_name_var } { TO backup_device [ ,…n ] [ WITH [ BLOCKSIZE = { blocksize | @blocksize_variable } ] [ [ , ] DESCRIPTION = { ‘text‘ | @text_variable } ] [ [ ,] EXPIREDATE = { date | @date_var } | RETAINDAYS = { days | @days_var } ] [ [ , ] PASSWORD = { password | @password_variable } ] [ [ , ] FORMAT | NOFORMAT ] [ [ , ] { INIT | NOINIT } ] [ [ , ] MEDIADESCRIPTION = { ‘text‘ | @text_variable } ] [ [ , ] MEDIANAME = { media_name | @media_name_variable } ] [ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ] [ [ , ] NAME = { backup_set_name | @backup_set_name_var } ] [ [ , ] NO_TRUNCATE ] [ [ , ] { NORECOVERY | STANDBY =undo_file_name } ] [ [ , ] { NOREWIND | REWIND } ] [ [ , ] { NOSKIP | SKIP } ] [ [ , ] { NOUNLOAD | UNLOAD } ] [ [ , ] RESTART ] [ [ , ] STATS [ =percentage ] ] For a detailed definition of each option, please see the description in SQL Books Online. You can perform the transaction-log backup by using the Backup Log command, as shown in Figure F. File-group backups A file-group backup lets you back up individual files or file groups. It basically allows you to back up a large database by spreading your backups out over time. This is a more granular type of backup that allows an admin to take a custom approach or to simply fill in the gaps of other backup methods. Using a database recovery model The database recovery model is a new feature that was added to SQL Server 2000. This model makes it easier to control your backups and disaster recovery options. SQL Server 7.0 options like selectinto/bulkcopy and trunc.logoncheckpoint have been replaced in SQL 2000 by the Simple, Full, and Bulk-Logged recovery models. Let’s take a look at the differences between these models. Specifying a recovery model To select a database recovery model, right-click on the database and choose Properties. Click thehttp://www.techrepublic.com/blog/datacenter/what-is-your-sql-server-backup-strategy/165[08/29/2012 3:08:59 PM]
  4. 4. What is your SQL Server backup strategy? | TechRepublic Options tab and select your recovery model. Simple recovery model The Simple recovery model is similar to the trunc.logoncheckpoint option in SQL Server 7.0. This recovery plan always truncates your transaction log and constantly removes transactions that have been committed. Because of this, the transaction log cannot be backed up, which leaves you with only two backup options: full and differential. If you try to back up the transaction log when using a Simple recovery model, you will receive this error message: “The backup log is not allowed while the recovery model is Simple.” Full and Bulk-Logged recovery models The Full and Bulk-Logged options add an administration and space burden but provide the maximum protection for your data. The Full recovery model provides you with better flexibility for recovering databases to an earlier point in time. The Bulk-Logged model provides higher performance and lower log space usage than Full recovery but does not provide as much protection. Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters. Passing table valued Talking intelligently about parameters in SQL Server virtualization 2008 1 Join the conversation! Add Your Opinion Comments Follow via: Staff Picks Top Rated Most Recent My Contacts See All Comments Remote Backup Strategy 0 AlexGreen86 3rd Jul 2011 Votes We have a central office with SQL Server 2005 Standard and two branches with SQL Express. We perform daily backups on each office. Because SQL Express cannot act as Publisher in Replication, we must... Read Whole Comment + View in thread See all comments Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion. Join Loginhttp://www.techrepublic.com/blog/datacenter/what-is-your-sql-server-backup-strategy/165[08/29/2012 3:08:59 PM]