1Z0-497 · Question #11
Which command do you use to create a local role while you are connected as the local user?
The correct answer is C. create role l_hr container=current. Rules for Creating Common Roles - When you create the common role, you must follow special rules. - Ensure that you are in the root. You cannot create common roles from a PDB. To check if you are in the root, run the show con_name command. The output should be CDB$ROOT…
Question
Which command do you use to create a local role while you are connected as the local user?
Options
- Acreate local role l_hr;
- Bcreate role c##_hr container=current;
- Ccreate role l_hr container=current;
- Dcreate role l_hr container=all;
How the community answered
(39 responses)- A8% (3)
- B3% (1)
- C79% (31)
- D10% (4)
Explanation
Rules for Creating Common Roles - When you create the common role, you must follow special rules. - Ensure that you are in the root. You cannot create common roles from a PDB. To check if you are in the root, run the show con_name command. The output should be CDB$ROOT. - Ensure that the name that you give the common role starts with C## or c## and contains only ASCII or EDCDIC characters. Note that this requirement does not apply to the names of existing Oracle-supplied roles, such as DBA or RESOURCE. - Optionally, set the CONTAINER clause to ALL. As long as you are in the root, if you omit the CONTAINER = ALL clause, then by default the role is created as a common role. Rules for Creating Local Roles - To create a local role, you must follow special rules. - To create a local role, you must be connected to the PDB in which you want to create the role, and have the CREATE ROLE privilege. - The name that you give the local role must not start with C## or c##. - You can include CONTAINER=CURRENT in the CREATE ROLE statement to specify the role as a local role. If you are connected to a PDB and omit this clause, then the CONTAINER=CURRENT clause is implied. - You cannot have common roles and local roles with the same name. However, you can use the same name for local roles in different PDBs. To find the names of existing roles, query the CDB_ROLES and DBA_ROLES data dictionary views.
Topics
Community Discussion
No community discussion yet for this question.