set autorecovery off
0、sqlplus /nolog
1、conn /as sysdba;
2、startup;
3、create tablespace app2
datafile 'F:\oracle\product\10.1.0\oradata\orcl4\zxdapp2.dbf' size 10M
extent management local uniform size 100k;
4、create user user2 identified by user2 account unlock;
5、grant connect,resource to user2;
6、select * from v$recover_file;
7、sqlplus /nolog
8、conn user2/user2@oracle9ivm ;
9、create table t1(id number,name varchar(20));
10、insert into t1 values(1,'zxd1');
11、alter tablespace app2 begin backup;
12、copy 'F:\oracle\product\10.1.0\oradata\orcl4\zxdapp2.dbf' 'c:\hotbackup\';
13、alter tablespace app2 end backup;
14、insert into t1 values(2,'zxd2');
15、alter system switch logfile;
16、alter system switch logfile;
17、alter system switch logfile;
18、alter system switch logfile;
20、alter database datafile 6 offline;
(alter tablespace app2 offline;)
21、rm -f zxdapp2.dbf;
22、select * from t1;
23、select * from v$recover_file;
24、select status,file# from v$datafile;
25、copy 'c:\coldbackup\zxdapp2.dbf ' 'F:\oracle\product\10.1.0\oradata\orcl4\';
26、recover datafile 6;
27、alter database datafile 6 online;
(alter tablespace app2 online;)
28、select * from t1;
29、select * from v$recover_file;
30、select * from t1;
31、ok!!!!;
阅读(564) | 评论(0) | 转发(0) |