检查 Oracle 数据库的年龄?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2522626/
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
Check how old an Oracle database is?
提问by Flukey
So, we have a mirror of a santized version of the production database.
所以,我们有一个生产数据库的净化版本的镜像。
Is there anyway (that you know of) to find out how old the database is?
无论如何(您知道)是否可以找出数据库的年龄?
i.e. when the database was put on the Oracle server.
即当数据库放在 Oracle 服务器上时。
Thanks for any help!
谢谢你的帮助!
回答by Rob van Laarhoven
select created from dba_users where username = 'SYS';
选择从 dba_users 创建,其中用户名 = 'SYS';
at my site there's a 16 seconds difference with SELECT MIN(created) FROM dba_objects; How is that possible, the objects in SYS are created 16 seconds before user SYS is created?
在我的网站上,SELECT MIN(created) FROM dba_objects 有 16 秒的差异;这怎么可能,SYS 中的对象是在创建用户 SYS 之前 16 秒创建的?
SQL>select created from dba_users where username = 'SYS';
SQL>SELECT MIN(created) FROM dba_objects;
CREATED
-------------------------
10-SEP-08 11:24:44
MIN(CREATED)
-------------------------
10-SEP-08 11:24:28
UPDATE :BEWARE : My answer is not correct (in all circumstances). The right answer is given by Adam and Dougman. See stackoverflow.com/questions/2537342/… When you create a database with DBCA and use datafile templates the creation date of user SYS and SYS objects is the date the template files are created, not the date the database is created.
更新:当心:我的回答不正确(在所有情况下)。Adam 和 Dougman 给出了正确的答案。请参阅 stackoverflow.com/questions/2537342/... 当您使用 DBCA 创建数据库并使用数据文件模板时,用户 SYS 和 SYS 对象的创建日期是创建模板文件的日期,而不是创建数据库的日期。
回答by Doug Porter
回答by Peter Lang
You could query the time when the first object was created:
您可以查询创建第一个对象的时间:
SELECT MIN(created) FROM dba_objects