Recommended Backup Plan for SQL Server Database

advertisement

Recommended Backup Plan for SQL 2000 Server Database

Servers (DAISI)

General Notes

STI recommends that data backup be performed on a regular basis.

Transaction Log Backup

Users should not truncate the Transaction log unless there is a problem. It is important for both the

Transaction log and the server to be backed up.

Transaction logs should be backed up at least every two hours throughout the day, Monday through Friday, starting at 7am and running through 6pm. The SQL Server Agent jobs found within the SQL Server Management Console may be used to schedule log dumps to run automatically. Transaction log backups are not necessary on the master , model , msdb , tempdb or any other low transactional databases.

Full Backups

Users perform full backups of all databases at least once every day. Recommended backup startup time is 12:00am daily, Sunday through Friday. A SQL Server Agent job found within the SQL

Server Management Console may be used to schedule these backups to run automatically. An example of this is given below in this document. It is not necessary to back up the tempdb database. This includes backing up the system databases to include master, model, distribution and msdb databases.

Backup Storage

It is suggested that users back up to the local disc and move the file to a network drive; or back up directly to a network drive and then to tape once a 24-hour backup set is created. Use of a backup device within SQL Server allows for a cleaner backup set, which typically results in an easier data restoration when necessary.

If the distribution database gets very large in size, work on truncating the database. o Back up log [ database name ] with truncate_only (run this in query analyzer). o Open enterprise manager and expand the server tree.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

1

o Right-click on the database and select All tasks . o Shrink database. o Click the bottom button (on right side of form) for files. o Select sql log file (default is data file , so be sure to change this selection). o Click OK .

Do not, under any circumstances, delete the .mdf

or the .ldf

files.

Performing the Database Backup

The DAISI , DISTRIBUTION , MODEL , MASTER and MSDB databases should be backed up regularly.

Steps to perform the database backup are as follows ( DAISI is used as an example below):

1.

Select Start | Programs | Microsoft SQL Server | Enterprise Manager .

2.

Expand the nodes as shown in the screen shot below to display the contents of the Management folder. Right-click on the Database Maintenance Plans node, then select New Maintenance

Plan from the menu provided.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

2

3.

Select Next to begin the creation of a new plan, then click Next again to continue.

4.

Select each database listed above in the list provided, then click Next to continue.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

3

5.

Select the Reorganize data… and Remove unused space… options, then click Next .

Note: By default, this part of the job will run at 1:00am every Sunday. To change this schedule, click on the Change button to the right of the Schedule field and use the form provided to make modifications. When creating a new schedule, be certain there is no conflict between this procedure and any other automated processes, such as data backups.

Click Next to continue.

6.

Select the Check database integrity and Attempt to repair any minor problems options as shown below, then click Next .

Note: By default, this part of the job will run at 12:00am every Sunday (that is, at midnight on Saturday night). To change this schedule and make it run once every day, click on the Change button to the right of the Schedule field and use the form provided to make modifications. When creating a new schedule, be certain there is no conflict between this procedure and any other automated processes, such as data backups. Click

Next to continue.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

4

7.

Select the option that will be used when backing up the database:

Either accept the scheduled day/time, or click the Change button to choose a new day and time.

Choose whether to back up to a Tape device if desired (this option may only be selected if the tape device is connected directly to the server), or to Disk (the server’s hard drive).

Click Next to continue.

8.

Either accept the default directory, or select Use this directory to change to a different directory.

Before making this decision, determine the size of the database and compare this to the available free space on the hard drive selected. The backup file will be roughly equal to the size of the actual database, so be sure to select a drive with sufficient space.

The backup file will be stored in the selected directory with a file name such as daisi_db_200405062202.BAK

. This file name will represent the name of the database, along with the date and time of the backup. The file extension will be .bak

unless the user specifies otherwise.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

5

Also, consider allowing SQL to remove backup files automatically to help manage disk usage.

Select the checkbox (shown in the screen shot above) labeled Remove files older than… and enter criteria to determine how long to keep backup files before they are deleted.

9.

In the example shown below, a backup will be performed once per week and the utility has been set to remove backup files older than one week. This means that there will always be one backup file stored on the drive at any particular time. Since this file will exist while a new one is being created, the drive selected to store backups must have enough storage space available to hold at least two times the size of the database. Immediately after the backup is performed each week, the oldest file will automatically be deleted.

10.

Click Next to continue.

11.

Select the option to back up the Transaction log. Click Next to continue.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

6

12.

If desired, select the option to Write report to a text file… upon completion of each backup. This will create a report describing the maintenance procedure. Click Next to continue.

13.

Take the default options on the Maintenance Plan history screen, and then click Next to continue.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

7

14.

If desired, change the Plan name to something more descriptive, and then click Finish .

15.

Click OK to close the prompt indicating that the plan has been successfully created.

Please note: It is recommended the Northwind and pubs databases be dropped/deleted if the systems do not use them for testing purposes.

Additional Recommendations

Make sure the replication folders are not being scanned by anti-virus software.

Make sure system administrators exclude the shared folder \\<servername>\repldata$ from the scan.

Quick Ref Guide STI_121610 Recommended Backup Plan for SQL 2000 Server Database Servers

(DAISI)

8

Download