重建控制文件之后

在数据库的控制文件重建之后,都是泪啊,

重建控制文件的原本可以来自两个地方

1)trace文件
[oracle@mydb01 orcl]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Oct 28 20:35:14 2014
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database backup controlfile to trace;
Database altered.
2)strings control01.ctl
通过这个命令可以查看到controlfile文件中记录的很多信息
如果日志文件没有损坏,需要使用参数noresetlogs来创建控制文件;
CREATE CONTROLFILE REUSE DATABASE "orcl" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/orcl/redo01.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/orcl/redo02.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/orcl/redo03.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/orcl/system01.dbf',
  '/u01/app/oracle/oradata/orcl/undotbs01.dbf',
  '/u01/app/oracle/oradata/orcl/sysaux01.dbf',
  '/u01/app/oracle/oradata/orcl/users01.dbf',
  '/u01/app/oracle/oradata/orcl/example01.dbf',
  '/u01/app/oracle/oradata/orcl/test01.dbf'
CHARACTER SET ZHS16GBK;

SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01100: database already mounted
SQL>  select first_change#,sequence# from v$log where status='CURRENT';

FIRST_CHANGE#  SEQUENCE#
------------- ----------
            0          0
SQL> select CHECKPOINT_CHANGE#,FILE#  from v$datafile_header;

  CHECKPOINT_CHANGE#      FILE#
-------------------- ----------
       1103447025670          1
       1103447025670          2
       1103447025670          3
       1103447025670          4
       1103447025670          5
       1103447025670          6

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
检查alert日志:
Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_3572.trc:
ORA-00600: internal error code, arguments: [2662], [256], [3935397902], [256], [3935397956], [4194313], [], []
Tue Oct 28 20:49:26 CST 2014
Error 600 happened during db open, shutting down database
USER: terminating instance due to error 600
关闭数据库,在参数文件中增加隐含参数,重新启动数据库
*._allow_resetlogs_corruption=TRUE
*._corrupted_rollback_segments=(_syssmu1$,_syssmu2$,_syssmu3$,_syssmu4$,_syssmu5$,_syssmu6$,_syssmu7$,_syssmu8$,_syssmu9$,_syssmu10$,_syssmu11$,_syssmu12$,_syssmu13$,_syssmu14$,_syssmu15$,_syssmu16$,_syssmu17$,_syssmu18$,_syssmu19$,_syssmu20$,_syssmu21$,_syssmu22$,_syssmu23$,_syssmu24$,_syssmu25$,_syssmu26$,_syssmu27$,_syssmu28$,_syssmu29$,_syssmu30$,_syssmu31$,_syssmu32$,_syssmu33$)


再次报错:
alert日志显示:
WARNING! Recovering data file 2 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 3 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 4 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 5 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
WARNING! Recovering data file 6 from a fuzzy file. If not the current file
it might be an online backup taken without entering the begin backup command.
ORA-279 signalled during: ALTER DATABASE RECOVER  database until cancel using backup controlfile   ...
Tue Oct 28 21:02:38 CST 2014
ALTER DATABASE RECOVER    CANCEL  
Signalling error 1152 for datafile 1!
ORA-1547 signalled during: ALTER DATABASE RECOVER    CANCEL  ...
Tue Oct 28 21:02:39 CST 2014
ALTER DATABASE RECOVER CANCEL 
ORA-1112 signalled during: ALTER DATABASE RECOVER CANCEL ...
*********************************************************************
WARNING: The following temporary tablespaces contain no files.
         This condition can occur when a backup controlfile has
         been restored.  It may be necessary to add files to these
         tablespaces.  That can be done using the SQL statement:
 
         ALTER TABLESPACE <tablespace_name> ADD TEMPFILE
 
         Alternatively, if these temporary tablespaces are no longer
         needed, then they can be dropped.
           Empty temporary tablespace: TEMP
*********************************************************************、、这个告警是临时表空间为空
Errors in file /u01/app/oracle/admin/orcl/bdump/orcl_smon_3658.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number  with name "" too small
Tue Oct 28 21:02:48 CST 2014
Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_3672.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number  with name "" too small
Error 604 happened during db open, shutting down database

关闭数据库尝试使用event进行启动
SQL> startup mount;
ORACLE instance started.


Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL> alter session set events 'IMMEDIATE trace name ADJUST_SCN level 1';
Session altered.
SQL> recover database until cancel using backup controlfile ;
ORA-00279: change 1103447025682 generated at 10/28/2014 21:27:55 needed for
thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_1_862176474.arch
ORA-00280: change 1103447025682 for thread 1 is in sequence #1
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
ORA-01112: media recovery not started
//其实这个地方已经报错了,没有注意到!!!
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced

仍然报错:
Tue Oct 28 21:29:57 CST 2014
Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_3818.trc:
ORA-00600: internal error code, arguments: [2662], [256], [3935397914], [256], [3935397956], [4194313], [], []
Tue Oct 28 21:29:58 CST 2014
Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_3818.trc:
ORA-00600: internal error code, arguments: [2662], [256], [3935397914], [256], [3935397956], [4194313], [], []
Tue Oct 28 21:29:58 CST 2014
Error 600 happened during db open, shutting down database
重新使用隐含参数进行打开:
SQL> startup mount pfile='/tmp/a.txt';
ORACLE instance started.

Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
SQL> recover database until cancel using backup controlfile ;
ORA-00279: change 1103447025686 generated at 10/28/2014 21:29:57 needed for
thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_1_862176595.arch
ORA-00280: change 1103447025686 for thread 1 is in sequence #1

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log '/u01/app/oracle/arch/1_1_862176595.arch'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
//重建控制文件后,无法找到归档日志

ORA-00308: cannot open archived log '/u01/app/oracle/arch/1_1_862176595.arch'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
使用redo在线日志进行欺骗
SQL>  recover database until cancel using backup controlfile ;
ORA-00279: change 1103447025686 generated at 10/28/2014 21:29:57 needed for
thread 1
ORA-00289: suggestion : /u01/app/oracle/arch/1_1_862176595.arch
ORA-00280: change 1103447025686 for thread 1 is in sequence #1
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/orcl/redo01.log
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;

Database altered.

库终于起来了!

检查临时文件
SQL> select name from v$tempfile;
no rows selected
检查日志文件
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log
SQL> select sequence# from v$log;
 SEQUENCE#
----------
         1
         0
         0
增加临时文件----该步骤曾在一次故障处理中忽视,导致查询相当慢!
SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' reuse;
Tablespace altered.

在数据库启动之后,建议做一次冷备。

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.


Total System Global Area  276824064 bytes
Fixed Size                  2095640 bytes
Variable Size             100664808 bytes
Database Buffers          167772160 bytes
Redo Buffers                6291456 bytes
Database mounted.
Database opened.

飞总的一篇博文:http://www.xifenfei.com/4661.html,相当值得参考!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值