Useful Query for both DBA and Developer:
Instructions of use:
Either run this query
logged on to SYS or SYSTEM or GRANT SELECT on the DICTIONARY TABLES:DBA_TAB_COLUMNS,
V$DATABASE, DBA_TABLES, DBA_EXTENTS, DBA_CONS_COLUMNS, DBA_CONSTRAINTS,
DBA_TRIGGERS, DBA_TAB_PRIVS, DBA_COL_PRIVS
In toad you just copy and
paste these script. It will be requested to enter the schema owner and the
tablename. At SQL*PLUS You will need Column format setting for proper output
layout.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Show the
Table/INDEX Details for Particular Schema
SELECT owner, table_name, TRUNC(sum(bytes)/1024/1024) Meg
FROM (SELECT segment_name table_name, owner, bytes
FROM dba_segments
WHERE segment_type = 'TABLE'
UNION ALL
SELECT i.table_name, i.owner, s.bytes
FROM dba_indexes i, dba_segments s
WHERE s.segment_name = i.index_name
AND s.owner = i.owner AND s.segment_type = 'INDEX'
UNION ALL
Comments
Post a Comment