SQL>startup mount; //启动到mount状态
SQL> show parameter control_files //查看控制文件的位置信息 NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ control_files string +DATA/metro/controlfile/backup .268.848861257 SQL> select name from v$datafile; //查看数据文件的信息 NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/metro/system01.dbf /u01/app/oracle/oradata/metro/undotbs01.dbf /u01/app/oracle/oradata/metro/sysaux01.dbf /u01/app/oracle/oradata/metro/users01.dbf /u01/app/oracle/oradata/metro/example01.dbf
SQL> alter database rename file ‘/u01/app/oracle/oradata/metro/system01.dbf‘ to ‘+DATA/METRO/DATAFILE/SYSTEM.257.848858337‘; //更改数据文件的信息
SQL> select status from v$instance; //查看数据库当前状态 STATUS ------------ MOUNTED
SQL> alter database open; //尝试启库,报出需要resetlogs提示 alter database open * ERROR at line 1: ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;//以resetlogs形式启库,提示数据文件1不 alter database open resetlogs * ERROR at line 1: ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: ‘+DATA/metro/datafile/system.257.848858337‘
SQL> select checkpoint_change# from v$datafile; //检查控制文件中各数据文件SCN
SQL> recover datafile 1; ORA-00283: recovery session canceled due to errors ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> recover datafile 1 using backup controlfile; ORA-00274: illegal recovery option USING
SQL> recover database; //提示需使用备份的控制文件 ORA-00283: recovery session canceled due to errors ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> recover database using backup controlfile; //使用备份的控制文件恢复数据库 ORA-00279: change 861998 generated at 05/29/2014 15:02:17 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/arch1/1_15_848741495.dbf ORA-00280: change 861998 for thread 1 is in sequence #15 //提示恢复需要sequence号为15的日志
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log ‘/u01/app/oracle/arch1/1_15_848741495.dbf‘ ORA-27037: unable to obtain file status IBM AIX RISC System/6000 Error: 2: No such file or directory Additional information: 3