参考https://docs.oracle.com/database/121/ARPLS/d_advis.htm#ARPLS65141
及https://oracle-base.com/articles/10g/sql-access-advisor-10g
DECLARE
task_name VARCHAR2(30);
BEGIN
task_name := 'My Task1';
DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR, task_name,'select a.id,a.name,b.id,b.name from test.bigtable a,test.smalltable b where a.id=b.id and a.id=40000');
END;
/
SET LONG 100000
SET PAGESIZE 50000
SELECT DBMS_ADVISOR.get_task_script('My Task1') AS script FROM dual;
SET PAGESIZE 24