IT开放社区

无备份丢失控制文件恢复open数据库

环境:

OS:Oracle Linux Server release 5.6

DB:oracle11.2.0.1

1.删除所有控制文件;

[oracle@itkaifang ~]$ cd /u01/app/oracle/oradata/
[oracle@itkaifang oradata]$ ls
itkaifang
[oracle@itkaifang oradata]$ cd itkaifang/
[oracle@itkaifang itkaifang]$ ls
control01.ctl  example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf     users01.dbf
control02.ctl  redo01.log     redo03.log  system01.dbf  undotbs01.dbf
[oracle@itkaifang itkaifang]$ rm con*
[oracle@itkaifang itkaifang]$ ls
example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf     users01.dbf
redo01.log     redo03.log  system01.dbf  undotbs01.dbf
[oracle@itkaifang itkaifang]$

2.一致性关闭数据库报错;

itkaifang@SYS> shutdown immediate
Database closed.
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/itkaifang/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

itkaifang@SYS> shutdown abort
ORACLE instance shut down.
itkaifang@SYS> startup
ORACLE instance started.
Total System Global Area  830930944 bytes
Fixed Size                  2217912 bytes
Variable Size             490735688 bytes
Database Buffers          335544320 bytes
Redo Buffers                2433024 bytes
ORA-00205: error in identifying control file, check alert log for more info

itkaifang@SYS>

3.在其它数据库生成控制文件创建语句或在删除控制文件生成,(alter database backup controlfile to trace as '/home/oracle/bak.trc';);

CREATE CONTROLFILE REUSE DATABASE "ITKAIFAN" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 5
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/itkaifang/redo01.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/itkaifang/redo02.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/itkaifang/redo03.log'
  ) SIZE 50M BLOCKSIZE 512
DATAFILE
  '/u01/app/oracle/oradata/itkaifang/system01.dbf',
  '/u01/app/oracle/oradata/itkaifang/sysaux01.dbf',
  '/u01/app/oracle/oradata/itkaifang/undotbs01.dbf',
  '/u01/app/oracle/oradata/itkaifang/users01.dbf',
  '/u01/app/oracle/oradata/itkaifang/example01.dbf'
CHARACTER SET AL32UTF8
;

4.启动数据库;

itkaifang@SYS> CREATE CONTROLFILE REUSE DATABASE "ITKAIFAN" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 5
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/itkaifang/redo01.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/itkaifang/redo02.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/itkaifang/redo03.log'
  ) SIZE 50M BLOCKSIZE 512
DATAFILE
  '/u01/app/oracle/oradata/itkaifang/system01.dbf',
  '/u01/app/oracle/oradata/itkaifang/sysaux01.dbf',
  '/u01/app/oracle/oradata/itkaifang/undotbs01.dbf',
  '/u01/app/oracle/oradata/itkaifang/users01.dbf',
  '/u01/app/oracle/oradata/itkaifang/example01.dbf'
CHARACTER SET AL32UTF8
;  2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24 
Control file created.
itkaifang@SYS> select status from v$instance;
STATUS
------------
MOUNTED
itkaifang@SYS> alter database open;
Database altered.
itkaifang@SYS>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

网站分类
最新文章
    随机文章
      站点信息
      • 文章总数:106
      • 页面总数:0
      • 分类总数:8
      • 标签总数:0
      • 评论总数:0
      • 浏览总数:15966
      DBA联盟
      DBA导师

      BlogPowerBy Z-BlogPHP 1.5 Zero ;Theme By 爱墙纸

      IT开放社区:京ICP备13044647号.初创于Oracle DBA实战班.邮箱:admin@itkaifang.com

      分享:

      支付宝

      微信