最近處理過好幾個關(guān)于RAC在重啟時個別資源無法啟動,例instance、tns等。
創(chuàng)新互聯(lián)公司2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目網(wǎng)站建設(shè)、成都網(wǎng)站制作網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元合江做網(wǎng)站,已為上家服務(wù),為合江各地企業(yè)和個人服務(wù),聯(lián)系電話:13518219792
資源情況如下:
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.DATA.dg
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.LISTENER.lsnr
OFFLINE OFFLINE resdb1
OFFLINE OFFLINE resdb2
ora.asm
ONLINE ONLINE resdb1 Started
ONLINE ONLINE resdb2 Started
ora.gsd
OFFLINE OFFLINE resdb1
OFFLINE OFFLINE resdb2
ora.net1.network
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.ons
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
ora.registry.acfs
ONLINE ONLINE resdb1
ONLINE ONLINE resdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE resdb1
ora.cvu
1 ONLINE ONLINE resdb2
ora.oc4j
1 ONLINE ONLINE resdb1
ora.resdb.db
1 OFFLINE OFFLINE resdb1
2 OFFLINE OFFLINE resdb2
從上面狀態(tài)信息可以看出,resdb數(shù)據(jù)庫的resdb1和resdb2兩個實例及監(jiān)聽的TARGET和STATE值都為OFFLINE。
而大多數(shù)初級DBA在關(guān)閉數(shù)據(jù)庫和監(jiān)聽是基本都是sqlplus shut immediate,這樣以來就會出現(xiàn)上邊的問題。(這樣會導(dǎo)致cluster無法正常管理資源)
查看
查看每個資源屬性的值如下:
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
ACL=owner:grid:rwx,pgrp:oinstall:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=%CRS_HOME%/bin/racgwrap%CRS_SCRIPT_SUFFIX%
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
ALIAS_NAME=ora.%CRS_CSS_NODENAME_LOWER_CASE%.LISTENER_%CRS_CSS_NODENAME_UPPER_CASE%.lsnr
AUTO_START=restore----此屬性
CHECK_INTERVAL=60
CHECK_TIMEOUT=120
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=listener) PROPERTY(LISTENER_NAME=PARSE(%NAME%, ., 2))
DEGREE=1
DESCRIPTION=Oracle Listener resource
ENABLED=1
ENDPOINTS=TCP:1521
LOAD=1
LOGGING_LEVEL=1
NAME=ora.resdb.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:r--,other::r--,group:dba:r-x,group:oper:r-x,user:grid:r-x
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore----此屬性
CARDINALITY=2
CHECK_INTERVAL=1
CHECK_TIMEOUT=30
CLUSTER_DATABASE=true
避免此問題發(fā)生,可修改如下屬性:(root用戶)
./crsctl modify resource "ora.LISTENER.lsnr" -attr "AUTO_START=always"
./crsctl modify resource "ora.resdb.db" -attr "AUTO_START=always"
而10G數(shù)據(jù)庫的crs和11G還是有一定差別的。
10G 的屬性如下:
$ crs_stat -p
NAME=ora.dba.LISTENER_RACDB1.lsnr
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
.......
NAME=ora.dbb.LISTENER_RACDB2.lsnr
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
DESCRIPTION=CRS application for listener on node
NAME=ora.RACDB.db
TYPE=application
ACTION_SCRIPT=/oracle/crs10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
CHECK_INTERVAL=600
NAME=ora.RACDB.RACDB1.inst
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
NAME=ora.RACDB.RACDB2.inst
TYPE=application
ACTION_SCRIPT=/oracle/oracle10g/bin/racgwrap
ACTIVE_PLACEMENT=0
AUTO_START=1
屬性說明:
AUTO_START值
0,表示:啟動到資源重啟之前的狀態(tài)
1,表示:啟動資源
2,表示:不啟動資源
可以用如下命令進行修改
crs_register resource_name -update -o as=2 ---(root下)
一般在安裝11GR2 RAC時,有經(jīng)驗的dba都會對資源屬性進行修改
如:
./crsctl modify res ora.crf -attr AUTO_START=never
./crsctl modify res ora.crf ENABLE=0 –init
./crsctl modify resource "ora.LISTENER.lsnr" -attr "AUTO_START=always"
./crsctl modify resource "ora.racdb.db" -attr "AUTO_START=always"