Oracle9i Data Guard Concepts and Administration Release 2 (9.2) Part Number A96653-01 |
|
This chapter explains how to create a physical standby database and start applying redo logs to it. This chapter includes the following main topics:
Table 3-1 provides a checklist of tasks that you perform to create a standby database and synchronize it so that it is ready to begin managed recovery. Each step includes a reference to a section that provides additional information.
Note: Use the Create Configuration Wizard that comes with Oracle9i Data Guard Manager to automatically perform all of the steps described in this chapter. |
Setting up a standby database for managed recovery requires you to perform a series of different tasks. After you have completed the preparation and initiated managed recovery, the standby database automatically and continuously applies redo logs as they are received from the primary database. Figure 3-1 shows the creation of a standby database.
Text description of the illustration sbr81101.gif
You can create a standby database on the same site as your primary database or on a separate site. If you create your standby database on the same site, follow the creation procedure carefully when creating the standby database files so that you do not overwrite files on the primary database.
The creation of the standby database files occurs in four stages:
Each standby database must be created from a backup of the primary database.
You can also use a single backup of the primary database to create up to nine standby databases, although the various standby databases in the environment do not have to be created from the same backup. (You can create an unlimited number of standby databases, but a single primary database can only support up to nine standby databases at a time.) Figure 3-2 shows that you can create one standby database from a backup of the primary database taken on January 20 and create another standby database from the backup taken on June 20. So long as you have the archived redo logs required to perform complete recovery of a backup, it can serve as the basis for a standby database.
Text description of the illustration sbr81104.gif
First, make backups of your primary database datafiles. You create the standby datafiles from these backups.
You can use any backup of the primary database so long as you have archived redo logs to completely recover the database. The backup can be old or new, consistent or inconsistent. Hot backups (or open backups) allow you to keep the database open while performing the backup. Nevertheless, you may prefer to make a new closed, consistent backup using the Recovery Manager utility (RMAN) to prevent the application of a large number of archived redo logs.
V$DATAFILE
fixed view to obtain a list of the primary datafiles. For example, enter:
SQL> SELECT NAME FROM V$DATAFILE; NAME ---------------------------------------------------------------------------- /oracle/dbs/tbs_01.dbf /oracle/dbs/tbs_02.dbf /oracle/dbs/tbs_03.dbf /oracle/dbs2/tbs_11.dbf /oracle/dbs2/tbs_12.dbf /oracle/dbs3/tbs_21.dbf /oracle/dbs3/tbs_22.dbf 7 rows selected.
SQL> SHUTDOWN;
SQL> STARTUP PFILE=initPRIMARY1.ora;
See Also:
Oracle9i Recovery Manager User's Guide to learn how to create a standby database with Recovery Manager |
After you have created the backups that will be used as the standby datafiles, you can create the standby database control file. The control file must be created after the latest timestamp for the backup datafiles.
ARCHIVE LOG LIST
command or query the V$DATABASE
view. Take the following steps:
SQL> STARTUP MOUNT PFILE=initPRIMARY1.ora
ARCHIVE LOG LIST
command to determine if the database is in ARCHIVELOG mode. For example:
SQL> ARCHIVE LOG LIST; Database log mode No Archive Mode Automatic archival Disabled Archive destination /oracle/dbs/arch Oldest online log sequence 0 Current log sequence 1
SQL> ALTER DATABASE ARCHIVELOG;
ARCHIVE LOG LIST
command again to verify the database has been placed in ARCHIVELOG mode. For example:
SQL> ARCHIVE LOG LIST; Database log mode Archive Mode Automatic archival Disabled Archive destination /oracle/dbs/arch Oldest online log sequence 0 Next log sequence to archive 1 Current log sequence 1
To enable the automatic archiving of the online redo logs, you must set LOG_ARCHIVE_START=true
in the initialization parameter file. However, this does not have to be done before you create the standby control file.
See Also:
SQL*Plus User's Guide and Reference for additional information on the |
oracle/dbs/stbycf.ctl
on the primary site, enter the following:
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/oracle/dbs/stbycf.ctl';
The filename for the created standby control file must be different from the filename of the current control file of the primary database. You can also use RMAN to create the standby database control file.
See Also:
Oracle9i SQL Reference for additional information on the |
After you have successfully created the standby datafiles and control file, copy the files to the standby site using an operating system utility.
If the standby database is on | Then you |
---|---|
A separate site with the same directory structure as the primary database |
Can use the same path names for the standby files as the primary files. In this way, you do not have to rename the primary datafiles in the standby control file. |
The same site as the primary database, or the standby database is on a separate site with a different directory structure |
Must rename the primary datafiles in the standby control file after copying them to the standby site. You can:
|
Use operating system commands or utilities to perform the following copy operations to the standby location:
Do not copy temporary tablespaces. Use an appropriate method for copying binary files.
See Also:
Section 6.3.6 for more information about creating temporary tablespaces and Section 10.1.2 for a scenario showing how to copy files to a standby site |
Once you have configured the primary database initialization parameter file, you can duplicate the file for use by the standby database. The procedure for creating the standby initialization parameter file is as follows:
|
Copyright © 1999, 2002 Oracle Corporation. All Rights Reserved. |
|