Solved

show database, show all_tables ?

Posted on 2006-11-28
5
5,314 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks nav_kum_v, btw  desc emp  does not work.
0
 
LVL 7

Expert Comment

by:Daniel Stanley
Comment Utility
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.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now