Skip to content

Commit f4953aa

Browse files
authored
Create reduce-sts.sql
1 parent 8812b1d commit f4953aa

File tree

1 file changed

+16
-0
lines changed
  • data-platform/core-converged-db/sql-tuning-sets/scripts-for-sts

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: reduce-sts.sql
2+
REM Use SELECT_SQLSET and LOAD_SQLSET
3+
4+
-- first create a new SQL Tuning Set with create-sts.sql
5+
-- enter values for ranking and limit criteria
6+
7+
DECLARE cur dbms_sqltune.sqlset_cursor;
8+
BEGIN
9+
OPEN cur FOR
10+
     SELECT VALUE (P)
11+
     FROM table(DBMS_SQLTUNE.SELECT_SQLSET(sqlset_name =>'&name_sts',
12+
  ranking_measure1 =>'ELAPSED_TIME', result_limit=>&limit)) P;
13+
  DBMS_SQLTUNE.LOAD_SQLSET(sqlset_name => '&name_reducedsts', populate_cursor => cur);
14+
CLOSE cur;
15+
END;
16+
/

0 commit comments

Comments
 (0)