我的编程空间,编程开发者的网络收藏夹
学习永远不晚

ORACLE SQL TUNING ADVISOR

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

ORACLE SQL TUNING ADVISOR

sql tunning advisor 使用的主要步骤:
1 建立tunning task
2 执行task
3 显示tunning 结果
4 根据建议来运行相应的调优方法 ----ADVISOR授权

1 基于SQL文本建立任务

FUNCTION create_tuning_task(
sql_text IN CLOB,
bind_list IN sql_binds := NULL,
user_name IN VARCHAR2 := NULL,
scope IN VARCHAR2 := SCOPE_COMPREHENSIVE,
time_limit IN NUMBER := TIME_LIMIT_DEFAULT,
task_name IN VARCHAR2 := NULL,
description IN VARCHAR2 := NULL)
RETURN VARCHAR2;

2 基于sql_id建立任务
FUNCTION create_tuning_task(
sql_id IN VARCHAR2,
plan_hash_value IN NUMBER := NULL,
scope IN VARCHAR2 := SCOPE_COMPREHENSIVE,
time_limit IN NUMBER := TIME_LIMIT_DEFAULT,
task_name IN VARCHAR2 := NULL,
description IN VARCHAR2 := NULL)
RETURN VARCHAR2;

3 基于AWR快照间隔以及相应SQL_ID建立任务
FUNCTION create_tuning_task(
begin_snap IN NUMBER,
end_snap IN NUMBER,
sql_id IN VARCHAR2,
plan_hash_value IN NUMBER := NULL,
scope IN VARCHAR2 := SCOPE_COMPREHENSIVE,
time_limit IN NUMBER := TIME_LIMIT_DEFAULT,
ask_name IN VARCHAR2 := NULL,
description IN VARCHAR2 := NULL)
RETURN VARCHAR2;

案例:
DECLARE
MY_TASK_NAME VARCHAR2(30);
MY_SQLTEXT CLOB;
BEGIN
MY_SQLTEXT :='SELECT 1 from dual';
MY_TASK_NAME := DBMS_SQLTUNE.CREATE_TUNING_TASK(SQL_TEXT => MY_SQLTEXT,
BIND_LIST=>SQL_BINDS(ANYDATA.CONVERTNUMBER(9)),
USER_NAME => 'NOAP',
SCOPE=>'COMPREHENSIVE',
TIME_LIMIT => 600,
TASK_NAME => 'SQL_TUNING_TEST',
DESCRIPTION=>'TUNING TASK'
);
END;

BEGIN DBMS_SQLTUNE.EXECUTE_TUNING_TASK('SQL_TUNING_TEST'); END;
SELECT status FROM USER_ADVISOR_TASKS WHERE task_name ='SQL_TUNING_TEST';
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK('SQL_TUNING_TEST') FROM DUAL;
BEGIN dbms_sqltune.drop_tuning_task('SQL_TUNING_TEST'); END;

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

ORACLE SQL TUNING ADVISOR

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

sql tuning advisor的使用方法是什么

SQL Tuning Advisor是Oracle Database提供的一个工具,用于提高SQL查询的性能。通过分析SQL语句的执行计划和访问路径,SQL Tuning Advisor可以提供优化建议,帮助用户改进SQL查询性能。使用S
sql tuning advisor的使用方法是什么
2024-04-19
2024-04-02

ORA-19387: “SQL Tuning Set” “string” belongs to another tuning task ORACLE 报

文档解释ORA-19387: SQL Tuning Set string belongs to another tuning taskCause: The user attempted to tune a task-managed
ORA-19387: “SQL Tuning Set” “string” belongs to another tuning task ORACLE 报
2023-11-05

ORA-13802: failed to purge SQL Tuning Base entry from sql$ ORACLE 报错 故障修复 远程处理

文档解释ORA-13802: failed to purge SQL Tuning Base entry from sql$Cause: An error occured while try to delete a SQL Tuning
ORA-13802: failed to purge SQL Tuning Base entry from sql$ ORACLE 报错 故障修复 远程处理
2023-11-05

SQL Tuning Health-Check Script (SQLHC) (文档 ID 1366133.1)

Login to the database server and set the environment used by the Database InstanceDownload the "sqlhc.zip" archive file and extrac
SQL Tuning Health-Check Script (SQLHC) (文档 ID 1366133.1)
2018-01-16

ORA-15703: invalid version number “number” for SQL tuning set staging table ORACLE 报错 故障

文档解释ORA-15703: invalid version number number for SQL tuning set staging tableCause: An invalid version number was
ORA-15703: invalid version number “number” for SQL tuning set staging table ORACLE 报错 故障
2023-11-05

ORA-13755: invalid “SQL Tuning Set” name ORACLE 报错 故障修复 远程处理

文档解释ORA-13755: invalid SQL Tuning Set nameCause: The user attempted to specify a SQL Tuning Set name that is invalid.
ORA-13755: invalid “SQL Tuning Set” name ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-13771: cannot obtain exclusive lock string on “SQL Tuning Set” “string”

文档解释ORA-13771: cannot obtain exclusive lock string on SQL Tuning Set string owned by user stringCause: Unexpected
ORA-13771: cannot obtain exclusive lock string on “SQL Tuning Set” “string”
2023-11-05

ORA-13772: unexpected deadlock on “SQL Tuning Set” “string” owned by user &#

文档解释ORA-13772: unexpected deadlock on SQL Tuning Set string owned by user stringCause: Unexpected error from
ORA-13772: unexpected deadlock on “SQL Tuning Set” “string” owned by user &#
2023-11-05

ORA-19388: operation not supported for “SQL Tuning Set” type ORACLE 报错 故障修复 远程处理

文档解释ORA-19388: operation not supported for SQL Tuning Set typeCause: The attempted operation was unsupported for the
ORA-19388: operation not supported for “SQL Tuning Set” type ORACLE 报错 故障修复 远程处理
2023-11-05

ORA-13754: “SQL Tuning Set” “string” does not exist for user “string&#

文档解释ORA-13754: SQL Tuning Set string does not exist for user string.Cause: The user attempted to access a SQL
ORA-13754: “SQL Tuning Set” “string” does not exist for user “string&#
2023-11-05

ORA-13778: no new name or owner specified for “SQL Tuning Set” ORACLE 报错 故障修复 远程处理

文档解释ORA-13778: no new name or owner specified for SQL Tuning SetCause: The user attempted to call remap_stgtab_sqlset
ORA-13778: no new name or owner specified for “SQL Tuning Set” ORACLE 报错 故障修复 远程处理
2023-11-04

ORA-13786: missing SQL text of statement object “string” for tuning task “string&#

文档解释ORA-13786: missing SQL text of statement object string for tuning task stringCause: The user attempted to
ORA-13786: missing SQL text of statement object “string” for tuning task “string&#
2023-11-05

ORA-13787: missing SQL profile for statement object “string” for tuning task “stri

文档解释ORA-13787: missing SQL profile for statement object string for tuning task stringCause: The user attempted to
ORA-13787: missing SQL profile for statement object “string” for tuning task “stri
2023-11-05

编程热搜

目录