SQL Statements for Backing-up Databanks
Refer to the Mimer SQL Reference Manual, Chapter 12, SQL Statement Descriptions 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:
starts a backup transaction and clears the log records for the databank backups taken within it. 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. commits a started backup transaction. 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.
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:
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. sets all databanks online, optionally clearing all records from LOGDB and makes the database available. 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. sets a databank online, making it available, optionally clearing records from LOGDB. sets a list of shadows offline, making them unavailable. 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.
The SQL system management statement used to recover a databank in the event of it being damaged or destroyed is:
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