40.You have statistics collected for some selected tables. Your requirement is that the statistics
2016-07-20 16:50
603 查看
40.You have statistics collected for some selected tables. Your requirement is that the statistics for the
tables and all dependent indexes must not be overwritten by further statistics collection until a certain
point of time.
How would you achieve this?
A.Lock statistics for the tables.
B.Change STALE_PERCENT to zero for the tables.
C.Set the TIMED_STATISTICS parameter to TRUE.
D.Set the STATISTICS_LEVEL parameter to BASIC.
E.Set the OPTIMIZER_USE_PENDING parameter statistics to TRUE.
答案:A
解析:
参考:http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm#ARPLS68491
题目说的是保证statistics不被覆盖,那么可以使用Lock statistics
B:TALE_PERCENT: Determines the percentage of rows in a table that have to change
before the statistics on that table are deemed stale and should be regathered.
The valid domain for stale_percent is non-negative numbers.The default value is 10%.
Note that if you set stale_percent to zero the AUTO STATS gathering job will gather
statistics for this table every time a row in the table is modified.
大概意思就是,这个参数是确定当表中行改变达到多大的比例的时候应该收集,该值不能为负数,默认为10%
需要注意的是,如果设置为0,那么只要有1行发生改变就会进行收集
所以这个东西与题目中说的不是一回事
C:TIMED_STATISTICS:这个主要是指定与时间相关的统计是否收集,如果为true,那么就收集并且存储在trace 文件或者
在V$SESSTATS和V$SYSSTATS动态视图中,如果为false,那么就不收集,这么做可以避免频繁从操作系统请求时间
D:OPTIMIZER_USE_PENDING:这里应该是OPTIMIZER_USE_PENDING_STATISTICS,指的是编译sql语句的时候,优化器是否使用最新的还没有验证的统计信息,默认情况下使用的是
存储在数据字典中的已经发布的统计信息
By default, the optimizer uses the published statistics stored in the data dictionary views.
If you want the optimizer to use the newly collected pending statistics, then set the initialization
parameter OPTIMIZER_USE_PENDING_STATISTICS to TRUE (the default value is FALSE),
and run a workload against the table or schema:
ALTER SESSION SET OPTIMIZER_USE_PENDING_STATISTICS = TRUE;
The optimizer will use the pending statistics instead of the published statistics
when compiling SQL statements. If the pending statistics are valid,
then you can make them public by executing the following statement:
EXEC DBMS_STATS.PUBLISH_PENDING_STATS(null, null);
You can also publish the pending statistics for a specific database object.
For example, by using the following statement:
EXEC DBMS_STATS.PUBLISH_PENDING_STATS('SH','CUSTOMERS');
If you do not want to publish the pending statistics, delete them by executing the following statement:
EXEC DBMS_STATS.DELETE_PENDING_STATS('SH','CUSTOMERS');
You can export pending statistics using DBMS_STATS.EXPORT_PENDING_STATS function.
Exporting pending statistics to a test system enables you to run a full workload against the new statistics.
参考:http://docs.oracle.com/cd/E11882_01/server.112/e41573/stats.htm#PFGRF003
tables and all dependent indexes must not be overwritten by further statistics collection until a certain
point of time.
How would you achieve this?
A.Lock statistics for the tables.
B.Change STALE_PERCENT to zero for the tables.
C.Set the TIMED_STATISTICS parameter to TRUE.
D.Set the STATISTICS_LEVEL parameter to BASIC.
E.Set the OPTIMIZER_USE_PENDING parameter statistics to TRUE.
答案:A
解析:
参考:http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm#ARPLS68491
题目说的是保证statistics不被覆盖,那么可以使用Lock statistics
B:TALE_PERCENT: Determines the percentage of rows in a table that have to change
before the statistics on that table are deemed stale and should be regathered.
The valid domain for stale_percent is non-negative numbers.The default value is 10%.
Note that if you set stale_percent to zero the AUTO STATS gathering job will gather
statistics for this table every time a row in the table is modified.
大概意思就是,这个参数是确定当表中行改变达到多大的比例的时候应该收集,该值不能为负数,默认为10%
需要注意的是,如果设置为0,那么只要有1行发生改变就会进行收集
所以这个东西与题目中说的不是一回事
C:TIMED_STATISTICS:这个主要是指定与时间相关的统计是否收集,如果为true,那么就收集并且存储在trace 文件或者
在V$SESSTATS和V$SYSSTATS动态视图中,如果为false,那么就不收集,这么做可以避免频繁从操作系统请求时间
D:OPTIMIZER_USE_PENDING:这里应该是OPTIMIZER_USE_PENDING_STATISTICS,指的是编译sql语句的时候,优化器是否使用最新的还没有验证的统计信息,默认情况下使用的是
存储在数据字典中的已经发布的统计信息
By default, the optimizer uses the published statistics stored in the data dictionary views.
If you want the optimizer to use the newly collected pending statistics, then set the initialization
parameter OPTIMIZER_USE_PENDING_STATISTICS to TRUE (the default value is FALSE),
and run a workload against the table or schema:
ALTER SESSION SET OPTIMIZER_USE_PENDING_STATISTICS = TRUE;
The optimizer will use the pending statistics instead of the published statistics
when compiling SQL statements. If the pending statistics are valid,
then you can make them public by executing the following statement:
EXEC DBMS_STATS.PUBLISH_PENDING_STATS(null, null);
You can also publish the pending statistics for a specific database object.
For example, by using the following statement:
EXEC DBMS_STATS.PUBLISH_PENDING_STATS('SH','CUSTOMERS');
If you do not want to publish the pending statistics, delete them by executing the following statement:
EXEC DBMS_STATS.DELETE_PENDING_STATS('SH','CUSTOMERS');
You can export pending statistics using DBMS_STATS.EXPORT_PENDING_STATS function.
Exporting pending statistics to a test system enables you to run a full workload against the new statistics.
参考:http://docs.oracle.com/cd/E11882_01/server.112/e41573/stats.htm#PFGRF003
相关文章推荐
- 2.Which two statements are true about the Automatic Workload Repository (AWR)
- 3.While observing the index statistics, you find that an index is highly fragmented, thereby resulti
- 4.Your test database is running in NOARCHIVELOG mode. Which statement is true regarding the type of
- 5.The database instance is currently using SPFILE. View the Exhibit and examine the error that you
- 6.Note the following points describing various utilities in Oracle Database 11g:
- 7.You have issued a SHUTDOWN ABORT command to bring down your database instance. Considerthe steps t
- 8.Observe the information in the columns:
- 9.View the Exhibit and examine the privileges granted to the SL_REP user.
- 10.Examine the following statement that is used to modify the constraint on the SALES table:
- 11.Identify the memory component from which memory may be allocated for:
- 12.Which is the correct description of a pinned buffer in the database buffer cache?
- 13.You have executed this command to change the size of the database buffer cache:
- 14.These are points that describe the contents of different memory components:
- 15.Which two statements are true about Shared SQL Area and Private SQL Area? (Choose two.)
- 16.Note the following functionalities of various background processes:
- 17.Note the functionalities of various background processes:
- 18.View the Exhibit and identify the component marked with a question mark.
- 19.Which two statements about the background process of the database writer are true? (Choose two.)
- 20.You have set Tablespace Full Metrics Threshold values for the USERS tablespace as follows:
- 21.Which three statements are true about logical structures of the Oracle database? (Choose three.)