This example of an input script shows you how to use the CLI Database Manager to set up a standby instance and start operating it as an active instance.
For more detailed information on working with the CLI Database Manager administration tool, and the meaning of the DBM commands, see Database Manager CLI.
Switch an
instance to ADMIN mode:
db_offline
db_admin
Creating
a backup medium in the
standby instance for importing a complete data backup from the
original instance:
medium_put <medium_name_data> <path_data> <medium_type>
DATA
Initializing
the existing standby instance and importing the data backup:
util_connect
db_activate RECOVER <medium_name_data>
util_release
Creating a
backup medium in the standby instance for importing the
log backups from the
original instance:
medium_put <medium_name_log> <path_log>\save.log FILE
LOG
The log backups are numbered automatically and saved in the save.log <nnn> file at the <path_log> path. Type in the db_restartinfo command to find out which log standby has to be imported first. The Used Log Page line shows the next log page from which log entries have to be read.
The log
history in the original system shows which log pages are included in the log
backup. The following commands give you access to the log history:
backup_history_open
backup_history_list
backup_history_close.
Importing
the backup logs:
db_offline
db_admin
util_connect
recover_start <medium_name_log> LOG 001
recover_replace <medium_name_log> <path_log>\save.log
002
recover_replace <medium_name_log> <path_log>\save.log 003
...
recover_ignore
In this case, the standby instance does not include the changes that have not yet been imported with the log backups from the original instance.
You can also terminate the import of the log backups without starting the standby instance in ONLINE operational state at the same time. To do this, use the command recover_cancel. The database instance is set to OFFLINE mode. Before you are able to run other commands, you must first use the db_admin command to switch the operational state of the standby instance to ADMIN.
See also: