What is the outcome of this block of code?

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.SQLACCESS_ADVISOR,
:task_name, :sql_stmt);
END;
What is the outcome of this block of code?

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.SQLACCESS_ADVISOR,
:task_name, :sql_stmt);
END;
What is the outcome of this block of code?

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

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

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

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



Leave a Reply 2

Your email address will not be published. Required fields are marked *


Helcio

Helcio

QUICK_TUNE Procedure

This procedure performs an analysis and generates recommendations for a single SQL statement.

This provides a shortcut method of all necessary operations to analyze the specified SQL statement. The operation creates a task using the specified task name. The task will be created using a specified Advisor task template. Finally, the task will be executed and the results will be saved in the repository.

Syntax

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);
Parameters

Table 17-28 QUICK_TUNE Procedure Parameters

Parameter Description
advisor_name
Name of the Advisor that will perform the analysis.
task_name
Name of the task.
attr1
Advisor-specific attribute in the form of a CLOB variable.
attr2
Advisor-specific attribute in the form of a VARCHAR2 variable.
attr3
Advisor-specific attribute in the form of a NUMBER.
task_or_template
An optional task name of an existing task or task template.