How to Migrate Single Standalone to 2-node RAC Cluster?
Non-RAC
Single Standalone server: SSSever
OS RHEL4 U6
Database Name: ProdDb
DB Version : 10.2.0.3
ASM: Yes
Diskgroups: +DG1 and +DG2
Backup: /backup/ProdDb
Archivelogs: one copy to +DG2 and another set to ASM
Homes: Both ASM and ORACLE_HOME on /d01/app/oracle/product/10.2.0/db_1
CPU patches: July'08
Intented New RAC Cluster:
Node1: LinuxServer-01
Node2: LinuxServer-02
OS RHEL4 U6 (on both nodes)
CRS version: 10.2.0.3
DB version 10.2.0.3
ASM: Yes
ORA_CRS_HOME /d01/app/oracle/product/10.2.0/crs
ASM_HOME /d01/app/oracle/product/10.2.0/asm
ORACLE_HOME /d01/app/oracle/product/10.2.0/db_1
CPU Patcheset level July'08
Backup: Locally mounted on LinuxServer-02:/backup and remotely mounted to LinuxServer-01:/backup with following options
192.168.102.19:/backup on /backup type nfs (rw,bg,rsize=16384,wsize=16384,hard,noac,actimeo=0,intr,addr=192.168.102.19)
RAC creation
1) create 2 node RAC Cluster with 10gR2 (10.2.0.1)
A) with three homes, ORA_CRS_HOME, ASM_HOME and ORACLE_HOME on each node)
/d01/app/oracle/product/10.2.0/crs
/d01/app/oracle/product/10.2.0/asm
/d01/app/oracle/product/10.2.0/db_1
B) Start ASM and create same diskgroup names as you are using on Singles Stand Alone server.
(Assuming you are using ASM on Single Standalone server like I do with two diskgroups called +DG1 and +DG2)
+DG1 --> For Datafiles, controlfile, spfile
+DG2 --> For controlfile, archivelog, flash_recovery, redologs
2) Upgrade CRS to 10.2.0.3 (or 10.2.0.4 depending on you need)
2) Upgrade ASM_HOME and ORACLE_HOME to 10.2.0.3
3) Upgrade Opatch Utility to 10.2.0.4.0
4) Apply all Oct'08 CPU patches on both ASM_HOME and ORACLE_HOME (Although CPU patches on ASM_HOME is not required, but its good to have).
Database Migration Steps:
1) Once the RAC is created, create a new temporary database called TempDb from dbca and select both nodes. (this will create necessary files and listener and remote_listener).
2) Send the backups from SSSever:/backup/ProdDb to newly created RAC (to node1)
3) Restore init.ora from backup
4) Make changes in init.ora
5) Create all necassary directories (adump,bdump,cdump,udump).
6) Restore controlfile.
7) Restore Database as you would restore on a single standalone.
8) Recover Database as you would recover on a single standalone.
9) Open database with open resetlogs (RMAN> Alter database open resetlogs;)
10) Shutdown database (RMAN> shutdown immediate;
For the sample of technical details of the above step 10 steps from , go to .
Coversion from single-standalone (node1) to RAC (both nodes) Steps:
1) backup critical files before Migration
a) tnsnames.ora
b) listener.ora
c) sqlnet.ora
d) init.ora/spfile.ora
2) Create pwd file if it doesn't already exist in dbs folder.
export ORACLE_SID=ProdDb
Node1:
orapwd file=$ORACLE_HOME/dbs/orapwProdDb1 password='abc123' entries=5 force=y
Node2:
orapwd file=$ORACLE_HOME/dbs/orapwProdDb2 password='abc123' entries=5 force=y
3) Make RAC changes in initProdDb.ora file
Note: (Get the listener name from TempDb with "Show parameter listener" command.
cd $ORACLE_HOME/dbs
cp initProdDb.ora initProdDb.ora.bak
cp initProdDb.ora /tmp/initProdDb1.ora
vi /tmp/initProdDb1.ora
change
undo_management=Manual
and add the following.
*.cluster_database_instances=2
*.cluster_database=true
*.remote_listener='LISTENERS_TempDb'
ProdDb1.thread=1
ProdDb1.instance_number=1
ProdDb1.undo_tablespace='UNDOTBS1'
ProdDb2.thread=2
ProdDb2.instance_number=2
ProdDb2.undo_tablespace='UNDOTBS2'
****If the LISTENERS_TempDb is not already in the tnsnames.ora file, add the following entry into both nodes tnsnames.ora as follows:
LISTENERS_TempDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
)
4) Create new init.ora on both nodes pointing spfile on ASM.
On node1:
vi $ORACLE_HOME/dbs/initProdDb1.ora
spfile='+DG1/ProdDb/SPFILE/initProdDb.ora'
On node2:
vi $ORACLE_HOME/dbs/initProdDb2.ora
spfile='+DG1/ProdDb/SPFILE/initProdDb.ora'
5) Copy database spfile to ASM.
export ORACLE_SID=ProdDb1
sqlplus / as sysdba
startup pfile='/tmp/initProdDb1.ora'
create spfile='+DG1/ProdDb/SPFILE/initProdDb.ora' from pfile='/tmp/initProdDb1.ora'
shutdown immediate;
startup;
show parameter spfile;
6) Create temp TBS, UNDO TBS for both nodes and RAC Data Dictionary Views.
export ORACLE_SID=ProdDb1
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
--Create temporary tablespace if needed
CREATE TEMPORARY TABLESPACE temp05 TEMPFILE '+DATA/primedg/datafiles/temp05.dbf' SIZE 20M;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp05;
--Drop the existing temp tablespace (if any)
--Create dedicated undo tablespace for both nodes.
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE
'+DATA/PrimeDG/datafile/undotbs01.dbf' SIZE 50M AUTOEXTEND OFF
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;
CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE
'+DATA/PrimeDG/datafile/undotbs02.dbf' SIZE 50M AUTOEXTEND OFF
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;
alter system set undo_management=auto scope=spfile;
shutdown immediate;
startup
spool /tmp/catclust.log
@catclust
spool off
shutdown immediate;
7) Register the RAC instances with CRS and start instance1.
srvctl add database -d ProdDb -o $ORACLE_HOME
srvctl add instance -d ProdDb -i ProdDb1 -n LinuxServer-01
srvctl add instance -d ProdDb -i ProdDb2 -n LinuxServer-02
Important:
Please note that when adding instances from the "srvctl add instance...." command, Node name should be in exact case as it says in hostname. If not, the database services may have trouble starting later on.
Following might be necessary if your asm home is different than dbhome. (otherwise db instances wont start)
srvctl setenv database -d ProdDb -T TNS_ADMIN='/d01/app/oracle/product/10.2.0/asm/network/admin'
srvctl start instance -d ProdDb -i ProdDb1
8) Create redo logs for the second RAC instance.
sqlplus / as sysdba
SQL> select group#, member from v$logfile;
--Depending on your existing redo group members for node1, you need the same number of redo groups (and members) for node 2. In my situation, I have 2 redo log groups (Group1 and Group2 with one member each) for node1. I will add the similar for node2 (Group3 and Group4 with one member each) with the following commands. If I have my flash_recovery_area enable, redologs will be created in FRA. If not, you may need to provide a redo log destination.
SQL> alter database add logfile thread 2 group 3 size 50M;
SQL> alter database add logfile thread 2 group 4 size 50M;
SQL> select group#, member from v$logfile;
alter database enable thread 2;
9) Create undotbs for node2
Undotbs for node2 should already be created: Verify it exists.
select tablespace_name, file_name from dba_data_files where tablespace_name like 'UNDOTBS%';
shutdown immediate;
startup
10) Start up the second RAC instance.
srvctl start instance -d ProdDb -i ProdDb2
11) Add ProdDb entry in /etc/oratab on BOTH nodes.
Node1:
ProdDb:/u01/app/oracle/product/10.2.0/db_1:N
Node2:
ProdDb:/u01/app/oracle/product/10.2.0/db_1:N
12) Create new services
At this time we can create the database services to handle the workload. We are multiple ways of creating service. The most simple way is creating the services from dbca. Another advantage of creating service using dbca is, it will create the appropriate TNS entries. Otherwise, if using manual way of creating services using srvctl, you will need to add the tns entries in every node's tnsnames.ora file.
Option-1
If you chose to create dbca, it is very simple. Invoke dbca from node1 and choose service management and follow the instructions. We will need to create 4 services as below:
ProdDbSRV1 both-preferred Basic,
ProdDbSRV2 2nd-preferred,1st Available, Basic
ProdDbSRV3 2nd-preferred, 1st not used, Basic
ProdDbPREC both preferred, pre-connect.
Option-2
Now is the second way which uses srvctl to create service. However, like I mentioned before you will then need to add the tns entries in each of the node's tnsnames.ora file.
ProdDbSRV1 both-preferred Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_1p2p -r ProdDbSRV1,ProdDbSRV2 -P BASIC
ProdDbSRV2 2nd-preferred,1st Available, Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_2p1a -r ProdDbSRV2 -a ProdDbSRV1
ProdDbSRV3 2nd-preferred, 1st not used, Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_2p1n -r ProdDbSRV2
ProdDbPREC both preferred, pre-connect.
srvctl add service -d ProdDbSRV -s ProdDbSRV_1p2p_PC -r ProdDbSRV1,ProdDbSRV2 -P PRECONNECT
Now start all the services
srvctl start service -d ProdDb -s ProdDbSRV1_1p2p
srvctl start service -d ProdDb -s ProdDbSRV2_2p1a
srvctl start service -d ProdDb -s ProdDbSRV3_2p1n
srvctl start service -d ProdDb -s ProdDbSRV4_1p2p_PC
13) (Re)create DBconsole
drop existing dbconsole
emca -deconfig dbcontrol db -repos drop -cluster
create new dbconsole on db01
emca -config dbcontrol db -repos create -cluster
Move dbconsole to start from db02 (since /backup is local to db02)
emca -reconfig dbcontrol –cluster –EM_NODE LinuxServer-02 -EM_SID_LIST ProdDb1
14) Add Local listener parameter on both nodes (if not already set in init.ora file, check with show parameter local_listener)
alter system set local_listener='(address=(protocol=tcp)(host=192.168.102.38)(port=1521))' sid='ProdDb1';
alter system set local_listener='(address=(protocol=tcp)(host=192.168.102.39)(port=1521))' sid='ProdDb2';
15) Start dbconsole
emctl start dbconsole
Post Migration Steps
1) Take a backup from new RAC
2) increase the temp tbs to 2G
3) Delete the temporary database you created in Pre Migration Steps (use dbca).
4) Make sure each of the 3 home's bash profile will have TNS_ADMIN set to /d01/app/oracle/product/10.2.0/asm/network/admin and your listener is running from ASM home.
If there are any steps I am missing here or you think sequence of events are not right, plz update me. I am open for suggestions. Also below are some of the other files which you might need for reference.
P.S. -- Reference files are below:
1) ASM_HOME .bash_profile
Node1:
LinuxServer-01:> pwd
/home/oracle
LinuxServer-01:> vi .bash_asm_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export ORACLE_BASE=/d01/app/oracle
export ORACLE_SID=+ASM1
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/asm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
# Moid's Aliases
clear
#alias c='clear'
#alias l='ls -ltr -a'
#alias oh='cd $ORACLE_HOME'
#alias ob='cd $ORACLE_BASE'
#alias p='pwd'
#alias sq='sqlplus "/as sysdba"'
#alias tns='cd $TNS_ADMIN'
#alias bkp='cd /u99/backup/'
#alias s='su - oracle'
echo " **************************************************************************"
echo "| Node-1 ASM_HOME |"
echo " **************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
Node2:
LinuxServer-02:> pwd
/home/oracle
LinuxServer-02:> vi .bash_asm_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export ORACLE_BASE=/d01/app/oracle
export ORACLE_SID=+ASM1
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/asm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
# Moid's Aliases
clear
#alias c='clear'
#alias l='ls -ltr -a'
#alias oh='cd $ORACLE_HOME'
#alias ob='cd $ORACLE_BASE'
#alias p='pwd'
#alias sq='sqlplus "/as sysdba"'
#alias tns='cd $TNS_ADMIN'
#alias bkp='cd /u99/backup/'
#alias s='su - oracle'
echo " **************************************************************************"
echo "| Node-1 ASM_HOME |"
echo " **************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
2) ORACLE_HOME .bash_profile
Node1:
LinuxServer-01:> pwd
/home/oracle
LinuxServer-0:> vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Set up Terminal Type
if [ "$TERM" = "" ]
then
eval `tset -s -Q -m ':?hp'`
else
eval `tset -s -Q`
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff -ixany
stty susp "^Z"
stty erase ^?
# Set up editor
export EDITOR=vi
# Set Oracle initialization variables
export ORACLE_TERM=vt220
export ORACLE_BASE=/d01/app/oracle
export ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
export ORA_CRS_HOME=/d01/app/oracle/product/10.2.0/crs
export ASM_HOME=/d01/app/oracle/product/10.2.0/asm
export ORACLE_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export BASE_PATH=$PATH
export PATH=.:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/OPatch:$BASE_PATH:/sbin:/usr/ccs/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export TNS_ADMIN=$ASM_HOME/network/admin
export ORACLE_SID=ProdDb1
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
export LD_ASSUME_KERNEL=2.4.19
clear
alias c='clear'
alias ls='ls -ltr -a -h'
alias oh='cd $ORACLE_HOME'
alias ob='cd $ORACLE_BASE'
alias p='pwd'
alias sq='sqlplus "/as sysdba"'
alias tns='cd $TNS_ADMIN'
alias bkp='cd /backup/'
alias s='su - mmuhammad'
alias pmon='ps -ef |grep pmon'
echo "****************************************************************************"
echo "| Node-1 DATABASE HOME |"
echo "****************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
echo "|c| |s| |l| |oh| |ob| |p| |sq| |tns| |bkp| |bd| |cdump| |pmon| |smon| |alert|"
echo " "
echo "Are the instances running on both nodes? Checking...... "
echo " "
srvctl status database -d ProdDb
echo " "
echo "File System Usage"
df -h | awk '{print $6"\t",$2"\t",$3"\t",$4"\t",$5}'|grep -v "/dev/"
echo " "
Node2:
LinuxServer-02:> pwd
/home/oracle
LinuxServer-02:> vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Set up Terminal Type
if [ "$TERM" = "" ]
then
eval `tset -s -Q -m ':?hp'`
else
eval `tset -s -Q`
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff -ixany
stty susp "^Z"
stty erase ^?
# Set up editor
export EDITOR=vi
# Set Oracle initialization variables
export ORACLE_TERM=vt220
export ORACLE_BASE=/d01/app/oracle
export ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
export ORA_CRS_HOME=/d01/app/oracle/product/10.2.0/crs
export ASM_HOME=/d01/app/oracle/product/10.2.0/asm
export ORACLE_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export BASE_PATH=$PATH
export PATH=.:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/OPatch:$BASE_PATH:/sbin:/usr/ccs/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export TNS_ADMIN=$ASM_HOME/network/admin
export ORACLE_SID=ProdDb2
export NODENAME=LinuxServer-02
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
export LD_ASSUME_KERNEL=2.4.19
clear
alias c='clear'
alias ls='ls -ltr -a -h'
alias oh='cd $ORACLE_HOME'
alias ob='cd $ORACLE_BASE'
alias p='pwd'
alias sq='sqlplus "/as sysdba"'
alias tns='cd $TNS_ADMIN'
alias bkp='cd /backup/'
alias s='su - mmuhammad'
alias pmon='ps -ef |grep pmon'
echo "****************************************************************************"
echo "| Node-2 DATABASE HOME |"
echo "****************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
echo "|c| |s| |l| |oh| |ob| |p| |sq| |tns| |bkp| |bd| |cdump| |pmon| |smon| |alert|"
echo " "
echo "Are the instances running on both nodes? Checking...... "
echo " "
srvctl status database -d ProdDb
echo " "
echo "File System Usage"
df -h | awk '{print $6"\t",$2"\t",$3"\t",$4"\t",$5}'|grep -v "/dev/"
echo " "
3) initProdDb.ora (After RAC build)
ProdDb.__db_cache_size=1258291200
ProdDb.__java_pool_size=16777216
ProdDb.__large_pool_size=16777216
ProdDb.__shared_pool_size=788529152
ProdDb.__streams_pool_size=0
*._awr_flush_threshold_metrics=TRUE
*._os_sched_high_priority=0
*.audit_file_dest='/d01/app/oracle/admin/ProdDb/adump'
*.background_dump_dest='/d01/app/oracle/admin/ProdDb/bdump'
*.cluster_database=TRUE
*.cluster_database_instances=2
*.compatible='10.2.0.2.0'
*.control_files='+DG2/ProdDb/controlfile/control01.ctl','+DG1/ProdDb/controlfile/control02.ctl','/backup/ProdDb/CONTROLFILE/controlfile03.ctl'
*.core_dump_dest='/d01/app/oracle/admin/ProdDb/cdump'
*.cursor_sharing='SIMILAR'
*.db_block_size=8192
*.db_create_file_dest='+DG1'
*.db_create_online_log_dest_1='+DG2'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ProdDb'
*.db_writer_processes=3
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ProdDbXDB)'
*.event='10511 trace name context forever'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=+DG2/ProdDb/'
*.log_archive_dest_2='LOCATION=/backup/ProdDb/Archive'
*.log_archive_format='arch_%t_%s_%r.arc'
*.log_checkpoint_interval=0
*.log_checkpoint_timeout=900
*.log_checkpoints_to_alert=TRUE
*.open_cursors=1200
*.parallel_execution_message_size=8192
*.pga_aggregate_target=1000M
*.processes=1500
*.remote_listener='LISTENERS_TempDb'
*.remote_login_passwordfile='exclusive'
*.service_names='ProdDb,ProdDB1'
ProdDb1.service_names='ProdDb, ProdDB1_PRECONNECT, ProdDB1, SYS$SYS.KUPC$S_1_20070511175947.ProdDb.REGRESS.RDBMS.DEV.US.ORACLE.COM, SYS$SYS.KUPC$C_1_20070511175947.ProdDb.REGRESS.RDBMS.DEV.US.ORACLE.COM'
*.sessions=4200
*.sessions=4200
*.sga_max_size=3000M
*.sga_target=2000M
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.user_dump_dest='/d01/app/oracle/admin/ProdDb/udump'
ProdDb1.thread=1
ProdDb1.instance_number=1
ProdDb1.undo_tablespace='UNDOTBS1'
ProdDb2.thread=2
ProdDb2.instance_number=2
ProdDb2.undo_tablespace='UNDOTBS2'
4) /etc/hosts Node1
LinuxServer-01:cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#Public IPs on eth0
192.168.102.18 LinuxServer-01.at.fry LinuxServer-01
192.168.102.19 LinuxServer-02.at.fry LinuxServer-02
#VIPs on eth0:1
192.168.102.38 LinuxServer-01-vip.at.fry LinuxServer-01-vip
192.168.102.39 LinuxServer-02-vip.at.fry LinuxServer-02-vip
#Private interconnects on eth2
192.168.2.18 LinuxServer-01-priv.at.fry LinuxServer-01-priv
192.168.2.19 LinuxServer-02-priv.at.fry LinuxServer-02-priv
Node2:
LinuxServer-02:cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#Public IPs on eth0
192.168.102.18 LinuxServer-01.at.fry LinuxServer-01
192.168.102.19 LinuxServer-02.at.fry LinuxServer-02
#VIPs on eth0:1
192.168.102.38 LinuxServer-01-vip.at.fry LinuxServer-01-vip
192.168.102.39 LinuxServer-02-vip.at.fry LinuxServer-02-vip
#Private interconnects on eth2
192.168.2.18 LinuxServer-01-priv.at.fry LinuxServer-01-priv
192.168.2.19 LinuxServer-02-priv.at.fry LinuxServer-02-priv
5) Tnsnames.ora (Same on both nodes)
# tnsnames.ora Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TempDb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
)
)
ProdDbPREC_PRECONNECT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbPREC_PRECONNECT)
(FAILOVER_MODE =
(BACKUP = ProdDbPREC)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV3)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV2)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV1)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
TempDb2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
(INSTANCE_NAME = TempDb2)
)
)
TempDb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
(INSTANCE_NAME = TempDb1)
)
)
TempDbSRV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDbsrv1)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbPREC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbPREC)
(FAILOVER_MODE =
(BACKUP = ProdDbPREC_PRECONNECT)
(TYPE = SELECT)
(METHOD = PRECONNECT)
(RETRIES = 180)
(DELAY = 5)
)
)
)
LISTENERS_TempDb =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
6) Listener.ora
Node1:
# listener.ora.LinuxServer-01 Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/listener.ora.LinuxServer-01
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_LinuxServer-01 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /d01/app/oracle/product/10.2.0/asm)
(PROGRAM = extproc)
)
)
LISTENER_LinuxServer-01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.102.18)(PORT = 1521)(IP = FIRST))
)
)
Node2:
# listener.ora.LinuxServer-02 Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/listener.ora.LinuxServer-02
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_LinuxServer-02 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /d01/app/oracle/product/10.2.0/asm)
(PROGRAM = extproc)
)
)
LISTENER_LinuxServer-02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.102.19)(PORT = 1521)(IP = FIRST))
)
)
Non-RAC
Single Standalone server: SSSever
OS RHEL4 U6
Database Name: ProdDb
DB Version : 10.2.0.3
ASM: Yes
Diskgroups: +DG1 and +DG2
Backup: /backup/ProdDb
Archivelogs: one copy to +DG2 and another set to ASM
Homes: Both ASM and ORACLE_HOME on /d01/app/oracle/product/10.2.0/db_1
CPU patches: July'08
Intented New RAC Cluster:
Node1: LinuxServer-01
Node2: LinuxServer-02
OS RHEL4 U6 (on both nodes)
CRS version: 10.2.0.3
DB version 10.2.0.3
ASM: Yes
ORA_CRS_HOME /d01/app/oracle/product/10.2.0/crs
ASM_HOME /d01/app/oracle/product/10.2.0/asm
ORACLE_HOME /d01/app/oracle/product/10.2.0/db_1
CPU Patcheset level July'08
Backup: Locally mounted on LinuxServer-02:/backup and remotely mounted to LinuxServer-01:/backup with following options
192.168.102.19:/backup on /backup type nfs (rw,bg,rsize=16384,wsize=16384,hard,noac,actimeo=0,intr,addr=192.168.102.19)
RAC creation
1) create 2 node RAC Cluster with 10gR2 (10.2.0.1)
A) with three homes, ORA_CRS_HOME, ASM_HOME and ORACLE_HOME on each node)
/d01/app/oracle/product/10.2.0/crs
/d01/app/oracle/product/10.2.0/asm
/d01/app/oracle/product/10.2.0/db_1
B) Start ASM and create same diskgroup names as you are using on Singles Stand Alone server.
(Assuming you are using ASM on Single Standalone server like I do with two diskgroups called +DG1 and +DG2)
+DG1 --> For Datafiles, controlfile, spfile
+DG2 --> For controlfile, archivelog, flash_recovery, redologs
2) Upgrade CRS to 10.2.0.3 (or 10.2.0.4 depending on you need)
2) Upgrade ASM_HOME and ORACLE_HOME to 10.2.0.3
3) Upgrade Opatch Utility to 10.2.0.4.0
4) Apply all Oct'08 CPU patches on both ASM_HOME and ORACLE_HOME (Although CPU patches on ASM_HOME is not required, but its good to have).
Database Migration Steps:
1) Once the RAC is created, create a new temporary database called TempDb from dbca and select both nodes. (this will create necessary files and listener and remote_listener).
2) Send the backups from SSSever:/backup/ProdDb to newly created RAC (to node1)
3) Restore init.ora from backup
4) Make changes in init.ora
5) Create all necassary directories (adump,bdump,cdump,udump).
6) Restore controlfile.
7) Restore Database as you would restore on a single standalone.
8) Recover Database as you would recover on a single standalone.
9) Open database with open resetlogs (RMAN> Alter database open resetlogs;)
10) Shutdown database (RMAN> shutdown immediate;
For the sample of technical details of the above step 10 steps from , go to .
Coversion from single-standalone (node1) to RAC (both nodes) Steps:
1) backup critical files before Migration
a) tnsnames.ora
b) listener.ora
c) sqlnet.ora
d) init.ora/spfile.ora
2) Create pwd file if it doesn't already exist in dbs folder.
export ORACLE_SID=ProdDb
Node1:
orapwd file=$ORACLE_HOME/dbs/orapwProdDb1 password='abc123' entries=5 force=y
Node2:
orapwd file=$ORACLE_HOME/dbs/orapwProdDb2 password='abc123' entries=5 force=y
3) Make RAC changes in initProdDb.ora file
Note: (Get the listener name from TempDb with "Show parameter listener" command.
cd $ORACLE_HOME/dbs
cp initProdDb.ora initProdDb.ora.bak
cp initProdDb.ora /tmp/initProdDb1.ora
vi /tmp/initProdDb1.ora
change
undo_management=Manual
and add the following.
*.cluster_database_instances=2
*.cluster_database=true
*.remote_listener='LISTENERS_TempDb'
ProdDb1.thread=1
ProdDb1.instance_number=1
ProdDb1.undo_tablespace='UNDOTBS1'
ProdDb2.thread=2
ProdDb2.instance_number=2
ProdDb2.undo_tablespace='UNDOTBS2'
****If the LISTENERS_TempDb is not already in the tnsnames.ora file, add the following entry into both nodes tnsnames.ora as follows:
LISTENERS_TempDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
)
4) Create new init.ora on both nodes pointing spfile on ASM.
On node1:
vi $ORACLE_HOME/dbs/initProdDb1.ora
spfile='+DG1/ProdDb/SPFILE/initProdDb.ora'
On node2:
vi $ORACLE_HOME/dbs/initProdDb2.ora
spfile='+DG1/ProdDb/SPFILE/initProdDb.ora'
5) Copy database spfile to ASM.
export ORACLE_SID=ProdDb1
sqlplus / as sysdba
startup pfile='/tmp/initProdDb1.ora'
create spfile='+DG1/ProdDb/SPFILE/initProdDb.ora' from pfile='/tmp/initProdDb1.ora'
shutdown immediate;
startup;
show parameter spfile;
6) Create temp TBS, UNDO TBS for both nodes and RAC Data Dictionary Views.
export ORACLE_SID=ProdDb1
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
--Create temporary tablespace if needed
CREATE TEMPORARY TABLESPACE temp05 TEMPFILE '+DATA/primedg/datafiles/temp05.dbf' SIZE 20M;
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp05;
--Drop the existing temp tablespace (if any)
--Create dedicated undo tablespace for both nodes.
CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE
'+DATA/PrimeDG/datafile/undotbs01.dbf' SIZE 50M AUTOEXTEND OFF
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;
CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE
'+DATA/PrimeDG/datafile/undotbs02.dbf' SIZE 50M AUTOEXTEND OFF
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;
alter system set undo_management=auto scope=spfile;
shutdown immediate;
startup
spool /tmp/catclust.log
@catclust
spool off
shutdown immediate;
7) Register the RAC instances with CRS and start instance1.
srvctl add database -d ProdDb -o $ORACLE_HOME
srvctl add instance -d ProdDb -i ProdDb1 -n LinuxServer-01
srvctl add instance -d ProdDb -i ProdDb2 -n LinuxServer-02
Important:
Please note that when adding instances from the "srvctl add instance...." command, Node name should be in exact case as it says in hostname. If not, the database services may have trouble starting later on.
Following might be necessary if your asm home is different than dbhome. (otherwise db instances wont start)
srvctl setenv database -d ProdDb -T TNS_ADMIN='/d01/app/oracle/product/10.2.0/asm/network/admin'
srvctl start instance -d ProdDb -i ProdDb1
8) Create redo logs for the second RAC instance.
sqlplus / as sysdba
SQL> select group#, member from v$logfile;
--Depending on your existing redo group members for node1, you need the same number of redo groups (and members) for node 2. In my situation, I have 2 redo log groups (Group1 and Group2 with one member each) for node1. I will add the similar for node2 (Group3 and Group4 with one member each) with the following commands. If I have my flash_recovery_area enable, redologs will be created in FRA. If not, you may need to provide a redo log destination.
SQL> alter database add logfile thread 2 group 3 size 50M;
SQL> alter database add logfile thread 2 group 4 size 50M;
SQL> select group#, member from v$logfile;
alter database enable thread 2;
9) Create undotbs for node2
Undotbs for node2 should already be created: Verify it exists.
select tablespace_name, file_name from dba_data_files where tablespace_name like 'UNDOTBS%';
shutdown immediate;
startup
10) Start up the second RAC instance.
srvctl start instance -d ProdDb -i ProdDb2
11) Add ProdDb entry in /etc/oratab on BOTH nodes.
Node1:
ProdDb:/u01/app/oracle/product/10.2.0/db_1:N
Node2:
ProdDb:/u01/app/oracle/product/10.2.0/db_1:N
12) Create new services
At this time we can create the database services to handle the workload. We are multiple ways of creating service. The most simple way is creating the services from dbca. Another advantage of creating service using dbca is, it will create the appropriate TNS entries. Otherwise, if using manual way of creating services using srvctl, you will need to add the tns entries in every node's tnsnames.ora file.
Option-1
If you chose to create dbca, it is very simple. Invoke dbca from node1 and choose service management and follow the instructions. We will need to create 4 services as below:
ProdDbSRV1 both-preferred Basic,
ProdDbSRV2 2nd-preferred,1st Available, Basic
ProdDbSRV3 2nd-preferred, 1st not used, Basic
ProdDbPREC both preferred, pre-connect.
Option-2
Now is the second way which uses srvctl to create service. However, like I mentioned before you will then need to add the tns entries in each of the node's tnsnames.ora file.
ProdDbSRV1 both-preferred Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_1p2p -r ProdDbSRV1,ProdDbSRV2 -P BASIC
ProdDbSRV2 2nd-preferred,1st Available, Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_2p1a -r ProdDbSRV2 -a ProdDbSRV1
ProdDbSRV3 2nd-preferred, 1st not used, Basic
srvctl add service -d ProdDbSRV -s ProdDbSRV_2p1n -r ProdDbSRV2
ProdDbPREC both preferred, pre-connect.
srvctl add service -d ProdDbSRV -s ProdDbSRV_1p2p_PC -r ProdDbSRV1,ProdDbSRV2 -P PRECONNECT
Now start all the services
srvctl start service -d ProdDb -s ProdDbSRV1_1p2p
srvctl start service -d ProdDb -s ProdDbSRV2_2p1a
srvctl start service -d ProdDb -s ProdDbSRV3_2p1n
srvctl start service -d ProdDb -s ProdDbSRV4_1p2p_PC
13) (Re)create DBconsole
drop existing dbconsole
emca -deconfig dbcontrol db -repos drop -cluster
create new dbconsole on db01
emca -config dbcontrol db -repos create -cluster
Move dbconsole to start from db02 (since /backup is local to db02)
emca -reconfig dbcontrol –cluster –EM_NODE LinuxServer-02 -EM_SID_LIST ProdDb1
14) Add Local listener parameter on both nodes (if not already set in init.ora file, check with show parameter local_listener)
alter system set local_listener='(address=(protocol=tcp)(host=192.168.102.38)(port=1521))' sid='ProdDb1';
alter system set local_listener='(address=(protocol=tcp)(host=192.168.102.39)(port=1521))' sid='ProdDb2';
15) Start dbconsole
emctl start dbconsole
Post Migration Steps
1) Take a backup from new RAC
2) increase the temp tbs to 2G
3) Delete the temporary database you created in Pre Migration Steps (use dbca).
4) Make sure each of the 3 home's bash profile will have TNS_ADMIN set to /d01/app/oracle/product/10.2.0/asm/network/admin and your listener is running from ASM home.
If there are any steps I am missing here or you think sequence of events are not right, plz update me. I am open for suggestions. Also below are some of the other files which you might need for reference.
P.S. -- Reference files are below:
1) ASM_HOME .bash_profile
Node1:
LinuxServer-01:> pwd
/home/oracle
LinuxServer-01:> vi .bash_asm_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export ORACLE_BASE=/d01/app/oracle
export ORACLE_SID=+ASM1
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/asm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
# Moid's Aliases
clear
#alias c='clear'
#alias l='ls -ltr -a'
#alias oh='cd $ORACLE_HOME'
#alias ob='cd $ORACLE_BASE'
#alias p='pwd'
#alias sq='sqlplus "/as sysdba"'
#alias tns='cd $TNS_ADMIN'
#alias bkp='cd /u99/backup/'
#alias s='su - oracle'
echo " **************************************************************************"
echo "| Node-1 ASM_HOME |"
echo " **************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
Node2:
LinuxServer-02:> pwd
/home/oracle
LinuxServer-02:> vi .bash_asm_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
umask 022
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export ORACLE_BASE=/d01/app/oracle
export ORACLE_SID=+ASM1
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/asm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
# Moid's Aliases
clear
#alias c='clear'
#alias l='ls -ltr -a'
#alias oh='cd $ORACLE_HOME'
#alias ob='cd $ORACLE_BASE'
#alias p='pwd'
#alias sq='sqlplus "/as sysdba"'
#alias tns='cd $TNS_ADMIN'
#alias bkp='cd /u99/backup/'
#alias s='su - oracle'
echo " **************************************************************************"
echo "| Node-1 ASM_HOME |"
echo " **************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
2) ORACLE_HOME .bash_profile
Node1:
LinuxServer-01:> pwd
/home/oracle
LinuxServer-0:> vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Set up Terminal Type
if [ "$TERM" = "" ]
then
eval `tset -s -Q -m ':?hp'`
else
eval `tset -s -Q`
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff -ixany
stty susp "^Z"
stty erase ^?
# Set up editor
export EDITOR=vi
# Set Oracle initialization variables
export ORACLE_TERM=vt220
export ORACLE_BASE=/d01/app/oracle
export ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
export ORA_CRS_HOME=/d01/app/oracle/product/10.2.0/crs
export ASM_HOME=/d01/app/oracle/product/10.2.0/asm
export ORACLE_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export BASE_PATH=$PATH
export PATH=.:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/OPatch:$BASE_PATH:/sbin:/usr/ccs/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export TNS_ADMIN=$ASM_HOME/network/admin
export ORACLE_SID=ProdDb1
export NODENAME=LinuxServer-01
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
export LD_ASSUME_KERNEL=2.4.19
clear
alias c='clear'
alias ls='ls -ltr -a -h'
alias oh='cd $ORACLE_HOME'
alias ob='cd $ORACLE_BASE'
alias p='pwd'
alias sq='sqlplus "/as sysdba"'
alias tns='cd $TNS_ADMIN'
alias bkp='cd /backup/'
alias s='su - mmuhammad'
alias pmon='ps -ef |grep pmon'
echo "****************************************************************************"
echo "| Node-1 DATABASE HOME |"
echo "****************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
echo "|c| |s| |l| |oh| |ob| |p| |sq| |tns| |bkp| |bd| |cdump| |pmon| |smon| |alert|"
echo " "
echo "Are the instances running on both nodes? Checking...... "
echo " "
srvctl status database -d ProdDb
echo " "
echo "File System Usage"
df -h | awk '{print $6"\t",$2"\t",$3"\t",$4"\t",$5}'|grep -v "/dev/"
echo " "
Node2:
LinuxServer-02:> pwd
/home/oracle
LinuxServer-02:> vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Set up Terminal Type
if [ "$TERM" = "" ]
then
eval `tset -s -Q -m ':?hp'`
else
eval `tset -s -Q`
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff -ixany
stty susp "^Z"
stty erase ^?
# Set up editor
export EDITOR=vi
# Set Oracle initialization variables
export ORACLE_TERM=vt220
export ORACLE_BASE=/d01/app/oracle
export ORACLE_HOME=/d01/app/oracle/product/10.2.0/db_1
export ORA_CRS_HOME=/d01/app/oracle/product/10.2.0/crs
export ASM_HOME=/d01/app/oracle/product/10.2.0/asm
export ORACLE_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export ORA_NLS=$ORACLE_HOME/ocommon/nls/admin/data
export BASE_PATH=$PATH
export PATH=.:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/OPatch:$BASE_PATH:/sbin:/usr/ccs/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export TNS_ADMIN=$ASM_HOME/network/admin
export ORACLE_SID=ProdDb2
export NODENAME=LinuxServer-02
export PS1='$NODENAME'":("'$ORACLE_SID'")> "
export LD_ASSUME_KERNEL=2.4.19
clear
alias c='clear'
alias ls='ls -ltr -a -h'
alias oh='cd $ORACLE_HOME'
alias ob='cd $ORACLE_BASE'
alias p='pwd'
alias sq='sqlplus "/as sysdba"'
alias tns='cd $TNS_ADMIN'
alias bkp='cd /backup/'
alias s='su - mmuhammad'
alias pmon='ps -ef |grep pmon'
echo "****************************************************************************"
echo "| Node-2 DATABASE HOME |"
echo "****************************************************************************"
echo " "
ps -ef|grep pmon| grep -v "grep pmon"
echo""
echo "|c| |s| |l| |oh| |ob| |p| |sq| |tns| |bkp| |bd| |cdump| |pmon| |smon| |alert|"
echo " "
echo "Are the instances running on both nodes? Checking...... "
echo " "
srvctl status database -d ProdDb
echo " "
echo "File System Usage"
df -h | awk '{print $6"\t",$2"\t",$3"\t",$4"\t",$5}'|grep -v "/dev/"
echo " "
3) initProdDb.ora (After RAC build)
ProdDb.__db_cache_size=1258291200
ProdDb.__java_pool_size=16777216
ProdDb.__large_pool_size=16777216
ProdDb.__shared_pool_size=788529152
ProdDb.__streams_pool_size=0
*._awr_flush_threshold_metrics=TRUE
*._os_sched_high_priority=0
*.audit_file_dest='/d01/app/oracle/admin/ProdDb/adump'
*.background_dump_dest='/d01/app/oracle/admin/ProdDb/bdump'
*.cluster_database=TRUE
*.cluster_database_instances=2
*.compatible='10.2.0.2.0'
*.control_files='+DG2/ProdDb/controlfile/control01.ctl','+DG1/ProdDb/controlfile/control02.ctl','/backup/ProdDb/CONTROLFILE/controlfile03.ctl'
*.core_dump_dest='/d01/app/oracle/admin/ProdDb/cdump'
*.cursor_sharing='SIMILAR'
*.db_block_size=8192
*.db_create_file_dest='+DG1'
*.db_create_online_log_dest_1='+DG2'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ProdDb'
*.db_writer_processes=3
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ProdDbXDB)'
*.event='10511 trace name context forever'
*.job_queue_processes=10
*.log_archive_dest_1='LOCATION=+DG2/ProdDb/'
*.log_archive_dest_2='LOCATION=/backup/ProdDb/Archive'
*.log_archive_format='arch_%t_%s_%r.arc'
*.log_checkpoint_interval=0
*.log_checkpoint_timeout=900
*.log_checkpoints_to_alert=TRUE
*.open_cursors=1200
*.parallel_execution_message_size=8192
*.pga_aggregate_target=1000M
*.processes=1500
*.remote_listener='LISTENERS_TempDb'
*.remote_login_passwordfile='exclusive'
*.service_names='ProdDb,ProdDB1'
ProdDb1.service_names='ProdDb, ProdDB1_PRECONNECT, ProdDB1, SYS$SYS.KUPC$S_1_20070511175947.ProdDb.REGRESS.RDBMS.DEV.US.ORACLE.COM, SYS$SYS.KUPC$C_1_20070511175947.ProdDb.REGRESS.RDBMS.DEV.US.ORACLE.COM'
*.sessions=4200
*.sessions=4200
*.sga_max_size=3000M
*.sga_target=2000M
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.user_dump_dest='/d01/app/oracle/admin/ProdDb/udump'
ProdDb1.thread=1
ProdDb1.instance_number=1
ProdDb1.undo_tablespace='UNDOTBS1'
ProdDb2.thread=2
ProdDb2.instance_number=2
ProdDb2.undo_tablespace='UNDOTBS2'
4) /etc/hosts Node1
LinuxServer-01:cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#Public IPs on eth0
192.168.102.18 LinuxServer-01.at.fry LinuxServer-01
192.168.102.19 LinuxServer-02.at.fry LinuxServer-02
#VIPs on eth0:1
192.168.102.38 LinuxServer-01-vip.at.fry LinuxServer-01-vip
192.168.102.39 LinuxServer-02-vip.at.fry LinuxServer-02-vip
#Private interconnects on eth2
192.168.2.18 LinuxServer-01-priv.at.fry LinuxServer-01-priv
192.168.2.19 LinuxServer-02-priv.at.fry LinuxServer-02-priv
Node2:
LinuxServer-02:cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#Public IPs on eth0
192.168.102.18 LinuxServer-01.at.fry LinuxServer-01
192.168.102.19 LinuxServer-02.at.fry LinuxServer-02
#VIPs on eth0:1
192.168.102.38 LinuxServer-01-vip.at.fry LinuxServer-01-vip
192.168.102.39 LinuxServer-02-vip.at.fry LinuxServer-02-vip
#Private interconnects on eth2
192.168.2.18 LinuxServer-01-priv.at.fry LinuxServer-01-priv
192.168.2.19 LinuxServer-02-priv.at.fry LinuxServer-02-priv
5) Tnsnames.ora (Same on both nodes)
# tnsnames.ora Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TempDb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
)
)
ProdDbPREC_PRECONNECT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbPREC_PRECONNECT)
(FAILOVER_MODE =
(BACKUP = ProdDbPREC)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV3)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV2)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbSRV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbSRV1)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
TempDb2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
(INSTANCE_NAME = TempDb2)
)
)
TempDb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDb)
(INSTANCE_NAME = TempDb1)
)
)
TempDbSRV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TempDbsrv1)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)
ProdDbPREC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ProdDbPREC)
(FAILOVER_MODE =
(BACKUP = ProdDbPREC_PRECONNECT)
(TYPE = SELECT)
(METHOD = PRECONNECT)
(RETRIES = 180)
(DELAY = 5)
)
)
)
LISTENERS_TempDb =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521))
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
6) Listener.ora
Node1:
# listener.ora.LinuxServer-01 Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/listener.ora.LinuxServer-01
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_LinuxServer-01 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /d01/app/oracle/product/10.2.0/asm)
(PROGRAM = extproc)
)
)
LISTENER_LinuxServer-01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-01-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.102.18)(PORT = 1521)(IP = FIRST))
)
)
Node2:
# listener.ora.LinuxServer-02 Network Configuration File: /d01/app/oracle/product/10.2.0/asm/network/admin/listener.ora.LinuxServer-02
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_LinuxServer-02 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /d01/app/oracle/product/10.2.0/asm)
(PROGRAM = extproc)
)
)
LISTENER_LinuxServer-02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LinuxServer-02-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.102.19)(PORT = 1521)(IP = FIRST))
)
)
No comments:
Post a Comment