Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I view which databases are available

Status
Not open for further replies.

ProgrammingB52

Technical User
May 7, 2003
37
0
0
US
In MySQL it is
show databases; What is the command to view all of the databases available?
 
Hi,
Read the Oracle concepts manual ( and other Oracle docs at
)..Oracle does not use the term database the same way as MySql..What you may be looking for is a listing of all the Tables you can access..The differences in process and even naming conventions between Oracle and other databases ( especially MySql and SqlServer) are substantial and will lead to confusion when trying to move from one to the other..This is a case where 'Read First..Act After' is very important.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
ProgrammingB52,

Turkbear is absolutely correct: Oracle's terminology (especially "database") differs from other database vendors' terminology. In MySQL, the "show databases" command displays the equivalent of Oracle's command:
Code:
select username from dba_users;
For non-Oracle database environments, database "users" (aka "logins") and the discrete collection of tables to which those logins may have default access (known as "databases" in the non-Oracle world, but known as "schemas" in the Oracle world) have no mutual dependencies. In the Oracle world, an Oracle "user" by definition has a "schema" by the same name. If you drop an Oracle user, then you also drop the schema ("database" for non-Oracle vendors) by the same name. An Oracle database user and the database schema by the same name are inextricable.

So, to see the list of Oracle users/schemas (roughly equivalent to MySQL "databases"), then you use the SELECT, above.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)

Do you use Oracle and live or work in Utah, USA?
Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Using select username from dba_users I get the error message ' table or view does not exist' Does that mean that there are no databases that I am privelaged to?
 
Hi,
No,It means you do not have access to the dba_tables table..
Try all_users or sys.dba_users..

If they fail, ask the Oracle DBA to grant your user account the needed privs..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top