LiteSpeed For SQL Server - User Guide PDF
LiteSpeed For SQL Server - User Guide PDF
User Guide
© 2019 Quest Software Inc. ALL RIGHTS RESERVED.
This guide contains proprietary information protected by copyright. The software described in this guide is furnished under a
software license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of the
applicable agreement. No part of this guide may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying and recording for any purpose other than the purchaser’s personal use without the written
permission of Quest Software Inc.
The information in this document is provided in connection with Quest Software products. No license, express or implied, by
estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Quest Software
products. EXCEPT AS SET FORTH IN THE TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE AGREEMENT FOR
THIS PRODUCT, QUEST SOFTWARE ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED
OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT
SHALL QUEST SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR
INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS
INTERRUPTION OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT,
EVEN IF QUEST SOFTWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Quest Software makes no
representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right
to make changes to specifications and product descriptions at any time without notice. Quest Software does not make any
commitment to update the information contained in this document.
If you have any questions regarding your potential use of this material, contact:
4 Polaris Way
Refer to our Web site (https://www.quest.com) for regional and international office information.
Patents
Quest Software is proud of our advanced technology. Patents and pending patents may apply to this product. For the most current
information about applicable patents for this product, please visit our website at https://www.quest.com/legal.
Trademarks
Quest, Toad, Toad World, LiteSpeed, the Quest logo, and Join the Innovation are trademarks and registered trademarks of Quest
Software Inc. For a complete list of Quest marks, visit https://www.quest.com/legal/trademark-information.aspx. All other
trademarks and registered trademarks are property of their respective owners.
Legend
CAUTION: A CAUTION icon indicates potential damage to hardware or loss of data if instructions are
not followed.
IMPORTANT, NOTE, TIP, MOBILE, or VIDEO: An information icon indicates supporting information.
Cloud 75
About the Cloud 75
Microsoft Azure Blob 75
Amazon S3 (Simple Storage Service) cloud storage 75
Google Cloud Storage 75
Using the Cloud 75
Setting up a cloud account with the cloud vendor 76
Registering the cloud account with LiteSpeed 77
Running LiteSpeed Backups to the cloud 78
Running LiteSpeed Restores from the cloud 79
Cloud Account Settings 79
Cloud Automatic Striping 81
Setting up Cloud Automatic Striping 81
Back Up Databases 83
Test Optimal Backup Settings 83
Backup Analyzer Wizard 83
Scheduling Backup Analyzer 84
Backup Analyzer Tab 84
Create and Deploy Backup Templates 87
Create Backup Templates 87
Deploy Backup Templates 97
Back Up Databases 99
About partial backups and restores 110
Partial backups 110
Restore partial backups 110
Restore partial backups with fast compression 110
Back Up Multiple Databases 111
LiteSpeed's Logic for Backing Up Multiple Databases 111
Include Databases 111
Exclude Databases 111
Back Up SQL Server AlwaysOn Availability Groups 112
Use Wildcard and Regular Expressions in LiteSpeed 112
Wildcard Expressions 113
Index 600
About LiteSpeed
LiteSpeed® for SQL Server®, or LiteSpeed, is a fast and flexible backup and recovery solution that allows
database administrators to easily maintain complete control over the backup and recovery process. LiteSpeed's
low-impact, high-performance compression and encryption technology helps reduce storage costs and protect
data, while maintaining a high level of recoverability.
Backup Analyzer Evaluate different backup options, such as compression level, striping, and backup
destinations, to determine which settings have the best compression and duration
values. For more information, see Test Optimal Backup Settings on page 83.
Backup Wizard Back up individual databases. This option lets you define backup options individually
for each database. You can create native SQL Server or LiteSpeed backups, generate
backup scripts, run backups immediately or schedule SQL Agent jobs. LiteSpeed
supports the following options for backups:
l log activity
l and more...
Be sure to select Use LiteSpeed to leverage many LiteSpeed advanced features. For
more information, see Back Up Databases on page 99.
Multi-Database Back up several databases with the same options. For more information, see Multi-
Backup Wizard Database Backup on page 116.
Backup Templates Automate backing up databases on multiple server instances by deploying a LiteSpeed
Backup Template. For more information, see Create Backup Templates on page 87.
Maintenance Plans Automate backing up databases. Maintenance Plans provide flexible backup options
as well as additional database maintenance options, such as CleanUp and Rebuild
Indexes tasks. For more information, see About Automating Maintenance Tasks on
page 129.
Fast Compression Reduce backup size and decrease backup times from hours to minutes by including
differential backups in the nightly backup routine. For more information, see Fast
Compression on page 116.
Double Click Restore Double Click Restore executable files on a server instance that does not have
Restore LiteSpeed installed. For more information, see Double Click Restore Executables on
page 121.
Network Resilience Control network resilience options. LiteSpeed's read and write resilience can handle
various failures on both network and attached storage devices. For more information,
see Network Resilience on page 125.
Adaptive Let LiteSpeed select optimal compression based on server performance at the time of
Compression backup. Adaptive Compression can optimize backups either for speed or for small size.
For more information, see Compression Methods on page 123.
Restore Wizard Restore databases and attached files immediately or schedule a restore job. For more
information, see Restore Databases Using the Restore Wizard on page 150.
Automated Restore Automate restoring the most recent database backups. If backing up to unique
filenames, you only need to specify a folder where LiteSpeed will look for candidates
for restore. For more information, see Restore Databases Using the Restore Wizard on
page 150.
Object Level List, query, preview and restore specific objects directly from the native SQL Server or
Recovery LiteSpeed backup files. For more information, see Restore Objects on page 165.
Log Shipping Automate backing up and restoring database transaction logs on one or more standby
databases. See the Configure Log Shipping guide for more information.
You can back up and restore with LiteSpeed using wizards in the LiteSpeed UI Console, extended stored
procedures and the command-line interface.
Application Menu
The Application menu displays often used LiteSpeed features and replaces the previous File menu.
Feature Description
Repository Registration Display and edit repository registration. You can add repository, edit
Cloud Accounts Display and edit registered cloud account settings. You can add,
edit, delete, import, and export cloud accounts.
Deploy Run the Remote Deploy Configuration wizard. Use this wizard to
deploy the LiteSpeed core components and edit LiteSpeed the
configuration to remote servers.
Options Display and edit the following LiteSpeed options: General, Backup
Manager Options), Log Shipping Options, Job Manager Options,
Log Reader Options, and Object Level Recovery Options.
Home Ribbon
The Home ribbon displays often used features.
Feature Description
SQL Server Registration Register new SQL Servers and groups. You can also delete and
edit existing ones. You can also manage licenses and edit
credential information for each registered SQL Server instance.
Restore Run the Restore Wizard. You can also restores databases, files and
file groups, transaction logs, and attached files.
Automated Restore Run the Restore Wizard with Automated Restore as the default
selection.
Log Shipping Run the Create LiteSpeed Log Shipping Plan Wizard.
Backup Templates Run the Create New Backup Template Wizard. You can also create
new, edit, deploy or remove existing backup templates.
Maintenance Plans Create a new maintenance plan by default. You can also create
new maintenance plan, paste maintenance plan, import
maintenance plan, and upgrade LiteSpeed maintenance plans.
Display Jobs Run the Job Manager and displays the Job Manager Ribbon.
Read Transaction Log Run the Read Log Wizard and displays the Log Reader Ribbon.
View Ribbon
The View ribbon displays often used view features.
Feature Description
Backup Manager Manage LiteSpeed and native SQL Server backups and restores
with a variety of advanced tools. You can also view detailed
information about your backup and restore processes, including
statistics on processes that fail or succeed, the amount of disk space
you save, and a list of all of the jobs for a server instance or
database.
Log Shipping Automate backing up a database (the publisher) and restoring its
transaction logs on one or more standby databases (the
subscribers). The process runs automatically throughout the day at
the interval you specify, which creates synchronized databases.
Object Level Recovery Read native SQL Server or LiteSpeed backups to view tables, query
backup data and restore tables, schemas, and views. You can also
generate DDL scripts for one or more databases objects.
Maintenance Plans Create a new maintenance plan by default. Several other items are
available. Automate routine database maintenance tasks, such as
backing up databases, updating statistics, and rebuilding indexes to
run on a specific day and time.
Job Manager Schedule, monitor, and manage SQL Agent jobs and Windows
tasks.
Log Reader Restore data in transaction log files by rolling back any operation
and reconstructing transactions. You can view recent transactions,
the full database log, and all transactions in the backup file.
Help Ribbon
The Help ribbon displays often used view features.
Feature Description
Use the Backup Manager Server Tools ribbon to access the following features:
Feature Description
Automated Restore Run the Restore Wizard with Automated Restore as the
default selection.
Backup Templates Runs the Create New Backup Template Wizard. You can
also create new, edit, deploy, and remove templates.
Display Jobs View the Job Manager and list of jobs in various states.
Makes visible the Job Manager ribbon.
Read Transaction Log Run the Read Log Wizard and LiteSpeed displays the
Log Reader Ribbon.
Feature Description
Restore Run the Restore Wizard. You can also restores databases, files and
file groups, transaction, and attached files.
Automated Restore Run the Restore Wizard with Automated Restore as the default
selection.
Display Jobs Display jobs and tasks according to their schedules and execution
history.
Feature Description
SQL Server Jobs Select a server in the SQL Server Jobs pane.
Windows Tasks When selected the Task Scheduler displays the Task
Scheduler 1.0 pane and the Task Scheduler 2.0 pane.
The panes display two distinct separate task schedules
that can be alternately viewed.
LiteSpeed automatically detects the version of Windows
Tasks. The Task Scheduler 2.0 includes support for Task
Scheduler 1.0 tasks.
Feature Description
Read Log Run the Read Log Wizard to generate a job transaction
log.
Undo / Redo Wizard Run the Undo / Redo Wizard to generate a T-SQL script.
that reverses changes previously made or reapplies
current changes.
Recover Table Wizard Run the Recover Table Wizard to recover dropped tables.
Table History Wizard Run the Table History Wizard to view changes made to
specific tables.
Export to CSV Export table to a CSV file. Other export options include:
HTML, XML, and DB.
Use the Log Shipping Server Tools ribbon to access the following features:
Feature Description
Automated Restore Run the Restore Wizard with Automated Restore as the
default selection.
Backup Templates Runs the Create New Backup Template Wizard. You can
also create new, edit, deploy, and remove templates.
Display Jobs View the Job Manager and list of jobs in various states.
Makes visible the Job Manager ribbon.
Read Transaction Log Run the Read Log Wizard and LiteSpeed displays the
Log Reader Ribbon.
Use the Object Level Recovery ribbon to access the following features:
Feature Description
Object Level Recovery Wizard Read native SQL Server or LiteSpeed backups to start
working with Object Level Recovery. (version 2: to view
database objects, query and restore backup data,
generate DDL scripts and more.)
NOTE: Object Level Recovery is only available with the
Enterprise license.
Navigation Pane
The navigation pane has two parts: a list of LiteSpeed features at the bottom and feature-specific information at
the top. Once you select a feature, the top of the navigation pane and the central pane update with the relevant
information. The top of the navigation pane displays a tree of servers for Backup Manager, Log Shipping, and
Maintenance Plans. It displays key tasks and options for the other features. When local servers are selected in
the View ribbon, the local instance icon is displayed in the navigation pane. When central
Tip: Click to change the features that appear as button selectable in the navigation pane.
Use the Navigation pane to access the following features:
Backup Manage LiteSpeed and native SQL Server backups and restores with a variety of CTRL+1
Manager advanced tools. You can also view detailed information about your backup and
restore processes, including statistics on processes that fail or succeed, the
amount of disk space you save, and a list of all of the jobs for a server instance or
database.
Log Automate backing up a database (the publisher) and restoring its transaction logs CTRL+2
Shipping on one or more standby databases (the subscribers). The process runs
automatically throughout the day at the interval you specify, which creates
synchronized databases.
Object Level Read native SQL Server or LiteSpeed backups to view tables, query backup data CTRL+3
Recovery and restore tables, schemas, and views. You can also generate DDL scripts for
one or more databases objects.
NOTE: Object Level Recovery is only available with the Enterprise license.
Maintenance Create a new maintenance plan by default. Several other items are available. CTRL+4
Plans Automate routine database maintenance tasks, such as backing up databases,
updating statistics, and rebuilding indexes to run on a specific day and time.
Job Schedule, monitor, and manage SQL Agent jobs and Windows tasks. CTRL+5
Manager
Log Reader Restore data in transaction log files by rolling back any operation and CTRL+6
reconstructing transactions. You can view recent transactions, the full database
log, and all transactions in the backup file.
Central Pane
The central pane displays information based upon your selection in the navigation pane. Each feature has a
unique home page and set of tabs. For a description of the Backup Manager tabs and central pane options, see
View Backup Manager Activity and History.
LiteSpeed UI Console. You can dock the pane by clicking Auto Hide or clear a process by clicking .
Properties Pane
The Properties pane lists properties about the item selected in the navigation pane.
To view the properties pane, click the Application Button and select Options and then Display properties in
dockable window on the General tab. You can dock the pane by clicking .
Toolbar
The toolbar has the following parts:
Navigation Includes buttons to navigate within the LiteSpeed UI Console, including Minimize
Quick Access Tool Bar Includes buttons to navigate within the LiteSpeed UI Console, including Start
Backup Wizard, Refresh selected item, and Customize Quick Access Toolbar:
Note: If the LiteSpeed install includes a central repository and the console, then LiteSpeed defaults the
console to use that central repository automatically without the need to manually register and select it in the
LiteSpeed console.
To register a repository
2. Click Add repository and complete the Register New Repository dialog fields.
Server name: Enter the name of the server instance, or click to select from a list of
available server instances.
Display name: Enter the name to display in the navigation pane tree.
Windows Select this option to connect to the SQL Server instance using Windows
authentication authentication.
SQL Server Select this option to connect to the SQL Server instance using SQL Server
Authentication authentication. Complete the Login name and Password fields.
TIPS:
l Select add repository, edit connection, delete connection, test connection, import, and export by clicking
the corresponding button in the Edit Repository Registration dialog. Imports can be done from .csv files
and from LiteSpeed 4.x.
l You can click the Display name, Authentication, Login, or Password fields in the grid to change
their value.
l Shares a common set of instance registrations and maintain grouping across all consoles.
l The Backup Manager View tab is used to switch between local and central repository views (if a
central is used).
l The central does not store passwords for SQL Server Authentication. Passwords are still stored locally
for the user.
l In the central repository view, all instances are read from the central, including their proper grouping.
l In the central view, any instances that are added, removed, or sorted, automatically get persisted into
the central.
l You can change from Windows Authentication to SQL Authentication, or change the account used for
SQL Authentication without affecting the central repository.
l Login credentials are not persisted in the central. The actual password, if SQL Authentication is used, is
stored locally. The only thing stored centrally is the type of authentication (Windows or SQL).
l Changes to the central, trigger a version change. This helps you know when the central data
has changed.
l When LiteSpeed starts, if the central repository view is selected, LiteSpeed checks a timestamp against
the central (which is automatically updated each time a change is made to a registration). If the
timestamps do not match, LiteSpeed automatically refreshes the view from the central repository. If the
timestamp matched, the local central registration cache is loaded.
l When importing or refreshing, any local login information is persisted while the central repository cache
is saved locally. You can then import while preserving login information.
Scenario
There are several server instances configured to report to a central repository and you need to register some
of them in your LiteSpeed UI Console.
3. (If you selected to import servers from a CSV file) Review the following for additional information:
The first line of a valid CSV file contains the following column headers:
l DisplayName—Specify how you want to display servers in the navigation pane tree.
l ServerName—Computer name or IP address following by port number: <IP_address>,
<port_number>.
l Authentication—Windows or SQL Server.
l LoginName—User name that is used for the SQL Server connection. It can be a Windows login in
the following format: 'Domain\Username', or SQL Server login.
l Password—Encrypted password for the login. May be blank.
l LicenseInfo—License key information (Site Message).
l LicenseType—Examples: Trial, Permanent, Term.
l LicenseEdition—Style of license. Example: Enterprise.
l Path—Server group location of the instance.
l ExpireDate—Date that the LiteSpeed license expires.
Next lines contain server parameters, separated by semicolons (;), a separate line for a server. You can
omit the LoginName and Password parameters to complete them later in the LiteSpeed UI Console.
Example:
DisplayName;ServerName;Authentication;LoginName;Password;LicenseInfo
LicenseType;LicenseEdition;Path;ExpireDate
W2K3-14;W2K3-14;Windows;DOMAIN\Username;3w663k3E
spb9884_sql_auth;spb9884;SQL Server;sa;321
NOTE: If you export server instances to a CSV file, it will contain SQL logins and obfuscated passwords.
You need to manually edit the CSV file to remove the connection information before you import
instances from this file.
Connect using Select either Windows authentication or SQL Server authentication (enter the
user name and password).
NOTE: Microsoft recommends using Windows authentication when possible
because it is more secure than SQL Server authentication.
Tips:
l You can click the Display name, Authentication, Login, or Password fields in the grid to change
their value.
l Click Display Overview Tab to see the Overview tab of the LiteSpeed UI Console window for the
selected instance. This will let you stay on the registration dialog and continue editing or
registering new server instances, but still see overview information of the various instances.
5. (Optional) In the Server tree, click and drag server instances to move them between groups.
Tip: In the Server tree, you can see registered SQL Server Instance nodes sorted alphabetically. To use a
custom sort order, select View | Sort Instances | Custom.
Scenario
There are several server instances configured to report to a central repository and you want a new colleague
to manage some of them in their LiteSpeed UI Console. Define which server instances are eligible for import.
By default, LiteSpeed allows all of the instances to be imported into other clients when you select to import from
a central repository, unless you specifically exclude instances.
1. Right-click a server in the Server tree in the navigation pane and select Edit | SQL Server Registration.
2. Clear the Allow import of this instance... checkbox and click OK.
2. Group the Backup Manager tree by server group (View | Group Instances By | Server Groups).
Create a top-level server group Right-click SQL Servers at the top of the navigation tree and select
New SQL Server Group.
Create a subgroup of an existing Right-click the group in the navigation pane tree and select New
server group SQL Server Group.
Tips:
l To create multi-level groups, create the parent group first. When you create the subgroup, the parent
group will already be there for you to select.
l To edit or delete a server group, right-click the group and select the appropriate option.
l You can also group server instances by categories. To switch between server groups and categories,
select View | Group Instances By.
2. Right-click the server instance and select Edit SQL Server Registration.
3. Click Advanced.
4. Select Subgroup of and select the parent group from the list.
l Databases and server instances can be assigned to more than one category. For example, if you have
Location and Role categories, a database could be categorized as both North America and
Development. Unlike categories, a server instance can only be assigned to one server group. In the
previous example, the server instance could only be assigned to a role or location group, but not both.
Create Categories
You can create as many categories as you need to organize your server instances and databases. You can
assign server instances and databases to as many or as few categories as necessary.
Categories can only be two levels deep, with top-level categories (Location or Role), and subcategories
(Europe, North America, and Asia, and Dev, Test, and Prod).
NOTE: You can use categories, if the central repository is configured and selected for use. For more
information, see Select a Central Repository on page 54.
To create categories
2. Click Add Category to add a top-level category, or select the top-level category and click Add
Subcategory.
Tip: To edit categories, select Categories | Edit. You can rename, move, and delete categories.
Compression Specifies the compression level for the backup. Valid values are 0 through 8. 0
level 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.
For more information, see Compression Methods on page 123.
Encryption By default, encryption is not used. If you select to encrypt a backup using the
level LiteSpeed UI Console wizards, the default encryption level is 128-bit AES.
For more information, see Encryption Methods on page 124.
Compression Determines the number of threads used for the backup. You will achieve the best
threads 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.
Max transfer Specifies the largest unit of transfer in bytes to be used between SQL Server and
size 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).
Buffer count Specifies the number of SQL Server buffers available for a LiteSpeed operation. The
default value is set by SQL Server.
CPU 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 on page 124.
Processor Specifies the affinity mask for the process. The mask is a 64-bit integer value. By
affinity default, it is 0 and will utilize all CPUs.
For more information, see Processor Affinity on page 64.
Processor Select the priority of the backup over other transactions or processes running on the
priority same server. The default is Normal.
Init backup LiteSpeed will appends the backup to an existing backup file set or tape.
set
File name Location and name of a LiteSpeed backup file. LiteSpeed uses the default SQL Server
backup directory. The default file name format is %D_%DATETIME%.bak. For more
information, see LiteSpeed Variables on page 127.
NOTE: Fast Compression handles the naming of files automatically. For more
information, see Backup Files and Folders on page 117.
Path to TSM See the Integration with TSM Guide for more information.
.opt file
Tip: To reset to the application default values, click Reset Original Values.
Where multiple SQL Server instances exist on one machine, you need to change the defaults for each instance
individually.
Processor Affinity
You can specify which processors LiteSpeed can use for the backup/restore process. They can be the same or
different from the processor affinity for SQL Server.
In wizards, access the advanced options. Click to select which processors LiteSpeed can use. The default is
0, which allows LiteSpeed to use all available system processors.
Or you can use the affinity parameter with the LiteSpeed extended stored procedures or command-line utilities.
For more information, see About Using the Command-Line Interface on page 181.
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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
Select central Select a central repository to view statistics in the LiteSpeed UI Console. Not
repository You must register the repository before you can select it. For more Selected
information, see Register Central Repositories on page 53.
Display View properties about the item selected in the navigation pane in a Cleared
properties in dockable window.
dockable
window
Show View confirmation message when exiting the LiteSpeed UI Console or Cleared
confirmation wizards.
message
Show View background task complete notification messages. Cleared
background
task complete
notification
Log the Select a logging level to define what events to log for the console. You Errors
LiteSpeed UI can find the log events in the Application Event Log. only
Console
activity
Show View if a database has been backed up recently using LiteSpeed Cleared
database
The instance tree view displays databases icons of the following colors:
status
l GREEN—If the latest database backup was successfully created
within the number of days specified for GREEN.
l YELLOW—If the latest database backup was successfully created
within the number of days specified for YELLOW and NOT in the
number of days specified for GREEN.
l RED—If the latest database backup was NOT successfully created
within the number of days specified for YELLOW.
2. Select the Backup Manager tab. Review the following for additional information:
View content timeout Enter the connection timeout for when you view the backup file 30
content. seconds
TSM device retry Select the amount of time to wait for the device to become available, No
time or not to retry. retries
Show TimeLine on View database backups in a timeline at the server and database Selected
LiteSpeed Activity level.
tab
Use UTC time for If selected LiteSpeed Activity will use UTC time to display and sort Not
LiteSpeed Activity activities on the list. Useful in case of several Sql Server instances selected
in different time zones. If not selected the local Sql Server instance
time used.
Ask for confirmation Display a confirmation message before you are able to edit central Selected
when making repository instances.
changes to the
Central View
Ask to import Display a confirmation message about importing registered SQL Selected
instances when Server instances when switching from the Local to Central View.
switching from Local
to Central View.
Automatic refresh Refresh the Overview and LiteSpeed Activity screens a configurable Not
Overview every. amount in increments from 1 to 30 minutes. selected
Specify proxy Specify proxy settings for the LiteSpeed console. Select the Proxy Not
settings if needed to Settings link and enter the following. selected
set up cloud storage
connection. l Use proxy - Click to enable proxy use.
l Address - Proxy server address.
l Port - Proxy server port (default is 80).
l Username - Proxy server user credential.
l Password - Proxy server password credential.
2. Select the Log Shipping tab. Review the following for additional information:
Display detailed status Show the details panel on the Monitoring tab. The details panel Selected
information on the displays tips if there is something wrong with the log shipping
Monitoring tab plan.
Load log shipping plan View current statuses of all log shipping plans when connecting Cleared
statuses... to the server instance and when refreshing the Log shipping
plans tab at the instance level.
If this option is off, plan status is only loaded when you double-
click a plan.
Show server time Display the local time and the time difference between the Selected
desktop and the server at the top of the Calendar tab for each
server.
Show recurring Simplify the display by showing jobs that run multiple times as Selected
executions as one item one job.
Show jobs that run Display the continuously running jobs at the top of the —
continuously during the schedule.
day on top of the
schedule
Show steps Display each job step on the Job List tab in an expanding row Under
in the list or in a separate pane at the bottom of the window. each
row of a
job
Show history Display job history on the Job List tab in a separate pane at the Cleared
bottom of the window.
On Demand—Display history only after clicking Show History.
(Selected.) If cleared, history displays automatically when you
select a job.
Maximum number of Specify the maximum number of total concurrent threads to use 3
threads on target instances to run the jobs.
Maximum appointments Specify the maximum number of appointments that can display 25
on the Calendar tab. If the number of appointments exceeds
this value, appointments may display incorrectly.
Show disabled jobs Display the jobs that have been disabled. Selected
Refresh job status after Refresh the job status automatically after the job is either Selected
start/stop started or stopped.
Auto refresh windows Specify the auto refresh rate in seconds for windows tasks. —
tasks every:
Tip: Click Advanced | Known Applications to add new or change existing masks and icons. A mask is a
pattern used to group jobs or tasks with similar names and display the appropriate icon for them. Masks are
stored locally.
Check log file Check the log file for changes every so many seconds. Selected
changes every 10
seconds
Show List all the transactions that are not committed. Selected
uncommitted
transactions
Reconstruct Select this option to display both DML and DDL commands Selected
DDL
commands
Online log Set the amount of time the log is read before a timeout is reached. 300
reading seconds
timeout
Maximum Set the maximum Binary Large Object (Blob) Data size. 8000
BLOB size bytes
Search Depth Select whether to read the entire log file or only a set number of records in
the log file. The options are: 100000
l Read entire log file - Select this option to read the entire log file.
l Read approximately - Select this option to set the number of
records to read.
NOTE: The minimum number of records to read is 100,000.
The Log Reader stores temp data in %temp%/Quest Software
where %temp% is the first path found of: the path specified by the
TMP environment variable, the path specified by the TEMP
environment variable, the path specified by the USERPROFILE
environment variable, the Windows temp directory.
l Clean Up History task. For more information, see About Creating Maintenance Plans on page 130.
l SLSSQLMaint utility. For more information, see Script Maintenance Plans Tasks on page 234.
l LiteSpeed_DeleteActivity stored procedure. For more information, see LiteSpeed_DeleteActivity
on page 72.
l Repository cleanup.
l LiteSpeedLocal.
l LiteSpeedCentral.
l Custom database—You can use the LiteSpeed Instance Configuration wizard (Start | All Programs |
Quest Software | LiteSpeed for SQL Server | Instance Configuration) to choose where to store the
repository data.
Syntax
USE {LiteSpeedLocal|LiteSpeedCentral|<custom_database_name>}
EXEС LiteSpeed_DeleteActivity
{ @deleteDate = 'date_time' | ( @delUnit = n,@delUnitType = 'time' )}
, {@delLocal = 0 | 1 | @delCentral = 0 | 1 |( @delLocal = 0 | 1 , @delCentral = 0 |
1)}
[, @purgeDeleted = 0 | 1 ]
[, @delLogshipping = 0 | 1 ]
[, @delStatus = 0 | 1]
Arguments
This stored procedure accepts the following arguments:
Argument Description
@deleteDate Deletes data older than the date and time specified. The argument accepts the following
format:
YYYYMMDD HH:MM:SS
where
l YYYY—4-digit year
l MM—2-digit month
l DD—2-digit day of the month
l HH—2-digit hour using the local 24-hour clock
l MM—2-digit minute
l SS—2-digit second
@delLocal Deletes old data from the LitespeedActivity and LitespeedBackupFile tables in the Local
repository or in the custom database (if the Local repository tables were created in the
custom database). This argument accepts one of the following values:
l 0—false
l 1—true
@delCentral Deletes old data from the LitespeedActivity and LitespeedBackupFile tables in the
Central repository or in the custom database (if the Central repository tables were created
in the custom database). This argument accepts one of the following values:
l 0—false
l 1—true
@delUnitType Specifies a unit of measurement of time for @delUnit. This argument accepts one of the
following values:
l MINUTES
l HOURS
l DAYS
l WEEKS
l MONTHS
l YEARS
l 0—false
l 1—true
@delLogshipping Deletes old log shipping history entries from dbo.LogShippingHistory in the following
databases:
l 0—false
l 1—true
@delStatus Deletes old data from dbo.DbMaintStatus, dbo.DTSStatus, dbo.JobStatus in the following
databases:
l 0—false
l 1—true
Examples
1. Delete the following data older than 08/21/2009 from the Local and Central repositories:
l LiteSpeed activity
l Information about deleted databases
exec LiteSpeedLocal.dbo.LiteSpeed_DeleteActivity
@delLocal=1
, @delCentral=1
, @purgeDeleted = 1
, @deleteDate = '20090821 00:00:00'
2. Delete the following data older than 6 months in the Local repository:
l LiteSpeed activity
l Log shipping history
l Data from dbo.DbMaintStatus, dbo.DTSStatus, dbo.JobStatus
USE LiteSpeedLocal
EXEC LiteSpeed_DeleteActivity
@delLocal=1,
@delLogshipping = 1,
@delStatus = 1 ,
@delUnit = 6,
@delUnitType = 'MONTHS'
Cloud
Tip: Set the default compression level to 7 for cloud backups. Using a higher compression level has real
savings. Reducing the number of bytes sent to the cloud makes for faster backups and restores and reduces
Internet bandwidth.
You can get started using the cloud with LiteSpeed by first setting up your account with the cloud vendor and
then registering that account with LiteSpeed.
Note:LiteSpeed contains all the necessary software and components necessary for running LiteSpeed backups
and restores to / from the following cloud vendors.
2. Click the IAM icon on the Cloud administration console to create a Cloud user.
3. The User Access Key IDs and Secret Access Keys are automatically generated.
4. Write down and save the Access Key IDs and Secret Access Keys. You will use these values later in the
LiteSpeed Cloud account registration.
5. Select the Permissions tab in the Cloud admin console and assign user Administrator Access
permissions.
6. Use the Cloud admin console to create a Bucket Name and Region. This is the location where your
backup files will be stored.
7. Write down and save the Bucket Name and Region. You will use these values later in the LiteSpeed
Cloud account registration.
8. Use the following procedure to register your Amazon S3 Cloud account with LiteSpeed.
Note: Amazon changes their Cloud account Web UI on a regular basis. Therefore the actual icons, tabs, and
selection buttons might be different than what is indicated in the procedures below.
1. Log in with your existing Microsoft credentials at: https://azure.microsoft.com/en-us/free/ to setup your
initial free Microsoft Azure account.
3. Complete the Microsoft Azure information page and click Sign up. The Welcome to Microsoft Azure web
page is displayed.
1. Click .
2. Click Cloud Accounts.
3. Click Add.
a. Enter the Access key saved in Step 4 from the "To create your Amazon S3 account"
procedure above.
b. Enter the Secret key saved in Step 4 from the "To create your Amazon S3 account"
procedure above.
Select IAM Roles to grant permission to the Amazon S3 resource without specifying the Access and
Secret key to LiteSpeed. The IAM Role supplies temporary permissions that LiteSpeed can use to make
calls to other Amazon Web Services applications. For information on creating and using IAM roles, refer
to the Amazon Web Services documentation.
4. Enter the Region name saved in Step 7 from the same procedure above.
5. Enter the Storage Class from the drop-down list. The options are standard, standard-infrequent access,
and reduced redundancy storage.
6. Enter the Bucket name saved in Step 7 from the same procedure above.
7. Click to deselect or select SSL security.
8. Click to select Use Server Side Encryption (AES-256).
9. Select 'Use Amazon S3 Transfer Acceleration Speed' to use Amazon's S3 Transfer Acceleration feature
which allows for increased upload speed to S3 storage up to 200% in some cases by using local
CloudFront endpoints.
10. Click to select GovCloud (US) Region.
11. Click to deselect or select Automatic Striping. The automatic striping options are: auto, 10,25, 50, 100,
250, 500, 1000, and 1995 GB.
1. Click Test Connection to verify that all entered information is working. When successful, the Cloud
Accounts screen is displayed with your new account listed.
2. Click OK to save your entries. Your cloud account is now registered with LiteSpeed.
3. Use one of the following procedures and run the LiteSpeed Backup or Restore Wizard to save backups
to the cloud or restore files from the same.
Caution:Backups are run to new files. Appending to an existing file is not supported. Existing backups can
only be overwritten. The option "Overwrite existing object" is available in the Backup Wizard and MP (Back
Up Database task). The option is turned off by default.
3. Select the cloud vendor account that you created from the Accounts list.
4. Conclude making the Backup wizard selections and finish by executing the backup.
Tip: You can review the LiteSpeed cloud backup scripts at the last wizard step before executing the
Cloud backup. You can also view an example cloud backup database script here (scroll to the bottom
of the page).
Tip: You can review the LiteSpeed Cloud restore script at the last wizard step before executing the
Cloud restore. You can also view an example Cloud restore database script here (scroll to the bottom
of the page).
Cloud account Select the Cloud account from the drop-down list.
Select the following items to add or edit the registered cloud account
settings.
l Edit - ( For Azure Blob only), click to edit display name, access
key, storage type (block blobs or page blobs), container, use
SSL, government account, and automatic striping. Options for
block blobs are: auto, 10, 25, 50, 100, 250, 500, 1000, 2000,
3000, 4000 and 4300 GB. Options for page blobs are: auto, 10,
25, 50, 100, 250, 500, and 995 GB.
l Edit - ( For Google Storage only), click to edit display name,
service account ID, private key, project ID, storage class, region
and bucket. Use SSL is always selected as Google always uses
it.
l Delete - Click to delete the Cloud account from the console.
l Import - Click to import a saved Cloud account in XML format.
Proxy Settings Select the following items to edit the Cloud account proxy settings.
1. Click .
2. Click Cloud Accounts.
3. Click Edit.
l Microsoft Azure blob storage (Block blob): auto, 10, 25, 50, 100, 250, 500, 1000, 2000, 3000,
4000 and 4300 GB.
Note: Maximum size of block blob supported by Microsoft Azure is 4.77 TB.
l Microsoft Azure blob storage (Page blob): auto, 10, 25, 50, 100, 250, 500 and 995 GB.
Note: Maximum size of page blob supported by Microsoft Azure is 1000GB.
l Amazon S3: auto, 10, 25, 50, 100, 250, 500, 1000 and 1995 GB.
Note: Maximum size of object supported by Amazon S3 is 5000GB. LiteSpeed is limited
by 2000GB.
l Google Cloud Storage: auto, 10, 25, 50, 100, 250, 500, 1000 and 1995 GB.
Note: Maximum size of object supported by Google Cloud Storage is 5 TB. LiteSpeed is
limited by 2TB.
5. Click Test Connection to verify that all entered information is working. When successful, the Cloud
Accounts screen is displayed with your new account listed.
6. Click OK.
Back Up Databases
l To test striped backups, click Add to add several destinations and select the Test backup striping
to selected backup locations checkbox on the Backup Location page.
l If you add more than two destinations, select both checkboxes to test all destination
combinations.
l If you select a large number of backup parameters, you may want to schedule the tests to run at a
specified time within the LiteSpeed Analyzer job.
3. Click Next.
4. On the Backup Location screen, select Backup to (Disk, Cloud, or TSM Backup) and Backup locations.
Add or remove backups from the locations. Additionally select striping options.
5. Click Next.
6. On the Data Sample screen, enter the amount of data to sample in megabytes or the percentage of
data to test.
7. Click Next.
8. On the Compression Level screen, select the compression levels to test. Any combination of
compression levels from 0 to 8 are available. You can also specify additional backup advanced options.
9. Click Next.
10. On the Execute Script screen, the list of databases to test is displayed.
11. Click Next. The Backup Analyzer Wizard test scrip runs and displays the test results summary.
12. Complete the wizard.
NOTE: After the required number of bytes is received for analysis, the process is intentionally aborted. This
generates the VDI error messages in the LiteSpeed log files and the SQL Server error log. Please ignore them.
The Backup Analyzer tab presents the test results in a graph and grid format:
l Graph—Displays the backup duration and compression amount for each test in a bar graph so you can
easily compare the results between size and duration. If you hover the mouse over the bar graph, test
number, size, and duration are displayed. If you select a test in the grid, LiteSpeed indicates the
corresponding test in the bar graph with a yellow border around it. You can view previous tests by
changing the Existing test field.
Tip: .Use the Grid horizontal scroll bar to view other table columns.
Column Description
Level The compression level that is used for a particular database backup test.
Estimated Duration The approximate time allotted to run the database backup.
Compression (MB) The amount of disk space you can save with this compression ratio.
You can double-click a row for more information about the test.
Tip: For panes that have grids, you can sort, group, move, and remove the columns:
l To sort and group the records, right-click a column header and select the appropriate options.
l To sort records against multiple columns, click column headers while holding the SHIFT key.
For example, to sort by type and then by name, click the Type column header and then
SHIFT+click the Name column header.
l To add or remove columns, right-click a column header and select Column Chooser. Add a
column by dragging it from the list into the column headers. Remove a column by dragging its
column header into the list.
l To move a column, drag the column header to the new location.
Note: This feature supports disk, TSM Backup, TSM Archive and cloud storage destinations.
Backup Templates can be easily updated and changes deployed to all instances. LiteSpeed tracks the
instances where each template is deployed, making re-deployment very easy. Backup Templates can also be
easily removed from an instance if they are no longer required.
Using LiteSpeed backup templates in your backup routine can help you manage multiple SQL Server instances.
You do not have to manage backup jobs for each database or manage maintenance plans for one server at a
time. Instead, create and deploy a backup template.
If your company's policy changes, you can quickly edit the template to comply with the new standards and
re-deploy. LiteSpeed versions the templates and the deployments, so it is easy to see if an instance needs
to be updated.
2. In the Backup Templates tab, click New on the toolbar. If you do not use the central repository, click
Backup Type Select what backups will occur after you deploy this template on a
server instance.
The default backup name and description use the following information:
l %D—Database name
l %T—Backup type (Full, Diff or Log)
l %z—Timestamp
l %AG% — AlwaysOn Availability Group Name. This allows you to
group databases into folders based on the AlwaysOn Availability
Group name. It is ignored for databases that are not in an
AlwaysOn Availability Group.
You can specify custom backup name and description using both the
LiteSpeed variables and text. For more information, see LiteSpeed
Variables on page 127.
Backup Destination Decide whether you want to save a default backup destination name in
the template or specify it at the deployment time. If you specify a backup
destination in a template, you can override backup destinations for each
instance at deployment time. Each Backup Template remembers if you
override these settings to make future redeployments easier.
Backup file name as well as the backup folder can include the
%SERVER% variable, that may be particularly useful when backing up
many instances to the same network share.
NOTE: Fast Compression handles the naming of files automatically.
For more information, see Backup Files and Folders on page 117.
You can either supply the backup destination at deployment time or
save the default backup destination in the template. The backup
destinations include disk, cloud, TSM Backup and TSM Archive.
Optimize the Object Level Select to create an index of objects in the backup file. This option is only
Recovery speed available for LiteSpeed backups. The default is enabled.
NOTE: Before you can recover objects or execute a SELECT statement,
you must read the backup file to create an index of restorable objects.
The index is an .lsm file. During the backup process the .lsm file is
created in the temp directory and attached to the backup file after the
backup is completed.
If you select this option, LiteSpeed uses the index in the backup file to
read the backup file, which makes the object level recovery process
much faster.
Create Double Click Select to create a Double Click Restore Loader that allows you to restore
Restore executable a backup on a server instance that does not have LiteSpeed installed.
If you additionally select to Create one Double-Click Restore executable
file then note the following warning. The executable may be greater than
4GB for large databases. Windows Server is unable to run executable
files larger than 4GB. However, the file will be convertible/restorable by
LiteSpeed file.
For more information, see Double Click Restore Executables on page
121.
NOTE: A Double Click Restore can only be created for a disk file.
Continue on error Select this option to continue running the backup even if an invalid
checksum is encountered.
Review the following if you selected the Fast Compression backup type.
Fast Compression Type Select whether you prefer to create a unique file for each backup or you
prefer to manage a single file for each backup set (a backup set is
composed of one full database backup plus all associated differential
backups):
Fast Compression Backup You can set the following thresholds to define when to issue a full
Options backup:
l Force a full backup every - The amount of time elapsed since the
last full backup. The default is 14 days.
l Data change threshold - The amount of database changes since
the last full backup. The default is 35%.
Select the Extension for backup files checkbox to enter or change the
backup file name extension. The default is set to bkp.
NOTE: You can select the backup file extension for Fast Compression
and make the new default, bak, for new items. For an existing item that
Backup Escalation This option causes LiteSpeed to issue a full backup, if one of the
following problems is discovered in the current backup set:
Verification and Cleanup TIP: "Cleanup" means Smart Cleanup Policies or Smart Cleanup. For
more information, refer to Smart Cleanup Policies.
Make sure the backup files in the backup set have integrity. This
provides an added level of insurance the backup files can be restored.
Verification failures appear in the LiteSpeed UI Console and, optionally,
as job failure notifications. A verification failure after a differential backup
will trigger the backup escalation process, if selected.
The Verification options include:
Compression level Select 0 for no compression or 1-8 (default 2) to compress the file. For
more information, see Compression Methods on page 123.
NOTE: Higher compression levels result in smaller backup files, but they
also take longer to complete. For assistance determining the best
compression options, use the Backup Analyzer. For more information,
see Test Optimal Backup Settings on page 83.
Tip: For cloud backups, set the default compression level to 7. Using
a higher compression level has real savings. Reducing the number
of bytes sent to the cloud makes for faster backups and reduces
Internet bandwidth.
Encrypt backup Select this checkbox to encrypt the backup. Then, select the encryption
level and enter the encryption password. For more information, see
Encryption Methods on page 124.
Compression Determines the number of threads used for the backup. You will achieve the
threads 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.
Max transfer size Enter the maximum backup file size in bytes. . The possible values are multiples
of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is
1048576.
Buffer count Enter the number of SQL Server buffers available for a LiteSpeed operation. The
default is set by SQL Server.
CPU throttle Enter the maximum percentage of CPU that LiteSpeed can use for the process.
The default is 100.
Processor affinity
Click to select which processors LiteSpeed can use. The default is 0, which
allows LiteSpeed to use all available system processors.
Comment User comment written into the backup header. Is blank by default.
Logging level Select a logging level to define what events to log for the console. You can find
the log events in the Application Event Log.
Network resilience If LiteSpeed fails to write disk backups or reads from disk, it waits and retries the
operation. You can enable and disable and control the number of times to retry
and the amount of time to wait before retrying.
TIPS:
l 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.
l You may also want to consider using Adaptive Compression to maintain backup
performance. For more information, see Adaptive Compression on page 124.
NOTE: LiteSpeed defaults typically result in the best performance. You should only modify
advanced options after careful planning and testing. For more information, see Configure LiteSpeed
Defaults on page 60.
6. Configure notification options. You can select an existing notification profile or specify operators at
deployment.
TIP: Variables defined in the maintenance plan can be used to format the Subject Line. There is also
help information inside the task that lists the available Subject Line variables.
NOTE: The SQL Server Agent must be configured to send email using Database Mail. Review the
following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
7. For a Differential backup ("Full" backup type)
l On the Diff Schedule tab, tick Schedule differential backup and fill in the details of the schedule
type and frequency. The Diff Destination and Diff Compression tabs are now added to the
Backup Template Wizard.
l On the Diff Destination tab set the filename format and default backup path.
l On the Diff Compression tab use the same compression and encryption settings as for a full
backup or customize using the available options.
l You can nominate a backup folder independent of the backup folder for Fast Compression / Full
backups. Do this at the T-Log Destination step. Further to this, the backup folder can be stipulated
for individual instances using the Deployment Wizard.
l On the T-Log Schedule page you can skip Transaction log backups for databases being
configured for Log Shipping. Click the Exclude LogShipping databases for transaction backups
option. This option is available only when Exclude LogShipping is set to off on the Select
Databases page. It allows you to run regular Full/Diff backups for Log Shipping databases and
not brake the log shipping transaction log backup sequence.
9. Specify backup cleanup options. For more information, see Smart Cleanup Policies on page 125.
NOTE: The "Do not delete if Archive bit is set" option is available for full and fast compression backups
in the Backup Template when it is deployed as a maintenance plan. If a backup template is created for
a full backup with the option "Do not delete if Archive bit is set" selected, and the backup template is
deployed as a job, the option is passed to the job's script to run the xp_slsSmartCleanup procedure.
When the backup template is deployed as a maintenance plan, the option is omitted because the
“Remove files older than” option (not the SmartCleanup option) for full backup is run in the
maintenance plan.
Backup Templates are saved in the central repository (if one is used) and available for editing and deployment
on the Backup Templates tab in the Backup Manager pane (CTRL+1). If the central repository is not configured,
LiteSpeed will save each template as file.
In the Backup Templates tab, you can create, edit, clone, import, export and deploy templates, view the template
contents, deployment details and modification history.
NOTES:
l The Backup Templates tab is only available, if the central repository is configured and selected for use.
To edit, deploy or remove a template when the central repository is not used, click beside Backup
Templates on the toolbar and select the appropriate option.
l The template deployment history is not exported when you export a template.
l A LiteSpeed backup template can only be deployed on a server that has LiteSpeed installed.
l If the target server LiteSpeed version does not support Adaptive Compression, the created jobs and
maintenance plans will instead use the specified compression level.
l Regular expressions are only supported in Maintenance Plans.
Select Use the Show selected instances only option to see server instances and databases
Instances where the selected template was deployed.
NOTE: You can select individual databases only if the backup template is saved with
the Custom Database Selection at Deployment option.
Backup Enter backup destinations for individual instances or for several instances at a time or
Options use the default backup destination you specified in the template.
Use the TLog Backup Location column to enter the Transaction Log backup folder for
the given instance.
Use the Diff Backup Location column to enter the Differential backup folder for the
given instance.
Use the Exclude Databases column to exclude individual databases from the backup.
Use the TSM Settings column to customize TSM settings for the backup.
You can change the scheduled time manually or you can right-click a cell in the
Scheduled Time column and select one of the following options:
l Default to template—To change the current cell back to the template default.
l Default all to template—To change all cells back to the template default.
l Stagger by n minutes—To stagger all scheduled times by n minutes, starting at
the template time and adding n minutes for an instance.
l Spread over n hour(s)—To spread the scheduled times evenly over an n hour
range, starting with the template time.
NOTE: You can only change the time for the instance.
Each Backup Template remembers if you override these settings to make future
redeployments easier. For example, if you specify a different scheduled time for an
instance, it will retain the job/plan start time for the next deployments and will not
change if you edit this setting in the template.
Notifications If you enabled notification in the template, review the Notification page and complete
the fields as necessary. You can use the notification profiles only if they are already
configured within a SQL Server instance.
TIP: Variables defined in the maintenance plan can be used to format the Subject Line.
There is also help information inside the task that lists the available Subject Line
variables.
NOTE: The SQL Server Agent must be configured to send email using Database Mail.
Review the following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
Deployment Owner - Optionally, enter the owner of the SQL job (or Maintenance Plan) that will
Type deploy the template. If the name you enter does not exist as a SQL user then the job will
fail. If this field is left blank the job will run with the creator of the template or "running"
user as the owner.
Back Up Databases
The Backup Manager wizard guides you through the process of backing up a single database or multiple
databases. For single database backups you can perform file, filegroup, or transaction log backups, and you
can also mirror, stripe, compress, encrypt, and add attachments to the backup file. For multiple database
backups you can create both the native SQL Server and LiteSpeed backups, mirror, compress and encrypt
backups, run all backups immediately or schedule via a SQL Server job.
Tip: Database backups created with LiteSpeed Version 8.x cannot be restored using older versions
of LiteSpeed.
NOTES:
l Running individual database backups or multi-database backups both use the same Backup wizard.
When backing up multiple databases at the same time For more information, see Multi-Database Backup
on page 116.
Alternately, you can create a maintenance plan. For more information, see About Creating Maintenance
Plans on page 130.
l If you select Fast Compression Backup, the wizard creates a Fast Compression job and does not create
backup files immediately.
l When using this wizard to back up databases participating in AlwaysOn availability groups, LiteSpeed
does not check whether the replica is preferred for backups. You can automate backing up of preferred
replicas using the LiteSpeed Backup Templates feature. For more information, see Create Backup
Templates on page 87.
l Fast Compression is not supported on secondary replicas in AlwaysOn Availability Groups. Backups
must be performed on the primary because differential backups are not supported on secondaries.
l Performing full, file and filegroup backups on secondary replicas in an AlwaysOn Availability Group will
always produce copy-only backups. Please refer to the SQL Server product documentation (SQL Server
2012 and above) for information about supported backup types.
1. In the Navigation pane, select a database to backup and click the Multi-Database Backup button.
Alternately you can right-click a database and select Multi-Database Backup from the menu.
2. Select the databases for backup. For more information, see LiteSpeed's Logic for Backing Up Multiple
Databases on page 111.
3. Complete the wizard. For more information, see To back up databases using the Backup wizard on
page 100. on backup options.
In case you select to schedule the backups to run at the specified times, the wizard creates a job with 'Multiple
Databases' appended to the job name.
2. In the Navigation pane, select a database to backup and click the Backup button. Alternately you can
right-click a database and select Backup from the menu.
Recovery model Indicates the recovery model for selected database. Possible values:
Full, Simple, Bulk-Logged, Mixed (in Multi-Databases Wizard if
databases with different recovery models are selected for backup).
Use LiteSpeed Select to create a LiteSpeed backup. If you clear this checkbox,
LiteSpeed creates a native backup script.
NOTE: The LiteSpeed version number is displayed.
TIP: You can specify custom backup names and descriptions using variables. For more information, see
LiteSpeed Variables on page 127.
Caution: The Cloud only runs backup to new files. Appending to an existing file is not supported by
the Cloud. Existing backups can only be overwritten. The option "Overwrite existing object" is
available in the Backup Wizard and MP (Back Up Database task). The option is turned off by
default.
Scenario: Select Disk and enter the existing or new location for Fast Compression backups:
l Disk
l Cloud
l TSM Backup
l TSM Archive
l Tape
Contents Click to view the contents of the backup destination including general
properties of file content and backup sets properties.
Add Mirror Click to copy the entire backup file to multiple locations.
TIP: This option is only available with the Overwrite existing media
option above.
You can create multiple mirrors by clicking this button more than once.
You can add mirrors to cloud platforms and different cloud platforms at
the same time.
NOTES:
l Mirroring is not the same as striping, which divides the backup file and stores the pieces at
different destinations.
l LiteSpeed automatically stripes the backup files if you include more than one backup destination.
l You can mirror backups regardless of what SQL Server version you use, but you cannot mirror
TSM or tape backups.
l LiteSpeed backup mirroring behavior:
Cloud (backup) + Cloud (mirror), Disk + Disk, Cloud + Disk
l If the mirror failed, the primary will complete. The backup operation will be marked
as completed.
l If the primary failed, then both mirror and primary will fail. The backup operation will be
marked as failed.
l If the mirror failed, the primary backup will fail. The backup operation will be
marked as failed.
l If the primary failed, then both mirror and primary will fail. The backup operation will be
marked as failed.
Client node Enter the node name for the TSM session. This field is not case-sensitive.
Client owner password Enter the access password for the specified node.
Management class Select the management class (policy) to associate with the backup object
being created. LiteSpeed will use the default management class, if this
option is not selected.
Check for existing objects Select this option to check for objects with the same name. LiteSpeed
with same name (Regular aborts the backup if it finds one.
backups)
5. If you selected the Fast Compression backup type, review the following:
Fast Compression Type Select whether you prefer to create a unique file for each backup or you
prefer to manage a single file for each backup set (a backup set is
composed of one full database backup plus all associated differential
backups):
Options You can set the following thresholds to define when to issue a full
backup:
Select the Extension for backup files checkbox to enter or change the
backup file name extension. The default is set to bkp.
NOTE: You can select the backup file extension for Fast Compression
and make the new default, bak, for new items. For an existing item that
does not have an extension defined, bkp is displayed when the item is
edited (maintenance plans and templates).
Select the Enable backup escalation checkbox to maintain high
recoverability. This option is enabled by default.
This option causes LiteSpeed to issue a full backup, if one of the
following problems is discovered in the current backup set:
Optimize the Object Level Select to create an index of objects in the backup file. This option is only
Recovery speed available for LiteSpeed backups. The default is enabled.
NOTE: Before you can recover objects or execute a SELECT statement,
you must read the backup file to create an index of restorable objects.
The index is an .lsm file. During the backup process the .lsm file is
created in the temp directory and attached to the backup file after the
backup is completed.
If you select this option, LiteSpeed uses the index in the backup file to
read the backup file, which makes the object level recovery process
much faster.
Create Double Click Select to create a Double Click Restore Loader that allows you to restore
Restore executable a backup on a server instance that does not have LiteSpeed installed.
If you select to Create one Double-Click Restore executable file then
note the following warning. The executable may be greater than 4GB for
large databases. Windows Server is unable to run executable files larger
than 4GB. However, the file will be convertible/restorable by LiteSpeed
file.
For more information, see Double Click Restore Executables on page
121.
NOTE: A Double Click Restore can only be created for a disk file.
Continue on error Select this option to continue running the backup even if an invalid
checksum is encountered.
Select files/folders to Select Add to attach files or folders to the backup set.
attach to the backup set
NOTE: Some options are only available with certain backup types.
Compression level Select 0 for no compression or 1-8 (default 2) to compress the file. For
more information, see Compression Methods on page 123.
NOTE: Higher compression levels result in smaller backup files, but they
also take longer to complete. For assistance determining the best
compression options, use the Backup Analyzer. For more information,
see Test Optimal Backup Settings on page 83.
Tip: For cloud backups, set the default compression level to 7. Using
a higher compression level has real savings. Reducing the number
of bytes sent to the cloud makes for faster backups and reduces
Internet bandwidth.
Encrypt backup Select this checkbox to encrypt the backup. Then, select the encryption
level and enter the encryption password. For more information, see
Encryption Methods on page 124.
Compression Determines the number of threads used for the backup. You will achieve the
threads 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.
Max transfer size Enter the maximum backup file size in bytes. . The possible values are multiples
of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is
1048576.
Buffer count Enter the number of SQL Server buffers available for a LiteSpeed operation. The
default is set by SQL Server.
CPU throttle Enter the maximum percentage of CPU that LiteSpeed can use for the process.
The default is 100.
Processor affinity
Click to select which processors LiteSpeed can use. The default is 0, which
allows LiteSpeed to use all available system processors.
Processor priority Select the priority of the backup over other transactions or processes running on
the same server. The default is Normal.
Logging level Select a logging level to define what events to log for the console. You can find
the log events in the Application Event Log.
Network resilience If LiteSpeed fails to write disk backups or reads from disk, it waits and retries the
operation. You can enable and disable and control the number of times to retry
and the amount of time to wait before retrying.
TIPS:
l 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.
l You may also want to consider using Adaptive Compression to maintain backup
performance. For more information, see Adaptive Compression on page 124.
NOTE: LiteSpeed defaults typically result in the best performance. You should only modify
advanced options after careful planning and testing. For more information, see Configure LiteSpeed
Defaults on page 60.
8. On the Attached Files page, select Attach files and directories to store selected files with the backup.
This feature lets you bundle items with the backup file that may be necessary to restore it. LiteSpeed
appends the files to the data section of the backup file, and consequently the attached files are
encrypted and compressed with the backup if those options are selected.
Some examples of when to use this feature include the following:
l Extended stored procedures packaged in DLLs may exist outside of the database, but you may
need them to restore it. These external DLLs can be attached to the backup file.
l If you are going to upgrade a database application, you can back up the database along with the
current version of the application. If anything goes wrong during the upgrade, you can restore
both the database and the related application files.
l When sending a backup file offsite to another person (such as an auditor or consultant), you can
attach schema diagrams, username and password lists, instructions, and other documentation.
To retrieve the attachment, select Restore Attached Files and Directories on the Attach Files page of the
Restore wizard. You can also use xp_restore_attachedfilesonly. For more information, see xp_restore_
attachedfilesonly on page 404.
TIP: To restore attached files only using the Restore Wizard, right-click a database in the server tree and
select Restore | Attached Files...
If you selected Fast Compression the backup schedule has options to configure backups to run as a SQL
Agent job at a scheduled time. The options are: daily at, custom, and do not run full backup on specified
days of the week. If you select custom, you can add schedule name, schedule type, occurs, weekly, daily
frequency, duration, and description.
10. On the Notification page, if you selected the Fast Compression backup type, you can configure the Fast
Compression job to send notifications when any type of failure occurs. The failure might be due to a
failed backup, a validation issue, like a missing Full or Differential backup, an LSN verification issue, or a
failed Verify operation. Select one of the following:
l Do not use notification - All failure notifications (including operator selections) are disabled.
l Notify every time - Notify for all successes and failures. An operator can be selected and
configured to receive notifications. Click the ellipsis button on the far right to create new or edit
existing operators.
l Failure only - Notify for failure only. An operator can be selected and configured to receive
notifications. Click the ellipsis button on the far right to create new or edit existing operators.
TIP: Variables defined in the maintenance plan can be used to format the Subject Line. There is also
help information inside the task that lists the available Subject Line variables.
NOTE: The SQL Server Agent must be configured to send email using Database Mail. Review the
following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
11. On the T-Log Schedule page, specify scheduling for the transaction log backup job execution. Select
Schedule transaction log and fill out the new job schedule screen. Entries include schedule name,
schedule type, occurs, daily frequency, duration and description.
12. On the Verification and Cleanup pages, specify the verification and cleanup options after each backup.
TIP: "Cleanup" means Smart Cleanup Policies or Smart Cleanup. For more information, refer to Smart
Cleanup Policies.
Make sure the backup files in the backup set have integrity. This provides an added level of insurance
the backup files can be restored. Verification failures appear in the LiteSpeed UI Console and,
optionally, as job failure notifications. A verification failure after a differential backup will trigger the
backup escalation process, if selected.
The Verification options include:
Note: Clean up transaction log options are available if you set up a transaction log within the
wizard (or template).
Scenario: Specify when full/differential backups are eligible for cleanup, according to your company's
retention policy. For more information, see Smart Cleanup Policies on page 125.
13. On the Fast Compression Job page, create the fast compression backup job script.
14. Complete the wizard.
NOTE: If you selected to run the backup in the background, you can view the progress in the
Background Tasks pane (View | Background Tasks). If you scheduled the backup, you can view and edit
it from the LiteSpeed Jobs tab for the database.
Partial backups
LiteSpeed can backup partial databases. Partial database backups contain only data from some filegroups in a
database. Partial backup data includes that from primary filegroups, read and write filegroups, and other
specified read-only files. Partial backups are different from full backups in that full backups contains all the data
in a specific database or set of filegroups or files, and enough available transaction log information for
recovering that data. Partial backups are run using the CLI with backup commands. Refer to for partial backup
example syntax.
Include Databases
You can specify databases:
l Manually
l Using one of the following built-in groups:
l All databases
l System databases
l User databases
l Using wildcard or regular expressions. For more information, see Use Wildcard and Regular
Expressions in LiteSpeed on page 112.
NOTE: New user databases will also be backed up as part of the "All databases" or "User databases" groups or
if they match the specified pattern, unless they are excluded by an Exclude option. For more information, see
Exclude Databases on page 111.
Depending on the LiteSpeed wizard, you cannot mix selection methods. Instead, you can schedule several
subplans or jobs using different selection methods.
Exclude Databases
Using these options you can further define databases you want to back up.
You can exclude the following databases:
l Offline
l Selected—LiteSpeed will backup all included existing and new databases, except those you select
manually and those excluded by a different Exclude option.
l Deleted
l Back up preferred—This is the default option. LiteSpeed will follow the logic defined for the availability
group by the database administrator and back up databases accordingly, provided the jobs or
maintenance plans are configured on every server instance that hosts an availability replica. The default
AlwaysOn configuration is to back up a secondary replica only, unless the primary replica is the only
replica online.
l Only back up the primary—The primary is backed up each time, regardless of AlwaysOn configuration.
l Back up all (primary and secondaries)— All primaries and secondaries are backed up each time,
regardless of AlwaysOn configuration.
l Back up none—AlwaysOn databases are ignored during backup.
NOTES:
l Fast Compression is not supported on secondary replicas in AlwaysOn Availability Groups. Backups
must be performed on the primary because differential backups are not supported on secondaries.
l Performing full, file and filegroup backups on secondary replicas in an AlwaysOn Availability Group will
always produce copy-only backups. Please refer to the SQL Server product documentation (SQL Server
2012 and above) for information about supported backup types.
l In Maintenance Plans if you select the Differential backup type, all secondary replicas in an AlwaysOn
Availability Group are automatically excluded. In the Multi-Database Backup Wizard they are not
excluded and differential backup for secondary replicas will fail.
l In Maintenance Plans and in the Multi-Database Backup Wizard, if you select the Transaction log
backup type and turn on the Copy Only option, backups for all secondary replicas will fail because
transaction log backups with Copy Only are not supported on secondaries.
Wildcard Expressions
You can use wildcard characters '?' and '*' to select databases you want to back up. For example, "litespeed*"
will include all databases that start with "litespeed" or "LiteSpeed".
Regular Expressions
Using regular expressions can provide you with more flexibility when selecting databases. For example, the
following expressions will include a database if its name:
NOTES:
Construct Description
^ The character following this construct is at the beginning of the document or new line.
Text: no cat can catch a crow
Expression: ^\w+
Matches: no
Matches: crow
\d Any digit.
Text: APR-2012
Expression: \d\d\d\d
Matches: 2012
\D Any non-digit.
Text: APR-2012
Expression: \D\D\D
Matches: APR
[ - ] Any character within the specified range. [0-9a-fA-F] matches a single hexadecimal digit,
without case sensitivity.
Expression: b[a-z]ttle
. Any single character. When preceded with the escape character (\), it is equivalent to a
period character.
Expression: d.g
Matches: dog, dig, and dug
{n,m} The preceding character must match at least "n" times but no more than "m" times.
Expression: mo{2,3}n
Matches: moon and mooon, but not mon or moooon
(?# ) A comment within a regular expression. The comment ends after the first closing
parenthesis.
Expression: theat(er|re)(?# using this example a second time)
Matches: theater and theatre
Expression: ^(?=.{32}$)(\d+)
Matches: numbers at the beginning of any line which is exactly 32 characters long
l msdn.microsoft.com/en-us/library/az24scfc.aspx
l msdn.microsoft.com/en-us/magazine/cc163473.aspx
Multi-Database Backup
Multi-Database Backup launches the Backup wizard which allows you to configure backup options for several
databases at once.
For each database, LiteSpeed generates uniquely named backup files to avoid collision.
NOTE: Fast Compression is now available for multi-database backup in the UI.
1. Right-click the server instance and select Multi-Database Backup.... Alternately you can select the Multi-
Database Backupbutton at the top.
2. Select databases for backup. For more information, see LiteSpeed's Logic for Backing Up Multiple
Databases on page 111.
3. Complete the wizard. For more information, see To back up databases using the Backup wizard on
page 100. on backup options.
In case you select to schedule the backups to run at the specified times, the wizard creates a job with 'Selected
databases' appended to the job name.
Fast Compression
Fast Compression allows you to maximize space savings and reduce backup time considerably over nightly full
backup routines by intelligently backing up only database changes rather than the entire database. Fast
Compression automatically chooses to create a full or differential backup based on user-defined full backup
intervals and the percentage of the database that has changed. By only backing up database changes, users
will see a significant reduction in backup storage and backup time.
NOTES:
1 100 GB 20 GB 20 GB (Full)
2 100 GB 20 GB 1 GB (Diff)
3 100 GB 20 GB 2 GB (Diff)
4 100 GB 20 GB 3 GB (Diff)
5 100 GB 20 GB 4 GB (Diff)
6 100 GB 20 GB 5 GB (Diff)
7 100 GB 20 GB 6 GB (Diff)
Quick Start
To start do one of the following:
l Run the Backup wizard and select the Fast Compression backup type. For more information, see Back
Up Databases on page 99.
l Create a maintenance plan with the Fast Compression Backup task. For more information, see Back Up
Databases Using Maintenance Plans on page 134.
Tip: To create Fast Compression jobs or tasks on several instances, create and deploy a LiteSpeed backup
template. For more information, see Create Backup Templates on page 87.
where:
l If the last full backup was not performed by Fast Compression, but a valid, full backup exists in the
designated Fast Compression folder, then Fast Compression uses it and begins the process with a
differential backup, preventing the need to run an initial full backup on the database.
l If the last full backup was not performed by Fast Compression and that full backup is either missing or
has an LSN verification issue, Fast Compression starts off by executing a full backup.
l If the last Full backup was performed by Fast Compression and is either missing or has an LSN
verification issue, Fast Compression escalates to a full backup (if the escalate option is selected) or
continues with a differential backup.
l Separate backup files—(Default) Creates a unique file for each backup in the backup set. This option
provides the convenience of having to move less data to tape or across the network when copying
individual backup files. Using this option means that up to two physical files may be needed to restore
the database (full backup plus the associated differential for the day in question).
l Self-contained backup sets—Provides the convenience of only having to manage a single file per
backup set. Only one file needs to be saved to or pulled from tape or copied from the backup location to
a secondary location. If backing up more than one database, a file for each database will be created.
The Self-Contained Backup Sets option automatically verifies the Full backup exists. The Separate Backup Files
option performs the same validation by default.
Note: For cloud backups only "Separate backup files" type is supported.
l Force a full backup every - The amount of time elapsed since the last full backup. The default is 14 days.
l Data change threshold - The amount of database changes since the last full backup. The default is 35%.
Fast Compression measures the amount of data change by either querying SQL Server or by comparing the
size of the last differential to the last full backup. The default option is to query actual data pages. It provides the
most accurate way to determine the amount of data change. If the query fails for any reason, Fast Compression
will automatically run a size comparison to the last Differential backup.
l Before a differential Fast Compression backup is available, the last full backup must have been created
in the Fast Compression backup folder.
l When backing up the master database as part of a Fast Compression maintenance plan or job, Fast
Compression always executes a full backup.
l The copy-only full backups cannot serve as a base for differential backups.
Select the Extension for backup files checkbox to enter or change the backup file name extension. The default
is set to bkp.
NOTE: You can select the backup file extension for Fast Compression and make the new default, bak, for new
items. For an existing item that does not have an extension defined, bkp is displayed when the item is edited
(maintenance plans and templates).
Additionally, you can prevent full backups from occurring on specified days of the week. If you select to exclude
specific days of the week from Full backups and Fast Compression is set to execute the first time on an excluded
day, assuming no full backup exists that can be used as described above, Fast Compression will not execute a
full backup. This will continue until Fast Compression runs on a day that is not excluded.
Backup Escalation
This option causes LiteSpeed to issue a full backup, if one of the following problems is discovered in the current
backup set:
NOTE: If a problem is detected and a full backup is created through escalation, an error will be returned.
Full backup escalation is selected by default to maintain high recoverability level in the situations where
recoverability may be limited (missing differential in set) or not available at all (missing full backup). This setting
provides insurance against unanticipated errors. For example, if a backup file is missing from the backup set
(someone accidentally deleted it), or there is some other type of issue like a Log Sequence Number (LSN)
validation error or file corruption, you would not normally be able to restore the database. To correct for this
potential issue with backups, Fast Compression automatically runs a full backup to put the database in a
restorable state. Errors are still noted in the LiteSpeed UI Console and alerts will still be sent via the job.
If you uncheck this option and Fast Compression discovers an issue, you will have to correct the problem
manually. If the physical file for the last full backup cannot be found, a differential backup may be executed
successfully, but you will not be able to recover the database using these backups unless the correct full backup
is located. Correction may require forcing a full backup using the @ForceFull parameter. xp_
slsFastCompression Under normal operating conditions, you should not experience these types of issues as
they are normally caused by accidental deletion of files or disk corruption, both of which occur very infrequently.
Note: Clean up transaction log options are available if you set up a transaction log within the wizard
(or template).
Cleanup
Cleanup provides a convenient way to remove old backups from disk without disrupting Fast Compression.
Select this option to remove full and differential backup files and transaction log backups that are older than the
specified time period.
The cleanup routine is backup set aware. This is important because the cleanup will never remove a full backup
that is needed by a differential backup that is not being deleted. If you use the Separate Backup Files option in
Fast Compression, you have the added flexibility of being able to remove differential backups from the active
backup set that are no longer needed.
NOTE: Fast Compression does not raise errors if it detects a missing backup from a backup set that was
removed via the cleanup process.
The backup retention will never delete:
l 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.
Backup Jobs
Completing the wizard will create the Fast Compression backup job. Using the Backup wizard, you can
optionally schedule transaction log backups for the database. Transaction log backups are scheduled as a
separate job from Fast Compression.
X X* (No name
changes)
*—X.exe is created as empty Double Click Restore loader. You can locate it in the same directory as the
converted X.
l Select the Create a Double Click Restore executable... option when creating backups in the LiteSpeed
UI Console.
l Supply @doubleclick = 2 when creating a backup using procedures. For more information, see xp_
backup_database on page 283.
l Supply --doubleclick 2 when creating a backup using command-line interface. For more information,
see LiteSpeed Command-Line Arguments on page 182.
Scenario
You need to restore particular compressed and encrypted LiteSpeed backups on a server that does not have
LiteSpeed
1. Define which backup files are needed for the restore and convert them to the Double Click Restore
executables. Do one of the following:
l Right-click a backup in the Backup Browser tab or in the Backup History tab and select Convert
to Double Click Restore backup.
l Run exec xp_slsCreateDCR @FileName='<path>'
where <path> is the path to the backup.
2. Copy the Double Click Restore executable(s) you created to the server that does not have LiteSpeed.
NOTE: If a backup file is more than 4 GB, you need to copy both the converted backup file and the empty
Double Click Restore loader.
3. Log on to the server, double-click the first Double Click Restore Executable file to restore and complete
the LiteSpeed Double Click Restore dialog. Repeat for all other files.
NOTE: If you deselected and selected appended backups to restore, you may need to re-enter the
encryption password.
Compression Levels
LiteSpeed offers the following compression levels that allow you to specify compression from least compression
to most compression, with a corresponding CPU trade-off.
Compression Description
Level
1 Medium Compression—for servers where minimal CPU utilization is preferred at the expense
of some compression.
2 Medium-High Compression—a new highly optimized low CPU algorithm for environments
where low CPU utilization is preferred but with improved compression over level 1.
3, 4, 5, 6 High Compression—for databases where balanced compressed backup size and CPU
utilization is important.
7, 8 Extreme Compression—a new highly optimized extreme compression algorithm for databases
where compressed size is very important with only a slight increase in CPU utilization over
previous levels.
NOTE:Levels 9, 10 and 11 were deprecated in version 6.0 and are now automatically
mapped to the new compression level 8.
Depending on your environment, the various algorithms will yield different results. When choosing a
compression level, test various options to determine the best option for your environment. For more information,
see Test Optimal Backup Settings on page 83.
Generally, the higher the compression ratio the higher the CPU utilization and potentially more compression.
That is, the higher compression levels will look for longer patterns to compress, as well as perform more passes
on the data.
The higher levels do not guarantee better compression ratios as the nature of the data dictates the final result.
Therefore, some databases will get varying results as the level increases.
Additionally, if a higher level gets significantly better compression, it may actually perform faster than a lower
level. Typically, the higher levels require more time for the backup.
NOTE: LiteSpeed supports backing up, restoring and shipping transaction logs of the databases encrypted with
transparent data encryption (TDE). If you want to compress the backup, you should choose compression level 1
to minimize CPU, since using a higher level of compression will only cause CPU to increase without any real
benefit on the backup file size. If you choose compression level 0, LiteSpeed will not attempt to compress the
backup. Review the following for additional information:
l Its important to back up the database encryption key, because there is no way to recover the data without
the key. LiteSpeed does not automatically export the encryption key. If needed, you can include the
Adaptive Compression
With Adaptive Compression you do not have to run the Backup Analyzer wizard to determine the best
compression level for a database. LiteSpeed will dynamically change the compression level during a backup in
order to optimize for speed or size, while maximizing use of available CPU. If the server workload changes
during the backup (change in CPU or Disk IO), Adaptive Compression automatically switches compression to
maintain optimal performance.
You can select to optimize backups either for size or for speed:
l Optimize for speed—Backups complete in the least amount of time possible. Available CPU is leveraged
to reduce backup size, but not at the expense of increased backup time. This is the default setting.
l Optimize for size—Backups are completed with higher compression while managing overall backup time
to ensure backups do not take a long time to complete (when compared to optimizing for speed). In this
mode, LiteSpeed allows the backup to complete more slowly if the reduction in speed results in a
smaller backup file. This mode is designed for databases where a smaller backup is desired but
managing how long the backup takes to complete is important as well.
NOTE: Adaptive Compression is only available with LiteSpeed 6.5 or later; Enterprise license.
Encryption Methods
Encryption is a mechanism for protecting data, which applies to it a specially designed algorithm, effectively
obfuscating its content by making it different from the original.
NOTE: If running Windows 2000 to utilize the higher levels of encryption, the Windows 2000 High Encryption
Pack must be installed.
LiteSpeed offers the option of encrypting in the following formats:
l 40-bit RC2
l 56-bit RC2
l 112-bit RC2
l 128-bit RC2
l 168-bit 3DES
l 128-bit RC4
l 128-bit AES
l 192-bit AES
l 256-bit AES
Higher levels of encryption require slightly more CPU, but generally the impact of 256-bit AES encryption on a
backup running on a modern server is very low at less than 0.5% CPU utilization. We recommend for best
security of a backup that 256-bit AES be used when encryption is needed.
Caution: When encrypting data, take care not to lose the encryption key; a backup cannot be restored or
recovered without the original encryption key.
Network Resilience
LiteSpeed's read and write resilience can handle various failures on both network and attached storage
devices. If LiteSpeed fails to write a backup during a backup operation or fails to read a backup during a restore
operation, it will wait and retry the failed operation. If successful on a subsequent attempt, the backup or restore
operation continues without interruption. Without network resilience, these operations would fail immediately on
the first read or write problem encountered.
You can control the number of times to retry and the amount of time to wait before retrying.
l 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.
l File/FileGroup backups
l File/FileGroup differential backups
l Partial backups
l Partial differential backups
l Files that have the filesystem archive bit set (if that option is selected)
NOTE: Fast Compression does not raise errors if it detects a missing backup from a backup set that was
removed via the cleanup process.
The diagram below shows how the LiteSpeed components communicate to SQL Server to check if backups are
eligible for cleanup and delete them each time Smart Cleanup Policies runs.
l Open existing or create a new backup template. For more information, see Create Backup
Templates on page 87.
l Open or create the Fast Compression Database task in a maintenance plan. For more information, see
About Creating Maintenance Plans on page 130.
l Run the Backup wizard and select the Fast Compression backup type. For more information, see Back
Up Databases on page 99.
l Use the xp_slsSmartCleanup extended stored procedure. For more information, see xp_
slsSmartCleanup on page 553.
l Create a Smart Cleanup Backup Files maintenance plan task. For more information, see Smart Cleanup
Backup Files task.
LiteSpeed Variables
LiteSpeed automatically substitutes variables anywhere you need to specify a backup file name, comment, or
description in the LiteSpeed UI Console, from the command-line and when using extended stored procedures.
ALL variables are supported for both files and folders.
Accepted Variables
LiteSpeed accepts the following variables:
Variable Description
%U Week number with the first Sunday as the first day of week one (00-
53). See Note1.
%W Week number with the first Monday as the first day of week one (00-
53). See Note1.
Examples
1. Specify backup destination:
\\Storage\Backup\%SERVER%\%DATABASENAME%_%TYPE%_%DATETIME%.bak
2. Back up the Northwind database with the specified backup set name and description.
EXEC master.dbo.xp_backup_database
@database='MyDB'
, @filename='C:\MSSQL\Backup\%D.BAK'
, @init= 1
, @backupname = '%D_%w'
, @desc = '%T Backup of %D'
3. Restore the Northwind database from the backup device c:\temp\Northwind.bak from the command-line
interface.
sqllitespeed.exe -R Database -D Northwind -F "C:\temp\%D.bak" -W REPLACE
l You cannot have more than one task of the same type in a subplan. To add a duplicate task,
create a new subplan and add the task.
l You cannot have both a Fast Compression Backup task and Back Up Database task added to the
same subplan.
l Any tasks in the subplan must use the same list of databases. If you select a different database in
a task, LiteSpeed prompts you to apply the database change to the entire subplan.
Perform full, differential, or transaction log backups; with or without encryption. You
Back Up
can back up databases on multiple servers by adding a separate backup task to the
Database maintenance plan for each server.
Back Up Databases Using Maintenance Plans
Reorganize
Index
Up
Maintenance
Plans
Remove historical data from the msdb database and LiteSpeed Local and Central
Clean repositories for the following:
Up History
l Back up and restore history
l Maintenance plans
l LiteSpeed activity
NOTE: LiteSpeed activity is removed from the Central repository, only if it is
located on the same server, where the Local repository resides.
Send an email notification to one or more existing operators. You can use the
Notify notification profiles only if they are already configured within a SQL Server instance.
Operator
TIP: Variables defined in the maintenance plan can be used to format the Subject
Line. There is also help information inside the task that lists the available Subject Line
variables.
NOTE: The SQL Server Agent must be configured to send email using Database Mail.
Review the following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
Reduce the size of data and log files in a database that grow beyond a specified size.
Shrink
Database
l You can add multiple constraints for a single task, and can execute those tasks concurrently or
based on the outcome of the previous task.
l To use edit the constraint or use an expression to evaluate precedence, right-click the constraint
line and select Edit.
NOTE: Constraints are not available for legacy plans. Legacy plan tasks are executed in the following
sequence:
1. Clean Up History
2. Check Database Integrity
3. Rebuild Index
4. Shrink Database
5. Update Statistics
6. Reorganize Index
7. Fast Compression Backup or Back Up Database
8. Clean Up Maintenance Plans
9. Notify Operator
10. Execute T-SQL
6. Click and repeat steps 2, 3 and 4 for additional subplans you want to add.
7. (Optional) Set reporting options.
Reporting and
Logging Click to set the reporting and logging options. Reporting and Logging in
Maintenance Plans
Notifications Click to notify an operator of job (subplan) status when a job fails,
succeeds, or completes.
Tips:
l To manually execute, edit, or delete a maintenance plan, right-click the plan in the Maintenance Plan
pane and select an option.
l To change the plan owner, open the plan in the Designpane and select the owner from the drop-down
list in the upper-right corner of the pane. Note that the plan owner is only responsible for creating and
editing plans. The account that executes packages is the SQL Agent service account (or a proxy
account). For more information, please refer to the "Privilege and Grant Requirements" section of the
LiteSpeed Installation Guide.
l To remove a subplan, select it and click on the toolbar in the maintenance plan designer.
l To disable a subplan, double-click the subplan in the Design pane.
Scenario
You need to create a maintenance plan to only back up databases which names start with "C", "DB1" and
"LiteSpeed", except "SoftwareCMSS".
Databases
Click to select databases you want to include in and exclude from the
maintenance plan. LiteSpeed's Logic for Backing Up Multiple Databases
Scenario: Select the Databases matching regular expression option,
enter the following in the Mask field: ^(?!SoftwareCMSS)(C|Quest
Software|LiteSpeed) and click Add. Use Wildcard and Regular
Expressions in LiteSpeed
Back up database across This option creates one backup file for all selected databases. If you
one or more need to create striped backups, provide multiple backup destinations.
files/destination
Tip: You can backup databases to disk, cloud, TSM backup, TSM
archive, or tape. Fast compression backups can be run to disk, cloud,
or TSM backups.
Create backup file for Select this option, if you want to create separate disk backups for
every database databases.
LiteSpeed file format The default backup file format uses the following information:
l %D—Database name
l %T—Backup type (Full, Diff or Log)
l %Y-%m-%d-%H%M%S—Date and time
l %EXT%—File extension
You can specify a custom backup file format using both the LiteSpeed
variables and text. LiteSpeed Variables
If you want LiteSpeed to remember a custom file format and use it for
new backup tasks on this instance, modify the format in the LiteSpeed
file format field as needed and click Set to Instance.
NOTE: Fast Compression handles the naming of files automatically. For
more information, see Backup Files and Folders on page 117.
Cloud vendor Select the cloud vendor, Amazon S3, Azure Blob or Google Storage,
Storage Account name Enter the name of your Azure blob storage account.
(Azure blob only)
Access key Enter the name of the unique Web service alphanumeric access key that
identifies each user.
Service account ID Enter the name of your Google Cloud Storage Service Account ID.
(Google Cloud Storage
only)
Private key (Google Cloud Enter the name of your Google Cloud Storage Private Key.
Storage only)
Project ID (Google Cloud Enter the name of your Google Cloud Storage Project ID.
Storage only)
Storage type Select the Azure storage type: block blobs or page blobs from the drop-
(Azure blob only) down list.
Container Select the Azure blob storage container from the drop-down list.
(Azure blob only)
Region Select a Web service region to use for a bucket with the drop-down list.
(Amazon S3 and Google
Cloud Storage only)
Bucket Enter the name of the container for objects. Bucket names must be at
(Amazon S3 and Google least 3 and no more than 63 characters long. Alternately use the drop-
down list to select an existing bucket.
Cloud Storage only)
If you selected TSM Backup or TSM Archive, review the following for additional information:
Client node Enter the node name for the TSM session. This field is not case-sensitive.
Client owner password Enter the access password for the specified node.
Management class Select the management class (policy) to associate with the backup object
being created. LiteSpeed will use the default management class, if this
option is not selected.
TSM Filespaces (Fast This step is optional. You can click TSM Filespaces to select the existing
Compression backups) or enter new file space name(s).
NOTE: Fast Compression handles the naming of files automatically. For
more information, see Backup Files and Folders on page 117.
TSM Objects (Regular Click TSM Objects and specify the filespace, the high-level name and
backups) the format of the low-level name.
If the option Stripe on TSM object and the number of stripes are selected,
the mask %@ is added by default to the end of the defined file format.
If the option Stripe on TSM object and the number of stripes are selected,
the mask %@ can be added by the user to any place of file format.
Backup set expires Select to set the transaction log expiration. The expiration can be set to
expire after a selected amount of days or on a particular day. Select one
of the following:
Remove files older than This option only removes files that match the file format from the
specified destination folder.
TIP: To remove obsolete files from different locations, use the Clean Up
task. Clean Up Maintenance Plans
Verify backup when Select this option to verify that LiteSpeed successfully wrote all backup
finished files and can read them.
Set native backup Select one of the following options to manage whether to use
compression SQL server native compression (available for native maintenance plans
only):
l Compress backup
Force a full backup if one Select this option to run a force full backup if one has not been created.
has not been created This is a useful option for differential and transaction log backups that
require an initial full backup at first.
Fast Compression Backup You can set the following thresholds to define when to issue a full
Options backup:
l Force a full backup every - The amount of time elapsed since the
last full backup. The default is 14 days.
l Data change threshold - The amount of database changes since
the last full backup. The default is 35%.
Select the Extension for backup files checkbox to enter or change the
backup file name extension. The default is set to bkp.
NOTE: You can select the backup file extension for Fast Compression
and make the new default, bak, for new items. For an existing item that
does not have an extension defined, bkp is displayed when the item is
edited (maintenance plans and templates).
Backup Escalation This option causes LiteSpeed to issue a full backup, if one of the
following problems is discovered in the current backup set:
Verification and Cleanup TIP: "Cleanup" means Smart Cleanup Policies or Smart Cleanup. For
more information, refer to Smart Cleanup Policies.
Make sure the backup files in the backup set have integrity. This
provides an added level of insurance the backup files can be restored.
Verification failures appear in the LiteSpeed UI Console and, optionally,
as job failure notifications. A verification failure after a differential backup
Notification Send an email notification to one or more existing operators. You can
use the notification profiles only if they are already configured within a
SQL Server instance.
TIP: Variables defined in the maintenance plan can be used to format
the Subject Line. There is also help information inside the task that lists
the available Subject Line variables.
NOTE: The SQL Server Agent must be configured to send email using
Database Mail. Review the following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
Compression level Select 0 for no compression or 1-8 (default 2) to compress the file. For
more information, see Compression Methods on page 123.
NOTE: Higher compression levels result in smaller backup files, but they
also take longer to complete. For assistance determining the best
compression options, use the Backup Analyzer. For more information,
see Test Optimal Backup Settings on page 83.
Tip: For cloud backups, set the default compression level to 7. Using
a higher compression level has real savings. Reducing the number
of bytes sent to the cloud makes for faster backups and reduces
Internet bandwidth.
Encrypt backup Select this checkbox to encrypt the backup. Then, select the encryption
level and enter the encryption password. For more information, see
Encryption Methods on page 124.
Compression Determines the number of threads used for the backup. You will achieve the
threads 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.
Max transfer size Enter the maximum backup file size in bytes. . The possible values are multiples
of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB). The default is
1048576.
Buffer count Enter the number of SQL Server buffers available for a LiteSpeed operation. The
default is set by SQL Server.
CPU throttle Enter the maximum percentage of CPU that LiteSpeed can use for the process.
The default is 100.
Processor affinity
Click to select which processors LiteSpeed can use. The default is 0, which
allows LiteSpeed to use all available system processors.
Processor priority Select the priority of the backup over other transactions or processes running on
Comment User comment written into the backup header. Is blank by default.
Logging level Select a logging level to define what events to log for the console. You can find
the log events in the Application Event Log.
Network resilience If LiteSpeed fails to write disk backups or reads from disk, it waits and retries the
operation. You can enable and disable and control the number of times to retry
and the amount of time to wait before retrying.
TIPS:
l 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.
l You may also want to consider using Adaptive Compression to maintain backup
performance. For more information, see Adaptive Compression on page 124.
NOTE: LiteSpeed defaults typically result in the best performance. You should only modify
advanced options after careful planning and testing. For more information, see Configure LiteSpeed
Defaults on page 60.
Review the following additional information about the verification and recovery options:
Optimize the Object Level Select to create an index of objects in the backup file. This option is only
Recovery speed available for LiteSpeed backups. The default is enabled.
NOTE: Before you can recover objects or execute a SELECT statement,
you must read the backup file to create an index of restorable objects.
The index is an .lsm file. During the backup process the .lsm file is
created in the temp directory and attached to the backup file after the
backup is completed.
If you select this option, LiteSpeed uses the index in the backup file to
read the backup file, which makes the object level recovery process
much faster.
Create Double Click Select to create a Double Click Restore Loader that allows you to restore
Restore executable a backup on a server instance that does not have LiteSpeed installed.
If you select to Create one Double-Click Restore executable file then
note the following warning. The executable may be greater than 4GB for
large databases. Windows Server is unable to run executable files larger
than 4GB. However, the file will be convertible/restorable by LiteSpeed
Continue on error Select this option to continue running the backup even if an invalid
checksum is encountered.
Select directories to mirror Click Disk to backup to disk. Click Cloud to backup to cloud.
the backup to (Overwrite
must be selected)
Select files/folders to Select Add to attach files or folders to the backup set.
attach to the backup set
2. Double-click the task and review the following for additional information:
Delete files of the following types Select the type of files to clean up:
Skip files in use by another Select this option to skip files that are in use by another process
process or access is denied or application and/or cannot be accessed. When this option is not
selected locked files are forcibly deleted.
Delete specific file Select this option to delete a specific file. Enter the file name or
select to browse for the file.
Search folder and delete files Select this option to remove any files with a specific file
based on extension extension. Enter the folder name or select to browse for the
folder.
File extension Enter the extension of the files you want to remove.
Include all subfolders Select this option to include all subfolders when searching for
files to remove.
Delete files based on the age of Select this option to automatically delete files based on their age
the file at task run time. Delete in number of hours, days, weeks, months, and years.
files older than the following:
l Different SQL Server versions—You may need to review and edit the selected databases list. Back Up
Databases Using Maintenance Plans
l Different LiteSpeed versions—Some options may be lost if they are not supported by the previous
LiteSpeed version.
1. In the Server tree, right-click a maintenance plan you want to copy and select Copy Maintenance Plan.
2. Right-click the instance where you want to paste the plan and select Paste Maintenance Plan.
To copy a subplan
1. To export a plan, select a maintenance plan you want to export and click the Export Plan button on the
toolbar. NOTE: The file extension is .mpp.
2. To import a plan, right-click the SQL Server instance from where you want to import the plan and select
Import Maintenance Plan.
3. Select the .mpp file that relates to the maintenance plan you want to import.
1. To export a sublan, in the Design pane select a subplan you want to export and click . NOTE:
The file extension is .mps.
2. To import a subplan, open a new or existing maintenance plan in the Design pane.
3. This step is optional. Click on the Design pane toolbar to add a new subplan.
You are going to create a maintenance plan on one SQL Server instance and then simply copy it to the other
server instances.
a. Select the Create backup file for every database option and specify the Destination folder and
file extension for the backups.
b. Select the Options tab and select the Remove files older than option. Specify when the full
backups are eligible for cleanup according to your company’s retention policy.
c. Click Ok to save the task.
4. Click on the tool bar. The task you just created will serve as a base for differential and t-log backups.
When you are done editing the subplan properties, select Enabled and click Ok.
Restore Databases
Scenario
You need to restore a LiteSpeed disk backup to a new database on another SQL Server. Copy the backup
files needed for restore to another server and run the Restore wizard.
Tip: The database (full or differential), files and filegroups, and transaction log restore types use
the restore wizard pages listed in the steps below: restore destination, backup source, backup
content, recovery options, data files, scheduled restore, execute script, and finish.
Tip: The attached files type uses the restore wizard pages listed in the steps below: restore
destination, backup source, backup content, data files, attached files, scheduled restore, execute
script, and finish.
l Automated Restore—Restore the most recent full backup and optionally differential and
transaction log backups. If you select this option, the Restore wizard creates an Automated
Restore job. Backup files can be restored immediately or restored in the background.
Tip: The automated restore type uses the restore wizard pages listed in the steps below: restore
destination, backup source, backup files, restore options, database integrity, database files,
scheduled restore, notification, execute script, and finish.
3. Review information on the Restore Destination page. Select the Kill all current connections before
restore checkbox to obtain exclusive access to the selected database. Additionally, you can select the
View current activity link to view the database connection activity table. A database cannot be restored
unless the restore process has exclusive access to the database. No user connections can exist when
performing a database restore.
Caution: Automated Restore for multiple databases - When running restores for multiple databases,
we recommend that you use the %DATABASENAME% variable to automatically generate an original
database name for database(s) going to be restored. When running restores from multiple servers,
different databases with the same server name can be overwritten. To prevent this, the variable
%SOURCESERVER% adds the source server name (server+instance) to the target database name
when running multiple automated restores. For example:
%SOURCESERVER%_%DATABASENAME%.
Scenario: Select the server instance to restore the backup to and enter a new database name.
Database
If you select Database, the database you are restoring is displayed. You can select another database
using the Database drop down selector. Use the SQL Server drop down selector if the database is on a
different SQL Server instance.
TIP:You can do point in time restores, restoring from a specific date and time or a time period (for
example four hours prior to recovery).
TIP: The restore type option Restore Verify Only in combination with the backup type Verify the latest
full or differential backup is less time consuming for full and differential backups or fast compression
backups where you only want to verify the latest backup, rather than the full and the latest differential. For
backups that are run every day this will serve to verify all backups.
Device
If you select Device, the options are Disk, Cloud, TSM Backup, TSM Archive, and Tape.
Scenario: Select Device and then Disk and specify the backup files you copied.
If you selected Cloud, review the Cloud Account Settings information below:
Cloud account Select the Cloud account from the drop-down list.
Proxy Settings Select the following items to edit the Cloud account proxy
settings.
If you selected TSM Backup or TSM Archive, review the following for additional information:
Client node Enter the node name for the TSM session. This field is not case-
sensitive.
Client owner password Enter the access password for the specified node.
If you selected Automated Restore, review the following for additional information.
Restore from Select SQL Server and databases to specify the source from where to
search the backups for automated restore.
NOTE: The restore from parameters help LiteSpeed to narrow
down its search for the required backup files in the source folders.
Use the drop-down treeview to add multiple sources from the System
and User parent nodes. Select User databases and all subordinate user
databases are automatically selected. Individually select and deselect
databases using the checkbox next to it.
For AlwaysOn availability groups, you may need to specify both SQL
Server (primary and secondary) to allow LiteSpeed to search backups
among all replicas. To specify a secondary SQL Server, set
"Automatically add all the Availability Group replicas to the search list"
option.
NOTES:
Backup type Specify backup types to use for the restore. Select one of the following
options:
5. If you selected Automated Restore, on the Backup Files page, select the backup file locations to search.
Restore from Select the restore from location (disk or cloud) using the drop down
menu.
Add Add the backup file location to restore to the list by selecting and
using the Backup File Location wizard.
Remove Select and remove the backup file location from the list.
6. If you selected Automated Restore, on the Database Integrity page, define the options to check
database integrity after restore.
Check database integrity after Use this option to run a CHECKDB on the restored database and
restore (DBCC_CHECKDB)
7. If you selected Automated Restore, on the Restore Options page, specify options for automated restore.
Drop databases after restore 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.
Overwrite the existing Use this option if you want to overwrite the existing database with the
database restored database.
Include databases that are Use this option to include databases that are part of a replication
part of a replication plan plan.
Select server instance Select the server that contains the backup you want to restore.
Note: In the case of AlwaysOn Availability Group backups, you may
select "Any instance" item from the list. It will include backups created on
all replicas.
Select database backup Select the database that you want to restore.
First backup to recover
a. Click the ellipsis to launch a window containing a list of
backups to restore.
b. Scroll down the list and select a backup. The backup to recover
table is populated with a list of backups. The table includes
backup name, type, destination, encrypted, server, database,
position, begin date, finish date, size, user, expiration, and copy
only. See the partial table below.
Verify backups Select to verify the backup file integrity before completing the wizard.
Overwrite the existing Select to have the current database overwritten with the restored
database database. The default is not selected.
Preserve the replication Select to preserve the replication settings for the restored database.
settings The default is not selected.
Restrict access to the restored Select to restrict access to the database after it is restored. The
database default is not selected.
Prompt before restoring Select this option if you would like to receive a prompt notification before
each backup restoring each backup. The default is not selected.
Note: Not available in case of Automated Restore
Eject tapes (if any) after Select this option if you would like to eject any tapes after restoring each
restoring each backup backup. The default is not selected. This option is available only for
tapes.
Note: Not available in case of Automated Restore
Restore as compressed, Using this option, you can restore a user database into an NTFS
read-only database compressed folder or restore a tlog to a read-only database in a
compressed folder.
NOTES:
Specify a compressed folder for the data files by editing the Restore As
paths. If a folder does not exist, LiteSpeed will create it as NTFS
compressed.
Restore the database files Although you can manually enter DATA and LOG locations, including
as secondary data files locations, it is recommended that you use locations
generated by LiteSpeed.
If restoring database (full or differential), the following links can be
selected (not available for Automated Restore):
If the source and target locations do not match or if they are set to other
than the default, LiteSpeed you can select one of the following options
(not available for Automated Restore):
Processor affinity
Click to select which processors LiteSpeed can use. The default is 0,
which allows LiteSpeed to use all available system processors.
l None—LiteSpeed does not write a log file for the backup or restore
operation.
Network resilience If LiteSpeed fails to write disk backups or reads from disk, it waits and
retries the operation. You can enable and disable and control the
number of times to retry and the amount of time to wait before retrying.
11. If you added an attachment to the backup file, select the Restore Attached Files and Directories on the
Attached Files page.
12. Review the following information about the Schedule Restore page. Select Weekly on (for Automated
Restore only), Run immediately, Run in background, or Schedule (Custom Schedule for Automated
Restore. Selecting Schedule launches a page for adding the schedule name, schedule type, occurs,
weekly, daily frequency, duration, and description.
13. Review the following information about the Notification page (for Automated Restore only). You can
specify the notification of failure options that are sent after each restore. Select one of the following:
l Do not use notification—All failure notifications (including operator selections) are disabled.
l Notify every time—Notify for all successes and failures. An operator can be selected and
configured to receive notifications. Click the ellipsis button on the far right to create new or edit
existing operators.
l Failure only—Notify for failure only. An operator can be selected and configured to receive
notifications. Click the ellipsis button on the far right to create new or edit existing operators.
NOTE: The SQL Server Agent must be configured to send email using Database Mail. Review
the following for additional information:
l http://msdn.microsoft.com/en-us/library/ms189635.aspx
l http://technet.microsoft.com/en-us/sqlserver/dd939167.aspx
l Double-click the Double Click Restore executable and complete the LiteSpeed Double Click
Restore dialog.
l The filename of the backup if there is a Double Click Restore loader created for this backup
l The filenames of any other stripes that were not converted to an executable
NOTE: The syntax is exactly the same as that for sqllitespeed.exe. For more information, see LiteSpeed
Command-Line Arguments on page 182.
l Restore as any other backup using the Restore Wizard, command-line interface or procedures.
NOTE: If logging is enabled during a restore, the log file is written to:
l The default output directory—For more information, see Configure Logging in LiteSpeed on page 580.
l The root of C:\—On a server that does not have LiteSpeed installed.
1. From a command prompt, run as administrator, change the directory until you are in the directory
containing sqlservr.exe. Usually:
sqlservr.exe -c –m"LiteSpeed"
For named instance:
NOTE: You must switch to the appropriate directory (for the instance of Microsoft SQL Server you want to
start) in the command window before starting sqlservr.exe.
3. Using another command prompt, change the directory until you are in the directory containing
SQLLiteSpeed.exe. Usually:
Example Script
l Alerter
l Cluster
l Computer Browser
l Event Log
l License Logging
l Messenger
l Net Logon
l Server
l Print Spooler
l Windows Time
l Workstation
NOTE: To restore the master database from a native full backup, refer to msdn.microsoft.com. For example, SQL
Server 2012: http://technet.microsoft.com/en-us/library/ms190679(v=sql.110).aspx.
Restore Objects
LiteSpeed helps you restore specific objects from a native or LiteSpeed backup file stored locally or in Cloud
storage. You can:
NOTE: Object Level Recovery is only available with the Enterprise license.
You can also restore objects in the command-line or using extended stored procedures. See the following for
more information:
NOTE: It is not recommended to use Object Level Recovery to recover tables with size equal or more than 1TB.
It is recommended to use Object Level Recovery to recover tables with size larger than 100GB on high-
performance systems only. In other cases, a full database restore operation is preferred.
Notes:
l You can restore objects directly from the Cloud. It is recommended to use this in cases where there is a
fast connection between OLR and the Cloud.
note: LiteSpeed must be installed on the server instance you select on the Specify Recover
Destination page.
l Point in time restore - Use the slider to indicate the required point in time. This supports table
level recovery.
l Bypass tail log processing - Select this option to bypass tail log processing. Object Level
Recovery operations may work faster.
9. On the Preview Script page, view the script that will run to retrieve the backup content. Click Next.
note: You can save, copy, print, and search the script in LiteSpeed, but you cannot edit or execute it in the
script preview pane.
Tip: For panes that have grids, you can sort, group, move, and remove the columns:
l To sort and group the records, right-click a column header and select the appropriate options.
l To sort records against multiple columns, click column headers while holding the SHIFT key. For
example, to sort by type and then by name, click the Type column header and then SHIFT+click the
Name column header.
l To add or remove columns, right-click a column header and select Column Chooser. Add a column
by dragging it from the list into the column headers. Remove a column by dragging its column
header into the list.
l To move a column, drag the column header to the new location.
Use table, constraint Enter the prefix naming convention in the field provided. Select this
and index name option when choosing to use prefix naming conventions with tables,
prefix constraints, and index names.
Use table, constraint Enter the suffix naming convention in the field provided. Select this
and index name option when choosing to use suffix naming conventions with tables,
constraints, and index names.
suffix
Drop table if it Drops existing table in the target database before recovering the
already exists table from a backup.
Bulk insert Select this option to import data into a table using BCP for data
recovery. It requires to use a temporary directory for temporary files.
The temporary directory is a Windows temp folder by default or you
can specify your custom directory.
Temporary directory:
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.)
Direct Mode Select this option to import data directly into a table. This alternate
data recovery mechanism eliminates the need for temp file space
and uses BULK INSERT operations to recover the data.
Filegroup Select the filegroup. This option associates the restored object with
the filegroup.
Script options Select these options to generate scripts for table-related objects and
To restore schemas
Restore schemas can recover database objects - extended procedures, functions, partition functions, partition
schemas, roles, rules, stored procedures, tables, memory optimized tables, triggers, types, users, views,
indexed views, and XML schema collections.
SQL Server
Select a server instance or click to navigate to it.
l Convert a TSM backup to LiteSpeed disk backup. For more information, see Recast LiteSpeed
Backups on page 252.
l Extract a TSM backup to disk as a native uncompressed backup, using the extractor tool. For
more information, see Convert LiteSpeed Backups to SQL Server Backups on page 261.
NOTE: To be able to extract TSM backups you need the Extractor tool delivered with LiteSpeed 5.2 or
higher. This tool is fully backward compatible.
2. Restore objects from the converted or native backup files using the Object Level Recovery tool.
tip: Refer to Restore Objects in the LiteSpeed UI Console for further help with object restore.
1. Select the Script Execution tab. The available commands are displayed.
3. Click Execute.
note: Be sure to use fully qualified names when you write a select statement.
SELECT
[ TOP <expression> ]
<select_list>
FROM <select_source>
[ WHERE <search_condition> ]
[ <offset_fetch> ]
<select_list> ::=
<select_item>
| <select_list> , <select_item>
<select_item> ::=
column
| column_wild
| column alias
| alias = column
<select_source> ::=
<table_source>
| <select_source> , <table_source>
| <select_source> JOIN <table_source> ON <search_condition>
| <select_source> INNER JOIN <table_source> ON <search_condition>
<table_source> ::=
table
| table alias
| table AS alias
<search_condition> ::=
{ [ NOT ] <predicate> | ( <search_condition> ) }
[ { AND | OR } [ NOT ] { <predicate> | ( <search_condition> ) } ][,...n]
<predicate> ::=
<expression> { = | > | < | >= | <= | <> | !< | != | !> } <expression>
| expression [ NOT ] LIKE string_constant [ ESCAPE 'escape_char' ]
| expression [ NOT ] BETWEEN expression AND expression
| expression [ NOT ] IN (expression [,...n])
| expression IS [ NOT ] NULL
<expression> ::=
constant
| column
<offset_fetch> ::=
{ OFFSET { integer_constant | offset_row_count_expression } { ROW | ROWS }
Examples
SELECT * FROM LiteSpeedActivity OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY
Overview All Displays information about the backup volume savings, successful jobs, and failed
jobs.
Under Database Properties, see the last backup date.
You can view information about different dates by changing the Period field or
select the dates from a calendar.
Databases Server Lists all of the server instance's databases with their state, recovery model, device,
instance backup destination and last backup date. Print this table or export to Excel.
You can right click on any instance and select backup, multi-database backup,
restore, automated restore, backup analyzer, display backup/restore jobs, assign
categories (available in some cases), refresh, properties, and activity.
LiteSpeed All Displays all activity for the selected parameters, including activity type and status,
Activity duration, compression ratio, backup throughput (uncompressed backup size to
backup duration ratio), Windows domain or SQL Server account that was used to
initiate the backup or restore operation, and more.
You can change the parameters in the following fields:
l Period — Select the time span, or select dates from a calendar. The options
are all, last hour, last 4 hours, last 8 hours, last 24 hours, last 48 hours, last
72 hours, last week, last 2 weeks, and last month.
l Status — View total instance status including all, success, warning, failure,
and in progress.
You can right click on any instance and select: view in timeline, view details, and re-
execute backup.
Tips:
If you selected a database or server instance in the navigation pane, the tab also
displays a timeline of activity. The timeline displays backups and restores from the
past and those scheduled to occur in the future.
You can hover over an item for additional information about it. Right-click anywhere
in the timeline to navigate to a date, change the time scale, or rotate the name of the
databases.
Backup All Displays the LiteSpeed Backup templates stored in the central repository. For more
Templates information, see Create Backup Templates on page 87.
In the Backup Templates tab, you can create, edit, clone, import, export and deploy
templates, view the template contents, deployment details and modification history.
NOTES:
l Backup not run for — Select the time span, or select dates from a calendar.
The options are all, last hour, last 4 hours, last 8 hours, last 24 hours, last 48
hours, last 72 hours, last week, last 2 weeks, and last month.
l Status — View total database status including all, green, yellow, and red.
Database status can be set at General Options in Show database status
area.
Note: The Reports tab is only available, if the central repository is configured and
selected for use.
Backup Server Displays backup directories and current backup files. You can restore the backup
Browser instance file or begin object level recovery from the files listed in the tab. You can also add
directories, delete directories, or set a default directory.
After expending a directory and making a backup visible, you can right click on the
backup and select restore, view content, convert to double click restore backup, and
convert to native backup.
LiteSpeed Server Lists all scheduled jobs. You can select different job types in the Jobs filter field.
Jobs instance Right click a job to select the options: change schedule, start, stop, enable jobs,
and disable jobs, delete, and view in job manager.
Database
List Server Lists the instances in the server group with their display name,
group authentication method, SQL Server version, LiteSpeed version, and
number of databases.
Backup History Database Lists all backups with their date and destination, including native SQL
Server backups performed through LiteSpeed. The list also includes
backups that have been replaced. You can view information about
different dates by changing the Period field or select the dates from a
calendar.
Tips:
Backup Analyzer Database Analyzes different settings, such as compression level, striping, and
backup destinations, to determine which settings have the best
compression and duration values. For more information, see Test Optimal
Backup Settings on page 83.
You can group server instances in the navigation pane tree based on their category or server group. Categories
are similar to server groups, but they offer different features. For more information, see Change Server Instance
Grouping Methods on page 58.
Tip: For panes that have grids, you can sort, group, move, and remove the columns:
l To sort and group the records, right-click a column header and select the appropriate options.
l To sort records against multiple columns, click column headers while holding the SHIFT key. For
example, to sort by type and then by name, click the Type column header and then SHIFT+click the
Name column header.
l To add or remove columns, right-click a column header and select Column Chooser. Add a column
by dragging it from the list into the column headers. Remove a column by dragging its column
header into the list.
l To move a column, drag the column header to the new location.
l After you refine the report criteria, you can print the results or export them to Excel. In addition, the tab
has a timeline that displays the activity for the selected parameters by their date.
Tab Description
Overview l At a group and instance level—Displays information about the backup volume savings,
successful jobs, and failed jobs.
l At a maintenance plan level—Displays maintenance plan latest status, name, owner,
creation date, and last run date.
You can view information about different dates by changing the Period field or clicking to
select the dates from a calendar.
History Displays execution history of the maintenance plans for the server instance.
NOTE: To view execution history of every task in a subplan, configure extended logging.
Reporting and Logging in Maintenance Plans
NOTE: If you receive a message that the server does not exist or access is denied, make sure the instance is
registered and connected.
l You must run commands on the server instance on which you want to perform activity.
l Review the Syntax sections to see which arguments are mandatory, which are optional, and which are
mutually exclusive. Mutually exclusive arguments are separated by a vertical bar. Optional arguments
are enclosed in square brackets. Round brackets are used to group arguments.
l Review the Arguments sections for more information about the arguments and accepted values.
1. Change the directory until you are in the directory containing the LiteSpeed command-line utility
(Usually, C:\Program Files\Quest Software\LiteSpeed\SQL Server\Engine).
SLSSmartCleanup Delete old backups. For more information, see SmartCleanup Command-Line
Arguments on page 225.
SLSRecast Change backup options for the existing LiteSpeed backups. For more
information, see Recast LiteSpeed Backups on page 252.
Extractor Convert LiteSpeed backups to the native SQL Server backups. For more
information, see Convert LiteSpeed Backups to SQL Server Backups on page
261.
OLR Restore database objects. Restore Objects with the Command-Line Interface
SLSSQLMaint Perform various database maintenance tasks. For more information, see
Script Maintenance Plans Tasks on page 234.
LicenseInfoCmd View currently installed license or to register a new key. For more information,
see LicenseInfoCmd Utility on page 277.
l Arguments
l TSM-Specific Arguments
l Cloud-Specific Arguments
l Proxy-Specific Arguments
Syntax
sqllitespeed.exe ( -? | <options> )
Connection Options:
-S <server_name\instance_name>
(-U <login_id> -P <password> ) | -T
Backup Options:
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 ]]
-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)]
-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]
Arguments
NOTES:
l Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
l Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.
l Size
l Speed
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
l Database—Back up database
l tsmbkp:<filespace>\<high>\<low>
l tsmarc:<filespace>\<high>\<low>
(none) --BackupType Specifies backup types to use for the restore. This
argument accepts one of the following values:
(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:
l 0—False (default)
l 1—True
l 0—False (default)
l 1—True
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
l 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.
l 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.
l 0—Logging off.
l 0—False (default)
l 1—True
l 0—False (default)
l 1—True
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
l VerifyOnly—Verify backup.
l CheckPassword—Check password/key.
l 0—False (default)
l 1—True
l 0—False (default)
l 1—True
l server_name
l server_name\instance_name
l 0—False (default)
l 1—True
(none) --SourceDatabase Backups of this database are the source for restore.
l 0—False (default)
l 1—True
l CONTINUE_AFTER_ERROR—Causes the
backup be executed despite encountering
an invalid backup checksum.
l COPY_ONLY—Specifies the copy-only
backup.
l 0—False (default)
l 1—True
TSM-Specific Arguments
TSM-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more
information.
(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.
l 0—False (default)
l 1—True
-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:
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) --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.
Proxy-Specific Arguments
Proxy-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for
more information.
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:
3. Write a database backup where each failure can be retried once after a 30 second wait:
7. Restore the Northwind database from the backup device c:\temp\Northwind.bak using variables:
9. Restore the most recent full backup and related differential and transaction log backups following this full
to a new database.
15. Restore Objects using the UDT argument. Create table with native types, if possible; othervise (CLR
UDT) create with UDT.
Returns
0 (success) or 1 (failure)
Syntax
slsFastCompression.exe ( -? | --ShowHelp | --SDShowSyntax |
<FastCompression_backup_options> <Connection_options> |
<FastCompression_verify_option> <Connection_options> |
<FastCompression_backup_options> <FastCompression_verify_option> <Connection_
options> )
--SDBackupDirectory <path>
[--SDForceFull |--SDForceDifferential ]
--SDExtentsChgRatioRequireFull <value> |--SDDiffToFullRatioRequireFull <value>
[--SDCheckForFullBackup]
[-F --FastCompressionExtension]
[--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]
[
-j <TSM_configuration_file>
[-c <TSM_client_node> ]
[-k <TSM_client_owner_password>]
[--TSMDeviceTimeoutMinutes <minutes>]
[-l <TSM_filespace>]
[-z <TSM_management_class>]
]
Arguments
NOTES:
l Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
l Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.
Argument Description
l ".4"
l "40%"
l ".4"
l "40%"
l A differential backup is
missing from the backup set
(excludes backups
automatically removed after
the specified retention
period).
l LSN verification fails in the
backup set.
l Verify operation fails on full
or differential backup.
l 0—False (default)
l 1—True
l 3—on Tuesday
l "tu"—on Tuesday
l "5-7"—from Thursday to
Saturday
l "m, w, su"—on Monday,
Wednesday, and Sunday
l Size
l Speed
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
(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..
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
-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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
l 0—Logging off.
l 0—False (default)
l 1—True
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
l server_name
l server_name\instance_name
-l --TSMFileSpace Specifies the TSM file space, the logical space on the
Cloud-Specific Arguments
Cloud arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for more
information.
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%.
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.
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%.
Returns
0 (success) or 1 (failure)
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).
l Arguments
l Cloud-Specific Arguments
l Proxy-Specific Arguments
l 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.
l The full backup, if there are associated differential or t-log backups in the backup set that are not eligible
for cleanup.
l File/FileGroup backups
l File/FileGroup differential backups
l Partial backups
l Partial differential backups
l Files that have the filesystem archive bit set (if that option is selected)
Syntax
slsSmartCleanup.exe ( -? | --ShowHelp | --ShowSyntax | <options> )
--Database <database_name>
--Server <server_name>
--WindowsAuth | (--UserName <username> --Password <password>)
Cleanup options:
--KeepArchiveFiles
--MultiDatabaseType
[--CopyOnlyBackups <option>]
[--TSMConfigFile <path>]
[--TSMClientNode <node>]
[--TSMClientOwnerPwd <password>]
[--TSMdsmi_dir <path>]
[--TSMdsmi_log <path>]
[--TSMLogName <name>]
[--TSMAdminName <name>]
[--TSMAdminPwd <password>]
Other options:
[--DryRun]
[--LogLevel (0|1|2) [--trace logpath = "path"]]
Arguments
NOTES:
l Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
l Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.
-a --KeepArchiveFiles Turns on monitoring and refuses to delete files that have the
archive filesystem bit set. When enabled dependent files are
not deleted.
l YYYY—4-digit year
l MM—2-digit month
l DD—2-digit day of the month
l HH—2-digit hour using the local 24-hour clock
l MM—2-digit minute
l SS—2-digit second
NOTES:
l YYYY—4-digit year
l MM—2-digit month
l DD—2-digit day of the month
l HH—2-digit hour using the local 24-hour clock
l MM—2-digit minute
l SS—2-digit second
l 0—Logging off.
-l --LogRetain Specifies the number of units (N). The t-log backup must be
at least N units old before it is eligible for cleanup.
See also LogRetainUnits for unit types details
Note: Old argument @LogRetainDays is still supported for
compatibility reasons.
cleanup policy.
Disk: “F:\\Backups; F:\\mirrors”
Cloud folders: "fff\; test123\"
l server_name
l server_name\instance_name
(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) --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.
Cloud-Specific Arguments
Cloud-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup
Command-Line Arguments for more information.
Proxy-Specific Arguments
Proxy-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and SmartCleanup
Command-Line Arguments for more information.
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:
4. Delete full, differential and log TSM backups created before 06/15/2012, using the PASSWORDAccess
generate option to connect to the TSM Server:
Returns
0 (success) or 1 (failure)
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
-D <names_group_or_patterns>
-BkUpMedia (TSM|TSMARCHIVE)
(-BkUpDB|-BkUpLog)
-BkFileName
[-CrBkSubDir]
-Default <file_format>
[-Differential]
[-FileGroups <filegroups>]
[-TSMClientNode <client_node>]
[-TSMClientOwnerPWD <password>]
-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>
-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
-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]
-CleanHis
<number>(HOURS|DAYS|WEEKS|MONTHS|YEARS)
[BKUP]
[JBS]
[MAINTPLN]
[Activity]
[CentralActivity]
[PurgeInfo]
[Logshipping]
[Status]
[ShrinkLog]
-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>)
Arguments
-Argument Description
-AdaptiveCompression Automatically selects the optimal compression level based on CPU usage or
<value> Disk IO. For more information, see Compression Methods on page 123.
You can tell Adaptive Compression to optimize backups either for size or for
speed. This argument accepts one of the following values:
l Size
l 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 on page 64.
-AltBkpDir <path> Specifies the directory where to search for the backup file.
-Attached <file_or_ Specifies filepaths to include in both backup and restore operations. The
directory> 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:
-BackupEsc This option causes LiteSpeed to issue a full backup, if one of the following
problems is discovered in the current backup set:
-BackupKey <encryption_ Value used to generate the encryption key for the encryption algorithm. If you
password> 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 DISK
l TAPE
l TSM
l 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.
l YEARS
l BKUP—Deletes back up and restore history.
l JBS—Deletes SQL Server Agent jobs history.
l MAINTPLN—Deletes Maintenance plans history.
l Activity—Deletes LiteSpeed activity from the Local Repository.
l CentralActivity—Deletes LiteSpeed activity from the Central Repository.
l PurgeInfo—Deletes any information for deleted databases.
l LogShipping—Deletes log shipping history.
l Status—Deletes status history (Job, DTS, Maint Plans).
l ShrinkLog—Shrinks the repository databases log files.
-COMPRESSIONLEVEL Specifies the compression level for the backup. Valid values are 0 through 8. 0
<value> 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 on page 83.
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.
-CRYPTLEVEL <value> Specifies the encryption level. This argument accepts one of the following
values:
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
-D <names_group_or_ Specifies the database names or the following built-in database groups to
patterns> include in the backup:
l "ALL DATABASES"
l "ALL SYSTEM DATABASES"
l "ALL USER DATABASES"
Alternately, you can specify wildcard or regular expression patterns using one
of the following formats:
l Mask:"<wildcard_expression>"
l Regex:"<regular_expression>"
For more information, see Use Wildcard and Regular Expressions in LiteSpeed
on page 112.
-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:
For more information, see Double Click Restore Executables on page 121.
l %D—Database name
l %T—Backup type (Full, Diff or Log)
l %Y-%m-%d-%H%M%S—Date and time
l %EXT%—File extension
-DelBkUps Deletes old backups based on the time period specified in the format:
<number><time_unit> <number><time_unit>, where the time unit is one of the following:
l HOURS
l DAYS
l WEEKS
l MONTHS
l 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 Deletes .html reports older than the given time period. This argument accepts
<number><time_unit> one of the following time units:
l HOURS
l DAYS
l WEEKS
l MONTHS
l YEARS
l HOURS
l DAYS
l WEEKS
l MONTHS
l YEARS
-DelType <value> Deletes file by type. This argument accepts one of the following values:
l FileBkupbackup—Backup files
l FileRptreport—Maintenance plan text reports
l FileAny—Any file
l MINUTES
l HOURS
l DAYS
l WEEKS
l MONTHS
l YEARS
-Exclude <values> Excludes databases. This argument accepts one or more of the following:
l Offline
l Deleted
l Mask:"<wildcard_expression>"
l Regex:"<regular_expression>"
l 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.
l Primary
l Secondary
-ExcludeDays <values> Specifies days of the week when a full backup is never performed. This
argument accepts one or more of the following:
l Mn
l Tu
l Wd
l Th
l Fr
l St
l 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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
-FileGroups <filegroup_ Specifies a database filegroup to include in the backup or restore. You can
names> 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_ Specifies the number of units (N). The full or differential backup must be at least
days> N units old before it is eligible for cleanup.
See BackupRetainUnits for unit types details
Note: Old argument BackupRetainDays is still supported for compatibility
reasons.
l 0—Logging off.
-LOGGING <value> Controls the logging options for backups. This argument accepts one of the
following values:
l 0—Logging off.
-LogRtn <number_of_ Specifies the number of units (N). The t-log backup must be at least N units old
days>
-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:
-OpImportance <value> Specifies whether the message is of low, high or normal importance. This
argument accepts one of the following values:
l 0—Low
l 1—Normal
l 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:
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 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:
-Retaindays <number_of_ Specifies a number of days to retain the backup. LiteSpeed will not overwrite
days> this file for this number of days.
-RmUnusedSpace <max_ Reduces the size of data and log files in a database that grow beyond a
size> <free_space_to_ specified size. This arguments accepts the following values:
remain>
l Database size, in MB, when the database grows beyond this amount , it
becomes eligible for shrinking. The default is 50.
l The percentage of free space to remain after shrinking. The default is
10.
l NoTrunc—(Optional) Returns freed space to operating system.
l server_name
l server_name\instance_name
-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.
-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 on page 124.
-TSMClientOwnerPWD Specifies the TSM client owner user password. Not required, if specified in the
<password> options file or if backing up with the Passwordaccess Generate option.
-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:
l Rows
l Percent
l FullScan
-UpdStatsTarget <value> Updates index and/or column statistics. This argument accepts one of the
following values:
l Columns
l Index
l All
-VrfyBackup Performs a restore verification on the backup file just created (if backup was
successful).
NOTE: This functionality is only available for disk and cloud operations.
For more information, see Network Resilience on page 125.
Examples
1. Perform full backups of all user databases, except those starting with "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.
3. Delete backup files older than 14 days from the d:\temp folder and its subfolders, if the files have
"bkp" extension.
4. Remove backup and restore history older than 3 months from the LiteSpeed Local repository, shrink
LiteSpeed Local repository.
Syntax
SLSRecast.exe ( -? | <source_options> <target_options> <other_options> )
Source Options:
-E|--SrcBackupFiles <path>
[-N|--SrcBackupIndex <file_number> ]
[-P|--SrcKey <password> ]
Target Options:
-F|--TgtBackupFiles <path>
[-K|--TgtKey <password> ]
[-I|--Overwrite ]
[(-C|--CompressionLevel 0...8 )|--AdaptiveCompression (Speed|Size)]
Other Options:
[ -A|--Affinity <affinity_mask> ]
[ -p|--Priority -1...2 ]
[ -h|--Throttle 1...100 ]
[ -b|--BlockSize ]
[ -X|--IOFlags ]
Tape Options:
[-m|--TapeFormat 0...3}
[-w|--TapeRewind ]
[-u|--TapeUnload ]
TSM Options:
[-c|--TSMClientNode <node_name> ]
[-k|--TSMClientOwnerPwd <password> ]
[-j|--TSMConfigFile <path> ]
[-z|--TSMMgmtClass <class> ]
[ --TSMPointInTime]
[ --TSMDeviceTimeoutMinutes <number> ]
[ --TSMarchive ]
[ --TSMdsmi_dir <path> ]
[ --TSMdsmi_log <path> ]
[ --TSMLogname <name> ]
Arguments
NOTES:
l Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
l Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.
l Size
l Speed
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
-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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
l 0—Logging off.
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 on page 580.
l 0—False (default)
l 1—True
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
l tsmbkp:<filespace>\<high>\<low>
l tsmarc:<filespace>\<high>\<low>
(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.
(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) --TSMOptions Specifies the options that are used during the TSM
session.
(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:
-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:
(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.
6. Encrypt a backup:
7. Convert a TSM backup to a disk backup and convert to a Double Click Restore executable:
Slsrecast -j c:\dsm.opt -E tsmbkp:test\test\test -c nodename -k password -F"D:\test.exe" -J2
Returns
0 (success) or 1 (failure)
Syntax
extractor.exe ( -? | ( [-F <sqllitespeed_backup_file>]
[-E <base_file_name>]
[-N <file_number>]
[-K <encryption_key>]
[-L (0|1|2)]
[-c <tsm_client_node>]
[-i <tsm_filespace>]
[-k <tsm_owner_password>]
[-j <tsm_config_file>]
[--TSMPointInTime <date_time>]
[-I] ) )
Arguments
NOTES:
l Single-letter arguments are case-sensitive, and they can be preceded by a figure dash '-' or '/'.
l Verbose multi-letter arguments are not case-sensitive, they must be preceded by double dashes '--'.
-E --MTFFile Specify the location and name of the Microsoft Tape Format (MSTF)
base file.
The extractor utility will create one backup device file for each thread
used in a LiteSpeed backup.
The extracted files containing the native SQL Server backup will
have the following format: base_file_namex.
Where:
NOTES:
-F --BackupFile The name of the LiteSpeed backup device file to be extracted. This
argument accepts network destinations.
For TSM backups and TSM archives, this argument accepts the
following formats:
l tsmbkp:<filespace>\<high>\<low>
l tsmarc:<filespace>\<high>\<low>
-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:
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.
(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.
-L --LogLevel Creates a log file. This argument accepts one of the following
values:
l 0—Logging off.
-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'
Examples
1. Extract a LiteSpeed backup to a Network Share:
extractor.exe -F"c:\Backup\Northwind.bak"
b. Specify one filename for each destination file. The number of file names you specify with the -E
parameter must match the number of files the extractor utility has returned for the LiteSpeed
backup. The example below has 3 destination files:
Returns
0 (success) or 1 (failure)
Syntax
olr.exe ( -? | <list_backup_contents> | <view_or_restore_tables> | <restore_other_
objects> | <execute_select_script>)
Connection Options:
-U <username>
-P <password>
Backup Files:
-F <full_backup_filename>
[-N <file_number>]
[-K <encryption_key>] ]
Script Options:
[ -G <ON_filegroup_name> ]
[ -I <TEXTIMAGE_ON_filegroup_name> ]
[ -i <table_objects> ]
[ -p <prefix> ]
[ -s <suffix> ]
[ --UDT <0|1> ]
List Contents:
-V
[-Y <object_type>]
<backup_files>
-O <table_name>
-E <destination_server_name>
[ (-S <database_name>
[-T <table_name>]
[-W <temp_directory>]
[-X <ship_directory>] ) |
-J <output_filename> ]
[<script_options>]
<backup_files>
<connection_options>
( -C [ <object_name> ]
-Y ( object_type | 'Database' )
| -Z <objects_filename> )
[ -Q <script_filename> ]
[<script_options>]
<backup_files>
[-y ]
[-W <temp_directory>]
-E <destination_server_name>
<connection_options>
-B
(-H <script_text> | -Q <script_file_name>)
[-y ]
-E <destination_server_name>
[ (-S <database_name>
[-T <table_name>]
[-W <temp_directory>]
)
| -J <output_filename> ]
<backup_files>
<connection_options>
NOTES:
l Arguments are case sensitive and can only be preceded with "-".
l Either use -H or -Q but not both.
l Either use -J or -T (with -S and -W) but not both.
l -B, -C, -O, -V and -Z parameters are mutually exclusive.
Arguments
Argument Name Description
-F <full_ Location and name of the backup file device containing the
backup_ object to recover.
filename> Examples:
--FullBackupFilename UNC Path: \\servername\share\path\filename
Local path: c:\filedirectory\filename
NOTE: There can be multiple files but they must be listed in the
order in which they were backed up.
-g <log_ Specifies location and name of the log backup file. You can
filename> --LogBackupFileName
supply multiple instances of this argument.
-H <script_ --ScriptText SELECT Script literal text. For more information, see Supported
--IncludeTableObjects l Indexes
l Statistics
l Triggers
l All—All of the above
-l --LSMPath Specify a custom path for finding or creating the LSM file.
-p <prefix> Adds a prefix to the names of the table's objects you selected to
--PrefixTableObjects
script or recover.
-Q <script_ The file name that the script is output into. When used with
file_name> execute-select, this file contains the select statement(s).
--ScriptFileName
For more information, see Supported SELECT Statements on
page 174.
-s <suffix> Adds a suffix to the names of the table's objects you selected to
--SuffixTableObjects
script or recover.
-Y <object_ Specifies the type of object. If you omit this parameter the object
type> type defaults to table, so you should use this argument to
recover schema objects other than tables. This argument
accepts one of the following values:
l All 1, 3 l TableConstraintClustere
--Type d 2
l Database
l TableConstraints 2
l Default
l TableForeignKeys 2
l ExtendedProcedure
l Function l TableIndexClustered 2
l IndexedView l TableIndexes 2
l MemoryOptimizedTabl l TableStatistics2
e
l TableTriggers 2
l PartitionFunction
l Trigger
l PartitionScheme
l Type
l Role 1
l User 1
l Rule
l View
l StoredProcedure
l XmlSchemaCollection
l SystemTable
l Table
Notes:
1 These values cannot be used to create scripts.
2 These values are pseudo-object types and are not real
Cloud-Specific Arguments
Cloud-specific arguments work in conjunction with the LiteSpeed arguments. See Syntax and Examples for
more information.
Examples
1. List all objects in the LiteSpeedLocal database in the LITESPEED_full.bak backup file:
3. Recover the contents of the LiteSpeedActivity table to the LITESPEED\SQL2005 server, TEST database,
LiteSpeedActivity117 table:
4. Recover the contents of the LiteSpeedActivity table to the LITESPEED\SQL2005 server, TEST database,
LiteSpeedActivity table using custom temp directory:
12. Create a script file for objects listed in the objects.txt file:
Returns
0 (success) or 1 (failure)
Syntax
LicenseInfoCmd.exe (-? | -r | ([-s] -l <license_key> [-m <site_message>]) )
Examples
1. View information about the accepted parameters:
LicenseInfoCmd.exe -?
LicenseInfoCmd.exe -l C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34
LicenseInfoCmd.exe -l C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34 -s
LicenseInfoCmd.exe -r
NOTE: LicenseInfoCmd needs to be run from an elevated command prompt on Windows Vista/2008/7/8/10 to
be able to store or remove the license key.
On upgrade from a LiteSpeed 8.5 or earlier installation the site message parameter is required as in:
LicenseInfoCmd.exe -l C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34 -m
"Trial Version"
LicenseInfoCmd.exe -l C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34 -m
"Trial Version" -s
l You can only run LiteSpeed commands on SQL Servers on which the LiteSpeed stored procedures
have been registered.
l Extended stored procedures are executed against the master database.
l Review the Syntax sections to see which arguments are mandatory, which are optional, and which are
mutually exclusive. Mutually exclusive arguments are separated by a vertical bar. Optional arguments
are enclosed in square brackets. Round brackets are used to group arguments.
l Review the Arguments sections for more information about the arguments and accepted values.
l LiteSpeed arguments are flexible and usually do not have any hard coded length limits. Review the
following for additional information:
l Path type parameters are the MAX_PATH for any filesystem being employed.
l Backup name, database name, etc. are passed into SQL Server and have the same
requirements.
l TSM has a limit on object names.
l Other than that, you are only limited by OS.
Verify Backups
If you want to... Use...
Encrypt Passwords
If you want to... Use...
TSM-Specific Tasks
If you want to... Use...
LiteSpeed Information
If you want to... Use...
'' Create Partial Backup (includes the primary filegroup, all read/write secondary
filegroups, and a specified read-only file)
xp_backup_database
Performs full, differential, file, or partial filegroup backups.
EXEC master.dbo.xp_backup_database
@database = N'FGBackups_PROD',
@compressionlevel = 2,
@filename = N'I:\FGBackups_FULL.bkp',
@read_write_filegroups = 1,
@init = 1,
xp_backup_database (Tape)
EXEC master.dbo.xp_backup_database
@database = 'database_name'
, @filename = 'tape_device_name'
[, @desc = 'backup_description']
[, @backupname = 'backupset_name']
@database= 'MyDB'
, @tsmclientnode = 'ClusterGroup'
, @tsmclientownerpwd= 'test16'
, @tsmobject= 'SLS_Mar\MyDB\(16)Thursday_14:14'
, @tsmarchive=1
, @init=1
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@adaptivecompression
Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see
Compression Methods on page 123.
You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one
of the following values:
l Size
l Speed
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSMaxParts
Is the number of parts that are simultaneously uploaded to Amazon S3. The LiteSpeed default is 3 parts. The
number of parts can be up to 5 if there is enough memory available during the upload. If you override this
parameter, you may impact memory usage.
@AWSPartSize
The size of each part that is uploaded to Amazon S3 (in MB). The LiteSpeed default for Part Size is calculated
as a database size divided into 9,000. The default Part Size = 25MB.
Notes:
l Amazon S3 has a maximum allowable 10,000 parts per file. If you override this parameter, you may
inadvertently go over the 10,000 limit.
l Minimum and maximum values for Part Size are defined by Amazon S3: 5MB and 5120MB (5GB)
relatively.
l The maximum object size is 5TB.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@CloudAutoStriping
This parameter enables automatic file striping for LiteSpeed cloud backups.
@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.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@CloudParallelUpload
The @CloudParallelUpload argument, parallel parts transfers, is used to create fast uploads to the Azure Cloud
or Amazon S3. The default number of parallel uploads:
l Amazon S3 = 3
l Azure Blob = 20
@CloudPartSize
The @CloudPartSize argument determines the size of each part that is uploaded to the cloud. The
default part size:
l Amazon S3 = 25MB
l Azure Blob = 4MB
notes:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
Important: : In versions less than 8.5 you should use --AWSStorageClass. The @AWSStorageClass
argument is no longer valid in subsequent LiteSpeed versions after 8.5.
l Multi_regional - for frequently accessed data around the world as per serving website content, streaming
videos, or gaming and mobile applications.
l Regional - for frequently accessed data in the same region as your Google Cloud DataProc or the
Google Compute Engine instances that use it, as per data analytics.
l Nearline - for infrequently accessed data (data you expect to access no more than once per month).
l Coldline - for infrequently accessed data (data you expect to access no more than once per year).
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@CloudSessionToken
Amazon Web Services specific argument.
The @CloudSessionToken argument specifies the session token required for temporary security credentials
(see Amazon Web Services SDK documentation for details).
@comment
Appends a user comment to the backup.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@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.
@cryptlevel
Works in conjunction with the @encryptionkey parameter.
Specify the encryption level. Higher levels improve security, but they require more CPU and take longer. Test
Optimal Backup Settings on analyzing the best backup settings for your environment.
This argument accepts one of the following values:
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@doubleclick
Creates a Double Click Restore executable. This argument accepts one of the following values:
l 1—Creates one Double-Click Restore executable file. Note the following warning: The executable may
be greater than 4GB for large databases. Windows Server is unable to run executable files larger than
4GB. However, the file will be convertible/restorable by LiteSpeed file.
l 2—Creates a Double Click Restore loader in the same location. (Default)
For more information, see Double Click Restore Executables on page 121.
@encryptionkey
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'
@excludedatabase
Name of database(s) to exclude from this backup.
If @ExcludeDatabase is supplied as a variable, this name can be specified either as a string constant
(@ExcludeDatabase = database name) or as a variable of character string data type, except for the ntext or text
data types.
Tip: The @ExcludeDatabase argument can be applied together with @MultiDatabaseType to exclude several
databases from the process.
@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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
@file
Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of
this argument.
@filename
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.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@format
Initializes the media on the device. This argument only applies to tape backups. This argument accepts one of
the following values:
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.
@GSProject
DEPRECATED LiteSpeed 8.8: Was used to store for the Google Cloud Storage project ID; the project ID is now
obtained from login. This parameter is retained for compatibility with old backup/restore scripts.
@init
Disk or TSM backups
l 0—Appends the backup to an existing backup file set. For TSM backups, it results in an error if the file
object already exists.
l 1—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.
Tape backups
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
l 0—False (default)
l 1—True
@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).
@mirror
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 on page 127.
@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:
@nowrite
When the backup is completed, it is not written to disk (similar to the native the SQL Native Backup commands:
backup database xxx to disk = 'NUL' or backup log xxx to disk = 'NUL' command). This argument accepts one of
the following values:
l 0—False (default)
l 1—True
The MSDB history tables are updated with the file name specified, but the file will not get created and no IO
is performed.
@olrmap
Generates a map file during a backup for Object Level Recovery. This argument accepts one of the
following values:
l 0—False (default)
l 1—True
@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:
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
@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.
@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.
@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.
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.
@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.
@read_write_filegroups
Specifies a partial backup, which includes all the read/write files in a database: the primary filegroup, any
read/write secondary filegroups, and any specified read-only files or filegroups. If the database is read-only,
@read_write_filegroups includes only the primary filegroup.
@retaindays
Specifies a number of days to retain the backup. LiteSpeed will not overwrite this file for this number of days.
@returndetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@rewind
Applies only to backing up and restoring tape. This argument accepts one of the following values:
@skip
Skips normal retention checks and overwrites the backup that has not expired.
l 0—False (default)
l 1—True
@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,
@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 on page 124.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
You can use the %TSMDEFAULTPATH% variable to make LiteSpeed detect the default TSM configuration file
path automatically (by getting from LiteSpeed defaults as a priority or the registry - HKEY_LOCAL_
MACHINE\SOFTWARE\IBM\ADSM\CurrentVersion\BackupClient)
@tsmmanagementclass
Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
l 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.
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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@verify
Performs a restore verification on the backup file just created (if backup was successful). This argument accepts
one of the following values:
l 0—False (default)
l 1—True
@verify is similar to an xp_restore_verifyonly call following xp_backup_database (or log). But if you use
variables in the file names, then the caller does not need to determine what file names were chosen. xp_
restore_verifyonly
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
Parameter Description
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.
STATS Specifies the percentage at which SQL Server returns backup progress. It defaults to 10%.
CONTINUE_ Causes the backup be executed despite encountering an invalid backup checksum.
AFTER_
ERROR
BLOCKSIZE Specifies the physical block size, in bytes. Supported values are: 512, 1024, 2048, 4096,
8192, 16384, 32768, and 65536 (Default).
NOTE: During a full database or differential backup, LiteSpeed backs up enough of the transaction log to
produce a consistent database when the database is restored.
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_backup_log
Backs up a transaction log. You cannot use xp_backup_log to back up databases with a simple recovery model.
Instead, use xp_backup_database.
NOTE: xp_backup_log does not accept the @with NO_LOG | TRUNCATE_ONLY parameters, and you have to
back up with SQL Server to use them.
Syntax
Back Up Log (Disk)
EXEC master.dbo.xp_backup_log
@database = 'database_name'
(, @filename = 'backup_file') [,...n]
[, @nowrite = 0 | 1 ]
[, @desc = 'backup_description']
[, @backupname = 'backupset_name']
[, @threads = 1..32]
[, @init = 0 | 1 ]
[, @LSECompatible = 1]
[, @mirror = 'mirror_backup_file_name'] [,...n]
[, @doubleclick = 0 | 1 ]
[, ( @encryptionkey = 'encryption_key' | @jobp = 'encrypted_key' ) ]
[, @cryptlevel = 'encryption_level']
[, @file = 'logical_file_name'] [,...n]
[, @filegroup = 'logical_filegroup_name'] [,...n]
[, @priority = -1 | 0 | 1 | 2 ]
[, @with = 'additional_with_parameters'] [,...n]
[, ( @retaindays = 0..99999 | @expiration = 'date' ) ]
[, @logging = 0 | 1 | 2 ]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @comment = 'comment']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @adaptivecompression = 'size' | 'speed' ]
[, @compressionlevel = 'compression_level']
[, @attachedfile = 'pathname']
[, @verify = 0 | 1 ]
[, @returndetails = 0 | 1 ]
@database = N'model',
@compressionlevel = 7,
@filename = N'test\test.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'*************',
@CloudSecretKeyEnc = N'*******',
@CloudBucketName = N'test',
@AzureBlobType = N'Page',
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@adaptivecompression
Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see
Compression Methods on page 123.
You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one
of the following values:
l Size
l Speed
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSPartSize
The size of each part that is uploaded to Amazon S3 (in MB). The LiteSpeed default for Part Size is calculated
as a database size divided into 9,000. The default Part Size = 25MB.
Notes:
l Amazon S3 has a maximum allowable 10,000 parts per file. If you override this parameter, you may
inadvertently go over the 10,000 limit.
l Minimum and maximum values for Part Size are defined by Amazon S3: 5MB and 5120MB (5GB)
relatively.
l The maximum object size is 5TB.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@CloudAutoStriping
This parameter enables automatic file striping for LiteSpeed cloud backups.
@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.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@CloudParallelUpload
The @CloudParallelUpload argument, parallel parts transfers, is used to create fast uploads to the Azure Cloud
or Amazon S3. The default number of parallel uploads:
l Amazon S3 = 3
l Azure Blob = 20
@CloudPartSize
The @CloudPartSize argument determines the size of each part that is uploaded to the cloud. The
default part size:
l Amazon S3 = 25MB
l Azure Blob = 4MB
notes:
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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
Important: : In versions less than 8.5 you should use --AWSStorageClass. The @AWSStorageClass
argument is no longer valid in subsequent LiteSpeed versions after 8.5.
l Multi_regional - for frequently accessed data around the world as per serving website content, streaming
videos, or gaming and mobile applications.
l Regional - for frequently accessed data in the same region as your Google Cloud DataProc or the
Google Compute Engine instances that use it, as per data analytics.
l Nearline - for infrequently accessed data (data you expect to access no more than once per month).
l Coldline - for infrequently accessed data (data you expect to access no more than once per year).
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@CloudSessionToken
Amazon Web Services specific argument.
The @CloudSessionToken argument specifies the session token required for temporary security credentials
(see Amazon Web Services SDK documentation for details).
@comment
Appends a user comment to the backup.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@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.
@cryptlevel
Works in conjunction with the @encryptionkey parameter.
Specify the encryption level. Higher levels improve security, but they require more CPU and take longer. Test
Optimal Backup Settings on analyzing the best backup settings for your environment.
This argument accepts one of the following values:
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@doubleclick
Creates a Double Click Restore executable. This argument accepts one of the following values:
l 1—Creates one Double-Click Restore executable file. Note the following warning: The executable may
be greater than 4GB for large databases. Windows Server is unable to run executable files larger than
4GB. However, the file will be convertible/restorable by LiteSpeed file.
l 2—Creates a Double Click Restore loader in the same location. (Default)
For more information, see Double Click Restore Executables on page 121.
@encryptionkey
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'
@excludedatabase
Name of database(s) to exclude from this backup.
If @ExcludeDatabase is supplied as a variable, this name can be specified either as a string constant
(@ExcludeDatabase = database name) or as a variable of character string data type, except for the ntext or text
data types.
Tip: The @ExcludeDatabase argument can be applied together with @MultiDatabaseType to exclude several
databases from the process.
@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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
@file
Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of
this argument.
@filename
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.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@format
Initializes the media on the device. This argument only applies to tape backups. This argument accepts one of
the following values:
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.
@GSProject
DEPRECATED LiteSpeed 8.8: Was used to store for the Google Cloud Storage project ID; the project ID is now
obtained from login. This parameter is retained for compatibility with old backup/restore scripts.
@init
Disk or TSM backups
l 0—Appends the backup to an existing backup file set. For TSM backups, it results in an error if the file
object already exists.
l 1—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.
Tape backups
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
l 0—False (default)
l 1—True
@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).
@mirror
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 on page 127.
@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:
@nowrite
When the backup is completed, it is not written to disk (similar to the native the SQL Native Backup commands:
backup database xxx to disk = 'NUL' or backup log xxx to disk = 'NUL' command). This argument accepts one of
the following values:
l 0—False (default)
l 1—True
The MSDB history tables are updated with the file name specified, but the file will not get created and no IO
is performed.
@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.
@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.
@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.
@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.
@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.
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
@retaindays
Specifies a number of days to retain the backup. LiteSpeed will not overwrite this file for this number of days.
@returndetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@rewind
Applies only to backing up and restoring tape. This argument accepts one of the following values:
@skip
Skips normal retention checks and overwrites the backup that has not expired.
l 0—False (default)
l 1—True
@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
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 on page 124.
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
You can use the %TSMDEFAULTPATH% variable to make LiteSpeed detect the default TSM configuration file
path automatically (by getting from LiteSpeed defaults as a priority or the registry - HKEY_LOCAL_
MACHINE\SOFTWARE\IBM\ADSM\CurrentVersion\BackupClient)
@tsmmanagementclass
Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@verify
Performs a restore verification on the backup file just created (if backup was successful). This argument accepts
one of the following values:
l 0—False (default)
l 1—True
@verify is similar to an xp_restore_verifyonly call following xp_backup_database (or log). But if you use
variables in the file names, then the caller does not need to determine what file names were chosen. xp_
restore_verifyonly
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
NO_ Allows backing up the log in situations where the database is damaged.
TRUNCATE
COPY_ONLY Specifies the copy-only backup.
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_ Causes the backup be executed despite encountering an invalid backup checksum.
AFTER_
ERROR
BLOCKSIZE Specifies the physical block size, in bytes. Supported values are: 512, 1024, 2048, 4096,
8192, 16384, 32768, and 65536 (Default).
Example
EXEC master.dbo.xp_backup_log
@database = 'MyDB'
, @filename='C:\MSSQL\Backup\MyDB_Backup.BAK'
, @init = 1
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
NOTE: For tape backups, LiteSpeed returns the size and dataset number of the backup file. This number is
used in the restore when multiple backups are sent to the same tape.
Syntax
Enter parameters to connect to Cloud storage:
Run a backup:
declare @mirrorPath1 nvarchar(1024)
set @mirrorPath1 = @mirrorId1 + N':' + N''
exec master.dbo.xp_backup_database
@database = N'TestDatabase',
@backupname = N'TestDatabase - Full Database Backup',
@desc = N'Full Backup of TestDatabase on %Y-%m-%d %I:%M:%S %p',
@compressionlevel = 2,
@filename = N'c:\backup\TestDatabase_Full_1503360019.bak',
@init = 1,
@mirror = @mirrorPath1,
@OLRMAP = 1 ,
@with = N'STATS = 10'
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
note: The LiteSpeed auto striping logic used in the @CloudAutoStriping and @CloudAutoStripingThreshold
parameters can override the Azure blob limit for LiteSpeed backups.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@CloudAutoStriping
This parameter enables automatic file striping for LiteSpeed cloud backups.
@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.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
l Amazon S3 = 3
l Azure Blob = 20
@CloudPartSize
The @CloudPartSize argument determines the size of each part that is uploaded to the cloud. The
default part size:
l Amazon S3 = 25MB
l Azure Blob = 4MB
notes:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudStorageClass
The @CloudStorageClass argument specifies a range of storage classes established for different use
cases including:
For Amazon S3:
Important: : In versions less than 8.5 you should use --AWSStorageClass. The @AWSStorageClass
argument is no longer valid in subsequent LiteSpeed versions after 8.5.
l Multi_regional - for frequently accessed data around the world as per serving website content, streaming
videos, or gaming and mobile applications.
l Regional - for frequently accessed data in the same region as your Google Cloud DataProc or the
Google Compute Engine instances that use it, as per data analytics.
l Nearline - for infrequently accessed data (data you expect to access no more than once per month).
l Coldline - for infrequently accessed data (data you expect to access no more than once per year).
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@CloudSessionToken
Amazon Web Services specific argument.
The @CloudSessionToken argument specifies the session token required for temporary security credentials
(see Amazon Web Services SDK documentation for details).
@filename
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.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@GSProject
DEPRECATED LiteSpeed 8.8: Was used to store for the Google Cloud Storage project ID; the project ID is now
obtained from login. This parameter is retained for compatibility with old backup/restore scripts.
@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
@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.
@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.
@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.
@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.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Syntax
EXEC master.dbo.xp_delete_tsmfile
@tsmclientnode = 'TSM_client_node'
, @tsmclientownerpwd = 'TSM_client_owner_password'
, @tsmobject = 'TSM_object'
, @tsmconfigfile = 'TSM_configuration_file'
[, @tsmpointintime = 'date_time' ]
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
Syntax
EXEC master.dbo.xp_encrypt_backup_key
@key ='Mypassword'
Results
The Results tab displays the encrypted key.
xp_encrypt_restore_key
The procedure encrypts a password into a value for @jobp, that is suitable for the xp_restore_database and xp_
restore_log procedures as an encrypted key.
Syntax
EXEC master.dbo.xp_encrypt_restore_key
@key ='Mypassword'
Results
The Results tab displays the encrypted key.
xp_extractor
Converts LiteSpeed backups to native SQL Server backups.
Syntax
NOTE: You can replace argument values with variables. For more information, see LiteSpeed Variables
on page 127.
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
l tsmbkp:<filespace>\<high>\<low>
l tsmarc:<filespace>\<high>\<low>
@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.
@basesize
The smallest chunk of memory LiteSpeed attempts to write to disk at any given time.
@encryptionkey
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'
@filename
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.
@filenumber
Disk restores:
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.
Tape restores:
Identifies the backup set to be restored. For example, a file number of 1 indicates the first backup set on the
backup medium, and a file number of 2 indicates the second backup set.
l 0—Appends the backup to an existing backup file set. For TSM backups, it results in an error if the file
object already exists.
l 1—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.
Tape backups
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@mtffile
Specify the location and name of the Microsoft Tape Format (MSTF) base file.
The extractor utility will create one backup device file for each thread used in a LiteSpeed backup.
The extracted files containing the native SQL Server backup will have the following format: base_file_namex.
Where:
NoteS:
l You cannot tell the extraction utility to extract a different number of native SQL Server files. However, you
can specify different destinations for the extracted files by supplying a file name with the -E parameter for
each of the native SQL Server files. To see how many files extractor.exe will create, run it without this
parameter. See example 4 for more information.
l If a full path is not specified, the extracted files will be created in the current directory.
@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:
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
@showhelp
Displays the syntax summary of the LiteSpeed command-line utility.
@trace
Used by LiteSpeed to activate trace logging.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@tsmfile
Specifies the TSM file.
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmdevicetimeoutminutes
Specifies how long to wait for a TSM device.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
l 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.
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.
@tsmpassword
The TSM username password. Passwords are case-sensitive.
@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.
@tsmusername
The TSM username ID.
@vlf
Virtual log files are the unit of truncation for the transaction log.
@vlfmaxsize
The maximum size of virtual log files. The number of virtual log files can grow based on the auto growth settings
for the log file and how often the active transactions are written to disk. Too many virtual log files can cause
transaction log backups to slow down and can also slow down database recovery.
Examples
Encrypted backup conversion
exec master..xp_extractor
@FileName = N'C:\Backups\backup.bkp',
@FileNumber = 1,
@EncryptionKey = N'password',
@Init = 1,
@MTFFile = N'C:\Backups\backup.bkp.bak'
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<xp_extractor> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
Convert LiteSpeed Backups to SQL Server Backups
xp_memory_size
-------------------------------------------------
NOTE: Extended stored procedure xp_memory_size has been marked as deprecated. It will be removed from
the product in version 9.0.
-------------------------------------------------
Extended stored procedure to return the contiguous memory availability of the system within the SQL Server
process space. This is the space to be utilized for the transfer buffer for backup and restore operations.
Syntax
EXEC master.dbo.xp_memory_size
xp_objectrecovery
Restores a table from backup files. There are several ways to restore a table:
l Restore table to a database - Allows you to directly restore the table. If a table with the same name
already exists in the destination database, LiteSpeed will not overwrite it. However, you can use
@destinationtable to rename the new table and restore it to the database.
l Restore table to a ship directory - Allows you to restore the table later or on a different location.
l Restore table to a .csv file - Allows you to open the file with Excel or any other spreadsheet application
recognizing .csv file format.
NOTES:
l You can restore objects directly from the Cloud. It is recommended to use this in cases where there is a
fast connection between OLR and the Cloud.
l You cannot restore objects directly from TSM files or tape backups. For more information, see Object
Level Restores from TSM Backups on page 172.
l Object Level Recovery does not support SQL Server Transparent Data Encryption (TDE).
l LiteSpeed may take a long time to read the backup file for large databases, often with little response in
the LiteSpeed UI Console. To prevent this, the Optimize Object Level Recovery speed option on the
Backup wizard Options page is selected by default to create the index during the backup.
l Objects are recovered as they existed at the time they were backed up. You cannot recover data to a
random point in time.
l Direct mode - In scenarios where you want the application to work with SQL Server directly using a
TCP/IP connection without involving the SQL Server client, you can enable direct mode which
significantly improves deployment and configuration of your applications. You can enable and disable
the use of direct mode from the the Recover Table Wizard.
l Tail log processing - In scenarios when you do not require any transaction log backups and the tail log,
you can select to bypass tail log processing. Object Level Recovery operations may work much faster in
this case. You can enable and disable bypass tail log processing from the toolbar, and when running the
Object Level Recovery Wizard and the Recover Table Wizard.
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@AsOnDisk
Instructs LiteSpeed to restore an in-memory table as a regular table. This argument accepts one of the
following values:
l 0—False (Default)
l 1—True
@backend
Object Level Recovery can restore tables using two different internal techniques to handle the record inserts.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@destinationdatabase
Specifies the destination database.
@destinationfilename
Name of comma separated file (.csv) that is generated instead restoring into a database. This is an ad hoc
solution for users want to see the restored data in Excel. You can only use this argument for text data.
@destinationserver
Name of the destination server.
@destinationtable
Specifies the name of the destination table. LiteSpeed will not overwrite an existing table. If you select the same
server instance and database as the original table, you must use a different table name.
NOTE: For Execute-Select operations, LiteSpeed will attempt to insert (append) all selected records into
existing table.
@diffencryptionkey
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'
Equivalent to @encryptionkey, but used for differential backups instead of full backup files.
@difffilenumber
Identifies the backup file within the backup set. Equivalent to @filenumber, but used for differential backups
instead of full backup files.
@disablelogprocessing
Instructs LiteSpeed to skip all transaction log backups and tail log processing. This may improve read and
recovery times. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will entirely ignore any transaction log backups specified and will not process
the tail log.
@encryptionkey
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'
@filename
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.
@filenumber
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.
@FilestreamOnFileGroup
Specifies a file stream filegroup to include in the object restore.
@logencryptionkey
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'
Equivalent to @encryptionkey, but used for transaction log backups.
@logfilename
Specifies location and name of the log backup file. You can supply multiple instances of this argument.
Syntax
@logfilenumber
Identifies the log backup file within the backup set. Equivalent to @filenumber, but used for log backups.
@LSM
Specifies handling for OLR LSM mapfile(s).
l Create—Reads backup and creates a new mapfile. It will ignore attached LSM.
l Keep—Does not delete mapfile(s) when complete.
l Delete—Always deletes mapfile(s) when complete.
@objectname
Specifies the name of the object to recover.
l 0—Off. Create table with native types, if possible; othervise (CLR UDT) create with UDT. (Default).
l 1—On. Create table with UDT.
@onfilegroup
Filegroup with the object to restore.
@PersistLogProcessing
Instructs LiteSpeed to persist log processing, so the same database backup does not have to be processed for
each Object Level Recovery operation. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will persist transaction log backups specified and the tail log for future use. This
option can offer a huge performance gain for working with databases with large tail logs that could
possibly take a long time to process.
@prefixtableobjects
Adds a prefix to the names of the table's objects you selected to script or recover.
@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.
@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.
@ProxyPassword
The @ProxyPassword argument is optional and specifies the proxy server password credential.
@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.
@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.
@shipdirectory
Name of the ship directory. Use this argument when you want to restore the object later or at a different physical
location. This argument creates the following files in the ship directory:
l CREATE <object_name>.sql
l <object_name>.fmt
l <object_name>.bcp
To restore the object, run the CREATE file first, and then run the BULK INSERT file. You will need to slightly
modify the BULK INSERT file because of the .fmt and .bcp file path names.
Tip: You can zip the files and send them to someone else.
@Status_FileName
Specifies the status of a backup location.
@stripedlogfilename
Specifies the striped log file name.
NOTE: The striped files for a given log backup must be specified before the next log backup set is specified.
@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.)
@textimageonfilegroup
Destination TEXTIMAGE_ON filegroup name. Used to restore a BLOB (binary large object).
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
KEEP_ Instructs the restore operation to keep the replication settings when restoring a published
REPLICATION database to a server other than that on which it was created (used when setting up
replication with log shipping). You cannot specify this parameter with NORECOVERY.
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
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.
When the this option is not specified, LiteSpeed performs a check to ensure that the
database is not restored to the current server if:
l the database name is different from the database name recorded in the LiteSpeed
backup set.
LiteSpeed will overwrite an existing file which cannot be verified as belonging to the
database being restored. Normally, LiteSpeed will refuse to overwrite pre-existing files.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving a
USER 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%.
exec xp_objectrecovery
@FileName = N'C:\temp\HiServ_full.bak',
@FileNumber = 1,
@ObjectName = N'dbo.Employees',
@DestinationTable = N'[dbo].[Employees]',
@DestinationDatabase = N'HiServ',
@DestinationServer = N'w2k3-22\LITESPEED',
@IncludeTableObjects = N'indexes, constraints, foreignKeys'
exec xp_objectrecovery
@FileName = N'C:\temp\HiServ_full.bak',
@FileNumber = 1,
@ObjectName = N'dbo.Customers',
@DestinationTable = N'[dbo].[Customers]',
@DestinationDatabase = N'HiServ',
@DestinationServer = N'w2k3-22\LITESPEED',
@IncludeTableObjects = N'indexes, constraints, foreignKeys'
exec xp_objectrecovery
@FileName = N'C:\temp\HiServ_full.bak',
@FileNumber = 1,
exec xp_objectrecovery
@FileName = N'C:\temp\HiServ_full.bak',
@FileNumber = 1,
@ObjectName = N'dbo.Positions',
@DestinationTable = N'[dbo].[Positions]',
@DestinationDatabase = N'HiServ',
@DestinationServer = N'w2k3-22\LITESPEED',
@IncludeTableObjects = N'indexes, constraints, foreignKeys'
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_objectrecovery_createscript
Creates DDL scripts. You can use this extended stored procedure to restore objects other than tables by
generating the DDL scripts and then running the scripts in your native SQL Server tool (such as
Management Studio).
NOTE:
When using scripts, the message output results are rendered in a multi row, single column result set so other
products can programmatically acquire the script without having to parse the message results. The script then
remains in the message output and result set locations.Object Level Restores from TSM Backups
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@AsOnDisk
Instructs LiteSpeed to restore an in-memory table as a regular table. This argument accepts one of the
following values:
l 0—False (Default)
l 1—True
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@diffencryptionkey
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'
Equivalent to @encryptionkey, but used for differential backups instead of full backup files.
@difffilenumber
Identifies the backup file within the backup set. Equivalent to @filenumber, but used for differential backups
instead of full backup files.
@disablelogprocessing
Instructs LiteSpeed to skip all transaction log backups and tail log processing. This may improve read and
recovery times. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will entirely ignore any transaction log backups specified and will not process
the tail log.
@encryptionkey
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'
@filename
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.
@filenumber
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.
@FilestreamOnFileGroup
Specifies a file stream filegroup to include in the object restore.
@logencryptionkey
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'
Equivalent to @encryptionkey, but used for transaction log backups.
@logfilename
Specifies location and name of the log backup file. You can supply multiple instances of this argument.
Syntax
@logfilenumber
Identifies the log backup file within the backup set. Equivalent to @filenumber, but used for log backups.
@LSM
Specifies handling for OLR LSM mapfile(s).
l Create—Reads backup and creates a new mapfile. It will ignore attached LSM.
l Keep—Does not delete mapfile(s) when complete.
l Delete—Always deletes mapfile(s) when complete.
@objectfilename
Identifies a file that contains a list of objects. The format of this file is "ObjectType,ObjectName" per line.
You can create the list using xp_objectrecovery_viewcontents. xp_objectrecovery_viewcontents
@OLRUDT
Create table script:
l 0—Off. Create table with native types, if possible; othervise (CLR UDT) create with UDT. (Default).
l 1—On. Create table with UDT.
@onfilegroup
Filegroup with the object to restore.
@PersistLogProcessing
Instructs LiteSpeed to persist log processing, so the same database backup does not have to be processed for
each Object Level Recovery operation. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will persist transaction log backups specified and the tail log for future use. This
option can offer a huge performance gain for working with databases with large tail logs that could
possibly take a long time to process.
@prefixtableobjects
Adds a prefix to the names of the table's objects you selected to script or recover.
@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.
@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.
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.
@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.
@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.
@scriptfilename
Name of the script file to save the generated SQL scripts.
@Status_FileName
Specifies the status of a backup location.
@stripedlogfilename
Specifies the striped log file name.
NOTE: The striped files for a given log backup must be specified before the next log backup set is specified.
@suffixtableobjects
Adds a suffix to the names of the table's objects you selected to script or recover.
@textimageonfilegroup
Destination TEXTIMAGE_ON filegroup name. Used to restore a BLOB (binary large object).
l All 1, 3 l TableConstraintClustered 2
l Database l TableConstraints 2
l Default l TableForeignKeys 2
l ExtendedProcedure l TableIndexClustered 2
l Function l TableIndexes 2
l IndexedView l TableStatistics2
l MemoryOptimizedTable
l TableTriggers 2
l PartitionFunction
l Trigger
l PartitionScheme
l Type
l Role 1
l User 1
l Rule
l View
l StoredProcedure
l XmlSchemaCollection
l SystemTable
l Table
Notes:
1 These values cannot be used to create scripts.
2 These values are pseudo-object types and are not real schema objects. They are only used to generate
SQL scripts to alter the table, and they will be ignored when used with -V or xp_objectrecovery_
viewcontents. When one of these values is used with -C or xp_objectrecovery_createscript, @ObjectName (-
C) is not the name of the object, but the name of the owning table.
3 This value lists all object types, which are prefixed with "object_type, ". All pseudo-table object types will be
listed even though they might not exist for the associated table.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
KEEP_ Instructs the restore operation to keep the replication settings when restoring a published
REPLICATION database to a server other than that on which it was created (used when setting up
replication with log shipping). You cannot specify this parameter with NORECOVERY.
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
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.
When the this option is not specified, LiteSpeed performs a check to ensure that the
database is not restored to the current server if:
l the database name is different from the database name recorded in the LiteSpeed
backup set.
LiteSpeed will overwrite an existing file which cannot be verified as belonging to the
database being restored. Normally, LiteSpeed will refuse to overwrite pre-existing files.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving a
USER usable database, this restricts access for the restored database to members of the db_
owner, dbcreator, or sysadmin roles.
The same undo file can be used for consecutive LiteSpeed restores of the same database.
NOTE: If free disk space is exhausted on the drive containing the specified undo file name,
the LiteSpeed restore operation stops.
STATS Displays a message each time a percentage of the activity completes. The default is 10%.
Examples
Generate SQL script to create a database
EXEC master.dbo.xp_objectrecovery_createscript
@filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
, @type = 'Database'
, @scriptfilename = 'C:\sql\CREATE_DATABASE.sql'
Table,dbo.Customers
Table,dbo.[Order Details]
Table,dbo.Orders
Table,dbo.Products
TableConstraintClustered,dbo.Customers
TableConstraintClustered,dbo.[Order Details]
TableConstraintClustered,dbo.Orders
TableConstraintClustered,dbo.Products
TableIndexClustered,dbo.Customers
TableIndexClustered,dbo.[Order Details]
TableIndexClustered,dbo.Orders
TableIndexClustered,dbo.Products
TableConstraints,dbo.Customers
TableConstraints,dbo.[Order Details]
TableConstraints,dbo.Products
TableIndexes,dbo.Customers
TableIndexes,dbo.[Order Details]
TableIndexes,dbo.Orders
TableIndexes,dbo.Products
TableForeignKeys,dbo.Customers
TableForeignKeys,dbo.[Order Details]
TableForeignKeys,dbo.Orders
TableForeignKeys,dbo.Products
TableTriggers,dbo.Customers
TableTriggers,dbo.[Order Details]
TableTriggers,dbo.Orders
TableTriggers,dbo.Products
StoredProcedure,dbo.CustOrdersDetail
StoredProcedure,dbo.[Sales by Year]
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
Syntax
View the SELECT query results
EXEC master.dbo.xp_objectrecovery_executeselect
(@filename = 'backup_file_name') [,...n]
[, @filenumber = n]
[, @encryptionkey = 'encryption_key']
[( , @logfilename = 'log_file_name'
[, @stripedlogfilename = 'striped_log_file_name'] [,...n]
[, @logencryptionkey = 'log_encryption_key']
[, @logfilenumber = n ] ) [,...n]]
[, @difffilename = 'diff_file_name'] [,...n]
[, @difffilenumber = n]
[, @diffencryptionkey= 'diff_encrypt_key']
[, @LSM = 'option' ]
{, @scripttext = 'script_text' |
, @scriptfilename = 'script_file_name'}
[, @destinationserver = 'dest_server_name']
[, @tempdirectory = 'recovery_temp_dir']
[, @disablelogprocessing = 0 | 1 ]
Arguments
Tips:
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@backend
Object Level Recovery can restore tables using two different internal techniques to handle the record inserts.
The first and default method uses BCP files and a TSQL BULK INSERT statement. Object Level Recovery will
write a BCP format file and an accompanying binary data file to the local file system. These files may become
very large depending on the table size and will require permissions to write to a temporary directory. The default
TEMP location can be set by using the @TempDirectory parameter or by setting a permanent temp location in
the LiteSpeed configuration file.
An alternate insertion method can be specified to use Sql Server’s Sql Native Client capabilities. This method
inserts row-data directly into the destination database bypassing any storage on the local file-system. To enable
this method, use the parameter @backend='SQLNativeClient' (or -b 1 from the command line). To make
this the default method set the value “BackEnd=SQLNativeClient” in the Object Level Recovery section of the
LiteSpeed configuration file.
Regardless of the insertion method used, the batch size can be globally managed by setting the value
“BulkImportBatchSize=<N>”. This will set the number of row inserts for each batched transaction.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@destinationdatabase
Specifies the destination database.
@destinationfilename
Name of comma separated file (.csv) that is generated instead restoring into a database. This is an ad hoc
solution for users want to see the restored data in Excel. You can only use this argument for text data.
@destinationserver
Name of the destination server.
@destinationtable
Specifies the name of the destination table. LiteSpeed will not overwrite an existing table. If you select the same
server instance and database as the original table, you must use a different table name.
NOTE: For Execute-Select operations, LiteSpeed will attempt to insert (append) all selected records into
existing table.
@difffilename
Name of backup file to restore. Used for differential backups instead of full backup files. You can supply multiple
instances of this argument.
@difffilenumber
Identifies the backup file within the backup set. Equivalent to @filenumber, but used for differential backups
instead of full backup files.
@disablelogprocessing
Instructs LiteSpeed to skip all transaction log backups and tail log processing. This may improve read and
recovery times. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will entirely ignore any transaction log backups specified and will not process
the tail log.
@encryptionkey
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'
@filename
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.
@KeepComputedColumns
Instructs LiteSpeed to keep the computed columns with the object restore. This argument accepts one of the
following values:
l 0—False
l 1—True
@logencryptionkey
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'
Equivalent to @encryptionkey, but used for transaction log backups.
@logfilename
Specifies location and name of the log backup file. You can supply multiple instances of this argument.
Syntax
@logfilenumber
Identifies the log backup file within the backup set. Equivalent to @filenumber, but used for log backups.
@LSM
Specifies handling for OLR LSM mapfile(s).
l Create—Reads backup and creates a new mapfile. It will ignore attached LSM.
l Keep—Does not delete mapfile(s) when complete.
l Delete—Always deletes mapfile(s) when complete.
@OLRUDT
Create table script:
@onfilegroup
Filegroup with the object to restore.
@PersistLogProcessing
Instructs LiteSpeed to persist log processing, so the same database backup does not have to be processed for
each Object Level Recovery operation. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will persist transaction log backups specified and the tail log for future use. This
option can offer a huge performance gain for working with databases with large tail logs that could
possibly take a long time to process.
@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.
@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.
@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.
@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
@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.
@scriptfilename
Name of the SELECT script file to be executed.
@scripttext
The text of the SELECT script to be executed. The SELECT statement is imbedded in a single-quoted
string literal, and all single-quoted string literals in the SELECT statement need to be double single-
quoted. For example:
@shipdirectory
Name of the ship directory. Use this argument when you want to restore the object later or at a different physical
location. This argument creates the following files in the ship directory:
l CREATE <object_name>.sql
l <object_name>.fmt
l <object_name>.bcp
To restore the object, run the CREATE file first, and then run the BULK INSERT file. You will need to slightly
modify the BULK INSERT file because of the .fmt and .bcp file path names.
Tip: You can zip the files and send them to someone else.
@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.)
@textimageonfilegroup
Destination TEXTIMAGE_ON filegroup name. Used to restore a BLOB (binary large object).
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
KEEP_ Instructs the restore operation to keep the replication settings when restoring a published
REPLICATION database to a server other than that on which it was created (used when setting up
replication with log shipping). You cannot specify this parameter with NORECOVERY.
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
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.
When the this option is not specified, LiteSpeed performs a check to ensure that the
database is not restored to the current server if:
l the database name is different from the database name recorded in the LiteSpeed
backup set.
LiteSpeed will overwrite an existing file which cannot be verified as belonging to the
database being restored. Normally, LiteSpeed will refuse to overwrite pre-existing files.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving a
USER 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%.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_objectrecovery_viewcontents
Lists the objects within the backup file.
Syntax
Parameters to describe backup file(s)
EXEC master.dbo.xp_objectrecovery_viewcontents
(@filename = 'backup_file_name') [,...n]
[, @filenumber = n]
[, @encryptionkey = 'encryption_key']
[( , @logfilename = 'log_file_name'
[, @stripedlogfilename = 'striped_log_file_name'] [,...n]
[, @logencryptionkey = 'log_encryption_key']
[, @logfilenumber = n ] ) [,...n]]
[, @difffilename = 'diff_file_name'] [,...n]
[, @difffilenumber = n]
[, @diffencryptionkey = 'diff_encrypt_key']
If the backup is stored in the cloud (Amazon S3) these parameters help us with access
[, @CloudBucketName = N'aabucket1']
[, @CloudAccessKey = N'***']
[, @CloudSecretKey = N'***']
[, @CloudRegionName = N'us-west-2']
[, @ProxyHost = N'proxy.sitelocal']
[, @ProxyPort = 8080]
[, @ProxyLogin = N'DOMAIN\temp-xyz-MYtester']
[, @ProxyPassword = N'***']
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'*******',
@CloudSecretKeyEnc = N'******',
@UseSSL = 1,
@affinity = 0,
@logging = 0
Parameters to describe OLR
, @Database = N'AA_5_restored88'
[, @type = 'object_type']
[, @disablelogprocessing = 0 | 1 ]
[, @LSM = 'option' ]
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@diffencryptionkey
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'
Equivalent to @encryptionkey, but used for differential backups instead of full backup files.
@difffilename
Name of backup file to restore. Used for differential backups instead of full backup files. You can supply multiple
instances of this argument.
@difffilenumber
Identifies the backup file within the backup set. Equivalent to @filenumber, but used for differential backups
instead of full backup files.
l 0—False (Default).
l 1—True. LiteSpeed will entirely ignore any transaction log backups specified and will not process
the tail log.
@encryptionkey
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'
@filename
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.
@filenumber
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.
@logencryptionkey
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'
Equivalent to @encryptionkey, but used for transaction log backups.
@logfilename
Specifies location and name of the log backup file. You can supply multiple instances of this argument.
Syntax
@logfilenumber
Identifies the log backup file within the backup set. Equivalent to @filenumber, but used for log backups.
l Create—Reads backup and creates a new mapfile. It will ignore attached LSM.
l Keep—Does not delete mapfile(s) when complete.
l Delete—Always deletes mapfile(s) when complete.
@PersistLogProcessing
Instructs LiteSpeed to persist log processing, so the same database backup does not have to be processed for
each Object Level Recovery operation. This argument accepts one of the following values:
l 0—False (Default).
l 1—True. LiteSpeed will persist transaction log backups specified and the tail log for future use. This
option can offer a huge performance gain for working with databases with large tail logs that could
possibly take a long time to process.
@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.
@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.
@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.
@ProxyPasswordEnc
The @ProxyPasswordEnc argument is optional and specifies the encrypted proxy server password credential.
@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.
@Status_FileName
Specifies the status of a backup location.
@stripedlogfilename
Specifies the striped log file name.
NOTE: The striped files for a given log backup must be specified before the next log backup set is specified.
@type
Specifies the type of object. If you omit this parameter the object type defaults to table, so you should use this
argument to recover schema objects other than tables. This argument accepts one of the following values:
l All 1, 3 l TableConstraintClustered 2
l Database l TableConstraints 2
l Default l TableForeignKeys 2
l ExtendedProcedure l TableIndexClustered 2
l Function l TableIndexes 2
l IndexedView l TableStatistics2
l MemoryOptimizedTable
l TableTriggers 2
l PartitionFunction
l Trigger
l PartitionScheme
l Type
l Role 1
l User 1
l Rule
l View
l StoredProcedure
l XmlSchemaCollection
l SystemTable
l Table
SQL scripts to alter the table, and they will be ignored when used with -V or xp_objectrecovery_
viewcontents. When one of these values is used with -C or xp_objectrecovery_createscript, @ObjectName (-
C) is not the name of the object, but the name of the owning table.
3 This value lists all object types, which are prefixed with "object_type, ". All pseudo-table object types will be
listed even though they might not exist for the associated table.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
KEEP_ Instructs the restore operation to keep the replication settings when restoring a published
REPLICATION database to a server other than that on which it was created (used when setting up
replication with log shipping). You cannot specify this parameter with NORECOVERY.
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
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.
When the this option is not specified, LiteSpeed performs a check to ensure that the
l the database name is different from the database name recorded in the LiteSpeed
backup set.
LiteSpeed will overwrite an existing file which cannot be verified as belonging to the
database being restored. Normally, LiteSpeed will refuse to overwrite pre-existing files.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving a
USER 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%.
Examples
List table objects for backup set #1 on a full backup file
EXEC master.dbo.xp_objectrecovery_viewcontents
@filename='C:\MSSQL\Backup\MyDB_Backup.BAK'
List all database objects using the full database backup and
several t-log backups
EXEC master.dbo.xp_objectrecovery_viewcontents
@filename = N'C:\temp\8_20101007183923.bak'
, @filenumber = 1
, @type = 'All'
, @logfilename = N'C:\temp\8_20101007183923_20101007184136.bak'
, @logfilenumber = 1
, @logfilename = N'C:\temp\8_20101007183923_20101007184235.bak'
, @logfilenumber = 1
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_remove_file
Deletes a backup file from a specified location (disk, TSM, or cloud).
Syntax (TSM)
EXEC master.dbo.xp_remove_file
@filename = N'tsmbkp:test\test\backup'
,@TSMUserName = 'nodename'
, @TSMPassword= 'password'
, @TSMconfigfile= 'C:\dsm.opt'
Syntax (cloud)
EXEC master.dbo.xp_remove_file
@filename = N'test\model.bak',
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'***************,
@CloudSecretKeyEnc = N'**********',
@CloudRegionName = N'us-west-1',
@UseSSL = 1
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
l Use the slsmedia command to delete a TSM object. See the example below.
SLSMedia.exe -r tsm:file space\high level\low level --TSMConfigFile
C:\ProgramFiles\Tivoli\tsm\api\dsm.opt --tsmclientnode nodename --TSMClientOwnerPwd password
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@FileName
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.
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.
@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.
@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.
@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.
@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.
@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.
@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.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Examples
Remove file from Microsoft Azure
EXEC master.dbo.xp_remove_file
@filename = N'tst\test.bak',
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'********'
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
xp_restore_attachedfilesonly
Restores attached files included within LiteSpeed backup sets. This procedure performs no database restore
operation, but only restores the specified files.
NOTE: You can direct restored files to be recreated in an alternate location from their original location.
Syntax
xp_restore_attachedfilesonly (Disk)
EXEC master.dbo.xp_restore_attachedfilesonly
[, @encryptionkey = 'encryption_key']
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
xp_restore_attachedfilesonly (TSM)
EXEC master.dbo.xp_restore_attachedfilesonly
, @tsmconfigfile = 'TSM_configuration_file'
[, @encryptionkey = 'encryption_key']
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @tsmclientnode = 'TSM_client_node']
[, @tsmpointintime = 'date_time' ]
[, @tsmarchive = 0 | 1]
xp_restore_attachedfilesonly (Tape)
EXEC master.dbo.xp_restore_attachedfilesonly
( @filename = 'backup_file_name') [,...n]
(, @attachedfile = 'pathname [ to new_pathname ]']) [,..n]
[, @filenumber = n]
[, @rewind = 0 | 1 ]
[, @unload = 0 | 1 ]
[, @encryptionkey = 'encryption_key']
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
@filename = N'test\test,bak',
@filenumber = 1,
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'********',
@CloudSecretKeyEnc = N'********',
@UseSSL = 1,
@affinity = 0,
@logging = 0,
Arguments
xp_restore_attachedfilesonly accepts the following arguments:
@affinity
Processor affinity designates specific processors to run LiteSpeed, while not allowing LiteSpeed to run on the
remaining 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
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 on page 124.
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@encryptionkey
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'
@File
Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of
this argument.
@filename
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.
@filenumber
Disk restores:
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.
Tape restores:
Identifies the backup set to be restored. For example, a file number of 1 indicates the first backup set on the
backup medium, and a file number of 2 indicates the second backup set.
@IOFlag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@JobP
Specifies an encrypted key. (Similar to @EncryptionKey).
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@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.
@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.
@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.
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.
@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.
@rewind
Applies only to backing up and restoring tape. This argument accepts one of the following values:
@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 on page 124.
@TSMarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Examples
1. Restore a complete directory:
EXEC master.dbo.xp_restore_attachedfilesonly
@filename= 'C:\MSSQL\Backup\MyDB_Backup.BAK'
@attachedfile = N'C:\DATA\Images'
EXEC master.dbo.xp_restore_attachedfilesonly
@filename= 'C:\MSSQL\Backup\MyDB_Backup.BAK'
EXEC master.dbo.xp_restore_attachedfilesonly
@tsmconfigfile = N'C:\Program Files\Tivoli\TSM\baclient\dsm.opt',
@tsmobject = N'C\Reports\attachedfiles',
@tsmpointintime = '2012-05-04 00:54:32',
@filenumber = 1,
@affinity = 0,
@logging = 0,
@attachedfile = N'''C:\Program Files\Tivoli\TSM\baclient\dsm_pg.opt'' to
''C:\Program Files\Tivoli\TSM\baclient\dsm_pg.opt'''
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
xp_restore_automated
Restores the most recent full disk and cloud backup created with LiteSpeed and optionally differential and
transaction log backups. You can use this extended stored procedure to automate restore operations even if
backup files have unique names.
NOTE: A database cannot be restored unless the restore process has exclusive access to the database. No
user connections can exist when performing a database restore.
Syntax
EXEC master.dbo.xp_restore_automated
[@database = 'database_name'
[, @datafilepath = 'path']
[, @logfilepath = 'path'] ]
, ( @filename = 'backup_filename' | ( @backuppath = 'path'
, @backupextension = 'extensions'
, @checksubfolders = 0 | 1 ) ) [,...n]
, @sourceserver = 'server_name'
, @sourcedatabase = 'database_name'
, @backuptype = N'option',
[, ( @encryptionkey = 'encryption_key' | @jobp = 'encrypted_key' ) ]
[, @with = 'additional_with_parameters'] [,...n]
[, @withreplace = 0 | 1 ]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @restoreasreadonly = 0 | 1]
[, @restoreascompressed = 0 | 1]
[, @dryrun = 0 | 1]
[, @dropdatabaseonfailure = 0 | 1 ]
[, @dropdatabaseonsuccess = 0 | 1 ]
@database = N'filegroups' ,
@filename = N'test\test.bak',
@sourceserver = N'test\test',
@backuptype = N'diff',
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'*******',
@UseSSL = 1,
@CloudGovRegion = 1,
@proxyhost = N'10.1.1.1',
@proxyport = 80,
@proxylogin = N'test',
@ProxyPasswordEnc = N'******',
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
@withreplace = 1,
@checkdb = 1,
@checkdbphysicalonly = 1,
@checkdbnoindex = 1,
@checkdbnoinfomessages = 1,
@read_write_filegroups = 1,
@returndetails = 1,
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@ARPeriod
Specifies a point in time to restore from where the time is measured in days, hours, minutes and seconds from
the restore time.
Set 0's for periods not used.
@ARPeriod = N'DD.HH:MM:SS'
@ARPointInTime
Specifies a point in time to restore from: year, month, day, hours, minutes, seconds.
@ARPointInTime = N'YYYY-MM-DD HH:MM:SS'
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@backuppath
Specifies the directory where to search for the backup files.
@backuptype
Specifies backup types to use for the restore. This argument accepts one of the following values:
l full—LiteSpeed will only restore the most recent full database backup.
l diff—LiteSpeed will restore the most recent full database backup and any existing differential backups
based on this full.
l 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.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@checkdb
Checks database integrity after restore. This argument accepts one of the following values:
l 0—False. LiteSpeed will not confirm integrity of the database after restore.
l 1—True. LiteSpeed will confirm integrity of the database after restore.
@checkdbdatapurity
Checks data purity validations on every column value in all rows of the table or tables in the database. This
argument accepts one of the following values:
l 0—False. LiteSpeed will not confirm integrity of the database column values after restore.
l 1—True. LiteSpeed will confirm integrity of the database column values after restore.
@checkdbextendedlogical
Checks logical consistency on an indexed view, XML indexes, and spatial indexes after restore. This argument
accepts one of the following values:
@checkdbnoindex
Checks the database but does not check the index. This argument accepts one of the following values:
l 0—False. LiteSpeed will check the database and check the index.
l 1—True. LiteSpeed will check the database but not check the index.
@checkdbnoinfomessages
Causes check database to suppress all informational messages. after restore. This argument accepts one of the
following values:
l 0—False. LiteSpeed will include informational messages in notification report after restore.
l 1—True. LiteSpeed will not include informational messages in notification report after restore.
@checkdbphysicalonly
Checks physical structure of the database only. This argument accepts one of the following values:
@checkdbtablelocks
Causes check database to obtain locks instead of using an internal database snapshot. This includes a short-
term exclusive (X) lock on the database. This argument accepts one of the following values:
l 0—False. LiteSpeed will not use locks instead of using an internal database snapshot after restore.
l 1—True. LiteSpeed will use locks instead of using an internal database snapshot after restore.
@checksubfolders
Specifies whether to use subfolders to look for database backups. This argument accepts one of the
following values:
l 0—False. LiteSpeed will only use backups located in the specified folder.
l 1—True. LiteSpeed will look for backups in the specified folder and in its subfolders.
@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, Azure Account Name, Google e-mail
styled account.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@database
Name of database to be backed up or restored.
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@datafilepath
Specifies a location for data files.
@dontusecopyonly
Specifies whether copy only backups are included during automated restores. This argument accepts one of the
following values:
@DontUseReplication
Specifies whether replication is used during automated restores. This argument accepts one of the
following values:
@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:
l 0—False (default)
l 1—True
l 0—False (default)
l 1—True
@dryrun
Shows backups that are candidates for restore at this time, but does not restore them. This argument accepts
one of the following values:
l 0—False (default)
l 1—True
@encryptionkey
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.
@FileName
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.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
NOTE: Automated Restore requires that you use the same password for all encrypted backups.
@logfilepath
Specifies a location for log files.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@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.
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.
@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.
@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.
@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.
@Read_Write_Filegroups
Specifies a partial backup, which includes all the read/write files in a database: the primary filegroup, any
read/write secondary filegroups, and any specified read-only files or filegroups. If the database is read-only,
@read_write_filegroups includes only the primary filegroup.
@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:
l 0—False (default)
l 1—True
l 0—False (default)
l 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:
l When using an NTFS-compressed folder for a database, it can only be restored as read-only.
l You can only use this feature on Windows NTFS file systems.
@ReturnDetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@sourcedatabase
Backups of this database are the source for restore.
@sourceserver
Backups created on this instance of SQL Server are the source for restore.
@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 on page 124.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
STATS Displays a message each time a percentage of the activity completes. The default is 10%.
@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:
@IncludeAGReplicas
AlwaysOn Availability Groups parameter. Instructs LS Core to search and include database backups created on
different replicas into the restore process.
NOTE: backups from different replicas have to be stored into the locations provided with
@BackupPath argument.
Examples
Restore the Most Recent Full Database Backup to a New
Database
EXEC master.dbo.xp_restore_automated
@database='NEWDB'
, @datafilepath = 'D:\DATA'
, @logfilepath = 'D:\DATA'
, @backuppath = N'D:\temp'
, @backupextension = 'bak,bkp'
, @checksubfolders = 1
, @sourceserver = N'LITESPEED\SQL2005'
, @sourcedatabase = N'FOX'
, @backuptype = N'full'
@backuppath = N'test',
@backupextension = N'',
@checksubfolders = 0,
@sourceserver = N 'servername',
@sourcedatabase = N'model',
@backuptype = N'tlog',
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'california',
@CloudAccessKey = N'********',
@CloudSecretKey = N'*********',
@UseSSL = 1,
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
@checkdb = 1,
@checkdbphysicalonly = 1,
@checkdbnoindex = 1,
@checkdbnoinfomessages = 1,
@progressname = N'f94ee3d8-f6ac-47e0-80cd-a6326a532dd9',
@backuppath = N'test',
@backupextension = N'bak',
@checksubfolders = 1,
@sourceserver = N'Server\SQL_instance',
@sourcedatabase = N'test',
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'******',
@UseSSL = 1,
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
@withreplace = 1,
@checkdb = 1,
@checkdbphysicalonly = 1,
@checkdbnoindex = 1,
@checkdbnoinfomessages = 1,
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_automated_verifyonly
Verifies the backup, but does not restore the backup. It checks to see that the backup set is complete and that all
volumes are readable. If the backup is valid, LiteSpeed returns the message from SQL Server: "The backup set
Syntax
EXEC master.dbo.xp_restore_automated_verifyonly
[@database = 'database_name'
[, @datafilepath = 'path']
[, @logfilepath = 'path'] ]
, ( @filename = 'backup_filename' | ( @backuppath = 'path'
, @backupextension = 'extensions'
, @checksubfolders = 0 | 1 ) ) [,...n]
, @sourceserver = 'server_name'
, @sourcedatabase = 'database_name'
, @backuptype = N'option',
[, ( @encryptionkey = 'encryption_key' | @jobp = 'encrypted_key' ) ]
[, @with = 'additional_with_parameters'] [,...n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @dryrun = 0 | 1]
xp_restore_automated (Cloud)
EXEC master.dbo.xp_restore_automated_verifyonly
@database = N'filegroups' ,
@filename = N'test\test.bak',
@sourceserver = N'test\test',
@sourcedatabase = N'filegroups',
@backuptype = N'diff',
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'*******',
@UseSSL = 1,
@CloudGovRegion = 1,
@proxyhost = N'10.1.1.1',
@proxylogin = N'test',
@ProxyPasswordEnc = N'******',
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
@ARPeriod
Specifies a point in time to restore from where the time is measured in days, hours, minutes and seconds from
the restore time.
Set 0's for periods not used.
@ARPeriod = N'DD.HH:MM:SS'
@ARPointInTime
Specifies a point in time to restore from: year, month, day, hours, minutes, seconds.
@ARPointInTime = N'YYYY-MM-DD HH:MM:SS'
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@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.
@backuppath
Specifies the directory where to search for the backup files.
@backuptype
Specifies backup types to use for restore and verify. This argument accepts one of the following values:
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@dontusecopyonly
Specifies whether copy only backups are included during automated restores. This argument accepts one of the
following values:
@DontUseReplication
Specifies whether replication is used during automated restores. This argument accepts one of the
following values:
@dryrun
Shows backups that are candidates for restore at this time, but does not restore them. This argument accepts
one of the following values:
l 0—False (default)
l 1—True
@encryptionkey
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.
@FileName
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.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@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.
@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.
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.
@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.
@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.
@Read_Write_Filegroups
Specifies a partial backup, which includes all the read/write files in a database: the primary filegroup, any
read/write secondary filegroups, and any specified read-only files or filegroups. If the database is read-only,
@read_write_filegroups includes only the primary filegroup.
@ReturnDetails
Generates a single-row result set.
l 0—False (default)
l 1—True
(30)
Threads tinyint The number of threads used for a LiteSpeed backup.
CompressionLevel tinyint Compression level used for compressing the backup. The compression
level can be NULL, if backed up with Adaptive Compression.
AdaptiveCompression nvarchar Adaptive Compression option used for compressing the backup: 'speed'
(max) or 'size'.
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@sourcedatabase
Backups of this database are the source for restore.
@sourceserver
Backups created on this instance of SQL Server are the source for restore.
@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
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
STATS Displays a message each time a percentage of the activity completes. The default is 10%.
Examples
Verify the Most Recent Full Database Backup
EXEC master.dbo.xp_restore_automated_verifyonly
@database='NEWDB'
, @backuppath = N'D:\temp'
, @backupextension = 'bak,bkp'
, @checksubfolders = 1
, @sourceserver = N'LITESPEED\SQL2005'
, @sourcedatabase = N'FOX'
, @backuptype = N'full'
@database = N'LiteSpeedLocal_AutomatedRestore'
, @backuppath = N'D:\temp\FC\'
, @backupextension = ''
, @checksubfolders = 0
, @sourceserver = N'LITESPEED\SQL2005'
, @sourcedatabase = N'LiteSpeedLocal'
, @backuptype = N'diff'
@database='NEWDB'
, @backuppath = N'D:\temp'
, @backupextension = 'stripe1'
, @checksubfolders = 0
, @backuppath = N'E:\temp'
, @backupextension = 'stripe2'
, @checksubfolders = 0
, @sourceserver = N'LITESPEED\SQL2005'
, @sourcedatabase = N'FOX'
, @backuptype = N'full'
@backuppath = N'D:\temp'
, @backupextension = ''
, @checksubfolders = 1
, @encryptionkey = N'******'
, @sourceserver = N'LITESPEED\SQL2005'
, @sourcedatabase = N'FOX'
, @backuptype = N'tlog'
, @dryrun = 1
@database = N'model' ,
@backuppath = N'test',
@backupextension = N'',
@sourceserver = N 'servername',
@sourcedatabase = N'model',
@backuptype = N'tlog',
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'california',
@CloudAccessKey = N'********',
@CloudSecretKey = N'*********',
@UseSSL = 1,
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
@database = N'newtest' ,
@backuppath = N'test',
@backupextension = N'bak',
@checksubfolders = 1,
@sourceserver = N'Server\SQL_instance',
@sourcedatabase = N'test',
@backuptype = N'diff',
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'******',
@UseSSL = 1,
@affinity = 0,
@logging = 0,
@DontUseReplication = 1,
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_checkpassword
This extended stored procedure checks a provided password or key against a single backup set within a
single file.
Syntax
EXEC master.dbo.xp_restore_checkpassword
@tsmconfigfile = N'I:\dsm.opt',
@tsmobject = N'test\test\test',
@tsmclientnode = N'nodename',
@tsmclientownerpwd = N'password',
@tsmarchive = 1,
@encryptionkey = N'key',
@logging = 0
@encryptionkey
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'
@filename
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.
@filenumber
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.
If @FileNumber is not specified, the backup set defaults to 1.
@Logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@TSMArchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
@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.
@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.
@TSMConfigFile
Specifies the TSM configuration file.
@TSMObject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
If @EncryptionKey is not provided (or is an empty string), the procedure checks if the backup set is
encrypted or not.
Syntax
EXEC master.dbo.xp_restore_checksumonly
@filename = 'backup_file_name'
xp_restore_database
Restores LiteSpeed full and partial backups created with LiteSpeed. Files and filegroups may also be restored
either from a file or filegroup LiteSpeed backup operation, or from a full database backup operation using xp_
backup_database. When restoring files or filegroups, you must apply a transaction log using xp_restore_log. In
addition, file differential backups can be restored after a full file restore using LiteSpeed.
NOTE: A database cannot be restored unless the restore process has exclusive access to the database. No
user connections can exist when performing a database restore.
Syntax
xp_restore_database (disk)
EXEC master.dbo.xp_restore_database
@database = 'database_name'
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @restoreasreadonly = 0 | 1 ]
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @returndetails = 0 | 1]
[, @restoreasreadonly = 0 | 1]
[, @restoreascompressed = 0 | 1]
xp_restore_database (TSM)
EXEC master.dbo.xp_restore_database
@database = 'database_name'
, @tsmconfigfile = 'TSM_configuration_file'
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @restoreasreadonly = 0 | 1 ]
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @tsmclientnode = 'TSM_client_node']
[, @tsmclientownerpwd = 'TSM_client_owner_password']
[, @tsmpointintime = 'date_time']
[, @returndetails = 0 | 1]
[, @restoreasreadonly = 0 | 1]
[, @restoreascompressed = 0 | 1]
xp_restore_database (tape)
EXEC master.dbo.xp_restore_database
@database = 'database_name'
(, @filename = 'backup_file_name') [,...n]
[, @filenumber = n]
[, @rewind = 0 | 1 ]
[, @unload = 0 | 1 ]
[, @encryptionkey = 'encryption_key']
[, @file = 'logical_file_name'] [,...n]
[, @filegroup = 'logical_filegroup_name'] [,...n]
[, @with = 'additional_with_parameters'] [,...n]
[, @restoreasreadonly = 0 | 1 ]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @attachedfile = 'pathname'] [,..n]
[, @returndetails = 0 | 1]
@filename = N'test\test.bak',
@filenumber = 1,
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'*******',
@CloudSecretKeyEnc = N'******',
@UseSSL = 1,
@with = N'REPLACE',
@affinity = 0,
@logging = 0
@Database = N'db-1'
, @FileName = N'db.bak'
, @FileNumber = 1
, @CloudVendor = N'GoogleStorage'
, @CloudBucketName = N'bucketname'
EXEC master.dbo.xp_restore_database
@database = 'Prod_test' ,
@read_write_filegroups = 1,
@with = N'REPLACE'
EXEC master.dbo.xp_restore_database
@database = 'Prod_test'
, @filegroup = 'FG3'
, @filename = N'I:\FGBackups_FULL_keep.bak',
@with = N'REPLACE'
EXEC master.dbo.xp_restore_database
@database = 'Prod_test',
@read_write_filegroups = 1,
@filename = 'I:\SQLbackups\FGBackups_PROD.litespeed.f0.bkp' ,
@with = N'REPLACE'
EXEC master.dbo.xp_restore_database
@database = 'Prod_test'
, @filegroup = 'FG3'
, @filename = N'I:\FGBackups_FULL.bak',
@with = N'REPLACE'
@database = 'FGBackups_PROD' ,
@read_write_filegroups = 1,
@WITH = 'PARTIAL' ,
@filename = N'I:\FGBackups_FULL.bkp',
@with = N'REPLACE',
@with = N'NORECOVERY'
@database = 'FGBackups_PROD' ,
@read_write_filegroups = 1,
@filename = N'I:\FGBackups_FULL_diff.bkp',
Tip: To restore the read only file group FG3 and bring it online after the partial restore above is completed, a full
backup containing the file group must be used for the restore.
EXEC.master.dbo.xp_restore_database
@database = 'FGBackups_PROD'
, @filegroup = 'FG3'
, @filename = N'I:\FGBackups_FULL_keep.bak',
@with = N'REPLACE'
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@DisconnectUsers
Disconnect users on executing restore (in standby mode only). This argument accepts one of the
following values:
@encryptionkey
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'
@file
Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of
this argument.
@filename
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.
@filenumber
Disk restores:
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.
Tape restores:
Identifies the backup set to be restored. For example, a file number of 1 indicates the first backup set on the
backup medium, and a file number of 2 indicates the second backup set.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@Page
The @Page argument allows you to restore one or more damaged pages without the need to restore the whole
database. Restoring and recovering a few individual pages might be faster than a file restore by reducing the
amount of data that is offline during a restore operation. However, if you have to restore more than a few pages
in a file, it may be more efficient to restore the whole file. For example, if lots of pages on a device indicate a
pending device failure, consider restoring the file, possibly to another location, and repairing the device. Please
refer to the Microsoft SQL Server documentation on Restore Pages for additional information and guidelines on
page restores.
@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.
@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
@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.
@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.
@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.
@read_write_filegroup
Specifies a partial backup, which includes all the read/write files in a database: the primary filegroup, any
read/write secondary filegroups, and any specified read-only files or filegroups. If the database is read-only,
@read_write_filegroups includes only the primary filegroup.
@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:
l 0—False (default)
l 1—True
@restoreasreadonly
Instructs the restore operation to leave the database in read-only mode. This argument accepts one of the
following values:
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:
l When using an NTFS-compressed folder for a database, it can only be restored as read-only.
l You can only use this feature on Windows NTFS file systems.
@returndetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@rewind
Applies only to backing up and restoring tape. This argument accepts one of the following values:
@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 on page 124.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
KEEP_ Instructs the restore operation to keep the replication settings when restoring a published
REPLICATION database to a server other than that on which it was created (used when setting up
replication with log shipping). You cannot specify this parameter with NORECOVERY.
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either the
NORECOVERY or STANDBY option must be specified if another transaction log has to be
applied. If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final xp_
restore_log statement when restoring a database backup and multiple transaction logs
using LiteSpeed, or when multiple xp_restore_database or xp_restore_log statements are
needed (for example, a full database backup followed by a differential database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the database to
remain in the restoring state after the restore operation. This is useful in either of these
situations:
l a restore script is being run and the log is always being applied.
l a sequence of file restores is used and the database is not intended to be usable
between two of the restore operations.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the recovery
process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database from
differential) are planned, NORECOVERY or STANDBY should be specified instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the default.
When restoring backup sets from an earlier version of SQL Server, a database upgrade
may be required. This upgrade is performed automatically when WITH RECOVERY is
specified.
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.
When the this option is not specified, LiteSpeed performs a check to ensure that the
database is not restored to the current server if:
l the database name is different from the database name recorded in the LiteSpeed
backup set.
LiteSpeed will overwrite an existing file which cannot be verified as belonging to the
database being restored. Normally, LiteSpeed will refuse to overwrite pre-existing files.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving a
USER usable database, this restricts access for the restored database to members of the db_
owner, dbcreator, or sysadmin roles.
NOTE: If free disk space is exhausted on the drive containing the specified undo file name,
the LiteSpeed restore operation stops.
STATS Displays a message each time a percentage of the activity completes. The default is 10%.
Examples
Standard Database Restore
EXEC master.dbo.xp_restore_database
@database = 'MyDB'
, @filename= 'C:\MSSQL\Backup\MyDB_Backup.BAK'
Restore Files
exec master.dbo.xp_restore_database
@database = 'MyDB'
, @filename = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\MyDB_
200909111303_file.bak'
, @filenumber = 1
, @file = 'file1'
, @file = 'file2'
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_filelistonly
Returns a result set with a list of the database and log files contained in a LiteSpeed backup set.
[, @filenumber = n]
xp_restore_filelistonly (TSM)
EXEC master.dbo.xp_restore_filelistonly
, @tsmconfigfile = 'TSM_configuration_file'
[, @filenumber = n]
[, @tsmclientnode = 'TSM_client_node']
[, @tsmclientownerpwd = 'TSM_client_owner_password']
[, @tsmpointintime = 'date_time' ]
xp_restore_filelistonly (Tape)
EXEC master.dbo.xp_restore_filelistonly
@filename = 'tape_device_name'
[, @filenumber = n]
@filename = N'test/test/test.bkp',
@filenumber = 1,
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'california',
@CloudAccessKey = N'***********',
@CloudSecretKey = N'****************',
@UseSSL = 1
@filename = N'test\test.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'*****',
@CloudSecretKeyEnc = N'******',
@CloudBucketName = N'test',@UseSSL = 1
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@filename
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.
@filenumber
Disk restores:
@JobP
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@Logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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.
@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.
@ProxyPassword
The @ProxyPassword argument is optional and specifies the proxy server password credential.
@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.
@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.
@TSMArchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
l 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.
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.
@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.
@Unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Results
Column Name Data Type Description for backup sets
LogicalName nvarchar(4000) Logical name of the SQL Server data or log device.
PhysicalName nvarchar(4000) Full path of the SQL Server data or log device.
l D—Data file
l L—Log file
l S—Filestream file
FileGroupName nvarchar(4000) Name of the filegroup the device files belong to.
BackupSizeInBytes nvarchar(4000) Size (in bytes) of the backup for the device file.
FileGroupId nvarchar(4000) Identifier of the filegroup the device files belong to.
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_headeronly
Retrieves the backup header information for all LiteSpeed backups. The header information is sent as a row by
the server for each backup on a given backup device in a table.
Tip: To retrieve information from TSM backups, also use xp_view_tsmcontents.
xp_restore_headeronly (Tape)
EXEC master.dbo.xp_restore_headeronly
@filename = 'tape_device_name'
[, @filenumber = n]
[, @headerdetails = 'option']
[, @attachedfiles = 0 | 1 | 2 | 3 ]
xp_restore_headeronly (TSM)
EXEC master.dbo.xp_restore_headeronly
@tsmobject = 'TSM_object'
, @tsmconfigfile = 'TSM_configuration_file'
[, @tsmclientnode = 'clientnode_name']
[, @tsmclientownerpwd = '****']
[, @tsmarchive = 0 | 1 ]
[, @tsmpointintime = 'date_time']
[, @attachedfiles = 0 | 1 | 2 | 3 ]
[, @headerdetails = 'option']
@filename = N'test\test.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'*******',
@CloudSecretKeyEnc = N'******',
@CloudBucketName = N'test',
@UseSSL = 1,
@logging = 0
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@attachedfiles
Lists files attached to a backup. This argument accepts one of the following values:
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@filename
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.
@filenumber
Disk restores:
@HeaderDetails
This argument accepts one of the following values:
@JobP
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@Logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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.
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.
@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.
@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.
@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.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@tsmconfigfile
Specifies the TSM configuration file.
@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.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@Unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Examples
1. Display backup set information and attached files:
exec master.dbo.xp_restore_headeronly
@filename = N'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Backup\FASTCOMP_full2.bak'
, @attachedfiles = 2
exec master.dbo.xp_restore_headeronly
@tsmclientnode = N'10.1.26.177',
@tsmclientownerpwd = N'Quest2013',
@tsmconfigfile = N'D:\dsm.opt'
, @tsmobject = N'test\test\model'
, @attachedfiles = 1
exec master.dbo.xp_restore_headeronly
@CloudVendor = N'AmazonS3'
, @FileName = N'AA_3_1.bak'
, @CloudBucketName = N'aabucket7'
, @CloudAccessKey = N'***' -- my key
, @CloudSecretKey = ***' -- my key
, @CloudRegionName = N'us-west-2' -- us-east-1, us-west-2, us-west-1, eu-west-1,
ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1
(this is an optional parameter. Region for selected @CloudBucketName will be
used.)
, @ProxyHost = N'proxy.sitelocal'
, @ProxyPort = 8080
, @ProxyLogin = N'DOMAIN\xyz-tst-MYTester'
, @ProxyPassword = N'***'
Results
xp_restore_headeronly displays the following information:
l 1—Database
l 2—Transaction Log
l 4—File
l 5—Differential Database
l 6—Differential File
l 7—Partial
l 8—Partial Differential
l 0—not encrypted
l 1—encrypted
IsCopyOnly nvarchar(128) Indicates if the backup is a
copy-only backup.
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_log
Restores LiteSpeed transaction log backups taken using the xp_backup_log command. Files and filegroups
may also be restored either from a file or filegroup LiteSpeed backup operation, or from a full database backup
operation using xp_backup_log. When restoring files or filegroups, you must apply a transaction log using xp_
restore_log. In addition, file differential backups can be restored after a full file restore using LiteSpeed.
NOTES:
l A database cannot be restored unless the restore process has exclusive access to the database. No
user connections can exist when performing a database restore.
l You cannot restore filegroups to a point in time.
@database = 'database_name'
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @returndetails = 0 | 1 ]
[, @restoreasreadonly = 0 | 1]
[, @restoreascompressed = 0 | 1]
xp_restore_log (TSM)
EXEC master.dbo.xp_restore_log
@database = 'database_name'
, @tsmconfigfile = 'TSM_configuration_file'
[, @filenumber = n]
[, @logging = 0 | 1 | 2 ]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @tsmclientnode = 'TSM_client_node']
[, @tsmclientownerpwd = 'TSM_client_owner_password']
[, @tsmpointintime = 'date_time' ]
[, @returndetails = 0 | 1 ]
[, @restoreasreadonly = 0 | 1]
[, @restoreascompressed = 0 | 1]
xp_restore_log (Tape)
EXEC master.dbo.xp_restore_log
@database = 'database_name'
, @filename = 'tape_device_name'
[, @rewind = 0 | 1 ]
[, @unload = 0 | 1 ]
[, @encryptionkey = 'encryption_key']
[, @filenumber = n]
[, @with = 'additional_with_parameters'] [,...n]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @attachedfile = 'pathname'] [,..n]
[, @returndetails = 0 | 1 ]
@filename = N'test\tlogl.bak',
@filenumber = 1,
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'california',
@CloudSecretKey = N'**********',
@UseSSL = 1,
@with = N'RECOVERY',
@affinity = 0,
@logging = 0
@filename = N'test\testlog.bak',
@filenumber = 1,
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'*****',
@CloudSecretKeyEnc = N'******',
@UseSSL = 1,
@affinity = 0,@logging = 0
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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.
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@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:
l The original entire directory path need not be supplied (e.g. c: to c:\testadSattsm is allowed).
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@DisconnectUsers
Disconnect users on executing restore (in standby mode only). This argument accepts one of the
following values:
@encryptionkey
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.
@filename
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.
@filenumber
Disk restores:
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.
Tape restores:
Identifies the backup set to be restored. For example, a file number of 1 indicates the first backup set on the
backup medium, and a file number of 2 indicates the second backup set.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
@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).
@Page
The @Page argument allows you to restore one or more damaged pages without the need to restore the whole
database. Restoring and recovering a few individual pages might be faster than a file restore by reducing the
amount of data that is offline during a restore operation. However, if you have to restore more than a few pages
in a file, it may be more efficient to restore the whole file. For example, if lots of pages on a device indicate a
pending device failure, consider restoring the file, possibly to another location, and repairing the device. Please
refer to the Microsoft SQL Server documentation on Restore Pages for additional information and guidelines on
page restores.
@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:
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
@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.
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.
@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.
@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.
@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.
@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:
l 0—False (default)
l 1—True
@restoreasreadonly
Instructs the restore operation to leave the database in read-only mode. This argument accepts one of the
following values:
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:
l When using an NTFS-compressed folder for a database, it can only be restored as read-only.
l You can only use this feature on Windows NTFS file systems.
@returndetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@rewind
Applies only to backing up and restoring tape. This argument accepts one of the following values:
@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 on page 124.
@TSMArchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
NORECOVERY Instructs the restore operation to not roll back any uncommitted transactions. Either
the NORECOVERY or STANDBY option must be specified if another transaction log
has to be applied. If NORECOVERY, RECOVERY, or STANDBY is not specified,
RECOVERY is the default.
SQL Server requires that the WITH NORECOVERY option is used on all but the final
xp_restore_log statement when restoring a database backup and multiple transaction
logs using LiteSpeed, or when multiple xp_restore_database or xp_restore_log
statements are needed (for example, a full database backup followed by a differential
database backup).
NOTE: When specifying the NORECOVERY option, the database is not usable in this
intermediate, non-recovered state.
When used with a file or filegroup restore operation, NORECOVERY forces the
database to remain in the restoring state after the restore operation. This is useful in
either of these situations:
l a restore script is being run and the log is always being applied.
RECOVERY Instructs the restore operation to roll back any uncommitted transactions. After the
recovery process, the database is ready for use.
If subsequent LiteSpeed restore operations (xp_restore_log or xp_restore_database
from differential) are planned, NORECOVERY or STANDBY should be specified
instead.
If NORECOVERY, RECOVERY, or STANDBY is not specified, RECOVERY is the
default.
When restoring backup sets from an earlier version of SQL Server, a database
upgrade may be required. This upgrade is performed automatically when WITH
RECOVERY is specified.
RESTRICTED_ When used in conjunction with recovery (another with param and the default) leaving
USER a usable database, this restricts access for the restored database to members of the
db_owner, dbcreator, or sysadmin roles.
Specifies the undo file name so the recovery effects can be undone. The size required
for the undo file depends on the volume of undo actions resulting from uncommitted
transactions. If you do not specify NORECOVERY, RECOVERY, or STANDBY,
LiteSpeed defaults to RECOVERY.
STANDBY allows a database to be brought up for read-only access between
transaction log restores and can be used with either warm standby server situations or
special recovery situations in which it is useful to inspect the database between log
restores.
If the specified undo file name does not exist, LiteSpeed creates it. If the file does
exist, LiteSpeed overwrites it.
The same undo file can be used for consecutive LiteSpeed restores of the same
database.
NOTE: If free disk space is exhausted on the drive containing the specified undo file
name, the LiteSpeed restore operation stops.
EXEC master.dbo.xp_restore_log
@database='MyDB'
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
, @with ='RECOVERY'
, @with = 'STOPBEFOREMARK= ''LogMark'''
EXEC master.dbo.xp_restore_log
@database='MyDB'
, @filename = 'C:\MSSQL\Backup\MyDB_Backup.BAK'
, @with = 'RECOVERY'
, @with = 'STOPAT = ''2003-03-19 11:10:57.000'''
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_restore_setinfo
Returns information about the stripe set to which the backup file belongs.
xp_restore_setinfo (TSM)
EXEC master.dbo.xp_restore_setinfo
@tsmobject = 'TSM_object'
, @tsmconfigfile = 'TSM_configuration_file'
[, @tsmclientnode = 'clientnode_name']
[, @tsmclientownerpwd = '****']
[, @tsmarchive = 0 | 1 ]
[, @tsmpointintime = 'date_time']
@CloudVendor = 'AmazonS3',
@CloudAccessKeyEnc = 'accesskeyenc',
@CloudSercretKeyEnc = 'secretkeyenc'
@filename = N'tst\test.bak',
@CloudVendor = N'AzureBlob',
@CloudBucketName = N'test',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'********'
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@filename
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.
@filenumber
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.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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.
@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.
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.
@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.
@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.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@tsmconfigfile
Specifies the TSM configuration file.
@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.
@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.
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
Example
EXEC master.dbo.xp_restore_setinfo
@filename = 'C:\SQLServerBackups\CD3.bak'
Results
Column Name Data Type Description
Returns
0 (success) or non-zero (failure).
xp_restore_verifyonly
Verifies the backup, but does not restore the backup. It checks to see that the backup set is complete and that
all volumes are readable. If the backup is valid, LiteSpeed returns the message from SQL Server: "The backup
set is valid."
Syntax
xp_restore_verifyonly (Disk or TSM)
EXEC master.dbo.xp_restore_verifyonly
@filename = 'backup_file_name' [,...n]
[, @filenumber = n]
[, @encryptionkey = 'encryption_key'| @jobp = 'encrypted_key' ) ]
[, @logging = 0 | 1 | 2 ]
[, @affinity = 0..2147483648]
[, @throttle = 1..100]
[, @ioflag = 'DISK_RETRY_COUNT=n']
[, @ioflag = 'DISK_RETRY_WAIT=n']
[, @buffercount = 'buffer_count']
[, @maxtransfersize = 'maximum_transfer_size']
[, @tsmclientnode = 'TSM_client_node']
[, @tsmclientownerpwd = 'TSM_client_owner_password']
[, @tsmobject = 'TSM_object']
[, @tsmconfigfile = 'TSM_configuration_file']
[, @tsmarchive = 1 | 0 ]
[, @tsmpointintime = 'date_time']
[, @returndetails = 0 | 1]
@filename = N'test\tlogl.bak',
@filenumber = 1,
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'california',
@CloudAccessKey = N'************',
@CloudSecretKey = N'**********',
@UseSSL = 1,
@with = N'RECOVERY',
@affinity = 0,
@logging = 0
@filename = N'test\test.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'*******',
@CloudSecretKeyEnc = N'******',
@CloudBucketName = N'test',
@with = N'RECOVERY',
@affinity = 0,
@logging = 0
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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:
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@AWSAccessKeyEnc
The @AWSAccessKeyEnc argument specifies the name of the encrypted unique Amazon Web Service
alphanumeric access key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
2, ap-northeast-1, and sa-east-1.
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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-
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@encryptionkey
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'
@filename
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.
@filenumber
Disk restores:
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.
Tape restores:
Identifies the backup set to be restored. For example, a file number of 1 indicates the first backup set on the
backup medium, and a file number of 2 indicates the second backup set.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
NOTE: This functionality is only available for disk and cloud operations.
For example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@jobp
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@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
@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.
@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.
@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.
@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.
@returndetails
Generates a single-row result set.
l 0—False (default)
l 1—True
MaxTransferSize int 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) .
BaseSize int The smallest chunk of memory LiteSpeed attempts to write to disk at any
given time.
BufferCount smallint The number of SQL Server buffers available for a LiteSpeed operation.
StripeCount smallint Number of backup files in the stripe set.
OverlappedBuffers tinyint The number of buffers that any single VDI thread can use at a time.
CPUSeconds numeric Processor time used by the LiteSpeed operation.
(18, 3)
ElapsedSeconds numeric Duration of the operation.
(18, 3)
Tip: In Toad, you can use Group Execute to produce a single result set for several server instances.
@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 on page 124.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmobject
Defines the TSM filespace, high level and low level. This argument accepts the following format:
tsm_filespace\tsm_high_level\tsm_low_level
where:
l 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.
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.
@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.
@unload
Applies to tape backups and restores. This argument accepts one of the following values:
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
Example
EXEC master.dbo.xp_restore_verifyonly
@filename='C:\MSSQL\Backup\MyDB_Backup.BAK'
Returns
0 (success) or non-zero (failure). Return codes represent the native error number returned from SQL Server for
any errors encountered during the operation.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_sls_cloud_browse
The xp_sls_cloud_browse command returns a list of objects located on the specified cloud storage path.
Syntax
exec master.dbo.xp_sls_cloud_browse
[@CloudVendor = N'AmazonS3']
[, @CloudAccessKey = N'***']
[, @CloudSecretKey = N'***]
[, @CloudBucketName = N'aabucket6']
[, @CloudFolderName = N'f1']
[, @CloudMaxItems = 2]
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@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, Azure Account Name, Google e-mail
styled account.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@CloudFolderName
The @CloudFolderName argument specifies the name of the folder for searching in cloud browse. It is a filter for
output files.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@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:
@CloudMaxItems
The @CloudMaxItems argument specifies the number of rows to return from the cloud.
Note: The @CloudMaxItems argument can be very useful on large tables with thousands of records.
Returning a large number of records can impact cloud performance.
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@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.
@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.
@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.
@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.
@ProxyPort
The @ProxyPort argument is optional and contains the port number of the proxy server. The TCP/IP port values
can be 1-65535.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
Examples
exec master.dbo.xp_sls_cloud_browse
@CloudAccessKey = N'***' -- my key
, @CloudSecretKey = N'***' -- my key
, @CloudBucketName = N'aabucket1'
, @CloudFolderName = N'f1' -- f1/f2 – for subfolders
, @CloudMaxItems = 2-- number of returning rows. Works like TOP command in SQL.
Returns
A list of objects or error on failure.
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_slsCreateDCR
This stored procedure converts a Native or LiteSpeed backup file to a Double Click Restore backup, a self-
executing and self-extracting backup that can be restored on a server instance that does not have LiteSpeed
installed. It also performs a rename on the file if applicable. Double Click Restore Executables
NOTE: A Double Click Restore can only be created for a disk file.
Agruments
@filename
Specifies the path to the backup.
@doubleclick
Creates a Double Click Restore executable. This argument accepts one of the following values:
l 1—Creates one Double-Click Restore executable file. Note the following warning: The executable may
be greater than 4GB for large databases. Windows Server is unable to run executable files larger than
4GB. However, the file will be convertible/restorable by LiteSpeed file.
l 2—Creates a Double Click Restore loader in the same location. (Default)
For more information, see Double Click Restore Executables on page 121.
Example
exec xp_slscreatedcr
@FileName = N'I:\test\test.bak'
Returns
0 (success) or non-zero (failure).
xp_slsFastCompression
xp_slsFastCompression (previously known as xp_slsSmartDiff) performs a full, partial, or differential database
backup using Fast Compression technology. Fast Compression
EXEC master.dbo.xp_slsFastCompression
@database = N'FGBackups_PROD'
, @BackupDirectory = 'I:\SQLbackups'
, @ExtentsChgRatioRequireFull = '.4',
@ForceFull = 1,
@read_write_filegroups = 1
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@AdaptiveCompression
Automatically selects the optimal compression level based on CPU usage or Disk IO. For more information, see
Compression Methods on page 123.
You can tell Adaptive Compression to optimize backups either for size or for speed. This argument accepts one
of the following values:
l Size
l Speed
@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.
0 0 All (default)
1 1 1
3 11 1 and 2
7 111 1, 2 and 3
38 100110 2, 3, and 6
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 on page 124.
@AlterDir
Specifies the directory where to search for the backup file.
Note: @AlterDIr replaced @SearchAlternateBackupDirectory in LiteSpeed 8.6. Support for the old
@SearchAlternateBackupDirectory parameter will be gradually phased out.
@AppendDifferential
Appends data to an existing full backup file.This argument accepts one of the following values:
l 0—False (default)
l 1—True
@attachedfile
l 0—False (default)
l 1—True
@AWSAccessKey
The @AWSAccessKey argument specifies the name of the unique Amazon Web Service alphanumeric access
key that identifies each user.
@AWSBucketName
The @AWSBucketName argument specifies the name of the container for AWS objects. Bucket names must be
at least 3 and no more than 63 characters long.
@AWSMaxParts
Is the number of parts that are simultaneously uploaded to Amazon S3. The LiteSpeed default is 3 parts. The
number of parts can be up to 5 if there is enough memory available during the upload. If you override this
parameter, you may impact memory usage.
@AWSPartSize
The size of each part that is uploaded to Amazon S3 (in MB). The LiteSpeed default for Part Size is calculated
as a database size divided into 9,000. The default Part Size = 25MB.
Notes:
l Amazon S3 has a maximum allowable 10,000 parts per file. If you override this parameter, you may
inadvertently go over the 10,000 limit.
l Minimum and maximum values for Part Size are defined by Amazon S3: 5MB and 5120MB (5GB)
relatively.
l The maximum object size is 5TB.
@AWSRegionName
The @AWSRegionName argument specifies the name of the Amazon Web Service region to use for a bucket.
Example values are but not limited to: us-east-1, us-west-2, us-west-1, eu-west-1, ap-southeast-1, ap-southeast-
@AWSSecretKey
The @AWSSecretKey argument specifies the name of the Amazon Web Service secret key that is assigned
when you initially get an AWS account.
@AWSSecretKeyEnc
The @AWSSecretKeyEnc argument specifies the name of the encrypted Amazon Web Service secret key that is
assigned when you initially get an AWS account.
@AWSUseGovCloud
The @AWSUseGovCloud argument enables a special restricted region for the US Government use in Amazon
S3. This argument accepts one of the following values:
@AWSUseReducedRedundancy
The @AWSUseReducedRedundancy argument specifies the use of reduced redundancy storage in Amazon
S3. This argument accepts one of the following values:
@AWSUseServerSideEncryption
The @AWSUseServerSideEncryption argument enables the encryption of data stored at rest in Amazon S3.
This argument accepts one of the following values:
@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.
@BackupDirectory
Specifies a directory for the backup file.
@backupname
Specifies the name of the backup set.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@buffercount
Specifies the number of SQL Server buffers available for a LiteSpeed operation. The default value is set
by SQL Server.
@CheckForFullBackup
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. Accepts the
following values:
l 0—False (default)
l 1—True
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@CloudParallelUpload
The @CloudParallelUpload argument, parallel parts transfers, is used to create fast uploads to the Azure Cloud
or Amazon S3. The default number of parallel uploads:
l Amazon S3 = 3
l Azure Blob = 20
@CloudPartSize
The @CloudPartSize argument determines the size of each part that is uploaded to the cloud. The
default part size:
l Amazon S3 = 25MB
l Azure Blob = 4MB
notes:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudStorageClass
The @CloudStorageClass argument specifies a range of storage classes established for different use
cases including:
For Amazon S3:
Important: : In versions less than 8.5 you should use --AWSStorageClass. The @AWSStorageClass
argument is no longer valid in subsequent LiteSpeed versions after 8.5.
l Multi_regional - for frequently accessed data around the world as per serving website content, streaming
videos, or gaming and mobile applications.
l Regional - for frequently accessed data in the same region as your Google Cloud DataProc or the
Google Compute Engine instances that use it, as per data analytics.
l Nearline - for infrequently accessed data (data you expect to access no more than once per month).
l Coldline - for infrequently accessed data (data you expect to access no more than once per year).
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@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 on page 83.
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.
@cryptlevel
Works in conjunction with the @encryptionkey parameter.
Specify the encryption level. Higher levels improve security, but they require more CPU and take longer. Test
Optimal Backup Settings on analyzing the best backup settings for your environment.
This argument accepts one of the following values:
l 0—40-bit RC2
l 9—MS_AES_128
l 10—MS_AES_192
l 11—MS_AES_256
@database
Name of database to be backed up or restored.
This parameter specifies a database:
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@desc
Specifies a description to store with the backup.
This argument accepts variables. For more information, see LiteSpeed Variables on page 127.
@DiffToFullRatioRequireFull
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:
l '.4'
l '40%'
@DryRun
Shows backups that are candidates for restore at this time, but does not restore them. This argument accepts
one of the following values:
l 0—False (default)
l 1—True
@ElapsedDaysRequireFull
Specifies the minimum number of days since last full backup required to perform full backup. The default
value is 14.
@encryptionkey
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'
@ExtentsChgRatioRequireFull
Specifies the minimum amount of database changes required for the full backup.
This argument accepts one of the following formats:
l '.4'
l '40%'
@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:
l yyyy-mm-dd
l yyyy-mm-dd hh:mm:ss
@FastCompressionExtension
Specifies the fast compression file extension. This argument accepts one of the following formats:
@file
Specifies a logical database file used for file or filegroup backups. You can supply multiple instances of
this argument.
@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.
@ForceDifferential
Forces differential backup. It accepts the following values:
l 0—False (default)
l 1—True
@ForceFull
Forces full backup. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@Format
Initializes the media on the device. This argument only applies to tape backups. This argument accepts one of
the following values:
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.
@FullBackupEscalation
This option causes LiteSpeed to issue a full backup, if one of the following problems is discovered in the current
backup set:
l 0—False (default)
l 1—True
@GSProject
DEPRECATED LiteSpeed 8.8: Was used to store for the Google Cloud Storage project ID; the project ID is now
obtained from login. This parameter is retained for compatibility with old backup/restore scripts.
@ioflag
Specifies if LiteSpeed should wait and retry the read or write operation on failure. You can define retry options
using the following parameters:
l 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.
l 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 example, to specify a database backup where each failure can be retried once after a 30-second wait:
EXEC master.dbo.xp_backup_database
@filename='c:\test.bkp'
, @database='test'
, @ioflag='DISK_RETRY_COUNT=1'
, @ioflag='DISK_RETRY_WAIT=30'
Network Resilience
@JobP
Specifies an encrypted key. (Similar to @EncryptionKey).
You can use xp_encrypt_backup_key to convert the password (encryption_key) for use with @jobp. The original
password (or encrypted key generated by xp_encrypt_restore_key) must be used to restore a backup.
@logging
Writes a log file for the operation. This argument accepts one of the following values:
l 0—Logging off.
@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).
@MirrorDirectory
Specifies a directory for a mirror backup. You can supply multiple instances of this argument.
@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:
@olrmap
Generates a map file during a backup for Object Level Recovery. This argument accepts one of the
following values:
l 0—False (default)
l 1—True
@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:
l -1—Below Normal
l 0—Normal (Default)
l 1—AboveNormal
l 2—High
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.
@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.
@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.
@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.
@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.
@read_write_filegroups
Specifies a partial backup, which includes all the read/write files in a database: the primary filegroup, any
read/write secondary filegroups, and any specified read-only files or filegroups. If the database is read-only,
@read_write_filegroups includes only the primary filegroup.
@SpecificDaysForbidFull
Specifies days of the week when a full backup is never performed. It accepts the following formats:
l 3—on Tuesday
l 'tu'—on Tuesday
l '5-7'—from Thursday to Saturday
l 'm, w, su'—on Monday, Wednesday, and Sunday
@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
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 on page 124.
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
@tsmdevicetimeoutminutes
Specifies how long to wait for a TSM device.
@tsmdsmi_dir
DSMI_DIR path if needed.
@tsmdsmi_log
DSMI_LOG path.
@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.
@tsmlogname
Log name.
@tsmmanagementclass
Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.
@tsmpassword
The TSM username password. Passwords are case-sensitive.
@tsmusername
The TSM username ID.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@Verify
Performs a restore verification on the backup file just created (if backup was successful). This argument accepts
one of the following values:
@with
Each @with argument should be a syntactically complete and correct statement. Please refer to the SQL Server
Transact-SQL backup and restore documentation for the syntax and usage.
The supported formats are:
l @with='PARAMETER'
l @with='PARAMETER=''accepted_value'''
NOTES:
l Extended stored procedure arguments are limited to 255 characters. If you need more than 255
characters, use multiple @with arguments.
l Do not supply the @with parameter if no additional features are required.
Parameter Description
CONTINUE_ Causes the backup be executed despite encountering an invalid backup checksum.
AFTER_
ERROR
Examples
Full backup change of 40%
Back up the Northwind database. Perform full backup only if the amount of database changes since the last full
backup is more than 40%.
EXEC master.dbo.xp_slsFastCompression
@database = 'Northwind'
EXEC master.dbo.xp_slsFastCompression
@database = 'Northwind'
, @BackupDirectory = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup'
, @MirrorDirectory = 'D:\SQLServerBackups'
, @ElapsedDaysRequireFull = 10
EXEC master.dbo.xp_slsFastCompression
@database = 'Northwind'
, @ForceFull = 1
exec master.dbo.xp_slsFastCompression
@database = N'userdb3',
@AdaptiveCompression = 'Speed',
@ExtentsChgRatioRequireFull = N'40%',
@tsmfilespace = N'FC',
@tsmclientnode = N'w2k3_TSM',
@tsmclientownerpwd = N'***',
@tsmmanagementclass = N'STANDARD',
@tsmdevicetimeoutminutes = 2,
exec master.dbo.xp_slsFastCompression
@database = N'A1',
@compressionlevel = 2,
@comment = N'',
@AppendDifferential = 0,
@CheckForFullBackup = 1,
@ExtentsChgRatioRequireFull = N'35%',
@BackupDirectory = N'D:\Backups',
@FullBackupEscalation = 1,
@ElapsedDaysRequireFull = 14,
@FastCompressionExtension = ‘bkp’
@database = N'newtest',
@compressionlevel = 7,
@comment = N'',
@ExtentsChgRatioRequireFull = N'35%',
@BackupDirectory = N'test',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'**************',
@CloudSecretKeyEnc = N'***************',
@CloudBucketName = N'test',
@UseSSL = 1,
@FullBackupEscalation = 1,
@ElapsedDaysRequireFull = 14
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_slsreadprogress
Reads the progress of the current activity on a specified database and returns an integer (0-100) indicating the
percentage completed of the current activity on the specified database.
Syntax
EXEC master.dbo.xp_slsreadprogress
@database = 'database_name'
Examples
1. Read the progress of the current activity at a specified database:
xp_slsSmartCleanup
Removes full and differential backup files and transaction log backups based on a user-defined period (either
the file age or the date).
The backup retention will never delete:
l 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.
l The full backup, if there are associated differential or t-log backups in the backup set that are not eligible
for cleanup.
l File/FileGroup backups
l File/FileGroup differential backups
l Partial backups
l Partial differential backups
l Files that have the filesystem archive bit set (if that option is selected)
Syntax
exec master.dbo.xp_slsSmartCleanup
@database = 'database_name'
, (@BackupRetainDays = 1...365 | @BackupExpiration = 'date_time')
, (@LogRetainDays = 1...365 | @LogExpiration = 'date_time')
[, @KeepArchiveFiles = 0 | 1 ]
[, @CopyOnlyBackups = 'option'] [, @Locations = N'C:\Backups',]
[, @DryRun = 0 | 1 ]
[, @TSMClientNode = 'TSM_client_node']
[, @TSMUserName = 'TSM_username_ID']
[, @TSMPassword = 'TSM_username_password']
[, @TSMConfigFile = 'TSM_configuration_file']
[, @TSMClientOwnerPwd = 'TSM_client_owner_password']
[, @TSMDSMI_DIR = 'path']
[, @TSMDSMI_LOG = 'path']
[, @TSMLogName = 'log_name']
xp_slsSmartCleanup (Azure)
exec master.dbo.xp_slsSmartCleanup
@database = N'test',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'******',
@CloudSecretKeyEnc = N'*****',
@CloudBucketName = N'test',
@UseSSL = 1,
@BackupRetainDays = 28,
@LogRetainDays = 7
xp_slsSmartCleanup (Disk)
exec master.dbo.xp_slsSmartCleanup
@database = N'DatabaseName',
@BackupRetain = 28,
@BackupRetainUnits = N''day'',
@LogRetain = 7,
@LogRetainUnits = N''day'',
@Locations = N'C:\Backups',
@KeepArchiveFiles = 1
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@BackupExpiration
Specifies the date using one of the following formats:
YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
where
l YYYY—4-digit year
l MM—2-digit month
l DD—2-digit day of the month
l HH—2-digit hour using the local 24-hour clock
l MM—2-digit minute
l SS—2-digit second
To be eligible for cleanup, the full or differential backup must be older than this date.
@BackupRetain
Specifies the number of units (N). The full or differential backup must be at least N units old before it is eligible
for cleanup.
See BackupRetainUnits for unit types details
Note: Old argument BackupRetainDays is still supported for compatibility reasons.
@BackupRetainUnits
Defines unit type for BackupRetain argument.
Allowed values: hour / day / week / month / year.
@LogExpiration
Specifies the date of one of the following formats:
YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
where
To be eligible for cleanup, the t-log backup must be older than this date.
@LogRetain
Specifies the number of units (N). The t-log backup must be at least N units old before it is eligible for cleanup.
See also LogRetainUnits for unit types details
Note: Old argument @LogRetainDays is still supported for compatibility reasons.
@LogRetainUnits
Defines unit type for LogRetain argument.
Allowed values: hour / day / week / month / year.
Defines unit type for @LogRetain argument.
Allowed values: hour / day / week / month / year.
@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, Azure Account Name, Google e-mail
styled account.
@CloudAccessKeyEnc
The @CloudAccessKeyEnc argument specifies the name of the encrypted unique Cloud Web Service
alphanumeric access key that identifies each user.
@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, Azure Container
Name, Google Bucket Name. Google Bucket Name requirements are described at
https://cloud.google.com/storage/docs/naming.
@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:
@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, sa-east-1,
N'Germany' and N'China'.
@CloudSecretKey
The @CloudSecretKey argument specifies the name of the Cloud Web Service secret key that is assigned when
you initially get a Cloud account.
@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.
@CloudVendor
The @CloudVendor argument specifies the name of the cloud service provider. The argument accepts one of
the following values: "AmazonS3", "AzureBlob" or "GoogleStorage".
@CopyOnlyBackups
Controls how LiteSpeed handles copy-only backups. This argument accepts one of the following values:
NOTES:
l Transaction log backups are not considered dependent on copy-only full or copy-only tlog backups.
l Copy-only transaction log backups will not mark other transaction log or full backups as having
a dependent.
l The values are not case-sensitive.
@database
Name of database to be backed up or restored.
If supplied as a variable (@database), this name can be specified either as a string constant (@database =
database name) or as a variable of character string data type, except for the ntext or text data types.
@Destination
Specifies the destination where to delete files from. Possible values: All, Disk, TSM, Tape, Cloud.
@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.
@GSProject
DEPRECATED LiteSpeed 8.8: Was used to store for the Google Cloud Storage project ID; the project ID is now
obtained from login. This parameter is retained for compatibility with old backup/restore scripts.
@KeepArchiveFiles
Turns on monitoring and refuses to delete files that have the archive filesystem bit set. When enabled
dependent files are not deleted.
@MultiDatabaseType
Produces a cleanup that includes several types of databases. Types can include: all, system, user, or
selected databases.
This argument accepts one of the following values:
@Locations
Defines locations (spread by semicolon symbol) to apply cleanup policy.
@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.
@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.
@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.
@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.
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
You can use the %TSMDEFAULTPATH% variable to make LiteSpeed detect the default TSM configuration file
path automatically (by getting from LiteSpeed defaults as a priority or the registry - HKEY_LOCAL_
MACHINE\SOFTWARE\IBM\ADSM\CurrentVersion\BackupClient)
@tsmdsmi_dir
DSMI_DIR path if needed.
@tsmdsmi_log
DSMI_LOG path.
@tsmlogname
Log name.
@tsmpassword
The TSM username password. Passwords are case-sensitive.
@tsmusername
The TSM username ID.
@UseSSL
The @UseSSL argument specifies that the connection uses SSL security. This argument accepts one of the
following values:
@ReviewAllBackups
Specifies Smart Cleanup behavior for searching backups to delete
1. 0 - Save last deleted backup ID and start check backups from this backup next time (default).
2. 1 - Review all backups from MSDB backups history (takes more time)
Examples
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:
exec master.dbo.xp_slsSmartCleanup
@database = 'test2'
, @BackupRetain = 2 8
, @BackupRetainUnits = N'day'
, @LogRetain = 2
, @LogRetainUnits = N'day'
, @CopyOnlyBackups = 'AllowDeletes'
, @Locations = N'F:\Backups; F:\mirrors'
exec master.dbo.xp_slsSmartCleanup
@database = 'test2'
, @BackupExpiration = '2019-11-15'
exec master.dbo.xp_slsSmartCleanup
@database = N'test_tsm'
, @tsmconfigfile = N'C:\Program Files\Tivoli\TSM\baclient\dsm.opt'
, @tsmclientnode = N'w2k3_TSM2'
, @tsmclientownerpwd = N'*****'
, @LogRetain = 2
4. Delete full, differential and transaction log TSM backups created before 06/15/2019, using the
PASSWORDAccess generate option to connect to the TSM Server:
exec master.dbo.xp_slsSmartCleanup
@database = N'test_tsm'
, @tsmconfigfile = N'C:\Program Files\Tivoli\TSM\baclient\dsm_gp.opt'
, @BackupExpiration = '2019-06-15'
, @LogExpiration = '2019-06-15'
exec master.dbo.xp_slsSmartCleanup
@database = @dbname
, @BackupRetainDays = 2
, @LogRetain
, @LogRetainUnits = N'day'
, @KeepArchiveFiles = 1
, @Locations = N'F:\Backups; F:\mirrors'
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
xp_slssqlmaint
This extended stored procedure executes the slssqlmaint.exe utility. It accepts a string that contains the
command-line arguments to be passed directly to slssqlmaint.exe.
NOTE: You can generate scripts by opening tasks in the LiteSpeed UI Console and clicking View T-SQL. About
Creating Maintenance Plans
Examples
Back up database
exec master.dbo.xp_slssqlmaint N'-D Regex:"LiteSpeed" Regex:"DB1" -BkUpMedia DISK -
DelBkUps 3DAYS -BkUpDB "C:\temp" -CrBkSubDir -BkExt "bak" -Logging 1 -Reliability 1 -
CompressionLevel 1 -Default "%D_%T_%z.%EXT%" -Exclude Offline LogShippng ReadOnly '
Mirror to Disk
execute master.dbo.xp_slssqlmaint N'-D "at1" -BkUpMedia DISK -BkUpDB "c:\backup" -
BkFileName -Logging 0 -CompressionLevel 2 -Mirror "c:\mirror\" -OPTOLR -SmartDiff
14DAYS -DataDelta 35 -SingleFile 0 -BackupEsc -Exclude Offline LogShippng
IgnoreReplica Secondary ReadOnly '
Mirror to Cloud
execute master.dbo.xp_slssqlmaint N'-D "TestDatabase" -BkUpMedia DISK -BkUpDB
"c:\backup\%SERVER%_%D_%T_%z.bak" -BkFileName -Logging 0 -CompressionLevel 2 -Mirror
"c:\mirror\" "
{""cloud"":""AmazonS3"",""accessKey"":""lkjflkjsldjiofsjrdfftgrux5j+OwkI"",""secretKey
"":""’plkljhlkwjnuildiIujUhjkHkldkflkdfe"",""container"":""irelandaatest"",""authType"
":""AccessAndSecretKeys"",""region"":""us-east-
1"",""storageClass"":""0"",""useSSE"":""False"",""useSSL"":""True"",""isGovCloud"":""F
alse"",""useAcceleration"":""False"",""useAutoStriping"":""True"",""autoStripSize"":""
0"",""paths"":[""test/""]}" -OPTOLR -Exclude Offline LogShippng IgnoreReplica
Secondary ReadOnly '
Syntax
EXEC master.dbo.xp_sqllitespeed_licenseinfo
[ @licensekey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-111-22222-YY'
[, @sitemessage = 'Site_Message' ]
[, @ShowLicenseNumber = 1 ]
[, @store = 1]
| @remove = 1]
Arguments
@licensekey Passes license key value.
@sitemessage Passes license site message. Applicable to upgrades from a LiteSpeed 8.5 or
earlier installation.
@ShowLicenseNumber Show the Customer License Number. The Customer License Number is part of the
=1 license key and is required to access support.
@store = 1 Overwrites any currently stored licenses with the valid license supplied.
Examples
1. View information about the supplied license key:
EXEC master.dbo.xp_sqllitespeed_licenseinfo
@licensekey = 'C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34'
EXEC master.dbo.xp_sqllitespeed_licenseinfo
@licensekey = 'C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34'
, @store=1
EXEC master.dbo.xp_sqllitespeed_licenseinfo
@remove= 1
EXEC master.dbo.xp_sqllitespeed_licenseinfo
@licensekey = 'C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34'
, @sitemessage = 'Trial Version'
EXEC master.dbo.xp_sqllitespeed_licenseinfo
@licensekey = 'C20TM3Q3K2HD74UDLBMHC6KYV6HZ3MQFNXZFB-123-45678-34'
, @sitemessage = 'Trial Version'
, @store=1
6. Show the Customer License Number. The Customer License Number is part of the license key and is
required to access support.
Result Set
Column Name Data Type Description
Site License bit Whether the key is a Site license key that is used company-wide.
Gigabyte Limit int Database size limit in GB. If there is a gigabyte limit set in the
license (any value larger than 0), LiteSpeed will fail any backup of
databases larger than the limit. 0 indicates unlimited database
size.
Trial Length int Number of trial days. The default value is 15.
NOTE: Some types of trials may have 0, if the expiration date is
fixed and not based on the install date.
exec master.dbo.xp_sqllitespeed_version
Result Set
Name Value
xp_view_tsmcontents
Retrieves TSM specific information and backup header information for the given LiteSpeed backup.
Arguments
Tips:
l To see the list of accepted arguments and data types for arguments, execute the following:
exec master.dbo.<procedure_name> show_help
l To convert the script for use with the command-line utilities, execute the following:
exec master.dbo.<procedure_name> show_cmd, <xp_arguments>
@desc
Specifies a description to filter the returned results to those that match the pattern.
NOTE: @desc is only supported if @TSMBriefList=0.
@tsmarchive
Specifies to store the backup as a TSM archive. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@tsmbrieflist
Returns a brief list. This argument accepts one of the following values:
NOTE: It is not needed for archives as they are only returned as a brief list.
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
You can use the %TSMDEFAULTPATH% variable to make LiteSpeed detect the default TSM configuration file
path automatically (by getting from LiteSpeed defaults as a priority or the registry - HKEY_LOCAL_
MACHINE\SOFTWARE\IBM\ADSM\CurrentVersion\BackupClient)
@tsmexpdatelower
For TSM archives, it specifies the oldest expiration date and time of where to start the list. The format is yyyy-
mm-dd hh:mm:ss.
@tsmexpdateupper
For TSM archives, it specifies the most recent expiration date and time of where to stop the list. The format is
yyyy-mm-dd hh:mm:ss.
@tsmfilespace
Specifies the space on the TSM server that contains a group of files. It can be the drive label name
or UNC name.
@tsmhighlevel
Specifies the TSM high-level name. If you do not specify this parameter, LiteSpeed will retrieve all high levels
from the TSM server.
NOTES:
@tsminsdatelower
For TSM archives, it specifies the oldest insertion date and time of where to start the list. The format is yyyy-mm-
dd hh:mm:ss.
@tsminsdateupper
For TSM archives, it specifies the most recent insertion date and time of where to stop the list. The format is yyyy-
mm-dd hh:mm:ss.
@tsmlowlevel
Specifies the TSM low-level name. If you do not specify this parameter, LiteSpeed will retrieve all low levels from
the TSM server.
NOTES:
@tsmsortbylowlevel
Sorts the results by the low level name. This argument accepts one of the following values:
l 0—False (default)
l 1—True
@tsmsortbypit
Sorts the results by the point-in-time date. It accepts one of the following:
l 0—False (default)
l 1—True
@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.
Result Set
xp_view_tsmcontents displays the following information:
FileNumber Int Number of the Backup within the LiteSpeed Backup device.
BackupDescription Nvarchar(128) (For archives only) The description (if any) that the user passed in
on the @desc parameter on the original backup.
l 1—Database
l 2—Transaction Log
l 4—File
l 5—Differential Database
l 6—Differential File
l 7—Partial
l 8—Partial Differential
ExpirationDate Datetime (For archives only) The expiration date and time that TSM
assigned the archived object based on the management class
policy of the management class assigned to the archived object.
Position Smallint Position of the backup set in the volume (for use with the FILE =
option).
ServerName Nvarchar(128) Name of the server that wrote the backup set.
DatabaseVersion Int Version of the database from which the backup was created.
FirstLsn Numeric (25,0) Log sequence number of the first transaction in the backup set.
NULL for file backups.
LastLsn Numeric (25,0) Log sequence number of the last transaction in the backup set.
NULL for file backups.
CheckpointLsn Numeric (25,0) Log sequence number of the most recent checkpoint at the time
the backup was created.
DifferentialBaseLsn Numeric (25,0) Log sequence number of the most recent full database backup.
BackupStartDate Datetime Date and time that the backup operation began.
BackupFinishDate Datetime Date and time that the backup operation finished.
SortOrder Smallint Server sort order. This column is valid for database backups only.
Provided for backward compatibility.
CodePage Smallint Server code page or character set used by the server.
CompatibilityLevel Tinyint Compatibility level setting of the database from which the backup
was created.
SoftwareVendorId Int Software vendor identification number. For SQL Server, this
number is 4608 (or hexadecimal 0x1200).
SoftwareVersionMajor Int Major version number of the server that created the backup set.
SoftwareVersionMinor Int Minor version number of the server that created the backup set.
SoftwareVersionBuild Int Build number of the server that created the backup set.
MachineName Nvarchar(128) Name of the server that wrote the backup set.
RecoveryForkId Uniqueidentifier ID for the current recovery fork for this backup.
l 0—not encrypted
l 1—encrypted
Note: A copy-only backup does not impact the overall backup and
restore procedures for the database.
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
Syntax
EXEC master.dbo.xp_view_tsmmc
@tsmclientnode = 'TSM_client_node'
, @tsmclientownerpwd = 'TSM_client_owner_password'
, @tsmconfigfile = 'TSM_configuration_file'
[, @tsmmanagementclass = 'TSM_management_class']
Arguments
@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.
@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.
@tsmconfigfile
Specifies the TSM configuration file.
You can use the %TSMDEFAULTPATH% variable to make LiteSpeed detect the default TSM configuration file
path automatically (by getting from LiteSpeed defaults as a priority or the registry - HKEY_LOCAL_
MACHINE\SOFTWARE\IBM\ADSM\CurrentVersion\BackupClient)
@tsmmanagementclass
Specifies the TSM management class. If not specified, LiteSpeed uses the default management class.
Backup Nvarchar Names the destination where backups are stored. The destination can be either a
copy (128) storage pool of disk devices or a storage pool of devices that support removable
group media, such as tape.
destination
Versions Nvarchar Specifies the maximum number of different backup versions retained. If you select a
data exists (128) management class that permits more than one backup version, the most recent
version is called the active version. All other versions are called inactive versions. If
the maximum number of versions permitted is five, and you run a backup that creates
a sixth version, the oldest version is deleted from server storage.
Versions Nvarchar Specifies the maximum number of different backup versions retained for files and
data (128) directories that you erased from your drive. This parameter is ignored as long as the
deleted file or directory remains on your drive. If you erase the file or directory, the next time
you run an incremental backup, the active backup version is changed to inactive and
the oldest versions are erased that exceed the number specified by this parameter.
Retain Nvarchar Specifies how many days all but the most recent backup version is retained. The
extra (128) most recent version is the active version, and active versions are never erased. If
versions Nolimit is specified, then extra versions are kept until the number of backup versions
exceeds the versions data exists or versions data deleted parameter settings. In this
case, the oldest extra version is deleted immediately.
Retain Nvarchar Specifies the number of days the last remaining inactive version of a file or directory
only (128) is retained. If Nolimit is specified, the last version is retained indefinitely. This
versions parameter goes into effect during the next incremental backup after a file is deleted
from the client machine. Any subsequent updates to this parameter will not affect files
that are already inactive. For example: If this parameter is set to 10 days when a file
is inactivated during an incremental backup, the file will be expired in 10 days.
Archive Nvarchar Names the destination where archives are stored. The destination can be either a
copy (128) storage pool of disk devices or a storage pool of devices that support removable
Returns
0 (success) or non-zero (failure).
To capture the output message and the result code, run the following:
declare @rc int
declare @rmsg varchar(999)
exec master..<procedure_name> <arguments>, @resultmsg=@rmsg output, @resultcode=@rc
output
select @rc, @rmsg
Troubleshoot LiteSpeed
1. Select Start | All Programs | Quest Software | LiteSpeed for SQL Server | Instance Configuration.
2. Review the names of the instances on the SQL Instances step.
3. Complete the wizard.
Be sure to use upper case for SERVER_NAME. Additionally, you need to add a comment to maintenance plans
to provide information about the databases involved in the plan:
1. Confirm the access rights of the SQLserver\agent startup account to the DR resource.
2. Confirm network connectivity between the SQL server and the DR storage appliance.
l "Executed as user: ... sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed."- double-
click a plan in the History page to view the event message.
l "The SQLDMO 'Application' object failed to initialize." - run the maintenance plan task script in
SSMS 2008.
Troubleshoot Performance-Related
Issues
LiteSpeed uses Virtual Device Interface (VDI) to generate its backups. This operates in a single contiguous
region of addresses within the SQL Server process space known as MemToLeave memory area. It is set aside
at startup and is left unallocated by SQL Server for the use by components in the SQL Server process space,
such as extended procedures, COM/OLE Automation objects, and linked server queries. Memory allocations by
SQL Server larger than 8 KB are also made from the MemToLeave area.
SQL Server's MemToLeave area becoming fragmented so that there is insufficient contiguous space to allocate
the buffers required for the backups. Rebooting SQL Server will free the memory, but the underlying cause of
memory fragmentation should be addressed for long-term resolution.
Factors that can drain this memory area:
l Core Engine
l Installation and Remote Deploy
l Maintenance Plans
l Log Shipping
l Object Level Recovery
l LiteSpeed UI Console Activity
NOTE: Log shipping plans activity is also logged and displayed in the History tab of the Log Shipping pane
(CTRL+2). See the Configure Log Shipping guide for more information.
Installer Logging
Installer log files are created in the default output directory. When you use the Remote Deploy Configuration
wizard to deploy LiteSpeed on SQL Server instances, this creates a 'RemoteDeploy'-prefixed log file on the
machine where you run the remote deploy from and 'SLSInstall'-prefixed log files on all target servers. For more
information, see Log File Naming and Location on page 582.
Backup/Restore Logging
Using the following instructions you can enable logging for a particular backup or restore activity. To log all
backup/restore activity on the server, see Instance-Wide LiteSpeed Logging.
l In wizards, access options or advanced options and set the logging level.
l Supply the @logging parameter if using the extended stored procedures.
1. Right-click an instance in the server tree, select Support and then LiteSpeed Logging.
l Core Engine—To log all backup/restore activity on the server, including log shipping and Fast
Compression backups, but not Maintenance Plans backup tasks. For more information, see
Reporting and Logging in Maintenance Plans on page 583. about logging options in
Maintenance Plans.
l Object Level Recovery (OLR)—To log read operations and object-level recovery.
l Log Ship—To log backup/copy/restore Log Shipping jobs, but not transaction log backups
and restores.
l Fast Compression—To log Fast Compression jobs and Fast Compression backups.
l Smart Cleanup Policies—To log Smart Cleanup Policies activity.
l SLSMedia—To log SLSMedia activity.
Clear one or more checkboxes to disable advanced logging for those options.
Option Description
Log file path This parameter specifies a path to a default output directory into which the log
files are written. For more information, see Log File Naming and Location on
page 582.
Flush output to log file LiteSpeed will perform a disk flush after each record. Select this parameter if
after every write you experience program exceptions resulting in a process abort.
(slower)
Delete log file on A log file is only saved if an error has occurred during execution.
success
Log rollover size This will limit the size of the log file, so that only the last records that fit within
the specified size will be kept. Use this option in the case of a long running
application, when the log file becomes overly large, or when an error
happens near the end of execution. Otherwise, set the rollover size value to
zero.
NOTES:
1. Right-click an instance in the server tree, select Support and then LiteSpeed Logging.
l YYYY—4-digit year
l MM—2-digit month
l DD— 2-digit day of the month
l hh— 2-digit hour using the local 24-hour clock
l mm—2-digit minute
l ss— 2-digit second
l xxx—3-digit millisecond
l PPPP—4-digit process id
l TTTT— 4-digit thread id
When you use the Remote Deploy Configuration wizard to deploy LiteSpeed on SQL Server instances, this
creates a 'RemoteDeploy'-prefixed log file on the machine where you run the remote deploy from and
'SLSInstall'-prefixed log files on all target servers.
Option Description
Write a text
file report in Select a directory in which to write a text file report. Alternately select to browse and locate
directory a directory
l Delete text files older than - Select to delete files based on their age in number of
minutes, hours, days, weeks, months, and years.
Write an
html file Select a directory in which to write an html file report. Alternately select to browse and
report in locate a directory.
directory
l Delete html files older than - Select to delete files based on their age in number of
minutes, hours, days, weeks, months, and years.
Log Logs plan details in msdb.dbo.sysmaintplan_logdetail for both LiteSpeed and native SQL
extended Server SSIS maintenance plans, for all tasks. This additional information is task-specific and is
information
displayed in the Extended Log Information pane of the History tab.
For the native SQL Server plans, this information also becomes a part of the native reporting
and may increase the size of the stored maintenance plan history.
Log to Writes the plan history to the remote server. Select the connection drop-down to choose the
remote server. Alternately assign a new server.
Server
Debug Logs LiteSpeed maintenance plan utility activity.
Logging
Quest Software support may ask you to enable debug logging in maintenance plans to help
troubleshoot product issues. Make sure LiteSpeed is installed on the server where you have a
problem with maintenance plans.
When a subplan is executed, the Maintenance Plan engine saves the archived <plan_name>_
<subplan_name>[<GUID>].zip file in the default output directory.Configure Logging in
LiteSpeed about the default output directory.
Each archive has:
l one or more files for all LiteSpeed tasks in a subplan, including the Reporting task
l one file containing -Gather command-line command to collect statistics
l one file containing -CollectStats command-line command for the process that starts
collecting statistics to repositories (only created for SSIS plans)
LiteSpeed's debug logging is not supported for the native SQL Server tasks. If the Use
LiteSpeed option is cleared for a task, then that task is handled by the native SQL Server
components.
1. Right-click a server in the tree and select Support | LiteSpeed Core Details.
2. Send the support bundle to Quest Software customer support or click Clipboard to save the generated
content to file.
LiteSpeed Community
Get the latest product information, find helpful resources, and join a discussion with the LiteSpeed team and
other community members. Join the LiteSpeed community at:
https://www.quest.com/community/products/litespeed/.
Use this site to:
l Participate in forums
ToadWorld http://www.toadworld.com/platforms/sql-server/default.aspx
Contacting Quest
For sales or other inquiries, visit www.quest.com/contact.
This product contains the following third-party components. For third-party license information, go to
https://www.quest.com/legal/license-agreements.aspx. Source code for components marked with an asterisk (*)
is available at https://opensource.quest.com.
Table 1: List of Third-Party Contributions
AWS SDK for .NET 3.3 Copyright 2009-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
**********************
THIRD PARTY COMPONENTS
**********************
This software includes third party software subject to the following copyrights:
-Json processing from LitJson –
All the source code and related files distributed with this software have been
dedicated to the public domain by the authors.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute the
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
- Parsing PEM files from Bouncy Castle -
Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle
(http://www.bouncycastle.org)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
This license governs use of the accompanying software. If you use the software,
you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have
the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the
software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its
contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license
conditions and limitations in section 3, each contributor grants you a non-
exclusive, worldwide, royalty-free copyright license to reproduce its contribution,
prepare derivative works of its contribution, and distribute its contribution or any
derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license
conditions and limitations in section 3, each contributor grants you a non-
exclusive, worldwide, royalty-free license under its licensed patents to make,
have made, use, sell, offer for sale, import, and/or otherwise dispose of its
contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any
contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim
are infringed by the software, your patent license from such contributor to the
software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright,
patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do
so only under this license by including a complete copy of this license with your
distribution. If you distribute any portion of the software in compiled or object code
form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors
give no express warranties, guarantees or conditions. You may have additional
consumer rights under your local laws which this license cannot change. To the
extent permitted under your local laws, the contributors exclude the implied
warranties of merchantability, fitness for a particular purpose and non-
infringement.
** iOS4Unity - https://github.com/Hitcents/iOS4Unity/
** SQLitePCLRaw - https://github.com/ericsink/SQLitePCL.raw
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
supersede or modify the terms of any separate license agreement you may have
executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names,
trademarks, service marks, or product names of the Licensor, except as required
for reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
writing, Licensor provides the Work (and each Contributor provides its
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied, including, without limitation, any
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for
determining the appropriateness of using or redistributing the Work and assume
any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort
(including negligence), contract, or otherwise, unless required by applicable law
(such as deliberate and grossly negligent acts) or agreed to in writing, shall any
Contributor be liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a result of this
License or out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or
Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations and/or
rights consistent with this License. However, in accepting such obligations, You
may act only on Your own behalf and on Your sole responsibility, not on behalf of
any other Contributor, and only if You agree to indemnify, defend, and hold each
Contributor harmless for any liability incurred by, or claims asserted against, such
Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
- Endian Conversion for EventStream Event decoding
[Amazon.Util.EventStreams.EndianConversionUtility] from IPAddress.cs
https://github.com/Microsoft/referencesource/
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
SharpZipLib 0.81.0.1407 The library is released under the GPL with the following exception:
Linking this library statically or dynamically with other modules is making a
combined work based on this library. Thus, the terms and conditions of the GNU
General Public License cover the whole combination.
As a special exception, the copyright holders of this library give you permission to
link this library with independent modules to produce an executable, regardless
of the license terms of these independent modules, and to copy and distribute the
resulting executable under terms of your choice, provided that you also meet, for
each linked independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from or based
on this library. If you modify this library, you may extend this exception to your
version of the library, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version.
Note The exception is changed to reflect the latest GNU Classpath exception.
Older versions of #ziplib did have another exception, but the new one is clearer
and it doesn't break compatibility with the old one.
Bottom line In plain English this means you can use this library in commercial
closed-source applications.
Spring4D 1.2.2 Copyright (c) 2009 - 2018 Spring4D Team. Apache License Version 2.0
Task Scheduler Managed Copyright (c) 2003-2010 David Hall
Wrapper 2.8
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
TimeSpan Helper Library BSD Copyright (c) 2009, dahall All rights reserved.
2.2
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
Neither the name of CodePlex Community nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
zlib 1.2.8 Portions copyright 1995-2012 Jean-loup Gailly and Mark Adler
zlib portable 1.11.0 Portions copyright 1995-2012 Jean-loup Gailly and Mark Adler
In d e x
backup speed 84
backup statistics 176
% Backup Templates 87
export 97
% variables 127 import from file 97
job notifications 96
. select databases 89
view history 97
.lsm 165 backup throughput 176
backup wizard 99
A backups 36, 281
attach files 108
About the Cloud 75 cleanup 125
activitymanager.exe 71 convert to SQL Server 261
Adaptive Compression 123 create 99
advanced logging 581 differential 99
AlwaysOn Availability Groups 112 Fast Compression 116
AlwaysOn databases 112 file and filegroup 99
Amazon S3 79 full 99
Amazon S3 Account 79 multi-database 116
Amazon S3 Cloud 75 primary replicas 112
Application Menu 39 re-execute 176
argument data type 278 read (OLR) 165
attachments recast 252
add to backup file 108 restore objects (OLR) 165
list files and directories 482 secondary repricas 112
restore from backup file 161 t-log 99
Automated Restore 150 template 87
command-line arguments 182 test optimal settings 83
xp arguments 415, 433 verify integrity 157
availability groups 112 view activity 176
Azure Account 79 wizard 99
B C
back up databases (Maint Plans) 134 categories 58
background processes 51 assign 59
Backup Analyzer 83 create 59
backup escalation 119 edit 59
backup history 176 group by in LiteSpeed Console 58
Backup Manager Server Tools Ribbon 43 central pane 50 LiteSpeed 8.9 User Guide
Index 600
central repository 54 DDL, generate (OLR) 165
clone backup templates 97 default log output directory 581
Cloud Account Settings 79 defaults 60
Cloud Automatic Striping 81 deploy backup templates 97
Cloud Browse Double Click Restore 121
xp arguments 526 restore 161
command line (LiteSpeed) 181
extract backups 261 E
Fast Compression 116
general commands 182 encryption 124
licensing 277 export backup templates 97
Maintenance Plans 234 extended stored procedures 278
Object Level Recovery 265 extract to different locations 263
recast backups 252 extract to the SQL Server backup 261
Smart Cleanup 225 extraction utility 261
compressed database 159 extractor.exe 261
compressed folder 159
compression 123 F
convert
backups to executables 122 Fast Compression 116
LiteSpeed backups 252 backup escalation 119
Maintenance Plans 130 command-line arguments 208
custom database selection 89 job notification 109
xp arguments 531
D
G
Database Tools Ribbon 44
databases Google cloud storage 75
back up 99
categorize 58 H
compress 159
group 58 Help Ribbon 42
restore 150 Home Ribbon 40
databases (Maint Plans) 129
back up 134 I
check integrity 130
clean up backups 130 import backup templates 97
clean up history 130 IntelliRestore 157
execute jobs 130
execute T-SQL 130 J
rebuild index 130
reorganize indexes 130 Job Manager Ribbon 45
shrink 130
LicenseInfoCmd.exe 277
LiteSpeed Console 39
N
LiteSpeed defaults 60
navigation pane 48
LiteSpeed logging 581
Network Resilience 125
LiteSpeed utilities 181
notifications
extractor 261
Backup Templates 96
licenseinfocmd 277
Fast Compression job 109
olr 265
Maintenance Plans 130
slsfastcompression 208
Restore job 151
slsrecast 252
NTFS compressed database 159
slssmartcleanup 225
NTFS compressed folder 159
slssqlmaint 234
sqllitespeed 182
LiteSpeed variables 127
O
LiteSpeed_DeleteActivity 72
Object Level Recovery 165
location and name of extracted files 262
command-line arguments 265
Log Reader
read backup files 165
options 69
restore from TSM 172
Log Reader Ribbon 46
restore tables 165
Log Shipping Server Tools Ribbon 47
SELECT statements 173
logging 580
wizard 165
M xp arguments 345
Object Level Recovery Ribbon 48
olr.exe 265
Maintenance Plans 129
options (Job Manager) 68
back up database 134
options (LiteSpeed) 65
clean up maintenance data 145
Backup Manager 67
command-line arguments 234
Log Shipping 68
copy plans and subplans 146
options (Log Reader) 69
create 130
owner of a maintenance plan 133
debug logging 583
logging 583
owner 133
P
prerequisites 129
preferred replica 112
upgrade 578
primary replicas 112
view activity and history 180
processor affinity 64
MemToLeave 579
X
xp_backup_database 283
xp_backup_log 309
xp_backup_parameters 330
xp_delete_tsmfile 335, 397
xp_encrypt_backup_key 337
xp_encrypt_restore_key 337
xp_extractor 337
xp_memory_size 344
xp_objectrecovery 345
xp_objectrecovery_createscript 360
xp_objectrecovery_executeselect 374
xp_objectrecovery_viewcontents 387
xp_replicate_activity_statistics 71
xp_replicate_job_statistics 71
xp_restore_attachedfilesonly 404
xp_restore_automated 415, 433
xp_restore_checkpassword 448
xp_restore_checksumonly 451
xp_restore_database 451
xp_restore_filelistonly 472
xp_restore_headeronly 480
xp_restore_log 492
xp_restore_setinfo 508
xp_restore_verifyonly 515
xp_sls_cloud_browse 526
xp_slsCreateDCR 529
xp_slsFastCompression 531
xp_slsReadProgress 552
xp_slsSmartCleanup 553
xp_slssqlmaint 562
xp_sqllitespeed_licenseinfo 564
xp_sqllitespeed_version 566
xp_view_tsmcontents 566
xp_view_tsmmc 573