Take the opportunity to calculate the uptime for the database by subtracting the value of startup_time from the current date.
col platform_name format a30 col open_mode format a20 col host_name format a20 col version format a10 col status format a20 col uptime format a30 col name format a10 set lines 300 SELECT D.NAME,D.PLATFORM_NAME,D.CREATED, D.OPEN_MODE,I.HOST_NAME,I.VERSION, I.ARCHIVER,I.STATUS, TO_DSINTERVAL( TO_CHAR( TO_TIMESTAMP(SYSDATE)-I.STARTUP_TIME ) ) "UPTIME", (SELECT ROUND(SUM(BYTES)/1024/1024/1024) FROM DBA_DATA_FILES) "DB size GB", ( SELECT ROUND(BYTES/1024/1024/1024) "mem GB" FROM V$SGAINFO WHERE NAME = 'Maximum SGA Size' ) "SGA max size GB" FROM V$DATABASE D INNER JOIN V$INSTANCE I ON UPPER(D.NAME) = UPPER(I.INSTANCE_NAME);
Result may look like the following:
NAME | PLATFORM_NAME | CREATED | OPEN_MODE | HOST_NAME | VERSION | ARCHIVER | STATUS | UPTIME | DB size GB | SGA max size GB |
---|---|---|---|---|---|---|---|---|---|---|
proddb01 | Linux x86 64-bit | 10.12.2015 14:16:46 | READ WRITE | prodserver01.mycompany.com | 11.2.0.4.0 | STARTED | OPEN | +00 13:59:55.000000 | 929 | 12 |