unlock orcladmin password in shell script

Shell script to check if orcladmin account is locked, and unlock it if required

# Check to see if orcladmin account is locked, and unlock it if it is.
if [ "`ldapbind -p <myport> -D cn=orcladmin -w <myorcladminpassword>`" = "bind successful" ]
then
   echo orcladmin account is ok, is not locked.
else
   echo unlocking orcladmin account...
   oidpasswd connect=<mydatabase> unlock_su_acct=true <<END_PASSWD
<databasepassword_of_user_ods>
END_PASSWD
fi

Useful for running from cron for an environment where orcladmin repeatedly gets locked.

The -p port is optional depending on configuration.

If you don’t know the password of the ODS database user account, you can change it temporarily using this method.

This entry was posted in Oracle forms, Scripts, Security. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>