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
<mydatabasepassword>
END_PASSWD
fi

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

The -p port is optional depending on configuration.

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>