Guideline of SQL Tuning Advisor
1. Create a SQL Tuning Task
-----------------------------------------------
DECLARE
alan_task_name VARCHAR2(30);
alan_sqltext CLOB;
BEGIN
alan_sqltext := 'SELECT /*+ ORDERED */ * ' ||
'FROM employees e, locations l, departments d ' ||
'WHERE e.department_id = d.department_id AND ' ||
'l.location_id = d.location_id AND ' ||
'e.employee_id < :bnd';
alan_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
sql_text => alan_sqltext,
bind_list => sql_binds(anydata.ConvertNumber(100)),
user_name => 'irmadmin',
scope => 'COMPREHENSIVE',
time_limit => 60,
task_name => 'alan_sql_tuning_task',
description => 'Task to tune a query on ......');
END;
/
select task_name from dba_advisor_log where wner=''
2. Executing a SQL Tuning Task
-----------------------------------------------
exec dbms_sqltune.execute_tuning_task(task_name=>'alan_sql_tuning_task');
3. Checking the Status of a SQL Tuning Task
----------------------------------------------------------------
select status from user_advisor_tasks where task_name='alan_sql_tuning_task';
4. Checking the Progress of the SQL Tuning Advisor
-------------------------------------------------------------------------
select status from user_advisor_tasks where task_name='alan_sql_tuning_task';
5. Display the Result of a SQL Tuning Task
-----------------------------------------------------------
set long 1000
set longchunksize 1000
set linesize 100
select dbms_sqltune.report_tuning_task('alan_sql_tuning_task') from dual;
-----------------------------------------------
DECLARE
alan_task_name VARCHAR2(30);
alan_sqltext CLOB;
BEGIN
alan_sqltext := 'SELECT /*+ ORDERED */ * ' ||
'FROM employees e, locations l, departments d ' ||
'WHERE e.department_id = d.department_id AND ' ||
'l.location_id = d.location_id AND ' ||
'e.employee_id < :bnd';
alan_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
sql_text => alan_sqltext,
bind_list => sql_binds(anydata.ConvertNumber(100)),
user_name => 'irmadmin',
scope => 'COMPREHENSIVE',
time_limit => 60,
task_name => 'alan_sql_tuning_task',
description => 'Task to tune a query on ......');
END;
/
select task_name from dba_advisor_log where wner=''
2. Executing a SQL Tuning Task
-----------------------------------------------
exec dbms_sqltune.execute_tuning_task(task_name=>'alan_sql_tuning_task');
3. Checking the Status of a SQL Tuning Task
----------------------------------------------------------------
select status from user_advisor_tasks where task_name='alan_sql_tuning_task';
4. Checking the Progress of the SQL Tuning Advisor
-------------------------------------------------------------------------
select status from user_advisor_tasks where task_name='alan_sql_tuning_task';
5. Display the Result of a SQL Tuning Task
-----------------------------------------------------------
set long 1000
set longchunksize 1000
set linesize 100
select dbms_sqltune.report_tuning_task('alan_sql_tuning_task') from dual;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-545660/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL TUNING ADVISORSQL
- SQL Access Advisor 與SQL Tuning AdvisorSQL
- sql tuning set/sql tuning advisor(待完善)SQL
- SQL Access Advisor、SQL Tuning Advisor 測試SQL
- sql tuning advisor和sql access advisor區別SQL
- SQL Tuning Advisor簡介SQL
- 手工執行sql tuning advisor和sql access advisorSQL
- Sql Tuning Advisor 使用方法SQL
- 深入瞭解SQL Tuning AdvisorSQL
- SQL Tuning Advisor : dbms_sqltuneSQL
- SQL Tuning Advisor使用例項SQL
- 使用sql tuning advisor最佳化sqlSQL
- Oracle SQL優化之sql tuning advisorOracleSQL優化
- oracle實用sql(3)--sql tuning advisorOracleSQL
- sql tuning advisor(STA) 建議 建立sql profileSQL
- Oracle SQL優化之sql tuning advisor(STA)OracleSQL優化
- ORACLE SQL TUNING ADVISOR 使用方法OracleSQL
- oracle SQL最佳化器SQL Tuning Advisor (STA)OracleSQL
- Oracle SQL最佳化之sql tuning advisor(STA)OracleSQL
- Introduction to SQL Tuning Advisor zt自ITPUBSQL
- [原創]ORACLE SQL TUNING ADVISOR 使用方法OracleSQL
- Sql Tuning Advisor的大致過程測試!SQL
- Oracle 11 sql tuning advisor sql access advisor關閉以及job檢視與停止OracleSQL
- 使用SQL Profile及SQL Tuning Advisor固定執行計劃SQL
- Oracle優化案例-關閉auto space advisor和sql tuning advisor(十九)Oracle優化SQL
- 在EM中使用SQL Tuning Advisor(SQL優化建議)優化SQLSQL優化
- Oracle自帶工具sql優化集-SQL Tuning Advisor (使用心得體會)OracleSQL優化
- Oracle OCP 1Z0 053 Q253(SQL Tuning Advisor)OracleSQL
- Oracle OCP IZ0-053 Q46(SQL Tuning Advisor Limited)OracleSQLMIT
- 【kingsql分享】Oracle 10G強大的SQL優化工具:SQL Tuning AdvisorSQLOracle 10g優化
- Oracle OCP 1Z0 053 Q406(sql tuning advisor)OracleSQL
- Sql最佳化(二十二) 自動調優工具:sql tuning advisor和sql profile介紹SQL
- SQL Tuning Advisor報錯ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]SQLErrorOBJ
- [20130626]11GR2 SQL Tuning Advisor.txtSQL
- rac資料庫預設sql tuning advisor,導致大量library cache lock資料庫SQL
- Oracle OCP 1Z0 053 Q403(Automatic SQL Tuning Advisor task)OracleSQL
- sql tuningSQL
- Oracle OCP 1Z0 053 Q298(SQL Tuning Advisor&GATHER_STATS_JOB)OracleSQL