只有.DBF、.CTL如何恢复数据库 只有.DBF、.CTL如何恢复数据库 ORACLE 9i 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有太多意外的话,就可以恢复。先见pfile,然后mount 然后open,然后调整文件路径即可。 既然你说只有dbf和控制文件,那就说明没有归档日志,在线日志和参数文件,这个恢复比较麻烦.用oracle本身的恢复来做貌似比较困难,流程大概如下1.创建pfile2.创建控制文件3.恢复dbf到指定位置4.打开隐藏参数 _allow_resetlogs_corruption5.打开数据库过程比较复杂另外,你可以选择使用odu,这个是国内一个dba写的第三方工具,可以直接读取dbf中的数据,具体参照http://www.laoxiong.net/category/odu 如果有rman备份,可以参照如下:下面是数据中的数据文件,参数文件,控制文件全部丢失,只有RMAN备份的文件,包括数据文件,参数文件,控制文件。恢复数据库到备份状态RMAN> delete backup;RMAN> backup database;RMAN> backup spfile;RMAN> shutdown abort;Oracle instance shut down[oracle@huang11 ~]$ rm /sof/oracle/oradata/orcl/* -rf [oracle@huang11 ~]$ rm /sof/oracle/admin/orcl -rf[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*orcl* -rf[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*ORCL* -rfRMAN> startup nomount;startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/sof/oracle/10g/dbs/initorcl.ora'下面是恢复spfile文件。RMAN> restore spfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_nnsnf_TAG20100119T113309_5ob9zoq0_.bkp';RMAN> startup force;RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of startup command at 01/19/2010 11:36:50RMAN-04014: startup failed: ORA-09925: Unable to create audit trail fileLinux Error: 2: No such file or directoryAdditional information: 9925[oracle@huang11 ~]$ mkdir /sof/oracle/admin/orcl/{a,b,c,d,u}dump -pRMAN> startup force;Oracle instance startedRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of startup command at 01/19/2010 11:40:25ORA-00205: error in identifying control file, check alert log for more infoRMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';Starting restore at 19-JAN-10allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=157 devtype=DISKchannel ORA_DISK_1: restoring control fileRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of restore command at 01/19/2010 11:41:13ORA-19870: error reading backup piece /sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkpORA-19504: failed to create file "/sof/oracle/oradata/orcl/control01.ctl"ORA-27040: file create error, unable to create fileLinux Error: 2: No such file or directory[oracle@huang11 ~]$ mkdir /sof/oracle/oradata/orclRMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';Starting restore at 19-JAN-10using channel ORA_DISK_1channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:01output filename=/sof/oracle/oradata/orcl/control01.ctloutput filename=/sof/oracle/oradata/orcl/control02.ctloutput filename=/sof/oracle/oradata/orcl/control03.ctlFinished restore at 19-JAN-10RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1RMAN> restore database;RMAN> recover database;Starting recover at 19-JAN-10using channel ORA_DISK_1starting media recoveryunable to find archive logarchive log thread=1 sequence=1RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 01/19/2010 11:43:12RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 560763SQL> alter database open resetlogs;Database altered.如果这里还是不能成功的时候我们就要加隐藏参数。SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;SQL> shutdown abort;SQL> startup force;SQL> alter database open resetlogs;s成功后取消隐藏参数。SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';System altered.SQL> shutdown immediate;SQL> startup下面我们查看数据是否能正常查询。SQL> select count(*) from luo.luo; COUNT(*)---------- 14 有log文件我没说全不好意思! 【*】Oracle有哪些特色SQL【第一次在CSDN发帖,大伙儿别让我失望!!!】 oracle下插入特殊字符 oracle 模糊查询问题 数据库使用聚合函数或者排序时磁盘100%。请问是什么问题 [提问]shutdown过程 刚才图没发出来。这次应该可以了 MSSQL 只使用一个核心,高端服务器变成垃圾。 怎么更新Blob类型字段的某些内容 java存储过程的问题,郁闷 如何取出上个星期的日期 谁能把pcscfg.cfg文件发给我看看? 同样是oracle 9i的linux版本的数据库,32位和64位的有什么区别吗? oracle 10g里的小问题
用oracle本身的恢复来做貌似比较困难,流程大概如下
1.创建pfile
2.创建控制文件
3.恢复dbf到指定位置
4.打开隐藏参数 _allow_resetlogs_corruption
5.打开数据库
过程比较复杂另外,你可以选择使用odu,这个是国内一个dba写的第三方工具,可以直接读取dbf中的数据,具体参照
http://www.laoxiong.net/category/odu
RMAN> delete backup;
RMAN> backup database;
RMAN> backup spfile;
RMAN> shutdown abort;
Oracle instance shut down
[oracle@huang11 ~]$ rm /sof/oracle/oradata/orcl/* -rf
[oracle@huang11 ~]$ rm /sof/oracle/admin/orcl -rf
[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*orcl* -rf
[oracle@huang11 ~]$ rm /sof/oracle/10g/dbs/*ORCL* -rf
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/sof/oracle/10g/dbs/initorcl.ora'
下面是恢复spfile文件。
RMAN> restore spfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_nnsnf_TAG20100119T113309_5ob9zoq0_.bkp';
RMAN> startup force;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/19/2010 11:36:50
RMAN-04014: startup failed: ORA-09925: Unable to create audit trail file
Linux Error: 2: No such file or directory
Additional information: 9925
[oracle@huang11 ~]$ mkdir /sof/oracle/admin/orcl/{a,b,c,d,u}dump -p
RMAN> startup force;
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 01/19/2010 11:40:25
ORA-00205: error in identifying control file, check alert log for more info
RMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';
Starting restore at 19-JAN-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/19/2010 11:41:13
ORA-19870: error reading backup piece /sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp
ORA-19504: failed to create file "/sof/oracle/oradata/orcl/control01.ctl"
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
[oracle@huang11 ~]$ mkdir /sof/oracle/oradata/orcl
RMAN> restore controlfile from '/sof/oracle/flash_recovery_area/ORCL/backupset/2010_01_19/o1_mf_ncsnf_TAG20100119T113155_5ob9yth6_.bkp';
Starting restore at 19-JAN-10
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output filename=/sof/oracle/oradata/orcl/control01.ctl
output filename=/sof/oracle/oradata/orcl/control02.ctl
output filename=/sof/oracle/oradata/orcl/control03.ctl
Finished restore at 19-JAN-10
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
RMAN> recover database;
Starting recover at 19-JAN-10
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/19/2010 11:43:12
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 560763
SQL> alter database open resetlogs;
Database altered.
如果这里还是不能成功的时候我们就要加隐藏参数。
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
SQL> shutdown abort;
SQL> startup force;
SQL> alter database open resetlogs;s
成功后取消隐藏参数。
SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile sid='*';
System altered.
SQL> shutdown immediate;
SQL> startup
下面我们查看数据是否能正常查询。
SQL> select count(*) from luo.luo;
COUNT(*)
----------
14