oracle 如何判断一个表在上个月是否被访问过?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1138952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 18:37:46  来源:igfitidea点击:

How to determine if a table has been accessed in the last month?

oracleperformance

提问by chris

In Oracle 10, is it possible to determine when the last time a table was accessed?

在 Oracle 10 中,是否可以确定上次访问表的时间?

According to this articlethe data is there, but I'm not sure whether this is reset whenever the server is restarted, nor how to actually get the access information.

根据这篇文章,数据在那里,但我不确定这是否会在服务器重新启动时重置,也不知道如何实际获取访问信息。

We're actually trying to determine what tables are no longer used.

我们实际上是在尝试确定不再使用哪些表。

回答by FerranB

The best way to determine table modifications is to check DBA_TAB_MODIFICATIONS, their values remain throught shutdown. You have to do a comparision between two intervals of time.

确定表修改的最佳方法是检查DBA_TAB_MODIFICATIONS,它们的值在关闭期间保持不变。您必须在两个时间间隔之间进行比较。

UPDATE: About the article. It refers to DBA_HIST_SEG_xxxtables which gets data from V$segstat. The data in this system view is reset on startup.

更新:关于文章。它指的是从V$segstat获取数据的DBA_HIST_SEG_xxx表。此系统视图中的数据在启动时重置。

回答by Ian Carpenter

Have you had a look at this asktom question http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2975793633621?

你有没有看过这个问题http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2975793633621

It takes a while to get going but if you search for "simple way last date of table used" it may be of some use.

需要一段时间才能开始,但如果您搜索“使用表格的最后日期的简单方式”,它可能会有用。

Hope it helps

希望能帮助到你

Cheers

干杯

Ian

伊恩