A Practical Guide To Oracle 10g RAC Its REAL Easy!: Gavin Soorma, Emirates Airline, Dubai Session# 106
A Practical Guide To Oracle 10g RAC Its REAL Easy!: Gavin Soorma, Emirates Airline, Dubai Session# 106
A Practical Guide To Oracle 10g RAC Its REAL Easy!: Gavin Soorma, Emirates Airline, Dubai Session# 106
Gavin Soorma,
Emirates Airline, Dubai
Session# 106
Agenda
• RAC concepts
• Planning for a RAC installation
• Pre Installation steps
• Installation of 10g R2 Clusterware
• Installation of 10g R2 Software
• Creation of RAC database
• Configuring Services and TAF
• Migration of single instance to RAC
What Is a RAC Cluster?
• Nodes
• Interconnect Interconnect
Disks
Database vs Instance
RAC Cluster consists of ….
One or more instances
One Database residing on shared storage
Node 1 Node 2
Database
Why RAC?
• High Availability – survive node and instance failures
•If using Automatic Undo Management also require one UNDO tablespace
per instance
• Each node not only has its own statically assigned IP address as well
as also a virtual IP address that is assigned to the node
• The listener on each node will be listening on the Virtual IP and client
connections will also come via this Virtual IP.
• Without VIP, clients will have to wait for long TCP/IP timeout before
getting an error message or TCP reset from nodes that have died
Sample /etc/hosts file
ITLINUXBL54
ssh-keygen -t dsa
cat id_dsa.pub >> authorized_keys
scp authorized_keys itlinuxbl53:/opt/oracle/.ssh
hangcheck_tick=30 hangcheck_margin=180
Using /lib/modules/2.4.21-37.ELsmp/kernel/drivers/char/hangcheck-timer.o
• Run root.sh
Start CRS daemon processes – evmd, cssd, crsd
Oracle Cluster File System
• Shared disk cluster file system for LINUX and Windows
Clustered
Servers
[root@itlinuxbl53 rpm]# ls
cvuqdisk-1.0.1-1.rpm
• BASIC
- After failover connection must reconnect to next address in the list
- Additional time to failover
• PRECONNECT
- Session is opened against all addresses in the list
- Only one is used – others remain connected
- Faster failover with preconnected sessions
- More memory resources consumed by preconnected sessions on
other nodes
tnsnames.ora for RAC
Client-side load balancing
ERP =
(DESCRIPTION =
(LOAD_BALANCE = ON)
(FAILOVER=ON)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2vip)(PORT = 1521)) (CONNECT_DATA =
(SERVICE_NAME = ERP.WORLD) (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))
RACDB_LISTENERS=
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rac1vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =rac2vip)(PORT = 1521))
Recovery and RAC
SQL> INSERT INTO SH.MYOBJECTS SELECT * FROM DBA_OBJECTS ;
SQL> COMMIT;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
12 B F A DISK 05-FEB-06 1 1 NO BACKUP_RACDB.HQ.EM_020506082809
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
12 B F A DISK 05-FEB-06 1 1 NO BACKUP_RACDB.HQ.EM_020506082809
Since the same control files are used by both instances RACDB1 and RACDB2
(same db RACDB) the output is the same on both sides.
Recovery and RAC (contd)
srvctl stop database -d RACDB
srvctl start database -d RACDB -o mount
export ORACLE_SID=racdb1
run {
set until logseq 10 thread 1;
set autolocate on;
allocate channel c1 type disk;
restore database ;
recover database ;
release channel c1;
}
Recovery and RAC (contd)
Starting restore at 05-FEB-06
• Create the directory structure for the database files and archive
log files on the OCFS file system
$ cd /ocfs/oradata/
$ mkdir gavin
$ cd /ocfs/oradata/gavin
$ mkdir arch
Migrate a Single-instance database to
RAC
$ cd /u01/ORACLE/gavin/
$ ls
arch control03.ctl redo02.log system01.dbf users01.dbf
control01.ctl example01.dbf redo03.log temp01.dbf
control02.ctl redo01.log sysaux01.dbf undotbs01.dbf
$ cp *.* /ocfs/oradata/gavin
Migrate a Single-instance database to
RAC
*.control_files='/ocfs/oradata/gavin/control01.ctl','/ocfs/oradata/ga
vin/control02.ctl','/ocfs/oradata/gavin/control03.ctl‘
SQL> @?/rdbms/admin/catclust.sql
Migrate a Single-instance database to
RAC
• Each instance in the cluster needs to have access to its own
thread of online redo log files.
*.cluster_database=TRUE
*.cluster_database_instances=2
gavin1.instance_name=gavin1
gavin2.instance_name=gavin2
gavin1.instance_number=1
gavin2.instance_number=2
gavin1.thread=1
gavin2.thread=2
gavin1.undo_tablespace=UNDOTBS1
gavin2.undo_tablespace=UNDOTBS2
*.remote_listener='LISTENERS_GAVIN'
Migrate a Single-instance database to
RAC
Make the following changes to the Init.ora parameter file:
gavin.__db_cache_size=171966464
gavin.__java_pool_size=8388608
gavin.__large_pool_size=4194304
gavin.__shared_pool_size=75497472
Change to ...
*.__db_cache_size=171966464
*.__java_pool_size=8388608
*.__large_pool_size=4194304
*.__shared_pool_size=75497472
Migrate a Single-instance database to
RAC
*.log_archive_dest_1='LOCATION=/ocfs/oradata/gavin/arch/‘
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapwgavin1 password=oracle
Migrate a Single-instance database to
RAC
LISTENERS_GAVIN =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
hqlinuxrac101.hq.emirates.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =
hqlinuxrac102.hq.emirates.com)(PORT = 1521))
)
Migrate a Single-instance database to
RAC
• Create the spfile which will be used by both
instances on the shared disk storage as well
A
gavin.soorma@emirates.com
QUESTIONS
ANSWERS
Contact me:
Email: gavin.soorma@emirates.com
Phone: + 971507843900
Acknowledgements & Thanks
• 10g RAC – Madhu Tumma
• High Availability with RAC, Flashback and Data
Guard – Matthew Hart & Scott Jesse
• A Rough Guide to RAC – Julian Dyke
• Oracle 10g Linux Administration – Edward Whalen