千家信息网

oracle自带工具(自动优化sql小助手)

发表于:2025-01-22 作者:千家信息网编辑
千家信息网最后更新 2025年01月22日,1.drop tuning task if task exists (删除之前的优化任务,如果存在的话)sqlplus / as sysdbaexec DBMS_SQLTUNE.DROP_TUNING
千家信息网最后更新 2025年01月22日oracle自带工具(自动优化sql小助手)

1.drop tuning task if task exists (删除之前的优化任务,如果存在的话)

sqlplus / as sysdba

exec DBMS_SQLTUNE.DROP_TUNING_TASK('zhangx_tune_taks'); <

2.create tuning task ,please replace sql_id 8gn0a9gxnc125 with yours. 创建一个新的sql优化任务, DECLARE tune_task VARCHAR2(30); BEGIN tune_task:=DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id=>'8gn0a9gxnc125',task_name=>'zhangx_tune_taks',time_limit => 600,description=>'ProvideSQLID');

END;

/

3.exec tuning task BEGIN DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'zhangx_tune_taks' ); END;

/

4.check tuning finding set lines 999 set long 100000 set longchunksize 100000 select dbms_sqltune.report_tuning_task('zhangxiong_tune_taks') from dual;
0