• No results found

OFF SET AUTORECOMPILE

In document SQLBase. SQLTalk Command Reference (Page 40-45)

If this setting is ON and the stored command later becomes invalid, SQLBase automatically recompiles the stored command the next time it is executed, either by the SQLTalk EXECUTE command or by the SQL/API sqlret function. When you create a stored command, the default AUTORECOMPILE setting is ON.

Example

ALTER COMMAND ADDNAMES SET AUTORECOMPILE ON;

See also

STORE EXECUTE

ALTER COMMAND command name ON

OFF SET AUTORECOMPILE

BACKUP

BACKUP

This command backs up a database, transaction log files, or both. You can backup a database to a file with the following name:

database-name.bkp

Transactions that have been committed when the backup starts are included in the backup. Active transactions are not included.

For all options except SNAPSHOT, the following rules apply:

• The SET SERVER command must come before the BACKUP command. • You must be logged in as DBA or SYSADM.

You do not need to be logged on as SYSADM to perform a BACKUP SNAPSHOT. This allows users other than SYSADM to backup the MAIN database.

Once you backup a database or log files to a directory, you can transfer the backup files to archival media and then delete them from the hard disk.

You can backup a partitioned database and restore it to a non-partitioned database, and vice-versa. Note that non-partitioned databases cannot exceed 2 gigabytes. This limit applies to all other files manipulated by SQLBase. For example, you cannot create a partition (dbarea) greater than 2 gigabytes.

If you do have a partitioned database greater than 2 gigabytes, you must perform backups to multiple segments. Each segment must be 2 gigabytes or less in size. To perform segmented backups, you must create a control file that describes the location and size of the segments to which you want to backup your database. Read the Database Administrator’s Guide for details on the format of the control file. Note

BACKUP DATABASE

SNAPSHOT

LOGS FROM database name

TO directory name

ON CLIENT

If a control file (databasename.BCF) is present in the directory specified in the TO and FROM clause of the BACKUP command, SQLBase performs a segmented backup operation. If a control file is not present, SQLBase backs up the database to a single databasename.BKP file.

Following is behavior to note when you use the BACKUP command:

• SQLBase issues an error if you try to back up databases in segments larger than 2 gigabytes.

• If you do not include a segmented backup control file (databasename.BCF) in the directory that you specified in the TO and FROM clause of the command, an unsegmented backup file is created (if less than the 2 gigabytes limit).

• SQLBase issues an error if the control file you specify does not have a minimum aggregate size to account for the total database size.

Read the Database Administrator’s Guide for details on setting the SIZE parameter for the control file.

• SQLBase does not verify the existence of disk space availability for any of the files you create.

Be sure that the directories you designate in the BACKUP command and in the control file have sufficient space. For backup commands with the snapshot option, also be sure that the directory specified in the command contains sufficient space for the backup of the log files involved in the operation.

Clauses

DATABASE

Copies the database (.dbs) file from its current directory to the specified backup directory.

LOGBACKUP must be ON to perform BACKUP DATABASE. You should never back up a database without also backing up the log files with it. LOGS

Copies unpinned log files from the current log directory (by default, the database directory) to the specified backup directory. Once this completes successfully, SQLBase deletes the log files that were backed up from the current log directory. You should back up log files from different databases to different directories since their file names could conflict.

BACKUP

SNAPSHOT

Copies the database and the associated log files from their current directory to the specified backup directory. Since BACKUP SNAPSHOT backs up a single recoverable database, it is suggested that you perform this function into an empty directory.

BACKUP SNAPSHOT is the recommended way to backup a database and its log files. There is only one step (RESTORE SNAPSHOT) needed to bring a database and its log files to a consistent state.

Alternatively, the files produced by BACKUP SNAPSHOT can be restored and recovered with the individual commands RESTORE DATABASE,

ROLLFORWARD, and RESTORE LOGS.

The SNAPSHOT option does not require the SYSADM logon and password. This means that other users besides SYSADM can backup the MAIN database by using BACKUP SNAPSHOT.

This command causes a log rollover which closes the current log file so that it can be backed up. This means that a RELEASE LOG command is not necessary. If LOGBACKUP mode is turned on, the log file is pinned until it is backed up using BACKUP LOGS. The backup command unpins the log, not BACKUP SNAPSHOT.

You cannot perform a BACKUP SNAPSHOT while in Read-Only (RO) isolation level.

Note that BACKUP SNAPSHOT does not backup a single file; you must provide directory name, not a file name.

FROM database name

This clause specifies the name of the database.

If the FROM clause is omitted, the database is assumed to be the one currently connected to the active cursor.

TO directory name

This specifies the destination directory for the backed up files.

This backup directory pathname can refer to the client or the server computer. You can specify the pathname with the ON SERVER or ON CLIENT clauses. If you omit the TO clause, the current directory on the client computer is used as

If the destination files of the backup already exist (and the PAUSE option is turned ON), you are prompted with the following message before the files are overwritten:

Backup file already exists. Overwrite it (Y/N)?

It is a good idea to place the backup on a different drive or device to isolate it from failure of the drive on which the database is located.

ON CLIENT or ON SERVER

This specifies whether the destination directory for the backed up files is on the client or the server. The default is ON CLIENT.

Example

The following example assumes that you have already entered a SET SERVER command.

BACKUP DATABASE TO \DEMOBKUP; DATABASE BACKED UP

RELEASE LOG;

RELEASE LOG COMPLETED BACKUP LOGS TO \DEMOBKUP; 2 LOGS BACKED UP

See also

RELEASE LOG RESTORE SET SERVER

BEGIN CONNECTION

This command establishes a new connection to a specified database. When you supply the name of the database along with the username and password required for its access, this opens a connection handle which identifies the specified database. You BEGIN CONNECTION connection_name

In document SQLBase. SQLTalk Command Reference (Page 40-45)

Related documents