How to create a on-demand AWR snapshot?

Using dbms_workload_repository.create_snapshot() one can create AWR snapshot.

Example: Creates the snapshot and returns the snap id. If ‘ALL’ is not passed it defaults to typical (statistics_level).

SQL> select dbms_workload_repository.create_snapshot('ALL') from dual;

DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT()
——————————————
856

1 row selected.

To view snapshot

SQL> select end_interval_time, error_count from DBA_HIST_SNAPSHOT where snap_id = 856;

END_INTERVAL_TIME ERROR_COUNT
————————————————————————— ———–
25-AUG-10 11.03.17.486 PM 0

posted @ 2016-12-09 10:29  lily_z  阅读(188)  评论(0编辑  收藏  举报