Re: SQL*Plus newbie questions

From: Donna Kray <kray.donna_at_mlink.motors.ge.com>
Date: 1996/01/23
Message-ID: <4e2v50$rt9_at_crissy.ge.com>#1/1


Steve Chell <slc_at_stevensons.co.nz> wrote:
>Hi all. I come from an Informix background, and I'm currently
>trying to get to grips with Oracle, in particular SQL*Plus.
>
>Any help with the following would be appreciated.
>
>1. Once connected to the database via SQL*Plus, how do you list
> the tables. (Informix equivalent: info tables)

In general Oracle has three set of views to allow you to see database

objects. DBA_%  (Super set view of objects. Owned by SYS)
         ALL_%  (Set of objects that you, the signed on user, may see)
         USER_% (Set of objects owned by you, the signed on user)

e.g. DBA_TABLES, ALL_INDEXES, USER_CONSTRAINTS.

To answer your question specifically:
SELECT TABLE_NAME FROM ALL_TABLES; or
SELECT SEGMENT_NAME FROM DBA_SEGMENTS WHERE SEGMENT_TYPE = 'TABLE'; --if you're a DBA type.

>
>2. Are there any system catalog tables which hold info about
> the tables, columns, etc in the database.
> (Informix equivalent: systables, syscolumns, etc)
 DBA_TABLES, DBA_TAB_COLUMNS, DBA_INDEXES, DBA_IND_COLUMNS, etc.
>
>3. How do you determine the number of tables in the database.
> (Informix equivalent:
> select count(*) from systables where tabtype = "T")
 See answer to question 1.
>
>4. How do you list the columns in a table.
> (Informix equivalent: info columns for tablename)
DBA_TAB_COLUMNS, ALL_TAB_COLUMNS, USER_TAB_COLUMNS or in SQL*Plus use command "DESCRIBE [OWNER.]TABLE_NAME"
>
>Thanks very much.
>
>

Use the view DICTIONARY to see all the views available to users SELECT * FROM DICTIONARY; DL Kray
kray.donna_at_mlink.motors.ge.com Received on Tue Jan 23 1996 - 00:00:00 CET

Original text of this message