crs resource의 상태를 crs_stat 명령으로 확인해 보면 가끔 resource의 상태가 UNKNOW인 경우가 가끔 발생한다.
CRS resource가 정상적으로 가동 되지 않은 경우도 있고 또 정상적으로 가동된 것 같은데 UNKNOW인 경우도 가끔 있다.  

oracle CRS resource가 UNKNOWN 상태로 변경되는 이유는 일반적으로 CRS resource start/stop/check 시의 action script 수행이 실패할 때 status가 변경되게 된다. 다음은 CRS resource의 state가 UNKNOWN으로 변경되는 일반적인 원인이다.
    

1.  The permission of the resource trace file is incorrect.
2.  The permission of the action script and other racg script is incorrect.
3.  The server load is very heavy and the action script times out.
4.  The look up to NIS hangs or takes very long time and causes the action script to time out.


CRS resource의 action script는 다음의 명령으로 확인할 수 있다. 
crs_stat -p <resource name such as ora.node1.vip> | grep ACTION_SCRIPT

CRS resource 이름은 다음의 명령으로 확인할 수 있다.
crs_stat | grep -i name

다음은 위에 기술한 CRS resource의 UNKNOWN state의 일반적인 원인에 대해 점검해 볼 항목이다.

1.  The permission of the resource trace file if it is incorrect. 
The resource trace file in in the HOME/log/<node name>/racg directory where HOME is the the HOME directory of action script for the resource.

2.  The permission of racg scripts in the HOME/bin directory if it they are incorrect. 
HOME is the the HOME directory of action script for the resource. Please issue "ls -l HOME/bin/racg*" to get the permission of the racg script. Please issue "ls -l HOME/bin/racg*" as user oracle or a user who normally starts up failing resources.
If any of the racg script is a soft link to another file, then check the permission of the file to which the racg script is soft linked.

3.  Check crsd.log and see if the resource action script timed out. 
If it did, then check if the server load was heavy (95% used or higher) for a minute or longer at the time of the failure. Setting up OSWatcher or IPD/OS can help troubleshooting this if the timeout occurs intermittently. Also, check if the NIC was having a problem at the time of the failure. 


참고 : Common Causes for CRS Resources in UNKNOWN State (Doc ID 860441.1) 

* Veritas VCS log 확인 
cat /var/adm/syslog.log | egrep 'Nov 27 00|NOV 27 01' | egrep 'VCS|oracle' | grep -v tty
* strace / tusc / truss 사용
Linux: strace -o /tmp/truss.out -aef sqlplus "/ as sysdba"
HP: tusc -afpo /tmp/truss.out -aef sqlplus "/ as sysdba"
AIX/ Solaris: truss -aefo (output file) (executable)

* OS system log file & error messages
SOLARIS : 
System log file /var/adm/messages

HP : 
System log file /var/adm/syslog/syslog.log
Display system/error messages /usr/sbin/dmesg

Linux :
System log file /var/log/messages
Display system/error messages dmesg
  
AIX :
System log file /var/adm/ras/errlog   
Display system/error messages /bin/errpt -a  

WINDOWS :
Event viewer. click on actions >> export list

* CRS process 확인
1. ps -ef | grep d.bin

* Resource Status 확인
crs_stat -t
crs_stat -p ==> CRS PROFILE을 확인

* Node_name 확인
as oracle> $ORA_CRS_HOME/crs/bin/olsnodes -n

* CRS 실행
1. as root> $ORA_CRS_HOME/crs/bin/crsctl start crs

* ASM 사용시 Start/Stop 방법
as oracle> srvctl start/stop asm -n node_name

* Listener Start/Stop 방법
as oracle> srvctl start/stop listener -n node_name [-l listenername]

* Instance Startup/Stop

srvctl start instance -d oraDB -i oraDB1
srvctl stop instance -d oraDB -i oraDB1
srvctl status database -d oraDB
Instance oraDB1 is not running on node ds04e
Instance oraDB2 is not running on node ds05e

* Database Down 방법

1. sqlplus "/as sysdba"
   SQL> shutdown immediate
   또는
   srvctl stop database -d db_name

2. srvctl stop nodeapps -n <node#1_name>
3. srvctl stop nodeapps -n <node#2_name>
4. as root> /fsoracle/app/oracle/crs/bin/crsctl stop crs
5. OS Cluster Down                     -- 꼭 내릴 필요는 없음

* Database startup 방법

1. OS Cluster startup
2. as root> /fsoracle/app/oracle/crs/bin/crsctl start crs
3. srvctl start nodeapps -n <node#1_name>        -- Resource Start (Optional)
4. srvctl start nodeapps -n <node#2_name>        -- Resource Start (Optional)
5. sqlplus "/as sysdba"
   SQL> startup
   또는 srvctl start database -d db_name

* CRS setup 방법

1. Database Auto Restart Disable 방법
   crs_stat -p ora.DSCTMA.db > /tmp/ora.DSCTMA.db.cap
   crs_profile -update ora.DSCTMA.db -dir /tmp -o as=2,ra=0
   crs_register ora.DSCTMA.db -dir /tmp -u
   crs_stat -p  ora.DSCTMA.db | grep -E "REQUIRED_RESOURCES|RESTART_ATTEMPTS|AUTO_START"


2.Instance Auto Restart  Disable 방법
  crs_stat -p ora.DSCTMA.DSCTMA01.inst > /tmp/ora.DSCTMA.DSCTMA01.inst.cap
  crs_profile -update ora.DSCTMA.DSCTMA01.inst -dir /tmp -o as=2,ra=0        -- Resource Option 수정
  crs_register ora.DSCTMA.DSCTMA01.inst -dir /tmp -u
  crs_stat -p  ora.DSCTMA.DSCTMA01.inst | grep -E "REQUIRED_RESOURCES|RESTART_ATTEMPTS|AUTO_START"

  crs_stat -p ora.DSCTMA.DSCTMA02.inst > /tmp/ora.DSCTMA.DSCTMA02.inst.cap
  crs_profile -update ora.DSCTMA.DSCTMA02.inst -dir /tmp -o as=2,ra=0        -- Resource Option 수정
  crs_register ora.DSCTMA.DSCTMA02.inst -dir /tmp -u
  crs_stat -p  ora.DSCTMA.DSCTMA02.inst | grep -E "REQUIRED_RESOURCES|RESTART_ATTEMPTS|AUTO_START"

3.crsctl disable crs ( Automatic Startup Disable )

4. Network Down 시 Database shutdown 방지 방법
crs_stat -p ora.DSCTMA.DSCTMA01.lsnr > /tmp/ora.DSCTMA.DSCTMA01.lsnr.cap
crs_profile -update ora.DSCTMA.DSCTMA01.lsnr -dir /tmp -o as=0,ra=0
crs_register ora.DSCTMA.DSCTMA01.lsnr -dir /tmp -u
crs_stat -p  ora.DSCTMA.DSCTMA01.lsnr | grep -E "REQUIRED_RESOURCES|RESTART_ATTEMPTS|AUTO_START"


5. VIP auto restart 기능 OFF
crs_stat -p ora.<node#1_name>.vip > /tmp/ora.<node#1_name>.vip.cap
crs_profile -update ora.<node#1_name>.vip -dir /tmp -o as=0  # auto_start=0
crs_register ora.<node#1_name>.vip -dir /tmp -u
crs_stat -p  ora.<node#1_name>.vip | grep -E "REQUIRED_RESOURCES|RESTART_ATTEMPTS|AUTO_START"





1. crs 버전

# ./crsctl query crs softwareversion
CRS software version on node [mars] is [10.2.0.2.0]

# ./crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.2.0]

2. crs 설치 정보

각 노드에서 olsnodes -n,   oicfg getif 를 수행한다.

예:
# olsnodes -n

결과
pvl31  1
pvl41  2

# oifcfg getif

결과
en0  192.1.10.0 global public
en1  192.1.11.0 global cluster_interconnect

3. crs 상태 확인

as oracle user

# crs_stat -t

ora.V10SN.V10SN1.inst                         ONLINE     ONLINE on opcbsol1
ora.V10SN.V10SN2.inst                         ONLINE     ONLINE on opcbsol2
ora.V10SN.db                                  ONLINE     ONLINE on opcbsol2
ora.opcbsol1.ASM1.asm                         ONLINE     ONLINE on opcbsol1
ora.opcbsol1.LISTENER_OPCBSOL1.lsnr           ONLINE     ONLINE on opcbsol1
ora.opcbsol1.gsd                              ONLINE     ONLINE on opcbsol1
ora.opcbsol1.ons                              ONLINE     ONLINE on opcbsol1
ora.opcbsol1.vip                              ONLINE     ONLINE on opcbsol1
ora.opcbsol2.ASM2.asm                         ONLINE     ONLINE on opcbsol2
ora.opcbsol2.LISTENER_OPCBSOL2.lsnr           ONLINE     ONLINE on opcbsol2
ora.opcbsol2.gsd                              ONLINE     ONLINE on opcbsol2
ora.opcbsol2.ons                              ONLINE     ONLINE on opcbsol2
ora.opcbsol2.vip                              ONLINE     ONLINE on opcbsol2

프로세스(process) 확인
ps -ef | grep oprocd     | grep -v grep
ps -ef | grep evmd     | grep -v grep
ps -ef | grep ocssd     | grep -v grep
ps -ef | grep crsd     | grep -v grep

4. network 구성

기본 구성
node        : pvl31, pvl41
interconnect: pvl31_int,pvl41_int
vip         : pvl31_vip(192.1.10.131),pvl41_vip(192.1.10.141)

en0 : public  (192.1.10.31/41)
en1 : private (192.1.11.31/41)

# netstat -l

Name  Mtu    Network   Address
En0   1500   link#2    0.2.55……..
En0   1500   192.1.10  pvl31
En0   1500   192.1.10  pvl31_vip
En1   1500   link#3    0.2.55…….
En1   1500   192.1.11  pvl31_int

5. voting , ocr 위치

[voting disk]
# crsctl query css votedisk

[ocr]
/var/opt/oracle/srvConfig.loc 에 지정되어 있거나 환경 변수인 SRV_CONFIG에 지정 되어 이다.

# ocrcheck

리눅스     : /var/oracle
기타 유닉스: /var/opt/oracle

내용:
ocrconfig_loc=<shared device>
local_only=FALSE

6. callout 디렉토리

$ORA_CRS_HOME/racg/usrco
$ORA_CRS_HOME/racg/usrco






사례 1) Database를 매뉴얼하게 생성 후 netca, srvctl add 명령으로 서비스 등록 후, srvctl start 명령 시 node 2번에서만 listener, instance가 시작되지 않고 crs_satat-t로 보았을 때 target =online, status UNKNOWN으로 나타난다.

사례 2) srvctl로 instnace startup시 다음과 같은 에러가 발생한다. Sqlplus로 메뉴얼하게 startup하면 정상적으로 startup된다.
srvctl start database -d BDB
PRKP-1001 : Error starting instance BDB1 on node bdb1
CRS-0215: Could not start resource 'ora.BDB.BDB1.inst'.
PRKP-1001 : Error starting instance BDB2 on node bdb2
CRS-0215: Could not start resource 'ora.BDB.BDB2.inst'.

사례 3) Veritas clusterware에 10gR2 CRS 설치 후 ons와 gsd가 구동되지 않는다.







oracle은 9i로 version이 올라오면서 이전 버전의 OPS(oracle parallel server)를 RAC(real application cluster)로 명칭을 바꾸고 새로운 기능들을 대폭 추가했다. 양 노드간의 데이터의 cache level에서의 이전을 지원하는 cache fusion, 일부 노드의 장애에 대해 자동으로 client 의 접속을 다른 노드로 넘겨주는 TAF, CTF 등의 추가로 HA 기능을 강조하던 이전의 버전에서 cluster 기능을 대폭 강화 했다.


oracle 10g rac에서의 가장 눈에 띄는 변화는 CRS의 등장이다. CRS는 서로 다른 platform에서도 동일한 interface를 구현하기 위해 설계되었다. 동일한 interface의 구현이라면 platform과는 상관없이 데이터베이스에서의 동일한 기능 구현을 말하는 듯 하다.

(혹시 다른 CRS(crystal red shrimp) 찾아 오신분들을 위해 사진 올립니다... ㅋ)

CRS(crystal red shrimp)



CRS는 여러 application을 가지고 있다. 이 application들은 발생하는 event를 모니터링해서 미리 설정된 action을 취하게 된다. public network의 단절이나, private network의 단절, disk controller와의 통신 문제, system 장애에 대해 이러한 action을 지정할 수 있다.
이러한 미리 정의된 action으로 사용자는 시스템 레벨에서의 장애 상황에 따른 application level의 조치 없이 운영이 가능하다.

물론 각 장애를 인지하기 위한 timeout까지의 시간, 강제 종료된 instance에 대한 recovery 시간등이 필요하므로 이에 대한 업무의 영향은 있을 것이다.

자세한 내용은 요기서..
Oracle 10g RAC의 CRS (Cluster Ready Services)
http://blog.naver.com/PostView.nhn?blogId=hmsong95&logNo=130004625118#






+ Recent posts