Database Reference
In-Depth Information
This example shows how to create a common user account by using the CONTAINER=ALL
clause. You'll also grant the new user SET CONTAINER and CREATE SESSION privileges.
These privileges are required for common users to navigate between containers.
SQL> ALTER SESSION SET CONTAINER=cdb$root;
Session altered.
SQL>
SQL> CREATE USER c##my_dba
2 IDENTIFIED BY secret
3 DEFAULT TABLESPACE user_data
4 QUOTA 1G ON user_data
5 TEMPORARY TABLESPACE temp
6 CONTAINER = ALL;
User created.
SQL> GRANT SET CONTAINER, CREATE SESSION TO c##my_dba CONTAINER = ALL;
Grant succeeded.
SQL>
Creating Local Users
Since we've already created local users in previous examples, we'll just expand on the
concepts previously present. As mentioned, to create a local user you must be connected
to the PDB and have the CREATE USER privilege. The local username must not start
with C## or c## . The CONTAINER=CURRENT clause in the CREATE USER statement is implied
when you create a local user.
SQL> ALTER SESSION SET CONTAINER=lne6;
Session altered.
SQL> SHOW CON_NAME
CON_NAME
------------------
LNE6
Search WWH ::




Custom Search