熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

OracleRAC日常基本維護命令

2022-06-13   來源: Oracle 

  所有實例和服務的狀態

  $ srvctl status database d orcl

  Instance orcl is running on node linux

  Instance orcl is running on node linux

  單個實例的狀態

  $ srvctl status instance d orcl i orcl

  Instance orcl is running on node linux

  在數據庫全局命名服務的狀態

  $ srvctl status service d orcl s orcltest

  Service orcltest is running on instance(s) orcl orcl

  特定節點上節點應用程序的狀態

  $ srvctl status nodeapps n linux

  VIP is running on node: linux

  GSD is running on node: linux

  Listener is running on node: linux

  ONS daemon is running on node: linux

  ASM 實例的狀態

  $ srvctl status asm n linux

  ASM instance +ASM is running on node linux

  列出配置的所有數據庫

  $ srvctl config database

  orcl

  顯示 RAC 數據庫的配置

  $ srvctl config database d orcl

  linux orcl /u/app/oracle/product//db_

  linux orcl /u/app/oracle/product//db_

  顯示指定集群數據庫的所有服務

  $ srvctl config service d orcl

  orcltest PREF: orcl orcl AVAIL:

  顯示節點應用程序的配置 —(VIPGSDONS監聽器)

  $ srvctl config nodeapps n linux a g s l

  VIP exists: /linuxvip///eth:eth

  GSD exists

  ONS daemon exists

  Listener exists

  顯示 ASM 實例的配置

  $ srvctl config asm n linux

  +ASM /u/app/oracle/product//db_

  集群中所有正在運行的實例

  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

  

   orcl YES OPEN ACTIVE NORMAL rac

   orcl YES OPEN ACTIVE NORMAL rac

  位於磁盤組中的所有數據文件

  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

  +FLASH_RECOVERY_AREA/orcl/onlinelog/group_

  +FLASH_RECOVERY_AREA/orcl/onlinelog/group_

  +FLASH_RECOVERY_AREA/orcl/onlinelog/group_

  +FLASH_RECOVERY_AREA/orcl/onlinelog/group_

  +ORCL_DATA/orcl/controlfile/current

  +ORCL_DATA/orcl/datafile/example

  +ORCL_DATA/orcl/datafile/indx

  +ORCL_DATA/orcl/datafile/sysaux

  +ORCL_DATA/orcl/datafile/system

  +ORCL_DATA/orcl/datafile/undotbs

  +ORCL_DATA/orcl/datafile/undotbs

  +ORCL_DATA/orcl/datafile/undotbs

  +ORCL_DATA/orcl/datafile/undotbs

  +ORCL_DATA/orcl/datafile/users

  +ORCL_DATA/orcl/datafile/users

  +ORCL_DATA/orcl/onlinelog/group_

  +ORCL_DATA/orcl/onlinelog/group_

  +ORCL_DATA/orcl/onlinelog/group_

  +ORCL_DATA/orcl/onlinelog/group_

  +ORCL_DATA/orcl/tempfile/temp

   rows selected

  屬於ORCL_DATA磁盤組的所有 ASM 磁盤

  SELECT path

  FROM v$asm_disk

  WHERE group_number IN (select group_number

  from v$asm_diskgroup

  where name = ORCL_DATA);

  PATH

  

  ORCL:VOL

  ORCL:VOL

  啟動/停止RAC集群

  確保是以 oracle UNIX 用戶登錄的我們將從rac節點運行所有命令

  # su – oracle

  $ hostname

  Rac

  停止 Oracle RAC g 環境

  第一步是停止 Oracle 實例當此實例(和相關服務)關閉後關閉 ASM 實例最後關閉節點應用程序(虛擬IPGSDTNS 監聽器和 ONS)

  $ export ORACLE_SID=orcl

  $ emctl stop dbconsole

  $ srvctl stop instance d orcl i orcl

  $ srvctl stop asm n rac

  $ srvctl stop nodeapps –n rac

  啟動 Oracle RAC g 環境

  第一步是啟動節點應用程序(虛擬 IPGSDTNS 監聽器和 ONS)當成功啟動節點應用程序後啟動 ASM 實例最後啟動 Oracle 實例(和相關服務)以及企業管理器數據庫控制台

  $ export ORACLE_SID=orcl

  $ srvctl start nodeapps n rac

  $ srvctl start asm n rac

  $ srvctl start instance d orcl i orcl

  $ emctl start dbconsole

  使用 SRVCTL 啟動/停止所有實例

  啟動/停止所有實例及其啟用的服務我只是覺得有意思就把此步驟作為關閉所有實例的一種方法加進來了!

  $ srvctl start database d orcl

  $ srvctl stop database d orcl


From:http://tw.wingwit.com/Article/program/Oracle/201311/16967.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.