Database Reference
In-Depth Information
SQL> CREATE USER another_user IDENTIFIED BY another;
User created.
SQL>
It is not permitted to have common users and local users with the same name; this is
enforced by the common user naming requirement. You can use the same name for local
users in different PDBs. To find the names of existing user accounts, query the ALL_USERS ,
CDB_USERS , DBA_USERS , and USER_USERS data dictionary views. This example repeats the
previous examples of how to create a local user and includes the CONTAINER=CURRENT clause.
SQL> ALTER SESSION SET CONTAINER=lne6;
Session altered.
SQL> CREATE USER lne_nd_n
2 IDENTIFIED BY cgyoomm
3 DEFAULT TABLESPACE user_data
4 QUOTA 1G ON example
5 TEMPORARY TABLESPACE temp
6 CONTAINER = CURRENT;
User created.
SQL> GRANT CREATE SESSION to lne_nd_n;
Grant succeeded.
SQL>
Again, if you have the appropriate privileges as either a common or local user connected
to a PDB, you can create local user accounts.
Default Role for a User
A role is a named group of related privileges that you grant to users or other roles. You can
assign zero or more default roles to a user. When you create a user, the default role setting
for the user is ALL , which means that roles granted to the user will automatically be default
roles. When a user creates a session, their default roles are automatically enabled.
Use the ALTER USER statement to change the default roles for the user, for example:
SQL> CREATE ROLE lne_boss;
Search WWH ::




Custom Search