none
restore database(or log) with standby后再restore log with standby,sql server是如何处理? RRS feed

  • 问题

  • 个人的理解是,再一次 restore log with standby之前, sql server先将前一次standy记录的撤销操作的文件还原进数据库,然后还原本次的log,最后将需要撤销的操作再次写入文件。请问我这样的理解对吗?

    2010年12月12日 14:13

答案

  • Books online has details under 'Restore Arguments (Transact-SQL)':

    The standby file is used to keep a "copy-on-write" pre-image for pages modified during the undo pass of a RESTORE WITH STANDBY. The standby file allows a database to be brought up for read-only access between transaction log restores and can be used with either warm standby server situations or special recovery situations in which it is useful to inspect the database between log restores. After a RESTORE WITH STANDBY operation, the undo file is automatically deleted by the next RESTORE operation. If this standby file is manually deleted before the next RESTORE operation, then the entire database must be re-restored. While the database is in the STANDBY state, you should treat this standby file with the same care as any other database file. Unlike other database files, this file is only kept open by the Database Engine during active restore operations.

    The standby_file_name specifies a standby file whose location is stored in the log of the database. If an existing file is using the specified name, the file is overwritten; otherwise, the Database Engine creates the file.

    The size requirement of a given standby file depends on the volume of undo actions resulting from uncommitted transactions during the restore operation.

    • 已标记为答案 jarrodchen 2010年12月13日 3:50
    2010年12月12日 20:52

全部回复

  • Books online has details under 'Restore Arguments (Transact-SQL)':

    The standby file is used to keep a "copy-on-write" pre-image for pages modified during the undo pass of a RESTORE WITH STANDBY. The standby file allows a database to be brought up for read-only access between transaction log restores and can be used with either warm standby server situations or special recovery situations in which it is useful to inspect the database between log restores. After a RESTORE WITH STANDBY operation, the undo file is automatically deleted by the next RESTORE operation. If this standby file is manually deleted before the next RESTORE operation, then the entire database must be re-restored. While the database is in the STANDBY state, you should treat this standby file with the same care as any other database file. Unlike other database files, this file is only kept open by the Database Engine during active restore operations.

    The standby_file_name specifies a standby file whose location is stored in the log of the database. If an existing file is using the specified name, the file is overwritten; otherwise, the Database Engine creates the file.

    The size requirement of a given standby file depends on the volume of undo actions resulting from uncommitted transactions during the restore operation.

    • 已标记为答案 jarrodchen 2010年12月13日 3:50
    2010年12月12日 20:52
  • 谢谢。 看来还是得勤查联机手册。
    2010年12月13日 0:26