Page tree
SQL Safe provides you with CLI commands to help you manually restore database objects.


To perform ObjectLevelRecovery operations use the following commands:
  • SQLsafeCmd ObjectLevelRecovery <db_name> <backup_archive> [options]
  • SQLsafeCmd ObjectLevelRecovery <db_name> <point_in_time> [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 ObjectLevelRecovery operations:

Options
Descriptions
-Async

Performs Action in background. Returns command control as soon as possible.

-InstanceName <name>

<name> - SQL server instance name.

Note: it is not required if the instance is set as a default on the target server.

-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).

-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.

-BackupSet <index><index> - the index of the backup set within the backup archive. (1-based).
-RestoreAs <db_name>

<db_name> - a database new name.

Note: the default is "<dbName>OLR" name.

-DatabaseFilesLocation <path><path> - specifies the database files location.
-TemporaryVdbLocation <location_path><location_path> - location where save VDB files.
-TemporaryVdbServerName <hostname>

<hostname> - host where create VDB for OLR Restore action.

-Password <pwd><pwd> - the non-encrypted password used to encrypt the backup.

Advanced Options

The following advanced options help you perform ObjectLevelRecovery operations:

Options

Description

-ArgsFile <filename>

The path to a file containing command-line arguments.

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

-Keep CDC

Flag to indicate whether the restore will support the Microsoft SQL Server Change Data Capture (CDC) feature.
The possible values are 1 (CDC restore will be supported) or 0 (CDC restore will not be supported). If the Keep CDC parameter is set to 1 then the CDC enabled database will be restored along with the CDC related artifacts and the Capture and Cleanup jobs will be created with the default options. If the parameter is omitted, CDC restore will not be supported.

-KeepReplication

Preserves replication settings when restoring a published database to a server other than that on which it was created.

-IncludeLogins

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

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

-ReporTLogFor backup, 'Yes' reports skipped t-log backups against databases that are in simple mode with a SUCCESS status rather than SKIPPED.
-MaxTransferSizeSpecifies the largest unit of transfer in bytes to be used between SQL Safe and the backup media.
The possible values are multiples of 65536 bytes (64KB) ranging up to 4194304 bytes (4 MB). This parameter is used to enable compression on TDE enabled databases only when the MaxTransferSize value is set to 65537 or higher. If omitted, the MaxTransferSize will be taken from the 'TransferLimit' value set in the SQL Safe agent properties.
-DisconnectUsersDisconnects all users from the target database before the restore operation begins.
-ContinueAfterError

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

Note: SQL 2005 and later only.

-VerifyOnly

Perform Verify Only Action.

-MailTo <email_address>

<email_address> - an email address(es) to send the notification via SMTP.

Note: multiple addresses may be separated by spaces, semicolons, or commas.

-Threads <number>

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

Options for Objects to Recovery

The following options are required to perform ObjectLevelRecovery operations:

Options
Description
-SchemaObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database schema objects. * (select all).

-UserDefinedTypeObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database user defined type objects. * (select all).

-XmlCollectionObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database xml collection objects. * (select all).

-TableObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database table objects. * (select all).

-FunctionObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database function objects. * (select all).

-ViewObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database view objects. * (select all).

-StoredProcedureObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database stored procedure objects. * (select all).

-ConstraintObjects <name1> [ <name2> ...]

<name1> [ <name2> ...] - the list of database constraint objects. * (select all).

Security Options

Secure your ObjectLevelRecovery 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, 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. (SQLSecurityModel).
-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. 

For detailed descriptions and available options, see the CLI Help (SQLsafeCmd help ObjectLevelRecovery).