1、sqlplus /nolog
2、conn /as sysdba;
3、startup;
copy 'F:\oracle\product\10.1.0\oradata\orcl4\*.dbf' 'c:\coldback\';
4、alter system switch logfile;
5、rm -f arch/*.dbf
6、conn user1/user1;
7、select * from t1;
8、insert into t1 values(777,'zxd777');
9、select * from t1;
10、conn /as sysdba;
11、select * from user1.t1;
12、select group#,status from v$log;(若redo02---current)
13、! strings redo02 |grep zxd777;
14、conn user1/user;
15、commit; (redo buffer=>redo log file)
16、conn /as sysdba;
17、! strings redo02 |grep zxd777;
18、! strings zxdapp1 |grep zxd777;
19、alter system checkpoint; (data block=>data file)
20、! strings zxdapp1 |grep zxd777;
21、! strings arch/xxxx.dbf |grep zxd777;
22、alter system switch logfile; (redo file=>archive log file)
23、! strings arch/xxxx.dbf |grep zxd777;
24、conn user1/user1;
25、select * from t1;
26、insert into t1 values(888,'zxd888');
27、commit;(进入redo file)
28、conn /as sysdb;
29、alter system checkpoint;(进入DATA FILE)
30、alter database backup controlfile to trace as 'c:\backup1\conbei.sql';
('c:\backup1\conbei.sql'
方式一:redo/arch file不丢失的情况;
方式二:redo/arch file丢失的情况;
)
31、shutdown abort;
32、rm -f 'F:\oracle\product\10.1.0\oradata\orcl4\*'; 删除所有文件
33、copy 'c:\coldback\*.dbf' 'F:\oracle\product\10.1.0\oradata\orcl4\'
34、用vi 将'c:\backup1\conbei.sql'中的方式二保留,其它所有的包括注释全部删掉。
recover database using backup controlfile 语句也删掉
alter database open resetlogs;语句删掉
alter tablespace temp add tempfile '/u01/oradata/morewood/temp01.dbf'
size 20971520 reuse autoextend no next 655360 maxsize 32767M语句也删掉
35、sqlplus /nolog
36、conn /as sysdba;
37、@c:\backup1\conbei.sql
38、recover database using backup controlfile until cancel;
若碰到没有文件输入cancel,其它情况时输入回车即可.
39、alter database open resetlogs;
40、alter tablespace temp add tempfile '/u01/oradata/morewood/temp01.dbf'
size 20971520 reuse autoextend no next 655360 maxsize 32767M;
41、select * from user1.t1;
42、ok!!!!;
数据库恢复的最高境界:
只要数据存在datafile/redo log file/archive log file中的某一个地方,
即可恢复。
阅读(987) | 评论(0) | 转发(0) |