Collection Contents Index Administration utilities overview The Collation utility pdf/chap4.pdf

Reference Manual
   CHAPTER 4. Database Administration Utilities     

The Backup utility


With the Backup utility, you can back up running databases, database files, transaction logs, and write files.

You can access the Backup utility in the following ways:

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 filenames are the same as the database filenames.

Running the Backup utility on a running database is equivalent to copying the database files when the database is not running. Thus, you can back up the database while other applications or users are using it.

For Info     For a description of suggested backup procedures, see Backup and Data Recovery.

Top of page  Backing up a database from Sybase Central

  To back up a running database:
  1. Connect to the database.

  2. Right-click the database and click Backup in the popup menu. The Backup wizard is displayed.

  3. Follow the instructions in the wizard.

  To back up a database file or a running database:
  1. Open the Database Utilities folder in the left panel.

  2. Double-click Backup Database in the right panel.

  3. Follow the instructions in the wizard.

For Info     For full information on backing up a database from Sybase Central, see the Sybase Central online Help. For more information about options, see Backup utility options

Top of page  The DBBACKUP command-line utility

Syntax 

dbbackup [switches] directory

Windows 3.x
syntax 

dbbackw [switches] directory

Switch

Description

-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 back up transaction log

-o file

Log output messages to a file

-q

Quiet mode—do not print messages

-r

Rename and start a new transaction log

-t

Only back up the transaction log

-w

Only back up the write file

-x

Delete and restart the transaction log

-y

Replace files without confirmation

Description 

If none of the switches -d, -t, or -w are used, all database files are backed up.

For Info     For more information about the command-line switches, see Backup utility options.

Top of page  Backup utility options

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.

Connection parameters (-c )     For a description of the connection parameters, see Connection parameters. 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.

For example, the following statement backs up the asademo database running on the server sample_server, connecting as user ID DBA with password SQL:

dbbackup -c "eng=sample_server;dbn=asademo;uid=dba;pwd=sql"

Backup main database only (-d )     Back up the main database files only, without backing up the transaction log file or a write 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 crashes. 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.

Change backup transaction log naming convention (-n)     This option changes the naming convention of the backup transaction log file to yymmddxx.log, where xx is a number from 00 to 99 and yymmdd represents the current year, month and day. By default, the name used for the backup transaction log file is identical to the file name of the transaction log that is being backed up.

When using the -n option, you must also use the -r or -t options.

The two-digit year notation does not cause any year 2000 problems. The names are used solely for identification, not for ordering.

Output messages to log (-o )     Sends backup messages to a named log file.

Operate quietly (-q )     Do not display messages on a window. This option is available only from the command-line utility.

Rename and start new transaction log (-r )     This option forces a checkpoint and the following three steps to occur:

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.

Delete and restart the transaction log (-x )     With this option, the existing transaction log is backed up, then the original is deleted and a new transaction log is started with the same name. This option causes the backup to wait for a point when all transactions from all connections are committed.

Operate without confirming actions (-y )     Without this option, you are prompted to confirm the creation of the backup directory or the replacement of a previous backup file in the directory.

Top of page  

Collection Contents Index Administration utilities overview The Collation utility pdf/chap4.pdf