用备份控制文件的恢复,控制文件中不包含数据文件,但联机日志中有
alter database backup controlfile to 'D:\control.ctl';
create tablespace tp1 datafile 'D:/tp1.dbf' size 10M;
create table t1(id int,name varchar2(10)) tablespace tp1;
insert into t1 values(1,'pl1');
commit;
停服务==>services.msc==>停oracle进程
rm -rf control*
shutdown abort;
拷贝 D:\control.ctl D:\app\administrator\oradata\orcl\control01.ctl
startup mount;
select file#,checkpoint_change# from v$datafile;
select file#,checkpoint_change# from v$datafile_header;
alter database open; //提示控制文件旧了
recover database using backup controlfile;
select * from v$log 找current的log
输入D:\oradata\orcl\redo02.log --状态是current
提示有一个文件不识别
select file#,name from v$datafile;
alter database rename file'D:\app/administrator\product\11.2.0\dbhome_1\database\UNNAMED00005' to 'D:\tp1.dbf';
recover database using backup controlfile;
输入:/oradata/orcl/redo02.log --一select * from v$log;
alter database open resetlogs;