Setting up a second node in an Oracle RAC (Real Application Clusters) environment requires careful configuration to ensure consistency across nodes. This guide walks you through enabling RAC in an existing Oracle Home and configuring the second instance properly.
1. Relink library binaries to enable RAC on a particular Oracle Home
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk rac_on
make -f ins_rdbms.mk ipc_rds ioracle2. Configure system parameters
a. Using spfile(Recommended)
Connect as sysdba and run
ALTER SYSTEM SET instance_name=DBNAME2 SCOPE=SPFILE SID='DBNAME2';
ALTER SYSTEM SET instance_number=2 SCOPE=SPFILE SID='DBNAME2';
ALTER SYSTEM SET thread=2 SCOPE=SPFILE SID='DBNAME2';b. Using pfile
Add the following entries
DBNAME1.instance_number=1
DBNAME2.instance_number=2
DBNAME1.local_listener='node1-hostname:port'
DBNAME2.local_listener='node2-hostname:port'
DBNAME1.thread=1
DBNAME2.thread=2
DBNAME1.undo_tablespace='UNDOTBS1'
DBNAME2.undo_tablespace='UNDOTBS2'3. Add redo logs and UNDO Tablespace for Node2 --- Create only if not present
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 1 SIZE <size>;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 2 SIZE <size>;
CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '+DATAC1' SIZE <size>;4. Add database and instances to the Cluster
Using srvctl to register the database and instances with the cluster.
srvctl add database -d DBNAME -o <ORACLE_HOME>
srvctl add instance -d DBNAME -i DBNAME1 -n node1-hostname
srvctl add instance -d DBNAME -i DBNAME2 -n node2-hostname
srvctl setenv database -d DBNAME -T TNS_ADMIN=$ORACLE_HOME/network/admin/DBNAME
srvctl getenv database -d DBNAME5. Move SPFILE to ASM Diskgroup
create spfile='+DATAC1/spfileDBNAME.ora' from pfile;
- Add the above entry in
initDBNAME1.oraunder $ORACLE_HOME/dbs
- Copy the initDBNAME1.ora file from Node1 to Node2 as initDBNAME2.ora
cat initDBNAME1.ora
spfile='+DATAC1/spfileDBNAME.ora' 6. Copy Required Network and Security Files to Node2
Copy the following from Node1 to Node2:
tnsnames.ora- sqlnet.ora
- Password file
- Wallet files (if used)
Make necessary hostname adjustments where required.
7. Start the Database Using srvctl
Finally, start the database:
srvctl start database -d DBNAME
srvctl status database -d DBNAME
Comments
Post a Comment