Database초보우낙
9. binary file로 백업받은 controlfile 복구 본문
controlfile을 백업하는 방법 2가지
- text형태
- binary file형태
■ 실습
#1. binary file 형태로 controlfile을 백업
#2. shutdown abort로 d를 내린다
#3 원본 control file을 삭제
#4 db를 startup 해서 올린다
#5. binary file형태로 백업받은 controlfole을 가지고 복구
◆ 실습 구현
#1. binary file 형태로 controlfile을 백업
alter database backup controlfile to '/home/oracle/hot_20240304/control01b.bak';
#2. shutdown abort로 d를 내린다
select name from v$controlfile; <---원본파일 위치
실행결과 -> /u01/app/oracle/oradata/Ouh/control01.ctl
shutdown abort --서버내리기
#3 원본 control file을 삭제
cd /u01/app/oracle/oradata/Ouh/
rm control01.ctl
#4 db를 startup 해서 올린다
<서버올리기>
startup <-------------nomount에서 멈춘다
ORA-00205 :error in identifying control file, check alert log for more info
controlfile을 찾을 수 없다
#5. binary file형태로 백업받은 controlfile을 가지고 복구
<os> --백업받은 controlfile을 복원
cp /home/oracle/hot_20240304/control01b.bak /u01/app/oracle/oradata/Ouh/control01.ctl
<SYS> --마운트로 올린다
alter database mount
@/home/oracle/i.sql
현재 쓰고 있고 아카이빙 되지않은 리두로그 그룹의 번호를 확인
select group#, status, archived, sequence#
from v$log;
--3번 그룹의 리두로그 파일이 무었인지 확인을 해야한다
select group#, member from v$logfile;
실행결과 -> /u01/app/oracle/oradata/Ouh/redo03.log
백업받은 controlfile로 복구를 하고 db를 올릴때 resetloges 옵션을 사용해줘야한다
recover database using backup controlfile;AUTOalter database open resetloges; <----초기화를 하면서 올려준다resetlogs옵션 : 리두로그 파일의 내용을 다 비우고 초기화하겠다는 뜻, 다시 1번부터 생성 , 리두로그 그룹만 초기화,데이터 초기화x
수업을 하다가 시퀀스가 너무 높게 나와서 진행이 안되므로 우선 임시방법으로 해결 ↓
startup nomount
@/home/oracle/hot_20240304/create_controlfile.sql
'백업과 복구 > 완전복구' 카테고리의 다른 글
11. multiplexing된 controlfile 중에 1개를 삭제하고 복구 (0) | 2024.04.12 |
---|---|
10. control file을 multixplexing하기 (0) | 2024.04.12 |
8. 1개의 control file이 삭제되었을 경우 (0) | 2024.04.12 |
7. 모든 data file들을 전부 삭제하고 복구 (0) | 2024.04.11 |
6. system data file 을 삭제하고 복구하기 (0) | 2024.04.10 |