次の方法で共有


Restore Object

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The Restore object defines the behavior of a RESTORE statement for a Microsoft SQL Server database or log.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

Action Property (Restore)

MediaName Property

Database Property

PercentCompleteNotification Property

DatabaseFileGroups Property

RelocateFiles Property

DatabaseFiles Property

ReplaceDatabase Property

Devices Property

Restart Property

FileNumber Property

StandbyFiles Property

Files Property

Tapes Property

LastRestore Property

ToPointInTime Property

LoadHistory Property

UnloadTapeAfter Property

Methods

Abort Method

ReadMediaHeader Method (Restore)

GenerateSQL Method (Backup, Restore)

SQLRestore Method

ReadBackupHeader Method (Restore)

SQLVerify Method

ReadFileList Method

 

Events

Complete Event

PercentComplete Event

NextMedia Event

 

解説

With the Restore object you can:

  • Restore all or part of a database.
  • Restore backup images of transaction log records.
  • Verify the integrity of backup media.
  • Report the contents of backup media.
  • Monitor a restore operation, reporting status to the user.

SQL Server can write a backup to one of four media types: a disk, a tape, a named pipe, or a backup device. SQL Server supports backup striping. A striped backup is one directed to more than a single device. Striping is supported to a single media type only. That is, a backup can be written to two tape devices. A backup cannot be written half to a tape device and the other half to a disk.

At a minimum, supply values for a restore source when using the Restore object. SQL Distributed Management Objects (SQL-DMO) implements supported media types in the Restore object properties Files, Devices, Pipes, and Tapes. Use one media type property to specify the restore operation source.

Setting other properties in the Restore object may be required by the restore operation you want to use. For example, before using the SQLRestore method, you must set the Database property of the Restore object.

ms141195.note(ja-jp,SQL.90).gifメモ :
The Restore object is compatible with instances of SQL Server versions 7.0 and later. However, the Restore2 object extends the functionality of the Restore object for use with features that were introduced in SQL Server 2000.

To perform a complete database restore

  1. Create a Restore object.

  2. Set a media property, naming the source device or devices.

  3. Set the Database property to indicate the target database.

  4. If necessary, set the ReplaceDatabase property to force database creation.

  5. Call the SQLRestore method.

To restore a single unit of a database log

  1. Create a Restore object.

  2. Set the Action property to SQLDMORestore_Log.

  3. Set a media property, naming the source device or devices.

  4. Set the Database property to indicate the target database.

  5. Call the SQLRestore method.

To restore a database log chain

  1. Create a Restore object.

  2. Set the Action property to SQLDMORestore_Log.

  3. Set the Database property to indicate the target database.

  4. Set the LastRestore property to FALSE.

  5. Set a media property, naming the source device or devices.

  6. Call the SQLRestore method.

  7. Repeat Steps 5 and 6 for all but the last unit in the database log chain.

  8. Set the LastRestore property to TRUE.

  9. Call the SQLRestore method to restore the last unit.

To verify the integrity of backup media

  1. Create a Restore object.

  2. Set a media property, naming the source device or devices.

  3. Call the SQLVerify method.

参照

関連項目

Restore2 Object

ヘルプおよび情報

SQL Server 2005 の参考資料の入手