Appendix: Preparing a Replica Oracle Database
This appendix describes how to set up a replica off-host Oracle database to be used for decision support as described in Creating an Off-Host Replica Database.
To prepare a replica Oracle database on a host other than the primary host:
-
If not already present, install the Oracle software onto the host's local disks. The location of the Oracle home directory ($ORACLE_HOME) is used for the database instance that is created from the snapshot volumes.
Note
In the examples shown here, the home directory is /rep/oracle in the local disk group, localdg. If required, you could instead choose to use the same file paths and database name as on the primary host.
-
In the local disk group, localdg, use the following command to create the volumes that are to be used for the redo logs and archived logs of the replicated database:
# vxassist -g diskgroup make volume size
For example, to create a 1-gigabyte redo log volume rep_dbase_logs and a 2-gigabyte archived log volume rep_dbase_arch:
# vxassist -g localdg make rep_dbase_logs 1g
# vxassist -g localdg make rep_dbase_arch 2g
-
Make the file systems for the redo logs and archive logs in the volumes created in the previous step using the following command:
# mkfs -F vxfs /dev/vx/rdsk/diskgroup/volume
In this example, the commands would be:
# mkfs -F vxfs /dev/vx/rdsk/localdg/rep_dbase_logs
# mkfs -F vxfs /dev/vx/rdsk/localdg/rep_dbase_arch
-
Create the mount points that are to be used to mount the new database. For example, create /rep/dbase_vol for the snapshot of the tablespace volume, /rep/dbase_logs for the redo logs, and /rep/dbase_arch for the archived logs:
# mkdir -p /rep/dbase_vol
# mkdir -p /rep/dbase_logs
# mkdir -p /rep/dbase_arch
-
Mount the redo log and archive log volumes on their respective mount points using the following command:
# mount -F vxfs /dev/vx/dsk/diskgroup/volume mount_point
In this example, the commands would be:
# mount -F vxfs /dev/vx/dsk/localdg/rep_dbase_logs \
/rep/dbase_logs
# mount -F vxfs /dev/vx/dsk/localdg/rep_dbase_arch \
/rep/dbase_arch
-
As the Oracle database administrator on the primary host, obtain an ASCII version of the current Oracle control file using the following SQL command:
alter database backup controlfile to trace;
This command writes a text version of the control file to the directory $ORACLE_HOME/admin/dbase/udump. See Text Control File for Original Production Database for an example.
-
Modify the text version of the control file created in the previous step as described below to create a new SQL script to set up the replica database:
- If required, change the locations defined under LOGFILE for the log files. For example, change lines of the form:
GROUP N '/dbase_vol/logN' SIZE 52428288,
GROUP N '/rep/dbase_vol/logN' SIZE 52428288,
- If required, change the locations defined under DATAFILE for the tablespaces. For example, change lines of the form:
'/dbase_vol/table',
'/rep/dbase_vol/table',
- If required, change the following line:
CREATE CONTROLFILE REUSE DATABASE "odb" NORESETLOGS ARCHIVELOG
CREATE CONTROLFILE SET DATABASE "ndb" RESETLOGS NOARCHIVELOG
where odb is the name of the original database and ndb is the name of the replica database (DBASE and REP1 in the example). Note that to reduce unnecessary overhead, the new database is not run in archive log mode.
See SQL Script to Create Control File for an example.
-
Copy the Oracle initialization file (for example, initdbase.ora; see Initialization File for Original Production Database) for the original database to a new initialization file for the replica database (for example, initREP1.ora; see Initialization File for Replica Oracle Database).
Edit the copied file and change the definitions of the following parameters:
background_dump_dest Background dump location.
core_dump_dest Core dump location.
db_name Database name to the name of the replica database.
log_archive_dest Archive log location, set equal to the path created in step 4 (for example, /rep/dbase_arch).
log_archive_start Archive log mode, log_archive_start, to FALSE.
user_dump_dest User dump location.
You may also wish to reduce the resource usage of the new database by adjusting the values of parameters such as db_block_buffers. See the Oracle Database Administrator's Guide for more information.
-
Copy the Oracle remote password file (for example, orapwdbase) in $ORACLE_HOME/dbs to a new file (for example, orapwREP1).
|