Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Database names?

Re: Database names?

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Wed, 19 Feb 2003 16:53:10 GMT
Message-ID: <MPG.18bd5651cfe296fd9896b0@news.la.sbcglobal.net>


james_at_nothing.com said...
> Hi there
> Can someone tell me how I can get the names of all the Databases on a
> server? I understand that the that the database structure of a n oracle
> server is very different to a SQL server.
>
> I wand to be able to determin all the names of all the database on the
> server that I'm working with.
> I'm using oracle 9i server and have full rights to the server!
>
> Hope someone can help.
> Thanks in Advance
> cheers
> James
>

You are so right! Oracle IS VERY DIFFERENT than MSSql! In Oracle, a database is called a schema, which is "owned" by a particular userid. Assuming you're using the MSSql term here, you can find all the schema owners (databases) by connecting as SYSTEM and:

  select username from dba_users;

This will give you all userids, not just schema owners. If you only want userids that have created (own) at least one table:

  select owner,table_name from dba_tables;

The "owner" is what MSSql (and MySQL) calls a database.

-- 
/Karsten
DBA > retired > DBA
Received on Wed Feb 19 2003 - 10:53:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US