DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE 手工清理awr
DBMS_WORKLOAD_REPOSITORY
The DBMS_WORKLOAD_REPOSITORY package lets you manage the Workload Repository, performing operations such as managing snapshots and baselines.
DROP_SNAPSHOT_RANGE Procedure
This procedure drops a range of snapshots.
Syntax
DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(
low_snap_id IN NUMBER,
high_snap_id IN NUMBER
dbid IN NUMBER DEFAULT NULL);
Parameters
Table 161-27 DROP_SNAPSHOT_RANGE Procedure Parameters
Parameter | Description |
---|---|
low_snap_id |
Low snapshot id of snapshots to drop. |
high_snap_id |
High snapshot id of snapshots to drop. |
dbid |
Database id (default to local DBID. |
Examples
This example drops the range of snapshots between snapshot id 102 to 105 for the local database:
EXECUTE DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(102, 105);
If you query the dba_hist_snapshot view after the Drop Snapshot action, you will see that snapshots 102 to 105 are removed from the Workload Repository.
MODIFY_SNAPSHOT_SETTINGS Procedures
This procedure controls three aspects of snapshot generation.
-
The INTERVAL setting affects how often snapshots are automatically captured.
-
The RETENTION setting affects how long snapshots are retained in the Workload Repository.
-
The number of SQL captured for each Top criteria. If the user manually specifies a value for Top N SQL, the AWR SQL collection will use the user-specified number for both automatic and manual snapshots.
There are two overloads. The first takes a NUMBER and the second takes a VARCHAR2 for the topnsql argument. The differences are described under the Parameters description.
Syntax
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention IN NUMBER DEFAULT NULL, interval IN NUMBER DEFAULT NULL, topnsql IN NUMBER DEFAULT NULL, dbid IN NUMBER DEFAULT NULL); DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention IN NUMBER DEFAULT NULL, interval IN NUMBER DEFAULT NULL, topnsql IN VARCHAR2, dbid IN NUMBER DEFAULT NULL);
Parameters
Table 161-28 MODIFY_SNAPSHOT_SETTINGS Procedure Parameters
Parameter | Description |
---|---|
retention |
New retention time (in minutes). The specified value must be in the range of MIN_RETENTION (1 day) toMAX_RETENTION (100 years). If ZERO is specified, snapshots will be retained forever. A large system-defined value will be used as the retention setting. If NULL is specified, the old value for retention is preserved. NOTE: The retention setting must be greater than or equal to the window size of the 'SYSTEM_MOVING_WINDOW' baseline. If the retention needs to be less than the window size, the MODIFY_BASELINE_WINDOW_SIZE Procedure can be used to adjust the window size. |
interval |
New interval setting between each snapshot, in units of minutes. The specified value must be in the rangeMIN_INTERVAL (10 minutes) to MAX_INTERVAL (1 year). If ZERO is specified, automatic and manual snapshots will be disabled. A large system-defined value will be used as the retention setting. If NULL is specified, the current value is preserved. |
topnsql |
|
dbid |
Database identifier in AWR for which to modify the snapshot settings. If NULL is specified, the local dbid will be used. Defaults to NULL. |
Examples
This example changes the interval setting to one hour and the retention setting to two weeks for the local database:
EXECUTE DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( interval => 60, retention => 20160);
If you query the DBA_HIST_WR_CONTROL table after this procedure is executed, you will see the changes to these settings.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29477587/viewspace-1155398/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 手工生成AWR分析報告
- 【效能優化】AWR的手工生成優化
- Oracle 11g 手工跑AWR報告Oracle
- 手工清理ASM裡面的垃圾檔案ASM
- 手工生成AWR執行期對比報告記錄
- oracle 19c&21c 單機/RAC手工清理Oracle
- 手工生成HTML格式AWR遇到Bug 13527323一例HTML
- Oracle 11.2.0.4 awr過期快照無法自動清理Oracle
- 【AWR】該怎樣清理SYSAUX表空間相關資料UX
- unix 系統捕獲sql語句和手工調整AWR的設定SQL
- 【AWR】清理SYSAUX表空間資料(第三季非暴力不合作)UX
- 【AWR】該怎樣清理SYSAUX表空間相關資料(第二季)UX
- ORACLE AWROracle
- Oracle AWR ---Oracle
- oracle awrOracle
- 【AWR】Oracle資料庫建立awr基線Oracle資料庫
- 【AWR】Oracle批量生成awr報告指令碼Oracle指令碼
- 【AWR】ORA-13541修改AWR保留策略
- 【Oracle】-【AWR/Stackpack】-AWR(Stackpack)執行許可權Oracle
- 手工建庫
- awr的命令
- AWR簡介
- awr 日誌
- 批量生成AWR
- awr學習
- oracle awr ashOracle
- Oracle AWR速查Oracle
- oracle,metric,awrOracle
- 【Oracle】AWR analyseOracle
- 【AWR】自動生成AWR報告指令碼以及用法指令碼
- 每天定時生成awr,每小時一個awr
- Oracle 10g,AWR,AWR,ADDM最佳實踐Oracle 10g
- Oracle 11g AWR 系列六:使用 AWR 檢視Oracle
- 【AWR】Oracle awr相關檢視及體系介紹Oracle
- 【AWR】資料庫診斷工具AWR使用全程記錄資料庫
- 【oracle手工建庫】Oracle
- oracle手工建庫Oracle
- oracle工具 awr formatOracleORM