...
Code Block |
---|
|
MOUNT DATABASE 'backup_database_path' TO mount_name; |
Example:
Code Block |
---|
|
MOUNT DATABASE '/home/machbase/backup' TO mountdb; |
UNMOUNT
Ifthemounteddatabaseisnolongerrequired,deleteitbyexecutingUNMOUNT command.
...
Code Block |
---|
|
UNMOUNT DATABASE mount_name;
|
Example:
Code Block |
---|
|
UNMOUNT DATABSE mountdb; |
Retrieve Data from Mounted Database
When you run a query against data from the backup database, the same SQL statements are used for querying data from currently operating database.
It only allows SYS user to retrieve data from the mounted database. When you retrieve the data from a table, it is required to input both mount_name and user_name in front of table_name by using "." as a delimiter. mount_name refers to a specified database from the mounted databases and user_name indicates the information of the user who has the authentication over the table of the mounted database.
Syntax:
Example:
Code Block |
---|
|
SELECT column_name FROM mount_name.user_name.table_name; |
Example:
Code Block |
---|
|
SELECT * FROM mountdb.sys.backuptable; |