Oracle Users

Oracle Database

Create a user

1
CREATE USER MYUSER IDENTIFIED BY MYPASSWORD DEFAULT TABLESPACE USERS TEMPORARY TABLESPAE TEMP;

Lock a user

1
ALTER USER MYUSER ACCOUNT LOCK;

Unlock a user

1
ALTER USER MYUSER ACCOUNT UNLOCK;

Drop a user

1
DROP USER MYUSER CASCADE;

Get default tablespace for user

1
SELECT DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME = 'MYUSER';

View objects in tablespace

1
SELECT * FROM dba_segments WHERE TABLESPACE_NAME='MYUSER' ORDER BY bytes DESC;