The following information was omitted from the Sybase IQ Utility Guide.
The Backup utility (dbbackup) makes a copy of the transaction log of a running IQ database. This utility lets you truncate the transaction log, freeing disk space and improving recovery speed, without having to stop and restart your server.
To back up an entire Sybase IQ database, always use the BACKUP statement, not dbbackup. BACKUP backs up all database files, and is the only way to back up the Catalog Store. For details, see “BACKUP statement,” in the Sybase IQ Reference Manual.
dbbackup [options] target-directory
The following table lists the available options for the dbbackup utility.
Option |
Description |
---|---|
@data |
Read options from the specified environment variable or configuration file |
-c "keyword=value; …" |
Supply database connection parameters |
-l (lowercase L) file |
Live backup of the transaction log to a file |
-q |
Quiet mode — do not print messages |
-r |
Copy the old transaction log to a new name and start a new empty log |
-xo filename |
Truncate (delete and restart) the transaction log |
The Backup utility allows you to back up the transaction log while other applications or users are using the database. Backup filenames are the same as the database filenames.
If you have adequate disk space, use -r to preserve the existing log file under a new name and start a new empty log. If disk space is limited, use -xo instead to truncate the existing log.
Exit codes are 0 (success) or non-zero (failure).
@data Reads in options from the specified environment variable or configuration file. If both exist with the same name, Sybase IQ uses the environment variable.
For more information about configuration files, see your Sybase IQ Installation and Configuration Guide.
To protect passwords or other information in the configuration file, you can use the File Hiding utility (dbfhide) to obfuscate configuration file contents.
Connection parameters (-c) If the connection parameters are not specified, connection parameters from the SQL CONNECT 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 Chapter 4, “Connection and Communication Parameters” in Sybase IQ System Administration Guide.
Live backup (-l (lowercase L)) Enables a secondary system to be brought up rapidly in the event of server failure. A live backup does not terminate, but continues while the server runs. It runs until the primary server becomes unavailable. At that point, it shuts down, but the backed up log file is intact and can be used to bring a secondary system up quickly.
The live backup of the transaction log is always the same length or shorter than the active transaction log. When a live backup is running and another backup restarts the transaction log (dbbackup -x), the live backup automatically truncates the live backup log and restarts the live backup at the beginning of the new transaction log.
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) Forces a checkpoint and the following three steps to occur:
Copies and saves the current working transaction log to the directory specified in the command.
Keeps the current transaction log in its current directory, but renames it using the format yymmddxx.log, where xx are sequential characters starting at AA and running to ZZ, and yymmdd represents the current year, month, and day. This file is then no longer the current transaction log.
Generates a new transaction log file that contains no transactions. The new file has the name of the former current transaction log and becomes the current transaction log.
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).
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.
target-directory The directory to which the backup files are copied. If the directory does not exist, Sybase IQ creates it. The parent directory must exist.
The following Windows command backs up the transaction log from the asiqdemo database running on the sample_server server into the directory asiqbackup, connecting as user ID DBA with password SQL:
dbbackup -c "eng=sample_server;dbn=asiqdemo;uid=DBA;pwd=SQL" c:\sample\asiqbackup
The following command uses the -xo option of dbbackup to delete the transaction log and start a new one with the same name, and the -l option to perform these actions while connected to the live database:
dbbackup -l -xo -c "eng=sample_server;dbn=asiqdemo;uid=DBA;pwd=SQL"