時(shí)間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評(píng)論(1)
所有實(shí)例和服務(wù)的狀態(tài)
$ srvctl status database -d orcl
Instance orcl1 is running on node linux1
Instance orcl2 is running on node linux2
單個(gè)實(shí)例的狀態(tài)
$ srvctl status instance -d orcl -i orcl2
Instance orcl2 is running on node linux2
在數(shù)據(jù)庫全局命名服務(wù)的狀態(tài)
$ srvctl status service -d orcl -s orcltest
Service orcltest is running on instance(s) orcl2, orcl1
特定節(jié)點(diǎn)上節(jié)點(diǎn)應(yīng)用程序的狀態(tài)
$ srvctl status nodeapps -n linux1
VIP is running on node: linux1
GSD is running on node: linux1
Listener is running on node: linux1
ONS daemon is running on node: linux1
ASM 實(shí)例的狀態(tài)
$ srvctl status asm -n linux1
ASM instance +ASM1 is running on node linux1.
列出配置的所有數(shù)據(jù)庫
$ srvctl config database
orcl
顯示 RAC 數(shù)據(jù)庫的配置
$ srvctl config database -d orcl
linux1 orcl1 /u01/app/oracle/product/10.2.0/db_1
linux2 orcl2 /u01/app/oracle/product/10.2.0/db_1
顯示指定集群數(shù)據(jù)庫的所有服務(wù)
$ srvctl config service -d orcl
orcltest PREF: orcl2 orcl1 AVAIL:
顯示節(jié)點(diǎn)應(yīng)用程序的配置 —(VIP、GSD、ONS、監(jiān)聽器)
$ srvctl config nodeapps -n linux1 -a -g -s -l
VIP exists.: /linux1-vip/192.168.1.200/255.255.255.0/eth0:eth1
GSD exists.
ONS daemon exists.
Listener exists.
顯示 ASM 實(shí)例的配置
$ srvctl config asm -n linux1
+ASM1 /u01/app/oracle/product/10.2.0/db_1
集群中所有正在運(yùn)行的實(shí)例
SELECT
inst_id
, instance_number inst_no
, instance_name inst_name
, parallel
, status
, database_status db_status
, active_state state
, host_name host
FROM gv$instance
ORDER BY inst_id;
INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST
-------- -------- ---------- --- ------- ------------ --------- -------
1 1 orcl1 YES OPEN ACTIVE NORMAL rac1
2 2 orcl2 YES OPEN ACTIVE NORMAL rac2
#p#副標(biāo)題#e#
位于磁盤組中的所有數(shù)據(jù)文件
select name from v$datafile
union
select member from v$logfile
union
select name from v$controlfile
union
select name from v$tempfile;
NAME
-------------------------------------------
+FLASH_RECOVERY_AREA/orcl/controlfile/current.258.570913191
+FLASH_RECOVERY_AREA/orcl/onlinelog/group_1.257.570913201
+FLASH_RECOVERY_AREA/orcl/onlinelog/group_2.256.570913211
+FLASH_RECOVERY_AREA/orcl/onlinelog/group_3.259.570918285
+FLASH_RECOVERY_AREA/orcl/onlinelog/group_4.260.570918295
+ORCL_DATA1/orcl/controlfile/current.259.570913189
+ORCL_DATA1/orcl/datafile/example.257.570913311
+ORCL_DATA1/orcl/datafile/indx.270.570920045
+ORCL_DATA1/orcl/datafile/sysaux.260.570913287
+ORCL_DATA1/orcl/datafile/system.262.570913215
+ORCL_DATA1/orcl/datafile/undotbs1.261.570913263
+ORCL_DATA1/orcl/datafile/undotbs1.271.570920865
+ORCL_DATA1/orcl/datafile/undotbs2.265.570913331
+ORCL_DATA1/orcl/datafile/undotbs2.272.570921065
+ORCL_DATA1/orcl/datafile/users.264.570913355
+ORCL_DATA1/orcl/datafile/users.269.570919829
+ORCL_DATA1/orcl/onlinelog/group_1.256.570913195
+ORCL_DATA1/orcl/onlinelog/group_2.263.570913205
+ORCL_DATA1/orcl/onlinelog/group_3.266.570918279
+ORCL_DATA1/orcl/onlinelog/group_4.267.570918289
+ORCL_DATA1/orcl/tempfile/temp.258.570913303
21 rows selected.
屬于"ORCL_DATA1"磁盤組的所有 ASM 磁盤
SELECT path
FROM v$asm_disk
WHERE group_number IN (select group_number
from v$asm_diskgroup
where name = 'ORCL_DATA1');
PATH
----------------------------------
ORCL:VOL1
ORCL:VOL2
啟動(dòng)/停止RAC集群
確保是以 oracle UNIX 用戶登錄的。我們將從rac1節(jié)點(diǎn)運(yùn)行所有命令:
# su – oracle
$ hostname
Rac1
停止 Oracle RAC 10g 環(huán)境
第一步是停止 Oracle 實(shí)例。當(dāng)此實(shí)例(和相關(guān)服務(wù))關(guān)閉后,關(guān)閉 ASM 實(shí)例。最后,關(guān)閉節(jié)點(diǎn)應(yīng)用程序(虛擬IP、GSD、TNS 監(jiān)聽器和 ONS)。
$ export ORACLE_SID=orcl1
$ emctl stop dbconsole
$ srvctl stop instance -d orcl -i orcl1
$ srvctl stop asm -n rac1
$ srvctl stop nodeapps –n rac1
啟動(dòng) Oracle RAC 10g 環(huán)境
第一步是啟動(dòng)節(jié)點(diǎn)應(yīng)用程序(虛擬 IP、GSD、TNS 監(jiān)聽器和 ONS)。當(dāng)成功啟動(dòng)節(jié)點(diǎn)應(yīng)用程序后,啟動(dòng) ASM 實(shí)例。最后,啟動(dòng) Oracle 實(shí)例(和相關(guān)服務(wù))以及企業(yè)管理器數(shù)據(jù)庫控制臺(tái)。
$ export ORACLE_SID=orcl1
$ srvctl start nodeapps -n rac1
$ srvctl start asm -n rac1
$ srvctl start instance -d orcl -i orcl1
$ emctl start dbconsole
使用 SRVCTL 啟動(dòng)/停止所有實(shí)例
啟動(dòng)/停止所有實(shí)例及其啟用的服務(wù)。我只是覺得有意思就把此步驟作為關(guān)閉所有實(shí)例的一種方法加進(jìn)來了!
$ srvctl start database -d orcl
$ srvctl stop database -d orcl
關(guān)鍵詞標(biāo)簽:Oracle
相關(guān)閱讀
熱門文章 Oracle中使用alter table來增加,刪除,修改列的語法 oracle中使用SQL語句修改字段類型-oracle修改SQL語句案例 誤刪Oracle數(shù)據(jù)庫實(shí)例的控制文件 為UNIX服務(wù)器設(shè)置Oracle全文檢索
人氣排行 oracle中使用SQL語句修改字段類型-oracle修改SQL語句案例 Oracle中使用alter table來增加,刪除,修改列的語法 ORACLE SQL 判斷字符串是否為數(shù)字的語句 ORACLE和SQL語法區(qū)別歸納(1) oracle grant 授權(quán)語句 ORACLE修改IP地址后如何能夠使用 如何加速Oracle大批量數(shù)據(jù)處理 Oracle刪除表的幾種方法