글
Controlfile 장애복구
컨트롤 파일 장애 복구에 앞서 일단 백업 수행
※ 열린백업을 할 때에는 아카이브 로그모드로 변경 필요. (현재 spfile 사용중)
닫힌백업 수행할꺼지만 복습차원에서 일단 아카이브모드로 변경하고 진행
DB 오픈 상태에서
SYS>alter system set log_archive_dest_1='location=/data/arc1' scope=spfile;
System altered.
SYS>alter system set log_archive_dest_1='location=/data/arc2' scope=spfile;
System altered.
SYS>alter system set log_archive_format="%s_%t_%r.arc" scope=spfile;
System altered.
ORACLE instance started.
Total System Global Area 619360256 bytes
Fixed Size 1345936 bytes
Variable Size 394266224 bytes
Database Buffers 218103808 bytes
Redo Buffers 5644288 bytes
Database mounted.
SYS>archive log list;
Database log mode Archive Mode (아카이브 모드로 변경 완료)
Automatic archival Enabled
Archive destination /data/arc2
Oldest online log sequence 21
Next log sequence to archive 23
Current log sequence 23
SYS>alter database open;
Database altered.
<닫힌백업 수행>
1. 컨트롤파일, 데이터파일, 리두로그의 위치를 각각 확인 한 후
SYS>select name from v$controlfile;
NAME
-----------------------------------------------------------------
/home/oracle/disk3/ctrl01.ctl
/home/oracle/disk4/ctrl02.ctl
/home/oracle/disk5/ctrl03.ctl
SYS>select name from v$datafile;
NAME
-----------------------------------------------------------------
/app/oracle/disk4/system01.dbf
/app/oracle/disk4/sysaux01.dbf
/app/oracle/disk3/undo01.dbf
/app/oracle/disk5/users01.dbf
/app/oracle/disk5/example01.dbf
/app/oracle/oradata/testdb/undo01.dbf
/app/oracle/oradata/testdb/hakjum01.dbf
7 rows selected.
SYS>select member from v$logfile;
MEMBER
-----------------------------------------------------------------
/app/oracle/disk1/redo03_a.log
/app/oracle/disk1/redo02_a.log
/app/oracle/disk1/redo01_a.log
/app/oracle/disk2/redo01_b.log
/app/oracle/disk2/redo02_b.log
/app/oracle/disk2/redo03_b.log
6 rows selected.
2. DB를 종료한 후 /data/backup/close 로 백업한다. 이후 DB 오픈.
[oracle@server128 backup]$ cp /home/oracle/disk3/ctrl01.ctl /data/backup/close/
[oracle@server128 backup]$ cp /home/oracle/disk4/ctrl02.ctl /data/backup/close/
[oracle@server128 backup]$ cp /home/oracle/disk5/ctrl03.ctl /data/backup/close/
[oracle@server128 backup]$
[oracle@server128 backup]$ cp /app/oracle/disk4/system01.dbf /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/disk4/sysaux01.dbf /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/disk3/undo01.dbf /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/disk5/*.dbf /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/oradata/testdb/undo01.dbf /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/oradata/testdb/hakjum01.dbf /data/backup/close/
[oracle@server128 backup]$
[oracle@server128 backup]$ cp /app/oracle/disk1/*.log /data/backup/close/
[oracle@server128 backup]$ cp /app/oracle/disk2/*.log /data/backup/close/
컨트롤파일 장애유형 3가지
1. 파라미터와 실제 경로가 다른경우
-> 안맞는 부분을 서로 맞춰주면 끝
2. Controlfile 끼리 내용이 다른경우 (Version 에러)
-> 높은 버전의 컨트롤파일이 최신 파일이므로 복사해서 해결
3. Old Controlfile
-> 컨트롤파일 재생성 후 resetlogs / noresetlogs 모드로 오픈
유형1.
현재 경로 확인 후 경로 중 하나를 지워서 에러를 발생시키기.
SYS>select name from v$controlfile;
NAME
-------------------------------------------------------------------------
/home/oracle/disk3/ctrl01.ctl
/home/oracle/disk4/ctrl02.ctl
/home/oracle/disk5/ctrl03.ctl
야호 에러가 발생했다.
얼럿 로그를 살펴보자.
[oracle@server128 trace]$ tail -f /app/oracle/diag/rdbms/testdb/testdb/trace/alert_testdb.log
Sat Apr 11 19:34:20 2015
ALTER DATABASE MOUNT
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/home/hahaha/hahahaha/'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-205 signalled during: ALTER DATABASE MOUNT...
Sat Apr 11 19:34:21 2015
Checker run found 1 new persistent data failures
유형2.
위에서 다룸.
유형3.
Old Controlfile 에러 만들기.
백업받아놓은 예전 컨트롤파일을 복사한다.
[oracle@server128 close]$ cp /data/backup/close/ctrl01.ctl /home/oracle/disk3/ctrl01.ctl
[oracle@server128 close]$ cp /data/backup/close/ctrl01.ctl /home/oracle/disk4/ctrl02.ctl
[oracle@server128 close]$ cp /data/backup/close/ctrl01.ctl /home/oracle/disk5/ctrl03.ctl
SYS>startup
ORACLE instance started.
Total System Global Area 619360256 bytes
Fixed Size 1345936 bytes
Variable Size 394266224 bytes
Database Buffers 218103808 bytes
Redo Buffers 5644288 bytes
Database mounted.
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/app/oracle/disk4/system01.dbf'
ORA-01207: file is more recent than control file - old control file
'Backup&Recovery' 카테고리의 다른 글
데이터 이동하기 (Export / Import) (1) | 2015.04.20 |
---|---|
Redo Log File 장애 case (0) | 2015.04.15 |
닫힌백업(cold backup / closed backup) (0) | 2015.04.13 |
백업대상 (0) | 2015.04.13 |
Archive log 압축하여 저장공간 줄이기 (0) | 2015.04.13 |