Backup-Klasse
The Backup object provides programmatic access to Microsoft SQL Server backup operations.
Vererbungshierarchie
System.Object
Microsoft.SqlServer.Management.Smo.BackupRestoreBase
Microsoft.SqlServer.Management.Smo.Backup
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.SmoExtended (in Microsoft.SqlServer.SmoExtended.dll)
Syntax
'Declaration
Public NotInheritable Class Backup _
Inherits BackupRestoreBase
'Usage
Dim instance As Backup
public sealed class Backup : BackupRestoreBase
public ref class Backup sealed : public BackupRestoreBase
[<SealedAttribute>]
type Backup =
class
inherit BackupRestoreBase
end
public final class Backup extends BackupRestoreBase
Der Backup-Typ macht folgende Elemente verfügbar.
Konstruktoren
Name | Beschreibung | |
---|---|---|
![]() |
Backup | Initializes a new instance of the Backup class. |
Zum Anfang
Eigenschaften
Name | Beschreibung | |
---|---|---|
![]() |
Action | Gets or sets the type of backup to be performed. |
![]() |
AsyncStatus | Ruft den asynchronen Status eines Sicherungs- oder Wiederherstellungsvorgangs ab. (Geerbt von BackupRestoreBase.) |
![]() |
BackupSetDescription | Gets or sets a textual description for a particular backup set. |
![]() |
BackupSetName | Gets or sets the name used to identify a particular backup set. |
![]() |
BlockSize | Ruft die physische Blockgröße der Sicherung oder Wiederherstellung in Bytes ab oder legt sie fest. (Geerbt von BackupRestoreBase.) |
![]() |
BufferCount | Ruft die Gesamtanzahl von E/A-Puffern ab, die für den Sicherungs- oder Wiederherstellungsvorgang verwendet werden sollen, oder legt sie fest. (Geerbt von BackupRestoreBase.) |
![]() |
Checksum | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob im Verlauf von Sicherungs- oder Wiederherstellungsvorgängen ein Prüfsummenwert berechnet wird, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
CompressionOption | Gets or sets the backup compression option. |
![]() |
ContinueAfterError | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob die Sicherung oder Wiederherstellung nach einem Prüfsummenfehler fortgesetzt wird, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
CopyOnly | Gets or sets a Boolean property value that specifies the backup is a copy-only backup. This does not affect the sequence of backups in the usual backup schedule. |
![]() |
Database | Ruft die Datenbank ab, auf der der Sicherungs- oder Wiederherstellungsvorgang ausgeführt wird, oder legt sie fest. (Geerbt von BackupRestoreBase.) |
![]() |
DatabaseFileGroups | Ruft die SQL Server-Dateigruppen ab, die Ziel des Sicherungs- oder Wiederherstellungsvorgangs sind. (Geerbt von BackupRestoreBase.) |
![]() |
DatabaseFiles | Ruft die Betriebssystemdateien ab, die Ziel des Sicherungs- oder Wiederherstellungsvorgangs sind. (Geerbt von BackupRestoreBase.) |
![]() |
Devices | Ruft die für den Sicherungs- oder Wiederherstellungsvorgang angegebenen Sicherungsmedien ab. (Geerbt von BackupRestoreBase.) |
![]() |
ExpirationDate | Gets or sets the date and time when the backup set expires and the backup data is no longer considered relevant. |
![]() |
FormatMedia | Gets or sets a Boolean property value that determines whether a tape is formatted as the first step of the backup operation. |
![]() |
Incremental | Gets or sets a Boolean property value that determines whether to perform a differential backup. |
![]() |
Initialize | Gets or sets a Boolean property value that determines whether the devices associated with a backup operation are initialized as part of the backup operation. |
![]() |
LogTruncation | Gets or sets the method used to truncate the database log as part of the backup operation. |
![]() |
MaxTransferSize | Ruft die maximale Anzahl von Bytes ab, die zwischen den Sicherungsmedien und der SQL Server-Instanz übertragen werden sollen, oder legt sie fest. (Geerbt von BackupRestoreBase.) |
![]() |
MediaDescription | Gets or sets a textual description of the medium that contains a backup set. |
![]() |
MediaName | Ruft den Namen ab, der zur Identifikation eines bestimmten Mediensatzes verwendet wurde, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
Mirrors | Gets or sets the list of backup devices used by the mirrored backup. |
![]() |
NoRecovery | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob das Protokollfragment gesichert und die Datenbank in den Wiederherstellungsstatus wiederhergestellt wird, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
NoRewind | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob Microsoft SQL Server das Band nach dem Sicherungs- oder Wiederherstellungsvorgang offen hält, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
PercentCompleteNotification | Ruft das Prozentintervall für Aufrufe des PercentCompleteEventHandler-Ereignishandlers ab oder legt es fest. (Geerbt von BackupRestoreBase.) |
![]() |
Restart | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob der Sicherungs- oder Wiederherstellungsvorgang bei einer Unterbrechung neu gestartet wird, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
![]() |
RetainDays | Gets or sets the number of days that must elapse before a backup set can be overwritten. |
![]() |
SkipTapeHeader | Gets or sets Boolean property that determines whether the tape header is read. |
![]() |
UndoFileName | Gets or sets the name of the undo file used to store uncommitted transactions that are rolled back during recovery. |
![]() |
UnloadTapeAfter | Ruft einen Boolean-Eigenschaftswert ab, der bestimmt, ob Bandmedien zurückgespult und nach Ende des Sicherungs- oder Wiederherstellungsvorgangs entladen werden, oder legt ihn fest. (Geerbt von BackupRestoreBase.) |
Zum Anfang
Methoden
Name | Beschreibung | |
---|---|---|
![]() |
Abort | Beendet einen laufenden Sicherungs- oder Wiederherstellungsvorgang. (Geerbt von BackupRestoreBase.) |
![]() |
Equals | (Geerbt von Object.) |
![]() |
GetHashCode | (Geerbt von Object.) |
![]() |
GetType | (Geerbt von Object.) |
![]() |
Script | Returns a String containing the Transact-SQL statement that can be used to execute the referenced backup. |
![]() |
SetMediaPassword(SecureString) | Veraltet Legt das Kennwort für einen Mediensatz fest. (Geerbt von BackupRestoreBase.) |
![]() |
SetMediaPassword(String) | Veraltet Legt das Kennwort für einen Mediensatz fest. (Geerbt von BackupRestoreBase.) |
![]() |
SetPassword(SecureString) | Legt das Kennwort für einen Sicherungssatz fest. (Geerbt von BackupRestoreBase.) |
![]() |
SetPassword(String) | Legt das Kennwort für einen Sicherungssatz fest. (Geerbt von BackupRestoreBase.) |
![]() |
SqlBackup | Performs the database backup operation as specified by the properties of the Backup object used. |
![]() |
SqlBackupAsync | Performs the database backup operation asynchronously as specified by the properties of the Backup object used. |
![]() |
ToString | (Geerbt von Object.) |
![]() |
Wait | Wartet das Ende des aktuellen Sicherungs- oder Wiederherstellungsvorgangs ab, bevor der nächste Prozess gestartet wird. (Geerbt von BackupRestoreBase.) |
Zum Anfang
Ereignisse
Name | Beschreibung | |
---|---|---|
![]() |
Complete | Tritt auf, sobald der Sicherungs- oder Wiederherstellungsvorgang abgeschlossen ist. (Geerbt von BackupRestoreBase.) |
![]() |
Information | Tritt auf, wenn eine beliebige Informationsmeldung von Microsoft SQL Server ausgegeben wird, die von den Ereignissen NextMedia, PercentComplete oder Complete nicht behandelt werden kann. (Geerbt von BackupRestoreBase.) |
![]() |
NextMedia | Tritt auf, wenn die Kapazität des Mediums in einem Zielgerät vom Sicherungs- oder Wiederherstellungsvorgang aufgebraucht ist. (Geerbt von BackupRestoreBase.) |
![]() |
PercentComplete | Tritt auf, wenn bei einem Sicherungs- oder Wiederherstellungsvorgang eine Abschlusseinheit erreicht wird. (Geerbt von BackupRestoreBase.) |
Zum Anfang
Hinweise
A Backup object allows you to do the following:
Back up a SQL Server database or database transaction log.
Generate a Transact-SQL BACKUP statement defining a backup.
Monitor a backup operation, reporting status to the user.
For SQL Server, a database delimits the largest backup unit. Although many different database backup images can be maintained on any single medium, a backup cannot span more than a single database. By default, backup operations performed with a Backup object back up a complete database.
SQL Server can write a backup to one of the following media types: disk, tape, or a proprietary medium called a backup device.
SQL Server supports backup striping. A striped backup is one directed to more than a single device. When striped, a backup is written across the devices in equal chunks. Striping is supported to a single media type only. For example, a backup can be written to two tape devices, but SQL Server cannot write part of a backup to a tape device and the rest to a disk.
At a minimum, you must supply values for a backup source and a backup target when using a Backup object. The Database property (inherited from BackupRestoreBase class) specifies the backup operation source.
To get Backup object properties, users can be a member of the public fixed server role.
To set Backup object properties, users must have BACKUP DATABASE or BACKUP LOG permissions on the database, or be a member of the db_owner and db_backupoperator fixed database role and the sysadmin fixed server role.
To run the SqlBackup method, users must have BACKUP DATABASE or BACKUP LOG permissions on the database, or be a member of the db_owner and db_backupoperator fixed database role and the sysadmin fixed server role.
Beispiele
Sichern und Wiederherstellen von Datenbanken und Transaktionsprotokollen
Threadsicherheit
Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.
Siehe auch
Verweis
Microsoft.SqlServer.Management.Smo-Namespace
Andere Ressourcen
Sichern und Wiederherstellen von Datenbanken und Transaktionsprotokollen