ASA Database Administration Guide
Database Administration Utilities
dbbackup [ options ] target-directory
| Option | Description |
|---|---|
| @data | Read options from the specified environment variable or configuration file. |
| -c "keyword=value; ..." | Supply database connection parameters. |
| -d | Only back up the main database file. |
| -l file | Live backup of the transaction log to a file. |
| -n | Change the naming convention for the backup transaction log. |
| -o filename | Log output messages to a file. |
| -q | Quiet mode—do not print messages. |
| -r | Rename and start a new transaction log. |
| -s | Perform an image backup on the server using the BACKUP statement. |
| -t | Back up only the transaction log. |
| -w | Back up only the write file. |
| -x | Delete and restart the transaction log. |
| -xo | Delete and restart the transaction log without making a backup. |
| -y | Replace files without confirmation. |
| target-directory | The directory to which the backup files are copied. |
If neither of the options -d or -t are used, all database files are backed up.
If -s is specified, the backup is created on the server using the BACKUP statement. Otherwise, the backup is made on the client machine.
@data
Use this option to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used.
For more information about configuration files, see Using configuration files.
If you want to protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file.
For more information, see Hiding the contents of files using the dbfhide command-line utility.
Connection parameters (-c)
If the connection parameters are not specified, connection parameters from the SQLCONNECT environment variable are used, if set. The user ID must have DBA authority or REMOTE DBA authority.
For a description of the connection parameters, see Connection parameters.
For example, the following command backs up the asademo database running on the server sample_server, connecting as user ID DBA with password SQL, into the asabackup directory:
dbbackup -c "eng=sample_server;dbn=asademo;uid=DBA;pwd=SQL" asabackup
Back up main database only (-d)
Back up the main database files only, without backing up the transaction log file, if one exists.
Live backup (-l lower-case L)
This option is provided to enable a secondary system to be brought up rapidly in the event of a server crash. A live backup does not terminate, but continues running while the server runs. It runs until the primary server becomes unavailable. At that point, it is shut down, but the backed up log file is intact and can be used to bring a secondary system up quickly.
If you specify -l, then you cannot use -s to create an image back up on the server.
For more information about live backups, see Differences between live backups and transaction log mirrors and Making a live backup.
Change backup transaction log naming convention (-n)
This option is used in conjunction with -r. It changes the naming convention of the backup transaction log file to yymmddxx.log, where xx are sequential letters ranging from AA to ZZ and yymmdd represents the current year, month, and day.
The backup copy of the transaction log file is stored in the directory specified in the command, and with the yymmddxx.log naming convention. This allows backups of multiple versions of the transaction log file to be kept in the same backup directory.
You can also use the both the -x option and the -n option to rename the log copy. For example
dbbackup -x -n
Log output messages to file (-o)
Write output messages to the named file.
Operate quietly (-q)
Do not display output messages. This option is available only when you run this utility from a command prompt.
Rename and start new transaction log (-r)
This option forces a checkpoint and the following three steps to occur:
The current working transaction log file is copied and saved to the directory specified in the command.
The current transaction log remains in its current directory, but is renamed using the format yymmddxx.log, where xx are sequential characters starting at AA and running through to ZZ, and yymmdd represents the current year, month, and day. This file is then no longer the current transaction log.
A new transaction log file is generated that contains no transactions. It is given the name of the file that was previously considered the current transaction log, and is used by the database server as the current transaction log.
Perform an image backup on the server (-s)
This option allows you to create an image backup on the server using the BACKUP statement. If you specify the -s option, the -l option (to create a live backup of the transaction log) cannot be used. The directory specified is a directory relative to the server's current directory, so it is recommended that you specify a full pathname. In addition, the server must have write permissions on the specified directory. When -s is specified, the Backup utility does not display progress messages and does not prompt you when it overwrites existing files. If you want to be prompted when an attempt is made to overwrite an existing file, you should not specify -s or -y.
Back up the transaction log file only (-t)
This can be used as an incremental backup since the transaction log can be applied to the most recently backed up copy of the database file(s).
Back up the database write file only (-w)
For a description of database write files, see The Write File utility (deprecated).
Delete and restart the transaction log (-x)
Back up the existing transaction log, then delete the original log and start a new transaction log.
Delete and restart the transaction log without a backup (-xo)
Delete the current transaction log and start a new one. This operation does not carry out a backup; its purpose is to free up disk space in non-replication environments.
Operate without confirming actions (-y)
Choosing this option creates the backup directory or replaces a previous backup file in the directory without confirmation. If you want to be prompted when an attempt is made to overwrite an existing file, you should not specify -s or -y.
Target-directory
The directory to which the backup files are copied. If the directory does not exist, it is created. However, the parent directory must exist.
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.