oracle 快照(snapshot) 管理

时间:2022-06-12 14:52:34


----手工创建oracle 快照

BEGIN

DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT ();

END;

/

---删除快照

详细快照信息能够查看视图 DBA_HIST_SNAPSHOT

BEGIN

DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE (low_snap_id => 22,

high_snap_id => 32, dbid => 3310949047);

END;

/

---改动快照设置

BEGIN

DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention => 43200, interval => 30, topnsql => 100, dbid => 3310949047);

END;

/

/* retention :43200 minutes (30 days) ;interval:30 minutes ;topsql:    */

通过视图  DBA_HIST_WR_CONTROL 查看当前快照參数配置。