I have a plsql job that runs as a specific user, and I need to perform a grant to give this user access to specific tables until the job completes. The job never takes more than 30 minutes.
My question is, in oracle is there anyway to grant a specific user access to a table for a limited amount of time, or should I just create another function to revoke privileges after the job is complete? I did a few quick searches and was unable to find anything on this. Does anyone know if this is possible?
It would be awesome if I could do grant all for 30 minutes.
To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';
Login to SQL Server Management Studio. In Object Explorer on the left pane, expand the Databases folder and select the concerned database and navigate to the by expanding Security and Users folders. Right-click the User to which you want to GRANT or REVOKE the permissions.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With