创建oracle快照的步骤

创建oracle快照的步骤[@more@]
1、 创建快照之前需要在sys用户下运行catrep.sql(此操作需要一个大的回滚段), 并且给user授予CREATE ANY SNAPSHOT、ALTER ANY SNAPSHOT权限
注:建立快照的两端数据库字符集最好一样。

2、 user建立DBLINK
CREATE DATABASE LINK TEST CONNECT TO SCOTT IDENTIFIED BY TIGER USING ‘TEST’;

3、 user建快照
CREATE SNAPSHOT S_TEST
REFRESH COMPLETE START WITH SYSDATE NEXT SYSDATE+1/24
AS SELECT * FROM SCOTT.TEST@TEST ;

REFRESH语句具体语法如下:
REFRESH
specifies how and when Oracle automatically refreshes the snapshot:

FAST
specifies a fast refresh, or a refresh using only the updated data stored in the snapshot log associated with the master table.

COMPLETE
specifies a complete refresh, or a refresh that reexecutes the snapshot's query.

FORCE
specifies a fast refresh if one is possible or complete refresh if a fast refresh is not possible. Oracle decides whether a fast refresh is possible at refresh time.

If you omit the FAST, COMPLETE, and FORCE options, Oracle uses FORCE by default. See also "Refreshing Snapshots".

START WITH
specifies a date expression for the first automatic refresh time.

NEXT
specifies a date expression for calculating the interval between automatic refreshes.

Both the START WITH and NEXT values must evaluate to a time in the future. If you omit the START WITH value, Oracle determines the first automatic refresh time by evaluating the NEXT expression when you create the snapshot. If you specify a START WITH value but omit the NEXT value, Oracle refreshes the snapshot only once. If you omit both the START WITH and NEXT values, or if you omit the REFRESH clause entirely, Oracle does not automatically refresh the snapshot.


4、 更改快照
ALTER SNAPSHOT S_TEST
REFRESH COMPLETE START WITH SYSDATE NEXT SYSDATE+1/2;

5、 手动刷新快照
EXEC DBMS_SNAPSHOT.REFRESH(‘S_TEST’ , ‘C’);
第一个参数是要刷新的快照名
第二个参数是刷新的方式,F----FAST, C---COMPLETE

6、 查看快照最后刷新的日期
SELECT NAME,LAST_REFRESH
FROM ALL_SNAPSHOT_REFRESH_TIMES;

[[i] Last edited by liuyy on 2005-10-10 at 14:28 [/i]]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/703656/viewspace-903362/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/703656/viewspace-903362/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值