Amazon books

Tuesday, November 10, 2009

Convert Single Instance to RAC Database 10g

--Create bdumo,cdump and adump directories on both nodes
mkdir 1
mkdir -p /dbdbname/admin/1/bdump
mkdir -p /dbdbname/admin/1/cdump
mkdir -p /dbdbname/admin/1/udump
mkdir -p /dbdbname/admin/1/adump

mkdir 2
mkdir -p /dbdbname/admin/2/bdump
mkdir -p /dbdbname/admin/2/cdump
mkdir -p /dbdbname/admin/2/udump
mkdir -p /dbdbname/admin/2/adump


-On First Node:
--Install Oracle Clusterware (If you don't have it already installed)
--Create the listener on both nodes
--Backup the database and restore it on a shared location like ASM
--Add the following parameters to your pfile
*.cluster_database = TRUE
*.cluster_database_instances = 2
*.undo_management=AUTO
1.undo_tablespace=undotbs (undo tablespace which already exists)
1.instance_name=1
1.instance_number=1
1.thread=1
1.local_listener=LISTENER_DB_hostname01
2.instance_name=2
2.instance_number=2
2.local_listener=LISTENER_DB_hostname02
2.thread=2
2.undo_tablespace=UNDOTBS2
2.cluster_database = TRUE


--Copy the $ORACLE_HOME/dbs/init.ora to $ORACLE_HOME/dbs/init.ora on node1 and on node2 as SID2


--After create the listener on both nodes, add them at tnsnames.ora file
LISTENER_BPLS_hostname01 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname01-vip.b2winc.com)(PORT = 1539))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.201.31)(PORT = 1539))
)



LISTENER_BPLS_hostname02 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname01-vip.b2winc.com)(PORT = 1539))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.201.31)(PORT = 1539))
)


--Use an pfile to startup nomount and them create the spfile

SQL>startup nomount pfile='temp_pfile.ora'

SQL>create SPFILE='+DG_dbname_FRA//spfile.ora' from pfile='temp_pfile_1.ora';


SQL>shutdown immediate

SQL>startup mount


--Create UNDO tablespaces for both nodes
SQL>create undo tablespace UNDOTBS1 datafile '+DG_dbname_FRA' size 500M;
SQL>create undo tablespace UNDOTBS2 datafile '+DG_dbname_FRA' size 500M;

--Create redo groups for thread 2
SQL>alter database add logfile thread 2 group 4 size 50M;
SQL>alter database add logfile thread 2 group 5 size 50M;
SQL>alter database add logfile thread 2 group 6 size 50M;

--Open the database and enable thread 2
SQL>alter database open;

SQL>alter database enable public thread 2;

--On second node, copy the init file, change the name to dbnameSID2.ora and start the database
export ORACLE_SID=dbname.ora
sqlplus / as sysdba
SQL>startup


--Finally create services
srvctl add database -d -o /dbdbname/products/rdbms -p /dbdbname/products/rdbms/init.ora

srvctl add instance -d -i 1 -n hostname01

srvctl add instance -d -i 2 -n hostname02


=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname01-vip.b2winc.com)(PORT = 1539))
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname02-vip.b2winc.com)(PORT = 1539))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = )
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)



Best Regards,
Paulo Portugal

No comments:

Post a Comment