

How to set up a standby database
(Oracle 8i/9i - Windows).
Note: More specific information is contained within
file#39
which is created during the file generation process. File#39
contains the actual file names of the scripts which have been custom-generated
for a particular database instance.
1) Open the Installgen application and fill in the database
parameters as would be done to create any new database. It is important
for the Standby SID to be different from the primary database SID in
order for the databases to be accessed via different tnsnames.ora entries.
2) If a media manager is being used for RMAN backups,
the standby server will need access to the tape drive through the media
manager software. The RMAN
Channel type field is used for the media manager device specifier.
Otherwise, the backup location on each server will need to be large
enough to store a full database backup of the primary database.
3) Press the Generate button to create the installation
scripts.
4) Use the scripts to install the Oracle software on the
standby server. The standby server must be using the same version, patchlevel
and OS as the primary database. Edit the scripts if needed to change
the default patchlevel which will be installed.
5) The following files are used for the standby database
setup after Oracle software
has been installed and patched on the standby server:
file#77
file#78
file#79
file#80
file#81
file#70
file#72
file#75
file#49
file#74
file#11
(It is generally recommended that all of the generated
files be copied to the primary server in case they are needed.)
6) Run the file#77
Perl script on the primary server. Follow the prompts.
7) You will be prompted to copy file#78
to the standby server. Run the file#78
Perl script, and follow the prompts.
8) An RMAN backup will be done on the primary server,
if requested. RMAN will limit its I/O consumption to a rate of 1500K
per second in order to allow the backup to be performed with the primary
database operating in production mode. This parameter can be modified
within script file#77
if necessary. The primary server's init.ora parameters are modified
dynamically without stopping/restarting the instance.
9) Once the RMAN backup has completed, the configuration,
standby controlfile, backup and archived redo log files are copied to
the standby server via a network share. This shared folder on the standby
server needs to correspond to the directory where RMAN backed up the
primary database - unless a media manager was used to back the database
directly to tape.
10) On the standby server, the archived redo log files
will be copied to the archivelog directory so that they will be available
for the RMAN duplicate standby database process. The primary and standby
versions of the tnsnames.ora, listener.ora and other configuration files
will be copied into the appropriate locations. The OracleRotateAlertLogSID
and OracleStandbyStartupSID services will be created on the standby
server.
The OracleRotateAlertLogSID service renames the Oracle
Alert log for the instance every time the server is restarted. This
task is done during system startup because the file is in use while
the database is running.
The OracleStandbyStartupSID service automatically starts
up the standby instance in managed recovery mode every time the server
is restarted. The OracleStandbyStartupSID.log file is written to the
server scripts directory each time the OracleStandbyStartupSID service
runs.
11) The standby server is started in NOMOUNT mode in preparation
for the RMAN duplicate standby database procedure.
12) RMAN is run on the primary server via an auxiliary
channel with a connection to the standby server. RMAN creates standby
controlfiles on the standby server with the same names and locations
as the primary server. RMAN then creates datafiles with the same names
and paths as the tablespaces in the primary database. RMAN then applies
all of the archivelog files up until the point where the standby controlfile
was created.
13) The standby server instance is then started in managed
recovery mode.
14) After the standby server is running in managed recovery
mode, the OracleRotateAlertLogSID and OracleStandbyStartupSID services
need to be reconfigured in the Services control panel to log onto the
server by using an account other than the LocalSystem account. Any account
which is a member of the ORA_DBA group and which has the Local User
Right to Run as a Service and Log on as a Batch job may be used. By
default, the Oracle installer configures the Administrator account as
a member of the ORA_DBA group.
15) During the standby server setup process the file#13
script will be configured to run via an AT job at 11:55PM. This script
removes old log files, archivelog and backup files to prevent the disk
from filling up. (Since the standby database is identical to the primary
database, it may be configured for RMAN backups to reduce the impact
on the primary database. RMAN backups done in this manner must use the
controlfile to store backup information without using an RMAN repository
on the OEM/OMS server.)
16) Install the file#72
file as tnsnames.ora on each client computer which will be connecting
to the primary database. This tnsnames.ora file is configured with transparent
application failover to allow the client to automatically attempt to
connect to the standby database if the primary database has failed.
17) Use the SID_standbydb_change_role.pl
Perl script to manage the standby configuration.
The SID_standbydb_change_role.pl Perl script provides the following
features:
primary to standby switchover
primary to standby failover
standby switchover to primary
standby failover to primary
standby to read-only
read-only to standby

