| Lesson 6 || Automated standby database |
| Objective || Set up a standby database in Oracle |
Automated Standby Database
In the event of a
- power failure,
- hardware failure, or
- a physical disaster,
such as fire, flood, or earthquake, that causes an instance to crash, the automated standby database feature within Oracle can be a data lifesaver.
While Oracle has provided the standby database feature for a number of years, the technology is significantly extended within Oracle8i
Copying or cloning the production database initially creates a standby database. As archived redo logs are generated on the production database, they are concurrently applied to the standby
database. This allows the standby database to remain synchronized with the production database.
Oracle8i transfers logs automatically
Prior to Oracle8i, the archived redo logs had to be manually transported or copied to the standby database and manually applied. With the automated standby database within Oracle8i,
the archived redo logs are automatically transferred and applied.
This eliminates the need for manual procedures to copy and transmit the redo logs and the need for the operator at the backup site to manually specify which logs to
apply. Automating this process eliminates a potential source of human error and increases database and application availability.
Up to four standby databases can be maintained in a constant state of media recovery through the automated application of archived redo log
files from the primary site.
The automated standby database resides at any location, taking over the processing from the primary production
database, and providing nearly continuous database availability. In the event of a failure of the primary database, one of the standby systems
can be activated, providing immediate system availability. Oracle provides the commands and internal verifications for the creation and
maintenance of the standby databases.
A standby database uses the archived redo log information from the primary database, so it is ready to perform recovery and go online at any
time. When the primary database archives its redo logs, the logs must be transferred to the remote site and applied to the standby database.
The standby database is therefore always one or two logs behind the primary database in time and transaction history.
Creating a standby database
The following are the steps involved in creating a standby database:
- Make a copy of the primary init.ora file to create a standby init.ora file.
- Obtain a list of datafiles within the production database by querying the
V$DATAFILE system view.
- Shut down your primary database cleanly.
- Make a consistent backup of the datafiles of your primary database using an O/S utility.
- Open the primary database and create the control file for your standby database.
- Archive the current online redo logs of the primary database.
- Transfer the standby database control file, archived log files, and backed up datafiles to the standby site/host using operating system commands.
Archiving the current online redo logs ensures consistency among the datafiles, the control file, and the redo log files.
Oracle Backup Recovery
The following steps are involved in placing the standby database in manual recovery mode:
- Configure the initialization parameters for the standby site
- Start the standby instance and mount it in standby mode
- Transfer the archived redo logs to the desired location on the standby host
- Place the standby database in managed recovery mode
The standby database can be on the same host as the production database or can be on a different host. It is recommended to have the same file
structure on the standby database host as in the primary database host.
Moving archived files to either a local or remote host, where the standby database resides, is automated with Oracle8i. Oracle keeps the standby database synchronized with the primary database by waiting for archived logs from the primary and then automatically applying them to the standby. This feature eliminates the need for manually providing the recovery process along with the filenames of the archived logs.
For details on operating system changes for creating a standby database, please refer to Oracle’s Operating system-specific manuals. For details on creating a standby database on a different host machine or with a different directory structure, refer to Oracle Backup and
Recovery Documentation. The next lesson explains more about read-only databases.