프린트 하기

OS환경 : Oracle Linux 7.4 (64bit)

 

DB 환경 : Oracle Database 11.2.0.4 RAC

 

방법 : 오라클 11g R2 GRID OLR 백업 복구 

Oracle Local Registry(OLR)는 11gR2/12c GRID 부터 생김

OLR에는 OHASD에 필요한 로컬 노드 특정 구성정보가 포함되며 노드 간에 공유되지 않음 (각 노드에는 자체 OLR이 있음)

 

 

OLR 위치를 가르키는 포인터 파일 위치는 플랫폼에 따라 '/etc/oracle/olr.loc' 또는 '/var/opt/oracle/olr.loc'임

Oracle Clusterware 설치 후 기본 위치

GI RAC 환경: $GRID_HOME/cdata/<hostname.olr>
GI SINGLE 환경 (Oracle Restart): $GRID_HOME/cdata/localhost/<hostname.olr>

 

 

OLR 백업

OLR은 GRID 설치 또는 업그레이드 중에 백업됨

OCR과 달리 OLR은 GI가 구성된 후 자동으로 다시 백업되지 않으며 수동 백업만 수행할 수 있음

추가 백업이 필요한 경우 OLR을 수동으로 백업해야함

1
2
3
4
5
# ocrconfig -local -manualbackup
 
rac1     2021/10/20 02:54:05     /app/grid/product/11.2.0/grid/cdata/rac1/backup_20211020_025405.olr
 
rac1     2018/03/08 01:58:21     /app/grid/product/11.2.0/grid/cdata/rac1/backup_20180308_015821.olr

 

 

백업 목록 확인

1
2
3
4
5
# ocrconfig -local -showbackup
 
rac1     2021/10/20 02:54:05     /app/grid/product/11.2.0/grid/cdata/rac1/backup_20211020_025405.olr
 
rac1     2018/03/08 01:58:21     /app/grid/product/11.2.0/grid/cdata/rac1/backup_20180308_015821.olr

GRID는 최근 5개의 수동 백업 기록을 유지함

수동 백업이 생성된 후에는 업데이트/삭제하지 않음

OS에서 파일을 지워도 위 명령에서는 지워졌다고 나오지 않고 그대로 나옴

 

 

OS 파일 목록 확인

1
2
3
4
5
6
# ls -al /app/grid/product/11.2.0/grid/cdata/rac1/
total 33520
drwxr-xr-2 oracle dba     4096 Oct 20 02:54 .
drwxrwxr-5 oracle dba       70 Oct 20 02:52 ..
-rw------- 1 root   root 6787072 Mar  8  2018 backup_20180308_015821.olr
-rw------- 1 root   root 7024640 Oct 20 02:54 backup_20211020_025405.olr

 

 

복원방법

ohasd.bin 이 정지되었는지 확인 후 진행

1
2
3
# ps -ef |grep ohasd.bin
root      1632     1  0 Oct19 ?        00:00:44 /app/grid/product/11.2.0/grid/bin/ohasd.bin reboot
root     22124  2938  0 02:58 pts/0    00:00:00 grep --color=auto ohasd.bin

 

 

정지되지 않았다면 정지

1
2
3
4
5
Rac grid 환경
# crsctl stop crs
 
Single grid 환경
# crsctl stop has

 

 

복원

1
2
3
4
예시
# ocrconfig -local -restore "olr백업파일"
 
# ocrconfig -local -restore /app/grid/product/11.2.0/grid/cdata/rac1/backup_20211020_025405.olr

 

 

명령 실패 시 아래 작업 진행

1
2
3
4
# cd <OLR location>
# touch <hostname>.olr
# chmod 600 <hostname>.olr
# chown <grid>:<oinstall> <hostname>.olr

 

 

grid 기동

1
2
3
4
5
Rac grid 환경
# crsctl start crs
 
Single grid 환경(grid 유저)
$ crsctl start has

 

 

참조 : 1193643.1