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

php中文网
发布: 2016-06-07 17:41:12
原创
833人浏览过

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

 

JoinMC智能客服
JoinMC智能客服

JoinMC智能客服,帮您熬夜加班,7X24小时全天候智能回复用户消息,自动维护媒体主页,全平台渠道集成管理,电商物流平台一键绑定,让您出海轻松无忧!

JoinMC智能客服 193
查看详情 JoinMC智能客服

 

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 归档信息如下:

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号