oracle rac基礎 oifcfg ocrconfig(轉自xyy@163)
[root@rac1 grid]# sh /u01/app/11.2.0/grid/bin/ocrconfig -export /u01/app/grid/1
使用秘訣: srvctl +<command:status,start,stop,config,modify,relocate>+<object:database,service,instance,nodeapps> + <option: -i ,-d,-s,-n> srvctl -h srvctl stop instance -h
srvctl relocate service -h
AEG2_DB2:/oracle/product/10.2.0/crs>srvctl relocate service -h 根據你寫出的長度不同的命令,會具體給出這個命令對應的作用的使用方法,非常好用。 ---------------------Start/Stop Instance-------------------- $ srvctl status database -d racdb $ srvctl stop instance -d racdb -i racdb1 -o abort $ srvctl status database -d racdb
-------------------Start/Stop CRS-------------------------- $ crsctl check crs
$ crsctl stop crs $ /etc/init.crs stop $ crs_stop –all
$ crsctl start crs $ /etc/init.crs start
$ /etc/init.crs disable $ /etc/init.crs enable
-----------------CRS Resource----------------------------- $ crs_stat $ crs_stat -t $ crsctl check boot $ crsctl check crs # /etc/init.crs disable # /etc/init.crs stop # su – oracle $ cd $ORA_CRS_HOME/bin $./ocrconfig -restore /opt/app/oracle/crs/cdata/crs/week.ocr # /etc/init.crs enable
$ crsctl Usage: crsctl check crs - checks the viability of the CRS stack crsctl check cssd - checks the viability of CSS crsctl check crsd - checks the viability of CRS crsctl check evmd - checks the viability of EVM crsctl set css <parameter> <value> - sets a parameter override crsctl get css <parameter> - gets the value of a CSS parameter crsctl unset css <parameter> - sets CSS parameter to its default crsctl query css votedisk - lists the voting disks used by CSS crsctl add css votedisk <path> - adds a new voting disk crsctl delete css votedisk <path> - removes a voting disk crsctl enable crs - enables startup for all CRS daemons crsctl disable crs - disables startup for all CRS daemons crsctl start crs - starts all CRS daemons. crsctl stop crs - stops all CRS daemons. Stops CRS resources in case of cluster. crsctl start resources - starts CRS resources. crsctl stop resources - stops CRS resources. crsctl debug statedump evm - dumps state info for evm objects crsctl debug statedump crs - dumps state info for crs objects crsctl debug statedump css - dumps state info for css objects crsctl debug log css [module:level]{,module:level} ... - Turns on debugging for CSS crsctl debug trace css - dumps CSS in-memory tracing cache crsctl debug log crs [module:level]{,module:level} ... - Turns on debugging for CRS crsctl debug trace crs - dumps CRS in-memory tracing cache crsctl debug log evm [module:level]{,module:level} ... - Turns on debugging for EVM crsctl debug trace evm - dumps EVM in-memory tracing cache crsctl debug log res <resname:level> turns on debugging for resources crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed crsctl query crs activeversion - lists the CRS software operating version crsctl lsmodules css - lists the CSS modules that can be used for debugging crsctl lsmodules crs - lists the CRS modules that can be used for debugging crsctl lsmodules evm - lists the EVM modules that can be used for debugging
SRVCTL命令介紹 SRVCTL命令可以控制RAC資料庫中的instance,listener以及services。 通常SRVCTL在ORACLE使用者下執行。下面我們來介紹srvctl命令。 1、透過SRVCTL命令來start/stop/check所有的例項: $ srvctl start|stop|status database -d <db_name>
2、start/stop指定的例項: $ srvctl start|stop|status instance -d <db_name> -i <instance_name>
3、列出當前RAC下所有的 $ srvctl config database -d <db_name>
4、start/stop/check 所有的nodeapps,比如:VIP, GSD, listener, ONS: $ srvctl start|stop|status nodeapps -n <node_name> 5、如果你使用ASM,srvctl也可以start/stop ASM例項: $ srvctl start|stop asm -n <node_name> [-i <asm_inst_name>] [-o<oracle_home>] 6、可以獲取所有的環境資訊: $ srvctl getenv database -d <db_name> [-i <instance_name>] 7、設定全域性環境和變數: $ srvctl setenv database -d <db_name> -t LANG=en 8、從OCR中刪除已有的資料庫: $ srvctl remove database -d <db_name> 9、向OCR中新增一個資料庫: $ srvctl add database -d <db_name> -o <oracle_home> [-m <domain_name>] [-p<spfile>] [-A <name|ip>/netmask] [-r {PRIMARY | PHYSICAL_STANDBY |LOGICAL_STANDBY}] [-s <start_options>] 10、向OCR中新增一個資料庫的例項: $ srvctl add instance -d <db_name> -i <instance_name> -n <node1> $ srvctl add instance -d <db_name> -i <instance_name> -n <node2> 11、向OCR中新增一個ASM例項: $ srvctl add asm -n <node_name> -i <asm_inst_name> -o <oracle_home> 12、新增一個service $ srvctl add service -d <db_name> -s <service_name> -r <preferred_list>
[-a <available_list>] [-P <TAF_policy>] [-u] 13、修改在其他節點上的service(修改的是配置,此時使用的例項不變) $ srvctl modify service -d <db_name> -s <service_name> -I <orig_instance_name> -t <target_instance_name> 14、relocate 某個節點的service到其他節點(當taf轉到avail例項上後,又想轉到pre的例項上,用relocate) srvctl relocate service -d <db_name> -s <service_name> -I <orig_instance_name> -t <target_instance_name>
SRVCTL相關的選項 SRVCTL START/STOP/STATUS options: -d database name -i instance name -n node name (for nodeapps)
SRVCTL ADD options: -A vip range, node, and database, address specification. The format of address string is: [<logical host name>]/<VIP address>/<net mask> [/<host interface1 [ | host interface2 |..]>] [,] [<logical host name>]/<VIP address>/<net mask> [/<host interface1[ | host interface2 |..]>] -a for services, list of available instances, this list cannot include preferred instances -m domain name with the format “us.domain.com” -n node name that will support one or more instances -o $ORACLE_HOME to locate Oracle binaries -P for services, TAF preconnect policy - NONE, PRECONNECT -r for services, list of preferred instances, this list cannot include available instances. -s spfile name -u updates the preferred or available list for the service to support the specified instance. Only one instance may be specified with the -u switch. Instances that already support the service should not be included.
SRVCTL MODIFY options: -i <instance-name> -t <instance-name> : the instance name (-i) is replaced by the instance name (-t) -i <instance-name> -r : the named instance is modified to be a preferred instance -A address-list for VIP application, at node level -s <asm_inst_name> : add or remove ASM dependency
SRVCTL RELOCATE options: -i <instance-name> -t <instance-name> : the instance name (-i) is replaced by the instance name (-t)
CRS及相關服務的常用命令 1、檢視狀態的命令 # su – oracle -- 先切換到oracle使用者 $ crs_stat -t -- 檢視crs及所有的service的狀態 Name Type Target State Host ------------------------------------------------------------ ora.oradb.db application ONLINE ONLINE db01 ora....radb.cs application ONLINE ONLINE db01 ora....db1.srv application ONLINE ONLINE db01 ora....db2.srv application ONLINE ONLINE db02 ora....b1.inst application ONLINE ONLINE db01 ora....b2.inst application ONLINE ONLINE db02 ora....C1.lsnr application ONLINE ONLINE db01 ora.db01.gsd application ONLINE ONLINE db01 ora.db01.ons application ONLINE ONLINE db01 ora.db01.vip application ONLINE ONLINE db01 ora....C2.lsnr application ONLINE ONLINE db02 ora.db02.gsd application ONLINE ONLINE db02 ora.db02.ons application ONLINE ONLINE db02 ora.db02.vip application ONLINE ONLINE db02 $ crsctl check crs -- 用crsctl命令,檢查crs相關服務的狀態 CSS appears healthy CRS appears healthy EVM appears healthy $ srvctl status nodeapps -n db01 (db02) -- 使用srvctl檢視所有節點上的服務是否正常 VIP is running on node:db01 GSD is running on node:db01 Listener is running on node:db01 ONS daemon is running on node:db01 $ srvctl status database -d db -- 使用srvctl檢視資料庫狀態 Instance db01 is running on node db01 Instance db02 is running on node db02 2、啟動和關閉相關服務的命令 # su – oracle $ crs_start –all --啟動所有的crs服務 $ crs_stop –all --停止所有的crs服務 $ crsctl start crs --啟動crs服務 $ crsctl stop crs --停止crs服務
$ srvctl start nodeapps -n db01(db02) --啟動某節點上所有的應用 $ srvctl stop nodeapps -n db01(db02) --停止某節點上所有的應用 $ srvctl start listener -n db01(db02) --啟動某個節點的listener $ srvctl stop listener -n db01(db02) --停止某個節點的listener $ srvctl start instance –d db –i db01(db02) --啟動某個instance $ srvctl stop instance –d db –i db01(db02) --停止某個instance $ srvctl start database –d db --啟動資料庫 $ srvctl stop database –d db --停止資料庫 |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21302630/viewspace-1757693/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- (轉)【oifcfg】使用Oracle介面配置工具(oifcfg)調整RAC公用和私有互聯IP子網配置Oracle
- 【RAC】OIFCFG 工具的使用
- 【oifcfg】使用Oracle介面配置工具(oifcfg)調整RAC公用和私有互聯IP子網配置Oracle
- RAC基礎
- Oracle RAC Cache Fusion 系列一:基礎概念Oracle
- oracle基礎入門(轉)Oracle
- Oracle 11.2.0.3RAC新特性-遷移spfile[Oracle基礎]Oracle
- 【RAC】RAC相關基礎知識
- oracle rac管理維護筆記_轉自網友Oracle筆記
- Oracle RAC自啟動Oracle
- OIFCFG命令
- Oracle PL/SQL語言基礎(轉)OracleSQL
- [RAC]使用ocrconfig -replace命令建立ocr鏡象檔案
- oracle架構的基礎知識(轉)Oracle架構
- 【轉】基於iSCSI與Openfiler構建自己的Oracle RACOracle
- 網格RAC基礎日誌
- oracle grid oifcfg iflist 與 getif的區別Oracle
- Oracle 基礎Oracle
- 新手上路:Oracle基礎工具簡介(轉)Oracle
- grid 常用命令和基礎概念 (Oracle RAC Administration)Oracle
- oracle單例項轉RACOracle單例
- 轉載:Oracle RAC簡介Oracle
- Oracle RAC之名詞解惑~~(轉)Oracle
- (轉)ORACLE RAC with NFS installOracleNFS
- [轉] Oracle RAC知識索引Oracle索引
- rac基礎知識溫習(1)
- Oracle ClusterwarePRCT-1011 : Failed to run "oifcfg".&nbOracleAI
- [RAC] Oracle11g RAC禁止DB自動啟動Oracle
- GI的oifcfg命令
- OCRCONFIG工具
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(1/8)-orastarOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(2/8)-orastarOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(3/8)-orastarOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(4/8)-orastaOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(5/8)-orastaOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(6/8)-orastaOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(7/8)-orastaOracleAST
- star帶你玩轉Oracle-零基礎openfiler共享儲存安裝Oracle 11G RAC-(8/8)-orastaOracleAST