Re: Finding the Definition of a View

From: Andrew Zitelli <zitelli_at_tus.ssi1.com>
Date: 1996/02/02
Message-ID: <4ersq0$62p_at_atlas.tus.ssi1.com>#1/1


Daniel Lieuwen <lieuwen> wrote:
> Assuming one has DBA priveleges, how does one find the definition of a
> view? No one remembers the exact definition off hand, and we need it
> back.

From SQL*Plus try:
SQL> select text from dba_views where view_name='YOUR_VIEW'

     and owner='THE_OWNER';

The "text" field is defined as a LONG therefore you may need to execute something like "SET LONG 1000" to see the full text in SQL*Plus. DBA_VIEWS also includes the field "text_length" which tells you the actual length of the text for each view.

> Also, where can one find a complete list of system tables (e.g. TABS,
> COLS)? Since they don't show up in TABS itself and I can't find even
> TABS and COLS in the indexes of any of the stack of about 10 books
> that came with the distribution, I'm out of ideas as to where to look.

TABS is a synonym for "user_tables" and only shows tables owned by the current user. Try querying "DBA_TABLES" and "DBA_VIEWS" for complete lists of tables and views. Many "system tables" are actually views across one or more underlying tables. Without DBA privileges, use "ALL_TABLES" and "ALL_VIEWS" which show all tables/views to which the current user is authorized. Received on Fri Feb 02 1996 - 00:00:00 CET

Original text of this message