Skip to content

Commit 8812b1d

Browse files
authored
Create create-sts-from-awr.sql
1 parent d23434f commit 8812b1d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
REM Script: create-sts-from-awr.sql
2+
REM Load STS from AWR with SELECT_WORKLOAD_REPOSITORY and LOAD_SQLSET
3+
4+
-- first create a STS with create-sts.sql
5+
-- find snap ids with list-snapshots.sql
6+
-- load statements in the SQL Tuning Set and enter two snap ids
7+
8+
DECLARE
9+
cur dbms_sqltune.sqlset_cursor;
10+
BEGIN
11+
OPEN cur FOR
12+
SELECT VALUE(P)
13+
FROM dbms_sqltune.select_workload_repository(begin_snap=>&startid, end_snap=>&endid) P;
14+
dbms_sqltune.load_sqlset (sqlset_name => '&name', sqlset_owner=>'&schema', populate_cursor => cur);
15+
END;
16+
/

0 commit comments

Comments
 (0)