2009년 8월 14일 금요일

[RAC] 데이터베이스 백업&복구

전체 데이터베이스 백업 수행

rac1-> rman nocatalog target /

   

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Aug 13 14:24:07 2009

   

Copyright (c) 1982, 2005, Oracle. All rights reserved.

   

connected to target database: DEVDB (DBID=599518495)

using target database control file instead of recovery catalog

   

RMAN> configure controlfile autobackup on;

   

new RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;

new RMAN configuration parameters are successfully stored

   

RMAN> backup database plus archivelog delete input;

Starting backup at 13-AUG-09

current log archived

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=140 instance=devdb1 devtype=DISK

channel ORA_DISK_1: starting archive log backupset

channel ORA_DISK_1: specifying archive log(s) in backup set

input archive log thread=1 sequence=2 recid=1 stamp=694794005

input archive log thread=1 sequence=3 recid=2 stamp=694794310

input archive log thread=2 sequence=1 recid=3 stamp=694794320

channel ORA_DISK_1: starting piece 1 at 13-AUG-09

channel ORA_DISK_1: finished piece 1 at 13-AUG-09

piece handle=+RECOVERYDEST/devdb/backupset/2009_08_13/annnf0_tag20090813t142524_0.263.694794327 tag=TAG20090813T142524 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:27

------ -------

Starting Control File and SPFILE Autobackup at 13-AUG-09

piece handle=+RECOVERYDEST/devdb/autobackup/2009_08_13/s_694794549.266.694794553 comment=NONE

Finished Control File and SPFILE Autobackup at 13-AUG-09

   

test_d 테이블스페이스에 mytable 테이블 생성

SQL> conn system/oracle@devdb2

Connected.

SQL> !date

Thu Aug 13 14:32:36 KST 2009

   

SQL> create table mytable (col1 number) tablespace test_d;

Table created.

   

t1 시점에 mytable 번째 레코드를 삽입

SQL> !date

Thu Aug 13 14:33:44 KST 2009

   

SQL> insert into mytable values(2);

1 row created.

SQL> commit;

Commit complete.

   

t2 시점에 mytable 번째 레코드를 삽입

SQL> !date

Thu Aug 13 14:33:44 KST 2009

   

SQL> insert into mytable values(2);

1 row created.

SQL> commit;

Commit complete.

   

t3 시점에 mytable DROP

SQL> !date

Thu Aug 13 14:33:56 KST 2009

   

SQL> drop table mytable;

Table dropped.

   

test_d 테이블스페이스의 포인트--타임 복구 수행

rac1-> mkdir /u01/app/oracle/aux

rac1-> rman nocatalog target /

   

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Aug 13 14:37:05 2009

   

Copyright (c) 1982, 2005, Oracle. All rights reserved.

   

connected to target database: DEVDB (DBID=599518495)

using target database control file instead of recovery catalog

   

RMAN> recover tablespace test_d

2> until time "to_date('13 Aug 2009 14:33:44','DD MON YYYY HH24:MI:SS')"

3> auxiliary destination '/u01/app/oracle/aux';

   

RMAN> backup tablespace test_d;

   

Starting backup at 13-AUG-09

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=124 instance=devdb1 devtype=DISK

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

input datafile fno=00007 name=+DG1/devdb/datafile/test_d.269.694792463

channel ORA_DISK_1: starting piece 1 at 13-AUG-09

channel ORA_DISK_1: finished piece 1 at 13-AUG-09

piece handle=+RECOVERYDEST/devdb/backupset/2009_08_13/nnndf0_tag20090813t144557_0.267.694795559 tag=TAG20090813T144557 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08

Finished backup at 13-AUG-09

   

Starting Control File and SPFILE Autobackup at 13-AUG-09

piece handle=+RECOVERYDEST/devdb/autobackup/2009_08_13/s_694795568.268.694795571 comment=NONE

Finished Control File and SPFILE Autobackup at 13-AUG-09

   

RMAN> sql 'alter tablespace test_d online';

   

sql statement: alter tablespace test_d online

   

▣ 복구 결과 검증

SQL> conn system/oracle

Connected.

SQL> select * from mytable;

   

COL1

----------

1

2

댓글 없음:

댓글 쓰기