GRANT Table Permissions for a limited amount of time GRANT Table Permissions for a limited amount of time oracle oracle

GRANT Table Permissions for a limited amount of time


The comment from @ksa is the correct answer for this. You should create a new user with exactly the permissions required, and define this procedure on that schema. You can then GRANT EXECUTE on this procedure to the role or users that need to run it. Although it is the default, you can also explicitly specify AUTHID DEFINER. In essence this means the procedure runs as the definer no matter who calls it. It saves you from any timing/scheduling issues and the permissions are clear to your successors. If you don't like having to specify the schema on every call, you can define a synonym.


There is a method in plsql called grantAccess(). It allows for you to give the number of seconds that a user is granted access for.

So, if you wanted to give them access for, say, a year, you would write the following:

rightSideUser.grantAccess(31536000)