- SQLsafeCmdBackup <db_name> [<db_name>] <backup_archive> [options]
- SQLsafeCmdBackup <db_name> [<db_name>] TSM [options]
- SQLsafeCmdBackup <db_name> [<db_name>] TRUNCATEONLY [options]
Where:
Action | Description |
---|---|
<db_name> | Name of the database. |
<backup_archive> | Path to the backup archive. |
<point_in_time> | Date/Time {"MM/dd/yyyy hh:mm:ss"} to restore to. |
Common Options
The following options help you perform Instant Restore operations:
Options | Descriptions |
---|---|
-BackupSet <index> | <index> - the index of the backup set within the backup archive (1-based). |
-DisconnectUsers | Disconnects all users from the target database before the restore operation begins. |
-EncryptedRestorePassword <pwd> | <pwd> - the encrypted password used to decrypt the backup. |
-InstanceName <name> | <name> - SQL server instance name. Note: it is not required if instance is the default instance on the target server. |
-Move <logical_filename> <target_filename> | Move the database logical database file to the physical target file. <logical_filename> - the database logical database file. <target_filename> - the physical target file. Corresponds to the WITH MOVE option in the RESTORE DATABASE T/SQL command. |
-Password <pwd> | <pwd> - the non-encrypted password used to encrypt the backup. |
-Server <hostname> | <hostname> - the hostname of server hosting the SQL Server where the operation should be performed. Note: this option is required for accessing remote or clustered SQL Servers (where applicable). |
-Replace | Override database if exists. |
Security Options
Secure your Instant Restore operations with the following options:
Options | Description |
---|---|
-NoPrompt | Never prompt for credentials even if necessary. |
-SecurityModel <model> | The security model used to log into SQL Server. <model> - Integrated or SQL. Note: Integrated (Windows authentication) is the default. |
-SqlUsername <username> | <username> - the SQL Server username (SQL SecurityModel). |
-SqlPassword <pwd> | <pwd> - the SQL Server password (SQL SecurityModel). |
-EncryptedSqlPassword <pwd> | <pwd> - the encrypted SQL Server password generated by EncryptSqlPassword action (SQL SecurityModel). |
-WindowsUsername <domain\user> | <domain\user> - the Windows user that will be used to read/write the backup archive. |
-WindowsPassword <pwd> | <pwd> - the password for the Windows user. |
-EncryptedWindowsPassword <pwd> | <pwd> - the encrypted password for the Windows user generated by EncryptWindowsPassword action. |
Advanced Options
The following advanced options help you perform Instant Restore operations:
Options | Description |
---|---|
-ArgsFile <filename> | The path to a file containing command-line arguments. <filename> - specifies the file that contains the command line arguments. |
-Diff <filename> | The differential backup. <filename> - the file path to the differential backup. This can be followed by -BackupFile, -BackupSet, or -Password to set individual options for this backup set. |
-Log <filename> | The log backup. <filename> the file path to the log backup. This can be followed by -BackupFile, -BackupSet, or -Password to set individual options for this backup set. |
-BackupFile <filename> | Specifies additional backup archive files to be used for striping backups. <filename> - specifies the backup archive files. Note: use once for each additional stripe. |
-IncludeLogins | For backup, includes the database logins in the backup file. For restore, creates the logins from the backup file on the destination server. |
-KeepReplication | Preserves replication settings when restoring a published database to a server other than that on which it was created. |
-NoChecksum | Disables the validation of any checksums by the restore operation. Note: SQL 2005 and later only. |
-MailTo <email_address> | <email_address> - an e-mail address(es) to send a notification via SMTP. Note: multiple addresses may be separated by spaces, semicolons, or commas. |
-NoStatus | Prevents status messages from being cached or sent to the Repository. |
-RecoveryMode <mode> [-UndoFile <filename>] | Specifies the mode in which to leave the database after the operation is completed. <mode> - NoRecovery or Standby. Note: for Standby mode an undo file may be specified with the -UndoFile option. |
-StopAt <datetime> | Specifies that the database be restored to the state it was in as of the specified date and time. <datetime> - "mm/dd/yyyy hh:mm:ss". Note: for Log BackupType only. |
-StopAtMark <mark> [-After <datetime>] | Specifies recovery to the specified <mark>, including the transaction that contains the <mark>. Note: for Log BackupType only. |
-StopBeforeMark <mark> [-After <datetime>] | Specifies recovery to the specified <mark> but does not include the transaction that contains the <mark>. Note: for Log BackupType only. |
-After <datetime> | Recovery stops at the first <mark> having the specified name exactly at or after <datetime>. Note: only valid with -StopAtMark/-StopBeforeMark options. For Log BackupType only. |
-Wait | Wait for hydration to complete before returning result of operation. Note: by default is to return result of bringing database online. |
For detailed descriptions and available options, see the CLI Help (SQLsafecmd help instantrestore
).