Oracle 11G RAC資料庫基本測試和使用
阿新 • • 發佈:2018-12-27
檢查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: Databaseis 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 Release11.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;
啟動企業管理器控制檯