Solved

show database, show all_tables ?

Posted on 2006-11-28
5
5,330 Views
Last Modified: 2008-01-09
hi guys, please view my screenshot :

http://img143.imageshack.us/img143/2308/sqldatamh8.jpg

this is capture from sql 2000, we can see the databases, tables easily in one view.

But what if I am using oracle 8i and oracle 10g ? how do I view it in sqlplus ? what is the command?

when i do a show database or show databases,  it say unknow show option database/databases.

i want to view all databases in one glance and the tables inside the database in one glance.

if i am in a command prompt, i wont know wat databases are running.

if i am in a command prompt,  i wont know wat tables are inside the database.

I want to learn the command.

THanks.


Thanks.


0
Comment
Question by:binary_1001010
5 Comments
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 125 total points
ID: 18034030
to see the database name :

select name from v$database; -- but for this you need privileges to access v$ data dictionary views.

select global_name from global_name;

to see the list of tables:

select * from cat ; -- from catalogue ..this gives a list of tables/views/synonyms etc which you have in your schema
select * from tab; -- this will give only tables

actually you have user_tables , all_tables , dba_tables which you can query accordingly. You have these views similarly for other objects like indexes which is user_indexes,all_indexes...,user_triggers,...user_synonyms..., user_views...

first give

desc emp  -- this is to see the structe of any table

Thanks


0
 
LVL 7

Expert Comment

by:Daniel Stanley
ID: 18034056
sqlplus is not a graphical tool, it's a command line tool. (PERIOD) if you want graphical representation of instances and database objects use the "Oracle Enterprise Manager Console" provided with 8i, or download a copy of Oracle Sql Developer and use it.

(sql developer)
http://www.oracle.com/technology/products/database/sql_developer/index.html

(OEM)
start menu -> programs -> Oracle - OraHome8i -> Enterprise Manager Console

or from command line.

C:> oemapp console

to do so make sure the Oracle home is in your path.

good luck,
daniels
0
 
LVL 17

Expert Comment

by:NicksonKoh
ID: 18034089
Hi binary_1001010,

For Oracle 8i, there is the DBA Studio. In Oracle 10g, I think they change it to Enterprise Manager. You should be able to find this tool when u install Oracle. These will be choice that I use to manage the database objects ONLY when there is no TOAD installed on the machine otherwise, usually I would use TOAD which is much faster and more user friendly to use.

Cheers
Nickson
0
 
LVL 9

Author Comment

by:binary_1001010
ID: 18034243
thanks nav_kum_v, btw  desc emp  does not work.
0
 
LVL 7

Expert Comment

by:Daniel Stanley
ID: 18034800
try "sql> desc scott.emp" if you are logged in as a user other than "scott". if logged in as scott then "sql> desc emp" will work if table does exist.

regards,
daniels
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question