INF: Database Device File Image Backup and sp_dboption |
Q134788
One of the advantages of using Microsoft SQL Server version 6.0 is the
variety of methods that can be used to perform a database backup. This
article explores a variation of the file image backup.
There are two tape formats used on the Windows NT platform, and they are
incompatible with each other. The first is the tape format supported by
Windows NT, NTBACKUP.EXE, and other third party tape archiving products
which use the Microsoft Tape Format (MTF). The second is the SQL Server
tape format. In some scenarios, customers have elected to have an operator
change tapes in between NTBackup's backup operation, and those database
dumps to tape performed by SQL Server. Other customers have chosen to have
SQL Server dump to disk, and then use NTBackup to archive this dump to tape.
There are two basic backup strategies for SQL Server. The primary backup
strategy for SQL Server is the database dump which can then be loaded in a
recovery scenario. This method is used primarily by companies whose servers
must be in operation 7 days a week and 24 hours a day. Many of these
companies also use the hot backup server strategy in which the dump is
loaded to the backup server. These SQL Server database dumps are frequently
performed to disk locally, to a network drive, and to tape.
The second basic SQL Server backup strategy is the use of a file image
backup, where SQL Server is shutdown and the all the database device files
are archived to tape using NTBackup. Because this method uses the NET
STOP/NET START SQL Server commands, most customers use this method by
combining batch scripts which are setup using the AT command and run by the
Windows NT Scheduler Service.
With the release of SQL Server version 6.0, you can perform some of the
same operations without stopping SQL Server and select which databases and
the associated device files are archived to tape. Before going further,
there are several precautions that must be stated:
sp_dboption test,offline,true
go
Database is now offline
Closing device 'testdata' and marking it 'deferred'.
Device option set.
Closing device 'testlog' and marking it 'deferred'.
Device option set.
select name,dbid,status,mode
from master..sysdatabases
where dbid = db_name('test')
name dbid status mode
------------------------------ ------ ------ ------
test 6 524 0 Msg 5160, Level 16, State 1:
Cannot take 'test' offline because usecount=1.
Msg 15245, Level 16, State 1:
'DBCC DBCONTROL' error. Database not placed offline.
xp_cmdshell 'ntbackup backup c:\sql60\data /a /v
/d "Image Backup of Test Database" /t Incremental /tape:0'
sp_dboption test,offline,false
go
Opening device 'testdata' and marking it as non-deferred.
Device option set.
Opening device 'testlog' and marking it as non-deferred.
Device option set.
Recovering database 'test'
Database is now online.
Opening device 'testdata' and marking it as non-deferred.
Device option set.
Opening device 'testlog' and marking it as non-deferred.
Msg 5153, Level 16, State 1:
Failed to open device 'testlog', see errorlog for details.
Msg 15246, Level 16, State 1:
Cannot bring database online due to problem opening device 'testlog'. Additional query words: sql6 methods
Keywords : kbenv kbusage
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600
|
Last Reviewed: April 17, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |