Why doesn't PL/SQL respect privileges granted by Roles?

后端 未结 5 942
我在风中等你
我在风中等你 2021-01-14 15:26

When executing a PL/SQL block, any privileges granted to roles are ignored. Instead you must give specific users specific grants to run it. If I want to give DBAs access to

5条回答
  •  梦谈多话
    2021-01-14 16:17

    It's probably a combination of laziness and the SET ROLE command.

    I disagree that it's not allowed because of complex dependencies. Oracle already manages complex dependencies. And in 12c it is possible to grant a role to an object.

    I think the real reason why objects don't inherit the roles of the user is because of the SET ROLE command. It's possible for a user to be assigned a role but to turn it on and off within a session. That's a silly feature and I've never seen it used. But theoretically it would require recompiling within the same session or transaction, which would be really confusing.

提交回复
热议问题