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

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

by #moonyz 2014. 11. 17.

case 5. drop table 후 복구하기 - 임시경로 사용

1. 전체 full backup

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

3. drop table 장애 발생! -> table 조회 불가

4. 복구할 임시경로 생성 

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

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

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

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

9. RMAN으로 data file위치를 변경 set newnamdatafile

10. data file 복원 restore

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

12. 복구할 시간 지정 until time '복구할시간'

13. 복구 recover

14. DB open alter database open resetlogs





연습문제. drop user 복구하기 

1. 전체 full backup

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

3. drop user 장애 발생! -> 해당 사용자가 만든 table 조회 불가

4. 복구할 임시경로 생성 

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

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

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

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

9. RMAN으로 data file위치를 변경 set newnamdatafile

10. data file 복원 restore

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

12. 복구할 시간 지정 set until time '복구할시간'

13. 복구 recover

14. DB open alter database open resetlogs





case 6. drop tablespace 복구하기 - 백업파일 있음

1. 테스트용으로 사용할 tablespace를 생성

2. 전체 full backup

3. 테이블 생성 및 데이터 입력

4. drop tablespace 장애발생 ! 

5. DB 종료

6. parameter file 수정 (복구할 디렉토리 경로로 control file의 위치 수정)

7. 복구할 임시 디렉토리 생성

8. 현재 사용하고 있는 redo log file 복사

9. nomount상태 -> 백업받은 control file 복원(restore) restore controlfile from'백업경로';

10. DB mount 상태 -> redo log file 경로 변경 alter database rename file to, data file 변경 set newname for datafile

11. 복구할 시간 지정 set until time '복구할시간' set until time='2014-11-17:11:16:27';

12. TAG옵션을 사용하여 복원에 사용할 백업셋 지정 restore database from tag 'TAG20141117T111034';

13. control file에 변경사항 반영 switch datafile all;

14. 복구 recover database; recover database;

15. DB open alter database open resetlogs;





case 7. Drop tablespace 복구하기 - 백업파일 없음

1. 전체 full backup

2. 테스트용으로 사용할 tablespace를 생성 및 테이블 생성, 데이터 입력

3. 테이블 생성 및 데이터 입력

4. drop tablespace 장애발생 ! 

5. DB 종료

6. parameter file 수정 (복구할 디렉토리 경로로 control file의 위치 수정)

7. 복구할 임시 디렉토리 생성

8. 현재 사용하고 있는 redo log file 복사

9. nomount상태 -> 백업받은 control file 복원(restore) restore controlfile from'백업경로';

10. DB mount 상태 -> redo log file 경로 변경 alter database rename file to, data file 변경 set newname for datafile

-- drop된 tablespace 제외한 나머지 data file 경로 변경

11. 복구할 시간 지정 set until time '복구할시간' set until time='2014-11-17:11:16:27';

12. TAG옵션을 사용하여 복원에 사용할 백업셋 지정 restore database from tag 'TAG20141117T111034';

13. control file에 변경사항 반영 switch datafile all;

14. 복구시도 set until time '복구할시간'  -> recover database; -- RMAN에서 복구시도하면 data file 자동으로 생성 후 복구함.

15. DB open alter database open resetlogs;





case 8. RMAN 백업을 사용하여 무정지 응급 복구 진행하기 (RMAN으로 DB복제)

1. 전체 full backup 수행

2. 테스트용 테이블 생성 및 데이터 입력 (switch를 발생시켜 archive log file 생성)

3. drop table 장애 발생! (switch를 발생시켜 archive log file 생성)


<DB 복제 시작>

4. 현재 사용하고있는 parameter file을 복사하여 clonedb용 parameter file을 생성 및 수정

5. clonedb 구성용 디렉토리 생성

6. archive log file을 backupset 파일이 있는 디렉토리로 복사

7. clonedb로 접속하여 nomount상태까지 올리기

8. rman auxiliary 로 접속하여 clonedb생성 및 복구 duplicate database to 'clonedb'

9. 복제DB(clonedb)에서 복구된 table을 export

10. 운영DB(testdb)에서 export한 dmp파일을 import



댓글