1. 程式人生 > >Oracle 11G RAC資料庫基本測試和使用

Oracle 11G RAC資料庫基本測試和使用

檢查RAC狀態

主節點測試各個節點rac執行是否正常。顯示rac節點詳細資訊

複製程式碼
$ srvctl config database -d rac
Database unique name: rac
Database name: rac
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: /u01/oradata/rac/spfilerac.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: rac
Database instances: rac1,rac2
Disk Groups: 
Services: 
Database 
is administrator managed $ $ srvctl status database -d rac Instance rac1 is running on node rac1 Instance rac2 is running on node rac2 $
複製程式碼


V$ACTIVE_INSTANCES檢視還可以顯示當前狀態的例項。

複製程式碼
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Sep 26 19:04:19 2009
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 
11.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> SELECT inst_name FROM v$active_instances; INST_NAME -------------------------------------------------------------------------------- rac1.localdomain:rac1 rac2.localdomain:rac2 SQL
>
複製程式碼

檢查建立的資料庫

srvctl工具可以顯示當前的RAC資料庫配置和狀態。

顯示AKA群集資料庫的配置資訊:

[email protected]> srvctl config database -d AKA

所有例項和服務的狀態:

[email protected]> srvctl status database -d AKA

某個特定節點上應用程式狀態:

[email protected]> srvctl status nodeapps -n gentic

顯示節點應用程式配置資訊(VIP,GSD,ONS,監聽器)

複製程式碼
 [email protected]> srvctl config nodeapps -n gentic -a -g -s -l

VIP exists.: /gentic-vip/192.168.138.130/255.255.255.0/eth0

GSD exists.

ONS daemon exists.

Listener exists.
 
複製程式碼

群集中執行的所有例項:

複製程式碼
sqlplus system/[email protected]
SELECT inst_id,

instance_number,

instance_name,

parallel,

status,

database_status,

active_state,

host_name host

FROM gv$instance

ORDER BY inst_id;
複製程式碼

檢視V$ACTIVE_INSTANCES也可以顯示當前例項的狀態:

SELECT * FROM v$active_instances;

最後,GV$允許你顯示整個RAC的全域性資訊:

SELECT inst_id, username, sid, serial#

FROM gv$session

WHERE username IS NOT NULL;

啟動企業管理器控制檯