procedure to give ALTER USER to another [message #641929] |
Thu, 27 August 2015 13:37  |
 |
wolffjw
Messages: 3 Registered: August 2015 Location: Florida
|
Junior Member |
|
|
I'm a DBA and I have some cases wherein a certain user needs ability to alter another user's password since he is the application administrator.
Naturally, I do not want him to be able to alter Oracle administrative accounts, or any other administrative accounts for that matter. Only actual "user" accounts.
Can someone please help me with this? I know basically that a procedure owned by someone with alter user privilege needs to be written with: execute immediate alter user '&user' identified by '&pass', and then execute grant on it to the person who I want to be able to execute it.
But I don't know much about writing procedures and how to do the checking that it is not an Oracle account, or an application admin account. I'm assuming to use a where clause where it only allows changing a user's password that has USERS as the default tablespace, or perhaps DEFAULT as the profile since they would only apply to actual end users and not system accounts (in our case because of the way we manage our databases for security reasons).
Can someone help please with the code for the procedure?
[Updated on: Thu, 27 August 2015 13:39] Report message to a moderator
|
|
|
|
|
|
|
|
Re: procedure to give ALTER USER to another [message #641942 is a reply to message #641941] |
Thu, 27 August 2015 15:03  |
 |
Michel Cadot
Messages: 68758 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:Is that how the procedure works?
Yes.
"DBADMIN" is what I call target user in the script.
"Current user" is the user who executes the script, creates the package in target user schema and grants it the needed privileges.
|
|
|