Automate with a command script
Your operating system probably supports automatic execution of command scripts. In most operating environments, interactive SQL tools such as DB-Access accept commands and SQL statements to execute from the command line. You can combine these two features to automate privilege maintenance.
The
details depend on your operating system and the version of the interactive
SQL tool that you are using. You must create a command script that
performs the following functions:
- Takes a user ID whose privileges are to be changed as its parameter
- Prepares a file of GRANT or REVOKE statements customized to contain that user ID
- Invokes the interactive SQL tool (such as DB-Access) with parameters that tell it to select the database and execute the prepared file of GRANT or REVOKE statements
In this way, you can reduce the change of the privilege class of a user to one or two commands.