动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ Oracle教程 ]的信息

本月文章推荐
.oracle大数据量的导入和导出.
.ORACLE SQL性能优化系列 (七).
.给Oracle数据库打补丁.
.Linux的信号机制.
.Oracle数据库-PL/SQL整理(1).
.使数据库为归档模式.
.Oracle的同步复制研究.
.数据挖掘概述(一).
.Oracle数据库碎片整理.
.实例讲解Oracle数据库自带的几个.
.RESETLOGS后没有备份情况下的数据.
.认识与分析登录档.
.甲骨文助陕西重型汽车驶入信息化.
.Oracle9i 数据库的设计指引全集(.
.Oracle远程复制和异地容灾方案分.
.如何备份控制文件?.
.Oracle数据库9i DataGuard的安装.
.Linux启动过程全接触(1).
.Oracle时间信息特性.
.今天帮朋友解决了一个ora-00904.

rman备份,控制文件丢失的解决办法

发表日期:2008-2-9 |



  情况描述
  客户报告数据库故障,新来的系统治理员误操作。删掉了一些文件。
  询问:
  删掉了那些文件?请大致描述一下数据库备份情况.
  答曰:
  所有重要数据文件,所有控制文件。数据库原来是归档模式,用rman备份数据,而rman 使用控制文件。
  幸运的是,最后一次rman full 备份是包括了控制文件在内。系统没有设定自动备份控制文件.现在状况是数据库无法启动.
  
  不用说,客户的备份方案不够完善,但是这时候再去说这些话责备用户有事后诸葛亮之嫌,用户是上帝,不要去得罪他。还有,客户有Full备份(虽然不是自动备份控制文件,这样无法用常规的恢复步骤来进行恢复)。这对我们来说是个绝对的好消息。
  
  下面我们通过一次模拟操作来演示这个问题的解决办法。
  
  解决过程
  首先,用控制文件作数据库系统的全备份:
  
  代码:------------------------黑色部分是敏感信息,须加以注重----------------------------------------------------
  C:WUTemp>rman target /
  
  Recovery Manager: Release 9.2.0.1.0 - ProdUCtion.
  
  Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
  
  connected to target database: DEMO (DBID=3272375326)
  
  RMAN> run {
  2> allocate channel C1 type disk;
  3> backup full tag 'FullBackup' format 'd:\KDE\%d_%u_%s_%p.dbf' database include current controlfile;
  4> sql ' alter system archive log current';
  5> release channel C1;
  6> }
  
  using target database controlfile instead of recovery catalog
  allocated channel: C1
  channel C1: sid=15 devtype=DISK
  
  Starting backup at 18-JUL-04
  channel C1: starting full datafile backupset
  channel C1: specifying datafile(s) in backupset
  including current SPFILE in backupset
  including current controlfile in backupset
  input datafile fno=00001 name=D:\ORACLE\ORADATA\DEMO\SYSTEM01.DBF
  input datafile fno=00002 name=D:\ORACLE\ORADATA\DEMO\UNDOTBS01.DBF
  input datafile fno=00004 name=D:\ORACLE\ORADATA\DEMO\EXAMPLE01.DBF
  input datafile fno=00009 name=D:\ORACLE\ORADATA\DEMO\XDB01.DBF
  input datafile fno=00005 name=D:\ORACLE\ORADATA\DEMO\INDX01.DBF
  input datafile fno=00008 name=D:\ORACLE\ORADATA\DEMO\USERS01.DBF
  input datafile fno=00003 name=D:\ORACLE\ORADATA\DEMO\DRSYS01.DBF
  input datafile fno=00006 name=D:\ORACLE\ORADATA\DEMO\ODM01.DBF
  input datafile fno=00007 name=D:\ORACLE\ORADATA\DEMO\TOOLS01.DBF
  channel C1: starting piece 1 at 18-JUL-04
  channel C1: finished piece 1 at 18-JUL-04
  piece handle=D:\KDE\DEMO_01FR79OT_1_1.DBF comment=NONE
  channel C1: backup set complete, elapsed time: 00:01:17
  Finished backup at 18-JUL-04
  
  sql statement: alter system archive log current
  
  released channel: C1
  
  --如上所示,我们做了一次数据库的Full备份.备份片中包括控制文件.注重上面输出内容的黑体部分.我们在后面的恢复操作中会用到.
  
  模拟错误,关掉实例,删掉所有的控制文件和所有的.DBF文件。然后starup会看到如下的出错信息:
  
  SQL> startup
  ORACLE instance started.
  
  Total System Global Area 152115804 bytes
  Fixed Size 453212 bytes
  Variable Size 100663296 bytes
  Database Buffers 50331648 bytes
  Redo Buffers 667648 bytes
  ORA-00205: error in identifying controlfile, check alert log for more info
  
  查看alert Log,应该是系统找不到控制文件.现在情形和客户问题一致.不过在继续讲述之前,我们还需要介绍一点背景知识.
  
  背景知识:
  在Oracle 816 以后的版本中,Oracle提供了一个包:DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE 包是由dbmsbkrs.sql 和 prvtbkrs.plb 这两个脚本创建的.catproc.sql 脚本运行后会调用这两个包.所以是每个数据库都有的这个包是Oracle服务器和操作系统之间IO操作的接口.由恢复治理器直接调用。
而且据说这两个脚本的功能是内建到Oracle的一些库文件中的.
  
  由此可见,我们可以在数据库 nomount 情况下调用这些package ,来达到我们的恢复目的。在dbmsbkrs.sql 和prvtbkrs.plb 这两个脚本中有具体的说明文档,出于篇幅问题,就不一一加以翻译了,但在下面会直接引用一些原文说明。
  
  要害的内容有:
  
  FUNCTION  deviceAllocate(
         type IN varchar2 default NULL
        ,name IN varchar2 default NULL
        ,ident IN varchar2 default NULL
        ,noio IN boolean default FALSE
        ,params IN varchar2 default NULL )
  RETURN varchar2;
  
  -- Describe the device to be used for sequential I/O. For device types where
  -- only one process at a time can use a device, this call allocates a device
  -- for exclusive use by this session. The device remains allocated until
  -- deviceDeallocate is called or session termination. The device can be used
  -- both for creating and restoring backups.
  --
  -- Specifying a device allocates a context that exists until the session
  -- terminates or deviceDeallocate is called. Only one device can be specified
  -- at a time for a particular session. Thus deviceDeallocate must be called
  -- before a different device can be specified. This is not a limitation since
  -- a session can only read or write one backup at a time.
  --
  -- The other major effect of allocating a device is to specify the name space
  -- for the backup handles (file names). The handle for a sequential file does
  -- not necessarily define the type of device used to write the file. Thus it
  -- is necessary to specify the device type in order to interpret the file
  -- handle. The NULL device type is defined for all systems. It is the file
  -- system supplied by the operating system. The sequential file handles are
  -- thus normal file names.
  --
  -- A device can be specified either by name or by type.
  -- If the type is specified but not the name, the system picks an
  -- available device of that type.
  -- If the name is specified but not the type, the type is determined
  -- from the device.
  -- If neither the type or the name is given, the backups are files in
  -- the operating system file system.
  
  -- Note that some types of devices, optical disks for example, can be shared
  -- by many processes, and thus do not really require allocation of the device
  -- itself. However we do need to allocate the context for Accessing the
  -- device, and we do need to know the device type for proper interpretation
  -- of the file handle. Thus it is always necessary to make the device
  -- allocation call before making most other calls in this package.
  --
  -- Input parameters:
  -- type
  -- If specified, this gives the type of device to use for sequential
  -- I/O. The allowed types are port specific. For example a port may
  -- support the type "TAPE" which is implemented via the Oracle tape
  -- API. If no type is specified,
it may be implied by specifying a
  -- particular device name to allocate. The type should be allowed to
  -- default to NULL if operating system files are to be used.
  --
  -- name
  -- If specified, this names a particular piece of hardware to use for
  -- accessing sequential files. If not specified, any available
  -- device of the correct type will be allocated. If the device cannot
  -- be shared, it is allocated to this session for exclusive use.
  -- The name should be allowed to default to NULL if operating system
  -- files are to be used.
  --
  -- ident
  -- This is the users identifier that he uses to name this device. It
  -- is only used to report the status of this session via
  -- dbms_application_info. This value will be placed in the CLIENT_INFO
  -- column of the V$SESSION table, in the row corresponding to the
  -- session in which the device was allocated. This
上一篇:多节点Oracle9i数据库的复制实现范例 人气:508
下一篇:实现Oracle数据库的每天的自动备份 人气:507
浏览全部Oracle教程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-9-4 LPLY CMS 网站管理系统 v5.0
2008-9-4 缤纷互动视频交友 v3.01.902
2008-9-4 ADN视频收藏专家 v3.0 bulid 080
2008-9-4 天空网络电影系统SKYUC v2.5.6 简
2008-9-4 Web Wiz Rich Text Editor(文本编
2008-9-4 幻影动漫网视频系统(Ppdong) v1.
2008-9-4 乐维电脑在线DIY配置系统
2008-9-4 老樊文章管理系统SQL版
2008-9-4 ASP.NET 2.53 缩略图水印组件源码
2008-8-23 Mini WinMount V0.4
2008-8-23 Vista优化大师3.11正式版
2008-8-23 Wine 1.13
2008-8-23 KlipFolio 5.0 Build 5899-80
2008-8-23 Windows Sysinternals Desktops
2008-8-23 OneTap Movies1.2破解版
2008-8-23 AnnotaterPDF阅读1.1.503 破解版
2008-8-23 SoundMeter分贝测量仪 v1.0汉化破
2008-8-23 iDrum音乐节拍1.0破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | 广告代码 | Html转换js | js/vbs加密 | md5加密 | 进制转换
实用工具:汉字翻译拼音 | 符号对照表 | 个税计算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 国家代码与域名缩写 | 文字加密解密 | 健康查询 | 万年历 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵