博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle OCP 1Z0-050(26题)解析
阅读量:4040 次
发布时间:2019-05-24

本文共 2405 字,大约阅读时间需要 8 分钟。

Oracle OCP 1Z0-050(26题)解析

QUESTION 26:

Evaluate the following code:

SQL>VARIABLE task_name VARCHAR2(255);

SQL>VARIABLE sql_stmt VARCHAR2(4000);

SQL>BEGIN

:sql_stmt := 'SELECT COUNT(*) FROM customers

WHERE cust_state_province =''CA''';

:task_name := 'MY_QUICKTUNE_TASK';

DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQL ACCESS_ADVISOR, :task_name, :sql_stmt);

END;

What is the outcome of this block of code?

A. It creates a task and workload but does not execute the task.

B. It produces an error because the SQL Tuning Set has not been created.

C. It produces an error because a template has not been created.

D. It creates a task and workload, and executes the task.

Answer: D

解析:

参考Oracle官方文档:

 

Using SQL Access Advisor in Enterprise Manager or API, you can do the following:

  • Recommend materialized views and indexes based on collected, user-supplied, or hypothetical workload information.

  • Recommend partitioning of tables, indexes, and materialized views.

  • Mark, update, and remove recommendations.

In addition, you can use SQL Access Advisor API to do the following:

  • Perform a quick tune using a single SQL statement.

  • Show how to make a materialized view fast refreshable.

  • Show how to change a materialized view so that general query rewrite is possible.

 

To tune a single SQL statement, the QUICK_TUNE procedure accepts as its input a task_name and a SQL statement. The procedure creates a task and workload and executes this task. There is no difference in the results from using QUICK_TUNE. They are exactly the same as those from using EXECUTE_TASK, but this approach is easier to use when there is only a single SQL statement to be tuned. The syntax is as follows:

DBMS_ADVISOR.QUICK_TUNE (   advisor_name           IN VARCHAR2,   task_name              IN VARCHAR2,   attr1                  IN CLOB,   attr2                  IN VARCHAR2 := NULL,   attr3                  IN NUMBER := NULL,   task_or_template       IN VARCHAR2 := NULL);

The following example shows how to quick tune a single SQL statement:

VARIABLE task_name VARCHAR2(255);VARIABLE sql_stmt VARCHAR2(4000);EXECUTE :sql_stmt := 'SELECT COUNT(*) FROM customers                       WHERE cust_state_province =''CA''';EXECUTE :task_name  := 'MY_QUICKTUNE_TASK';EXECUTE DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR,              :task_name, :sql_stmt);

See for more information regarding the QUICK_TUNE procedure and its parameters.

 

你可能感兴趣的文章
网站地址中的www有还是没有
查看>>
RFC文档(中文翻译版本)
查看>>
邮件是怎么发送和接收的(STMP和POP3/IMAP协议)
查看>>
渗透的艺术
查看>>
怎么查看gcc默认的include路径
查看>>
TCP连接状态
查看>>
SecureCRT登录ssh上传下载文件方法
查看>>
理解硬盘
查看>>
理解硬盘(二)
查看>>
ubuntu下7zip压缩解压缩命令使用
查看>>
Makefile中的info函数
查看>>
使用mkimage制作uboot脚本
查看>>
全球海底光缆分布图-Submarine Cable Map
查看>>
很有用的图像数据转换工具
查看>>
uboot内存布局
查看>>
uboot移植-内存分布
查看>>
ubuntu下如何把用户的语言环境变量改为中文
查看>>
Ubuntu Server 16.04修改IP、DNS、hosts
查看>>
几个可以替代百度的搜索引擎
查看>>
BT.656标准简介
查看>>