利用dbms_backup_restore恢复数据库
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了利用dbms_backup_restore恢复数据库,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含5707字,纯文字阅读大概需要9分钟。
内容图文
场景:Oracle数据库的存储坏了,数据文件和控制文件全部丢失,只有数据文件的备份集,且备份集中无控制文件。(当然了,oracle10
测试环境:OEL+11.2.0.1
实例名:orcl2
DBID:1336959433
场景:Oracle数据库的存储坏了,数据文件和控制文件全部丢失,只有数据文件的备份集,且备份集中无控制文件。(当然了,oracle10g和11g中是自动备份数据文件的)
备份数据库
首先将数据库进行全备
[oracle@DBA2 backup]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Sep 22 00:05:52 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL2 (DBID=1336959433)
RMAN> backup database format '/backup/orcl_%U' plus archivelog;
Starting backup at 22-SEP-13
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=16 STAMP=826760691
input archived log thread=1 sequence=2 RECID=9 STAMP=826760691
input archived log thread=1 sequence=3 RECID=8 STAMP=826760691
input archived log thread=1 sequence=4 RECID=10 STAMP=826760691
input archived log thread=1 sequence=5 RECID=11 STAMP=826760691
input archived log thread=1 sequence=6 RECID=17 STAMP=826760691
input archived log thread=1 sequence=7 RECID=19 STAMP=826760691
input archived log thread=1 sequence=8 RECID=18 STAMP=826760691
input archived log thread=1 sequence=9 RECID=13 STAMP=826760691
input archived log thread=1 sequence=10 RECID=12 STAMP=826760691
input archived log thread=1 sequence=11 RECID=15 STAMP=826760691
input archived log thread=1 sequence=12 RECID=14 STAMP=826760691
input archived log thread=1 sequence=13 RECID=21 STAMP=826760691
input archived log thread=1 sequence=14 RECID=22 STAMP=826760691
input archived log thread=1 sequence=15 RECID=20 STAMP=826760691
input archived log thread=1 sequence=16 RECID=7 STAMP=826760691
input archived log thread=1 sequence=17 RECID=4 STAMP=826760691
input archived log thread=1 sequence=18 RECID=5 STAMP=826760691
input archived log thread=1 sequence=19 RECID=1 STAMP=826760691
input archived log thread=1 sequence=20 RECID=2 STAMP=826760691
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/u/oracle/flash_recovery_area/ORCL2/backupset/2013_09_22/o1_mf_annnn_TAG20130922T000600_93vjz8nh_.bkp tag=TAG20130922T000600 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=6 STAMP=826760691
input archived log thread=1 sequence=2 RECID=3 STAMP=826760691
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/u/oracle/flash_recovery_area/ORCL2/backupset/2013_09_22/o1_mf_annnn_TAG20130922T000600_93vk288l_.bkp tag=TAG20130922T000600 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=23 STAMP=826761959
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/u/oracle/flash_recovery_area/ORCL2/backupset/2013_09_22/o1_mf_annnn_TAG20130922T000600_93vk29cw_.bkp tag=TAG20130922T000600 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-SEP-13
Starting backup at 22-SEP-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/orcl2/system01.dbf
input datafile file number=00002 name=/oradata/orcl2/undotbs01.dbf
input datafile file number=00003 name=/oradata/orcl2/sysaux01.dbf
input datafile file number=00005 name=/oradata/orcl2/seven.dbf
input datafile file number=00004 name=/oradata/orcl2/users01.dbf
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/backup/orcl_04okeoqa_1_1 tag=TAG20130922T000738 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/backup/orcl_05okeou7_1_1 tag=TAG20130922T000738 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-SEP-13
Starting backup at 22-SEP-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=24 STAMP=826762186
channel ORA_DISK_1: starting piece 1 at 22-SEP-13
channel ORA_DISK_1: finished piece 1 at 22-SEP-13
piece handle=/u/oracle/flash_recovery_area/ORCL2/backupset/2013_09_22/o1_mf_annnn_TAG20130922T000946_93vk6b6o_.bkp tag=TAG20130922T000946 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 22-SEP-13
RMAN>
查看备份文件:
[oracle@DBA2 backup]$ ls
-rw-r----- 1 oracle oinstall 1182695424 Sep 22 00:09 orcl_04okeoqa_1_1
-rw-r----- 1 oracle oinstall 10158080 Sep 22 00:09 orcl_05okeou7_1_1
orcl_04okeoqa_1_1是数据文件的备份集,orcl_05okeou7_1_1是控制文件和参数文件的备份集。
内容总结
以上是互联网集市为您收集整理的利用dbms_backup_restore恢复数据库全部内容,希望文章能够帮你解决利用dbms_backup_restore恢复数据库所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。