标签:
在重建控制文件之前应该考虑的事情select distinct(status) from v$datafile where status not in ('ONLINE','SYSTEM'); select name, ts#, online$, contents$ from ts$ where online$ =2;否则,一旦控制文件以resetlogs的方式重建之后,所有的offlined 的datafile不能添加回database。
RMAN> sql 'alter database datafile 6 online'; sql statement: alter database datafile 6 online RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of sql command on default channel at 07/29/2012 11:07:07 RMAN-11003: failure during parse/execution of SQL statement: alter database datafile 6 online ORA-01190: control file or data file 6 is from before the last RESETLOGS ORA-01110: data file 6: '/opt/app/oracle/oradata/ORA112/leng_ts.dbf'
File Name: /opt/app/oracle/fra/ORA112/flashback/o1_mf_85zttw61_.flb RMAN-07529: Reason: catalog is not supported for this file type你将会不得不重新启用flashback database.所有旧的闪回日志将不再有用,需要手工从disk上remove掉。
RMAN> catalog recovery area;
RMAN> backup current controlfile; SYS> alter database backup controlfile to '/tmp/control01.bk';在重建控制文件之前,你至少做一个当前控制文件的备份。
SYS@ORA112.SQL> show parameter control_files NAME TYPE VALUE ------------------------------------ -------------------- ------------------------------ control_files string /opt/app/oracle/oradata/ORA112 /control1.ctl, /opt/app/oracle /oradata/ORA112/control2.ctl $ cp /opt/app/oracle/oradata/ORA112/control1.ctl /opt/app/oracle/oradata/ORA112/control1.ctl.old $ cp /opt/app/oracle/oradata/ORA112/control2.ctl /opt/app/oracle/oradata/ORA112/control2.ctl.old
SQL> alter database backup controlfile to trace;上面的命令会生成一个ASCII命令,用该ASCII命令可以重建controlfile。该命令实际不是current controlfile的备份。
control_files='location1/file1','location2/file2'2)打开控制文件的autobackup
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;如果需要,使用如下命令来修改autobackup的位置:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
标签:
原文地址:http://blog.csdn.net/msdnchina/article/details/50644641