본문 바로가기
oracle

[ORACLE] OCR

by 둥구리둥둥 2023. 5. 11.
728x90
반응형

1. OCR (Oracle Cluster Repository)
- RAC 상의 모든 Node 들에 대한 cluster 구성정보를 저장하고 있는 저장소
- OCR은 기본적으로는 자동 백업이 설정되어 있으며 기본적으로는 root 가 소유자


2. OCR 관련 사항 확인
 # ocrcheck
- ocrcheck 결과 "check succeeded" 가 마지막에 결과로 나오면 OCR이 이상없음을 의미
-   "Device/File Name"  OCR File이 저장되어 있는 Diskgroup
- ocrcheck -detail 명령어를 수행하면 더 자세한 정보 확인 가능
EX>
 # ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          3
     Total space (kbytes)     :     262120
     Used space (kbytes)      :       2844
     Available space (kbytes) :     259276
     ID                       :  737356714
     Device/File Name         : +DGOCR1
                                    Device/File integrity check succeeded
     Device/File Name         : +DGOCR2
                                    Device/File integrity check succeeded
 
                                    Device/File not configured
 
                                    Device/File not configured
 
                                    Device/File not configured
 
     Cluster registry integrity check succeeded
 
     Logical corruption check succeeded


3. Node 무결성을 확인하는 방법

# cluvfy comp ocr [ -n node_list] 

EX> -- 결과 체크후 successful 이 추출된 것을 확인 할수 있으면 전체 node 무결성에 이상이 없음을 의미 
# cluvfy comp ocr -n all -verbose
Verifying OCR Integrity ...PASSED
Verification of OCR integrity was successful.
... 중략


4. OCR의 자동백업경로 확인
# ocrconfig -showbackup

EX>
# ocrconfig -showbackup
rac1 " ocr bakcup date"  "+DGOCR:/백업경로"
(백업주기  : backup00.ocr~backup02.ocr 4시간 간격 기본 3세트 유지, 
               day.ocr 일 단위,
               week.ocr 주 단위)


5.OCR 백업 경로 변경
# ocrconfig -backuploc <경로>

6. 수동 백업 진행 -- 기존 백업 경로에 백업파일 생성
# ocrconfig -manualbackup

7. OCR MIRROR -- OCR 파일 추가하여 안정성 확보 
# ocrconfig add <ASM diskgroup 명>

8. OCR 삭제
# ocrconfig -delete <file 명, ASM diskgroup 명>

9. OCR 복원
1) 백업 확인
# ocrconfig -showbackup

2) Oracle Cluster  중지
# crsctl stop crs 

3) Oracle Cluster Exclusive mode 기동
# crsctl start crs -excl -nocrs

4) OCR 복원
# ocrconfig -restore <백업경로/파일명>
EX>
#ocrconfig -restore +DGOCR:/rac/OCRBACKUP/backup00.ocr.262.1136546851

5) Oracle Cluster 중지(Exclusive mode 중지 후 다시 기동)
# crsctl stop crs

6) Oracle Cluster 기동
# crsctl start crs

7) OCR 무결성 검사
#  cluvfy comp ocr -n all

728x90
반응형