Classe Backup
The Backup object provides programmatic access to Microsoft SQL Server backup operations.
Gerarchia di ereditarietà
System.Object
Microsoft.SqlServer.Management.Smo.BackupRestoreBase
Microsoft.SqlServer.Management.Smo.Backup
Spazio dei nomi Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.SmoExtended (in Microsoft.SqlServer.SmoExtended.dll)
Sintassi
'Dichiarazione
Public NotInheritable Class Backup _
Inherits BackupRestoreBase
'Utilizzo
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
Nel tipo Backup sono esposti i membri seguenti.
Costruttori
Nome | Descrizione | |
---|---|---|
Backup | Initializes a new instance of the Backup class. |
In alto
Proprietà
Nome | Descrizione | |
---|---|---|
Action | Gets or sets the type of backup to be performed. | |
AsyncStatus | Ottiene lo stato asincrono di un processo di backup o di ripristino. Ereditato da 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 | Ottiene o imposta le dimensioni del blocco fisico del backup o del ripristino, in byte. Ereditato da BackupRestoreBase. | |
BufferCount | Ottiene o imposta il numero totale di buffer di I/O da utilizzare per l'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. | |
Checksum | Ottiene o imposta un valore della proprietà Boolean che determina se durante le operazioni di backup o di ripristino viene calcolato un valore di checksum. Ereditato da BackupRestoreBase. | |
CompressionOption | Gets or sets the backup compression option. | |
ContinueAfterError | Ottiene o imposta un valore della proprietà Boolean che determina se il backup o il ripristino continua dopo che si è verificato un errore di checksum. Ereditato da 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 | Ottiene o imposta il database in cui l'operazione di backup o di ripristino viene eseguita. Ereditato da BackupRestoreBase. | |
DatabaseFileGroups | Ottiene i filegroup di SQL Server di destinazione dell'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. | |
DatabaseFiles | Ottiene i file del sistema operativo di destinazione dell'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. | |
Devices | Ottiene i dispositivi di backup specificati per l'operazione di backup o di ripristino. Ereditato da 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 | Ottiene o imposta il numero massimo di byte da trasferire tra i supporti di backup e l'istanza di SQL Server. Ereditato da BackupRestoreBase. | |
MediaDescription | Gets or sets a textual description of the medium that contains a backup set. | |
MediaName | Ottiene o imposta il nome utilizzato per identificare un particolare set di supporti. Ereditato da BackupRestoreBase. | |
Mirrors | Gets or sets the list of backup devices used by the mirrored backup. | |
NoRecovery | Ottiene o imposta un valore della proprietà Boolean che determina se viene eseguito il backup della parte finale del log e se viene ripristinato lo stato di ripristino del database. Ereditato da BackupRestoreBase. | |
NoRewind | Ottiene o imposta un valore della proprietà Boolean che determina se il nastro verrà tenuto aperto da Microsoft SQL Server dopo l'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. | |
PercentCompleteNotification | Ottiene o imposta l'intervallo percentuale per le chiamate del gestore eventi PercentCompleteEventHandler. Ereditato da BackupRestoreBase. | |
Restart | Ottiene o imposta un valore della proprietà Boolean che determina se l'operazione di backup o di ripristino verrà riavviata in caso di interruzione. Ereditato da 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 | Ottiene o imposta un valore della proprietà Boolean che determina se i supporti a nastro vengono riavvolti e scaricati al termine dell'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. |
In alto
Metodi
Nome | Descrizione | |
---|---|---|
Abort | Termina un'operazione di backup o di ripristino in esecuzione. Ereditato da BackupRestoreBase. | |
Equals | Ereditato da Object. | |
GetHashCode | Ereditato da Object. | |
GetType | Ereditato da Object. | |
Script | Returns a String containing the Transact-SQL statement that can be used to execute the referenced backup. | |
SetMediaPassword(SecureString) | Obsoleto. Imposta la password per un set di supporti. Ereditato da BackupRestoreBase. | |
SetMediaPassword(String) | Obsoleto. Imposta la password per un set di supporti. Ereditato da BackupRestoreBase. | |
SetPassword(SecureString) | Imposta la password per un set di backup. Ereditato da BackupRestoreBase. | |
SetPassword(String) | Imposta la password per un set di backup. Ereditato da 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 | Ereditato da Object. | |
Wait | Attende il completamento dell'operazione di backup o di ripristino corrente prima di passare al processo successivo. Ereditato da BackupRestoreBase. |
In alto
Eventi
Nome | Descrizione | |
---|---|---|
Complete | Si verifica al termine dell'operazione di backup o di ripristino. Ereditato da BackupRestoreBase. | |
Information | Si verifica quando da Microsoft SQL Server vengono inviati messaggi informativi che non possono essere gestiti dagli eventi Complete NextMedia o PercentComplete. Ereditato da BackupRestoreBase. | |
NextMedia | Si verifica quando l'operazione di backup o di ripristino esaurisce il supporto in un dispositivo di destinazione. Ereditato da BackupRestoreBase. | |
PercentComplete | Si verifica quando un'operazione di backup o di ripristino raggiunge un'unità di completamento. Ereditato da BackupRestoreBase. |
In alto
Osservazioni
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.
Esempi
Backup e ripristino dei database e dei log delle transazioni
Protezione dei thread
I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.
Vedere anche
Riferimento
Spazio dei nomi Microsoft.SqlServer.Management.Smo
Altre risorse
Backup e ripristino dei database e dei log delle transazioni