Oracle10.2.0.5 3nodes RAC
在racnode1使用DBCA创建service
racnode1选择首选,racnode2和racnode3选择可用,TAF policy选择basic
点击No
各实例的service_names
[oracle@racnode1 ~]$ sqlplus sys@racdb1 as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 10:58:55 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string zwc, racdb SQL> conn sys@racdb2 as sysdba Enter password: Connected. SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string racdb SQL> conn sys@racdb3 as sysdba Enter password: Connected. SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string racdb SQL>
[oracle@racnode1 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.racdb.db application ONLINE ONLINE racnode1 ora....b1.inst application ONLINE ONLINE racnode1 ora....b2.inst application ONLINE ONLINE racnode2 ora....b3.inst application ONLINE ONLINE racnode3 ora.....zwc.cs application ONLINE ONLINE racnode1 ora....db1.srv application ONLINE ONLINE racnode1 ora....SM1.asm application ONLINE ONLINE racnode1 ora....E1.lsnr application ONLINE ONLINE racnode1 ora....de1.gsd application ONLINE ONLINE racnode1 ora....de1.ons application ONLINE ONLINE racnode1 ora....de1.vip application ONLINE ONLINE racnode1 ora....SM2.asm application ONLINE ONLINE racnode2 ora....E2.lsnr application ONLINE ONLINE racnode2 ora....de2.gsd application ONLINE ONLINE racnode2 ora....de2.ons application ONLINE ONLINE racnode2 ora....de2.vip application ONLINE ONLINE racnode2 ora....SM3.asm application ONLINE ONLINE racnode3 ora....E3.lsnr application ONLINE ONLINE racnode3 ora....de3.gsd application ONLINE ONLINE racnode3 ora....de3.ons application ONLINE ONLINE racnode3 ora....de3.vip application ONLINE ONLINE racnode3
Service "zwc" has 1 instance(s).
Instance "racdb1", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:5 refused:0 state:ready
LOCAL SERVER
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.151)(PORT=1521))
[oracle@racnode1 ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 25-DEC-2012 11:04:22 Copyright (c) 1991, 2010, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER_RACNODE1 Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date 20-DEC-2012 16:28:07 Uptime 4 days 18 hr. 36 min. 15 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener_racnode1.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.151)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.51)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... Service "+ASM_XPT" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... Service "racdb" has 3 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... Instance "racdb2", status READY, has 1 handler(s) for this service... Instance "racdb3", status READY, has 1 handler(s) for this service... Service "racdbXDB" has 3 instance(s). Instance "racdb1", status READY, has 1 handler(s) for this service... Instance "racdb2", status READY, has 1 handler(s) for this service... Instance "racdb3", status READY, has 1 handler(s) for this service... Service "racdb_XPT" has 3 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... Instance "racdb2", status READY, has 1 handler(s) for this service... Instance "racdb3", status READY, has 1 handler(s) for this service... Service "zwc" has 1 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... The command completed successfully [oracle@racnode1 ~]$ lsnrctl service LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 25-DEC-2012 11:04:24 Copyright (c) 1991, 2010, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Service "+ASM_XPT" has 1 instance(s). Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVER Service "racdb" has 3 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... Handler(s): "DEDICATED" established:5 refused:0 state:ready LOCAL SERVER "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.151)(PORT=1521)) Instance "racdb2", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.152)(PORT=1521)) Instance "racdb3", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.153)(PORT=1521)) Service "racdbXDB" has 3 instance(s). Instance "racdb1", status READY, has 1 handler(s) for this service... Handler(s): "D000" established:0 refused:0 current:0 max:1022 state:ready DISPATCHER <machine: racnode1, pid: 13625> (ADDRESS=(PROTOCOL=tcp)(HOST=racnode1)(PORT=30569)) Instance "racdb2", status READY, has 1 handler(s) for this service... Handler(s): "D000" established:0 refused:0 current:0 max:1022 state:ready DISPATCHER <machine: racnode2, pid: 6359> (ADDRESS=(PROTOCOL=tcp)(HOST=racnode2)(PORT=57869)) Instance "racdb3", status READY, has 1 handler(s) for this service... Handler(s): "D000" established:0 refused:0 current:0 max:1022 state:ready DISPATCHER <machine: racnode3, pid: 1929> (ADDRESS=(PROTOCOL=tcp)(HOST=racnode3)(PORT=59281)) Service "racdb_XPT" has 3 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... Handler(s): "DEDICATED" established:5 refused:0 state:ready LOCAL SERVER "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.151)(PORT=1521)) Instance "racdb2", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.152)(PORT=1521)) Instance "racdb3", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.153)(PORT=1521)) Service "zwc" has 1 instance(s). Instance "racdb1", status READY, has 2 handler(s) for this service... Handler(s): "DEDICATED" established:5 refused:0 state:ready LOCAL SERVER "DEDICATED" established:0 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.151)(PORT=1521)) The command completed successfully
ZWC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = racnode1-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = racnode2-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = racnode3-vip)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = zwc) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) )
客户端连接测试
C:\>sqlplus system@zwc SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 25 11:19:44 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. 输入口令: 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> col host_name format a10 SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 1 racdb1 racnode1 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC NO
[oracle@racnode1 ~]$ hostname racnode1 [oracle@racnode1 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 11:24:07 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> shutdown abort ORACLE instance shut down.
C:\>sqlplus system@zwc SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 25 11:19:44 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. 输入口令: 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> col host_name format a10 SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 1 racdb1 racnode1 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC NO SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 3 racdb3 racnode3 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC YES NONE NONE NO
[oracle@racnode3 ~]$ hostname racnode3 [oracle@racnode3 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 11:26:05 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string zwc
[oracle@racnode3 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 11:26:59 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> shutdown abort ORACLE instance shut down.
C:\>sqlplus system@zwc SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 25 11:19:44 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. 输入口令: 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> col host_name format a10 SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 1 racdb1 racnode1 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC NO SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 3 racdb3 racnode3 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC YES NONE NONE NO SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 2 racdb2 racnode2 OPEN SQL> select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --- SELECT BASIC YES
[oracle@racnode2 admin]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 11:27:47 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string zwc
[oracle@racnode2 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.racdb.db application ONLINE ONLINE racnode1 ora....b1.inst application OFFLINE OFFLINE ora....b2.inst application ONLINE ONLINE racnode2 ora....b3.inst application OFFLINE OFFLINE ora.....zwc.cs application ONLINE ONLINE racnode1 ora....db1.srv application ONLINE ONLINE racnode2 ora....SM1.asm application ONLINE ONLINE racnode1 ora....E1.lsnr application ONLINE ONLINE racnode1 ora....de1.gsd application ONLINE ONLINE racnode1 ora....de1.ons application ONLINE ONLINE racnode1 ora....de1.vip application ONLINE ONLINE racnode1 ora....SM2.asm application ONLINE ONLINE racnode2 ora....E2.lsnr application ONLINE ONLINE racnode2 ora....de2.gsd application ONLINE ONLINE racnode2 ora....de2.ons application ONLINE ONLINE racnode2 ora....de2.vip application ONLINE ONLINE racnode2 ora....SM3.asm application ONLINE ONLINE racnode3 ora....E3.lsnr application ONLINE ONLINE racnode3 ora....de3.gsd application ONLINE ONLINE racnode3 ora....de3.ons application ONLINE ONLINE racnode3 ora....de3.vip application ONLINE ONLINE racnode3
[oracle@racnode1 ~]$ srvctl start instance -d racdb -i racdb1 [oracle@racnode1 ~]$ srvctl start instance -d racdb -i racdb3 [oracle@racnode1 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.racdb.db application ONLINE ONLINE racnode1 ora....b1.inst application ONLINE ONLINE racnode1 ora....b2.inst application ONLINE ONLINE racnode2 ora....b3.inst application ONLINE ONLINE racnode3 ora.....zwc.cs application ONLINE ONLINE racnode1 ora....db1.srv application ONLINE ONLINE racnode2 ora....SM1.asm application ONLINE ONLINE racnode1 ora....E1.lsnr application ONLINE ONLINE racnode1 ora....de1.gsd application ONLINE ONLINE racnode1 ora....de1.ons application ONLINE ONLINE racnode1 ora....de1.vip application ONLINE ONLINE racnode1 ora....SM2.asm application ONLINE ONLINE racnode2 ora....E2.lsnr application ONLINE ONLINE racnode2 ora....de2.gsd application ONLINE ONLINE racnode2 ora....de2.ons application ONLINE ONLINE racnode2 ora....de2.vip application ONLINE ONLINE racnode2 ora....SM3.asm application ONLINE ONLINE racnode3 ora....E3.lsnr application ONLINE ONLINE racnode3 ora....de3.gsd application ONLINE ONLINE racnode3 ora....de3.ons application ONLINE ONLINE racnode3 ora....de3.vip application ONLINE ONLINE racnode3
[oracle@racnode1 ~]$ srvctl relocate service -d racdb -s zwc -i racdb2 -t racdb1
[oracle@racnode1 ~]$ sqlplus sys@racdb1 as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 11:36:13 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string zwc SQL> conn sys@racdb2 as sysdba Enter password: Connected. SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string racdb SQL> conn sys@racdb3 as sysdba Enter password: Connected. SQL> show parameter service_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ service_names string racdb
SQL> select INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS,ACTIVE_STATE,INSTANCE_ROLE,DATABASE_STATUS from gv$INSTANCE; INSTANCE_NAME HOST_NAME VERSION STARTUP_TIME STATUS ACTIVE_ST INSTANCE_ROLE DATABASE_STATUS ---------------- ----------- ----------------- ----------------------- ------------ --------- ------------------ ----------------- racdb2 racnode2 10.2.0.5.0 20-DEC-2012 16:07:46 OPEN NORMAL PRIMARY_INSTANCE ACTIVE racdb1 racnode1 10.2.0.5.0 25-DEC-2012 11:31:20 OPEN NORMAL PRIMARY_INSTANCE ACTIVE racdb3 racnode3 10.2.0.5.0 25-DEC-2012 11:31:58 OPEN NORMAL PRIMARY_INSTANCE ACTIVE
C:\>sqlplus system@zwc SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 25 11:36:45 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. 输入口令: 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> SQL> col host_name format a10 SQL> select instance_number,instance_name,host_name,status from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME STATUS --------------- ---------------- ---------- ------------ 1 racdb1 racnode1 OPEN