あるサーバーから別のサーバーにDBを復元する毎日のプロセスがあります。DBのデータベースバックアップファイルを復元し、TLogバックアップファイルが見つかった場合はそれらも復元します。
このプロセスはしばらくの間問題なく機能します。今日は失敗しましたエラーメッセージ:
Message
Executed as user: AOI\sa_SqlAgentSrv_PRD. RegQueryValueEx() returned error 2, 'The system cannot find the file specified.' [SQLSTATE 01000] (Message 22001) IF EXISTS (select * from sysdatabases where name = 'SiteDbStandby') ALTER DATABASE SiteDbStandby SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [SiteDbStandby] FROM DISK = '\\SqlBackup\Databases\SiteDb.bak' WITH NORECOVERY , REPLACE , MOVE 'SiteDb_data' to 'G:\MSSQL10.DB2\MSSQL\DATA\SiteDbStandby_SiteDb_data.mdf' , MOVE 'SiteDb_log' to 'J:\MSSQL10.DB2\MSSQL\DATA\SiteDbStandby_SiteDb_log.ndf' [SQLSTATE 01000] (Message 0) Processed 191216 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 4 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE DATABASE successfully processed 191220 pages in 20.366 seconds (73.352 MB/sec). [SQLSTATE 01000] (Message 3014)
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120916_011017.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120916_021929.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120916_031349.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120915_231017.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120916_001017.BAK' WITH NORECOVERY [SQLSTATE 01000] (Message 0) The log in this backup set begins at LSN 42459000001303500001, which is too recent to apply to the database. An earlier log backup that includes LSN 42459000001302800001 can be restored. [SQLSTATE 42000] (Error 4305) RESTORE LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.
午前1時から16.9のログファイル、午前2時から16.9のログファイル、午前3時から16.9のログファイル、午後23時から15.9のログファイル、午前12時から16.9のログファイルを復元しようとしていることがわかります。 。
ログの復元シーケンスが台無しになりました。
私は仕事の歴史を振り返りました、私たちは毎日約3週間の死刑執行の歴史を持っています。それぞれの実行において、順序は正しいです。例えば:
Executed as user: AOI\sa_SqlAgentSrv_PRD. RegQueryValueEx() returned error 2, 'The system cannot find the file specified.' [SQLSTATE 01000] (Message 22001) IF EXISTS (select * from sysdatabases where name = 'SiteDbStandby') ALTER DATABASE SiteDbStandby SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATABASE [SiteDbStandby] FROM DISK = '\\SqlBackup\Databases\SiteDb.bak' WITH NORECOVERY , REPLACE , MOVE 'SiteDb_data' to 'G:\MSSQL10.DB2\MSSQL\DATA\SiteDbStandby_SiteDb_data.mdf' , MOVE 'SiteDb_log' to 'J:\MSSQL10.DB2\MSSQL\DATA\SiteDbStandby_SiteDb_log.ndf' [SQLSTATE 01000] (Message 0) Processed 191032 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 6 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE DATABASE successfully processed 191038 pages in 21.703 seconds (68.768 MB/sec). [SQLSTATE 01000] (Message 3014)
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120914_231026.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120915_001019.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120915_011032.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120915_021140.BAK' WITH NORECOVERY
RESTORE LOG SiteDbStandby FROM DISK = '\\SqlBackup\Logs\SiteDb_20120915_031053.BAK' WITH NORECOVERY [SQLSTATE 01000] (Message 0) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 7 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE LOG successfully processed 7 pages in 0.009 seconds (5.588 MB/sec). [SQLSTATE 01000] (Message 3014) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE LOG successfully processed 0 pages in 0.009 seconds (0.000 MB/sec). [SQLSTATE 01000] (Message 3014) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 1229 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE LOG successfully processed 1229 pages in 0.196 seconds (48.965 MB/sec). [SQLSTATE 01000] (Message 3014) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 3 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE LOG successfully processed 3 pages in 0.013 seconds (1.277 MB/sec). [SQLSTATE 01000] (Message 3014) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_data' on file 1. [SQLSTATE 01000] (Message 4035) Processed 0 pages for database 'SiteDbStandby', file 'SiteDb_log' on file 1. [SQLSTATE 01000] (Message 4035)
RESTORE LOG successfully processed 0 pages in 0.009 seconds (0.000 MB/sec). [SQLSTATE 01000] (Message 3014)
use master restore database SiteDbStandby with recovery [SQLSTATE 01000] (Message 0)
RESTORE DATABASE successfully processed 0 pages in 4.360 seconds (0.000 MB/sec). [SQLSTATE 01000] (Message 3014) use SiteDbStandby ALTER AUTHORIZATION ON DATABASE::SiteDbStandby TO sa ALTER DATABASE SiteDbStandby SET COMPATIBILITY_LEVEL = 100 [SQLSTATE 01000] (Message 0). The step succeeded.
したがって、正しい順序は、前日の午後11時、当日の午前12時、当日の午前1時、午前2時、および午前3時です。
すべてのログは、共有フォルダディレクトリに存在します。すべてが正常に見えます。
なぜ仕事が失敗したのかという考えを思いついたのですか?
前もって感謝します、
ロニ。