0% found this document useful (0 votes)
261 views

Oracle AWR Automatic Workload Repository Grid DBMS - WORKLOAD - REPOSITORY

This document provides documentation on the Oracle DBMS_WORKLOAD_REPOSITORY package including details on various functions and objects related to Automatic Workload Repository (AWR) and Active Session History (ASH).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
261 views

Oracle AWR Automatic Workload Repository Grid DBMS - WORKLOAD - REPOSITORY

This document provides documentation on the Oracle DBMS_WORKLOAD_REPOSITORY package including details on various functions and objects related to Automatic Workload Repository (AWR) and Active Session History (ASH).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS...

Pgina 1 de 10

PSOUG Home

PSOUG Home

Code Snippets

Oracle Lookup

Oracle Reference

Oracle Error Codes

Oracle Functions

CODE

JOBS

FORUM

Oracle Code Library

Find Or Post Oracle Jobs

Oracle Discussion & Chat

Code Snippets

Oracle Reference
0

Oracle Functions

PSOUG Forum

PSOUG Forum

Oracle Blogs

Search

Search the Reference Library pages:

Oracle DBMS_WORKLOAD_REPOSITORY
Version 11.1
AWR Objects
Source

{ORACLE_HOME}/rdbms/admin/dbmsawr.sql

First Availability

10.1

Background Process

MMON - Automatic data purging every 7 days by default


Name

Constants

MAX_INTERVAL
MIN_INTERVAL
MAX_RETENTION
MIN_RETENTION

Retention

Data Type

Value

100 years
10 minutes
100 years
1 day

NUMBER
NUMBER
NUMBER
NUMBER

52560000
10
52560000
1440

Data Types

AWRRPT_TEXT_TYPE
AWRRPT_HTML_TYPE
AWRRPT_TEXT_TYPE_TABLE
AWRRPT_HTML_TYPE_TABLE
SYS AWRRPT_ROW_TYPE

Dependencies

dba_hist_baseline
awrrpt_html_type
awrrpt_html_type_table
awrrpt_text_type
awrrpt_type_table
dbms_swrf_lib
dbms_swrf_report_internal

dba_hist_snapshot
plitblm
wrm$_baseline
wrm$_snapshot
wrm$_snap_error
wrm$_wr_control

{ORACLE_HOME}/rdbms/admin/catawr.sql
{ORACLE_HOME}/rdbms/admin/catawrpd.sql
File that create the AWR schema {ORACLE_HOME}/rdbms/admin/catawrtb.sql
{ORACLE_HOME}/rdbms/admin/catawrwv.sql
-- must be run as SYSDBA
Free
ADD_COLORED_SQL (new 11.1.0.6)
Oracle
dbms_workload_repository.add_colored_sql(
Magazine
Subscriptions Routine to add a colored SQL ID. sql_id IN VARCHAR2,
and Oracle If an SQL ID is colored, it will
dbid
IN NUMBER DEFAULT NULL);
White Papers always be captured in every
snapshot, independent of its level desc wrm$_colored_sql
of activities (i.e. does not have to
be a TOP SQL). Capturing will
SELECT * FROM wrm$_colored_sql;
occur if the SQL is found in the
cursor cache at snapshot time.

SELECT dbid
FROM v$database;

SELECT sql_id
FROM gv$sql
WHERE rownum < 101;
exec dbms_workload_repository.add_colored_sql('5rygsj4dbw6jt',
1692970157);
SELECT * FROM wrm$_colored_sql;
ASH_REPORT_HTML (new 11.1.0.6)
dbms_workload_repository.ash_report_html(
Display the ASH report in HTML l_dbid
IN NUMBER,
l_inst_num
IN NUMBER,
l_btime
IN DATE,
l_etime
IN DATE,
l_options
IN NUMBER DEFAULT 0,
l_slot_width
IN NUMBER DEFAULT 0,
l_sid
IN NUMBER DEFAULT NULL,

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 2 de 10

Code Snippets

l_sql_id
IN VARCHAR2
DEFAULT
Oracle Lookup
Oracle Reference
Oracle Error
Codes

NULL,
Oracle Functions

PSOUG Forum

l_service_hash IN NUMBER DEFAULT NULL,


l_module
IN VARCHAR2 DEFAULT NULL,
l_action
IN VARCHAR2 DEFAULT NULL,
l_client_id
IN VARCHAR2 DEFAULT NULL,
l_plsql_entry IN VARCHAR2 DEFAULT NULL)
RETURN awrrpt_html_type_table PIPELINED;
SELECT dbid
FROM v$database;
SELECT inst_id
FROM gv$instance;
SELECT sample_time
FROM gv$active_session_history
ORDER BY 1;
set pagesize 0
set linesize 121
spool c: emp\ash_rpt.html
SELECT * FROM TABLE(dbms_workload_repository.ash_report_html
(1692970157, 1, SYSDATE-30/1440, SYSDATE-1/1440));
spool off
Alternative ASH HTML Report

Alternative ASH HTML Report

define report_type = 'html';


define begin_time = '-30'
define duration = '';
define report_name = 'c: emp\ashrpt.html';
@?/rdbms/admin/ashrpt
define report_type = 'html';
define begin_time = '-30'
define duration = '';
define report_name = 'c: emp\ashrpt.html';
@?/rdbms/admin/ashrpti

ASH_REPORT_TEXT (new 11.1.0.6)


dbms_workload_repository.ash_report_text(
Display the ASH report in TEXT l_dbid
IN NUMBER,
l_inst_num
IN NUMBER,
l_btime
IN DATE,
l_etime
IN DATE,
l_options
IN NUMBER DEFAULT 0,
l_slot_width
IN NUMBER DEFAULT 0,
l_sid
IN NUMBER DEFAULT NULL,
l_sql_id
IN VARCHAR2 DEFAULT NULL,
l_wait_class
IN VARCHAR2 DEFAULT NULL,
l_service_hash IN NUMBER DEFAULT NULL,
l_module
IN VARCHAR2 DEFAULT NULL,
l_action
IN VARCHAR2 DEFAULT NULL,
l_client_id
IN VARCHAR2 DEFAULT NULL,
l_plsql_entry IN VARCHAR2 DEFAULT NULL)
RETURN awrrpt_text_type_table PIPELINED;
SELECT dbid
FROM v$database;
SELECT inst_id
FROM gv$instance;
SELECT sample_time
FROM gv$active_session_history
ORDER BY 1;
set pagesize 0
set linesize 121
spool c: emp\ash_rpt.html
SELECT * FROM TABLE(dbms_workload_repository.ash_report_text
(1692970157, 1, SYSDATE-30/1440, SYSDATE-1/1440));
spool off
Alternative ASH Text Report

define report_type = 'text';


define begin_time = '-30'
define duration = '';
define report_name = 'c: emp\ashrpt.txt';
@?/rdbms/admin/ashrpt

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 3 de 10

PSOUG Home

Code Snippets

define Oracle
report_type
Oracle Lookup
Reference

Alternative ASH Text Report

= Oracle
'text';
Error Codes
Oracle Functions
define begin_time = '-30'
define duration = '';
define report_name = 'c: emp\ashrpt.txt';
@?/rdbms/admin/ashrpti

PSOUG Forum

AWR_DIFF_REPORT_HTML (new 11.1.0.6)


dbms_workload_repository.awr_diff_report_html(
This table function displays the
dbid1
IN NUMBER,
AWR Compare Periods Report in
inst_num1 IN NUMBER,
HTML format. The output
bid1
IN NUMBER,
is one column of VARCHAR2
eid1
IN NUMBER,
(5000).
dbid2
IN NUMBER,
inst_num2 IN NUMBER,
bid2
IN NUMBER,
eid2
IN NUMBER)
RETURN awrrpt_html_type_table PIPELINED;
TBD
AWR_DIFF_REPORT_TEXT (new 11.1.0.6)
dbms_workload_repository.awr_diff_report_text(
This table function displays the
awr_diff_report_text(dbid1 IN NUMBER,
AWR Compare Periods Report in
inst_num1 IN NUMBER,
TEXT format. The output
bid1
IN NUMBER,
is one column of VARCHAR2
eid1
IN NUMBER,
(240).
dbid2
IN NUMBER,
inst_num2 IN NUMBER,
bid2
IN NUMBER,
eid2
IN NUMBER)
RETURN awrdrpt_text_type_table PIPELINED;
TBD
AWR_REPORT_HTML
Display the AWR report in HTML

dbms_workload_repository.awr_report_html(
l_dbid
IN NUMBER,
l_inst_num IN NUMBER,
l_bid
IN NUMBER,
l_eid
IN NUMBER,
l_options IN NUMBER DEFAULT 0)
RETURN awrrpt_text_type_table PIPELINED;
awrrpt_text_type_table is VARCHAR2(150)
See AWR Report demo linked at the bottom of the page

AWR_REPORT_TEXT
Display the AWR report in ASCII
text

dbms_workload_repository.awr_report_text(
l_dbid
IN NUMBER,
l_inst_num IN NUMBER,
l_bid
IN NUMBER,
l_eid
IN NUMBER,
l_options IN NUMBER DEFAULT 0)
RETURN awrrpt_text_type_table PIPELINED;
awrrpt_text_type_table is VARCHAR2(80)
See AWR Report demo linked at the bottom of the page

AWR_SQL_REPORT_HTML (new 11.1.0.6)


dbms_workload_repository.awr_sql_report_html(
Display the AWR SQL report in
l_dbid
IN NUMBER,
HTML
l_inst_num IN NUMBER,
l_bid
IN NUMBER,
l_eid
IN NUMBER,
l_sqlid
IN VARCHAR2,
l_options IN NUMBER DEFAULT 0)
RETURN awrrpt_html_type_table PIPELINED;
SELECT dbid
FROM v$database;
SELECT inst_id
FROM gv$instance;
set
set
col
col
col

pagesize 0
linesize 121
instart_fmt noprint;
inst_name format a12 heading 'Instance';
db_name format a12 heading 'DB Name';

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 4 de 10

PSOUG Home

Code Snippets

col
Oracle Lookup

snap_id
format 99999990
heading
'Snap
Id';
Oracle Reference
Oracle Error
Codes
Oracle Functions
PSOUG Forum
col snapdat format a18 heading 'Snap Started' just c;
col lvl format 99 heading 'Snap|Level';
set heading on;
break on inst_name on db_name on host on instart_fmt skip 1;
ttitle off;
SELECT TO_CHAR(s.startup_time,' DD MON "at" HH24:MI:SS')
INSTART_FMT,
di.instance_name INST_NAME, di.db_name DB_NAME, s.snap_id
SNAP_ID,
TO_CHAR(s.end_interval_time,'DD MON YYYY HH24:MI') SNAPDAT,
s.snap_level LVL
FROM dba_hist_snapshot s, dba_hist_database_instance di
WHERE di.dbid = s.dbid
AND di.instance_number = s.instance_number
AND di.startup_time = s.startup_time
ORDER BY snap_id;
SELECT sql_id
FROM gv$active_session_history
WHERE TRUNC(sql_exec_start) = TRUNC(SYSDATE);
spool c: emp\awr_sql_rpt.html
SELECT * FROM TABLE
(dbms_workload_repository.awr_sql_report_html(1692970157, 1,
1230, 1231, 'a01hp0psv0rrh'));
spool off

AWR_SQL_REPORT_TEXT (new 11.1.0.6)


dbms_workload_repository.awr_sql_report_text(
Display the AWR SQL report in
l_dbid
IN NUMBER,
TEXT
l_inst_num IN NUMBER,
l_bid
IN NUMBER,
l_eid
IN NUMBER,
l_sqlid
IN VARCHAR2,
l_options IN NUMBER DEFAULT 0)
RETURN awrsqrpt_text_type_table PIPELINED;
SELECT dbid
FROM v$database;
SELECT inst_id
FROM gv$instance;
set pagesize 0
set linesize 121
col instart_fmt noprint;
col inst_name format a12 heading 'Instance';
col db_name format a12 heading 'DB Name';
col snap_id format 99999990 heading 'Snap Id';
col snapdat format a18 heading 'Snap Started' just c;
col lvl format 99 heading 'Snap|Level';
set heading on;
break on inst_name on db_name on host on instart_fmt skip 1;
ttitle off;
SELECT TO_CHAR(s.startup_time,' DD MON "at" HH24:MI:SS')
INSTART_FMT,
di.instance_name INST_NAME, di.db_name DB_NAME, s.snap_id
SNAP_ID,
TO_CHAR(s.end_interval_time,'DD MON YYYY HH24:MI') SNAPDAT,
s.snap_level LVL
FROM dba_hist_snapshot s, dba_hist_database_instance di
WHERE di.dbid = s.dbid
AND di.instance_number = s.instance_number
AND di.startup_time = s.startup_time
ORDER BY snap_id;
SELECT sql_id
FROM gv$active_session_history
WHERE TRUNC(sql_exec_start) = TRUNC(SYSDATE);
spool c: emp\awr_sql_rpt.txt
SELECT * FROM TABLE
(dbms_workload_repository.awr_sql_report_text(1692970157, 1,
1230, 1231, 'a01hp0psv0rrh'));
spool off

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 5 de 10

PSOUG Home

Code Snippets

Oracle Lookup

Oracle Reference

Oracle Error Codes

Oracle Functions

PSOUG Forum

CONTROL_RESTRICTED_SNAPSHOT (new 11.1.0.7)


Controls if AWR snapshots are
dbms_workload_repository.control_restricted_snapshot(allow IN
allowed to occur even if the
BOOLEAN);
restricted session mode has been
enabled for the database. TRUE
allows snapshot capture in
restricted session mode.

BEGIN
dbms_workload_repository.control_restricted_snapshot(TRUE);
END;
/

CREATE_BASELINE (new 11g parameter)


dbms_workload_repository.create_baseline(
Creates a baseline returns the
start_snap_id IN NUMBER,
baseline_id
end_snap_id
IN NUMBER,
baseline_name IN VARCHAR2,
Overload 1
dbid
IN NUMBER DEFAULT NULL,
expiration
IN NUMBER DEFAULT NULL)
RETURN NUMBER;
SELECT dbid
FROM v$database;
set linesize 121
col startup_time format a40
SELECT snap_id, startup_time
FROM dba_hist_snapshot
ORDER BY 1,2;
SELECT baseline_name, dbid
FROM dba_hist_baseline;
set serveroutput on
DECLARE
i dba_hist_baseline.baseline_id%TYPE;
BEGIN
i := dbms_workload_repository.create_baseline(1199, 1207,
'UW_BASE', 1692970157);
dbms_output.put_line(TO_CHAR(i));
END;
/
SELECT baseline_id, baseline_name
FROM dba_hist_baseline;
Overload 2

dbms_workload_repository.create_baseline(
start_snap_id IN NUMBER,
end_snap_id
IN NUMBER,
baseline_name IN VARCHAR2,
dbid
IN NUMBER DEFAULT NULL
expiration
IN NUMBER DEFAULT NULL);
SELECT dbid
FROM v$database;
SELECT snap_id, startup_time
FROM dba_hist_snapshot
ORDER BY 1,2;
SELECT baseline_name, dbid
FROM dba_hist_baseline;
exec dbms_workload_repository.create_baseline(1199, 1207,
'UW_BASE', 1692970157);
SELECT baseline_name, dbid
FROM dba_hist_baseline;

CREATE_BASELINE_TEMPLATE (new 11.1.0.6)


dbms_workload_repository.create_baseline_template(
Creates a Baseline Template for start_time
IN DATE,
a
end_time
IN DATE,
single time period. There will be a
baseline_name IN VARCHAR2,
MMON task that will use these
inputs to create a Baseline for the template_name IN VARCHAR2,
time period when the time comes. expiration
IN NUMBER DEFAULT NULL,
dbid
IN NUMBER DEFAULT NULL);
Overload 1

desc dba_hist_baseline_template
SELECT dbid, template_id, template_name, template_type
FROM dba_hist_baseline_template;

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 6 de 10

PSOUG Home

Code Snippets

SELECT Oracle
baseline_name,
dbidError Codes
Oracle Lookup
Reference
Oracle

Oracle Functions

PSOUG Forum

FROM dba_hist_baseline;
exec dbms_workload_repository.create_baseline_template
(SYSDATE+1/1440, SYSDATE+5/1440, 'UW_BASE2', 'UW_TEMPLATE', 1);
SELECT dbid, template_id, template_name, template_type
FROM dba_hist_baseline_template;
Overload 2

dbms_workload_repository.create_baseline_template(
day_of_week
IN VARCHAR2,
hour_in_day
IN NUMBER,
duration
IN NUMBER,
start_time
IN DATE,
end_time
IN DATE,
baseline_name_prefix IN VARCHAR2,
template_name
IN VARCHAR2,
expiration
IN NUMBER DEFAULT 35,
dbid
IN NUMBER DEFAULT NULL);
TBD

CREATE_SNAPSHOT
Create snapshot and return
snapshot ID
Overload 1

dbms_workload_repository.create_snapshot(
flush_level IN VARCHAR2 DEFAULT 'TYPICAL') RETURN NUMBER;
Flush Levels
ALL
TYPICAL

set linesize 121


col begin_interval_time format a30
col end_interval_time format a30
SELECT snap_id, startup_time, begin_interval_time,
end_interval_time
FROM dba_hist_snapshot
ORDER BY 1,2;
set serveroutput on
DECLARE
i dba_hist_snapshot.snap_id%TYPE;
BEGIN
i := dbms_workload_repository.create_snapshot;
dbms_output.put_line(TO_CHAR(i));
END;
/
SELECT snap_id, startup_time, begin_interval_time,
end_interval_time
FROM dba_hist_snapshot
ORDER BY 1,2;
Overload 2

dbms_workload_repository.create_snapshot(
flush_level IN VARCHAR2 DEFAULT 'TYPICAL');
Flush Levels
ALL
TYPICAL

set linesize 121


col begin_interval_time format a30
col end_interval_time format a30
SELECT snap_id, startup_time, begin_interval_time,
end_interval_time
FROM dba_hist_snapshot
ORDER BY 1,2;
exec dbms_workload_repository.create_snapshot;
SELECT snap_id, startup_time, begin_interval_time,
end_interval_time
FROM dba_hist_snapshot
ORDER BY 1,2;
DROP_BASELINE
Drop a baseline

dbms_workload_repository.drop_baseline(
baseline_name IN VARCHAR2,
cascade
IN BOOLEAN DEFAULT FALSE,
dbid
IN NUMBER DEFAULT NULL);
Cascade

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 7 de 10

PSOUG Home

Code Snippets

False Drop
baseline
but not snapshots
Oracle Lookup
Oracle
Reference
Oracle Error Codes
True

Oracle Functions

PSOUG Forum

Drops baseline and snapshots

SELECT baseline_name, dbid


FROM dba_hist_baseline;
exec dbms_workload_repository.drop_baseline('UW_BASE', FALSE,
1692970157);
SELECT baseline_name, dbid
FROM dba_hist_baseline;
DROP_BASELINE_TEMPLATE (new 11g)
dbms_workload_repository.drop_baseline_template(
Drops a Baseline Template
template_name IN VARCHAR2,
dbid
IN NUMBER DEFAULT NULL);
SELECT dbid, template_id, template_name, template_type
FROM dba_hist_baseline_template;
exec dbms_workload_repository.drop_baseline_template
('UW_TEMPLATE');
SELECT dbid, template_id, template_name, template_type
FROM dba_hist_baseline_template;
DROP_SNAPSHOT_RANGE
dbms_workload_repository.drop_snapshot_Range(
Drop a range of snapshots
low_snap_id IN NUMBER,
high_snap_id IN NUMBER
dbid
IN NUMBER DEFAULT NULL);
set linesize 121
col startup_time format a40
SELECT snap_id, startup_time
FROM dba_hist_snapshot
ORDER BY 1,2;
exec dbms_workload_repository.drop_snapshot_range(1105, 1199);
SELECT snap_id, startup_time
FROM dba_hist_snapshot
ORDER BY 1,2;
MODIFY_BASELINE_WINDOW_SIZE (new 11g)
dbms_workload_repository.modify_baseline_window_size(
Modifies the window size for the window_size IN NUMBER,
default moving window baseline
dbid
IN NUMBER DEFAULT NULL );
Installation default is 8 days

set linesize 121


col baseline_name format a30
SELECT dbid, baseline_name, baseline_type, moving_window_size
FROM dba_hist_baseline;
exec dbms_workload_repository.modify_baseline_window_size(5);
SELECT dbid, baseline_name, baseline_type, moving_window_size
FROM dba_hist_baseline;
exec dbms_workload_repository.modify_baseline_window_size(8);

MODIFY_SNAPSHOT_SETTINGS
dbms_workload_repository.modify_snapshot_settings(
Modifies the interval between
retention IN NUMBER DEFAULT NULL,
snapshots and/or the retention of
interval IN NUMBER DEFAULT NULL,
snapshots in the repository
topnsql
IN NUMBER DEFAULT NULL,
dbid
IN NUMBER DEFAULT NULL);
Overload 1
Note: Some of this functionality
also exists in
DBMS_MANAGEMENT_PACKS
MODIFY_AWR_SETTINGS proc

Defaults
Retention 7 days = 10080 minutes
60 minutes *
Interval
* Reset to 15-30 min. maximum between snapshots

set linesize 121


col retention format a20
col snap_interval format a20
SELECT retention, snap_interval, topnsql
FROM wrm$_wr_control;

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 8 de 10

PSOUG Home

Code Snippets

SELECT Oracle
dbid Reference
Oracle Lookup

Oracle Error Codes

Oracle Functions

PSOUG Forum

FROM v$database;
exec dbms_workload_repository.modify_snapshot_settings(14400,
20, 1000, 1701481905);
SELECT retention, snap_interval, topnsql
FROM wrm$_wr_control;
Overload 2

dbms_workload_repository.modify_snapshot_settings(
retention IN NUMBER
DEFAULT NULL,
interval IN NUMBER
DEFAULT NULL,
topnsql
IN VARCHAR2 DEFAULT NULL,
dbid
IN NUMBER
DEFAULT NULL);
Defaults
Retention 7 days = 10080 minutes
Interval
60 minutes *
* Reset to 15-30 min. maximum between snapshots

set linesize 121


col retention format a20
col snap_interval format a20
SELECT retention, snap_interval, topnsql
FROM wrm$_wr_control;
SELECT dbid
FROM v$database;
exec dbms_workload_repository.modify_snapshot_settings(14400,
20, '1001', 1701481905);
SELECT retention, snap_interval, topnsql
FROM wrm$_wr_control;
REMOVE_COLORED_SQL (new 11g)
dbms_workload_repository.remove_colored_sql(
Routine to remove a colored SQL sql_id IN VARCHAR2,
ID. If an SQL ID is colored, it will
dbid
IN NUMBER DEFAULT NULL );
always be captured in every
snapshot, independent of its level
of activities (i.e. does not have to
be a TOP SQL).

desc wrm$_colored_sql
SELECT * FROM wrm$_colored_sql;
exec dbms_workload_repository.remove_colored_sql
('5rygsj4dbw6jt', 1692970157);
SELECT * FROM wrm$_colored_sql;

RENAME_BASELINE (new 11g)


dbms_workload_repository.rename_baseline(
Rename a baseline
old_baseline_name IN VARCHAR2,
new_baseline_name IN VARCHAR2,
dbid
IN NUMBER DEFAULT NULL);
SELECT dbid, baseline_name, baseline_type
FROM dba_hist_baseline;
exec dbms_workload_repository.rename_baseline('UW_BASE',
'UW_BASE2');
SELECT dbid, baseline_name, baseline_type
FROM dba_hist_baseline;
exec dbms_workload_repository.rename_baseline('UW_BASE',
'UW_BASE');
SELECT_BASELINE_DETAILS (new 11g)
dbms_workload_repository.select_baseline_metrics(
Display baseline statistics
l_baseline_id IN NUMBER,
l_beg_snap IN NUMBER DEFAULT NULL,
l_end_snap IN NUMBER DEFAULT NULL,
l_dbid
IN NUMBER DEFAULT NULL)
RETURN awrbl_details_type_table PIPELINED;
SELECT dbid, baseline_id, baseline_name, baseline_type
FROM dba_hist_baseline;
set linesize 121
col start_snap_time format a30
col end_snap_time format a30
SELECT *

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REPOS... Pgina 9 de 10

PSOUG Home

Code Snippets

FROM
Oracle Lookup

TABLE(dbms_workload_repository.select_baseline_details
Oracle Reference
Oracle Error Codes
Oracle Functions
PSOUG Forum

(1));
SELECT_BASELINE_METRIC (new 11g)
dbms_workload_repository.select_baseline_metric(
Display metric stats for a baseline l_baseline_name IN VARCHAR2,
l_dbid
IN NUMBER DEFAULT NULL,
l_instance_num IN NUMBER DEFAULT NULL)
RETURN awrbl_metric_type_table PIPELINED;
SELECT dbid, baseline_id, baseline_name, baseline_type
FROM dba_hist_baseline;
set pagesize 0
set linesize 121
SELECT *
FROM TABLE(dbms_workload_repository.select_baseline_metric(0));
Related Topics
AWR Report
Home

Code Library

Sponsors

Privacy

Terms of Use

http://psoug.org/reference/dbms_wrkld_repos.html

Contact Us

[95 users online]

2010 psoug.org

09/12/2015

Oracle AWR Automatic Workload Repository Grid DBMS_WORKLOAD_REP... Pgina 10 de 10

http://psoug.org/reference/dbms_wrkld_repos.html

09/12/2015

You might also like