Oracle数据库丢失控制文件的恢复四则(二)

2014-11-24 17:02:16 · 作者: · 浏览: 1
e1 ;

old 1: select count(*) from &tbsname1

new 1: select count(*) from tbs1

COUNT(*)

----------

72780

sys@BKT> select count(*) from&tbsname2 ;

old 1: select count(*) from &tbsname2

new 1: select count(*) from tbs2

COUNT(*)

----------

72781

sys@BKT> alter tablespace &tbsname1read only ;

old 1: alter tablespace &tbsname1 read only

new 1: alter tablespace tbs1 read only

Tablespace altered.

sys@BKT>

3. switch logfile

alter system switch logfile ;

alter system switch logfile ;

alter system switch logfile ;

alter system switch logfile ;

alter system switch logfile ;

output :

sys@BKT> alter system switchlogfile ;

alter system switch logfile ;

alter system switch logfile ;

alter system switch logfile ;

System altered.

sys@BKT>

System altered.

sys@BKT>

System altered.

sys@BKT>

System altered.

4. remove controlfile

rm /u02/oradat/bkt/control01.ctl

rm/u02/flash_recovery_area/bkt/control02.ctl

output :

[oracle@master ~]$ rm/u02/oradat/bkt/control01.ctl

[oracle@master ~]$ rm/u02/flash_recovery_area/bkt/control02.ctl

--from alert .

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6172.trc:

ORA-00210: cannot open the specifiedcontrol file

ORA-00202: control file:'/u02/oradat/bkt/control01.ctl'

ORA-27041: unable to open file

Linux-x86_64 Error: 2: No such file ordirectory

Additional information: 3

5. shutdown database

shutdown abort

output :

sys@BKT> shutdown abort ;

ORACLE instance shut down.

6. using backup controlfile

--copy backup controlfile to thecontrolfile path which defined in the parameter .

cp /tmp/control01.ctl/u02/oradat/bkt/control01.ctl

cp /tmp/control01.ctl/u02/flash_recovery_area/bkt/control02.ctl

recover

output :

cp /tmp/control01.ctl /u02/oradat/bkt/control01.ctl

cp /tmp/control01.ctl/u02/flash_recovery_area/bkt/control02.ctl

sys@BKT> startup

ORACLE instance started.

Total System Global Area 417546240 bytes

Fixed Size 2228944 bytes

Variable Size 318770480 bytes

Database Buffers 88080384 bytes

Redo Buffers 8466432 bytes

Database mounted.

ORA-01122: database file 1 failedverification check

ORA-01110: data file 1:'/u02/oradat/bkt/system01.dbf'

ORA-01207: file is more recent than controlfile - old control file

--from alert

ALTER DATABASE OPEN

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_ora_6327.trc:

ORA-01122: database file 1 failedverification check

ORA-01110: data file 1:'/u02/oradat/bkt/system01.dbf'

<<>>

ORA-1122 signalled during: ALTER DATABASEOPEN...

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6331.trc:

ORA-00338: log 1 of thread 1 is more recentthan control file

ORA-00312: online log 1 thread 1:'/u02/oradat/bkt/redo01.log'

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6331.trc:

ORA-00338: log 1 of thread 1 is more recentthan control file

ORA-00312: online log 1 thread 1:'/u02/oradat/bkt/redo01.log'

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6331.trc:

ORA-00338: log 2 of thread 1 is more recentthan control file

ORA-00312: online log 2 thread 1:'/u02/oradat/bkt/redo02.log'

Errors in file /u01/apps/oracle/diag/rdbms/bkt/bkt/trace/bkt_m000_6331.trc:

ORA-00338: log 2 of thread 1 is more recentthan control file

ORA-00312: online log 2 thread 1:'/u02/oradat/bkt/redo02.log'

Errors in file/u01/apps/oracle/diag/rdbms/bkt/bkt/tra