The object provides programmatic access to restore operations.
Assembly: Microsoft.SqlServer.SmoExtended (in Microsoft.SqlServer.SmoExtended.dll)
By using a object you can do the following:
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: disk, tape, 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. Half of a backup cannot be written to a tape device and the other half to a disk.
At a minimum, supply values for a restore source when using a object. Use one media type property to specify the restore operation source.
Setting other properties in the object may be required by the restore operation desired.
Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
To get object properties, users can be a member of the public fixed server role.
To set object properties, users must have CREATE DATABASE permission on the server, or be a member of sysadmin or dbcreator fixed server roles, or be a member of db_owner fixed database role.
To perform a restore operation, users must have CREATE DATABASE permission on the server, or be a member of sysadmin or dbcreator fixed server roles. If the database already exists, then members of the db_owner fixed database role can also perform a restore operation.