LoginSignup
2
2

More than 5 years have passed since last update.

AWR自動取得

Posted at

set pages 0
spool awr_tmp.sql
select
'define report_type=text' || chr(10) ||
'define num_days=2' || chr(10) ||
'define begin_snap=' || SNAP_ID || chr(10) ||
'define end_snap=' || (SNAP_ID + 1)|| chr(10) ||
'define report_name=' || SNAP_ID || '_' || (SNAP_ID + 1) || '.txt' ||
chr(10) ||
'@?/rdbms/admin/awrrpt.sql' || chr(10)
from sys.dba_hist_snapshot
where snap_id >
(select max(snap_id)-3 from sys.dba_hist_snapshot)
and snap_id < (select max(snap_id) from sys.dba_hist_snapshot)
order by snap_id;
spool off
@awr_tmp.sql

exit

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2