检验SQL Server备份的脚本
本文导语: 检验SQL Server备份的脚本 代码如下: USE MASTER -- Add a new backup device -- Ensure that the SQL Server can read from the physical location where the backup is placed -- TYPE NAME PHYSICAL LOCATION EXEC SP_ADDUMPDEVICE 'disk','networkdrive','\VPCW2K8Database BackupTest.bak'...
检验SQL Server备份的脚本
USE MASTER
-- Add a new backup device
-- Ensure that the SQL Server can read from the physical location where the backup is placed
-- TYPE NAME PHYSICAL LOCATION
EXEC SP_ADDUMPDEVICE 'disk','networkdrive','\VPCW2K8Database BackupTest.bak'
-- Execute the Restore operation in VERIFY ONLY mode
-- Provide the actual paths where you plan to restore the database.
-- This is because VERIFYONLY also checks for available space
RESTORE
VERIFYONLY
FROM networkdrive
WITH
MOVE N'TESTDB_DATA' TO N'E:TestDBTestDB_Data.mdf',
MOVE N'TESTDB_INDEXES' TO N'E:TestDBTestDB_Idx.mdf',
MOVE N'TESTDB_LOG' TO N'E:TestDBTestDB_LOG.ldf'
-- DROP THE DEVICE
-- Name, Physical File (OPTIONAL - if present, the file is deleted)
EXEC SP_DROPDEVICE 'networkdrive'
您可能感兴趣的文章:
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。