Restore Members

The Restore object provides programmatic access to restore operations.

The following tables list the members exposed by the Restore type.

Public Constructors

  名称 Description
Restore Initializes a new instance of the Restore class.

顶部

Public Fields

(see also Protected Fields )

  名称 Description
ms220122.pubfield(zh-cn,SQL.90).gif VerifyComplete Specifies the VerifyCompleteEventHandler.

顶部

Protected Fields

  名称 Description
ms220122.protfield(zh-cn,SQL.90).gif currentAsyncOperation  (inherited from BackupRestoreBase )
ms220122.protfield(zh-cn,SQL.90).gif m_BackupAction  (inherited from BackupRestoreBase )
ms220122.protfield(zh-cn,SQL.90).gif m_LogTruncation  (inherited from BackupRestoreBase )
ms220122.protfield(zh-cn,SQL.90).gif m_RestoreAction  (inherited from BackupRestoreBase )

顶部

Public Properties

  名称 Description
ms220122.pubproperty(zh-cn,SQL.90).gif Action Gets or sets the type of restore to be performed.
ms220122.pubproperty(zh-cn,SQL.90).gif AsyncStatus  Gets the asynchronous status of a backup or restore process. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif Checksum  Gets or sets a Boolean property value that determines whether a checksum value is calculated during backup or restore operations. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif ClearSuspectPageTableAfterRestore Gets or sets a Boolean value that determines whether entries in the suspect page table will be deleted following the restore operation.
ms220122.pubproperty(zh-cn,SQL.90).gif ContinueAfterError  Gets or sets a Boolean property value that determines whether the backup or restore continues after a checksum error occurs. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif Database  Gets or sets the database on which the backup or restore operation runs. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif DatabaseFileGroups  Gets the Microsoft SQL Server file groups targeted by the backup or restore operation. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif DatabaseFiles  Gets the operating system files targeted by the backup or restore operation. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif Devices  Gets the backup devices specified for the backup or restore operation. This property is not CLS-compliant. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif FileNumber Gets or sets the index number used to identify the targeted backup set on the backup medium.
ms220122.pubproperty(zh-cn,SQL.90).gif KeepReplication Gets or sets a Boolean property value that specifies whether to maintain a replication configuration during a restore operation.
ms220122.pubproperty(zh-cn,SQL.90).gif MediaName  Gets or sets the name used to identify a particular media set. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif NoRecovery  Gets or sets a Boolean property value that determines whether the tail of the log is backed up and whether the database is restored into the Restoring state. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif NoRewind  Gets or sets a Boolean property value that determines whether Microsoft SQL Server will keep the tape open after the backup or restore operation. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif Offset Gets or sets the array of page addresses to be restored.
ms220122.pubproperty(zh-cn,SQL.90).gif Partial Gets or sets a Boolean property value that specifies whether a partial or full restore operation will be performed.
ms220122.pubproperty(zh-cn,SQL.90).gif PercentCompleteNotification  Gets or sets the percentage interval for PercentCompleteEventHandler event handler calls. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif RelocateFiles Gets or sets the array of database logical file names and operating system physical file names used to redirect database storage when a database is restored to a new physical location.
ms220122.pubproperty(zh-cn,SQL.90).gif ReplaceDatabase Gets or sets a Boolean value that specifies whether a restore operation creates a new image of the restored database.
ms220122.pubproperty(zh-cn,SQL.90).gif Restart  Gets or sets a Boolean property value that determines whether the backup or restore operation will restart if it is interrupted. (inherited from BackupRestoreBase)
ms220122.pubproperty(zh-cn,SQL.90).gif RestrictedUser Gets or sets a Boolean property value that specifies whether access to the restored database is restricted to members of the db_owner fixed database role and the dbcreator and sysadmin fixed server roles.
ms220122.pubproperty(zh-cn,SQL.90).gif StandbyFile Gets or sets the name of an undo file used as part of the imaging strategy for a Microsoft SQL Server instance.
ms220122.pubproperty(zh-cn,SQL.90).gif StopAtMarkAfterDate Gets or sets the date to be used in conjunction with the mark name specified by StopAtMarkName to determine the stopping point of the recovery operation.
ms220122.pubproperty(zh-cn,SQL.90).gif StopAtMarkName Gets or sets the mark name to be used in conjunction with the date specified by StopAtMarkAfterDate to determine the stopping point of the recovery operation.
ms220122.pubproperty(zh-cn,SQL.90).gif StopBeforeMarkAfterDate Gets or sets the date to be used in conjunction with the mark name specified by StopBeforeMarkName to determine the stopping point of the recovery operation.
ms220122.pubproperty(zh-cn,SQL.90).gif StopBeforeMarkName Gets or sets the mark name to be used in conjunction with the date specified by StopBeforeMarkAfterDate to determine the stopping point of the recovery operation.
ms220122.pubproperty(zh-cn,SQL.90).gif ToPointInTime Gets or sets the endpoint for database log restoration.
ms220122.pubproperty(zh-cn,SQL.90).gif UnloadTapeAfter  Gets or sets a Boolean property value that determines whether tape media are rewound and unloaded after the backup or restore operation completes. (inherited from BackupRestoreBase)

顶部

Public Methods

(see also Protected Methods )

  名称 Description
ms220122.pubmethod(zh-cn,SQL.90).gif Abort  Terminates a running backup or restore operation. (inherited from BackupRestoreBase)
ms220122.pubmethod(zh-cn,SQL.90).gif ClearSuspectPageTable Deletes entries in the suspect page table.
ms220122.pubmethod(zh-cn,SQL.90).gif Equals  Overloaded. (inherited from Object )
ms220122.pubmethod(zh-cn,SQL.90).gif GetHashCode  (inherited from Object )
ms220122.pubmethod(zh-cn,SQL.90).gif GetType  (inherited from Object )
ms220122.pubmethod(zh-cn,SQL.90).gif ReadBackupHeader Reads the backup header and returns information about the media contents.
ms220122.pubmethod(zh-cn,SQL.90).gif ReadFileList Returns the list of database files on the targeted media.
ms220122.pubmethod(zh-cn,SQL.90).gif ReadMediaHeader Reads the media header and returns the media header values.
ms220122.pubmethod(zh-cn,SQL.90).gif ReadSuspectPageTable Returns the suspect page table for the targeted Microsoft SQL Server instance.
ms220122.pubmethod(zh-cn,SQL.90).gifms220122.static(zh-cn,SQL.90).gif ReferenceEquals  (inherited from Object )
ms220122.pubmethod(zh-cn,SQL.90).gif Script Generates a Transact-SQL script that can be used to re-create the restore operation.
ms220122.pubmethod(zh-cn,SQL.90).gif SetMediaPassword  Overloaded. (inherited from BackupRestoreBase )
ms220122.pubmethod(zh-cn,SQL.90).gif SetPassword  Overloaded. (inherited from BackupRestoreBase )
ms220122.pubmethod(zh-cn,SQL.90).gif SqlRestore Performs a restore operation.
ms220122.pubmethod(zh-cn,SQL.90).gif SqlRestoreAsync Performs a restore operation asynchronously.
ms220122.pubmethod(zh-cn,SQL.90).gif SqlVerify Overloaded. Checks the media on the Microsoft SQL Server instance represented by the specified Server object.
ms220122.pubmethod(zh-cn,SQL.90).gif SqlVerifyAsync Overloaded. Checks the media on the Microsoft SQL Server instance represented by the specified Server object asynchronously.
ms220122.pubmethod(zh-cn,SQL.90).gif SqlVerifyLatest Overloaded. Verifies the most recent backup but does not restore it, and checks to see that the backup set is complete and the entire backup is readable.
ms220122.pubmethod(zh-cn,SQL.90).gif ToString  (inherited from Object )
ms220122.pubmethod(zh-cn,SQL.90).gif Wait  Waits for the current backup or restore operation to complete before moving on to the next process. (inherited from BackupRestoreBase)

顶部

Protected Methods

  名称 Description
ms220122.protmethod(zh-cn,SQL.90).gif ExecuteSql  (inherited from BackupRestoreBase )
ms220122.protmethod(zh-cn,SQL.90).gif ExecuteSqlAsync  (inherited from BackupRestoreBase )
ms220122.protmethod(zh-cn,SQL.90).gif ExecuteSqlWithResults  (inherited from BackupRestoreBase )
ms220122.protmethod(zh-cn,SQL.90).gif Finalize  (inherited from Object )
ms220122.protmethod(zh-cn,SQL.90).gif GetDevicesScript  (inherited from BackupRestoreBase )
ms220122.protmethod(zh-cn,SQL.90).gif IsStringValid  (inherited from BackupRestoreBase )
ms220122.protmethod(zh-cn,SQL.90).gif MemberwiseClone  (inherited from Object )

顶部

Public Events

  名称 Description
ms220122.pubevent(zh-cn,SQL.90).gif Complete  Occurs when the backup or restore operation completes. (inherited from BackupRestoreBase)
ms220122.pubevent(zh-cn,SQL.90).gif Information  Occurs when any informational message is issued by Microsoft SQL Server that cannot be handled by the CompleteNextMedia or PercentComplete events. (inherited from BackupRestoreBase)
ms220122.pubevent(zh-cn,SQL.90).gif NextMedia  Occurs when the backup or restore operation exhausts the medium in a target device. (inherited from BackupRestoreBase)
ms220122.pubevent(zh-cn,SQL.90).gif PercentComplete  Occurs when a backup or restore operation reaches a completion unit. (inherited from BackupRestoreBase)

顶部

请参阅

参考

Restore Class
Microsoft.SqlServer.Management.Smo Namespace

其他资源

Backing Up and Restoring Databases and Transaction Logs
RESTORE (Transact-SQL)
在 SQL Server 中备份和还原数据库