To enable the role user_admin
in the current session, you would use the SET ROLE
statement.
Let's go through each option to understand why it is correct or incorrect:
Option A) alter session enable role user_admin;
- This option is incorrect because the ENABLE ROLE
statement is used to enable a role for a specific user, not for the current session.
Option B) alter session set role user_admin;
- This option is incorrect because the SET ROLE
statement is missing. The correct syntax for enabling a role using the SET ROLE
statement would be ALTER SESSION SET ROLE user_admin;
.
Option C) alter role user_admin enable;
- This option is incorrect because the ALTER ROLE
statement is used to modify the properties of a role, not to enable it for the current session.
Option D) set role user_admin;
- This option is correct because the SET ROLE
statement is used to enable a role for the current session. Therefore, the correct answer is option D.
The correct answer is option D.