2026-03-12 20:23:15

This commit is contained in:
root
2026-03-12 21:23:47 +01:00
parent eab4b36eca
commit 93039b8489
3332 changed files with 699614 additions and 0 deletions

38
star/sqltt_sqlid.sql Normal file
View File

@@ -0,0 +1,38 @@
set serveroutput ON
variable max_secs NUMBER
begin
:max_secs:=to_number(&2)*60;
end;
/
variable c_tt refcursor
DECLARE
r CLOB;
t varchar2(30) := 'SQLTT_&1';
BEGIN
BEGIN
dbms_sqltune.drop_tuning_task(t);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
r := dbms_sqltune.create_tuning_task(task_name => t, sql_id => '&1', time_limit => :max_secs);
dbms_sqltune.execute_tuning_task(t);
open :c_tt for select dbms_sqltune.report_tuning_task(t) recommendations from dual;
if :c_tt is NULL then
begin
open :c_tt for select 'N/A' recommendations from dual;
end;
end if;
END;
/
print :c_tt