February 14th, 2013, 07:49 AM
List exiting databases in Oracle server using SQL plus command
I am using Oracle database server and I want to show existing databases on that server. Are there any SQL plus command to list all databases there in the server?
February 14th, 2013, 08:52 AM
Are you sure you want to list databases? A database in Oracle is something completely different than e.g. in SQL Server or MySQL.
In case you do mean database (which I doubt): no, there is no SQL command to list those.
Each database is (more or less) a different Oracle installation.
Those are listed in /etc/oratab in Linux systems. Under Windows those would show up in the system registry.
However a database in SQL Server or MySQL is usually mapped to a user/schema in Oracle (a user is basically the same as a schema there).
To see all schemas in the current database (to which you are connected in SQL*Plus) you can use the view ALL_USERS (or DBA_USERS).
More details are available in the manual: http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_2129.htm#i1593342
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
Tips on how to ask better questions: