지난 수업 중에 백업파일이 저장되는 위치를
/home/oracle/backup/rman/ 디렉토리로 지정해놓았었다.
RMAN> show all;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/backup/rman/%F';
그런데 그 부분을 기본값으로 되돌리려면?
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK clear;
clear 명령어를 사용하면 된다.
RMAN> show all;
원래의 값으로 되돌아갔는지 확인하기:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
원래대로 바뀌어 있다.
RMAN> list backup;
백업 정보 보기
RMAN> delete backupset;
Do you really want to delete the above objects (enter YES or NO)? yes
백업셋 지우기
RMAN> backup as compressed backupset database;
백업 다시 받기
RMAN> list backup;
백업 정보 보기
(복습 중이라면 꼭 이 백업 정보 메모장에라도 저장해 놓기... 아래 부분에서 매우 요긴하게 쓰인다...)
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
64 Full 323.58M DISK 00:00:36 29-JAN-24
BP Key: 64 Status: AVAILABLE Compressed: YES Tag: TAG20240129T094421
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T094421_lvfx7651_.bkp
List of Datafiles in backup set 64
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/system01.dbf
2 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/sysaux01.dbf
4 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/users01.dbf
5 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/example01.dbf
6 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
65 Full 9.73M DISK 00:00:01 29-JAN-24
BP Key: 65 Status: AVAILABLE Compressed: NO Tag: TAG20240129T094507
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp
SPFILE Included: Modification time: 29-JAN-24
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 2170324 Ckp time: 29-JAN-24
RMAN> report obsolete;
RMAN> delete obsolete;
Do you really want to delete the above objects (enter YES or NO)? yes
RMAN> crosscheck archivelog all;
물리적인 아카이브 파일을 모르고 지워버려도 컨트롤 파일은 기억하고 있다. (실제로는 없다)
물리적인 아카이브 파일이 있어야 할 곳에 있는지 없는지를 위 명령어로 체크할 수 있다.
(없다면 꼭 아카이브가 없다는 것을 알아차린 시점에 새로 백업받기 > 예전 아카이브들 지워버리기)
RMAN> list expired archivelog all;
RMAN> delete expired archivelog all;
RMAN> list expired archivelog all;
RMAN> report obsolete;
필요없는 파일들 다 지우기
SYS@ora11g> ! ls /home/oracle/arch1
arch_1_28_1158423268.arc
아카이브도 확인해보기
select a.group#, b.sequence#, a.member, b.bytes/1024/1024MB, b.archived, b.status
from v$logfile a, v$log b
where a.group# = b.group#
order by 1;
리두 정보 확인
시나리오 n. 컨트롤 파일 손상시키기
1. 컨트롤파일 손상시키기
1-1. 현재 컨트롤파일이 있는 위치 확인
SYS@ora11g> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ora11g/control01.ctl
1-2. 컨트롤파일 지우기
SYS@ora11g> ! rm /u01/app/oracle/oradata/ora11g/control01.ctl
SYS@ora11g> ! ls /u01/app/oracle/oradata/ora11g/control01.ctl
ls: cannot access /u01/app/oracle/oradata/ora11g/control01.ctl: No such file or directory
1-3. 체크포인트 유발 : alert log 일하는지 보기 > 꿈쩍도 안한다.
SYS@ora11g> alter system checkpoint;
System altered.
2. 어쩔 수 없이 수동으로 DB 내리기
SYS@ora11g> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ora11g/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
있어야 할 위치에 컨트롤파일이 없다고 하면서 오류 발생
아래는 alert log 정보
##########################################################################
Mon Jan 29 09:54:13 2024
Errors in file /u01/app/oracle/diag/rdbms/ora11g/ora11g/trace/ora11g_m000_31421.trc:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ora11g/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
##########################################################################
SYS@ora11g> shutdown abort
ORACLE instance shut down.
shutdown abort 로 DB 내리기
3. RMAN 에서 노마운트 단계까지만 접속하기
(RMAN 세션으로 나갔다가 다시 접속해서 실행해야 한다)
RMAN> exit
[oracle@oracle ~]$ rman target /
connected to target database (not started)
not started 라고 친절하게 알려주기까지 함 ♡
그럼 started 단계까지 띄워주는 게 인지상정이겠지...
RMAN> startup nomount;
Oracle instance started
Total System Global Area 711430144 bytes
Fixed Size 1367004 bytes
Variable Size 448791588 bytes
Database Buffers 255852544 bytes
Redo Buffers 5419008 bytes
DB 를 노마운트 단계까지 띄웠고, 이제 컨트롤파일을 복구해야 하는데
백업 정보를 가지고 있는 컨트롤파일이 깨졌기 때문에
list backup; 명령어로 컨트롤파일의 백업 정보를 볼 수 없다.
RMAN> list backup;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 01/29/2024 09:57:14
ORA-01507: database not mounted
하지만 백업 정보를 알고 있는 경우 (백업정보를 문서화해 놓은 경우) 백업파일을 찾아서 리스토어할 수 있다.
아래는 위에서 적어놓은 백업 정보
(복습할 때도 백업받고 나서 컨트롤파일 깨뜨리기 전에
꼭 백업 정보 메모장에 미리 기록해놓기!)
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
64 Full 323.58M DISK 00:00:36 29-JAN-24
BP Key: 64 Status: AVAILABLE Compressed: YES Tag: TAG20240129T094421
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T094421_lvfx7651_.bkp
List of Datafiles in backup set 64
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/system01.dbf
2 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/sysaux01.dbf
4 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/users01.dbf
5 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/example01.dbf
6 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
65 Full 9.73M DISK 00:00:01 29-JAN-24
BP Key: 65 Status: AVAILABLE Compressed: NO Tag: TAG20240129T094507
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp
SPFILE Included: Modification time: 29-JAN-24
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 2170324 Ckp time: 29-JAN-24
4. 백업으로 컨트롤파일 복구하기
restore controlfile from '/u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp';
(위 문장 수행하면 자꾸 오류남... ㅠㅠ 아래는 챗 GPT 에게 물어봐서 고쳐놓은 문장)
restore controlfile from '/u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp';
근데 뭐가 다른 점인지 1도 모르겠다. 나 오류 대체 왜 떴던 거야? ... 그냥 컴퓨터가 나 괴롭히고 싶어서?
아무튼 GPT의 도움으로 어찌어찌 수행되긴 함.
(나 복습 중인데 위에 문장 오류 1도 없어... 컴퓨터가 또 나 괴롭히려고 오락가락한 듯 ㅡㅡ 나쁜 자식)
아래는 오류 메시지
RMAN> restore controlfile from from '/u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "from": expecting one of: "autobackup, tag, double-quoted-string, single-quoted-string"
RMAN-01007: at line 1 column 26 file: standard input
아래는 복습 중에 나온 제대로 된 복구 화면
RMAN> restore controlfile from '/u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159548717_lvgp8x9d_.bkp';
Starting restore at 29-JAN-24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=11 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ora11g/control01.ctl
Finished restore at 29-JAN-24
5. 복구한 컨트롤파일을 이용해서 mount 단계까지 올리기
RMAN> alter database mount
database mounted
released channel: ORA_DISK_1
6. 데이터베이스 복구하기
RMAN> recover database;
RMAN> recover database;
Starting recover at 29-JAN-24
Starting implicit crosscheck backup at 29-JAN-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=11 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 29-JAN-24
Starting implicit crosscheck copy at 29-JAN-24
using channel ORA_DISK_1
Finished implicit crosscheck copy at 29-JAN-24
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T100628_lvfyjov3_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_24/o1_mf_s_1159108019_lv17x4mh_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_25/o1_mf_s_1159197667_lv3zgmts_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_25/o1_mf_s_1159205985_lv47ll9f_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524816_lvfyy0ls_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159548717_lvgp8x9d_.bkp
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 4 is already on disk as file /u01/app/oracle/oradata/ora11g/redo01.log
archived log file name=/u01/app/oracle/oradata/ora11g/redo01.log thread=1 sequence=4
media recovery complete, elapsed time: 00:00:00
Finished recover at 29-JAN-24
7. resetlogs 로 DB 열기
RMAN> alter database open resetlogs;
database opened
컨트롤파일이 깨졌기 때문에 DB 는 무조건 resetlogs 로 오픈해야 한다.
8. 새로 백업받기
RMAN> backup as compressed backupset database;
백업받고
RMAN> list backup;
백업본 확인
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
64 Full 323.58M DISK 00:00:36 29-JAN-24
BP Key: 64 Status: AVAILABLE Compressed: YES Tag: TAG20240129T094421
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T094421_lvfx7651_.bkp
List of Datafiles in backup set 64
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/system01.dbf
2 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/sysaux01.dbf
4 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/users01.dbf
5 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/example01.dbf
6 Full 2170239 29-JAN-24 /u01/app/oracle/oradata/ora11g/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
65 Full 9.73M DISK 00:00:02 29-JAN-24
BP Key: 65 Status: AVAILABLE Compressed: NO Tag: TAG20240129T100623
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524383_lvfyjk0y_.bkp
SPFILE Included: Modification time: 29-JAN-24
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 2170892 Ckp time: 29-JAN-24
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
66 Full 327.30M DISK 00:00:42 29-JAN-24
BP Key: 66 Status: AVAILABLE Compressed: YES Tag: TAG20240129T100628
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T100628_lvfyjov3_.bkp
List of Datafiles in backup set 66
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/system01.dbf
2 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/sysaux01.dbf
4 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/users01.dbf
5 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/example01.dbf
6 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
67 Full 9.73M DISK 00:00:01 29-JAN-24
BP Key: 67 Status: AVAILABLE Compressed: NO Tag: TAG20240129T100714
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp
SPFILE Included: Modification time: 29-JAN-24
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 2171223 Ckp time: 29-JAN-24
9. 정리 작업
RMAN> report obsolete;
정책상 필요없는 백업본 확인
(아까 그 백업본 없었으면 컨트롤파일 복구도 못했을 텐데?...
복구했다고 바로 내팽개쳐지는 거 보니까 좀 씁쓸하다 ㅠ.ㅠ)
RMAN> delete obsolete;
Do you really want to delete the above objects (enter YES or NO)? yes
필요없어진 백업본 지우기
RMAN> report obsolete;
RMAN> crosscheck archivelog all;
RMAN> list expired archivelog all;
RMAN> delete expired archivelog all;
RMAN> list expired archivelog all;
필요없어진 아카이브 파일도 다 지우기
RMAN> list backup;
백업본 확인 : 필요없는 백업본은 깔끔하게 지워져 있다.
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
66 Full 327.30M DISK 00:00:42 29-JAN-24
BP Key: 66 Status: AVAILABLE Compressed: YES Tag: TAG20240129T100628
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/backupset/2024_01_29/o1_mf_nnndf_TAG20240129T100628_lvfyjov3_.bkp
List of Datafiles in backup set 66
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/system01.dbf
2 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/sysaux01.dbf
4 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/users01.dbf
5 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/example01.dbf
6 Full 2171114 29-JAN-24 /u01/app/oracle/oradata/ora11g/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
67 Full 9.73M DISK 00:00:01 29-JAN-24
BP Key: 67 Status: AVAILABLE Compressed: NO Tag: TAG20240129T100714
Piece Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp
SPFILE Included: Modification time: 29-JAN-24
SPFILE db_unique_name: ORA11G
Control File Included: Ckp SCN: 2171223 Ckp time: 29-JAN-24
select a.group#, b.sequence#, a.member, b.bytes/1024/1024MB, b.archived, b.status
from v$logfile a, v$log b
where a.group# = b.group#
order by 1;
리두 정보 확인
시나리오 n+1. 컨트롤파일 또 깨뜨리기
1. 컨트롤파일 손상시키기
SYS@ora11g> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ora11g/control01.ctl
현재 컨트롤파일이 있는 위치 확인
SYS@ora11g> ! rm /u01/app/oracle/oradata/ora11g/control01.ctl
컨트롤파일 지우기
SYS@ora11g> ! ls /u01/app/oracle/oradata/ora11g/control01.ctl
ls: cannot access /u01/app/oracle/oradata/ora11g/control01.ctl: No such file or directory
2. DB 내리기
SYS@ora11g> shutdown immediate
shutdown immediate 로 내려보려고 했지만
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ora11g/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
될 리가 없지...
SYS@ora11g> shutdown abort
shutdown abort 로 DB 내리기
3. RMAN 으로 새로 접속
RMAN> exit
[oracle@oracle ~]$ rman target /
connected to target database (not started)
접속하면: not started 라고 친절하게 알려준다.
4. RMAN 에서 DB 노마운트 단계까지 올리기
RMAN> startup nomount;
5. 받아놓은 백업 중 가장 최근 거 찾아서 깨진 컨트롤파일 알아서 리스토어하라고 시키기
RMAN> restore controlfile from autobackup;
RMAN> restore controlfile from autobackup;
Starting restore at 29-JAN-24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=11 device type=DISK
recovery area destination: /u01/app/oracle/fast_recovery_area
database name (or database unique name) used for search: ORA11G
channel ORA_DISK_1: AUTOBACKUP /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u01/app/oracle/oradata/ora11g/control01.ctl
Finished restore at 29-JAN-24
6. DB 마운트 단계까지 올리기
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
7. 데이터베이스 리커버리
RMAN> recover database;
리두 로그 적용해서 DB 복구하기
RMAN> recover database;
Starting recover at 29-JAN-24
Starting implicit crosscheck backup at 29-JAN-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=11 device type=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 29-JAN-24
Starting implicit crosscheck copy at 29-JAN-24
using channel ORA_DISK_1
Finished implicit crosscheck copy at 29-JAN-24
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_24/o1_mf_s_1159108019_lv17x4mh_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_25/o1_mf_s_1159197667_lv3zgmts_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_25/o1_mf_s_1159205985_lv47ll9f_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159523107_lvfx8n4v_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORA11G/autobackup/2024_01_29/o1_mf_s_1159524434_lvfyl37q_.bkp
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oracle/oradata/ora11g/redo01.log
archived log file name=/u01/app/oracle/oradata/ora11g/redo01.log thread=1 sequence=1
media recovery complete, elapsed time: 00:00:00
Finished recover at 29-JAN-24
8. 리셋로그로 데이터베이스 열기
RMAN> alter database open resetlogs;
database opened
컨트롤파일이 깨졌으므로 DB 는 리셋로그로 열어야 한다.
9. 의미 없는 과거 백업본과 아카이브파일 등 지우기
RMAN> list backup;
RMAN> report obsolete;
RMAN> delete obsolete;
RMAN> crosscheck archivelog all;
RMAN> list expired archivelog all;
RMAN> delete expired archivelog all;
SYS@ora11g> ! ls /home/oracle/arch1
arch_1_1_1159524370.arc arch_1_28_1158423268.arc
컨트롤파일이 깨졌을 경우 autobackup 을 사용해서 백업하면 편하지만 이게 안 먹힐 때도 있다.
(그럴 때는 하는 수 없이 컨트롤파일의 백업본 이름을 알아내서 수동으로 백업해야 함)
그러니 백업을 받을 때마다 꼭 백업파일 이름과 어느 위치에 백업받았는지를 꼭 기록해놓는 습관을 들이자.
2024년 1월 29일 3교시 RMAN advise failure, repair failure (0) | 2024.01.29 |
---|---|
2024년 1월 29일 2교시 헌 DB 새 DB 로 만들기, 초기 파라미터 파일이 깨졌을 때의 대처 방법(DBID) (0) | 2024.01.29 |
2024년 1월 26일 3교시 자습시간 ♡ (0) | 2024.01.26 |
2024년 1월 26일 2교시 RMAN을 이용해서 복제DB (과거 시간 DB) 만들기 2 (0) | 2024.01.26 |
2024년 1월 26일 1교시 RMAN을 이용해서 복제 DB 만들기 (0) | 2024.01.26 |