Database Reference
In-Depth Information
Role created.
SQL> GRANT lne_boss TO lne_nd, smith06;
Grant succeeded.
SQL> ALTER USER lne_nd DEFAULT ROLE lne_boss;
User altered.
SQL>
You must grant a role to a user before you can make that role a default role for that user.
Altering Common or Local User Accounts Using the
ALTER USER Statement
Use the
ALTER USER
statement to alter a common or local user in a multitenant envi-
ronment. Once a user is created as a local user or common user, you cannot alter it to
become the other type.
You can, however, grant common users access to objects in PDBs. In this example, we'll
use the
ALTER USER
statement to alter the common user
c##my_dba
, created in a previous
example, so that this user can access the contents of the
V$SESSION
view in the PDBs
PDB1
,
PDB2
, and
LNE6
when logged into
CDB$ROOT
.
SQL> CONNECT sys/system@CONT as SYSDBA
Connected.
SQL> ALTER USER c##my_dba
3 QUOTA 2G ON user_data
4 SET CONTAINER_DATA = (cdb$root, pdb1, pdb2, lne6)
5 FOR V$SESSION CONTAINER = CURRENT;
User altered.
SQL>
If you do not include the current container (in this case
CDB$ROOT
), you will receive an
ORA-65057 error message. The
ALTER USER
statement in this example modifies the settings
for the user
c##my_dba
as follows:
QUOTA 2G
This setting gives the user up to 2 G of space on the
user_data
tablespace.
Search WWH ::
Custom Search