学院首页>网络编程>ORACLE>[Oracle]Oracle冷备份的不完全恢复

[Oracle]Oracle冷备份的不完全恢复

作者:landa 来源:赛迪论坛 添加时间:2006-5-26 9:53:10

冷备份的不完全恢复:基于三种情况

一 冷备份.

建立表空间test,用户test,表名test 插入数据

insert into test.test(a,b) values(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),to_char(sysdate,'yyyy-mm-dd hh24:mi’));

commit;

alter system archive log current;

进行了两个事务(commit)和日志切换

commit;

alter system archive log current;日志切换同时归档

select checkpoint_change#,archive_change# ,controlfile_change# from v$database;

1 984675 983549 984675 初始备份时的scn

此时进行冷备份

执行shutdown immediate

拷贝所有的数据文件,控制文件,在线日志文件,归档日志文件,如果需要,spfile,密码文件

最好多拷贝几份,以便反复测试使用。

二、添加数据文件

startup

打开数据库

删除test.test 表中的所有数据

然后插入数据

insert into test.test(a,b) values(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),to_char(sysdate,'yyyy-mm-dd hh24:mi’));

commit;

alter system archive log current;

进行了两个事务(commit)和日志切换

commit;

前14条每两个进行一个commit,同时alter system archive log current;

后面的

每一个进行commit;

alter system archive log current;

select * from test.test

1 2005-12-17 16:41:41 2005-12-17 16:41:41

2 2005-12-17 16:42:36 2005-12-17 16:42:36

3 2005-12-17 16:29:14 2005-12-17 16:29:14

4 2005-12-17 16:28:26 2005-12-17 16:28:26

5 2005-12-17 16:28:27 2005-12-17 16:28:27

6 2005-12-17 16:29:12 2005-12-17 16:29:12

7 2005-12-17 16:29:49 2005-12-17 16:29:49

8 2005-12-17 16:29:49 2005-12-17 16:29:49

9 2005-12-17 16:30:07 2005-12-17 16:30:07

10 2005-12-17 16:30:09 2005-12-17 16:30:09

11 2005-12-17 16:30:26 2005-12-17 16:30:26

12 2005-12-17 16:30:27 2005-12-17 16:30:27

13 2005-12-17 16:31:04 2005-12-17 16:31:04

14 2005-12-17 16:31:23 2005-12-17 16:31:23

15 2005-12-17 16:31:42 2005-12-17 16:31:42

16 2005-12-17 16:31:56 2005-12-17 16:31:56

17 2005-12-17 16:33:58 2005-12-17 16:33:58

18 2005-12-17 16:34:05 2005-12-17 16:34:05

19 2005-12-17 16:34:10 2005-12-17 16:34:10

20 2005-12-17 16:34:17 2005-12-17 16:34:17

第 1 页,共 2 页 [1] [2]
站内搜索