Monday, 9 January 2017

Getting Information on Tables


You can get information about your tables by
  • Performing a DESCRIBE command on the table.
  • Querying the user_tables view.
Some of the columns in the user_tables view:
ColumnTypeDescription
table_nameVARCHAR2(30)Name of the table.
tablespace_nameVARCHAR2(30)Name of the tablespace
temporaryVARCHAR2(1)Whether the table is temporary.

SQL> SELECT table_name, tablespace_name, temporary
  2  FROM user_tables
  3  WHERE table_name IN ('MYTABLE');

TABLE_NAME                     TABLESPACE_NAME                T
------------------------------ ------------------------------ -
MYTABLE                                                       Y

SQL>