Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Database names?
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 > DBAReceived on Wed Feb 19 2003 - 10:53:10 CST