Which command do you use to create a local role while you are connected as the local user?

Which command do you use to create a local role while you are connected as the local user?

Which command do you use to create a local role while you are connected as the local user?

A.
create local role l_hr;

B.
create role c##_hr container=current;

C.
create role l_hr container=current;

D.
create role l_hr container=all;



Leave a Reply 5

Your email address will not be published. Required fields are marked *


ana

ana

c

At the time of this writing, multitenant databases are not part of the OCA
exam objectives. When creating users in multitenant databases, you may
use the CONTAINER=ALL clause to create a common user in all pluggable
databases connected to the root container. Common usernames must
begin with C##. To create a local user in a pluggable database, use the
CONTAINER=CURRENT clause connected to the pluggable database.

Giovani Hernandez

Giovani Hernandez

Yes, is correcta answer C.

https://oracle-base.com/articles/12c/multitenant-manage-users-and-privileges-for-cdb-and-pdb-12cr1

Granting Roles and Privileges to Common and Local Users
The rules for granting privileges and roles can seem a little confusing at first. Just remember, if you connect to a PDB and only deal with local users and roles, everything feels exactly the same as pre-12c databases. It’s only when you start to consider the scope of common users and roles that things become complicated.
The basic difference between a local and common grant is the value used by the CONTAINER clause.
— Common grants.
CONN / AS SYSDBA

GRANT CREATE SESSION TO c##test_user1 CONTAINER=ALL;
GRANT CREATE SESSION TO c##test_role1 CONTAINER=ALL;
GRANT c##test_role1 TO c##test_user1 CONTAINER=ALL;

— Local grants.
CONN system/password@pdb1
GRANT CREATE SESSION TO test_user3;
GRANT CREATE SESSION TO test_role1;
GRANT test_role1 TO test_user3;