问题描述
嗨,专家们,
我需要澄清如何在V $ SQL中增加无效和负载列。
我明白:
-由于某些因素 (收集统计信息,更改表的结构,...),游标无效。
-在上一次失效后重新加载,光标老化。
-重新加载意味着硬解析
我的问题是:
-这些说法正确吗?
-还有其他影响无效的因素吗?(例如动态采样)
-如果由于PQ_SLAVE_MISMATCH而生成了一些孩子,这对失效和重新加载有何影响?(我知道PQ_SLAVE_MISMATCH是不正确的并行使用的原因,我在开发人员团队中报告了这种情况)
-执行次数是否可能比加载和无效次数低得多?如果是的话,你能解释一下吗?
-光标老化后,是否可能仅从库缓存中清除某些信息?(例如,定时信息,如APPLICATION_WAIT_TIME、ELAPSED_TIME等,被清除,但重新加载和失效被保持)
这些问题是为以下情况找到答案:
提前谢谢。
我需要澄清如何在V $ SQL中增加无效和负载列。
我明白:
-由于某些因素 (收集统计信息,更改表的结构,...),游标无效。
-在上一次失效后重新加载,光标老化。
-重新加载意味着硬解析
我的问题是:
-这些说法正确吗?
-还有其他影响无效的因素吗?(例如动态采样)
-如果由于PQ_SLAVE_MISMATCH而生成了一些孩子,这对失效和重新加载有何影响?(我知道PQ_SLAVE_MISMATCH是不正确的并行使用的原因,我在开发人员团队中报告了这种情况)
-执行次数是否可能比加载和无效次数低得多?如果是的话,你能解释一下吗?
-光标老化后,是否可能仅从库缓存中清除某些信息?(例如,定时信息,如APPLICATION_WAIT_TIME、ELAPSED_TIME等,被清除,但重新加载和失效被保持)
这些问题是为以下情况找到答案:
SQL> select inst_id,child_number,executions,invalidations,loads,trunc(elapsed_time/1000000) elapsed_secs, 2 trunc(application_wait_time/1000000) application_wait_secs,trunc(concurrency_wait_time/1000000) concurrency_wait_secs, 3 trunc(cluster_wait_time/1000000) cluster_wait_secs,trunc(user_io_wait_time/1000000) user_io_wait_secs,trunc(cpu_time/1000000) cpu_time_secs,rows_processed,plan_hash_value 4 from gv$sql where sql_id = '' and executions > 0 order by inst_id,child_number; INST_ID CHILD_NUMBER EXECUTIONS INVALIDATIONS LOADS ELAPSED_SECS APPLICATION_WAIT_SECS CONCURRENCY_WAIT_SECS CLUSTER_WAIT_SECS USER_IO_WAIT_SECS CPU_TIME_SECS ROWS_PROCESSED PLAN_HASH_VALUE ---------- ------------ ---------- ------------- ---------- ------------ --------------------- --------------------- ----------------- ----------------- ------------- -------------- --------------- 1 1 1 42 54 4 0 0 0 0 3 1 1990401962 2 1 6 390 762 7 0 0 0 0 3 15 395703849 2 4 2 36 77 11 0 0 0 0 10 2 3669144543 2 7 54 707 1049 31 0 4 0 0 14 345 395703849 3 9 8 0 1 6 0 0 0 0 4 21 1990401962 4 0 19 422 589 15 0 1 0 0 9 73 395703849 复制
提前谢谢。
专家解答
- Are these statements correct?
是的。
- Are there some other factor that impact INVALIDATION ? (for example dynamic sampling)
许多潜在因素。自适应光标共享。基数反馈。辅助统计。
- If I have some child generated due to PQ_SLAVE_MISMATCH, how this impact on INVALIDATIONS and RELOAD?
是的,这会影响它。当我们生成一个新的孩子时,通常是因为无法使用现有的孩子,所以您可能会看到它。这里的一个例子
https://asktom.oracle.com/pls/apex/asktom.search?tag=invalidation-of-child-cursor
- Is it possible to have a number of EXECUTIONS much lower than LOADS and INVALIDATIONS? If yes could you explain?
是的。 I can parse a statement and never run it. Often when we open a cursor, we don't actually run it until the first fetch because if the first fetch is not issued, it is not worth executing it.
- When a cursor is aged out, is it possible that only some information are purged from library cache? (for example
timing informations, such as APPLICATION_WAIT_TIME, ELAPSED_TIME and so on, are purged but RELOAD and INVALIDATIONS are maintained)
是的。 A statement sits in a number of different memory structures (heaps). We can purge or age parts out and keep others.
是的。
- Are there some other factor that impact INVALIDATION ? (for example dynamic sampling)
许多潜在因素。自适应光标共享。基数反馈。辅助统计。
- If I have some child generated due to PQ_SLAVE_MISMATCH, how this impact on INVALIDATIONS and RELOAD?
是的,这会影响它。当我们生成一个新的孩子时,通常是因为无法使用现有的孩子,所以您可能会看到它。这里的一个例子
https://asktom.oracle.com/pls/apex/asktom.search?tag=invalidation-of-child-cursor
- Is it possible to have a number of EXECUTIONS much lower than LOADS and INVALIDATIONS? If yes could you explain?
是的。 I can parse a statement and never run it. Often when we open a cursor, we don't actually run it until the first fetch because if the first fetch is not issued, it is not worth executing it.
- When a cursor is aged out, is it possible that only some information are purged from library cache? (for example
timing informations, such as APPLICATION_WAIT_TIME, ELAPSED_TIME and so on, are purged but RELOAD and INVALIDATIONS are maintained)
是的。 A statement sits in a number of different memory structures (heaps). We can purge or age parts out and keep others.
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【专家有话说第五期】在不同年龄段,DBA应该怎样规划自己的职业发展?
墨天轮编辑部
1450次阅读
2025-03-13 11:40:53
Oracle RAC ASM 磁盘组满了,无法扩容怎么在线处理?
Lucifer三思而后行
879次阅读
2025-03-17 11:33:53
RAC 19C 删除+新增节点
gh
539次阅读
2025-03-14 15:44:18
2月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
497次阅读
2025-03-13 14:38:19
Oracle 如何修改 db_unique_name?强迫症福音!
Lucifer三思而后行
425次阅读
2025-03-12 21:27:56
Oracle DataGuard高可用性解决方案详解
孙莹
367次阅读
2025-03-26 23:27:33
墨天轮个人数说知识点合集
JiekeXu
313次阅读
2025-04-01 15:56:03
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
282次阅读
2025-04-08 09:12:48
风口浪尖!诚通证券扩容采购Oracle 793万...
Roger的数据库专栏
266次阅读
2025-03-24 09:42:53
切换Oracle归档路径后,不能正常删除原归档路径上的归档文件
dbaking
266次阅读
2025-03-19 14:41:51