본문 바로가기
oracle/[Recovery] RMAN & Flashback

[Recovery Manager] RMAN - 복구 (완전복구)

by #moonyz 2014. 11. 14.

case 1. offline되는 데이터파일이 삭제된 경우 - DB 종료 없이 복구

1. 테스트용 tablespace 생성

2. RMAN으로 full backup 수행

3. data file이 삭제되어 장애발생!

4. 해당 tablespace offline 

5. 복구할 tablespace data file 복원(restore) restore tablespace

6. tablespace 복구(recover) recover tablespace

7. 해당 tablespace online





case 2. offline이 안되는 데이터파일이 삭제되는 경우 - DB 종료 후 복구

1. offline이 안되는 tablespace의 data file 삭제

2. DB 재시작 (shudown immediate) - 정상종료되지 않을경우 강제종료 : RMAN > shutdown abort;

3. 복구할 tablespace data file 복원(restore) restore tablespace

4. tablespace 복구(recover) recover tablespace - DB를 강제종료했을경우 DB 전체 복구 : RMAN > recover database;

5. DB Open





case 3. 임시경로에서 복구하기

1. data file 삭제

2. 장애가 발생한 tablespace OFFLINE

3. 복구할 파일 새로운 경로 지정

4. 복구할 tablespace data file 복원(restore) 

5. 변경파일의 위치를 control file에 반영

6. tablespace 복구(recover)

7. 해당 tablespace ONLINE




case 4. 임시경로에 필요한 데이터 파일만 복원 후 복구하기

1. 전체 full backup

2. 테스트에 사용할 tablespace 와 table 생성 및 데이터 입력

3. data file을 삭제하여 장애 발생!

4. 해당 tablespace 재시작 -> data file이 삭제되어 재시작되지 않음

5. 복구할 임시경로 생성 

6. 현재 사용하고 있는 control file과 redo log file을 복구할 임시경로에 복사 

7. DB 종료후 parameter file을 vi로 열어서 control file의 위치를 복구경로로 변경

8. 마운트 상태에서 작업 startup mount

9. RMAN으로 redo log file위치를 변경 alter database rename file '기존경로' to '변경할경로'

10. 필요한 data file만 위치를 변경시키고, 필요없는 data file은 drop offline set newnamdatafile

12. 백업이 안된 파일은 신규로 재생성 (테스트용으로 생성한 tablespace) alter database create datafile

12. 필요한 tablespace 복원 (system, sysaux, undotbs1, 복구할 tablespace) restore

13. 파일위치 변경내용(redo log file, data file)을 control file에 반영 switch datafile all

14. 필요한 tablespace만 복구 recover

15.  DB open alter database open

16. 해당 tablespace ONLINE alter tablespace 테이블스페이스명 online





댓글