I answered a question similar to yours previously. Please see https://searchoracle.techtarget.com/answer/Restricting-password-changes. With a small number of modifications, I think you'll be able to use the same code to achieve what you need as well. Be aware that the user that fires this trigger will need to have the ALTER USER system privilege granted directly to them -- not through a role.
Dig Deeper on Oracle database security
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.