Use this command to create a new backup template or to change the data of an existing backup template by overwriting its current definition. The properties of the backup template defined in this way are stored in the configuration file BackupTemplates.xml of Database Manager.
Changes to backup templates only apply when the backup process is next started.
For backup templates of the FILE type only:
If the automatic log backup function is ON while you change the backup template used by the automatic log backup, the changes will only apply after the automatic log backup function has been stopped and started again.
Define the file and directory in which the backup is to be created by specifying the property location. The directory specified in this way must already exist. However, the backup file is not created physically until it is first used for a backup. Only then the backup file with the name defined in the backup template will be visible in the specified directory.
The option for specifying a successor template can only be used in a data backup for a bridge scenario.
Although the complete syntax line is long, note that for normal use you only need to define very few parameters to create a backup template (see also the examples below). You can also use Database Studio to create backup template ( Defining Backup Templates).
You have the server permission Backup.
You can use the DBM command explain backup_template_create to display the full explanatory text. The structure of the backup_template_create syntax in this topic was slightly modified in comparison to the DBM command explanatory text.
backup_template_create <backup_template> TO <spec> <spec>:: = <data_carrier_list> <content_spec> | BACKUPTOOL <backup_tool> <data_carrier_list_backup_tool> <content_spec> | EXTERNAL SNAPSHOT <data_carrier_list>:: = <data_carrier> | <data_carrier> <data_carrier> ... <data_carrier>:: = <carrier_type> [NAMED <data_carrier_name>] <carrier_type>:: = <file_description> | <pipe_description> | <tape_description> <file_description>:: = FILE <location> [SIZE <n> [<size_unit>]] [BLOCKSIZE <n> [<size_unit>]] [OVERWRITE] [COMPRESSED] <pipe_description>:: = PIPE <location> [<size_description>] [<block_size_description>] [COMPRESSED] <tape_description>:: = TAPE <location> [<size_description>] [<block_size_description>] [AUTOLOADER | COMMAND <os_command>] <content_spec>:: = CONTENT <content> [ENCRYPT <encryption_algorithm>] [<owner_list>] [FOLLOWED BY <successor_backup_template>] <content>:: = DATA | INCREMENTAL | LOG [EVERY <n> <time_unit>] <size_unit>:: = PAGES | BYTE | KB | MB | GB | TB <encryption_algorithm>:: = AES128-CBC | AES192-CBC | AES256-CBC | DES-CBC | DES3-CBC <owner_list>:: = <owner> | <owner> <owner> ... <owner>:: = OWNER <owner_name> <time_unit> ::= MINUTES | SECONDS | HOURS <backup_tool>:: = NETWORKER | BACKINT | TSM <data_carrier_list_backup_tool>::= <data_carrier_backup_tool> | <data_carrier_backup_tool > <data_carrier_backup_tool > ... <data_carrier_backup_tool >:: = PIPE <location> [COMPRESSED] [NAMED <data_carrier_backup_tool_name>]
Option |
Description |
---|---|
<backup_template> |
Freely definable name of the backup template Maximum number of characters: 64 See also: Database Administration, Backup Templates and Data Carriers |
NAMED <data_carrier_name> |
Name of the data carrier See also: Glossary, Data Carrier |
<location> |
Depending on the carrier type ( FILE, PIPE, TAPE) enter the required information:
For log backups to files, the system adds a sequence number to the name of each new backup file. It assigns the numbers sequentially as long as the history of the log backups is not interrupted. If the log backup history is interrupted (for example after the database was initialized), the system starts numbering at 001 again. It also uses sequential numbers if you carry out multiple log backups for one database onto different data carriers, and thus to files with different file names. If automatic log backup is switched on, the system stores all backup files under the same file name using a sequence number. For data backups to files you can use placeholders for date and time of the backup in the file name. You can freely combine and insert the following placeholders within the file name:
Example
DemoDataCompl_#YYYY-#MM-#DD Note the standards for different types of backup templates on different operating systems. Standards for backup template of type TAPE: on Unix: Enter an absolute path. on Microsoft Windows: The path must comply with the following convention: \\.\tape<running_number>. Standards for the backup tool NetWorker: Enter an absolute path. This must be identical for both the backup and restore operations. Note that parts of the path name that represent only links are replaced with the actual directory or file name by NetWorker. Standards for backup templates of type PIPE: on Unix: You are free to choose any path. If you enter a relative path, the backup template is stored in the run directory of the database ( [<path>/]<file_name>). on Microsoft Windows: The path must comply with the following convention: \\.\pipe\<pipe_name>. Standards for backup templates of type FILE: on Unix: You can enter an absolute or relative path. An absolute path must begin with a slash ( /). If you enter a relative path, it is interpreted as relative to the run directory of the database. on Microsoft Windows: Enter an absolute path as follows: \\<computer_name>\<share>\[<path>\]<file_name> or with the drive: <drive>:\[<path>]\<file_name> If you enter a relative path, it is interpreted as relative to the run directory of the database. |
OVERWRITE |
Relevant only for the backup template of the FILE type and only for data backups. It defines the behavior if the file already exists. This entry is not interpreted for log backups. If you specify the keyword and the file already exists, it is overwritten by the new backup. If you do not specify the keyword and the file already exists, the backup fails. |
COMPRESSED |
For backup templates of the FILE and PIPE types only Specifies whether the backup is compressed |
AUTOLOADER |
For backup templates of the TAPE type only Keyword to be specified if you want to use a tape device with an automatic tape loader. If you do not specify the keyword, the system does not expect an automatic tape loader. |
COMMAND <os_command> |
For backup templates of the TAPE type only Operating system command to be executed before saving to a succeeding data carrier ( backup_replace) or restoring a succeeding data carrier ( recover_replace) |
CONTENT <content> |
Backup type Possible values are: DATA | INCREMENTAL | LOG [EVERY <n> <time_unit>] DATA: complete data backup INCREMENTAL: incremental data backup LOG: log backup (definition of a time unit is possible) Note, however, that you can carry out log backups to files and pipes only. Otherwise, you will receive an error message when you start the backup. See also: Glossary, Backup Type |
OWNER <owner> |
Private key owner (see X.509 certificate), defines the encryption method |
FOLLOWED BY <successor_backup_template> |
Can only be specified for a data backup in a bridge scenario: Name of the log backup template to be used after the data backup |
SIZE <n> [PAGES | BYTE | KB | MB | GB | TB] |
Maximum number of pages, which can be written to the data carrier <n>: Numeric value (integer) If you do not specify a size, the system will keep backing up to the data carrier until either the backup is complete, or the operating system does not allow further backups to this data carrier because it is full. If this happens, you receive an error message and can then continue the backup using another data carrier. Default unit: PAGES |
BLOCKSIZE <n> [PAGES | BYTE | KB | MB | GB | TB] |
Amount of data transferred in one block when the data carrier is accessed <n>: Numeric value (integer), the system default value is 8 The system default unit is PAGES. |
SECONDS | MINUTES | HOURS |
Unit of indicated time value Default value: MINUTES |
NETWORKER | BACKINT | TSM |
Name of the backup tool used NetWorker: NetWorker (Legato) BACKINT: NetBackup (Veritas) and all backup tools that support Backint for SAP MaxDB and Backint for Oracle TSM: TSM von IBM/Tivoli See also: Glossary, Backup Tool |
NAMED <data_carrier_backup_tool_name> |
Name of the data carrier backup tool |
EXTERNAL SNAPSHOT |
Backup to be made as an external snapshot See also: backup_finish |
OK
In the event of errors, see Reply Format.
Creating a backup template for a complete data backup to the file named databackup in folder C, short form:
dbmcli on DEMODB> backup_template_create DemoDataCompl TO FILE c:\databackup CONTENT DATA
OK
Database Administration, Configuration Files