본문 바로가기

Oracle DataBase/백업복구 실습

drop table 복구하기 ( 백업 없는 경우 )

 

★ 전체 백업수행

 

★ 테이블 만들기

 

SQL> create table scott.tt500(no number) tablespace test;

Table created.

 

SQL> insert into scott.tt500 values(1);

1 row created.

 

SQL> ed
Wrote file afiedt.buf

  1* insert into scott.tt500 values(2)
SQL> /

1 row created.

 

SQL> ed
Wrote file afiedt.buf

  1* insert into scott.tt500 values(3)
SQL> /

1 row created.

 

SQL> commit;

Commit complete.

 

SQL> @tt

TO_CHAR(SYSDATE,'YYYY-MM-DD:HH24:MI:SS
--------------------------------------
2012-01-08:00:42:25

 

 

Data file 백업된 것 copy -> /data/backup/temp

log , ctl -> testdb 에있는것 모두 -> /data/backup/temp

 

SQL> !vi $ORACLE_HOME/dbs/inittestdb.ora

Pfile 변경

control 파일 경로 변경

Data file, redo log file 경로 변경

rename 시키기

 

SQL> recover database until time '2012-01-08:00:42:24' using backup controlfile;

 

 

★ 데이터가 되살아난다.

 

해당 test01.dbf 파일을 offline 안시키고 했더니 check point 정보가 맞지않아서 open

되지않아서 강제 파라미터를 사용해서 오픈후 자료가 복구가 되었다.