仅仅只有数据文件情况的恢复
2013-04-27 17:31
405 查看
群中一网友遇到问题,windows 10g磁盘故障,非归档,无备份,在只有数据文件的情况下进行
恢复,我这里为其演示下一个大概的恢复过程:—-拷贝一份整个测试库的数据文件
—-只保留数据文件,删除controlfile和redo log
——create pfile for recover
——编辑pfile,修改相关目录信息
—–手工重建controlfile,控制文件中重做日志文件—–system表空间,sysaux表空间,undo表空间,用户表空间参数根据数据文件存在的绝对路径及文件名来确定
—–后面是recover的步骤
—-停库后,添加如下隐含参数:
下面来增进一下scn即可open,你可以用event,也可以用bbed去推进,我这里图方便,直接用event,如下:
要解决这个ora-00600 4194 很easy,就不多说了,我这里直接将undo_management修改为manual然后将undotbs2 drop掉。
由于我这里模拟之前是abort 关闭数据库,然后拷贝的,所以后面恢复出现了一些600错误,不过都是一些
非常常见的错误,当然,如果是该网友的情况,open数据库之后,最好是能将整个库exp出来然后重建。
恢复,我这里为其演示下一个大概的恢复过程:—-拷贝一份整个测试库的数据文件
[ora10g@killdb oradata]$ cp -r roger recover [ora10g@killdb oradata]$ [ora10g@killdb oradata]$ cd recover/ |
[ora10g@killdb recover]$ rm *.ctl [ora10g@killdb recover]$ rm redo*.log [ora10g@killdb recover]$ sqlplus "/as sysdba" SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 4 00:27:14 2012 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup nomount ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes |
SQL> !pwd /home/ora10g/oradata/recover SQL> create pfile='/tmp/recover_tmp.ora' from spfile; File created. SQL> shutdown abort; ORACLE instance shut down. |
SQL> startup nomount pfile='/tmp/recover_tmp.ora'; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes |
SQL> CREATE CONTROLFILE REUSE DATABASE "roger" RESETLOGS NOARCHIVELOG 2 MAXLOGFILES 50 3 MAXLOGMEMBERS 5 4 MAXDATAFILES 100 5 MAXINSTANCES 8 6 MAXLOGHISTORY 226 7 LOGFILE 8 GROUP 1 '/home/ora10g/oradata/recover/redo01.log' SIZE 50M, 9 GROUP 2 '/home/ora10g/oradata/recover/redo02.log' SIZE 50M, 10 GROUP 3 '/home/ora10g/oradata/recover/redo03.log' SIZE 50M 11 DATAFILE 12 '/home/ora10g/oradata/recover/system01.dbf', 13 '/home/ora10g/oradata/recover/roger01.dbf', 14 '/home/ora10g/oradata/recover/sqlt_01.dbf', 15 '/home/ora10g/oradata/recover/sysaux01.dbf', 16 '/home/ora10g/oradata/recover/undotbs2_01.dbf', 17 '/home/ora10g/oradata/recover/users01.dbf' 18 CHARACTER SET zhs16gbk; Control file created. SQL> |
SQL> recover database using backup controlfile ; ORA-00279: change 5690602 generated at 12/03/2012 05:43:05 needed for thread 1 ORA-00289: suggestion : /home/ora10g/archivelog/0001_1_44_792658815.dbf ORA-00280: change 5690602 for thread 1 is in sequence #44 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} auto ORA-00308: cannot open archived log '/home/ora10g/archivelog/0001_1_44_792658815.dbf' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 ORA-00308: cannot open archived log '/home/ora10g/archivelog/0001_1_44_792658815.dbf' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 SQL> SQL> SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01113: file 1 needs media recovery if it was restored from backup, or END BACKUP if it was not ORA-01110: data file 1: '/home/ora10g/oradata/recover/system01.dbf' SQL> SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. |
*._allow_resetlogs_corruption=TRUE *._allow_error_simulation=TRUE SQL> startup mount pfile='/tmp/recover_tmp.ora' ; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes Database mounted. SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01092: ORACLE instance terminated. Disconnection forced 此时alert log信息如下: Tue Dec 04 00:39:12 PST 2012 alter database open resetlogs RESETLOGS is being done without consistancy checks. This may result in a corrupted database. The database should be recreated. RESETLOGS after incomplete recovery UNTIL CHANGE 5690602 Tue Dec 04 00:39:12 PST 2012 Errors in file /home/ora10g/admin/roger/udump/roger_ora_32295.trc: ORA-00313: open failed for members of log group 1 of thread 1 ORA-00312: online log 1 thread 1: '/home/ora10g/oradata/recover/redo01.log' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 Tue Dec 04 00:39:14 PST 2012 Errors in file /home/ora10g/admin/roger/udump/roger_ora_32295.trc: ORA-00313: open failed for members of log group 2 of thread 1 ORA-00312: online log 2 thread 1: '/home/ora10g/oradata/recover/redo02.log' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 Tue Dec 04 00:39:15 PST 2012 Errors in file /home/ora10g/admin/roger/udump/roger_ora_32295.trc: ORA-00313: open failed for members of log group 3 of thread 1 ORA-00312: online log 3 thread 1: '/home/ora10g/oradata/recover/redo03.log' ORA-27037: unable to obtain file status Linux Error: 2: No such file or directory Additional information: 3 Tue Dec 04 00:39:16 PST 2012 Setting recovery target incarnation to 2 Tue Dec 04 00:39:16 PST 2012 Assigning activation ID 2505358118 (0x9554bb26) Thread 1 opened at log sequence 1 Current log# 1 seq# 1 mem# 0: /home/ora10g/oradata/recover/redo01.log Successful open of redo thread 1 Tue Dec 04 00:39:16 PST 2012 MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set Tue Dec 04 00:39:16 PST 2012 SMON: enabling cache recovery Tue Dec 04 00:39:17 PST 2012 ORA-01555 caused by SQL statement below (SQL ID: 4krwuz0ctqxdt, SCN: 0x0000.0056d4f1): Tue Dec 04 00:39:17 PST 2012 select ctime, mtime, stime from obj$ where obj# = :1 Tue Dec 04 00:39:17 PST 2012 Errors in file /home/ora10g/admin/roger/udump/roger_ora_32295.trc: ORA-00704: bootstrap process failure ORA-00704: bootstrap process failure ORA-00604: error occurred at recursive SQL level 1 ORA-01555: snapshot too old: rollback segment number 14 with name "_SYSSMU14$" too small Error 704 happened during db open, shutting down database USER: terminating instance due to error 704 Instance terminated by USER, pid = 32295 ORA-1092 signalled during: alter database open resetlogs... |
SQL> conn /as sysdba Connected to an idle instance. SQL> startup mount pfile='/tmp/recover_tmp.ora' ; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes Database mounted. SQL> alter session set events '10015 trace name ADJUST_SCN level 1'; Session altered. SQL> SQL> alter database open ; alter database open * ERROR at line 1: ORA-01113: file 1 needs media recovery if it was restored from backup, or END BACKUP if it was not ORA-01110: data file 1: '/home/ora10g/oradata/recover/system01.dbf' SQL> recover database; Media recovery complete. SQL> alter database open ; alter database open * ERROR at line 1: ORA-00607: Internal error occurred while making a change to a data block ORA-00600: internal error code, arguments: [4194], [39], [13], [], [], [], [], [] SQL> select open_mode from v$database; OPEN_MODE ---------- READ WRITE SQL> |
SQL> conn /as sysdba Connected to an idle instance. SQL> startup mount pfile='/tmp/recover_tmp.ora' ; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes Database mounted. SQL> alter database open; Database altered. SQL> drop tablespace undotbs2 including contents and datafiles; Tablespace dropped. SQL> create undo tablespace undotbs1 datafile '/home/ora10g/oradata/recover/undotbs1.dbf' size 10m; Tablespace created. 最后再将参数还原即可,如下: SQL> shutdown abort; ORACLE instance shut down. SQL> startup mount pfile='/tmp/recover_tmp.ora' ; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 146801896 bytes Database Buffers 16777216 bytes Redo Buffers 2920448 bytes Database mounted. SQL> alter database open; Database altered. SQL> SQL> SQL> show parameter undo_ NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _gc_undo_affinity boolean FALSE undo_management string AUTO undo_retention integer 900 undo_tablespace string UNDOTBS1 |
非常常见的错误,当然,如果是该网友的情况,open数据库之后,最好是能将整个库exp出来然后重建。
相关文章推荐
- 仅仅只有数据文件情况的恢复
- 仅仅只有数据文件情况的恢复
- 问题8:如何在应用表空间中的数据文件损坏或者丢失的情况下进行恢复?
- SQL SERVER 2005 只有mdf文件的数据恢复方法
- 无备份有完全归档日志情况下恢复数据文件
- 只有spfile和控制文件情况下进行rman恢复时报ORA-00312 ORA-00313错误
- 仅仅丢失一个普通用户数据文件的恢复B(脱机恢复)
- SQL Server 没有日志文件(*.ldf) 只有数据文件(*.mdf) 恢复到SQL Server2005
- SQLServer2005 没有日志文件(*.ldf) 只有数据文件(*.mdf) 恢复数据库的方法
- 没有备份、只有归档日志,如何恢复数据文件?
- Oracle 数据文件在无备份情况下的恢复
- 无备份情况下数据文件恢复
- Oracle10g只有数据文件的恢复(Windows)
- SQL SERVER 2005 只有mdf文件的数据恢复方法
- SQL Server 2005 在只有MDF文件的情况下恢复(丢失日志文件)
- MYSQL数据文件--.frm文件(只有.frm文件时的表结构恢复)
- 出现Oracle 文件大小变为0的情况如何恢复数据?
- MYSQL数据文件--.frm文件(只有.frm文件时的表结构恢复)
- SQL SERVER 2005 只有mdf文件的数据恢复方法
- 在没有备份情况下误删除数据文件的恢复