OCP 1Z0 053 28

来源:互联网 发布:js获取用户访问地区 编辑:程序博客网 时间:2024/05/24 23:16
28.You have a range-partitioned table in your database. Each partition in the table contains the sales data 
for a quarter. 
The partition related to the current quarter is modified frequently and other partitions undergo fewer data 
manipulations. The preferences for the table are set to their default values. You collect statistics for the 
table using the following command in regular intervals: 
SQL> EXECUTE 
DBMS_STATS.GATHER_TABLE_STATS('SH','SALES',GRANULARITY=>'GLOBAL'); 
You need statistics to be collected more quickly. What can you do to achieve this? 
A. Set DYNAMIC_SAMPLING to level 4. 
B. Set the STATISTICS_LEVEL parameter to BASIC.
C. Set the INCREMENTAL value to TRUE for the partition table. 
D. Increase the value of STALE_PERCENT for the partition table. 
Answer: C 

需要用 DBMS_STATS.SET_TABLE_PREF 设置INCREMENTAL为true。参数GRANULARITY改为auto。

http://docs.oracle.com/cd/B28359_01/server.111/b28274/stats.htm#i42218

13.3.1.3 Statistics on Partitioned Objects

For partitioned tables and indexes, DBMS_STATS can gather separate statistics for each partition and global statistics for the entire table or index. Similarly, for composite partitioning, DBMS_STATS can gather separate statistics for subpartitions, partitions, and the entire table or index. The type of partitioning statistics to be gathered is specified in the GRANULARITYargument to the DBMS_STATS gathering procedures.

Depending on the SQL statement being optimized, the optimizer can choose to use either the partition (or subpartition) statistics or the global statistics. Both types of statistics are important for most applications, and Oracle recommends setting the GRANULARITY parameter to AUTO to gather both types of partition statistics.

With partitioned tables, new data is usually loaded into a new partition. As new partitions are added and data loaded, statistics must be gathered on the new partition, and global statistics must be kept up to date. If the INCREMENTAL value for a partition table is set to TRUE, and you gather statistics on that table with the GRANULARITY parameter set to AUTO, Oracle will gather statistics on the new partition and update the global table statistics by scanning only those partitions that have been modified and not the entire table. If the INCREMENTAL value for the partitioned table is set to FALSE (default value), then a full table scan is used to maintain the global statistics. This is a highly resource intensive and time consuming operation for large tables.


0 0
原创粉丝点击