Ask Your Question
1

How can I create an Oracle SQL Query that will generate a list of all the Schemas present in a Database?

asked 2022-11-02 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-21 19:00:00 +0000

david gravatar image

You can use the following Oracle SQL Query to generate a list of all the Schemas present in a Database:

SELECT username 
FROM dba_users 
WHERE account_status = 'OPEN' 
AND default_tablespace not in ('SYSTEM','SYSAUX');

This query will give you a list of all the active user accounts in the database that are not associated with the 'SYSTEM' and 'SYSAUX' tablespaces. These accounts represent the schemas in the database.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-11-02 11:00:00 +0000

Seen: 7 times

Last updated: May 21 '22