轉 OracleRAC管理 之 叢集狀態&資訊檢視

lhyvsxman發表於2010-07-20
參看叢集狀態

[11:34:11oracle@node1 ~]crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.dba.db application ONLINE ONLINE node2

ora....l1.inst application ONLINE ONLINE node1

ora....l2.inst application ONLINE ONLINE node2

ora.dba.rac.cs application ONLINE ONLINE node2

ora....ll1.srv application ONLINE ONLINE node1

ora....ll2.srv application ONLINE ONLINE node2

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora....SM2.asm application ONLINE ONLINE node2

ora....E2.lsnr application ONLINE ONLINE node2

ora.node2.gsd application ONLINE ONLINE node2

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip application ONLINE ONLINE node2

檢視叢集資源資訊

[12:59:42oracle@node2 ~]srvctl config database -d dba -a

node1 null1 /u01/app/oracle/product/10.2.0/db_1

node2 null2 /u01/app/oracle/product/10.2.0/db_1

DB_NAME: dba

ORACLE_HOME: /u01/app/oracle/product/10.2.0/db_1

SPFILE: +DATA/dba/spfilenull.ora

DOMAIN: wang.com

DB_ROLE: null

START_OPTIONS: null

POLICY: AUTOMATIC

ENABLE FLAG: DB ENABLED

檢視連線資訊

[13:01:55oracle@node2 ~]srvctl config database -d dba -t

Example client-side TNS entry for service rac:

rac = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db_vip)(PORT=dedicated_port))(CONNECT_DATA=(SERVICE_NAME=rac.wang.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))

Example client-side TNS entry for service name:

name = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db_vip)(PORT=dedicated_port))(CONNECT_DATA=(SERVICE_NAME=name.wang.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))

檢視服務資訊

[13:02:20oracle@node2 ~]srvctl config service -d dba -a

rac PREF: null2 null1 AVAIL: TAF: basic

name PREF: null2 null1 AVAIL: TAF: basic

[13:02:45oracle@node2 ~]srvctl config service -d dba -s rac

rac PREF: null2 null1 AVAIL:

[13:03:01oracle@node2 ~]srvctl config service -d dba -s rac -a

rac PREF: null2 null1 AVAIL: TAF: basic

檢視ASM資訊

[13:05:41oracle@node2 ~]srvctl config asm -n node1

+ASM1 /u01/app/oracle/product/10.2.0/db_1

[13:05:44oracle@node2 ~]

[13:05:53oracle@node2 ~]srvctl config asm -n node2

+ASM2 /u01/app/oracle/product/10.2.0/db_1

[13:05:56oracle@node2 ~]

檢視監聽資訊

[13:05:57oracle@node2 ~]srvctl config listener -n node2

node2 LISTENER_NODE2

[13:06:15oracle@node2 ~]

[13:06:16oracle@node2 ~]srvctl config listener -n node1

node1 LISTENER_NODE1

檢視狀態

[13:08:40oracle@node2 ~]srvctl status database -d dba

Instance null1 is running on node node1

Instance null2 is running on node node2

[13:08:43oracle@node2 ~]srvctl status database -d dba -v

Instance null1 is running on node node1 with online services rac name

Instance null2 is running on node node2 with online services rac name

檢視監聽狀態

[13:09:27oracle@node2 ~]srvctl status instance -d dba -i null1,null2

Instance null1 is running on node node1

Instance null2 is running on node node2

[13:09:40oracle@node2 ~]srvctl status instance -d dba -i null1,null2 -v

Instance null1 is running on node node1 with online services rac name

Instance null2 is running on node node2 with online services rac name

檢視節點應用狀態

[13:10:29oracle@node2 ~]srvctl status nodeapps -n node1

VIP is running on node: node1

GSD is running on node: node1

Listener is running on node: node1

ONS daemon is running on node: node1

[13:11:44oracle@node2 ~]srvctl status nodeapps -n node2

VIP is running on node: node2

GSD is running on node: node2

Listener is running on node: node2

ONS daemon is running on node: node2

檢視節點ASM狀態

[13:11:47oracle@node2 ~]srvctl status asm -n node1

ASM instance +ASM1 is running on node node1.

[13:12:26oracle@node2 ~]srvctl status asm -n node2

ASM instance +ASM2 is running on node node2.

測試TAF

設定服務TAF模式為BASIC

RAC =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))

(LOAD_BALANCE = yes)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = rac.wang.com)

(FAILOVER_MODE =

(TYPE = SELECT)

(METHOD = BASIC)

(RETRIES = 180)

(DELAY = 5)

)

)

)

檢視叢集狀態

[11:55:50oracle@node2 dbs]crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.dba.db application ONLINE ONLINE node2

ora....name.cs application ONLINE ONLINE node2

ora....ll1.srv application ONLINE ONLINE node1

ora....ll2.srv application ONLINE ONLINE node2

ora....l1.inst application ONLINE ONLINE node1

ora....l2.inst application ONLINE ONLINE node2

ora.dba.rac.cs application ONLINE ONLINE node2

ora....ll1.srv application ONLINE ONLINE node1

ora....ll2.srv application ONLINE ONLINE node2

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora....SM2.asm application ONLINE ONLINE node2

ora....E2.lsnr application ONLINE ONLINE node2

ora.node2.gsd application ONLINE ONLINE node2

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip application ONLINE ONLINE node2

連線資料庫進行長事務查詢

[11:59:41oracle@node1 ~]sqlplus sys/oracle@rac as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 27 11:59:56 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SYS@NODE2:null2>show parameter service_name

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

service_names string dba.wang.com, rac, name

SYS@NODE2:null2>

SYS@NODE2:null2>show parameter db_name;

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

db_name string dba

SYS@NODE2:null2>

SYS@NODE2:null2>show parameter instance_name;

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

instance_name string null2

SYS@NODE2:null2>select * from dba_objects;

在事務執行過程中關閉當前所連線的例項

[12:00:47oracle@node2 admin]srvctl stop instance -i null2 -d dba -o abort

可觀察到該長事務中斷若干秒後繼續查詢

2005-10-22 21:50:51 2005-10-22 21:51:00 2005-10-22:21:50:51 VALID N N N

觀察叢集狀態

[oracle@node1 ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.dba.db application ONLINE ONLINE node2

ora....name.cs application ONLINE ONLINE node2

ora....ll1.srv application ONLINE ONLINE node1

ora....ll2.srv application ONLINE OFFLINE

ora....l1.inst application ONLINE ONLINE node1

ora....l2.inst application OFFLINE OFFLINE

ora.dba.rac.cs application ONLINE ONLINE node2

ora....ll1.srv application ONLINE ONLINE node1

ora....ll2.srv application ONLINE OFFLINE

ora....SM1.asm application ONLINE ONLINE node1

ora....E1.lsnr application ONLINE ONLINE node1

ora.node1.gsd application ONLINE ONLINE node1

ora.node1.ons application ONLINE ONLINE node1

ora.node1.vip application ONLINE ONLINE node1

ora....SM2.asm application ONLINE ONLINE node2

ora....E2.lsnr application ONLINE ONLINE node2

ora.node2.gsd application ONLINE ONLINE node2

ora.node2.ons application ONLINE ONLINE node2

ora.node2.vip application ONLINE ONLINE node2

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12180666/viewspace-1035433/,如需轉載,請註明出處,否則將追究法律責任。

相關文章