This example of an input script shows you how to use
the Database
Manager CLI to set up a standby
instance and start operating it as
an active instance.
For more detailed information on
working with the Database Manager CLI administration tool, and the meaning of
the DBM commands, see Database
Manager
CLI: SAP
DB
7.4.
This example is valid for database instances with a database version lower than 7.4.04.
Initializing an existing standby instance:
db_offline
db_admin
util_connect
util_execute init config
util_release
The command init_config deletes all data in the database instance permanently.
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
Importing the data backup:
util_connect
recover_start <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 file save.log <nnn> in the path <path_log>.
Importing the log backups:
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
…
The return code is –8020 (another medium is needed).
Starting the standby instance as an active
instance:
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 the operational state
ONLINE at the
same time.
To do this, use the command recover_cancel.
As of Version 7.4.03, this command switches the state of a database instance to OFFLINE. Before you can specify other commands, you must first use the command db_admin to switch the operational state of the standby instance to ADMIN.