你是否遇见过这样的情况,每天进行正常的数据库备份。但是当需要从备份中恢复数据库的时候却失败了?本脚本就是对备份进行校验,保证恢复的成功。 备份 SQL Server USE MASTER-- Add a new backup device-- Ensure that the SQL Server can read from the phy
你是否遇见过这样的情况,每天进行正常的数据库备份。但是当需要从备份中恢复数据库的时候却失败了?本脚本就是对备份进行校验,保证恢复的成功。 备份 SQL ServerUSE 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'
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号