设为首页 收藏本站
查看: 261|回复: 0

[经验分享] Oracle DB 备份恢复目录

[复制链接]

尚未签到

发表于 2015-11-7 12:39:31 | 显示全部楼层 |阅读模式
将配置恢复目录的保留策略,然后备份该恢复目录。 1) 为 ORCL 数据库设置环境。
[oracle@rtest ~]$ export ORACLE_SID=test0924
2) 启动 RMAN,在不指定目录的情况下使用恢复目录数据库作为目标。
[oracle@rtest ~]$  rman target sys@rcat1028
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 28 16:17:22 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
target database Password: ******                                                                                         connected to target database: RCAT1028 (DBID=2744053659)
RMAN> 3) 确保已将恢复目录的保留策略设置为冗余大于 1 。如果该值不大于 1 ,则至少将其设置为 2 。
RMAN> show retention policy;
using target database control file instead of recovery catalogRMAN configuration parameters for database with db_unique_name RCAT1028 are:CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 22> ;
new RMAN configuration parameters:CONFIGURE RETENTION POLICY TO REDUNDANCY 2;new RMAN configuration parameters are successfully stored
4) 尝试备份数据库。 RMAN> backup database;
Starting backup at 28-OCT-13allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=190 device type=DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setRMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/28/2013 16:18:54ORA-19602: cannot backup or copy active file in NOARCHIVELOG modecontinuing other job steps, job failed will not be re-runchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 28-OCT-13channel ORA_DISK_1: finished piece 1 at 28-OCT-13piece handle=+RECOVERY/rcat1028/backupset/2013_10_28/ncsnf0_tag20131028t161854_0.261.830017137 tag=TAG20131028T161854 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:04RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/28/2013 16:18:54ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
RMAN>
请注意,无法备份模式不为 ARCHIVELOG  的打开数据库。为确保最高的可用性,恢复目录数据库应以 ARCHIVELOG  模式运行。 5) 退出 RMAN。
RMAN>  exit
6) 首先设置 RCAT1028数据库的环境,然后将恢复目录数据库更改为在 ARCHIVELOG  模式下运行。 [oracle@rtest dbs]$ export ORACLE_SID=rcat1028[oracle@rtest dbs]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 28 16:21:36 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
SQL> conn /as sysdbaConnected.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.
Total System Global Area 1235959808 bytesFixed Size                  2227904 bytesVariable Size             738197824 bytesDatabase Buffers          486539264 bytesRedo Buffers                8994816 bytesDatabase mounted.SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;Database log mode              Archive ModeAutomatic archival             EnabledArchive destination            USE_DB_RECOVERY_FILE_DESTOldest online log sequence     3Next log sequence to archive   5Current log sequence           5SQL> 7) 确认RCAT1028数据库环境, 按照前面提供的步骤重新登录 RMAN。
[oracle@rtest ~]$ export ORACLE_SID=test0924[oracle@rtest ~]$ rman target sys@rcat1028
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Oct 28 16:25:17 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
target database Password: ******                                                                                         connected to target database: RCAT1028 (DBID=2744053659)
RMAN>
9) 备份恢复目录数据库。此时操作应成功。
RMAN> backup database;Starting backup at 28-OCT-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=131 device type=DISKchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00001 name=+DATA/rcat1028/datafile/system.262.830015445input datafile file number=00002 name=+DATA/rcat1028/datafile/sysaux.261.830015451input datafile file number=00003 name=+DATA/rcat1028/datafile/undotbs1.265.830015451input datafile file number=00005 name=+DATA/rcat01.dbfinput datafile file number=00004 name=+DATA/rcat1028/datafile/users.259.830015453channel ORA_DISK_1: starting piece 1 at 28-OCT-13channel ORA_DISK_1: finished piece 1 at 28-OCT-13piece handle=+RECOVERY/rcat1028/backupset/2013_10_28/nnndf0_tag20131028t162544_0.262.830017545 tag=TAG20131028T162544 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:03:25channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 28-OCT-13channel ORA_DISK_1: finished piece 1 at 28-OCT-13piece handle=+RECOVERY/rcat1028/backupset/2013_10_28/ncsnf0_tag20131028t162544_0.263.830017753 tag=TAG20131028T162544 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:04Finished backup at 28-OCT-13RMAN> exitRecovery Manager complete.[oracle@rtest ~]$          版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-136208-1-1.html 上篇帖子: Oracle Database Instant Client 11g 32位和64位 安装包发布 下篇帖子: Oracle Database(1)-归档模式设置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表