创建用户默认的是container=all,在cdb中只能创建全局用户(c##开头),会在cdb和所有的pdb中创建该用户(但是pdb中的全局用户需要另外授权才能够在pdb中访问)。在pdb中只能创建的用户为本地用户
用户授权
SQL>
grant
connect
to
c##xff; Grant
succeeded. SQL>
select
GRANTEE,con_id from
cdb_ROLE_PRIVS where
GRANTED_ROLE='CONNECT'
AND
GRANTEE='C##XFF'; GRANTEE
CON_ID------------------------------
----------C##XFF
1 SQL>
grant
resource to
c##xff container=all; Grant
succeeded. SQL>
select
GRANTEE,con_id from
cdb_ROLE_PRIVS where
GRANTED_ROLE='RESOURCE'
AND
GRANTEE='C##XFF'; GRANTEE
CON_ID------------------------------
----------C##XFF
1C##XFF
3
用户授权默认情况下是只会给当前container,在cdb中也可以指定container=all,对所有open的pdb且存在该用户都进行授权
修改参数
SQL>
alter
system set
open_cursors=500 container=all; System
altered. SQL>
conn sys/xifenfei@pdb1 as
sysdbaConnected.SQL>
show parameter open_cursors; NAME
TYPE VALUE------------------------------------
----------- ------------------------------open_cursors
integer
500SQL>
alter
system set
open_cursors=100; alter
system set
open_cursors=100*ERROR
at
line 1:ORA-01219:
database
or
pluggable database
not
open:
queries allowed on
fixedtables
or
views only SQL>
alter
database
open; Database
altered. SQL>
alter
system set
open_cursors=100; System
altered. SQL>
show parameter open_cursors; NAME
TYPE VALUE------------------------------------
----------- ------------------------------open_cursors
integer
100SQL>
conn / as
sysdbaConnected.SQL>
show parameter open_cursors; NAME
TYPE VALUE------------------------------------
----------- ------------------------------open_cursors
integer
500
这里可以看到在cdb中修改,pdb会继承进去;如果在pdb中修改会覆盖pdb从cdb中继承的参数含义