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

Oracle 10g RAC 常用維護命令

2022-06-13   來源: Oracle 

  所有實例和服務的狀態

  [oracle@vzwc ~]$ srvctl status database d zwc

  Instance zwc is running on node vzwc

  Instance zwc is running on node vzwc

  單個實例的狀態

  [oracle@vzwc ~]$ srvctl status instance d zwc i zwc

  Instance zwc is running on node vzwc

  [oracle@vzwc ~]$ srvctl status instance d zwc i zwc

  Instance zwc is running on node vzwc

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

  [oracle@vzwc ~]$ srvctl status nodeapps n vzwc

  VIP is running on node: vzwc

  GSD is running on node: vzwc

  Listener is running on node: vzwc

  ONS daemon is running on node: vzwc

  [oracle@vzwc ~]$

  [oracle@vzwc ~]$ srvctl status nodeapps n vzwc

  VIP is running on node: vzwc

  GSD is running on node: vzwc

  Listener is running on node: vzwc

  ONS daemon is running on node: vzwc

  ASM 實例的狀態

  [oracle@vzwc ~]$ srvctl status asm n vzwc

  ASM instance +ASM is running on node vzwc

  [oracle@vzwc ~]$

  [oracle@vzwc ~]$ srvctl status asm n vzwc

  ASM instance +ASM is running on node vzwc

  顯示 RAC 數據庫的配置

  [oracle@vzwc ~]$ srvctl config database d zwc

  vzwc zwc /u/app/oracle/product//db_

  vzwc zwc /u/app/oracle/product//db_

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

  [oracle@vzwc ~]$ srvctl config nodeapps n vzwc a g s l

  VIP exists: /vzwcvip///eth

  GSD exists

  ONS daemon exists

  Listener exists

  [oracle@vzwc ~]$

  [oracle@vzwc ~]$ srvctl config nodeapps n vzwc a g s l

  VIP exists: /vzwcvip///eth

  GSD exists

  ONS daemon exists

  Listener exists

  顯示 ASM 實例的配置

  [oracle@vzwc ~]$ srvctl config asm n vzwc

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

  [oracle@vzwc ~]$

  [oracle@vzwc ~]$ srvctl config asm n vzwc

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

  RAC正在運行的實例

  SQL> 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

   /

  INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST

  

   zwc YES OPEN ACTIVE NORMAL vzwc

   zwc YES OPEN ACTIVE NORMAL vzwc

  磁盤組中的所有數據文件

  SQL> select name from v$datafile

   union

   select member from v$logfile

   union

   select name from v$controlfile

   union

   select name from v$tempfile

   /

  NAME

  

  +DATADG/zwc/controlfile/current

  +DATADG/zwc/datafile/example

  +DATADG/zwc/datafile/sysaux

  +DATADG/zwc/datafile/system

  +DATADG/zwc/datafile/undotbs

  +DATADG/zwc/datafile/undotbs

  +DATADG/zwc/datafile/users

  +DATADG/zwc/onlinelog/group_

  +DATADG/zwc/onlinelog/group_

  +DATADG/zwc/onlinelog/group_

  +DATADG/zwc/onlinelog/group_

  +DATADG/zwc/tempfile/temp

  +FLASHDG/zwc/controlfile/current

  +FLASHDG/zwc/onlinelog/group_

  +FLASHDG/zwc/onlinelog/group_

  +FLASHDG/zwc/onlinelog/group_

  +FLASHDG/zwc/onlinelog/group_

  OCR存放路徑

  [oracle@vzwc ~]$ ocrcheck

  Status of Oracle Cluster Registry is as follows :

  Version :

  Total space (kbytes) :

  Used space (kbytes) :

  Available space (kbytes) :

  ID :

  Device/File Name : /dev/raw/raw

  Device/File integrity check succeeded

  Device/File not configured

  Cluster registry integrity check succeeded

  VOTEDISK存放路徑

  [oracle@vzwc ~]$ crsctl query css votedisk

   /dev/raw/raw

  located votedisk(s)

  clusterware版本

  [oracle@vzwc ~]$ crsctl query crs activeversion

  CRS active version on the cluster is []

  RAC資源查看

  [oracle@vzwc ~]$ crs_stat t

  Name Type Target State Host

  

  oraSMasm application ONLINE ONLINE vzwc

  oraClsnr application ONLINE ONLINE vzwc

  oravzwcgsd application ONLINE ONLINE vzwc

  oravzwcons application ONLINE ONLINE vzwc

  oravzwcvip application ONLINE ONLINE vzwc

  oraSMasm application ONLINE ONLINE vzwc

  oraClsnr application ONLINE ONLINE vzwc

  oravzwcgsd application ONLINE ONLINE vzwc

  oravzwcons application ONLINE ONLINE vzwc

  oravzwcvip application ONLINE ONLINE vzwc

  orazwcdb application ONLINE ONLINE vzwc

  oracinst application ONLINE ONLINE vzwc

  oracinst application ONLINE ONLINE vzwc

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

  export ORACLE_SID=zwc

  emctl stop dbconsole

  srvctl stop instance d zwc i zwc

  srvctl stop asm n vzwc

  srvctl stop nodeapps n vzwc

  啟動節點應用程序(虛擬 IPGSDTNS 監聽器和 ONS)當成功啟動節點應用程序後啟動 ASM 實例最後啟動 Oracle 實例(和相關服務)以及EM

  export ORACLE_SID=zwc

  srvctl start nodeapps n vzwc

  srvctl start asm n vzwc

  srvctl start instance d zwc i zwc

  emctl start dbconsole

  啟動/停止所有實例及其啟用的服務

  srvctl start database d zwc

  srvctl stop database d zwc


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