首页
登录 | 注册

意外故障重建控制文件

意外故障重建控制文件

索引快速增长导致盘空间占满,最后发现两个控制文件不一致,有一个貌似直接坏了

修改了一下,直接宕机启动发现


15:08:53 SYS@mydb1>startup
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2228024 bytes
Variable Size            1224736968 bytes
Database Buffers           50331648 bytes
Redo Buffers                8769536 bytes
ORA-00214: control file '/u01/app/oracle/product/11.2.3/db_1/dbs/control02.ctl' version 860092545 inconsistent with file '/u02/oradata/mydb1/control01.ctl' version 860092543

/u01/app/oracle/product/11.2.3/db_1/dbs/control02.ctl 略微新一点

15:08:58 SYS@mydb1>


Additional information: 4
Additional information: 64
Additional information: 610304
Errors in file /u01/app/oracle/diag/rdbms/mydb1/mydb1/trace/mydb1_ora_14819.trc:
ORA-00204: error in reading (block 64, # blocks 64) of control file
ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
ORA-27072: File I/O error
Additional information: 4
Additional information: 64
Additional information: 610304






Tue Jul 29 15:06:15 2014
********************* ATTENTION: ********************
 The controlfile header block returned by the OS
 has a sequence number that is too old.
 The controlfile might be corrupted.
 PLEASE DO NOT ATTEMPT TO START UP THE INSTANCE
 without following the steps below.
 RE-STARTING THE INSTANCE CAN CAUSE SERIOUS DAMAGE
 TO THE DATABASE, if the controlfile is truly corrupted.
 In order to re-start the instance safely,
 please do the following:
 (1) Save all copies of the controlfile for later
     analysis and contact your OS vendor and Oracle support.
 (2) Mount the instance and issue:
     ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
 (3) Unmount the instance.
 (4) Use the script in the trace file to
     RE-CREATE THE CONTROLFILE and open the database.
*****************************************************
USER (ospid: 15083): terminating the instance
Tue Jul 29 15:06:16 2014
System state dump requested by (instance=1, osid=15083), summary=[abnormal instance termination].
System State dumped to trace file /u01/app/oracle/diag/rdbms/mydb1/mydb1/trace/mydb1_diag_9045.trc
Dumping diagnostic data in directory=[cdmp_20140729150616], requested by (instance=1, osid=15083), summary=[abnormal instance termination].
Termination issued to instance processes. Waiting for the processes to exit
Tue Jul 29 15:06:27 2014
Instance termination failed to kill one or more processes
Instance terminated by USER, pid = 15083
Tue Jul 29 15:08:55 2014
Starting ORACLE instance (normal)

15:15:13 SYS@mydb1>show parameter user_dump_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      /u01/app/oracle/diag/rdbms/myd
                                                 b1/mydb1/trace
15:16:07 SYS@mydb1>


mydb1_ora_14566.trc:ORA-00204: error in reading (block 64, # blocks 64) of control file
mydb1_ora_14566.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14566.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14566.trc:ORA-00204: error in reading (block 64, # blocks 64) of control file
mydb1_ora_14566.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14819.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14819.trc:ORA-00204: error in reading (block 64, # blocks 64) of control file
mydb1_ora_14819.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14824.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_14824.trc:ORA-00204: error in reading (block 64, # blocks 64) of control file
mydb1_ora_14824.trc:ORA-00202: control file: '/u02/oradata/mydb1/control01.ctl'
mydb1_ora_15083.trc: The controlfile header block returned by the OS
mydb1_ora_15083.trc: The controlfile might be corrupted.
mydb1_ora_15083.trc: TO THE DATABASE, if the controlfile is truly corrupted.
mydb1_ora_15083.trc: (1) Save all copies of the controlfile for later
[oracle@my2950 trace]$



没办法 ,重建控制文件吧




CREATE CONTROLFILE REUSE DATABASE "MYDB1" NORESETLOGS  ARCHIVELOG 
    MAXLOGFILES 16 
    MAXLOGMEMBERS 3 
    MAXDATAFILES 100 
    MAXINSTANCES 8 
    MAXLOGHISTORY 454 
LOGFILE 
  GROUP 1 '/u03/oraredo/mydb1/onlinelog/redoaa01.log' SIZE 100M,
  GROUP 2 '/u03/oraredo/mydb1/onlinelog/redoaa02.log' SIZE 100M, 
  GROUP 3 '/u03/oraredo/mydb1/onlinelog/redoaa03.log' SIZE 100M,
  GROUP 4 '/u03/oraredo/mydb1/onlinelog/redoaa04.log' SIZE 100M,
  GROUP 5 '/u03/oraredo/mydb1/onlinelog/redoaa05.log' SIZE 100M

-- STANDBY LOGFILE 
DATAFILE 
  '/u02/oradata/mydb1/sysaux01.dbf',
  '/u02/oradata/mydb1/system01.dbf',
  '/u02/oradata/mydb1/temp01.dbf',
  '/u02/oradata/mydb1/undotbs101.dbf',
  '/u02/oradata/mydb1/users01.dbf',
  '/u02/oradata/mydb1/zabbix101.dbf',
  '/u02/oradata/mydb1/ccdata001.dbf' 
CHARACTER SET AL32UTF8 


最终的
[oracle@my2950 script]$ more rccf.sql
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "MYDB1" RESETLOGS  ARCHIVELOG
--  SET STANDBY TO MAXIMIZE PERFORMANCE
    MAXLOGFILES 5
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 1
    MAXLOGHISTORY 226
LOGFILE

  GROUP 1 '/u03/oraredo/mydb1/onlinelog/redoaa01.log' SIZE 100M,
  GROUP 2 '/u03/oraredo/mydb1/onlinelog/redoaa02.log' SIZE 100M,
  GROUP 3 '/u03/oraredo/mydb1/onlinelog/redoaa03.log' SIZE 100M,
  GROUP 4 '/u03/oraredo/mydb1/onlinelog/redoaa04.log' SIZE 100M,
  GROUP 5 '/u03/oraredo/mydb1/onlinelog/redoaa05.log' SIZE 100M
-- STANDBY LOGFILE
DATAFILE
  '/u02/oradata/mydb1/sysaux01.dbf',
  '/u02/oradata/mydb1/system01.dbf',
  '/u02/oradata/mydb1/undotbs101.dbf',
  '/u02/oradata/mydb1/users01.dbf',
  '/u02/oradata/mydb1/zabbix101.dbf',
  '/u02/oradata/mydb1/ccdata001.dbf'
CHARACTER SET AL32UTF8
;

[oracle@my2950 script]$


15:27:03 SYS@mydb1>startup nomount
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2228024 bytes
Variable Size            1224736968 bytes
Database Buffers           50331648 bytes
Redo Buffers                8769536 bytes
15:27:37 SYS@mydb1>

[oracle@my2950 mydb1]$ mkdir bak
[oracle@my2950 mydb1]$ mv control01.ctl.orig bak/
[oracle@my2950 mydb1]$ pwd
/u02/oradata/mydb1
[oracle@my2950 mydb1]$ ll
total 19775564
drwxr-xr-x 2 oracle dba         31 Jul 29 15:28 bak/
-rw-r----- 1 oracle dba 1825579008 Jul 29 14:53 ccdata001.dbf
-rw-r----- 1 oracle dba 1520443392 Jul 29 15:06 sysaux01.dbf
-rw-r----- 1 oracle dba  838868992 Jul 29 15:05 system01.dbf
-rw-r----- 1 oracle dba 4294975488 Jul 29 14:24 temp01.dbf
-rw-r----- 1 oracle dba 7130324992 Jul 29 15:06 undotbs101.dbf
-rw-r----- 1 oracle dba    5251072 Jul 29 14:53 users01.dbf
-rw-r----- 1 oracle dba 7864328192 Jul 29 14:53 zabbix101.dbf
[oracle@my2950 mydb1]$


15:45:13 SYS@mydb1>Set SQLBLANKLINES ON     --sqlplus支持空号
15:46:08 SYS@mydb1>
15:46:08 SYS@mydb1>
15:46:08 SYS@mydb1>
15:46:09 SYS@mydb1>@rccf.sql
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2228024 bytes
Variable Size            1224736968 bytes
Database Buffers           50331648 bytes
Redo Buffers                8769536 bytes
ERROR:
ORA-06550: line 1, column 29:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated


CREATE CONTROLFILE REUSE DATABASE "MYDB1" NORESETLOGS  ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01160: file is not a data file
ORA-01110: data file : '/u02/oradata/mydb1/temp01.dbf'


15:46:13 SYS@mydb1>


15:47:48 SYS@mydb1>@rccf.sql
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2228024 bytes
Variable Size            1224736968 bytes
Database Buffers           50331648 bytes
Redo Buffers                8769536 bytes
ERROR:
ORA-06550: line 1, column 29:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated


CREATE CONTROLFILE REUSE DATABASE "MYDB1" NORESETLOGS  ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01224: group number in header 7 does not match GROUP 1
ORA-01517: log member: '/u03/oraredo/mydb1/onlinelog/redoaa01.log'


15:47:52 SYS@mydb1>


[oracle@my2950 script]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jul 29 15:48:23 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

15:48:23 SYS@mydb1>shutdown abort
ORACLE instance shut down.
15:48:28 SYS@mydb1>Set SQLBLANKLINES ON
15:48:30 SYS@mydb1>@rccf.sql
ORACLE instance started.

Total System Global Area 1286066176 bytes
Fixed Size                  2228024 bytes
Variable Size            1224736968 bytes
Database Buffers           50331648 bytes
Redo Buffers                8769536 bytes

Control file created.

15:48:36 SYS@mydb1>



ALTER DATABASE OPEN;
ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/mydb1/temp01.dbf'
     SIZE 4294975488 REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 5000M;    

15:52:58 SYS@mydb1>ALTER DATABASE OPEN resetlogs;
ALTER DATABASE OPEN resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u02/oradata/mydb1/system01.dbf'


15:53:35 SYS@mydb1>

15:55:04 SYS@mydb1>select file#,ts#,status,name from v$datafile;

     FILE#        TS# STATUS  NAME
---------- ---------- ------- ----------------------------------------
         1          0 SYSTEM  /u02/oradata/mydb1/system01.dbf
         2          1 RECOVER /u02/oradata/mydb1/sysaux01.dbf
         3          2 RECOVER /u02/oradata/mydb1/undotbs101.dbf
         4          4 RECOVER /u02/oradata/mydb1/users01.dbf
         5          9 RECOVER /u02/oradata/mydb1/ccdata001.dbf
         7          7 RECOVER /u02/oradata/mydb1/zabbix101.dbf

6 rows selected.

15:58:31 SYS@mydb1>


15:59:19 SYS@mydb1>recover database using backup controlfile until cancel
ORA-00279: change 248088346 generated at 07/29/2014 14:53:35 needed for thread 1
ORA-00289: suggestion : /u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc
ORA-00280: change 248088346 for thread 1 is in sequence #2047


15:59:53 Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log '/u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc'
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: '/u02/oradata/mydb1/system01.dbf'


16:00:14 SYS@mydb1>

15:59:19 SYS@mydb1>recover database using backup controlfile until cancel
ORA-00279: change 248088346 generated at 07/29/2014 14:53:35 needed for thread 1
ORA-00289: suggestion : /u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc
ORA-00280: change 248088346 for thread 1 is in sequence #2047


15:59:53 Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00308: cannot open archived log '/u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc'
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: '/u02/oradata/mydb1/system01.dbf'


16:00:14 SYS@mydb1>
16:00:33 SYS@mydb1>ALTER DATABASE OPEN resetlogs;
ALTER DATABASE OPEN resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u02/oradata/mydb1/system01.dbf'


16:00:36 SYS@mydb1>recover database using backup controlfile until cancel
ORA-00279: change 248088346 generated at 07/29/2014 14:53:35 needed for thread 1
ORA-00289: suggestion : /u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc
ORA-00280: change 248088346 for thread 1 is in sequence #2047


16:01:05 Specify log: {=suggested | filename | AUTO | CANCEL}
'/u03/oraredo/mydb1/onlinelog/redoaa01.log'
ORA-00310: archived log contains sequence 2043; sequence 2047 required
ORA-00334: archived log: '/u03/oraredo/mydb1/onlinelog/redoaa01.log'


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: '/u02/oradata/mydb1/system01.dbf'


16:01:27 SYS@mydb1>recover database using backup controlfile until cancel
ORA-00279: change 248088346 generated at 07/29/2014 14:53:35 needed for thread 1
ORA-00289: suggestion : /u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc
ORA-00280: change 248088346 for thread 1 is in sequence #2047


16:01:42 Specify log: {=suggested | filename | AUTO | CANCEL}
'/u03/oraredo/mydb1/onlinelog/redoaa02.log'
ORA-00310: archived log contains sequence 2044; sequence 2047 required
ORA-00334: archived log: '/u03/oraredo/mydb1/onlinelog/redoaa02.log'


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: '/u02/oradata/mydb1/system01.dbf'


16:01:45 SYS@mydb1>recover database using backup controlfile until cancel
ORA-00279: change 248088346 generated at 07/29/2014 14:53:35 needed for thread 1
ORA-00289: suggestion : /u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_07_29/o1_mf_1_2047_%u_.arc
ORA-00280: change 248088346 for thread 1 is in sequence #2047


16:01:48 Specify log: {=suggested | filename | AUTO | CANCEL}
'/u03/oraredo/mydb1/onlinelog/redoaa03.log'
Log applied.
Media recovery complete.
16:01:53 SYS@mydb1>

16:02:22 SYS@mydb1>select file#,ts#,status,name from v$datafile;

     FILE#        TS# STATUS  NAME
---------- ---------- ------- ----------------------------------------
         1          0 SYSTEM  /u02/oradata/mydb1/system01.dbf
         2          1 ONLINE  /u02/oradata/mydb1/sysaux01.dbf
         3          2 ONLINE  /u02/oradata/mydb1/undotbs101.dbf
         4          4 ONLINE  /u02/oradata/mydb1/users01.dbf
         5          9 ONLINE  /u02/oradata/mydb1/ccdata001.dbf
         7          7 ONLINE  /u02/oradata/mydb1/zabbix101.dbf

6 rows selected.

16:02:25 SYS@mydb1>

16:02:34 SYS@mydb1>ALTER DATABASE OPEN resetlogs;

Database altered.

16:02:51 SYS@mydb1>

16:02:34 SYS@mydb1>ALTER DATABASE OPEN resetlogs;

Database altered.




ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/mydb1/temp01.dbf'
16:03:40   2       SIZE 4294975488 REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 5000M;

Tablespace altered.

16:03:42 SYS@mydb1>


ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/mydb1/temp01.dbf'
     SIZE 4294975488 REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 5000M
Completed: ALTER TABLESPACE TEMP ADD TEMPFILE '/u02/oradata/mydb1/temp01.dbf'
     SIZE 4294975488 REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 5000M



来自为知笔记(Wiz)



相关文章

  • 关于页面缓存的信息,可以用 cat /proc/meminfo  看到.其中的Cached 指用于pagecache的内存大小(diskcache-SwapCache).随着写入缓存页,Dirty 的值会增加. 一旦开始把缓存页写入硬盘,W ...
  • 经常做恢复验证,每次都有些小不同,想省点事,搞个一键还原可好?适用于不同实例,源端和目标端最好版本一致,平台一致,开始吧. 步骤介绍: #适用oracle 11g单机环境 #备份在192.168.1.1的RESTORDIR目录下,采用rma ...
  • 为了云计算的安全需要自己控制加密密钥
    由于其规模经济和易用性,各组织已迅速接受云计算.外包所需的基础设施要容易得多,特别是在多租户环境和中等市场企业中,这些企业很难为自己的基础设施融资. CloudKMS(企业拥有密钥,但它们存储在云软件中):基于软件的多租户云KMS特别不适合 ...
  • 报表中如何控制附件的上传和下载权限
    目前,多用户的软件平台已经是再常见不过的了,有成千上万个用户账号的平台也很正常.为了保证每个用户准确访问各自的信息,免不了要做这样或那样的权限控制,而且这种权限控制往往是需要基于数据层面进行管理的. 对于报表平台的数据权限管理,我们可以直观 ...
  • 注意,我并不会是百分之一百正确的.例如,一个系统很可能没有/proc文件系统支持,但是大多数系统肯定有.这里我假定你是"随大流的",并有一个典型配置的系统. 什么是符号(Symbols)? 内核符号表(Kernel Sy ...
  • Qt Creator Pro文件根据不同编译器自动选择对应的第三方库
    开发环境: Ubuntu 16.04 x64 + Qt Creator 4.7.2 + Qt-4.8.7 目标板: TI am335x开发板 编译工具: arm-arago-linux-gnueabi-gcc   开发中需要链接FFmpeg ...

2020 unjeep.com webmaster#unjeep.com
12 q. 0.013 s.
京ICP备10005923号