Control File恢复
场景一:重建control File www.2cto.com
You’ve experienced a failure and lost all of your control files, and you
belatedly realizethat you don’t have a good binary backup of the control file.
belatedly realizethat you don’t have a good binary backup of the control file.
You want to change a database setting that can be modified only by
re-creating the con-trol file.
re-creating the con-trol file.
You are relocating a large number of datafiles, and you find it easier
to re-create the control file with the new names and locations
(instead of manually renaming the datafiles)
to re-create the control file with the new names and locations
(instead of manually renaming the datafiles)
解决:重建Control FIles
[sql]
SQL> show parameter user_dump_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /u01/app/oracle/diag/rdbms/pur
ple/purple1/trace
技巧:NAMING A TRACE FILE
Trace文件命名规则
.trc,我们可以通过设置tracefile_identifier来识
别Trace文件。 www.2cto.com
别Trace文件。 www.2cto.com
SQL> alter session set tracefile_identifier=mytrace
Session altered.
SQL> select distinct tracefile from v$process p,v$session s ,
v$mystat m where p.addr=s.paddr and s.sid=m.sid;--
查看当前TraceFile
v$mystat m where p.addr=s.paddr and s.sid=m.sid;--
查看当前TraceFile
TRACEFILE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/purple/purple1/trace/purple1_ora_
14669_MYTRACE.trc
14669_MYTRACE.trc
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PURPLE"
RESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '+DATA/purple/onlinelog/group_1.257.805043621'
SIZE 50M BLOCKSIZE 512,
SIZE 50M BLOCKSIZE 512,
GROUP 2 '+DATA/purple/onlinelog/group_2.258.805043623'
SIZE 50M BLOCKSIZE 512
SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'+DATA/purple/datafile/system.264.805043525',
'+DATA/purple/datafile/sysaux.262.805043527',
'+DATA/purple/datafile/undotbs1.256.805043527',
'+DATA/purple/datafile/users.260.805043527',
'+DATA/purple/datafile/undotbs2.263.805043817'
CHARACTER SET ZHS16GBK
;
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PURPLE"
NORESETLOGS ARCHIVELOG
NORESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '+DATA/purple/onlinelog/group_1.257.805043621'
SIZE 50M BLOCKSIZE 512,
SIZE 50M BLOCKSIZE 512,
GROUP 2 '+DATA/purple/onlinelog/group_2.258.805043623'
SIZE 50M BLOCKSIZE 512,
SIZE 50M BLOCKSIZE 512,
GROUP 3 '+DATA/purple/onlinelog/group_3.271.805043939'
SIZE 50M BLOCKSIZE 512,
SIZE 50M BLOCKSIZE 512,
GROUP 4 '+DATA/purple/onlinelog/group_4.272.805043941'
SIZE 50M BLOCKSIZE 512
SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'+DATA/purple/datafile/system.264.805043525',
'+DATA/purple/datafile/sysaux.262.805043527',
'+DATA/purple/datafile/undotbs1.256.805043527',
'+DATA/purple/datafile/users.260.805043527',
'+DATA/purple/datafile/undotbs2.263.805043817'
CHARACTER SET ZHS16GBK
;
场景二:多路复用控制文件的恢复
[sql]
SQL> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2213896 bytes
Variable Size 1090521080 bytes
Database Buffers 553648128 bytes
Redo Buffers 7135232 bytes
ORA-00205: e