Mimer SQL System Management Handbook TOC PREV NEXT INDEX

Mimer Developer Site

www.mimer.com/developer


SQL Statements for Backing-up Databanks


Refer to the Mimer SQL Reference Manual for a detailed description, and syntax definition, of the SQL system management functions. A brief description of the purpose of each function appears here.

Online Backup Commands

The SQL system management statements that can be used to take backups are:

Command
Description

START BACKUP

starts a backup transaction and clears the log records for the databank backups taken within it.

CREATE BACKUP

creates a backup within a backup transaction. By default an online backup is created, but optionally an exclusive backup can be initiated, which will lock the databank from other users.

COMMIT BACKUP

commits a started backup transaction.

ROLLBACK BACKUP

aborts a backup transaction and ensures that all log records are preserved.

To use these statements to take a databank backup, the user must either be the creator of the databank, or have BACKUP privilege.

When the SQL statements are used to take a backup of a databank, the entire process of taking a databank backup is handled automatically.

The use of a backup transaction ensures that the backups taken within the transaction are consistent with one another, as each backup is effectively taken at the same point in time. Log records are cleared for successfully backed up databanks when the backup transaction is committed. If LOGDB is included in the backup transaction all log records are cleared.

Online/Offline Commands

The SQL system management statements (typically used when taking databank backups using the host file system) that can be used to set a databank, shadow or the whole database online or offline are:

Command
Description

SET DATABASE OFFLINE

sets all non-system databanks offline, and makes the database unavailable. If one of the databanks cannot be set offline (e.g. because it is being used), the command will fail.

SET DATABASE ONLINE

sets all databanks online, optionally clearing all records from LOGDB and makes the database available.

SET DATABANK OFFLINE

sets a databank offline and the databank pages are updated with all changes made by committed transactions so far. The databank file is closed (except SYSDB, which always remains open as long as the database server is running) so the file can be copied, and it becomes unavailable to database users.

SET DATABANK ONLINE

sets a databank online, making it available, optionally clearing records from LOGDB.

SET SHADOW OFFLINE

sets a list of shadows offline, making them unavailable.

SET SHADOW ONLINE

sets a list of shadows online, making them available, optionally clearing records from LOGDB.

A user setting the database online/offline, must have BACKUP privilege and must be the only user accessing the database.

A user setting a databank or a shadow online/offline, must either be the creator of the databank or have BACKUP privilege.

Restore Command

The SQL system management statement used to recover a databank in the event of it being damaged or destroyed is:

Command
Description

ALTER DATABANK RESTORE

used to restore a databank from a backup copy by using a LOGDB backup and/or the information currently in the LOGDB system databank.

A user using this function to restore a databank must be the creator of the databank or have BACKUP privilege.



Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL System Management Handbook TOC PREV NEXT INDEX