Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
SQL Safe provides you with CLI commands to help you manually backup a database.

 

To backup databases typeuse the following commands:

...

  • SQLsafeCmdBackup <db_

...

  • name> [<db_name>]

...

  •  <backup_archive> [options]

...

  • SQLsafeCmdBackup <db_

...

  • name> [<db_name>]

...

  •  TSM [options]

...

  • SQLsafeCmdBackup <db_

...

  • name> [<db_name>]

...

  •  TRUNCATEONLY [options]

...

 

Where: 
ActionDescription
<db_name>

One or more names of database(s) to backup.

If a database name contains a space, the database name should be surrounded with "double quotes".

Special keywords may be used to backup multiple databases. These keywords are: { all}, { allsystem}, { alluser}.

<backup_archive>

Path to the backup archive.
Tsm

Use Tivoli Storage Manager (see below for special options).

TruncateOnly

Use this keyword to truncate the transaction log of the SQL Server database only.

Common Options

The following options help you perform backup operations:

 Options Description

-BackupDescription <desc>

The <desc> - the description of the backup.
-BackupName <name>The <name> - the name of the backup.
-BackupType <type>

{Full | Differential | Log | File} The backup type required.

<type> - full, differential, log, file.

-BckDstType <type>

{0 | 1 | 2 | 3 | 4} The backup destination type is used for the backup.

<type> - 0, 1, 2, 3, 4.

-CompressionLevel <level>CompressionLevel <level>

{ispeed | isize | 0 | 1 | 2 | 3 | 4} The compression level used for the backup. If .

<level> - ispeed, isize, 0, 1, 2, 3, 4.

Note: if the compression level is not specified, ispeed is the default.

-Exclude <db_name> [<db_name> ...]

One <db_name> [<db_name> ...] - one or more names of database(s) to not backup.

-InstanceName <name>

<name> - the SQL server instance name. 

Note: it is not Not required if instance the instance is the default instance on the target server.

-NoTruncate

Don't Do not truncate the transaction log. (Log backup only).

-Overwrite

Overwrite existing archive if one exists.

Note: if   If this option is omitted, the default behavior is to append.

-Server <hostname>

The host name of <hostname> - the hostname of the server hosting the SQL Server where the operation should be performed.

  This Note: this option is required for accessing remote or clustered SQL Servers (where applicable).

-Verify

Verify the backup set after backup is complete.

Encryption Options

Encrypt your backups with the following options:

 Options Description

-EncryptionType <type>

{AES128 | AES256}

The type of encryption used to encrypt the backup.

<type> - AES128, AES256.

-Password <pwd>The <pwd> - the non-encrypted password used to encrypt the backup.
-EncryptedBackupPassword <pwd>The <pwd> - the encrypted password used to encrypt the backup. (Used with EncryptionType).

Security Options

Secure your backups with the following options:

 Options Description
-NoPromptNever prompt for credentials even if necessary.
-SecurityModel <model>{Integrated | SQL}

The security model used to log into SQL Server.

<model> - Integrated, 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>Encrypted <pwd> - the encrypted SQL Server password generated by EncryptSqlPassword action. (SQL
SecurityModel).
-WindowsUsername <domain\user>The <domain\user> - the Windows user that will be used to read/write the backup archive.
-WindowsPassword <pwd>The <pwd> - the password for the Windows user.
-EncryptedWindowsPassword <pwd>Encrypted <pwd> - the encrypted password for the Windows user generated by EncryptWindowsPassword action.

Advanced Options

The following advanced options help you perform backup operations:

 Options Description
-ArgsFile <filename>

Path The path to a file containing command-line arguments.

<filename> - specifies the file that contains the command line arguments.

-BackupFile <filename>

Specifies additional backup archive files to be used for striping backups. Use .

<filename> - specifies the backup archive files.

 Note: use once for each additional stripe.

-Checksum

(SQL 2005 and later only) Instructs SQL Server to generate backup checksums during a
backup, or verify backup checksums during a verify or restore.

 ContinueAfterError

(Note: SQL 2005 and later only.

-ContinueAfterError

) Instructs SQL Server to continue the operation despite encountering errors such as invalid checksums.

 

CopyOnly

(Note: SQL 2005 and later only.

-CopyOnly

) Specifies that the backup does not affect the normal sequence of backups.

Note: SQL 2005 and later only.

-DatabaseFilegroup <filegroup>

<filegroup> - the

DatabaseFileGroup <filegroup>

(File BackupType only) The database logical filegroup.

 DatabaseFilename <filename>

(File BackupType only) The database logical filename.

Note: for file BackupType only.

-DatabaseFilename <filename>

<filename> - the database logical filename.

Note: for file BackupType only.

-Delete <n><time_period> Delete <n><time_period>{Minutes | Hours | Days | Weeks | Months}

After a backup successfully completes, delete archives that are older than the specified amount of time.

 <n> - amount of time.

<time_period> - minutes, hours, days, weeks, months.

There must be NO SPACE between <n> and <time_period>.

E.g., -delete 2hours. If used,

Note: if you use the space between <n> and <time_period>, the backup archive filename will be automatically generated with the following pattern:

<instancename>_<databasename>_<backuptype>_ <timestamp>.safe. The

where the <timestamp> is in UTC time and is of in the form of YYYYMMDDHHMM.

-DeleteMirror <n><time_period>

 {Minutes | Hours | Days | Weeks | Months}

After a backup successfully completes, delete mirrors that are older than the specified amount of time.

 <n> - amount of time.

<time_period> - minutes, hours, days, weeks, months.

There must be NO SPACE between <n> and <time_period>.

E.g., -deletemirror 2hours. If used,

Note: if you use the space between <n> and <time_period>, the mirror filename will be automatically generated with the following pattern:

<instancename>_<databasename>_<backuptype>_<timestamp>.safe. The

where the <timestamp> is in UTC time and is of in the form of YYYYMMDDHHMM.

-FailOnMirrorError

 Abort

To abort a backup if an error is encountered while writing to a mirror backup archive.

(Default

Note: the default behavior is to abort only if an error is encountered while writing to a primary backup archive.

)

 IncludeLogins-IncludeLogins

 For backup, includes the database logins in the backup file.

For restore, creates the logins from the backup file on the destination server.

-MailTo <email_address>Send a notification via SMTP to the specified e-mail

<email_address> - an email address(es)

. Multiple

to send the notification via SMTP.

Note: multiple addresses may be

seperated

separated by spaces, semicolons, or commas.

 MirrorFile -MirrorFile <filename>

Specifiy Specifies additional backup archive files to be used for mirroring backups. Use .

<filename> - specifies the backup archive files.

Note: use once for each additional mirror. Up to two mirrors may be specified.

 NoSkip-NoSkip

Disables automatic skipping of databases that cannot be backed up, such as offline databases.

 NoStatus-NoStatus

Prevents status messages from being cached or sent to the Repository.

-ReadWriteFileGroups

(SQL 2005 and later only) Instructs SQL Server to perform a partial backup, which includes the primary filegroup and any read-/write secondary filegroups.

Note: SQL 2005 and later only.

-RecoveryMode  RecoveryMode <mode> [-UndoFile <filename>UndoFile<filename>]

{NoRecovery | Standby} Specifies the mode in which to leave the database after the operation is completed. For

 <mode> - NoRecovery, Standby.

Note: for Standby mode an undo file may be specified with the -UndoFile option.

 -UndoFile <filename>

Specifies <filename> - specifies the ABSOLUTE path to the undo filename (.

Note: for Standby recovery mode only).

-RetryWrites <interval> <retry_time> <total_time>On a network file error, retry every <interval> seconds for up to <retry_time> seconds. Total retry time
allowed is <total_time> minutes.
-Threads <number>

Specifies <number> - specifies the number of threads that should be used to distribute the backup process across
multiple processors.

-VDB Off

Do not optimize for quick access by SQL virtual database.

-Verbose

Display Displays SQL Server result text for both successful and failed backups (default is to display only .

Note: by default, it displays for failed backups )only.

Tivoli Storage Manager (TSM) Options

There are TSM options for your backup operations Options:

 Options Description
-TsmClientOwnerName <name>The <name> - the client owner name.
-TsmClientOwnerPassword <pwd>The <pwd> - the client owner password.
-EncryptedTsmClientOwnerPassword <pwd>Encrypted <pwd> - the encrypted TSM client owner password.
-TsmConfigFile <filename>The <filename> - the configuration file location.
-TsmHighLevel <name>The <name> - the high level file specification (path).
-TsmLowLevel <name>The <name> - the low level file specification (file name).
-TsmTcpServerAddress <address>The <address> - the TCP/IP address for the TSM server.
-TsmTcpPort <port>The <port> - the TCP/IP port address for the TSM server.
-TsmManagementClass <name>The <name> - the management class to which the backup file
will be bound.

For detailed descriptions and available options, see the CLI Help (SQLsafecmd help <action>backup).

SQL Safe is a high-performance backup and recovery solution for your SQL Servers. Learn more > >

...