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: sql command to list all databases in the oracle server

Re: sql command to list all databases in the oracle server

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 30 Dec 2006 12:33:48 -0800
Message-ID: <1167510822.133853@bubbleator.drizzle.com>


Martijn wrote:

> DA Morgan wrote:

>> dalu.gelu_at_gmail.com wrote:
>>> Hi,
>>>
>>> could u help me, what is the sql command to list all existing databases
>>> in a oracle server?
>> Oracle IS NOT SQL Server
>> Oracle IS NOT Sybase
>> Oracle IS NOT Informix
>> Oracle IS NOT Ingres
>>
>> Thus your question has no meaning.
>>
>> In Oracle a "database" is a set of related physical files sitting on
>> disk. It has nothing to do with the use of that word in other products.
>>
>> The word you are looking for is SCHEMA and the query you are asking for is:
>>
>> SELECT username, account_status
>> FROM dba_users
>> ORDER BY 1;
>>
> 
> Wouldn't this show more then the "schema-owners".
> I looked it up in the (oracle 10) documentation : "A schema is a
> collection of database objects. A schema is owned by a database user
> and has the same name as that user."
> 
> I think the above query will show all users in the database. Probably a
> lot of them are not schema-owners.
> 
> So ... if you are looking for schema's (ofcourse identified by
> username) you better could use the following query?
> select distinct username from dba_objects;
> 
> anyway ...... everybody have a wonderfull 2007
> 
> Best regards,
> 
> Martijn Bos
> 

>> For more information try the following:
>> http://tahiti.oracle.com
>> http://www.psoug.org (and click on Morgan's Library)
>>
>> HTH
>> --
>> Daniel A. Morgan
>> University of Washington
>> damorgan_at_x.washington.edu
>> (replace x with u to respond)
>> Puget Sound Oracle Users Group
>> www.psoug.org

Then do this instead:

SELECT DISTINCT owner
FROM dba_objects
ORDER BY 1;

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sat Dec 30 2006 - 14:33:48 CST

Original text of this message

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