Total System Global Area 1090519040 bytes
Fixed Size 1267020 bytes
Variable Size 704645812 bytes
Database Buffers 369098752 bytes
Redo Buffers 15507456 bytes
ORA-00214: control file '/sof/oracle/oradata/orcl/control02.ctl' version 1036
inconsistent with file '/sof/oracle/oradata/orcl/control01.ctl' version 1020
现在就提示了控制文件的版本好不一致的问题。注意提示的版本号那个更高。
SQL> ho cp /sof/oracle/oradata/orcl/control01.ctl /sof/oracle/oradata/orcl/control01.ctl.bak
SQL> ho cp /sof/oracle/oradata/orcl/control02.ctl /sof/oracle/oradata/orcl/control01.ctl
SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1090519040 bytes
Fixed Size 1267020 bytes
Variable Size 704645812 bytes
Database Buffers 369098752 bytes
Redo Buffers 15507456 bytes
ORA-00214: control file '/sof/oracle/oradata/orcl/control02.ctl' version 1036
inconsistent with file '/sof/oracle/oradata/orcl/control03.ctl' version 1020
SQL> ho cp /sof/oracle/oradata/orcl/control03.ctl /sof/oracle/oradata/orcl/control03.ctl.bak
SQL> ho cp /sof/oracle/oradata/orcl/control02.ctl /sof/oracle/oradata/orcl/control03.ctl
SQL> startup
ORACLE instance started.
Total System Global Area 1090519040 bytes
Fixed Size 1267020 bytes
Variable Size 704645812 bytes
Database Buffers 369098752 bytes
Redo Buffers 15507456 bytes
Database mounted.
Database opened.
上面就说明成了。
4,控制文件都丢失,
5,有但是很old
SQL> alter database backup controlfile to trace as '/tmp/luo.txt'
2 ;
Database altered.
得到建立日志文件的脚本,以后我们数据库建好后就要做。
下面就是重建控制文件。
千万记住下面这个命令。
如果控制文件全部丢失,版本过老,在我们重建控制文件之前需要备份故障的状态。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@huang ~]$ cp /sof/oracle/oradata/orcl/ /sof/oracle/oradata/orcl.bak -rf
[oracle@huang ~]$ rm /sof/oracle/oradata/orcl/control0* -rf
[oracle@huang ~]$ ls /sof/oracle/oradata/orcl
orcl/ orcl.bak/
[oracle@huang ~]$ ls /sof/oracle/oradata/orcl
orcl/ orcl.bak/
[oracle@huang ~]$ ls /sof/oracle/oradata/orcl/
example01.dbf redo02.log sysaux01.dbf temp01.dbf users01.dbf
redo01.log redo03.log system01.dbf undotbs01.dbf
[oracle@huang ~]$ sqlplus / as sysdba
[uniread] Loaded history (945 lines)
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Jan 4 16:57:00 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1090519040 bytes
Fixed Size 1267020 bytes
Variable Size 704645812 bytes
Database Buffers 369098752 bytes
Redo Buffers 15507456 bytes
ORA-00205: error in identifying control file, check alert log for more info
去除所有的--和空格行,和开头的空格。
[oracle@huang ~]$ grep -v ^-- /tmp/luo.txt|grep -v ^$ >/tmp/luo1.txt
[oracle@huang ~]$ vim /tmp/luo1.txt
[oracle@huang ~]$ sed -n '1,23'p /tmp/luo1.txt >/tmp/luo2.txt
截取下面两行和之间的内容。注意是下面行是第一次出现的时候
STARTUP NOMOUNT
..................
SIZE 30408704 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
[oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
[oracle@huang ~]$ sed -i 's/^ //' /tmp/luo2.txt
[oracle