Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SQL Query for listing all Schemas in a DB

Tags:

oracle

plsql

I wanted to delete some unused schemas on our oracle DB.

How can I query for all schema names ?

like image 527
vicsz Avatar asked Jan 28 '11 21:01

vicsz


People also ask

How do I list all tables in a schema in Oracle SQL?

If you want to list all tables in the Oracle database, you can query the dba_tables view. SELECT table_name FROM dba_tables ORDER BY table_name ASC; This view (and all others starting with dba_) are meant for database administrators.

How do I find the database schema name in Oracle?

select owner, table_name from all_tables.


1 Answers

Using sqlplus

sqlplus / as sysdba

run:

 SELECT *  FROM dba_users 

Should you only want the usernames do the following:

 SELECT username  FROM dba_users 
like image 173
a_horse_with_no_name Avatar answered Sep 21 '22 08:09

a_horse_with_no_name