Each machines
D:\oracle\product\10.2\crs (software oracle cluster ready service)
D:\oracle\product\10.2\db_1 (software oracle database )
All machines shared storage path
J:\archive\PRDDB
Host Rac Information
host01 information :
- hostname= host01
- virtual ip(for rac) host01-vip=155.5.44.127
- public ip(for remote) host01-pub=155.5.44.X
- private ip (for heartbeat) host01-priv=10.X.X.X (teaming 2 interface)
- oracle sid = PRDDB1
host02 information :
- hostname= host02
- virtual ip(for rac) host02-vip=155.5.44.129
- public ip(for remote) host02-pub=155.5.44.Y
- private ip (for heartbeat) host02-priv=10.Y.Y.Y (teaming 2 interface)
- oracle sid = PRDDB2
Database Rac Information
PRDDB Database
- Instance=PRDDB1,PRDDB2
- DB storageàRaw device=+ASM
- +ASM instance=+ASM1,+ASM2
- +ASM storage files= control01.ctl, control02.ctl,control03.ctl,system01.dbf, sysaux01.dbf, temp01.dbf, undotbs01.dbf,undotbs02.dbf, redo_t1_01.log,redo_t1_02.log,redo_t1_03.log,redo_t1_04.log, redo_t2_01.log,redo_t2_02.log,redo_t2_03.log,redo_t2_04.log
- Ocr à cluster filesystem= I:\cdata\orc.dbf
- Votting à cluster filesystem= I:\cdata\voting.dbf
- Archivelogàcluster filesystem=J:\archive\PRDDB
- Spfilleàcluster filesystem= I:\oracle\PRDDB\spfilePRDDB.ora
PRDDB1 :Instance 1 or Thread 1
- hostname=host01
- oracle sid=PRDDB1
- oracle cluster sw=D:\oracle\product\10.2\crs
- oracle databse sw=D:\oracle\product\10.2\db_1
- redolog for instance1 on shared storage +ASM1= redo_t1_01.log,redo_t1_02.log,redo_t1_03.log,redo_t1_04.log
- undo for instance1 on shared storage +ASM1 = undotbs01.dbf
PRDDB2 :Instance 2 or Thread 2
- hostname=host02
- oracle sid=PRDDB2
- oracle cluster sw=D:\oracle\product\10.2\crs
- oracle databse sw=D:\oracle\product\10.2\db_1
- redolog for instance2 on shared storage +ASM2 = redo_t2_01.log,redo_t2_02.log,redo_t2_03.log,redo_t2_04.log
- undo for instance2 on shared storage +ASM2 = undotbs02.dbf
การ Create Rac database PRDDB มีขั้นตอนดังนี้
- Configure network interface and resolve hostname(DNS or hostfile)
- Create shared disks raw& shared disk filesystem.
- Install oracle clusterware software.
- Install the Database Software and Create an ASM Instance.
- Create a Database using DBCA
- TNS and Listener configuration
มีขั้นตอนดังนี้
2. Create shared disks raw & shared disk filesystem
2.1 shared disks raw มีไว้สำหรับ
- ASM disk (All db files)
+DATA/PRDDB/
control01.ctl, control02.ctl,control03.ctl(controlfiles)
system01.dbf, sysaux01.dbf, temp01.dbf
undotbs01.dbf,undotbs02.dbf
redo_t1_01.log,redo_t1_02.log,redo_t1_03.log,redo_t1_04.log
redo_t2_01.log,redo_t2_02.log,redo_t2_03.log,redo_t2_04.log
2.2 shared disk filesystem มีไว้สำหรับ
- votting disk I:\cdata\voting.dbf
- ocr disk I:\cdata\orc.dbf
- spfile I:\oracle\PRDDB\spfilePRDDB.ora
- archive log files J:\archive\PRDDB
มีขั้นตอนดังนี้
มีขั้นตอนดังนี้
4. Install the Database Software and Create an ASM Instance
มีขั้นตอนดังนี้
มีขั้นตอนดังนี้
Configure tnsnames.ora
ใน D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora ของทั้ง 2 เครื่องจะเหมือนกัน
# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
PRDDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRDDB)
)
)
PRDDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRDDB)
(INSTANCE_NAME = PRDDB2)
)
)
PRDDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRDDB)
(INSTANCE_NAME = PRDDB1)
)
)
LISTENERS_PRDDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-vip)(PORT = 1521))
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
Configure listener.ora
ใน listener.ora ของทั้ง 2 เครื่องจะไม่เหมือนกัน
Host01
ใน D:\oracle\product\10.2.0\db_1\network\admin\ listener.ora.host01
# listener.ora.host01 Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\listener.ora.host01
# Generated by Oracle configuration tools.
LISTENER_HOST01 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host01-vip)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 155.5.44.127)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER_HOST01 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
Host02
ใน D:\oracle\product\10.2.0\db_1\network\admin\listener.ora.host02
# listener.ora.host02 Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\listener.ora.host02
# Generated by Oracle configuration tools.
LISTENER_HOST02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02-vip)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 155.5.44.129)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER_HOST02 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
ทำการ test connection ว่าใช้ได้ผ่าน tnsnames and listener
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 20 16:58:37 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> CONN sys/password@PRDDB1 AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- ----------------------------------------------------------------
PRDDB1 PRDDB1
SQL> CONN sys/password@PRDDB2 AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- ----------------------------------------------------------------
PRDDB2 PRDDB2
SQL> CONN sys/password@PRDDB AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- ----------------------------------------------------------------
PRDDB2 PRDDB2
SQL>
Check the Status of the RAC
There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.
C:\>srvctl config database -d RAC
Host01 PRDDB1 C:\oracle\product\10.2.0\db_1
Host02 PRDDB2 C:\oracle\product\10.2.0\db_1
C:\>srvctl status database -d RAC
Instance PRDDB1 is running on node host01
Instance PRDDB2 is running on node host02
The V$ACTIVE_INSTANCES view can also display the current status of the instances.
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 20 16:58:37 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> SELECT * FROM v$active_instances;
INST_NUMBER INST_NAME
----------- ------------------------------------------------------------
1 HOST01:PRDDB1
2 HOST02:PRDDB2
SQL>
Finally, the GV$ allow you to display global information for the whole RAC.
-------------------------------------------------------------------------------------------------
0 comments:
Post a Comment