Legacy backup examples

The following examples are provided to show how you can issue the backup command with various parameters and options.

Full backup examples

If you want to complete a full backup, the following examples are provided to help you to model the command syntax.
  • To complete a legacy full backup of two databases (model and msdb) to IBM Spectrum Protect server server storage with the /sqlbuffers and /stripes optional parameters, enter the following command:
      tdpsqlc backup model,msdb full /sqlbuffers=2 /stripes=2
    
  • To complete a legacy full backup of a database (test2) with no output displayed, because the /quiet parameter is used, and the default Windows authentication mode is overridden with the use of the /sqlauthentication parameter, enter the following command:
    tdpsqlc backup test2 full /quiet /sqlauth=sql
  • To complete a legacy full backup of all available databases with the wildcard character (*) while using the /excludedb parameter to exclude the master and msdb databases from the backup process, enter the following command:
    tdpsqlc backup * full /excludedb=master,msdb
  • To complete a full backup of the a database (test1) with the parameters that customizes the number of kilobytes, /adjustkbtsmestimate, enter the following command:
    tdpsqlc backup test1 full /adjustkbtsmestimate=25
  • To complete a full backup of all standard databases, enter the following command:
    tdpsqlc backup * full /EXCLUDEALwaysondbs
  • To complete a log backup of all availability databases, enter the following command:
    tdpsqlc backup * log /EXCLUDESTandarddbs
  • For a more complex example, consider the following scenario: There are three AlwaysOn Availability Groups. The first availability group is called AG01 with the following databases:
    • AlwaysOn Availability Database called AlwaysOnLegacyDB1
    • AlwaysOn Availability Database called AlwaysOnLegacyDB3
    The second availability group is called AG03 with the following AlwaysOn Availability Database: AlwaysOnLegacyDB2. The third availability group is called AG04 with the following databases:
    • AlwaysOn Availability Database called AlwaysOnLegacyDB5
    • AlwaysOn Availability Database called AlwaysOnLegacyDB6
    • Standard database called SQL_DB1
    • Standard database called SQL_DB2
    To complete a full backup with list matching both standard and availability databases, but excluding standard databases, enter the following command:
    C:\Program Files\tivoli\tsm\TDPSql>tdpsqlc backup AlwaysOnLegacy*,SQL* 
    	full /backupdest=TSM /backupmeth=legacy /EXCLUDESTandarddbs
  • When using the /AAGName parameter to filter the databases that are backed up, refer to the following scenario with the examples: There are two AlwaysOn Availability Groups. The first availability group is called AG01 with the following databases:
    • AlwaysOn Availability Database called AlwaysOnLegacyDB1
    • AlwaysOn Availability Database called AlwaysOnLegacyDB3
    The second availability group is called AG04 with the following databases: with databases:
    • AlwaysOn Availability Database called AlwaysOnLegacyDB5
    • AlwaysOn Availability Database called AlwaysOnLegacyDB6
    When you enter a backup command for all databases, but use the /AAGName parameter to include only databases from AG01 in the backup, enter the following command:
    C:\Program Files\tivoli\tsm\TDPSql>tdpsqlc backup * full /backupdest=TSM 
    	/backupmeth=legacy /AAGName=AG01
    When you enter a backup command for a database list with wildcards, but use the/AAGName parameter to include only databases from AG04 in the backup, enter the following command:
    C:\Program Files\tivoli\tsm\TDPSql>tdpsqlc backup AlwaysOn*,SQL* full 
    	/backupdest=TSM /backupmeth=legacy /AAGName=AG04
    When you enter a backup command for a database list with wildcards, but do not match all databases from the specified AlwaysOn Availability Group, enter the following command:
    C:\Program Files\tivoli\tsm\TDPSql>tdpsqlc back *DB5 full /backupdest=TSM 
    	/backupmeth=legacy /AAGName=AG04

Differential backup examples

If you want to complete a differential backup, the following examples are provided to help model the command syntax.
  • To complete a legacy differential backup of the previous full backup of a database (test2), including an estimate of the changed portion of the test2 database, enter the following command:
    tdpsqlc backup test2 difffull /diffest=10
  • To complete a legacy differential backup of all available databases using the wildcard character (*) using the /excludedb parameter to exclude the master and msdb databases from the backup, enter the following command:
    tdpsqlc backup * difffull /excludedb=master,msdb
  • To complete a differential backup with a database list matching both standard and availability databases, but excluding availability databases, enter the following command:
    C:\Program Files\tivoli\tsm\TDPSql>tdpsqlc backup AlwaysOnLegacy*,SQL* 
    	diff /EXCLUDEALwaysondbs

Log backup example

To complete a legacy log backup of the previous full backups of two databases (test2 and model) while overriding the default truncation of the log files, enter the following command:
tdpsqlc backup test2,model log /truncate=no

Group backup example

To complete a legacy backup of all filegroups belonging to a database called netapp_db2, enter the following command:
tdpsqlc backup netapp_db2 Group=*

File backup example

To complete a legacy file backup of all files belonging to a database (test2) using the wildcard character (*), enter the following command:
tdpsqlc backup test2 file=*

Set backup example

To complete a legacy set backup of one filegroup and two separate files (jointly as a single backup object) from a database (test2) while using the /groups and /files parameters to specify which items constitute this set backup, enter the following command:
tdpsqlc backup test2 set /groups=primary /files=test2_2data,
test2_3data

Copy-only full backup example

To complete a legacy copy-only full backup of the availability database (filestreamdb) in an SQL Server 2012 AlwaysOn Availability Group environment, and later versions, enter the following command:
tdpsqlc backup filestreamdb CopyFull /backupdestination=TSM 
/backupmethod=legacy