题目:
123.What two statements are true regarding the recommendations received from the SQL Access Advisor? (Choose two.)
A. It cannot generate recommendations that support multiple workload queries.
B. It can recommend partitioning on tables provided that the workloads have some predicates and joins on the columns of the NUMBER or DATE type.
C. It can recommend partitioning only on tables that have at least 10,000 rows.
D. It can recommend only B-tree indexes and not bitmap or function-based indexes.
参考答案 BC
解析
题目意思是,关于SQL Access Advisor的建议,那个说法是正确的。
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e41573/advisor.htm#PFGRF94876
Materialized views, partitions, and indexes are essential when tuning a database to achieve optimum performance for complex, data-intensive queries. SQL Access Advisor helps you achieve your performance goals by recommending the proper set of materialized views, materialized view logs, partitions, and indexes for a given workload. Understanding and using these structures is essential when optimizing SQL as they can result in significant performance improvements in data retrieval. The advantages, however, do not come without a cost. Creation and maintenance of these objects can be time consuming, and space requirements can be significant. In particular, partitioning of an unpartitioned base table is a complex operation that must be planned carefully.
SQL Access Advisor index recommendations include bitmap, function-based, and B-tree indexes. A bitmap index offers a reduced response time for many types of ad hoc queries and reduced storage requirements compared to other indexing techniques. Bitmap indexes are most commonly used in a data warehouse to index unique or near-unique keys. SQL Access Advisor materialized view recommendations include fast refreshable and full refreshable MVs, for either general rewrite or exact text match rewrite.
SQL Access Advisor, using the TUNE_MVIEW
procedure, also recommends how to optimize materialized views so that they can be fast refreshable and take advantage of general query rewrite.
In addition, SQL Access Advisor can recommend partitioning on an existing unpartitioned base table to improve performance. Furthermore, it may recommend new indexes and materialized views that are themselves partitioned. While creating new partitioned indexes and materialized view is no different from the unpartitioned case, partitioning existing base tables should be executed with care. This is especially true when indexes, views, constraints, or triggers are defined on the table. See "Special Considerations when Script Includes Partitioning Recommendations" for a list of issues involving base table partitioning for performing this task online.
You can run SQL Access Advisor from Oracle Enterprise Manager (accessible from the Advisor Central page) using SQL Access Advisor Wizard or by invoking the DBMS_ADVISOR
package. The DBMS_ADVISOR
package consists of a collection of analysis and advisory functions and procedures callable from any PL/SQL program.
Figure 18-1 illustrates how SQL Access Advisor recommends access structures for a given workload obtained from a user-defined table or the SQL cache. If a workload is not provided, then it can generate and use a hypothetical workload also, provided the user schema contains dimensions defined by the CREATE
DIMENSION
keyword.
Figure 18-1 Materialized Views and SQL Access Advisor
Description of "Figure 18-1 Materialized Views and SQL Access Advisor"
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 make recommendations, SQL Access Advisor relies on structural statistics about table and index cardinalities of dimension level columns, JOIN
KEY
columns, and fact table key columns. You can gather either exact or estimated statistics with the DBMS_STATS
package. Because gathering statistics is time-consuming and full statistical accuracy is not required, it is generally preferable to estimate statistics. Without gathering statistics on a given table, queries referencing this table are marked as invalid in the workload, resulting in no recommendations being made for those queries. It is also recommended that all existing indexes and materialized views have been analyzed. See Oracle Database PL/SQL Packages and Types Reference for more information about the DBMS_STATS
package.
18.2.4.1 SQL Tuning Set Workloads
The input workload source for SQL Access Advisor is the SQL tuning set. An important benefit of using a SQL tuning set is that because it is stored as a separate entity, it can easily be shared among many Advisor tasks. After a SQL tuning set object has been referenced by an Advisor task, it cannot be deleted or modified until all Advisor tasks have removed their dependency on the data. A workload reference is removed when a parent Advisor task is deleted or when the workload reference is manually removed from the Advisor task by the user.
SQL Access Advisor performs best when a workload based on actual usage is available. You can store multiple workloads in the form of SQL tuning sets, so that you can view the different uses of a real-world data warehousing or transaction-processing environment over a long period and across the life cycle of database instance startup and shutdown.
END
-- 2019-08-27 add
题目:
221.To generate recommendations to improve the performance of a set of SQL queries in an application,
you execute the following blocks of code:
BEGIN dbms_advisor.create_task(dbms_advisor.sqlaccess_advisor,'TASK1'); END;/
BEGIN dbms_advisor.set_task_parameter('TASK1','ANALYSIS_SCOPE','ALL');
dbms_advisor.set_task_parameter('TASK1','MODE','COMPREHENSIVE');
END;
/
BEGIN
dbms_advisor.execute_task('TASK1');
dbms_output.put_line(dbms_advisor.get_task_script('TASK1'));
END;
/
The blocks of code execute successfully; however, you do not get the required outcome.
What could be the reason?
A. A template needs to be associated with the task.
B. A workload needs to be associated with the task.
C. The partial or complete workload scope needs to be associated with the task.
D. The type of structures (indexes, materialized views, or partitions) to be recommended need to be specified for the task.
参考答案 B
解析
题目意思是,执行了dbms_advisor对查询语句进行sql access advisor。执行成功了,但是没有结果。为什么?
从题目上看,没有创建workload。选择B 。
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e41573/advisor.htm#PFGRF94878
An easy way to use SQL Access Advisor is to invoke its wizard, which is available in Enterprise Manager from the Advisor Central page. If you prefer to use SQL Access Advisor through the DBMS_ADVISOR
package, then this section describes the basic components and the sequence in which you must call the procedures.
This section describes the four steps in generating a set of recommendations:
Create a task
Define the workload
Generate the recommendations
View and implement the recommendations
Figure 18-2 SQL Access Advisor Flowchart
END
-- 2019-08-27 add
题目:
232.What recommendations does the SQL Access Advisor provide for optimizing SQL queries? (Choose all that apply.)
A. selection of SQL plan baselines
B. partitioning of tables and indexes
C. creation of index-organized tables
D. creation of bitmap, function-based, and B-tree indexes
E. optimization of materialized views for maximum query usage and fast refresh
参考答案 BDE
解析
题目意思问,SQL 访问指导,推荐了那些结果?
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e41573/advisor.htm#PFGRF008
This chapter illustrates how to use SQL Access Advisor, which is a tuning tool that provides advice on improving the performance of a database through partitioning, materialized views, indexes, and materialized view logs. The chapter contains the following sections:
Overview of SQL Access Advisor
Using SQL Access Advisor
Tuning Materialized Views for Fast Refresh and Query Rewrite
Materialized views, partitions, and indexes are essential when tuning a database to achieve optimum performance for complex, data-intensive queries. SQL Access Advisor helps you achieve your performance goals by recommending the proper set of materialized views, materialized view logs, partitions, and indexes for a given workload. Understanding and using these structures is essential when optimizing SQL as they can result in significant performance improvements in data retrieval. The advantages, however, do not come without a cost. Creation and maintenance of these objects can be time consuming, and space requirements can be significant. In particular, partitioning of an unpartitioned base table is a complex operation that must be planned carefully.
SQL Access Advisor index recommendations include bitmap, function-based, and B-tree indexes. A bitmap index offers a reduced response time for many types of ad hoc queries and reduced storage requirements compared to other indexing techniques. Bitmap indexes are most commonly used in a data warehouse to index unique or near-unique keys. SQL Access Advisor materialized view recommendations include fast refreshable and full refreshable MVs, for either general rewrite or exact text match rewrite.
SQL Access Advisor, using the TUNE_MVIEW
procedure, also recommends how to optimize materialized views so that they can be fast refreshable and take advantage of general query rewrite.
In addition, SQL Access Advisor can recommend partitioning on an existing unpartitioned base table to improve performance. Furthermore, it may recommend new indexes and materialized views that are themselves partitioned. While creating new partitioned indexes and materialized view is no different from the unpartitioned case, partitioning existing base tables should be executed with care. This is especially true when indexes, views, constraints, or triggers are defined on the table. See "Special Considerations when Script Includes Partitioning Recommendations" for a list of issues involving base table partitioning for performing this task online.
You can run SQL Access Advisor from Oracle Enterprise Manager (accessible from the Advisor Central page) using SQL Access Advisor Wizard or by invoking the DBMS_ADVISOR
package. The DBMS_ADVISOR
package consists of a collection of analysis and advisory functions and procedures callable from any PL/SQL program.
Figure 18-1 illustrates how SQL Access Advisor recommends access structures for a given workload obtained from a user-defined table or the SQL cache. If a workload is not provided, then it can generate and use a hypothetical workload also, provided the user schema contains dimensions defined by the CREATE
DIMENSION
keyword.
Figure 18-1 Materialized Views and SQL Access Advisor
Description of "Figure 18-1 Materialized Views and SQL Access Advisor"
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 make recommendations, SQL Access Advisor relies on structural statistics about table and index cardinalities of dimension level columns, JOIN
KEY
columns, and fact table key columns. You can gather either exact or estimated statistics with the DBMS_STATS
package. Because gathering statistics is time-consuming and full statistical accuracy is not required, it is generally preferable to estimate statistics. Without gathering statistics on a given table, queries referencing this table are marked as invalid in the workload, resulting in no recommendations being made for those queries. It is also recommended that all existing indexes and materialized views have been analyzed. See Oracle Database PL/SQL Packages and Types Reference for more information about the DBMS_STATS
package.
END
-- 2019-09-04 add
题目:
407.Which of the following is a potential performance tuning recommendation from the SQL Access Advisor?
A. Create new indexes.
B. Modify existing indexes.
C. Implement partitioning on a nonpartitioned table.
D. Create materialized views.
E. All of the above
参考答案 E
解析
sql access advisor的结果。 选择E 。
参考文档,参考上面的题目的文档。
end
题目:
408.Which statement most accurately describes the implementation of a SQL Access Advisor recommendation?
A. SQL Access Advisor recommendations are automatically implemented.
B. Individual SQL Access Advisor recommendations can be scheduled for implementation.
C. All SQL Access Advisor recommendations for a specific task must be implemented at the same time.
D. SQL Access Advisor recommendations are automatically scheduled for implementation during the maintenance window.
E. None of the above.
参考答案 B
解析
关于试试sql access advisor的建议,那个说法最准确。
可以计划单个SQL Access Advisor建议的实现 。选择B 。
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e41573/advisor.htm#PFGRF94880
18.2.5.1 Recommendations and Actions
SQL Access Advisor makes several recommendations, each of which contains one or more individual actions. In general, each recommendation provides a benefit for one query or a set of queries. All individual actions in a recommendation must be implemented together to achieve the full benefit. Recommendations can share actions.
For example, a CREATE
INDEX
statement could provide a benefit for several queries, but some of those queries might benefit from an additional CREATE
MATERIALIZED
VIEW
statement. In that case, the advisor would generate two recommendations: one for the set of queries that require only the index, and another one for the set of queries that require both the index and the materialized view to run optimally.
The partition recommendation is a special type of recommendation. When SQL Access Advisor determines that partitioning a specified base table would improve workload performance, the advisor adds a partition action to every recommendation containing a query referencing the base table. This technique ensures that index and materialized view recommendations are implemented on the correctly partitioned tables.
END
-- 2019-09-11 add
题目:
624.You work with a newly created database. Presently, there is no application load on the database
instance. You want to create a baseline for tuning the application, so you decide to collect
recommendations that can be implemented to improve application performance.
What action must you take to achieve this?
A. Run Segment Advisor
B. Run the SQL Tuning Advisor (STA)
C. Run the Automatic Workload Repository (AWR) report
D. Run the SQL Access Advisor with a hypothetical workload
参考答案 D
解析
新的数据库没有应用程序负载。希望创建一个baseline来调优应用。决定收集能提高应用程序的建议。
参考文档,参考上面的文档。
END
-- 2019-09-12 add
题目:
691. You work in a data warehouse environment that involves the execution of complex queries. The
current content of the SQL cache contains the ideal workload for analysis. You want to analyze only a few
most resource-intensive statements.
What must you do to receive recommendations on efficient use of indexes and materialized views to
improve query performance?
A.Run the SQL Access Advisor.
B.Run the SQ; Tuning Advisor (STA).
C.Run the Automatic Workload Repository (AWR) report.
D.Run the Automatic Database Diagnostic Monitor (ADDM).
参考答案 A
解析
数据仓库中涉及到复杂的查询。关于索引和物化视图的效率。使用SQL Access advisor进行调优。选择A 。
参考文档,参考上面的题目。
END