The Backup utility makes a copy of the transaction log of a running IQ database, and 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 BACKUP instead of dbbackup. BACKUP backs up all database files, and is the only way to back up the catalog store. See BACKUP statement in Chapter 1, “SQL Statements” in Reference: Statements and Options.
dbbackup [options] target-directory
Table 3-1 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 |
Send a 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 file names are the same as the database file names.
The dbbackup utility truncates the database name to 70 characters and creates a target file with a truncated name. Sybase IQ uses dbbackup when synchronizing secondary servers. Due to dbbackup restrictions, database names must be less than 70 characters long.
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 nonzero (failure).
@data Reads in options from the specified environment variable or configuration file. If both exist, and share the same name, Sybase IQ uses the environment variable.
For more information about configuration files, see the Installation and Configuration Guide.
To protect passwords or other information in the configuration file, use the File Hiding utility (dbfhide) to obfuscate configuration file contents. See “File Hiding utility (dbfhide).”
Connection parameters (-c) If you do not specify the connection parameters, connection parameters from the SQL CONNECT environment variable are used, if set. The user ID must have DBA authority or REMOTE DBA authority.
See Chapter 4, “Connection and Communication Parameters” in the System Administration Guide: Volume 1.
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 quickly bring up a secondary system.
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.
See “Live backup of transaction log” in Chapter 12, “Data Backup, Recovery, and Archiving” in the System Administration Guide: Volume 2.
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 these 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 files.
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 iqdemo database running on the sample_server server into the directory iqbackup, connecting as user ID DBA with password sql:
dbbackup -c "eng=sample_server;dbn=iqdemo;uid=DBA;pwd=sql" c:\sample\iqbackup
The following example truncates the log of a live server, renames the old log prior to truncation, and creates a exact copy of the log in the target directory:
dbbackup -t -r -o dbbackup.out -c "eng=taj_iqdemo;dbn=iqdemo;uid=DBA;pwd=sql" logbackup
dbbackup -xo -c "eng=sample_server;dbn=iqdemo;uid=DBA;pwd=sql"