LiteSpeed for SQL Server 8.6 - User Guide

About Backing Up/Restoring with LiteSpeed LiteSpeed User Interface Configure LiteSpeed for First Use Cloud Back Up Databases Automate Maintenance Tasks Restore Databases Restore Objects View Activity and History Use Command-Line Interface Use Extended Stored Procedures Troubleshoot LiteSpeed Review Additional Resources

LiteSpeed Command Line Arguments

LiteSpeed Command-Line Arguments

The LiteSpeed command-line utility (sqllitespeed.exe or sqllitespeedx32.exe) allows you to conduct LiteSpeed backups and restores directly from your operating system command-line. You must run the utility on the server that you are backing up or restoring. You may need to use sqllitespeedx32.exe if you have a 32-bit SQL Server on a 64-bit operating system.

Syntax

sqllitespeed.exe ( -? | <options> )

Connection Options:

-S <server_name\instance_name>        
(-U <login_id> -P <password> ) | -T

 

Backup Options:

-B <option>
[--nowrite]        
[-D <database_name>]
[-f <file_name>]         
[-g <filegroup_name>]   
-F <backup_device_name> 
[-n <backup_set_name>]      
[-d <backup_description>]
[-Y <comment> ]      
[-E <mirror_path>] 
[-I] 
[-N <file_number>]        
[-W <options>]
[--AdaptiveCompression (Speed|Size) | -C <compression_level> ]      
[-e <encryption_level> (-K <password>|--JobP <key>)]         
[-y <date_time> | -r <number_of_days>]
[-s ]
[--doubleclick] 
[--OLRMap
[--TempDirectory <path>]]
[--attachedfile <path_or_file>] 
[-X <options>]    
[-h 1...100]  
[-o <buffer_count>]           
[-x < maximum_transfer_size>]   
[-t <number_of_threads>]
[-p (-1|0|1|2)] 
[--LSECompatible ]
[-L (0|1|2) [--Trace logpath = "path"]] 
[-V (0|1)]


Restore Options:

-R <restore_option>
-F <backup_device_name> 
-D <destination_database_name>
[-N <file_number>]
[-f <file_name>]         
[-g <filegroup_name>]  
[--Read_Write_Filegroups]
[-K <password>| --JobP <key>]
[-W STATS = <number>]
[-W PASSWORD = "<media_password>"]
[-A <affinity_mask>]
[-h 1...100]  
[-o <buffer_count>]           
[-x <maximum_transfer_size>]  
[-X <options>]
[--RestoreAsReadOnly
[--RestoreAsCompressed ]]
[--attachedfile <path_or_file>] 
[-L (0|1|2) [--Trace logpath = "path"]]

 

Automated Restore Options:

-R Automated
[-D <destination_database_name>
    [--DataFilePath <path> ]
    [--LogFilePath <path> ] ]
-F <backup_filename> | (--BackupPath <path>
    --BackupExtension <extensions>
    --CheckSubfolders (0|1) )
[--BackupType <option> ]
--SourceServer <server_name>
--SourceDatabase <database_name>
[-K <password> | --JobP <key>]
[-W "STATS = <number>"]
[-W "PASSWORD = '<my_password>'"]
[--WithReplace (0|1)]
[-A <affinity_mask>]
[-h 1...100]  
[-o <buffer_count>]           
[-x <maximum_transfer_size>]  
[-X <options>]
[--RestoreAsReadOnly
[--RestoreAsCompressed ]]
[-L (0|1|2) [--Trace logpath = "path"]]
[--DryRun (0|1)]
[--DropDatabaseOnFailure (0|1)]
[--DropDatabaseOnSuccess (0|1)]

 

TSM Connection Options:

-j <TSM_configuration_file> 
-i < TSM_object> 
[-c <TSM_client_node> ]          
[-k <TSM_client_owner_password>]
[-l <TSM_filespace>]        
[-q <TSM_query>] 
[-a delete] 
[-z <TSM_management_class>] 
[--tsmpointtime yyyy-mm-dd hh:mm:ss] 
[--tsmarchive]


Tape Arguments:

[-m (0|1|2|3)]        
[-w]        
[-u]         

 

Cloud connection options:

[--CloudVendor <vendor name>]
[--CloudAccessKey <key name>]
[--CloudAccessKeyEnc <encrypted key name>]
[--CloudSecretKey <key name>]
[--CloudSecretKeyEnc <encrypted key name>]
[--CloudBucketName <bucket name>]
[--CloudRegionName <cloud region name>]
[--CloudGovRegion <government region number>]
[--AWSStorageClass <standard, standard-ia, standard-rrs>]
[--AWSUseServerSideEncryption <1, 0>]
[--AzureBlobType <block, page>]
[--CloudAutoStriping <1, 0>]
[--CloudAutoStripingThreshold <param size in GB>]
[--UseSSL <1, 0>]

 

Proxy connection options:

[--ProxyHost <proxy host name>]
[--ProxyLogin <proxy server login credential>]
[--ProxyPassword <proxy server password credential>]
[--ProxyPasswordEnc <encrypted proxy server password credential>]
[--ProxyPort <proxy server port number>]

Arguments

NOTES:

  • Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
  • Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.

-Argument

--Argument

Description

(none) --AdaptiveCompression

Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see Compression Methods.

You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one of the following values:

  • Size
  • Speed

-A

--Affinity

Processor affinity designates specific processors to run LiteSpeed, while not allowing LiteSpeed to run on the remaining processors.

This argument accepts decimal values and hexadecimal values. If a value begins with "0x" it is interpreted as hexadecimal. A positive 64-bit integer value translates to a binary mask where a value of 1 designates the corresponding processor to be able to run the LiteSpeed process.

NOTE: 32-bit Windows is internally limited to a 32-bit mask.

For example, you need to select processors 2, 3, and 6 for use with LiteSpeed. Number the bits from the right to left. The rightmost bit represents the first processor. Set the second, third, and sixth bits to 1 and all other bits to 0. The result is binary 100110, which is decimal 38 or hexadecimal 0x26. Review the following for additional information:

Decimal Value

Binary Bit Mask

Allow LiteSpeed Threads on Processors

0 0 All (default)

1

1

1

3

11

1 and 2

7 111 1, 2 and 3

38

100110

2, 3, and 6

205 11001101 1, 3, 4, 7, and 8

Tip: Before you start tuning the CPU Throttle or Affinity parameters to adjust backup performance, try limiting the number of threads. If you decide to use an affinity value other than default, it is recommended that you limit the threading as well. You may also want to consider using Adaptive Compression to maintain backup performance. For more information, see Adaptive Compression.

(none)

--AttachedFile

Specifies filepaths to include in both backup and restore operations. The filepath can be either a single file or a directory. If it is a directory, then LiteSpeed recursively includes all files and subdirectories. All attached files are encrypted and compressed, with all pertinent backup parameters supported. This feature works for disk, tape, TSM, and Double Click Restore as well. You can supply multiple instances of this argument.

When used within the context of a restore operation, the path parameter can be expanded to include a new destination. This form will take the syntax of <file_path> to <new_file_path>. The new filepath can be used to specify a new location but cannot rename a file.

This argument only restores the attached files. It does not restore the database, just the files that were attached to that backup.

NOTES:

  • The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
  • c:\testad to testadr would restore all files in directory c:\testad to c:\testadr.

You can supply multiple instances of this argument.

-B

--Backup

Backup operation. This argument accepts one of the following values:

  • Database—Back up database

  • Log—Back up transaction log 

(none) --BackupExtension

When looking for database backups, LiteSpeed will only consider backup files that have the extensions you specify. The value of this parameter is a list of extensions, separated with commas. No value or asterisk (*) specifies any file extension.

-d

--BackupDescription

Specifies a description to store with the backup.

This argument accepts variables. For more information, see LiteSpeed Variables.

-F

--BackupFiles

Specifies a backup location (e.g. C:\backups\AdventureWorks.bak). This argument accepts network destinations. You can supply multiple instances of this argument to use stripe backups.

Examples:

UNC Path: \\servername\share\path\filename

Local path: c:\filedirectory\filename 

For TSM backups and TSM archives, this argument accepts the following formats:

  • tsmbkp:<filespace>\<high>\<low>
  • tsmarc:<filespace>\<high>\<low>

This argument accepts variables. For more information, see LiteSpeed Variables.

-N

--BackupIndex

Specifies the particular backup to use when recasting, restoring, extracting or reading from files with multiple appended backups. You can run xp_restore_headeronly to query the files contained within the backup set given by backup_file_name.

-n

--BackupName

Specifies the name of the backup set.

This argument accepts variables. For more information, see LiteSpeed Variables.

(none) --BackupPath

Specifies the directory where to search for the backup files.

You can supply multiple instances of this argument. Each instance of this parameter must be followed by --BackupExtension and --CheckSubfolders arguments.

(none) --BackupType

Specifies backup types to use for the restore. This argument accepts one of the following values:

  • full—LiteSpeed will only restore the most recent full database backup.
  • diff—LiteSpeed will restore the most recent full database backup and any existing differential backups based on this full.
  • tlog—LiteSpeed will restore the most recent full database backup and any existing differential and/or transaction log backups created after the most recent full backup.

-o

--BufferCount

Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set by SQL Server.

NOTE: LiteSpeed defaults typically result in the best performance. You should only modify advanced options after careful planning and testing.

(none)

--CheckDB

Specifies checking the database integrity after running restores. Options include: --CheckDBPhysicalOnly, --CheckDBDataPurity, --CheckDBExtendedLogicalChecks, --CheckDBNoIndex, --CheckDBTableLocks, and --CheckDBNoInfoMessages.

(none)

--CheckDBPhysicalOnly

Specifies the checking database physical structure option. Note: Using this argument can significantly decrease the execution time when using large databases.

(none)

--CheckDBDataPurity

Specifies the checking database column values option for validity or out of range.

(none)

--CheckDBExtendedLogicalChecks

Specifies the performing consistency checks on indexes option. It checks XML indexes and spacial indexes.

(none)

--CheckDBNoIndex

Specifies the performing intensive checks of non-clustered indexes for user tables option.

(none)

--CheckDBTableLocks

Specifies the using table locks instead of using an internal database snapshot option.

(none)

--CheckDBNoInfoMsgs

Specifies the including informational messages in the notification report option.
(none) --CheckSubfolders

Specifies whether to use subfolders to look for database backups. This argument accepts one of the following values:

  • 0—False. LiteSpeed will only use backups located in the specified folder.
  • 1—True. LiteSpeed will look for backups in the specified folder and in its subfolders.

-Y

--Comment

Appends a user comment to the backup.

This argument accepts variables. For more information, see LiteSpeed Variables.

-C

--CompressionLevel

Specifies the compression level for the backup. Valid values are 0 through 8. 0 bypasses the compression routines. The remaining values of 1 through 8 specify compression with increasingly aggressive computation. 2 is the default value for disk backups and 7 is the default value for cloud backups.

When choosing a compression level, it is best to try various options using your equipment and data to determine the best option for your environment. Use the Backup Analyzer to test the performance of different compression levels. For more information, see Test Optimal Backup Settings.

NOTE: If both the compression level and Adaptive Compression option are passed in, LiteSpeed will not error out and will select and use Adaptive Compression.

-D

--Database

Name of database to be backed up or restored.

(none) --DataFilePath

Specifies a location for data files.

(none) --DisconnectUsers

Disconnect users on executing restore (in standby mode only). This argument accepts one of the following values:

  • 0—Do not disconnect users (default).
  • 1—Disconnect users.
(none) --DontUseCopyOnly

Specifies that LiteSpeed is not to use copy-only backups when running restores.

(none) --DontUseReplication Specifies that LiteSpeed is not to include databases that are part of a replication plan when running restores.

-J

--DoubleClick

Creates a Double Click Restore executable. This argument accepts one of the following values:

  • 1—Converts a LiteSpeed backup to a Double Click Restore executable, if the size of the backup is less than 4GB. If a backup is a native SQL Server backup or it is larger than 4 GB, it creates a Double Click Restore loader in the same location.
  • 2—Creates a Double Click Restore loader in the same location.

For more information, see Double Click Restore Executables.

(none) --DropDatabaseOnFailure

Drops the restored database only if the restore fails. Use this option if you no longer need the restored database. For example, if you are only restoring the latest backup for testing purposes. This option contains two additional options to select. One or both options can be selected.On success restore and check database integrity operations - The database is dropped after a successful restore and database integrity check.On failure any of restore or check databases integrity operations - The database is dropped after failing the restore or database integrity check. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True
(none) --DropDatabaseOnSuccess

Drops database on success only. Use this option if you no longer need the restored database. For example, if you are only restoring the latest backup for testing purposes. This option contains two additional options to select. One or both options can be selected.On success restore and check database integrity operations - The database is dropped after a successful restore and database integrity check.On failure any of restore or check databases integrity operations - The database is dropped after failing the restore or database integrity check. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

(none)

--EncBackupKey

Encrypts the specified key. The encrypted key is suitable for use with -jobp in a backup operation.

(none)

--EncRestoreKey

Encrypts the specified key. The encrypted key is suitable for use with -jobp in a restore operation.

-e

--EncryptionLevel

Specifies encryption level. Works in conjunction with the Key (K) parameter. This argument accepts one of the following values:

  • 0—40-bit RC2

  • 1—56 bit RC2

  • 2—112 bit RC2

  • 3—128 bit RC2

  • 4—168 bit 3DES

  • 5—128 bit RC4

  • 6—128 bit AES

  • 7—192 bit AES

  • 8—256 bit AES

(none) --ExcludeDatabase

Name of database(s) to exclude from this backup / restore.

Example:

--ExcludeDatabase Northwind

Tip: The @ExcludeDatabase argument can be applied together with @MultiDatabaseType to exclude several databases from the process.

-y

--Expiration

Specifies the date and time when the backup expires. LiteSpeed will not overwrite this file until expiration datetime is passed. This argument accepts one of the following formats:

  • yyyy-mm-dd
  • yyyy-mm-dd hh:mm:ss

-f

--File

Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of this argument.

-g

--FileGroup

Specifies a database filegroup to include in the backup or restore. You can supply multiple instances of this argument.

A filegroup backup is a single backup of all files in the filegroup and is equivalent to explicitly listing all files in the filegroup when creating the backup. Files in a filegroup backup can be restored individually or as a group.

-X --IOFlags

Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options using the following parameters:

  • DISK_RETRY_COUNT—Specifies the number of times that a specific operation will be retried on failure. The default is 4 retries, the maximum allowed setting is 1000.
  • DISK_RETRY_WAIT—Specifies the number of seconds to wait immediately following a failure before retrying. The default is 15 seconds, the maximum allowed setting is 300.

NOTE: This functionality is only available for disk and cloud operations.

For more information, see Network Resilience.

(none)

--JobP

Specifies an encrypted key. (Similar to -K).

NOTE: Automated Restore requires that you use the same password for all encrypted backups.

-K

--Key

Value used to generate the encryption key for the encryption algorithm. If you do not supply encryption key, then the program will not encrypt the backup. If you use the wrong encryption key, the restore will fail.

Caution: When encrypting data, take care not to lose the encryption key; a backup cannot be restored or recovered without the original encryption key.

Example of key: 'Mypassword'

NOTE: Automated Restore requires that you use the same password for all encrypted backups.

(none) --LogFilePath

Specifies a location for log files.

-L

--LogLevel

Creates a log file. This argument accepts one of the following values:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

The default output directory is C:\Documents and Settings\All Users\Application Data\Quest Software\LiteSpeed\SQL Server\Logs (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs) (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs). To log to a different directory run this utility with the following argument: --trace logpath = "path".

For more information, see Configure Logging in LiteSpeed.

(none) --LSECompatible

Produces a backup that is compatible for use with LiteSpeed Engine for SQL Server. The parameter can be used whenever a new backup file is created and should only be set when backups are needed for cross-compatibility between the products. This switch will force modifications to internal settings such as the thread count, striping model, and encryption levels. In some cases, performance may be degraded. The parameter is ignored when appending to a backup file created without the switch.

This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

About LiteSpeed Engine for SQL Server

-x

--MaxTransferSize

Specifies the largest unit of transfer in bytes to be used between SQL Server and LiteSpeed. The possible values are multiples of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is 1048576 (1 MB).

-E

--MirrorFiles

Mirrors the backup file (copies the backup to multiple locations). If you back up the primary to a set of striped files, all mirrored backups must match the primary in the number of stripes in each mirror.

This argument accepts variables. For more information, see LiteSpeed Variables.

(none)

--MultiDatabaseType

Produces a backup that includes several types of databases. Types can include: all, system, user, or selected databases.

This argument accepts one of the following values:

  • All - Backup all system and user databases.
  • System - Backup only system databases.
  • User - Backup only user databases.
  • Selected - Backup specifically selected databases.
-Z --NoWrite

The argument is similar to backup log xxx to disk = 'NUL'. When the backup is completed, it is not written to disk.

NOTES:

  • You need to supply a filename (-F). The MSDB history tables are updated with the filename specified, but the file will not get created and no IO is performed.
  • If compression or encryption parameters are specified, then the data will get compressed or encrypted before being thrown away.

-M

--OLRMap

Generates a map file during a backup for Object Level Recovery. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

-I

--Overwrite

Re-initializes (overwrites and replaces) the target backup files. For TSM backups, this will create the TSM object and version the backup based on the retention policy.

-P

--Password

Specifies the user password. Passwords are case-sensitive. Required if the connection type is not a trusted connection.

-p

--Priority

Specifies the priority of the LiteSpeed process compared to other processes running on the same server. This argument accepts one of the following values:

  • -1—Below Normal

  • 0—Normal (Default)

  • 1—AboveNormal

  • 2—High

(none)

--Read_Write_Filegroups

Specifies a partial backup, which includes the primary filegroup and any read-write secondary filegroups.

-r

--RetainDays

Specifies a number of days to retain the backup. LiteSpeed will not overwrite this file for this number of days. 

-R

--Restore

Restore operation.This argument accepts one of the following values:

  • AttachedFilesOnly —Restore attached files without restoring the database.

  • Database—Restore database backup.

  • Log—Restore log backup.

  • VerifyOnly—Verify backup. 

  • HeaderOnly—Provide backup details.

  • FileListOnly—Provide database file details.

  • CheckPassword—Check password/key.

  • CheckSumOnly—Checksum a backup file.

  • AttachedFileNamesOnly—List names of all attached files.

  • Automated—Restore the most recent full backup and optionally differential and transaction log backups.

(none) --RestoreAsCompressed

Works in conjunction with --RestoreAsReadOnly, creates a folder if it does not exist, and then compresses it. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True
(none) --RestoreAsReadOnly

Instructs the restore operation to leave the database in read-only mode. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

Using this option, you can restore a user database into an NTFS compressed folder or restore a tlog to a read-only database in a compressed folder.

NOTES:

  • When using an NTFS-compressed folder for a database, it can only be restored as read-only.
  • You can only use this feature on Windows NTFS file systems.

-S

--Server

Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:

  • server_name
  • server_name\instance_name

If no server is specified, the LiteSpeed command-line utility will connect to the default instance of SQL Server on the local computer.

-?

--ShowHelp

Displays the syntax summary of the LiteSpeed command-line utility.

-s

--Skip

Skips normal retention checks and overwrites the backup that has not expired.

  • 0—False (default)
  • 1—True
(none) --SourceDatabase

Backups of this database are the source for restore.

(none) --SourceServer

Backups created on this instance of SQL Server are the source for restore.

-m

--TapeFormat

Initializes the media on the device. This argument only applies to tape backups. This argument accepts one of the following values:

  • 0—Do not format (default)

  • 1—Write new header

  • 2—Long erase / write new header

  • 3—Low level controller format / write new header

NOTE: Any successful format operation (values 1, 2, and 3; not all are available to all drive types) lays down a LiteSpeed tape header that will identify this tape as containing LiteSpeed backups. Using @init=1 (or -I in the command line) will not lay down a tape header.

-w

--TapeRewind

Applies only to backing up and restoring tape. This argument accepts one of the following values:

  • 0—Leave the tape unwound (default)

  • 1—Rewind the tape after writing/reading

-u

--TapeUnload

Applies to tape backups and restores. This argument accepts one of the following values:

  • 0—Keep tape loaded (default)

  • 1—Unload and eject tape from the drive after operation

(none)

--TempDirectory  

Specifies a temporary directory for use with Object Level Recovery. Use this argument when the default Windows temp directory does not have enough free disk space for the restore process.

NOTE: You can specify the default temp directory using the TempPath parameter in the [LiteSpeed] section of the LiteSpeedSettings.ini file. (Usually, C:\Documents and Settings\All Users\Application Data\Quest Software\LiteSpeed\SQL Server\LiteSpeedSettings.ini.)

-t

--Threads

Determines the number of threads used for the backup. You will achieve the best results by specifying multiple threads, but the exact value depends on several factors including: processors available, affinity setting, compression level, encryption settings, IO device speed, and SQL Server responsiveness. The default is n-1 threads, where n is the number of processors.

-h

--Throttle

Specifies the maximum CPU usage allowed. The argument accepts an integer value between 1 and 100. The default value is 100. This is the percentage of the total amount of CPU usage (across all enabled processors) available.

TIP: Before you start tuning the CPU Throttle or Affinity parameters to adjust backup performance, try limiting the number of threads. If you decide to use an affinity value other than default, it is recommended that you limit the threading as well. You may also want to consider using Adaptive Compression to maintain backup performance. For more information, see Adaptive Compression.

  --UDT

Create table script:

  • 0—Off. Create table with native types, if possible; othervise (CLR UDT) create with UDT. (Default).
  • 1—On. Create table with UDT.

-U

--UserId

Specifies user login ID. Required if the connection type is not a trusted connection.

Login IDs are case-sensitive.

-V --Verify

Performs a restore verification on the backup file just created (if backup was successful).

  • 0—False (default)
  • 1—True

-T

--WindowsAuth

Uses a trusted connection (to the server) instead of requiring a password.

-W

--With

Specifies strings that will be passed directly to SQL Server. You can supply multiple instances of this argument.

Some of the accepted parameters are the following:

  • DIFFERENTIAL—Specifies that the database or file backup should consist only of the portions of the database or file changed since the last full backup. A differential backup is usually smaller than a full backup. Use this option so that all individual log backups since the last full backup do not need to be applied.
  • CHECKSUM—Causes checksums to be verified when a LiteSpeed backup is created.

    NOTE: When you restore a backup containing checksum, it is automatically checked. If you do not want to check the checksums during a restore, supply 'NO_CHECKSUM' .

  • CONTINUE_AFTER_ERROR—Causes the backup be executed despite encountering an invalid backup checksum.
  • COPY_ONLY—Specifies the copy-only backup.
  • KEEP_REPLICATION—Instructs the restore operation to keep the replication settings when restoring a published database to a server other than that on which it was created (used when setting up replication with log shipping).
  • MOVE—Specifies that the given logical_file_name should be moved to operating_system_file_name.
  • REPLACE—Instructs LiteSpeed to create the specified database and its related files even if another database already exists with the same name. The existing database is deleted.
  • RECOVERY—Instructs the restore operation to roll back any uncommitted transactions. After the recovery process, the database is ready for use.
  • NORECOVERY—Instructs the restore operation to not roll back any uncommitted transactions.
  • NO_TRUNCATE—Allows backing up the log in situations where the database is damaged.
  • RESTRICTED_USER—When used in conjunction with recovery (another with param and the default) leaving a usable database, this restricts access for the restored database to members of the db_owner, dbcreator, or sysadmin roles.
  • STATS—Displays a message each time a percentage of the activity completes. The default is 10%.
  • BLOCKSIZE—Specifies the physical block size, in bytes. Supported values are: 512, 1024, 2048, 4096, 8192, 16384, 32768, and 65536 (Default).
  • PASSWORD—Specifies the password for the backup set.
(none) --WithReplace

Instructs LiteSpeed to create the specified database and its related files even if another database already exists with the same name. The existing database is deleted. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

TSM-Specific Arguments

TSM-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none)

--TSMAdminName

Specifies the TSM administrative user name that has client authority for the TSM node. Some operations may require an administrative user with client owner authority to be specified in order to open a TSM session. The correct username and password may be obtained from the TSM administrator.

(none)

--TSMAdminPwd

Specifies the plain text password of the administrative user which is used to log in to the TSM server and start the TSM session.

(none) --TSMArchive

Specifies to store the backup as a TSM archive. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

-c

--TSMClientNode

Specifies the TSM server LiteSpeed connects to during backups and restores. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-k

--TSMClientOwnerPwd

Specifies the TSM client owner user password. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

(none) --TSMDeviceTimeoutMinutes

Specifies how long to wait for a TSM device.

(none) --TSMDSMI_Dir

DSMI_DIR path if needed.

(none) --TSMDSMI_Log

DSMI_LOG path.

-j   

--TSMConfigFile

Specifies the TSM configuration file.

-i

--TSMFile

Defines the TSM filespace, high level and low level. This argument accepts the following format:

tsm_filespace\tsm_high_level\tsm_low_level

where:

  • tsm_filespace is the logical space on the TSM server that contains a group of files. It can be the drive label name or UNC name.

  • tsm_high_level specifies the directory path in which the file belongs.

  • tsm_low_level specifies actual name of the file.

NOTE: You may only store one item the location specified by this argument. It is not possible to append an object to this location. You can use the -I command-line argument or @init to back up to a non-unique location.

-l

--TSMFileSpace

Specifies the TSM file space, the logical space on the TSM server. It can be the drive label name or UNC name. You can supply multiple instances of this argument.

NOTE: IBM recommends that an application client should select a unique file space; it is recommended that LiteSpeed users follow this practice with a specific file space reserved for LiteSpeed backups.

(none) --TSMLogname

Log name.

-z

--TSMMgmtClass

Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.

(none)

--TSMPointInTime

Specifies the date for restore/to filter results. If it is not passed, LiteSpeed will choose the most recent archived backup. The format is yyyy-mm-dd hh:mm:ss.

NOTE: If the backup was a striped backup and the point-in-times of the various striped files are different (rare but can be different a second or so), then the most recent of the times must be chosen.

Cloud-Specific Arguments

Cloud-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none)

--AWSStorageClass

The @AWSStorageClass argument specifies a range of storage classes established for different use cases including:

  • Standard: Standard storage - for general-purpose storage of frequently accessed data.
  • Standard-IA: Standard Infrequent Access - for long-lived, but less frequently accessed data.
  • RRS: Reduced Redundancy Storage - for non-critical data considering lower level of redundancy rather than Standard storage.

Important: This @AWSStorageClass argument is replaced by @CloudStorageClass. The @AWSStorageClass argument is no longer valid in subsequent LiteSpeed versions after 8.5.

(none) --AWSUseServerSideEncryption

The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3. This argument accepts one of the following values:

  • 0—Do not use Server Side Encryption
  • 1—Use Server Side Encryption
(none) --AzureBlobType

The @AzureBlobType argument specifies the types of blobs that can be stored in the Microsoft Azure cloud storage. This argument accepts one of the following values: "Block", "Page".

note: The LiteSpeed auto striping logic used in the @CloudAutoStriping and @CloudAutoStripingThreshold parameters can override the Azure blob limit for LiteSpeed backups.

(none) --CloudAccessKey

The @CloudAccessKey argument specifies the name of the unique Cloud Web Service alphanumeric access key that identifies each user. The selections include Amazon Access Key or Azure Account Name.

(none) --CloudAccessKeyEnc

The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service alphanumeric access key that identifies each user.

(none) --CloudAutoStriping

This parameter enables automatic file striping for LiteSpeed cloud backups.

(none) --CloudAutoStripingThreshold

This parameter contains the stripe size in GBs. LiteSpeed logic uses the database size to make a decision about the number of stripes needed for LiteSpeed cloud backups. For example, if you have a database with a size of 200GB and set @CloudAutoStripingThreshold = 50, then LiteSpeed uses 200/50 = 4 stripes.

(none) --CloudBucketName

The @CloudBucketName argument specifies the name of the container for cloud objects. Bucket names must be at least 3 and no more than 63 characters long. The selections are Amazon Bucket Name or Azure Container Name.

(none) --CloudGovRegion

The @CloudGovRegion argument enables a special restricted region for the US Government use in Amazon S3 and Azure Clouds. This argument accepts one of the following values:

  • 0—Do not use government cloud (default)
  • 1—Use government cloud
(none) --CloudRegionName

The @CloudRegionName argument specifies the name of the Cloud Web Service region to use for a bucket. Example values are but not limited to: us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2, and sa-east-1.

(none) --CloudSecretKey

The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when you initially get a Cloud account. The selections are Amazon Secret Key or Azure Access Key.

(none) --CloudSecretKeyEnc

The @CloudSecretKeyEnc argument specifies the name of the encrypted Cloud Web Service secret key that is assigned when you initially get a Cloud account.

(none) --CloudVendor

The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of the following values: "AmazonS3" or "AzureBlob."

(none)

--UseSSL

The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the following values:

  • 0—Do not use SSL
  • 1—Use SSL (default)

Proxy-Specific Arguments

Proxy-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none)

--ProxyHost

The @ProxyHost argument is optional and specifies the name of the proxy host name that is running the proxy server.

note: If the @ProxyHost argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyLogin

The @ProxyLogin argument is optional and specifies the proxy server login credential.

note: If not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPassword

The @ProxyPassword argument is optional and specifies the proxy server password credential.

note: If the @ProxyPassword argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPasswordEnc

The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.

note: If the @ProxyPasswordEnc argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPort

The @ProxyPort argument is optional and contains the port number of the proxy server. The TCP/IP port values can be 1-65535.

note: If the @ProxyPort argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

Examples

  1. Backup the Northwind database using a trusted connection to the backup device c:\temp\Northwind.bak:

    sqllitespeed.exe -B Database -T -D Northwind -F "C:\temp\Northwind.bak"

  2. Backup the Northwind database, log errors (if any) to a specified directory:

    sqllitespeed.exe -B Database -D Northwind -F "C:\temp\Northwind.bak" -L1 --trace logpath="C:\backup_logs"

  3. Write a database backup where each failure can be retried once after a 30 second wait:

    sqllitespeed.exe -B database -D foo -F c:\test.bkp -X disk_retry_count=1 -X disk_retry_wait=30

  4. Back up to TSM with the Passwordaccess Generate option:

    sqllitespeed.exe -Bdatabase -DNorthwind -L1 -i"fsMH\nw\%D" -j"C:\TSM\baclient\dsm_pg.opt" -I -z"SPS_MGTD" -S"MyServer\Inst2" -U"sa" -P"***"

  5. Create a differential backup of the Northwind database:

    sqllitespeed.exe -Bdatabase -DNorthwind -i"fsMH\nw\%D-%T" -c"10.0.1.200" -k"password" -j"c:\program files\Tivoli\TSM\baclient\dsm.opt" -WDIFFERENTIAL -I -n"Northwind Diff Backup" -d"Differential Backup of Northwind on 4/12/2011 1:50:58 PM"

  6. Restore the Northwind database:

    sqllitespeed.exe -RDatabase -j"C:\TSM\baclient\dsm.opt" -i"fsMH\nw\Northwind" --TSMPointInTime "2011-04-12 16:57:22" -N1 -DNorthwind -WREPLACE -A0 -L1 -S"w2k3-22" -U"sa" -P"***"

  7. Restore the Northwind database from the backup device c:\temp\Northwind.bak using variables:

    sqllitespeed.exe -R Database -D Northwind -F "C:\temp\%D.bak"

  8. Restore the most recent full and drop database:

    sqllitespeed.exe -R Automated -D LiteSpeedLocal_TestRestore --DataFilePath "D:\DATA" --LogFilePath "D:\DATA" --DropDatabase 3 --BackupPath "D:\temp" --BackupExtension "" --CheckSubfolders 0 --SourceServer LITESPEED\SQL2005 --SourceDatabase LiteSpeedLocal --BackupType full -K ****** --WithReplace 1 --DropDatabaseOnFailure 1 --DropDatabaseOnSuccess 1 -S"LITESPEED\SQL2005" -T

  9. Restore the most recent full backup and related differential and transaction log backups following this full to a new database.

    sqllitespeed.exe -R Automated --DataFilePath "D:\DATA" --LogFilePath "D:\DATA" --BackupPath "D:\temp" --BackupExtension "" --CheckSubfolders 1 -D LiteSpeedLocal_Copy --SourceServer LITESPEED\SQL2005 --SourceDatabase LiteSpeedLocal --BackupType tlog -K ****** -S"LITESPEED\SQL2005" -T

  10. Restore the most recent Fast Compression backups.

    sqlLiteSpeed.exe -R Automated -D "LiteSpeedLocal_AutomatedRestore" --BackupPath "D:\temp\FC\" --BackupExtension "" --CheckSubfolders 0 -K "*******" --SourceServer "LITESPEED\SQL2005" --SourceDatabase "LiteSpeedLocal" --BackupType "diff" --JobP "5jzOEztgLxQ=" --WithReplace 1 -S "LITESPEED\SQL2005" -U "sa" -P "******"

  11. Restore the most recent striped backup.

    sqllitespeed.exe -R Automated -D "NEWDB" --DataFilePath "D:\DATA" --LogFilePath "D:\DATA" --BackupPath "D:\temp" --BackupExtension "stripe1" --CheckSubfolders 0 --BackupPath "E:\temp" --BackupExtension "stripe2" --CheckSubfolders 0 --SourceServer "LITESPEED\SQL2005" --SourceDatabase "FOX" --BackupType "full" -S "LITESPEED\SQL2005" -T

  12. View candidates for Automated Restore.

    sqllitespeed.exe -R Automated --BackupPath d:\temp\TEST --BackupExtension "bak,bkp" --CheckSubfolders 1 --SourceServer LITESPEED\SQL2005 --SourceDatabase "LiteSpeedLocal" --BackupType "diff" --DryRun "1" -S "LITESPEED\SQL2005" -T

  13. Restore attached files only:

    sqllitespeed.exe -R attachedfilesonly -F "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\CapacityManagerRepository_Full_200903012353_20091006124204.bak" -N 1 --attachedfile "'C:\temp\CProg—29-Sep-2009 19-22-51-233.txt' to 'C:\CProg.txt'" -S "spb9771" -T

  14. Encrypt a password for the restore operations.

    sqllitespeed.exe --EncRestoreKey -K "RF^t%7MF"

  1. Restore Objects using the UDT argument. Create table with native types, if possible; othervise (CLR UDT) create with UDT.

    olr.exe -F "C:\temp\FOX_full.bak" -K****** -N3 -C -Y Database -Q d:\temp\create_database_FOX.sql --UDT 0

Returns

0 (success) or 1 (failure)

 

Related Topic


Was this topic helpful?

[Select Rating]



Fast Compression Command-Line Agruments

Fast Compression Command-Line Arguments

The LiteSpeed command-line utility (SLSFastCompression.exe) allows you to conduct full and differential backups directly from your operating system command-line.

Syntax

slsFastCompression.exe ( -? | --ShowHelp | --SDShowSyntax |
<FastCompression_backup_options> <Connection_options> |
<FastCompression_verify_option> <Connection_options> |
<FastCompression_backup_options> <FastCompression_verify_option> <Connection_options> )

 

FastCompression backup options:

--SDBackupDirectory <path>
[--SDForceFull |--SDForceDifferential ]
--SDExtentsChgRatioRequireFull <value> |--SDDiffToFullRatioRequireFull <value>
[--SDCheckForFullBackup]
[--SDFullBackupEscalation]
[--SDElapsedDaysRequireFull <n>]
[--SDSpecificDaysForbidFull (<day>,...)]
[--AltDir <path>]
[--SDMirrorDirectory <path>...]
[--SDAppendDifferential]     ]

[-F --FastCompressionExtension]

 

FastCompression verify option:

[--SDVerify (Last|Full,Last|All)] 

Accepted LiteSpeed arguments:
[-t <number_of_threads>]         
[-X <options>]
[-A <affinity_mask> ]
[-L (0|1|2)]        
[-W <with_arguments>]
[-n < backup_name>]
[-d <backup_description>]
[-p <priority_level> ]  
[--AdaptiveCompression (Speed|Size) | -C < compression_level> ]
[-e <encryption_level> (-K <encryption_key>| --JobP <encrypted_key>)]
[-Y <comment> ]
[--attachedfile <path_or_file>]
[-h 1...100]
[-o <buffer_count>]
[-x <maximum_transfer_size>] 
[-M --OLRMap]
[--MultiDatabaseType <all, system, user, selected>]

Connection options:

-D <database_name>
-S <server_name>
(-U <username> -P <password>) |-T]

 

TSM connection options:

[
-j <TSM_configuration_file> 
[-c <TSM_client_node> ]
[-k <TSM_client_owner_password>]
[--TSMDeviceTimeoutMinutes <minutes>]
[-l <TSM_filespace>]
[-z <TSM_management_class>]
]

 

Cloud connection options:

[--CloudVendor <vendor name>]
[--CloudAccessKey <key name>]

[--CloudAccessKeyEnc <encrypted key name>]

[--CloudAutoStriping <1 or 0>]

[--CloudAutoStripingThreshold <auto, number GB>]

[--CloudSecretKey <key name>]

[--CloudSecretKeyEnc <encrypted key name>]

[--CloudBucketName <bucket name>]

[--CloudRegionName <cloud region name>]

[--CloudGovRegion <government region number>]

 

Proxy connection options:

[--ProxyHost <proxy host name>]

[--ProxyLogin <proxy server login credential>]

[--ProxyPassword <proxy server password credential>]

[--ProxyPasswordEnc <encrypted proxy server password credential>]

[--ProxyPort <proxy server port number>]

Arguments

NOTES:

  • Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
  • Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.

Fast Compression Arguments

Argument

Description

--AlterDir

Specifies the directory where to search for the backup file.

Note: AlterDIr replaced SDSearchAlternateBackupDirectory in LiteSpeed 8.6. Support for the old SDSearchAlternateBackupDirectory parameter will be gradually phased out.

--SDAppendDifferential

Appends data to an existing full backup file.

--SDBackupDirectory

Specifies a directory for the backup file.

--SDCheckForFullBackup

Checks if the expected full backup exists when backing up to separate files and returns a failure message if it is not found. If the full backup file does not exist, it performs a full backup. If the full backup file does exist, the decision to perform a new full or a differential backup will depend on other conditions specified.

--SDDiffToFullRatioRequireFull

Specifies the last differential backup size to last full backup size ratio. When exceeding the specified ratio LiteSpeed performs a full backup.

This argument accepts one of the following formats:

  • ".4"
  • "40%"

--SDElapsedDaysRequireFull

Specifies the minimum number of days since last full backup required to perform full backup. The default value is 14.

--SDExtentsChgRatioRequireFull

Specifies the minimum amount of database changes required for the full backup.

This argument accepts one of the following formats:

  • ".4"
  • "40%"

--SDForceDifferential

Forces differential backup.

--SDForceFull

Forces full backup.

--SDFullBackupEscalation

This option causes LiteSpeed to issue a full backup, if one of the following problems is discovered in the current backup set:

  • The full backup is missing.
  • A differential backup is missing from the backup set (excludes backups automatically removed after the specified retention period).
  • LSN verification fails in the backup set.
  • Verify operation fails on full or differential backup.

NOTE: If a problem is detected and a full backup is created through escalation, an error will be returned.

This argument accepts one of the following values:

  • 0—False (default)
  • 1—True

--SDMirrorDirectory

Specifies a directory for a mirror backup. You can supply multiple instances of this argument.

--SDShowSyntax

Displays the slsFastCompression syntax.

--SDSpecificDaysForbidFull

Specifies days of the week when a full backup is never performed. This argument accepts one of the following formats:

  • 3—on Tuesday
  • "tu"—on Tuesday
  • "5-7"—from Thursday to Saturday
  • "m, w, su"—on Monday, Wednesday, and Sunday

--SDVerify

Performs a restore verification on the backup file just created (if backup was successful). This argument accepts one of the following values:

  • Last—Verifies last backup performed (can be either a full or differential)
  • Full, Last—Verifies the last full backup and last differential is available
  • All—Verifies last full backup and all differentials since

Accepted LiteSpeed Arguments

The following parameters work in conjunction with the Fast Compression parameters. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none) --AdaptiveCompression

Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see Compression Methods.

You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one of the following values:

  • Size
  • Speed

-A

--Affinity

Processor affinity designates specific processors to run LiteSpeed, while not allowing LiteSpeed to run on the remaining processors.

This argument accepts decimal values and hexadecimal values. If a value begins with "0x" it is interpreted as hexadecimal. A positive 64-bit integer value translates to a binary mask where a value of 1 designates the corresponding processor to be able to run the LiteSpeed process.

NOTE: 32-bit Windows is internally limited to a 32-bit mask.

For example, you need to select processors 2, 3, and 6 for use with LiteSpeed. Number the bits from the right to left. The rightmost bit represents the first processor. Set the second, third, and sixth bits to 1 and all other bits to 0. The result is binary 100110, which is decimal 38 or hexadecimal 0x26. Review the following for additional information:

Decimal Value

Binary Bit Mask

Allow LiteSpeed Threads on Processors

0 0 All (default)

1

1

1

3

11

1 and 2

7 111 1, 2 and 3

38

100110

2, 3, and 6

205 11001101 1, 3, 4, 7, and 8

Tip: Before you start tuning the CPU Throttle or Affinity parameters to adjust backup performance, try limiting the number of threads. If you decide to use an affinity value other than default, it is recommended that you limit the threading as well. You may also want to consider using Adaptive Compression to maintain backup performance. For more information, see Adaptive Compression.

For more information, see Configure LiteSpeed Defaults.

(none)

--AttachedFile

Specifies a file or directory (and all nested files and directories) to attach with this backup operation. You can supply multiple instances of this argument..

-d

--BackupDescription

Specifies a description to store with the backup.

This argument accepts variables. For more information, see LiteSpeed Variables.

-n

--BackupName

Specifies the name of the backup set.

This argument accepts variables. For more information, see LiteSpeed Variables.

-o

--BufferCount

Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set by SQL Server.

NOTE: LiteSpeed defaults typically result in the best performance. You should only modify advanced options after careful planning and testing.

-Y

--Comment

Appends a user comment to the backup.

This argument accepts variables. For more information, see LiteSpeed Variables.

-C

--CompressionLevel

Specifies the compression level for the backup. Valid values are 0 through 8. 0 bypasses the compression routines. The remaining values of 1 through 8 specify compression with increasingly aggressive computation. 2 is the default value for disk backups and 7 is the default value for cloud backups.

When choosing a compression level, it is best to try various options using your equipment and data to determine the best option for your environment. Use the Backup Analyzer to test the performance of different compression levels. For more information, see Test Optimal Backup Settings.

NOTE: If both the compression level and Adaptive Compression option are passed in, LiteSpeed will not error out and will select and use Adaptive Compression.

-D

--Database

Name of database to be backed up or restored.

-e

--EncryptionLevel

Specifies encryption level. Works in conjunction with the Key (K) parameter. This argument accepts one of the following values:

  • 0—40-bit RC2

  • 1—56 bit RC2

  • 2—112 bit RC2

  • 3—128 bit RC2

  • 4—168 bit 3DES

  • 5—128 bit RC4

  • 6—128 bit AES

  • 7—192 bit AES

  • 8—256 bit AES

-y

--Expiration

Specifies the date and time when the backup expires. LiteSpeed will not overwrite this file until expiration datetime is passed. This argument accepts one of the following formats:

  • yyyy-mm-dd
  • yyyy-mm-dd hh:mm:ss
(none)

--FastCompressionExtension

Specifies the fast compression file extension. This argument accepts one of the following formats:

  • bak - the default for new items.
  • bkp - for an existing item that does not have an extension defined.

-f

--File

Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of this argument.

-g

--FileGroup

Specifies a database filegroup to include in the backup or restore. You can supply multiple instances of this argument.

A filegroup backup is a single backup of all files in the filegroup and is equivalent to explicitly listing all files in the filegroup when creating the backup. Files in a filegroup backup can be restored individually or as a group.

-X --Ioflag

Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options using the following parameters:

  • DISK_RETRY_COUNT—Specifies the number of times that a specific operation will be retried on failure. The default is 4 retries, the maximum allowed setting is 1000.
  • DISK_RETRY_WAIT—Specifies the number of seconds to wait immediately following a failure before retrying. The default is 15 seconds, the maximum allowed setting is 300.

NOTE: This functionality is only available for disk and cloud operations.

-K

--Key

Value used to generate the encryption key for the encryption algorithm. If you do not supply encryption key, then the program will not encrypt the backup. If you use the wrong encryption key, the restore will fail.

Caution: When encrypting data, take care not to lose the encryption key; a backup cannot be restored or recovered without the original encryption key.

Example of key: 'Mypassword'

-L

--LogLevel

Creates a log file. This argument accepts one of the following values:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

The default output directory is C:\Documents and Settings\All Users\Application Data\Quest Software\LiteSpeed\SQL Server\Logs (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs) (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs). To log to a different directory run this utility with the following argument: --trace logpath = "path".

For more information, see Configure Logging in LiteSpeed.

-x

--MaxTransferSize

Specifies the largest unit of transfer in bytes to be used between SQL Server and LiteSpeed. The possible values are multiples of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is 1048576 (1 MB).

(none)

--MultiDatabaseType

Produces a backup that includes several types of databases. Types can include: all, system, user, or selected databases.

This argument accepts one of the following values:

  • All - Backup all system and user databases.
  • System - Backup only system databases.
  • User - Backup only user databases.
  • Selected - Backup specifically selected databases.

-M

--OLRMap

Generates a map file during a backup for Object Level Recovery. This argument accepts one of the following values:

  • 0—False (default)
  • 1—True
(none)

--Password

Specifies the user password. Passwords are case-sensitive. Required if the connection type is not a trusted connection.

-p

--Priority

Specifies the priority of the LiteSpeed process compared to other processes running on the same server. This argument accepts one of the following values:

  • -1—Below Normal

  • 0—Normal (Default)

  • 1—AboveNormal

  • 2—High

(none)

--Read_Write_Filegroups

Specifies a partial backup, which includes the primary filegroup and any read-write secondary filegroups.

-r

--RetainDays

Specifies a number of days to retain the backup. LiteSpeed will not overwrite this file for this number of days. 

(none)

--SDDryRun

Displays backups that are to be removed (delete candidates) or kept according to the specified conditions and SmartCleanup logic. SmartCleanup does not remove any backups, if this parameter is specified.

-S

--Server

Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:

  • server_name
  • server_name\instance_name

If no server is specified, the LiteSpeed command-line utility will connect to the default instance of SQL Server on the local computer.

-?

--ShowHelp

Displays the syntax summary of the LiteSpeed command-line utility.

-t

--Threads

Determines the number of threads used for the backup. You will achieve the best results by specifying multiple threads, but the exact value depends on several factors including: processors available, affinity setting, compression level, encryption settings, IO device speed, and SQL Server responsiveness. The default is n-1 threads, where n is the number of processors.

-h

--Throttle

Specifies the maximum CPU usage allowed. The argument accepts an integer value between 1 and 100. The default value is 100. This is the percentage of the total amount of CPU usage (across all enabled processors) available.

TIP: Before you start tuning the CPU Throttle or Affinity parameters to adjust backup performance, try limiting the number of threads. If you decide to use an affinity value other than default, it is recommended that you limit the threading as well. You may also want to consider using Adaptive Compression to maintain backup performance. For more information, see Adaptive Compression.

-U

--UserId

Specifies user login ID. Required if the connection type is not a trusted connection.

Login IDs are case-sensitive.

(none)

--Verify 1 Performs a restore verification on the backup file just created (if backup was successful).

-W

--With

Specifies strings that will be passed directly to SQL Server in the backup/restore SQL.  

Some of the accepted parameters are the following:

  • CHECKSUM—Causes checksums to be verified when a LiteSpeed backup is created.

    NOTE: When you restore a backup containing checksum, it is automatically checked. If you do not want to check the checksums during a restore, supply 'NO_CHECKSUM' .
  • CONTINUE_AFTER_ERROR—Causes the backup be executed despite encountering an invalid backup checksum.
  • STATS—Displays a message each time a percentage of the activity completes. The default is 10%.

Accepted TSM Command-Line Arguments

The following arguments work in conjunction with the Fast Compression arguments and accepted LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

-c

--TSMClientNode

Specifies the TSM server LiteSpeed connects to during backups and restores. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-k

--TSMClientOwnerPwd

Specifies the TSM client owner user password. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-j   

--TSMConfigFile

Specifies the TSM configuration file.

(none) --TSMDeviceTimeoutMinutes

Specifies how long to wait for a TSM device.

(none) --TSMdsmi-dir

DSMI_DIR path if needed.

(none) --TSMdsmi_log

DSMI_LOG path.

-l

--TSMFileSpace

Specifies the TSM file space, the logical space on the TSM server. It can be the drive label name or UNC name. You can supply multiple instances of this argument.

NOTE: IBM recommends that an application client should select a unique file space; it is recommended that LiteSpeed users follow this practice with a specific file space reserved for LiteSpeed backups.

(none) --TSMLogname

Log name.

-z

--TSMMgmtClass

Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.

Cloud-Specific Arguments

Cloud arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none)

--AWSStorageClass

The @AWSStorageClass argument specifies a range of storage classes established for different use cases including:

  • Standard: Standard storage - for general-purpose storage of frequently accessed data.
  • Standard-IA: Standard Infrequent Access - for long-lived, but less frequently accessed data.
  • RRS: Reduced Redundancy Storage - for non-critical data considering lower level of redundancy rather than Standard storage.

Important: This @AWSStorageClass argument is replaced by @CloudStorageClass. The @AWSStorageClass argument is no longer valid in subsequent LiteSpeed versions after 8.5.

(none) --AWSUseServerSideEncryption

The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3. This argument accepts one of the following values:

  • 0—Do not use Server Side Encryption
  • 1—Use Server Side Encryption
(none) --AzureBlobType

The @AzureBlobType argument specifies the types of blobs that can be stored in the Microsoft Azure cloud storage. This argument accepts one of the following values: "Block", "Page".

note: The LiteSpeed auto striping logic used in the @CloudAutoStriping and @CloudAutoStripingThreshold parameters can override the Azure blob limit for LiteSpeed backups.

(none) --CloudAccessKey

The @CloudAccessKey argument specifies the name of the unique Cloud Web Service alphanumeric access key that identifies each user. The selections include Amazon Access Key or Azure Account Name.

(none) --CloudAccessKeyEnc

The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service alphanumeric access key that identifies each user.

(none) --CloudAutoStriping

This parameter enables automatic file striping for LiteSpeed cloud backups.

(none) --CloudAutoStripingThreshold

This parameter contains the stripe size in GBs. LiteSpeed logic uses the database size to make a decision about the number of stripes needed for LiteSpeed cloud backups. For example, if you have a database with a size of 200GB and set @CloudAutoStripingThreshold = 50, then LiteSpeed uses 200/50 = 4 stripes.

(none) --CloudBucketName

The @CloudBucketName argument specifies the name of the container for cloud objects. Bucket names must be at least 3 and no more than 63 characters long. The selections are Amazon Bucket Name or Azure Container Name.

(none) --CloudGovRegion

The @CloudGovRegion argument enables a special restricted region for the US Government use in Amazon S3 and Azure Clouds. This argument accepts one of the following values:

  • 0—Do not use government cloud (default)
  • 1—Use government cloud
(none) --CloudRegionName

The @CloudRegionName argument specifies the name of the Cloud Web Service region to use for a bucket. Example values are but not limited to: us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2, and sa-east-1.

(none) --CloudSecretKey

The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when you initially get a Cloud account. The selections are Amazon Secret Key or Azure Access Key.

(none) --CloudSecretKeyEnc

The @CloudSecretKeyEnc argument specifies the name of the encrypted Cloud Web Service secret key that is assigned when you initially get a Cloud account.

(none) --CloudVendor

The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of the following values: "AmazonS3" or "AzureBlob."

(none)

--UseSSL

The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the following values:

  • 0—Do not use SSL
  • 1—Use SSL (default)

Proxy-Specific Arguments

Proxy arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more information.

-Argument

--Argument

Description

(none)

--ProxyHost

The @ProxyHost argument is optional and specifies the name of the proxy host name that is running the proxy server.

note: If the @ProxyHost argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyLogin

The @ProxyLogin argument is optional and specifies the proxy server login credential.

note: If not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPassword

The @ProxyPassword argument is optional and specifies the proxy server password credential.

note: If the @ProxyPassword argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPasswordEnc

The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.

note: If the @ProxyPasswordEnc argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPort

The @ProxyPort argument is optional and contains the port number of the proxy server. The TCP/IP port values can be 1-65535.

note: If the @ProxyPort argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

Examples

  1. Back up the Northwind database. Perform full backup only if the amount of database changes since the last full backup is more than 40%.

    SLSFastCompression.exe --SDBackupDirectory "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup" --SDExtentsChgRatioRequireFull ".4" -D Northwind -S SPB9771

  2. Back up the Northwind database to multiple locations. Perform full backup only if more than 10 days have passed since last full backup. Full backup escalation option is on.

    SLSFastCompression.exe --SDBackupDirectory "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup" --SDMirrorDirectory "D:\SQLServerBackups" --SDElapsedDaysRequireFull 10 --SDFullBackupEscalation -S SPB9771 -D Northwind

  3. Back up the Northwind database. Force full backup.

    SLSFastCompression.exe --SDBackupDirectory "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup" --SDForceFull -D Northwind -S SPB9771

  4. Back up to TSM using the Passwordaccess Generate option specified in the option file. Perform full backup only if the amount of database changes since the last full backup is more than 40%.

    SLSFastCompression.exe -D LiteSpeedLocal -C 2 --SDExtentsChgRatioRequireFull ".4" --TSMFileSpace "FC" --TSMConfigFile "C:\Program Files\Tivoli\TSM\baclient\dsm_pg.opt" --TSMMgmtClass "STANDARD" --tsmdevicetimeoutminutes 2 --SDFullBackupEscalation --SDElapsedDaysRequireFull 14 -S"W2K5_TSM" -U"sa" -P"***"

  5. Back up to Amazon S3 cloud.

    TIP: Command line fast compression backups only work with the encrypted access information. They will fail if the access info is not encrypted.

    SLSFastCompression.exe --SDBackupDirectory "fc" --SDExtentsChgRatioRequireFull ".4" -D model --CloudVendor "AmazonS3" --CloudBucketName "california" --CloudAccessKey "*****" --CloudSecretKey "*****" --CloudRegionName "us-west-1" --UseSSL -S"servername" -T

Returns

0 (success) or 1 (failure)

 

Related Topic

LiteSpeed Command-Line Arguments


Was this topic helpful?

[Select Rating]



SmartCleanup Command-Line Arguments

SmartCleanup Command-Line Arguments

The slsSmartCleanup command-line utility (slsSmartCleanUp.exe) allows you to find and remove old full, differential and transaction log backups based on a user-defined period (either the file age or the date).

The backup retention will never delete:

  • The backup files, if there are mixed backups in the same backup file. For example, if a user performs a backup of AdventureWorks and Pubs into the same mybackups.bak backup file.
  • The full backup, if there are associated differential or t-log backups in the backup set that are not eligible for cleanup.
  • File/FileGroup backups
  • File/FileGroup differential backups
  • Partial backups
  • Partial differential backups
  • Files that have the filesystem archive bit set (if that option is selected)

Syntax

slsSmartCleanup.exe ( -? | --ShowHelp | --ShowSyntax | <options> )

Connection options:

--Database <database_name>
--Server <server_name>
--WindowsAuth | (--UserName <username> --Password <password>)

Cleanup options:

--BackupRetainDays <number> | --BackupExpiration <date>
--LogRetainDays <number> | --LogExpiration <date>

--KeepArchiveFiles

--MultiDatabaseType

[--CopyOnlyBackups <option>]

TSM connection options:

[--TSMConfigFile <path>]
[--TSMClientNode <node>]
[--TSMClientOwnerPwd <password>]
[--TSMdsmi_dir <path>]
[--TSMdsmi_log <path>]
[--TSMLogName <name>]
[--TSMAdminName <name>]
[--TSMAdminPwd <password>]

[Cloud connection options:]

[--CloudVendor <vendor name>]
[--CloudAccessKey <key name>]

[--CloudAccessKeyEnc <encrypted key name>]

[--CloudAutoStriping <1 or 0>]

[--CloudAutoStripingThreshold <auto, number GB>]

[--CloudSecretKey <key name>]

[--CloudSecretKeyEnc <encrypted key name>]

[--CloudBucketName <bucket name>]

[--CloudRegionName <cloud region name>]

[--CloudGovRegion <government region number>]

[Proxy connection options:]

[--ProxyHost <proxy host name>]

[--ProxyLogin <proxy server login credential>]

[--ProxyPassword <proxy server password credential>]

[--ProxyPasswordEnc <encrypted proxy server password credential>]

[--ProxyPort <proxy server port number>]

Other options:

[--DryRun]
[--LogLevel (0|1|2) [--trace logpath = "path"]]

Arguments

NOTES:

  • Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
  • Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.

-Argument

--Argument

Description

-a --KeepArchiveFiles

Turns on monitoring and refuses to delete files that have the archive filesystem bit set. When enabled dependent files are not deleted.

-b --BackupRetainDays

Specifies the number of days (N). The full or differential backup must be at least N days old before it is eligible for cleanup.

-c --BackupExpiration

Specifies the date using one of the following formats:

YYYY-MM-DD

YYYY-MM-DD HH:MM:SS

where

  • YYYY—4-digit year
  • MM—2-digit month
  • DD—2-digit day of the month
  • HH—2-digit hour using the local 24-hour clock
  • MM—2-digit minute
  • SS—2-digit second

To be eligible for cleanup, the full or differential backup must be older than this date.

-C --CopyOnlyBackups

Controls how LiteSpeed handles copy-only backups. This argument accepts one of the following values:

  • Default—LiteSpeed will ignore copy-only backups except on secondary replicas in AlwaysOn Availability groups, in which case it will allow deletions. This is the default behavior when the parameter is not specified.
  • Ignore—Copy-only backups are never deleted.
  • AllowDeletes—Copy-only backups are removed according to the specified retention options.

NOTES:

  • Transaction log backups are not considered dependent on copy-only full or copy-only tlog backups.
  • Copy-only transaction log backups will not mark other transaction log or full backups as having a dependent.
  • The values are not case-sensitive.
-D --Database

Name of database to be backed up or restored.

Only backups of this database are eligible for cleanup.

(none) --Destination Specifies the instance of the destination server to cleanup.
-d --DryRun

Displays backups that are to be removed (delete candidates) or kept according to the specified conditions and SmartCleanup logic. SmartCleanup does not remove any backups, if this parameter is specified.

-k --LogExpiration

Specifies the date of one of the following formats:

YYYY-MM-DD

YYYY-MM-DD HH:MM:SS

where

  • YYYY—4-digit year
  • MM—2-digit month
  • DD—2-digit day of the month
  • HH—2-digit hour using the local 24-hour clock
  • MM—2-digit minute
  • SS—2-digit second

To be eligible for cleanup, the t-log backup must be older than this date.

-L --LogLevel

Creates a log file. This argument accepts one of the following values:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

The default output directory is C:\Documents and Settings\All Users\Application Data\Quest Software\LiteSpeed\SQL Server\Logs (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs) (or C:\ProgramData\Quest Software\LiteSpeed\SQL Server\Logs). To log to a different directory run this utility with the following argument: --trace logpath = "path".

For more information, see Configure Logging in LiteSpeed.

-l --LogRetainDays

Specifies the number of days (N). The t-log backup must be at least N days old before it is eligible for cleanup.

(none) --MultiDatabaseType

Produces a cleanup for several types of databases. Types can include: all, system, user, or selected databases.

This argument accepts one of the following values:

  • All - Cleanup backups for all system and user databases.
  • System - Cleanup backups for only system databases.
  • User - Cleanup backups for only user databases.
  • Selected - Cleanup backups for specifically selected databases.
-S --Server

Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:

  • server_name
  • server_name\instance_name

If no server is specified, the LiteSpeed command-line utility will connect to the default instance of SQL Server on the local computer.

(none) --ServerToDelete

Specifies the instance of the destination server to delete.

(none) --TSMAdminName

Specifies the TSM administrative user name that has client authority for the TSM node. Some operations may require an administrative user with client owner authority to be specified in order to open a TSM session. The correct username and password may be obtained from the TSM administrator.

(none) --TSMAdminPwd

Specifies the plain text password of the administrative user which is used to log in to the TSM server and start the TSM session.

(none) --TSMClientNode

Specifies the TSM server LiteSpeed connects to during backups and restores. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

(none) --TSMClientOwnerPwd

Specifies the TSM client owner user password. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-j --TSMConfigFile

Specifies the TSM configuration file.

(none) --TSMdsmi_dir

DSMI_DIR path if needed.

(none) --TSMdsmi_log

DSMI_LOG path.

(none) --TSMLogName

Log name.

-U --UserName

Specifies user login ID. Required if the connection type is not a trusted connection.

Login IDs are case-sensitive.

-P --Password

Specifies the user password. Passwords are case-sensitive. Required if the connection type is not a trusted connection.

-T --WindowsAuth Specifies Windows authentication. Uses a trusted connection (to the server) instead of requiring a password.
-? --ShowHelp

Displays the syntax summary of the LiteSpeed command-line utility.

(none)               --ShowSyntax Displays the utility syntax.

Cloud-Specific Arguments

Cloud-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup Command-Line Arguments for more information.

-Argument

--Argument

Description

(none) --CloudAccessKey

The @CloudAccessKey argument specifies the name of the unique Cloud Web Service alphanumeric access key that identifies each user. The selections include Amazon Access Key or Azure Account Name.

(none) --CloudAccessKeyEnc

The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service alphanumeric access key that identifies each user.

(none) --CloudBucketName

The @CloudBucketName argument specifies the name of the container for cloud objects. Bucket names must be at least 3 and no more than 63 characters long. The selections are Amazon Bucket Name or Azure Container Name.

(none) --CloudGovRegion

The @CloudGovRegion argument enables a special restricted region for the US Government use in Amazon S3 and Azure Clouds. This argument accepts one of the following values:

  • 0—Do not use government cloud (default)
  • 1—Use government cloud
(none) --CloudRegionName

The @CloudRegionName argument specifies the name of the Cloud Web Service region to use for a bucket. Example values are but not limited to: us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, eu-central-1, eu-west-1, eu-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2, and sa-east-1.

(none) --CloudSecretKey

The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when you initially get a Cloud account. The selections are Amazon Secret Key or Azure Access Key.

(none) --CloudSecretKeyEnc

The @CloudSecretKeyEnc argument specifies the name of the encrypted Cloud Web Service secret key that is assigned when you initially get a Cloud account.

(none) --CloudVendor

The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of the following values: "AmazonS3" or "AzureBlob."

(none)

--UseSSL

The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the following values:

  • 0—Do not use SSL
  • 1—Use SSL (default)

Proxy-Specific Arguments

Proxy-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup Command-Line Arguments for more information.

-Argument

--Argument

Description

(none)

--ProxyHost

The @ProxyHost argument is optional and specifies the name of the proxy host name that is running the proxy server.

note: If the @ProxyHost argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyLogin

The @ProxyLogin argument is optional and specifies the proxy server login credential.

note: If not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPassword

The @ProxyPassword argument is optional and specifies the proxy server password credential.

note: If the @ProxyPassword argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPasswordEnc

The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.

note: If the @ProxyPasswordEnc argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

(none) --ProxyPort

The @ProxyPort argument is optional and contains the port number of the proxy server. The TCP/IP port values can be 1-65535.

note: If the @ProxyPort argument is not defined, then the LiteSpeed core engine checks the local .ini files for the proxy parameters. If the proxy parameters are not detected, then the LiteSpeed core engine connects directly to the proxy servers.

Example

  1. Delete disk full and differential backups older than 28 days, delete log backups older than 2 days, allow deletions of the copy-only backups:

    SLSSmartCleanup.exe --Database test2 --BackupRetainDays 28 --LogRetainDays 2 --CopyOnlyBackups AllowDeletes --Server LITESPEED\SQL2005 -U sa -P *******

  2. Delete disk full and differential backups created before 11/15/2012:

    SLSSmartCleanup.exe --Database test2 --BackupExpiration "2012-11-15" --Server LITESPEED\SQL2005 --WindowsAuth

  3. Delete tsm log backups older than 2 days:

    SLSSmartCleanup.exe --Database test_tsm --TSMConfigFile "C:\Program Files\Tivoli\TSM\baclient\dsm.opt" --TSMClientNode w2k3_TSM2 --TSMClientOwnerPwd ***** --LogRetainDays 2 --WindowsAuth

  4. Delete full, differential and log TSM backups created before 06/15/2012, using the PASSWORDAccess generate option to connect to the TSM Server:

    SLSSmartCleanup.exe --Database test_tsm --TSMConfigFile "C:\Program Files\Tivoli\TSM\baclient\dsm_gp.opt" --BackupExpiration 2012-06-15 --LogExpiration 2012-06-15 --WindowsAuth

  5. Delete Amazon S3 cloud backup.

    TIP: The parameter “-CSecretKey” must be generated by the Maintenance plan wizard and cut\paste into the command line script.

    SLSsmartcleanup.exe -D model --BackupExpiration "2014-03-02 00:00:00" --CloudVendor "AmazonS3" --CloudBucketName "california" --CloudAccessKey "***** " --CloudSecretKey "******" --CloudRegionName "us-west-1" --UseSSL -S"servername"

Returns

0 (success) or 1 (failure)

  

Related Topics


Was this topic helpful?

[Select Rating]



Script Maintenance Plans Tasks

Script Maintenance Plans Tasks

You can perform various database maintenance tasks from the command line. To use the SLSSQLMaint utility, change the directory until you are in the directory containing slssqlmaint.exe. (Usually, C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\Binn).

NOTE: You can generate scripts by opening tasks in the LiteSpeed UI Console and clicking View T-SQL. About Creating Maintenance Plans

This topic covers the following:

Syntax

slssqlmaint.exe
-? | (<connection_options> <task_options>)

Connection options:

-S <server_name\instance_name>
-T | (-U <login_ID> -P <password>)

Backup Database task options (Disk):

-D <names_group_or_patterns>
-BkUpMedia DISK
-BkUpDB|-BkUpLog
( (<path_and_filename>
-BkFileName
[-NOINIT] )
| ( (-UseDefDir|<path>)
[-CrBkSubDir]
-Default <file_format> ) )
[-BkExt <extension>]
[-Differential]
[-FileGroups <filegroups>]
[-Expiration <date_time> | -Retaindays <number_of_days> ]
[-DelBkUps <number>(HOURS|DAYS|WEEKS|MONTHS|YEARS)]
[-VrfyBackup]
[-With "COPY_ONLY"]
[-AdaptiveCompression (speed|size) | -CompressionLevel <value> ]
[-Logging (0|1|2)]
[-Comment <comment>]
[-Threads <number>]
[-Throttle <value>]
[-BufferCount <number>]
[-MaxTransferSize <size>]
[-Priority (0|1|2)]
[-Affinity <mask>]
[-X
    [DISK_RETRY_COUNT <value>]
    [DISK_RETRY_WAIT <value>]]
[-CryptLevel <value>
(-jobp <encrypted_key> | -BackupKey <encryption_password>) ]
[-DblClick (1|2)]
[-OPTOLR|-NOOPTOLR]
[-Reliability (1|2|3)]
[-Mirror <path>]
[-Attached <file_or_directory>]
[-Exclude
    [Offline]
    [LogShippng]
    [ReadOnly]
    [Selected]
    [Deleted]
    [<wildcard_or_regex_pattern>]
    [IgnoreReplica
        [Primary]
        [Secondary]]

Backup Database task options (TSM or TSM Archive):

-D <names_group_or_patterns>
-BkUpMedia (TSM|TSMARCHIVE)
(-BkUpDB|-BkUpLog)
-BkFileName
[-CrBkSubDir]
-Default <file_format>
[-Differential]
[-FileGroups <filegroups>]
[-TSMClientNode <client_node>]
[-TSMClientOwnerPWD <password>]
-TSMConfigFile <path>
-TSMObjectPath <TSM_path>
[-TSMManagementClass <name>]
[-TSMDeviceTimeoutMinutes <timeout_period>]
[-VrfyBackup]
[-With "COPY_ONLY"]
[-AdaptiveCompression (speed|size) | -CompressionLevel <value> ]
[-Logging (0|1|2)]
[-Comment <comment>]
[-Threads <number>]
[-Throttle <value>]
[-BufferCount <number>]
[-MaxTransferSize <size>]
[-Priority (0|1|2)]
[-Affinity <mask>]
[-CryptLevel <value>
(-jobp <encrypted_key> | -BackupKey <encryption_password>) ]
[-Reliability (1|2|3)]
[-Attached <file_or_directory>]
[-Exclude
    [Offline]
    [LogShippng]
    [ReadOnly]
    [Selected]
    [Deleted]
    [<wildcard_or_regex_pattern>]
    [IgnoreReplica
        [Primary]
        [Secondary]]

Backup Database task options (Tape):

-D <names_group_or_patterns>
-BkUpMedia TAPE
(-BkUpDB|-BkUpLog)
<path>
-BkFileName
[-NOINIT]
[-Differential]
[-FileGroups <filegroups>]
[-Expiration <date_time> | -Retaindays <number_of_days> ]
[-VrfyBackup]
[-With "COPY_ONLY"]
[-AdaptiveCompression (speed|size) | -CompressionLevel <value> ]
[-Logging (0|1|2)]
[-Comment <comment>]
[-Threads <number>]
[-Throttle <value>]
[-BufferCount <number>]
[-MaxTransferSize <size>]
[-Priority (0|1|2)]
[-Affinity <mask>]
[-CryptLevel <value>
(-jobp <encrypted_key> | -BackupKey <encryption_password>) ]
[-Reliability (1|2|3)]
[-Attached <file_or_directory>]
[-Exclude
    [Offline]
    [LogShippng]
    [ReadOnly]
    [Selected]
    [Deleted]
    [<wildcard_or_regex_pattern>]
    [IgnoreReplica
        [Primary]
        [Secondary]]

Fast Compression task options (Disk):

-D <names_group_or_patterns>
-BkUpMedia DISK
-BkUpDB <path>
-BkFileName
[-CrBkSubDir]
[-NOINIT]
-SmartDiff <number>DAYS
(-DataDelta <value> | -SizeDelta <value>)
[-ExcludeDays <values>]
-SingleFile (0|1)
[-RequireFull
[-AltBkpDir <path>]]
[-BackupEsc]
[-VerifyOpt (Last|FullDiff|All)]
[-NotifyOpt (Failure|Every)]
[-NotifyAgent <name>]
[-FullDiffRtn 28 ]
[-LogRtn 28]
[-AdaptiveCompression (speed|size) | -CompressionLevel <value> ]
[-Logging (0|1|2)]
[-Comment <comment>]
[-Threads <number>]
[-Throttle <value>]
[-BufferCount <number>]
[-MaxTransferSize <size>]
[-Priority (0|1|2)]
[-Affinity <mask>]
[-X
    [DISK_RETRY_COUNT <value>]
    [DISK_RETRY_WAIT <value>]]
[-CryptLevel <value>
(-jobp <encrypted_key> | -BackupKey <encryption_password>) ]
[-OPTOLR|-NOOPTOLR]
[-Reliability (1|2|3)]
[-Mirror <path>]
[-Attached <file_or_directory>]
[-Exclude
    [Offline]
    [LogShippng]
    [ReadOnly]
    [Selected]
    [Deleted]
    [<wildcard_or_regex_pattern>]
    [IgnoreReplica
        [Primary]
        [Secondary]]

Fast Compression task options (TSM):

-D <names_group_or_patterns>
-BkUpMedia DISK
-BkUpDB <path>
-BkFileName
[-CrBkSubDir]
-Default <file_format>
[-TSMClientNode <client_node>]
[-TSMClientOwnerPWD <password>]
-TSMConfigFile <path>
[-TSMObjectPath <filespace_name>]
[-TSMManagementClass <name>]
[-TSMDeviceTimeoutMinutes <timeout>]
-SmartDiff <number>DAYS
(-DataDelta <value> | -SizeDelta <value>)
[-ExcludeDays <values>]
-SingleFile (0|1)
[-RequireFull
[-AltBkpDir <path>]]
[-BackupEsc]
[-VerifyOpt (Last|FullDiff|All)]
[-NotifyOpt (Failure|Every)]
[-NotifyAgent <name>]
[-FullDiffRtn 28 ]
[-LogRtn 28]
[-AdaptiveCompression (speed|size) | -CompressionLevel <value> ]
[-Logging (0|1|2)]
[-Comment <comment>]
[-Threads <number>]
[-Throttle <value>]
[-BufferCount <number>]
[-MaxTransferSize <size>]
[-Priority (0|1|2)]
[-Affinity <mask>]
[-CryptLevel <value>
(-jobp <encrypted_key> | -BackupKey <encryption_password>) ]
[-Reliability (1|2|3)]
[-Attached <file_or_directory>]
[-Exclude
    [Offline]
    [LogShippng]
    [ReadOnly]
    [Selected]
    [Deleted]
    [<wildcard_or_regex_pattern>]
    [IgnoreReplica
        [Primary]
        [Secondary]]

Cleanup History task options:

-CleanHis
    <number>(HOURS|DAYS|WEEKS|MONTHS|YEARS)
    [BKUP]
    [JBS]
    [MAINTPLN]
    [Activity]
    [CentralActivity]
    [PurgeInfo]
    [Logshipping]
    [Status]
    [ShrinkLog]

Cleanup Maintenance Plans task options:

-MAINTDEL
    -DelDeviceType DISK
    -DELTYPE (FileBkup|FileRpt|FileAny)
    [-DELUSEAGE
        -DELUNIT <number>
        -DELUNITTYPE (MINUTES|HOURS|DAYS|WEEKS|MONTHS|YEARS)]
    (-DELFOLDER <directory>
    -DELEXTENSION <extension>
    [-DELSUBFOLDERS]
    [-DelEmptyFolder])
    |(-DELFILE
        -DELFILEPATH <path_and_filename>)

Legacy Task options:

(-PlanID <plan_ID>|-PlanName <plan_name>)
[<backup_task_options>]
[-CkDB|-CkDBNoIdx]
[-ReorgIDX]
[<cleanup_maint_plans_task_options>]
[<clean_up_history_task_options>]
[-OpNotify <names>
    -OpMessage <message>
    -OpSubject <subject>
    -OpImportance (0|1|2)]
[-RebldIdx <1-100> ]
[-RmUnusedSpace <max_size> <free_space_to_remain>
    [NoTrunc]]
[-UpdOptiStats <number> -UpdStatsTarget (Columns|Index|All) -UpdStatsScan (FullScan|Rows|Percent)]
[-Rpt <path>.txt
[-DelTxtRpt <number><time_unit>]]
[-HtmlRpt <path>.html
[-DelHtmlRpt <number><time_unit>]]
[-To <operator_name>]
[-Writehistory]
[-LogEngine (0|1|2)]

Arguments

-Argument

Description

-AdaptiveCompression <value>

Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see Compression Methods.

You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one of the following values:

  • Size
  • Speed
-AFFINITY <mask>

Specifies the affinity mask for the process. The mask is a 64-bit integer value. By default, it is 0 and will utilize all CPUs.

For more information, see Processor Affinity.

-AltBkpDir <path> Specifies the directory where to search for the backup file.

-Attached <file_or_directory>

Specifies filepaths to include in both backup and restore operations. The filepath can be either a single file or a directory. If it is a directory, then LiteSpeed recursively includes all files and subdirectories. All attached files are encrypted and compressed, with all pertinent backup parameters supported. This feature works for disk, tape, TSM, and Double Click Restore as well. You can supply multiple instances of this argument.

When used within the context of a restore operation, the path parameter can be expanded to include a new destination. This form will take the syntax of <file_path> to <new_file_path>. The new filepath can be used to specify a new location but cannot rename a file.

This argument only restores the attached files. It does not restore the database, just the files that were attached to that backup.

NOTES:

  • The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
  • c:\testad to testadr would restore all files in directory c:\testad to c:\testadr.
-BackupEsc

This option causes LiteSpeed to issue a full backup, if one of the following problems is discovered in the current backup set:

  • The full backup is missing.
  • A differential backup is missing from the backup set (excludes backups automatically removed after the specified retention period).
  • LSN verification fails in the backup set.
  • Verify operation fails on full or differential backup.

NOTE: If a problem is detected and a full backup is created through escalation, an error will be returned.

-BackupKey <encryption_password>

Value used to generate the encryption key for the encryption algorithm. If you do not supply encryption key, then the program will not encrypt the backup. If you use the wrong encryption key, the restore will fail.

Caution: When encrypting data, take care not to lose the encryption key; a backup cannot be restored or recovered without the original encryption key.

Example of key: 'Mypassword'

-BkExt <extension> Specifies the extension of the backup files.
-BkFileName Specifies that each path specified includes the filename.
-BkUpDB

Specifies the database backup type.

-BkUpLog Specifies the tlog backup type.
-BkUpMedia <value>

Specifies the backup destination. This argument accepts one of the following values:

  • DISK
  • TAPE
  • TSM
  • TSMArchive
-BUFFERCOUNT

Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set by SQL Server.

-CkDB

Checks the allocation and structural integrity of tables and indexes.

-CkDBNoIdx Checks the allocation and structural integrity of tables.
-CleanHis <values>

Enables the Cleanup History task. This argument accepts one or more of the following:

  • <number><time_unit>—Removes historical data older than specified time period. You can use one of the following time units:
    • HOURS
    • DAYS
    • WEEKS
    • MONTHS
    • YEARS
  • BKUP—Deletes back up and restore history.
  • JBS—Deletes SQL Server Agent jobs history.
  • MAINTPLN—Deletes Maintenance plans history.
  • Activity—Deletes LiteSpeed activity from the Local Repository.
  • CentralActivity—Deletes LiteSpeed activity from the Central Repository.
  • PurgeInfo—Deletes any information for deleted databases.
  • LogShipping—Deletes log shipping history.
  • Status—Deletes status history (Job, DTS, Maint Plans).
  • ShrinkLog—Shrinks the repository databases log files.
-COMMENT <comment>

Appends a user comment to the backup.

This argument accepts variables. For more information, see LiteSpeed Variables.

-COMPRESSIONLEVEL <value>

Specifies the compression level for the backup. Valid values are 0 through 8. 0 bypasses the compression routines. The remaining values of 1 through 8 specify compression with increasingly aggressive computation. 2 is the default value for disk backups and 7 is the default value for cloud backups.

When choosing a compression level, it is best to try various options using your equipment and data to determine the best option for your environment. Use the Backup Analyzer to test the performance of different compression levels. For more information, see Test Optimal Backup Settings.

NOTE: If both the compression level and Adaptive Compression option are passed in, LiteSpeed will not error out and will select and use Adaptive Compression.

-CrBkSubDir

Creates a subdirectory for each database.

-CRYPTLEVEL <value>

Specifies the encryption level. This argument accepts one of the following values:

  • 0—40-bit RC2

  • 1—56 bit RC2

  • 2—112 bit RC2

  • 3—128 bit RC2

  • 4—168 bit 3DES

  • 5—128 bit RC4

  • 6—128 bit AES

  • 7—192 bit AES

  • 8—256 bit AES

-D <names_group_or_patterns>

Specifies the database names or the following built-in database groups to include in the backup:

  • "ALL DATABASES"
  • "ALL SYSTEM DATABASES"
  • "ALL USER DATABASES"

Alternately, you can specify wildcard or regular expression patterns using one of the following formats:

  • Mask:"<wildcard_expression>"
  • Regex:"<regular_expression>"

For more information, see Use Wildcard and Regular Expressions in LiteSpeed.

-DataDelta <value>

Specifies the minimum amount of database changes required for the full backup.

Accepted values are 1-99, the default value is 35.

-DblClick

Creates a Double Click Restore executable. This argument accepts one of the following values:

  • 1—Converts a LiteSpeed backup to a Double Click Restore executable, if the size of the backup is less than 4GB. If a backup is a native SQL Server backup or it is larger than 4 GB, it creates a Double Click Restore loader in the same location.
  • 2—Creates a Double Click Restore loader in the same location.

For more information, see Double Click Restore Executables.

-Default <format>

Specifies the default file format, usually %D_%T_%Y-%m-%d-%H%M%S.%EXT%, where:

  • %D—Database name
  • %T—Backup type (Full, Diff or Log)
  • %Y-%m-%d-%H%M%S—Date and time
  • %EXT%—File extension

For more information, see LiteSpeed Variables.

-DelBkUps <number><time_unit>

Deletes old backups based on the time period specified in the format: <number><time_unit>, where the time unit is one of the following:

  • HOURS
  • DAYS
  • WEEKS
  • MONTHS
  • YEARS
-DelDeviceType DISK Specifies the device type. Currently DISK is the only supported device type.
-DelEmptyFolder Deletes empty folders.
-DelExtension <extension> Specifies the extension of the files eligible for deletion.
-DelFile Deletes a specific file.
-DelFilePath <filename> Specifies the location and name of the files.
-DelFolder <path> Deletes a specific folder.
-DelHtmlRpt <number><time_unit>

Deletes .html reports older than the given time period. This argument accepts one of the following time units:

  • HOURS
  • DAYS
  • WEEKS
  • MONTHS
  • YEARS
-DelSubFolders Deletes the first-level subfolders.
-DelTxtRpt <number><time_unit>

Deletes .txt reports older than the given time period. This argument accepts one of the following time units:

  • HOURS
  • DAYS
  • WEEKS
  • MONTHS
  • YEARS
-DelType <value>

Deletes file by type. This argument accepts one of the following values:

  • FileBkupbackup—Backup files
  • FileRptreport—Maintenance plan text reports
  • FileAny—Any file
-DelUnit Deletes files based on the file age.
-DelUnitType <value>

Specifies the unit type for file age. This argument accepts one of the following values:

  • MINUTES
  • HOURS
  • DAYS
  • WEEKS
  • MONTHS
  • YEARS
-DelUseAge Specifies the file age.
-DIFFERENTIAL Specifies that the database or file backup should consist only of the portions of the database or file changed since the last full backup. A differential backup is usually smaller than a full backup. Use this option so that all individual log backups since the last full backup do not need to be applied.

-Exclude <values>

Excludes databases. This argument accepts one or more of the following:

  • Selected—This option will exclude databases supplied with the -D argument.
  • LogShippng
  • ReadOnly

  • Offline
  • Deleted
  • Mask:"<wildcard_expression>"
  • Regex:"<regular_expression>"
  • IgnoreReplica—This option will ignore the preferred replica setting and will back up all replicas, unless they are excluded by the Primary and Secondary options.
  • Primary
  • Secondary
-ExcludeDays <values> Specifies days of the week when a full backup is never performed. This argument accepts one or more of the following:
  • Mn
  • Tu
  • Wd
  • Th
  • Fr
  • St
  • Sn
-Expiration <date_time>

Specifies the date and time when the backup expires. LiteSpeed will not overwrite this file until expiration datetime is passed. This argument accepts one of the following formats:

  • yyyy-mm-dd
  • yyyy-mm-dd hh:mm:ss
-FileGroups <filegroup_names>

Specifies a database filegroup to include in the backup or restore. You can supply multiple instances of this argument.

A filegroup backup is a single backup of all files in the filegroup and is equivalent to explicitly listing all files in the filegroup when creating the backup. Files in a filegroup backup can be restored individually or as a group.

-FullDiffRtn <number_of_days>

Specifies the number of days (N). The full or differential backup must be at least N days old before it is eligible for cleanup.

-HtmlRpt <report_filename>.HTML Writes an HTML report.
-JobP <encrypted_key> Specifies an encrypted key.
-LogEngine <value>

Controls the debug logging options for a plan. This argument accepts one of the following values:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

For more information, see Reporting and Logging in Maintenance Plans.

-LOGGING <value>

Controls the logging options for backups. This argument accepts one of the following values:

  • 0—Logging off.

  • 1 or any odd value—Logging on. Log file is removed on success.

  • 2 or any even value—Logging on.

For more information, see Configure Logging in LiteSpeed.

-LogRtn <number_of_days>

Specifies the number of days (N). The t-log backup must be at least N days old before it is eligible for cleanup.

-MAINTDEL Enables the Cleanup Maintenance Plans task.
-MAXTRANSFERSIZE <size>

Specifies the largest unit of transfer in bytes to be used between SQL Server and LiteSpeed. The possible values are multiples of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is 1048576 (1 MB).

-Mirror <path> Mirrors the backup file (copies the backup to multiple locations). If you back up the primary to a set of striped files, all mirrored backups must match the primary in the number of stripes in each mirror.
-NOINIT Does not overwrite the existing backup files.
-NOOPTOLR Does not generate a map file during a backup for Object Level Recovery.
-NO_OUTPUT Does not display the output.
-NotifyAgent <operator> Specifies the operator.
-NotifyOpt <value>

Specifies the notification options after backup. This argument accepts one of the following values:

  • Every—Notify every time
  • Failure—Notify on failure only
-OpImportance <value>

Specifies whether the message is of low, high or normal importance. This argument accepts one of the following values:

  • 0—Low
  • 1—Normal
  • 2—High
-OpMessage <message> Specifies the message for the Notify Operator task.
-OpNotify <names> Specifies the operator names for the Notify Operator task.
-OpProfile <profile> Specifies operators profile.
-OpSubject <subject> Specifies the message subject for the Notify Operator task.subject
-OPTOLR

Generates a map file during a backup for Object Level Recovery.

-P <password>

Specifies the user password. Passwords are case-sensitive. Required if the connection type is not a trusted connection.

-PlanID <plan_id> Specifies GUID identifying the maintenance plan in 36 character hex format.
-PlanName <name> Specifies the maintenance plan name.
-PRIORITY <value>

Specifies the priority of the LiteSpeed process compared to other processes running on the same server. This argument accepts one of the following values:

  • -1—Below Normal

  • 0—Normal (Default)

  • 1—AboveNormal

  • 2—High

-RebldIdx <%_free_space> Drops and recreates indexes to improve performance, creates the specified amount of free space on each data page (1-100).
-Reliability <value>

Specifies whether LiteSpeed should perform checksums before writing to media and whether it should continue on error. This argument accepts one of the following values:

  • 1—Causes checksums to be verified when a LiteSpeed backup is created, LiteSpeed does not continue on error.
  • 2—Causes the backup be executed on error, checksums are not verified.
  • 3—Causes the backup be executed despite encountering an invalid backup checksum.
-ReorgIDX Defragments and compacts existing indexes to improve performance.
-RequireFull

Checks if the expected full backup exists when backing up to separate files and returns a failure message if it is not found. If the full backup file does not exist, it performs a full backup. If the full backup file does exist, the decision to perform a new full or a differential backup will depend on other conditions specified.

-Retaindays <number_of_days>

Specifies a number of days to retain the backup. LiteSpeed will not overwrite this file for this number of days. 

-RmUnusedSpace <max_size> <free_space_to_remain>

Reduces the size of data and log files in a database that grow beyond a specified size. This arguments accepts the following values:

  • Database size, in MB, when the database grows beyond this amount , it becomes eligible for shrinking. The default is 50.
  • The percentage of free space to remain after shrinking. The default is 10.
  • NoTrunc—(Optional) Returns freed space to operating system.

-Rpt <report_filename>.txt Writes a .TXT report.
-S <server_name>

Specifies the instance of Microsoft SQL Server to connect to. This argument accepts one of the following values:

  • server_name
  • server_name\instance_name

If no server is specified, the LiteSpeed command-line utility will connect to the default instance of SQL Server on the local computer.

-SingleFile <value>

This argument accepts one of the following values:

  • 0—Specifies self-contained backup set.
  • 1—Appends data to an existing full backup file.

For more information, see Fast Compression.

-SizeDelta <value>

Specifies the last differential backup size to last full backup size ratio. When exceeding the specified ratio LiteSpeed performs a full backup.

Accepted values are 1-99, the default value is 35.

-SmartDiff <number>DAYS

Specifies the minimum number of days since last full backup required to perform full backup. The default value is 14.

-T Uses a trusted connection (to the server) instead of requiring a password.
-THREADS <number_of_threads>

Determines the number of threads used for the backup. You will achieve the best results by specifying multiple threads, but the exact value depends on several factors including: processors available, affinity setting, compression level, encryption settings, IO device speed, and SQL Server responsiveness. The default is n-1 threads, where n is the number of processors.

-THROTTLE <value>

Specifies the maximum CPU usage allowed. The argument accepts an integer value between 1 and 100. The default value is 100. This is the percentage of the total amount of CPU usage (across all enabled processors) available.

TIP: Before you start tuning the CPU Throttle or Affinity parameters to adjust backup performance, try limiting the number of threads. If you decide to use an affinity value other than default, it is recommended that you limit the threading as well. You may also want to consider using Adaptive Compression to maintain backup performance. For more information, see Adaptive Compression.

-To <names> Specifies operator's name.
-TSMClientNode <node_name>

Specifies the TSM server LiteSpeed connects to during backups and restores. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-TSMClientOwnerPWD <password>

Specifies the TSM client owner user password. Not required, if specified in the options file or if backing up with the Passwordaccess Generate option.

-TSMConfigFile <path>

Specifies the TSM configuration file.

-TSMDeviceTimeoutMinutes <timeout>

Specifies how long to wait for a TSM device.

-TSMManagementClass <class>

Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.

-TSMObjectPath <path> Specifies path to the TSM backup. For Fast Compression backups, it only specifies the filespace.
-U <username>

Specifies user login ID. Required if the connection type is not a trusted connection.

Login IDs are case-sensitive.

-UpdOptiStats <number> Enables the Update Statistics task. The number following this argument is the amount of database to sample (in rows or percent). The default is 50 percent.
-UpdStatsScan <value>

Specifies how to measure the amount of database to sample. This argument accepts one of the following values:

  • Rows
  • Percent
  • FullScan
-UpdStatsTarget <value>

Updates index and/or column statistics. This argument accepts one of the following values:

  • Columns
  • Index
  • All
-UseDefDir Instructs LiteSpeed to use the default backup directory.
-VerifyOpt <value>

Performs a restore verification on the backup file just created (if backup was successful). This argument accepts one of the following values:

  • Last—Verifies last backup performed (can be either a full or differential).
  • FullDiff—Verifies the last full backup and last differential is available.
  • All—Verifies last full backup and all differentials since.
-VrfyBackup

Performs a restore verification on the backup file just created (if backup was successful).

-With "COPY_ONLY" Specifies the copy-only backup.
-WriteHistory Writes history to msdb.dbo.sysdbmaintplan_history.
-X <option> <option_value> <option> <option_value>

Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options using the following parameters:

  • DISK_RETRY_COUNT—Specifies the number of times that a specific operation will be retried on failure. The default is 4 retries, the maximum allowed setting is 1000.
  • DISK_RETRY_WAIT—Specifies the number of seconds to wait immediately following a failure before retrying. The default is 15 seconds, the maximum allowed setting is 300.

NOTE: This functionality is only available for disk and cloud operations.

For more information, see Network Resilience.

Examples

  1. Perform full backups of all user databases, except those starting with "temp".

    slssqlmaint.exe -S LITESPEED\SQL2005 -U sa -P ****** -D "ALL USER DATABASES" -BkUpMedia DISK -BkUpDB -UseDefDir -AdaptiveCompression speed -Default "%D_%z.bak" -CryptLevel 8 -BackupKey ****** -Exclude Offline LogShippng ReadOnly Mask:"temp*"

  2. For LiteSpeedLocal and LiteSpeedCentral databases, perform full Fast Compression backups if the amount of database changes since the last full backup is 40% or more.

    slssqlmaint.exe -S LITESPEED\SQL2005 -U sa -P ****** -D "LiteSpeedLocal" "LiteSpeedCentral" -BkUpMedia DISK -BkUpDB "C:\temp" -BkFileName -AdaptiveCompression speed -SmartDiff 14DAYS -DataDelta 40 -SingleFile 0 -RequireFull -BackupEsc -Exclude Offline LogShippng ReadOnly

  3. Delete backup files older than 14 days from the d:\temp folder and its subfolders, if the files have "bkp" extension.

    slssqlmaint.exe -S LITESPEED\SQL2005 -U sa -P ****** -MAINTDEL -DelDeviceType DISK -DELTYPE FileBkup -DELUSEAGE -DELUNIT "14" -DELUNITTYPE "DAYS" -DELSUBFOLDERS -DELEXTENSION "bkp" -DELFOLDER "d:\temp"

  4. Remove backup and restore history older than 3 months from the LiteSpeed Local repository, shrink LiteSpeed Local repository.

    slssqlmaint.exe -S LITESPEED\SQL2005 -U sa -P ****** -CleanHis 3MONTHS BKUP Activity ShrinkLog

  5. Script a legacy plan.

    slssqlmaint.exe -S LITESPEED\SQL2005 -U sa -P ****** -PlanID "00638AA2-C493-4F90-9C3B-275B55091D60" -BkUpMedia DISK -BkUpDB -UseDefDir -CrBkSubDir -BkExt "bak" -NOOPTOLR -Logging 2 -AdaptiveCompression speed -Default "%D_%T_%Y%d%m%H%M%S.%EXT%" -CkDB -ReorgIDX -MAINTDEL -DelDeviceType DISK -DELTYPE FileBkup -DELUSEAGE -DELUNIT "3" -DELUNITTYPE "DAYS" -DELSUBFOLDERS -DELEXTENSION "bak" -DELFOLDER "c:\temp" -CleanHis 90DAYS MAINTPLN Activity PurgeInfo ShrinkLog -RebldIdx 100 -RmUnusedSpace 50 10 -UpdOptiStats 50 -UpdStatsTarget All -UpdStatsScan FullScan -WriteHistory -LogEngine 0

  6. Perform an Amazon S3 cloud backup.

    Tip: When using variables in a command line script, use double %% or else they will not be parsed correctly.

    • Correct example: -Default "%%T-%%m-%%H-%%M-%%S"
    • Incorrect example: -Default "%T-%m-%H-%M-%S"

    slssqlmaint.exe -D "master" -BkUpMedia CLOUD -BkUpDB -BkFileName -Logging 0 -CompressionLevel 2 -Default "%%T-%%m-%%H-%%M-%%S" -OPTOLR -CSType "AmazonS3" -CSAccessKey "******" -CSSecretKeyPlain "*********" -CSContainer "california" -CSAccessPoint "us-west-1" -CSObject "test\" -Exclude Deleted Offline LogShippng -T -S servername

 

Related Topics


Was this topic helpful?

[Select Rating]



Related Documents

Please note our Privacy Policy recently changed to support GDPR. You may read it here. Continuing to use our website indicates you have accepted the new policy.