AWR and ASH reports

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

 

Download Automatic Workload Repository (AWR) and Active Session History (ASH) reports

ON THE LOCALHOST WIN DESKTOP

cd D:\awr
sqlplus /nolog
SQL> conn sys@orcl as sysdba
sqlplus sys@orcl as sysdba

Check that you logged in to the correct database

SQL> select name from v$database;
SQL> select instance from v$thread;
SQL> select * from v$instance;

SQL> @?/rdbms/admin/awrrpt.sql

save with HTML extension (may be not full report) or txt

SQL> @?/rdbms/admin/ashrpti.sql

html, Enter, ALL, 29-Dec-15 10:00:00, duration 60 min

Check current AWR snapshot settings

SQL>
select
   extract( day from snap_interval) *24*60+
   extract( hour from snap_interval) *60+
   extract( minute from snap_interval ) "Snapshot Interval",
   extract( day from retention) *24*60+
   extract( hour from retention) *60+
   extract( minute from retention ) "Retention Interval"
from 
   dba_hist_wr_control;	Snapshot Interval Retention Interval
	----------------- ------------------
	        60           11520
SQL> desc dba_hist_wr_control 	 Name                                          Null?    Type
 	----------------------------------------- -------- ----------------------------
 	 DBID                                   NOT NULL NUMBER
 	 SNAP_INTERVAL              NOT NULL INTERVAL DAY(5) TO SECOND(1)
	 RETENTION                      NOT NULL INTERVAL DAY(5) TO SECOND(1)
	 TOPNSQL                                      VARCHAR2(10)
SQL> select SNAP_INTERVAL from dba_hist_wr_control;

1 hour

 	 SNAP_INTERVAL
	--------------------------
	 +00000 01:00:00.0
SQL> select RETENTION from dba_hist_wr_control;

8 days (11520 sec)

 	 RETENTION
	--------------------------
	 +00008 00:00:00.0
SQL> 
set lines 200;
col SNAP_INTERVAL format a20;
col RETENTION format a20;
select * from dba_hist_wr_control;      	 DBID SNAP_INTERVAL RETENTION      TOPNSQL
	---------- -------------------- -------------------- ----------------------------------------
	 3870951505 +00000 01:00:00.0 +00008 00:00:00.0    DEFAULT
SQL> show parameter statistics_level 	 NAME                             TYPE          VALUE
	-------------------------- --------------- ------------------------------
	 statistics_level               string          TYPICAL
SQL> desc dbms_workload_repository

Set new AWR settings on the server

10 min, 8 days (11 520 sec)

SQL> exec dbms_workload_repository.modify_snapshot_settings(interval => 10, retention => 11520)

Newsletter

Enter your email to join our mailing list

Quick Contact