views:

95

answers:

3

Hi all,

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.

Thanks for any help!

+2  A: 

You could query the time when the first object was created:

SELECT MIN(created) FROM dba_objects
Peter Lang
+5  A: 

select created from dba_users where username = '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?

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.

Robert Merkwürdigeliebe
Excellent! Just what I wanted. Thanks very much:-)
Jamie
I'd have gone after `select created from gv$database`, which contains the earliest absolute time reference in my systems. The reason that objects in SYS's schema have an earlier timestamp than the SYS account is because those are the underlying physical data structures; one can't have a user in the user table before creating the table. The first object in DBA_OBJECTS I see is CLUSTER C_OBJ#, and the SYSTEM tablespace/datafile (which do not appear in DBA_OBJECTS) have to exist before C_OBJ# can be created in it.
Adam Musch
BEWARE : My answer is not correct (in all circumstances). The right answer is given by Adam and Dougman. See http://stackoverflow.com/questions/2537342/the-creation-date-of-a-databaseWhen 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.
Robert Merkwürdigeliebe
+2  A: 

select created from v$database;

v$database documentation

Dougman