Wednesday, September 29, 2010

Oracle Database queries

To know the current user in Oracle
select user from dual;
Steps to know list of users in the Oracle database.
Connec to dba user
conn sys/password as sysdba;
execute below query to get list of users
select * from dba_users;
To select only user names:
select username from dba_users;
To know the full details about the user:
select * from dba_users where username='scott';
To get the Table space name:
select tablespace_name from dba_tablespaces;
To list the username and size of the user:
select owner,sum(bytes) from dba_segments group by owner;

No comments: