Creates a client-side backup of database files and transaction logs for running databases.
dbbackup [ options ] target-directory
Use this option to read in options from the specified environment variable or configuration file. 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. See File Hiding utility (dbfhide).
|-b block-size||Use this option to specify the maximum block size (in number of pages) to be used to transfer pages from the database server to dbbackup. The dbbackup utility tries to allocate this number of pages; if it fails, it repeatedly reduces this value by half until the allocation succeeds. The default size is 128 pages.|
|-c "keyword=value; ..."||
Specify connection parameters. The user ID must have DBA authority or REMOTE DBA authority to connect to the database. See Connection parameters.
For example, the following command backs up the sample database running on the server sample_server, connecting as the DBA user, into the SQLAnybackup directory:
dbbackup -c "ENG=sample_server;DBN=demo;UID=DBA;PWD=sql" SQLAnybackup
|-d||Back up the main database files only, without backing up the transaction log file, if one exists.|
This option specifies how dbbackup processes the database files before writing them to the destination directory. The choice of whether to apply pre-images during a backup, or copy the checkpoint log as part of the backup, has performance implications. If the -s option is specified to cause the backup to be performed on the server, the default setting for -k is auto; otherwise, the default setting is copy.
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 shuts down, but the backed up log file is intact and can be used to bring a secondary system up quickly. See Differences between live backups and transaction log mirrors, and Making a live backup.
If you specify -l, then you cannot use -s to create an image back up on the server.
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 both the -x option and the -n option to rename the log copy. For example
dbbackup -c "UID=DBA;PWD=sql" -x -n mybackupdir
|-o filename||Write output messages to the named file.|
|-q||Do not display output messages. This option is available only when you run this utility from a command prompt.|
This option renames the transaction log and starts a new transaction log. It forces a checkpoint and causes the following three steps to occur:
|-s||This option allows you to create an image backup on the server using the BACKUP DATABASE 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 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, do not specify -s or -y. You must specify -s if you specify the -k recover option.|
|-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).|
|-x||Back up the existing transaction log, delete the original log, and then start a new transaction log.|
|-xo||Delete the current transaction log and start a new one. This operation does not perform a backup; its purpose is to free up disk space in non-replication environments.|
|-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, do not specify -s or -y.|
|target-directory||The directory the backup files are copied to. If the directory does not exist, it is created. However, the parent directory must exist.|
The Backup utility makes a backup copy of all the files for a single database. A simple database consists of two files: the main database file and the transaction log. More complicated databases can store tables in multiple files, with each file as a separate dbspace. All backup file names are the same as the database file names. The image backup created by the Backup utility consists of a separate file for each file that is backed up.
For more information about making archive backups (a single file that contains both the database file and the transaction log), see Making archive backups.
Using the Backup utility on a running database is equivalent to copying the database files when the database is not running. You can use the Backup utility to back up the database while other applications or users are using it.
If neither of the options -d or -t are used, all database files are backed up.
The Backup utility creates a client-side backup of the database files. You can specify -s to create a backup on the server using the BACKUP DATABASE statement.
For information about performing server-side backups, see BACKUP statement.
In addition to dbbackup, you can access the Backup utility in the following ways:
From Sybase Central, using the Create Backup Images wizard. See Making image backups.
From Interactive SQL, using the BACKUP DATABASE statement. See BACKUP statement.
For more information about recommended backup procedures, see Backup and Data Recovery.
Exit codes are 0 (success) or non-zero (failure).
For more information about exit codes, see Software component exit codes.