Oracle中控制文件损坏的处理方法
上一篇 / 下一篇 2008-04-23 12:48:15 / 个人分类:Oracle Fundamentals
模拟现场:2个控制文件d:r2control_01.ctl, d:r2control_02.ctl,其中d:r2control_02.ctl损坏。
$sqlplus /nolog
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
ez8UG)A-p
{0Total System Global Area 34675092 bytes
Fixed Size 453012 bytes
Variable Size 25165824 bytes
Database Buffers 8388608 bytes
Redo Buffers 667648 bytes
SQL> alter system set control_files=' d:r2control_01.ctl' scope=spfile;
ITPUB个人空间,o
X{8[s,g%TE&]
System altered.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount
Q"]n#V
V_5?L0SQL> alter database backup controlfile to trace;
ITPUB个人空间W7YO3m#z
Database altered.
ITPUB个人空间5Y8A6C%wY
W.Ng
SQL> select d.value '/' lower(rtrim(i.instance,chr(0))) '_ora_' p.spid '.trc' trace from
(select r.spid from sys.v$mystat m,sys.v$session s,sys.v$process r where m.statistic#=1 and s.sid=m.sid and r.addr=s.paddr) p,
(select t.instance from sys.v$thread t,sys.v$parameter v where v.name='thread' and (v.value=0 or t.thread#=to_number(v.value))) i,
(select value from sys.v$parameter where name='user_dump_dest') d;
0\pcX#C+Z!X;~0SQL> alter system set control_files='d:r2control_01.ctl', 'd:r2control_01.ctl' scope=spfile;
ITPUB个人空间^ U1wr/t0R
System altered.
b\\"\d`4M0SQL> shutdown immediate
ORA-01109: database not open
ITPUB个人空间
O0n7R,L)v9`5l.L#s
Database dismounted.
ORACLE instance shut down.
E7M1isEs0X0整理trc文件,总而言之一句话,将两个蓝色字体中间的内容copy出来,去掉带#的语句,然后执行整理后的文件。
yF|u8~%[w"f8Q0SQL>conn / as sysdba;
SQL>@ldd.trc
5X/e7Oq*HBX0Trc文件范例
Dump file d:r2udumpr2_ora_3136.trc
Sun Dec 10 00:07:51 2006
ORACLE V9.2.0.7.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.1 Service Pack 2, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Windows 2000 Version 5.1 Service Pack 2, CPU type 586
Instance name: r2
ITPUB个人空间6z/]@@^6b#}@_&s
Redo thread mounted by this instance: 1