Recmmended Backup Plan fr SQL 2000 Server Database Servers (DAISI) General Ntes STI recmmends that data backup be perfrmed n a regular basis. Transactin Lg Backup Users shuld nt truncate the Transactin lg unless there is a prblem. It is imprtant fr bth the Transactin lg and the server t be backed up. Transactin lgs shuld be backed up at least every tw hurs thrughut the day, Mnday thrugh Friday, starting at 7am and running thrugh 6pm. The SQL Server Agent jbs fund within the SQL Server Management Cnsle may be used t schedule lg dumps t run autmatically. Transactin lg backups are nt necessary n the master, mdel, msdb, tempdb r any ther lw transactinal databases. Full Backups Users perfrm full backups f all databases at least nce every day. Recmmended backup startup time is 12:00am daily, Sunday thrugh Friday. A SQL Server Agent jb fund within the SQL Server Management Cnsle may be used t schedule these backups t run autmatically. An example f this is given belw in this dcument. It is nt necessary t back up the tempdb database. This includes backing up the system databases t include master, mdel, distributin and msdb databases. Backup Strage It is suggested that users back up t the lcal disc and mve the file t a netwrk drive; r back up directly t a netwrk drive and then t tape nce a 24-hur backup set is created. Use f a backup device within SQL Server allws fr a cleaner backup set, which typically results in an easier data restratin when necessary. If the distributin database gets very large in size, wrk n truncating the database. Back up lg [database name] with truncate_nly (run this in query analyzer). Open enterprise manager and expand the server tree. (DAISI) 1
Right-click n the database and select All tasks. Shrink database. Click the bttm buttn (n right side f frm) fr files. Select sql lg file (default is data file, s be sure t change this selectin). Click OK. D nt, under any circumstances, delete the.mdf r the.ldf files. Perfrming the Database Backup The DAISI, DISTRIBUTION, MODEL, MASTER and MSDB databases shuld be backed up regularly. Steps t perfrm the database backup are as fllws (DAISI is used as an example belw): 1. Select Start Prgrams Micrsft SQL Server Enterprise Manager. 2. Expand the ndes as shwn in the screen sht belw t display the cntents f the Management flder. Right-click n the Database Maintenance Plans nde, then select New Maintenance Plan frm the menu prvided. (DAISI) 2
3. Select Next t begin the creatin f a new plan, then click Next again t cntinue. 4. Select each database listed abve in the list prvided, then click Next t cntinue. (DAISI) 3
5. Select the Rerganize data and Remve unused space ptins, then click Next. Nte: By default, this part f the jb will run at 1:00am every Sunday. T change this schedule, click n the Change buttn t the right f the Schedule field and use the frm prvided t make mdificatins. When creating a new schedule, be certain there is n cnflict between this prcedure and any ther autmated prcesses, such as data backups. Click Next t cntinue. 6. Select the Check database integrity and Attempt t repair any minr prblems ptins as shwn belw, then click Next. Nte: By default, this part f the jb will run at 12:00am every Sunday (that is, at midnight n Saturday night). T change this schedule and make it run nce every day, click n the Change buttn t the right f the Schedule field and use the frm prvided t make mdificatins. When creating a new schedule, be certain there is n cnflict between this prcedure and any ther autmated prcesses, such as data backups. Click Next t cntinue. (DAISI) 4
7. Select the ptin that will be used when backing up the database: Either accept the scheduled day/time, r click the Change buttn t chse a new day and time. Chse whether t back up t a Tape device if desired (this ptin may nly be selected if the tape device is cnnected directly t the server), r t Disk (the server s hard drive). Click Next t cntinue. 8. Either accept the default directry, r select Use this directry t change t a different directry. Befre making this decisin, determine the size f the database and cmpare this t the available free space n the hard drive selected. The backup file will be rughly equal t the size f the actual database, s be sure t select a drive with sufficient space. The backup file will be stred in the selected directry with a file name such as daisi_db_200405062202.bak. This file name will represent the name f the database, alng with the date and time f the backup. The file extensin will be.bak unless the user specifies therwise. (DAISI) 5
Als, cnsider allwing SQL t remve backup files autmatically t help manage disk usage. Select the checkbx (shwn in the screen sht abve) labeled Remve files lder than and enter criteria t determine hw lng t keep backup files befre they are deleted. 9. In the example shwn belw, a backup will be perfrmed nce per week and the utility has been set t remve backup files lder than ne week. This means that there will always be ne backup file stred n the drive at any particular time. Since this file will exist while a new ne is being created, the drive selected t stre backups must have enugh strage space available t hld at least tw times the size f the database. Immediately after the backup is perfrmed each week, the ldest file will autmatically be deleted. 10. Click Next t cntinue. 11. Select the ptin t back up the Transactin lg. Click Next t cntinue. (DAISI) 6
12. If desired, select the ptin t Write reprt t a text file upn cmpletin f each backup. This will create a reprt describing the maintenance prcedure. Click Next t cntinue. 13. Take the default ptins n the Maintenance Plan histry screen, and then click Next t cntinue. (DAISI) 7
14. If desired, change the Plan name t smething mre descriptive, and then click Finish. 15. Click OK t clse the prmpt indicating that the plan has been successfully created. Please nte: It is recmmended the Nrthwind and pubs databases be drpped/deleted if the systems d nt use them fr testing purpses. Additinal Recmmendatins Make sure the replicatin flders are nt being scanned by anti-virus sftware. Make sure system administratrs exclude the shared flder \\<servername>\repldata$ frm the scan. (DAISI) 8