User Management

Creating a User

Once you connect as a sysdba user, simply you can execute the CREATE USER command to generate a new DB user.

Here is the command:

SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=true;


Session altered.

SQL> CREATE USER phonebookdba IDENTIFIED BY "p123!@#";

User created.

Note if you get ORA-65096: invalid common user or role name error run 

SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=true;

Grant Access

Grant to CONNECT role

The CONNECT role was established with

Alter Session Create Session
Create Cluster Create Synonym
Create Database Link Create Table
Create Sequence Create View

Refer to Addressing The CONNECT Role Change for more information

Here is the command to grant a user CONNECT role:

SQL> GRANT CONNECT TO phonebookdba;

Grant a user to be DBA

Sometimes you need to create a user with more privileges like allowing the user to create named types for custom schemas or even the DBA role that allows the user to not only create custom named types but alter and destroy them as well.

SQL> GRANT CONNECT, RESOURCE, DBA TO phonebookdba;

 

Alter User

 

Drop User

 

Leave a Reply