Table information

March 7th, 2012

Get information about one table in partucular schema

COLUMN owner               FORMAT A15                HEADING "Owner"
COLUMN table_name          FORMAT A30                HEADING "Table Name"
COLUMN tablespace_name     FORMAT A28                HEADING "Tablespace"
COLUMN last_analyzed       FORMAT A20                HEADING "Last Analyzed"
COLUMN num_rows            FORMAT 999,999,999        HEADING "# of Rows"

SELECT
    owner
  , table_name
  , tablespace_name
  , TO_CHAR(last_analyzed, 'DD-MON-YYYY HH24:MI:SS') last_analyzed
  , num_rows
FROM
    dba_tables
WHERE
      owner      = UPPER('&schema_name')
  AND table_name = UPPER('&table_name')
/


Comments are closed.