当前位置:  数据库>嵌入式中,利用C语言操作SQLite数据库,查询没有数据返回,请大家帮忙看看哈 iis7站长之家

利用dbms_backup_restore恢复数据库

    来源: 互联网  发布时间:2017-05-31

    本文导语: 测试环境:OEL+11.2.0.1 实例名:orcl2DBID:1336959433场景:Oracle数据库的存储坏了,数据文件和控制文件全部丢失,只有数据文件的备份集,且备份集中无控制文件。(当然了,oracle10g和11g中是自动备份数据文件的) 备份数据库首先...

测试环境: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是控制文件和参数文件的备份集。

制造实验场景
删除数据文件和控制文件:
[oracle@DBA2 oradata]$ cd /oradata/orcl2/
[oracle@DBA2 orcl2]$ ls
control01.ctl  redo02.log  seven.dbf    system01.dbf  temp02.dbf    users01.dbf
redo01.log    redo03.log  sysaux01.dbf  temp01.dbf    undotbs01.dbf
[oracle@DBA2 orcl2]$ rm *
[oracle@DBA2 orcl2]$ ls
[oracle@DBA2 orcl2]$ cd /u/oracle/flash_recovery_area/orcl2/
[oracle@DBA2 orcl2]$ ls
control02.ctl
[oracle@DBA2 orcl2]$ rm *
[oracle@DBA2 orcl2]$
数据文件和控制文件现已全部删除,数据库也会随之崩溃;


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 怎样利用JAVABEAN将JSP页面提交的数据保存到数据库,请给代码好吗?谢谢!
  • CPU、内存、数据库利用率监控
  • 如何利用Applet访问数据库?
  • html下利用javascript连数据库
  • 急急急!!利用jdbc-odbc bridge 连接远程数据库
  • 怎样利用JDBC连接oracle数据库?谢谢!!!
  • 利用JDBC-ODBC能不能向数据库中存储二进制数据
  • 利用JDBC连接mysql数据库,运行环境为IBM的aglets平台。碰到如下问题!!!SOS!!
  • 利用可更新ResultSet的updateBinaryStream()可以把图片存到mySql数据库,却不能存到Oracle数据库,怎么办?
  • 嵌入式中,利用C语言操作SQLite数据库,查询没有数据返回,请大家帮忙看看哈
  • C#利用ODP.net连接Oracle数据库的操作方法
  • Oracle 低权限数据库账户得到 OS 访问权限 提权利用
  • 利用导出/导入功能实现重新组织Oracle数据库表空间
  • 在JSP利用JAVABEAN完成数据库的调用以及查询时出现的问题?JAVA高手请进
  • Oracle数据库中利用ASSM改善分段存储
  • 利用C#实现分布式数据库查询
  • 利用phpexcel把excel导入数据库和数据库导出excel实现
  • linux c下利用srand和rand函数生成随机字符串
  • 请问:Linux下用C编程计算CPU利用率和内存利用率?
  • linux下利用(cat,strings,head,sed)命令生成随机字符串
  • 在2003下利用vmware安装了linux,又利用host-only方式上了网,问题如下多谢指点!!!
  • Web前端开发如何利用css样式来控制Html中的h1/h2/h3标签不换行
  • 大虾 紧急求助!!!!如何求得当前机子的处理器利用率和内存利用率?
  • 如何利用libpcap和Python嗅探数据包
  • 如何利用Bash脚本(利用awksedgrepwc等)来自动修改配置文件
  • windows堆栈溢出利用的七种方式
  • 求RADIUS的动态分配IP的问题(利用IPPOOL)
  • iowait和cpu利用率的权衡问题
  • 利用java.net.URLConnection上传文件
  • Qt中利用槽如何来传递参数
  • 浏览器漏洞利用框架 BeEF


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,