Sunday, June 29, 2014

Find out database name and database size .....

Using this query you can find database name, server name and database total size in mega byte ....


SQL> SET LINE 2000;
SQL>
SQL>   SELECT D.NAME, I.HOST_NAME, ROUND (SUM (F.BYTES) / 1048576) MB
  2      FROM V$DATABASE D
  3           CROSS JOIN V$INSTANCE I
  4           CROSS JOIN V$DATAFILE F
  5  GROUP BY D.NAME, I.HOST_NAME;

NAME      HOST_NAME                                                                MB
--------- ---------------------------------------------------------------- ----------
ORCL      N1020                                                                 39685

SQL>

No comments:

Post a Comment