Database초보우낙

32.파라미터 파일이 손상되었을때 Rman으로 복구 본문

백업과 복구/백업과 복구(Rman)

32.파라미터 파일이 손상되었을때 Rman으로 복구

오운학 2024. 4. 15. 23:42
  • 파라미터 파일의 종류2가지

 

 

$ORACLE_HOME/dbs 밑에 spfile pfile 2개가 동시에 있으면

오라클은 spfile 우선적으로 읽어서 startup 인스턴스를 구성

 

 

설명 : parameter file 없으면 startup shutdown에서 아무단계로 올라갈 없다

실습

#1. database ID 확인

#2. Rman에서 spfile 백업받는다

#3. shutdown abort

#4. os에서 spfile pfile 삭제

#5. startup

#6. Rman으로 접속해서 바로 nomount 올린다

#7. 백업받은 spfile 복원

#8. startup force

 

 

구현

#1. database ID 확인

 

 

Database id 1573656506

 

 

 

#2. Rman에서 spfile 백업받는다

 

backup spfile;

/u01/app/oracle/flash_recovery_area/OUH/backupset/2024_03_07/o1_mf_nnsnf_TAG20240307T135244_lyll0x0o_.bkp

 

#3. shutdown abort

 

#4. os에서 spfile pfile 삭제

 

dbs

ls -l spfile*.ora

ls -l initOuh.ora

 

 

rm spfileOuh*.ora

rm initOuh.ora

 

#5. startup

 

파라미터 파일이 없어서 서버를 올릴 없다

 

#6. Rman으로 접속해서 바로 nomount 올린다

 

rman target sys/oracle nocatalog;

 

set dbid =1573656506;

startup nomount

 

spfile 없지만 서버를 올릴 있다

starting Oracle instance without parameter file for retrieval of spfile

Oracle instance started

--> 파라미터 파일 없이 서버를 올렸다

 

설명 :

파라미터 파일 없이 Rman 스스로 nomount 인스턴스를 올렸다

nomount 올린 이유는 shutdown 상태에서는 아무것도 없기 때문이다

 

#7. 백업받은 spfile 복원

restore spfile from autobackup;

 

↑위와 같은 에러가 발생하면 spfile 위치를 확인해준다

 

list backup of spfile;   <--------mount상태일때만 가능

 

이것도 에러가 발생하므로 직접 os 가서 spfile백업본을 찾아야한다

 

 

sys ->

show parameter recovery;  <---------

 

 

restore spfile from '/u01/app/oracle/flash_recovery_area/OUH/autobackup/2024_03_07/o1_mf_s_1162993966_lyll0y70_.bkp';

restore control from autobackup;         <----컨트롤 파일 오토백업

 

#8. startup force