Home  >  Article  >  Database  >  oracle备份恢复之跨越归档进行恢复

oracle备份恢复之跨越归档进行恢复

WBOY
WBOYOriginal
2016-06-07 17:41:12759browse

1备份当前数据库RMANbackupdatabase;Startingbackupat14-DEC-12usingtargetdatabasecontrolfileinsteadofrecoverycatalogallocatedchannel:ORA_DISK_1channelORA

 

 

1 备份当前数据库

RMAN> backup database;

 

Starting backup at 14-DEC-12

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=211 devtype=DISK

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

input datafile fno=00009 name=/oracle/test/zxbig.dbf

input datafile fno=00001 name=/oracle/test/system1.dbf

input datafile fno=00003 name=/oracle/test/sysaux01.dbf

input datafile fno=00005 name=/oracle/test/zxa.dbf

input datafile fno=00008 name=/oracle/test/undotbs1.dbf

input datafile fno=00002 name=/oracle/test/zxb.dbf

input datafile fno=00007 name=/oracle/test/zxc.dbf

input datafile fno=00004 name=/oracle/test/users01.dbf

input datafile fno=00006 name=/oracle/test/test1.dbf

input datafile fno=00010 name=/oracle/test2.dbf

input datafile fno=00011 name=/oracle/test/jiujian1.dbf

channel ORA_DISK_1: starting piece 1 at 14-DEC-12

channel ORA_DISK_1: finished piece 1 at 14-DEC-12

piece handle=/oracle/app/db1/dbs/0hnssesq_1_1 tag=TAG20121214T221345 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:04:58

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including current control file in backupset

including current SPFILE in backupset

channel ORA_DISK_1: starting piece 1 at 14-DEC-12

channel ORA_DISK_1: finished piece 1 at 14-DEC-12

piece handle=/oracle/app/db1/dbs/0inssf64_1_1 tag=TAG20121214T221345 comment=NONE

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

Finished backup at 14-DEC-12

 

2 创建测试表

 

SQL> create table t5(a int) tablespace jiujian1;

 

Table created.

 

SQL> select table_name,tablespace_name from dba_tables where table_name='T5';

 

TABLE_NAME                     TABLESPACE_NAME

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

T5                             JIUJIAN1

 

 

3插入数据,香港服务器,切换日志,香港服务器租用,产生归档:

 

当前日志状态如下:

 

SQL> select group#,archived,sequence#,status from v$log;

 

    GROUP# ARC SEQUENCE# STATUS

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

         1 YES          2 INACTIVE

         2 YES          3 INACTIVE

         3 YES          1 INACTIVE

         4 YES          4 INACTIVE

         5 YES          5 INACTIVE

         6 NO           6 CURRENT

 

6 rows selected.

 

6号归档中的数据如下:

SQL> insert into t5 values(1);

 

1 row created.

SQL> insert into t5 values(2);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

7号归档中的数据如下:

SQL> insert into t5 values(3);

 

1 row created.

 

 

SQL> insert into t5 values(4);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

8号归档中的数据如下:

SQL> insert into t5 values(6);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

9号归档中的数据如下:

SQL> insert into t5 values(5);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

10号归档中的数据如下:

System altered.

 

SQL> insert into t5 values(7);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

11号归档中的数据如下:

SQL> insert into t5 values(8);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

12号归档中的数据如下:

SQL> insert into t5 values(9);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

13号归档中的数据如下:

SQL> insert into t5 values(10);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

14号归档中的数据如下:

SQL> insert into t5 values(11);

 

1 row created.

 

SQL> insert into t5 values(12);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

15号归档中的数据如下:

SQL> insert into t5 values(13);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> insert into t5 values(14);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

 

SQL> insert into t5 values(15);

 

1 row created.

 

SQL> commit;

 

Commit complete.

 

SQL> alter system switch logfile;

 

System altered.

 

4 当前数据库日志状态如下:

SQL> select group#,archived,sequence#,status from v$log;

 

    GROUP# ARC SEQUENCE# STATUS

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

         1 NO         20 CURRENT

         2 YES         15 INACTIVE

         6 YES         18 INACTIVE

         4 YES         16 INACTIVE

         5 YES         17 INACTIVE

         3 YES         19 INACTIVE

 

5 归档信息如下:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn