Database Mount
MOUNT
To run the mount command, the backup database pathname and the name of the database to be mounted must be entered.
The backup database path sets the location of the directory executed by the backup command. The name of the database to be mounted must be given a separate name to distinguish it from the active database.
The backup database pathname can be an absolute pathname (a pathname beginning with the "/" character), or a relative pathname based on $MACHBASE_HOME/dbs with the same rules as the backup command.
Syntax:
MOUNT DATABASE 'backup_database_path' TO mount_name;
Example:
MOUNT DATABASE '/home/machbase/backup' TO mountdb;
UNMOUNT
If the mounded database data no longer needs to be read, use the UNMOUNT command to release the mounted state.
Syntax:
UNMOUNT DATABASE mount_name;
Example:
UNMOUNT DATABASE mountdb;
Reading Data from Mounted Database
When retrieving data from a mounted database, use the same SQL statement as before.
Only the SYS user can read the mounted data. To specify the mounted database table in an SQL statement, the mount_name and user_name must be set connected to a "." character.
Syntax:
SELECT column_name FROM mount_name.user_name.table_name;
Example:
SELECT * FROM mountdb.sys.backuptable;