3.3 Installation of Oracle RAC
Note!
This section is not applicable when the Oracle database is installed in Amazon Web Services.
With Oracle Real Application Clusters (RAC) it is possible to use two database instances at the same time, when extracting data from the database.
The settings assume that an existing Oracle Instance is ready for use.
- Install Oracle RAC, create a database with shared storage on the cluster nodes and listeners according to normal Oracle RAC procedures.
- Modify install.xml to include the SID of one of the instances of the RAC cluster and modify other obvious information (as location of the shared storage place of the database files and the Oracle install.)
- Modify and run Oracle scripts.
Modify oracle_create_instance.sh
The following passage in the oracle_create_instance.sh should be commented out. It is, however, important to make sure that listeners are running correctly for RAC instances/services since the modification of the script will cause it to not check for presence of running listeners.# Make sure that the listener is up for our instance. # It is not really needed in this script but it will be # necessary in the installer. # lsnrctl status | grep "Instance \"${ORACLE_SID}\"" > /dev/null # # if [ $? -ne 0 ] ; then # echo "The listener for $ORACLE_SID is not running, abort!" 1>&2 # exit 1 # fi
Note!
Make sure that each listener and instance running get a row each in the init<instance>.ora files located in $ORACLE_HOME/dbs for each of the nodes.
Modify oracle_create.sql
The following passage should be commented out. The script will then no longer create a new database/instance, instead it will make tables and users in the RAC instances.-- Create the database -- prompt Creating database -- CREATE DATABASE orac1 -- DATAFILE '/opt/oradata/orac/mz/ts_orac1_system.dbf' -- SIZE 250M REUSE AUTOEXTEND OFF -- sysaux datafile '/opt/oradata/orac/mz/ts_orac1_sysaux.dbf' -- size 100M autoextend off -- UNDO TABLESPACE MZ_UNDO_TS_01 -- DATAFILE '/opt/oradata/orac/mz/ts_orac1_undo01.dbf' -- SIZE 125m REUSE AUTOEXTEND OFF -- LOGFILE -- group 1 ('/opt/oradata/orac/mz/ts_orac1_log01.log') size 15M, -- group 2 ('/opt/oradata/orac/mz/ts_orac1_log02.log') size 15M, -- group 3 ('/opt/oradata/orac/mz/ts_orac1_log03.log') size 15M, -- group 4 ('/opt/oradata/orac/mz/ts_orac1_log04.log') size 15M;
When running the *.sql scripts, the original file $ORACLE_HOME/dbs/init*.ora (* = instance name) is replaced with a new .ora file. The original file should be restored, hence the file created by should not be used. The easiest way to restore the init<instance>.ora file is to copy it from the second node, since they should be identical on both hosts. An example of a init<instance>.ora is shown next:
oracga1.local_listener="(address=(protocol=tcp) (host=10.0.0.111)(port=1521))" oracga2.local_listener="(address=(protocol=tcp) (host=10.0.0.112)(port=1521))" SPFILE='+ORAC50/oracga/spfileoracga.ora'
The three occurrences of create tablespace should also be changed. Remove the path after
DATAFILE
and removeREUSE
beforeAUTOEXTEND
, so it will look like this:create tablespace ts_mz_tab datafile size 200m autoextend off extent management local uniform size 250k SEGMENT SPACE MANAGEMENT AUTO;
Run
oracle_create_instance.sh
Note!
If the script fails, you must manually drop all objects in the
mzadmin
andmzowner
schemas before you run it again.