Oracle 获取存储过程上次修改日期

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1313212/
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-10 02:06:31  来源:igfitidea点击:

Oracle get stored procedure last modified date

oracle

提问by Beta033

First, thank you all for your help.

首先,感谢大家的帮助。

I'm trying to locate something similar to MSSQL's sys.procedures.Modify_date in oracle(10g).

我正在尝试在 oracle(10g) 中找到类似于 MSSQL 的 sys.procedures.Modify_date 的内容。

A little context:

一点背景:

We design many stored procedures for use in both oracle and mssql. it's simple enough in mssql to see which stored procedures have been updated (as modify_date will be newer). I've heard there was something similar for oracle but have found precious little on the intertubes. I also heard a rumor that there was something close, but it contains the last compilation date for the sproc. As i'm looking for "the last time someone altered the text of the sproc", this won't quite work.

我们设计了许多用于 oracle 和 mssql 的存储过程。在 mssql 中查看哪些存储过程已更新非常简单(因为 modify_date 会更新)。我听说oracle有类似的东西,但在intertubes上发现很少。我还听说有一些接近的谣言,但它包含 sproc 的最后编译日期。当我在寻找“最后一次有人更改 sproc 的文本时”,这不太可行。

Is this possible? is there some trick? Right now we maintain a text comment within the stored procedure and one of the devs wrote a routine to go pull out the date from that comment. It's klunky and easy to forget to do and i'd like to find a better way.

这可能吗?有什么技巧吗?现在我们在存储过程中维护一个文本注释,其中一个开发人员编写了一个例程来从该注释中提取日期。这很笨拙而且很容易忘记做,我想找到更好的方法。

Again, thanks for your help.

再次感谢您的帮助。

回答by Quassnoi

SELECT  LAST_DDL_TIME, TIMESTAMP
FROM    DBA_OBJECTS
WHERE   OBJECT_TYPE = 'PROCEDURE'
        AND OBJECT_NAME = 'PRC_MINE'

回答by Gary Myers

If you are interested in actual changes to the code, look into the AUDIT statement or a DDL trigger

如果您对代码的实际更改感兴趣,请查看 AUDIT 语句或DDL 触发器

回答by tuinstoel

Maybe it is better to use something like sub version or team system to handle source control.

也许最好使用诸如子版本或团队系统之类的东西来处理源代码控制。