列出旧对象
只是想知道是否有一种方法可以列出数据库中尚未查询的所有对象。 我知道你可以通过sys.dba_Objects看到last_ddl_time和Created Time。但我对对象上的 Total_reads 更感兴趣,特别是索引和表。以及谁使用过它。(不是所有者)
谢谢
just wondering is there a way to List all objects in database which have not been Queried.
i know you can see the last_ddl_time and Created Time through sys.dba_Objects. But i am More interested in Total_reads on Objects specially Indexes and tables.And Who has Used it.(Not the Owner)
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
V$SEGMENT_STATISTICS
视图来获取您想要的信息。例如,如果您想查看自上次数据库重新启动以来SCOTT
模式中的每个段已完成多少逻辑读取如果您获得使用 AWR 的许可并且您的 AWR 保留时间足够长并且如果您可以使用较少的可用统计信息,并且您只对最常用的段感兴趣,那么您也可以使用
DBA_HIST_SEG_STAT
表。然而,如果您试图查明某个特定对象是否被轻度使用,AWR 可能不是正确的解决方案,因为尽管偶尔使用,它可能不会显示为任何快照窗口中的顶部片段之一。
或者,您可以编写自己的流程来定期从
V$SEGMENT_STATISTICS
捕获数据,并通过减去不同快照的统计值来计算增量。You can probably use the
V$SEGMENT_STATISTICS
view to get the information you're after. For example, if you wanted to see how many logical reads had been done on each segment in theSCOTT
schema since the last database restartIf you are licensed to use the AWR and your AWR retention is long enough and you can make due with fewer available statistics, and you are only interested in the most used segments, you may also be able to use the
DBA_HIST_SEG_STAT
table.If you are trying to find out whether a particular object is lightly used, however, the AWR is probably not the right solution since it might not show up as one of the top segments in any snapshot window despite being used occasionally.
Alternately, you could write your own process to capture the data from
V$SEGMENT_STATISTICS
periodically and compute the deltas by subtracting the statistic values from different snapshots.