两条sql作用的记录---(Dynamic Sampling)

在一次ORA-01555报错处理中,出现两条sql语句

SELECT /* DS_SVC */ /*+ dynamic_sampling(0) no_sql_tune no_monitoring optimizer_features_enable(default) no_parallel result_cache(snapshot=3600) OPT_ESTIMATE(@"innerQuery", TABLE, "O", ROWS=4.0625) */ C1, C2, C3 FROM (SELECT /*+ qb_name("innerQuery") NO_INDEX_FFS( "O")  */ 4294967295 AS C1, COUNT(*) AS C2, SUM(CASE WHEN ("O"."TYPE#"=13) THEN 1 ELSE 0 END) AS C3  FROM SYS."OBJ$" SAMPLE BLOCK(49.2308, 8) SEED(1)  "O" WHERE ("O"."TYPE#"=13)) innerQuery

SELECT /* DS_SVC */ /*+ dynamic_sampling(0) no_sql_tune no_monitoring optimizer_features_enable(default) no_parallel result_cache(snapshot=3600) OPT_ESTIMATE(@"innerQuery", INDEX_FILTER, "O", "I_OBJ2", ROWS=4.0625) OPT_ESTIMATE(@"innerQuery", INDEX_SKIP_SCAN, "O", "I_OBJ2", ROWS=4.0625) OPT_ESTIMATE(@"innerQuery", TABLE, "O", ROWS=4.0625) */ C1, C2, C3 FROM (SELECT /*+ qb_name("innerQuery") NO_INDEX_FFS( "O")  */ 4294967295 AS C1, COUNT(*) AS C2, SUM(CASE WHEN ("O"."TYPE#"=13) THEN 1 ELSE 0 END) AS C3  FROM SYS."OBJ$" SAMPLE BLOCK(49.2308, 8) SEED(1)  "O" WHERE ("O"."TYPE#"=13)) innerQuery

通过网上查资料以及自己的猜测,这两条sql语句的作用可能是用于动态采样
经查看数据库参数

optimizer_dynamic_sampling           integer     2

关闭动态采样

alter system set optimizer_dynamic_sampling=0 scope=both;

关于动态采样(dynamic sampling)的一些知识
两条sql作用的记录---(Dynamic Sampling)_第1张图片
两条sql作用的记录---(Dynamic Sampling)_第2张图片
Performance Tuning Guide–>Part IV Optimizing SQL Statements–>Chapter 13, “Managing Optimizer Statistics”–>13.6 Estimating Statistics with Dynamic Sampling–>13.6.2.1 Dynamic Sampling Levels

你可能感兴趣的:(Oracle)