Tuning Set Name : Test_TOP_SQL_1503437315950
select name from dba_sqlset;
select * from dba_sqlset where name like 'Test%';
Dropping SQL Task
select name from dba_sqlset;
execute dbms_sqltune.drop_sqlset('Test_TOP_SQL_1503437315950');
You could get an error, if it is reference to advisory task
Get advisory task name
select description, created, owner from DBA_SQLSET_REFERENCES where sqlset_name = 'Test_TOP_SQL_1503437315950';
task: SQL_TUNING_1503437363054
select owner,description, created,last_modified from DBA_ADVISOR_TASKS where task_name = 'SQL_TUNING_1503437363054';
execute dbms_sqltune.drop_tuning_task('SQL_TUNING_1503437363054');
execute DBMS_SQLTUNE.drop_sqlset (sqlset_name => 'Test_TOP_SQL_1503437315950');
If you can't drop SQL Set then check whether record exist in work load repository or not
SELECT count(*) FROM wri$_sqlset_definitions a, wri$_sqlset_references b WHERE a.name = 'Test_TOP_SQL_1503437315950' AND b.sqlset_id = d.id;
Delete row
delete from wri$_sqlset_references where sqlset_id in (select id from wri$_sqlset_definitions where name in ('Test_TOP_SQL_1503437315950'));
commit;
execute DBMS_SQLTUNE.drop_sqlset (sqlset_name => 'Test_TOP_SQL_1503437315950');
select name from dba_sqlset;
select * from dba_sqlset where name like 'Test%';
Dropping SQL Task
select name from dba_sqlset;
execute dbms_sqltune.drop_sqlset('Test_TOP_SQL_1503437315950');
You could get an error, if it is reference to advisory task
Get advisory task name
select description, created, owner from DBA_SQLSET_REFERENCES where sqlset_name = 'Test_TOP_SQL_1503437315950';
task: SQL_TUNING_1503437363054
select owner,description, created,last_modified from DBA_ADVISOR_TASKS where task_name = 'SQL_TUNING_1503437363054';
execute dbms_sqltune.drop_tuning_task('SQL_TUNING_1503437363054');
execute DBMS_SQLTUNE.drop_sqlset (sqlset_name => 'Test_TOP_SQL_1503437315950');
If you can't drop SQL Set then check whether record exist in work load repository or not
SELECT count(*) FROM wri$_sqlset_definitions a, wri$_sqlset_references b WHERE a.name = 'Test_TOP_SQL_1503437315950' AND b.sqlset_id = d.id;
Delete row
delete from wri$_sqlset_references where sqlset_id in (select id from wri$_sqlset_definitions where name in ('Test_TOP_SQL_1503437315950'));
commit;
execute DBMS_SQLTUNE.drop_sqlset (sqlset_name => 'Test_TOP_SQL_1503437315950');
Comments
Post a Comment