Wednesday, July 22, 2015

Database object information queries

A few queries to show basic information about database objects.

 Information from dba_objects 

 Change the object_type clause for different types of objects
 - TABLE
 - VIEW
 - PACKAGE
 - PROCEDURE
 - FUNCTION
etc...


set line 200 col object_name for a30 select owner, object_name, object_type, status, created, last_ddl_time from dba_objects where object_name = 'OBJECTNAME' - object name and object_type = 'TABLE' --Object type

Information about table indexes



set line 220 col COLUMN_NAME for a30 col object_name for a30 select INDEX_OWNER, INDEX_NAME, TABLE_NAME, COLUMN_NAME, COLUMN_POSITION from dba_ind_columns where table_name = 'BOND_FEED_TRACE_TRADE'

******************************************
 keywords: object details
******************************************
 rdbms version: 11.2
******************************************

No comments: