Databases Reference
In-Depth Information
from dba_sqlset_statements;
Here is some sample output:
SQLSET_NAME DISK_READS CPU_TIME ELAPSED_TIME BUFFER_GETS
------------------------------ ---------- ---------- ------------ -----------
IO_STS 3112941 3264960000 7805935285 2202432
IO_STS 2943527 3356460000 8930436466 1913415
IO_STS 2539642 2310610000 5869237421 1658465
IO_STS 1999373 2291230000 6143543429 1278601
IO_STS 1993973 2243180000 5461607976 1272271
IO_STS 1759096 1930320000 4855618689 1654252
Now use the DBMS_SQLTUNE.DELETE_SQLSET procedure to remove SQL statements from the STS based
on the specified criterion. This example removes SQL statements that have less than 2,000,000 disk reads
from the SQL tuning set named IO_STS :
BEGIN
DBMS_SQLTUNE.DELETE_SQLSET(
sqlset_name => 'MY_TUNING_SET'
,basic_filter => 'disk_reads < 2000000');
END;
/
Because the metrics/statistics are part of the STS, you can remove SQL statements from a SQL
tuning set based on characteristics of the associated metrics/statistics. You can use the
DBMS_SQLTUNE.DELETE_SQLSET procedure to remove statements from the STS based on statistics such as
elapsed_time , cpu_time , buffer_gets , disk_reads , and so on.
If you want to delete all SQL statements from a SQL tuning set, don't specify a filter.
SQL> exec DBMS_SQLTUNE.DELETE_SQLSET(sqlset_name => 'MY_TUNING_SET');
Tip You can also use Enterprise Manager to delete SQL statements. Navigate to the Performance tab, and then
click on SQL tuning sets. You should see a screen similar to Figure 9-3. Click on the SQL tuning set of interest and
selectively choose SQL statements that you want to remove.
Adding Statements to an Existing SQL Tuning Set
You can add SQL statements to an existing SQL tuning set. To do this, use the MERGE option of the
LOAD_SQLSET procedure. The MERGE option instructs Oracle to insert any new SQL statements that are
found, and if a SQL statement already exists in the tuning set, to update the execution statistics. Here's
an example:
DECLARE
cur dbms_sqltune.sqlset_cursor;
BEGIN
OPEN cur FOR
 
Search WWH ::




Custom Search