Oracle Database User Management
This is the simplest task for a Database Administrator.
Login to sqlplus session from your OS(Windows/Linux/AIX) using sysdba / a user who has create user privilege.
sqlplus / as sysdba
alter user <username> identified by <password>;
this will create a user with default tablespace and profile. Depending on the organization's policy and user's requirement you might need to mention few other options in the query. Those are advanced options you can explore more on my advance create user query.
Now user needs some privileges to connect to the database and do some transactions or query any tables.
CONNECT - this is the Oracle-defined default privilege for any user to be able to connect to the database.
grant connect to <username>;
alternatively, grant create session to <username>; will do the same.
Now, for the user to be able to query any table in the db, one basic privilege is required.
grant select any table to <username>;
This will create a db user in Oracle.
To see the user is created properly you can validate with below query.
select * from dba_users where username='<username>';
The dba_users is a data dictionary view which eventually being created from all_users. To know more about all_users and dba_users column properties stay tuned!!
Best Wishes!!
No comments:
Post a Comment
If you have any queries/ any suggestion please do comment and let me know.