Database Backup

The BACKUP DATABASE command backs up an SAP® Sybase® IQ database to one or more archive devices. Basic syntax identifies the type of backup you want to perform, and a TO clause that directs the output to an archive device:

BACKUP DATABASE 
   [ backup-option … ]
TO archive_device
You must be connected to the database to back it up. You cannot use the BACKUP DATABASE command to specify another database.

In a multiplex environment, execute all BACKUP DATABASE and RESTORE DATABASE commands on the coordinator.

Backup Data

BACKUP DATABASE issues a CHECKPOINT before starting the backup, then backs up the catalog store. Data that is not committed when this initial checkpoint occurs is not included in the backup. A second checkpoint occurs at the end of backup. Data that is committed while the backup is in progress is included in subsequent backups.

Backups run concurrently with most other read-write operations, except those that affect the structure of the database. You cannot issue a CHECKPOINT or change the database metadata while a backup is in progress. If a system or media failure occurs during backup, you cannot restore uncommitted transactions.

Make a copy of the params.cfg file and save the contents of the SYSDBFILE and SYSDBSPACE system views. SAP Sybase IQ does not back up the temporary store (db-name.iqtmp) and params.cfg, but does back up the metadata and other information that is necessary for re-creating the temporary store structure.

Data Distribution

BACKUP DATABASE always makes a full backup of the catalog store on the first archive device, and then backs up the data from the IQ store in parallel across all of the devices you specify. Blocks are not evenly distributed across archive media. Depending on the processing speed of individual threads, you may have more blocks on one device than others.

SAP Sybase IQ backs up only those recoverable database blocks that are actually in use at the time of the backup. Free blocks are not backed up. Sets of files must be restored in the order in which they were backed up.

Backup Options

Dbspaces and dbfiles can be read-only (RO), read-write (RW), online, or offline. You can restrict FULL, INCREMENTAL-SINCE-FULL, or INCREMENTAL backups to the read-write files in the IQ main store (db-name.iq). The backed up files are selected when the backup command checks the read-write status in the catalog.

A backup can back up a set of read-only dbspaces and read-only files. The read-only dbspaces or files must belong to the IQ main store. The backed up files are user selected.

If you use symbolic links for raw device names, as recommended, make sure the system backup utility follows the symbolic link and backs up the device.

Device Limits

Keep backup commands small. Large numbers of devices increase I/O and hardware contention. To saturate CPU usage, use roughly 1 device per core; on faster systems, use up to 2 devices per core. Use 36 or fewer TO clauses.

Failure and Recovery

  • If a backup fails during the initial or final CHECKPOINT, normal CHECKPOINT recovery occurs.
  • If a backup fails between the initial or final CHECKPOINT, the backup is rolled back. If the system fails between the initial and final CHECKPOINTS, use an older backup to restore the database.
  • If the system fails during the final CHECKPOINT after a full backup, restore the database from the backup you just created.
Note: See Reference: Statements and Options > SQL Statements > BACKUP DATABASE for parameter descriptions, usage, and required permissions.
Related concepts
Database Validation
Performance Options
Archive Devices
Queries, Utilities, and Procedures
Backup Scenarios
Previous Backups
Backup Log