Database

Oracle 복구

Jack Moon 2012. 10. 8. 16:08

Oracle 복구

 머리 아픈 하루 였습니다.

테스트 서버의 data를 실서버로 옮기는 과정에서 여러가지 문제에 부딪쳤습니다.

 

1.

 처음에는 exp로 export 해서 imp로 끝내면 쉽게 끝나겠거니 생각했는데요.

 

---------------------------------------------------- Export

exp userid=id/password file='/tmp/miso.DMP'

----------------------------------------------------- Import
imp userid=id/password file=/usr/miso.DMP            ------> error

    IMP-00031: Must specify FULL=Y or provide FROMUSER/TOUSER or TABLES arguments
   IMP-00000: Import terminated unsuccessfully

 

 ----> 아래와 같이 fromuser, touser 를 명시하니 통과

imp userid=id/password file=/usr/miso.DMP fromuser=moon0sool touser=moon0sool

 

2. 생성된 miso.DMP 의 용량은 2G 정도 되었습니다. (2천만건 정도)  

     점심먹고 오면 끝나려니 하고 식사를 하고 왔는데 4-5백만건 정도에서 멈춰 있는 겁니다. 엔지니어 얘기로는 노아카이브 모드로 exp, imp 해야 된다고 들었답니다.(확실치 않음)

이것 저것 만지다 archive 파일 , 로그 파일 막 지우니 데몬이 안 뜨더군요. (아뿔싸)

 

하는 수 없이 무식한 방법을 시도해 보았습니다. 물리적인 DB의 파일을 모두 옮겼지요. .../orddata/miso (DB명)

 

그런데 역시 에러가 나더군요.

 

SQL> startup
ORACLE instance started.

Total System Global Area  293601280 bytes
Fixed Size                  2040088 bytes
Variable Size             113254120 bytes
Database Buffers          171966464 bytes
Redo Buffers                6340608 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced

 

에러 로그를 살펴 보았습니다.  (/home/oracle/admin/miso/bdump/alert_miso.log)

 "ORA-00704: bootstrap process failure / ORA-39700: database must be opened with UPGRADE option"

 

몇시간을 헤매다  http://orcl.tistory.com/entry/ORA-00704-bootstrap-process-failure-ORA-39700 을 따라 하니 해결되었습니다.

 

간단하게 제가 실행한 것들만 작성해 보자면

 

Start the database in the UPGRADE mode:

SQL> STARTUP UPGRADE
Set the system to spool results to a log file for later analysis:

SQL> SPOOL upgrade_info.log
Run the Pre-Upgrade Information Tool:

SQL> @?/rdbms/admin/utlu102i.sql
Turn off the spooling of script results to the log file:

SQL> SPOOL OFF
SQL> SHUTDOWN

 

 

SQL> STARTUP NOMOUNT
Set the CLUSTER_DATABASE initialization parameter to FALSE:

SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
Shut down the database:

SQL> SHUTDOWN
Enter the following SQL*Plus commands:

SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @?/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.

SQL> @?/rdbms/admin/utlrp.sql

 

정말 머리 아픈 하루 였습니다. 

 

 

 

 

 

 

 

 

'Database' 카테고리의 다른 글

Oracle characterset  (0) 2012.10.08
Oracle 에러  (0) 2012.10.08
Oracle 백업  (0) 2012.10.08
Oracle - PHP 연동 샘플  (0) 2012.10.08
MySQL 패스워드 변천사  (0) 2012.10.08