Wednesday 28 October 2015

How to reset the Weblogic admin server password

If you lose or forget your weblogic admin server password, and you can follow the below steps to reset it.

Here we tested it in Weblogic server 10.3..

Step 1:
Set the following environment variables (update the domain name    as appropriate):

export FMW_HOME=/u01/app/oracle/product/middleware
export DOMAIN_HOME=$FMW_HOME/user_projects/domains/<domain_name>
export CLASSPATH=$CLASSPATH:$MW_HOME/wlserver_10.3/server/lib/weblogic.jar

Run the env as shown below.
. $DOMAIN_HOME/bin/setDomainEnv.sh

Step 2:
Shut down your weblogic domain:
$DOMAIN_HOME/bin/stopWebLogic.sh

Step 3:
Rename and backup the DefaultAuthenticatorInit.ldift file as shown below,

cd $DOMAIN_HOME/security
mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift.old

Now run the following command to generate a new DefaultAuthenticatorInit.ldift file. ((here ‘weblogic’ is default username))

java weblogic.security.utils.AdminAccount <username> <new_password> .

Note: Don't forget the period "." at the end of the this command, otherwise you will get "Error: Invalid arguments"

Rename and backup the following LDAP directory.

mv $DOMAIN_HOME/servers/AdminServer/data/ldap $DOMAIN_HOME/servers/AdminServer/data/ldap.old
(This ldap directory will be recreated once weblogic server startup time)

Step 4:

Back and Edit the boot.properties file and update the new password. (Above new_password)

cd $DOMAIN_HOME/servers/AdminServer/security
cp boot.properties  boot.properties_old

vi boot.properties
password=<username>
username=<new_password>

(Note: New password will be encrypted once server starts)

Step 5:

Now start your weblogic domain.

[oracle@fa bin]# cd /root/MW_home/user_projects/domains/base_domain/bin/
[oracle@fa bin]# ls
nodemanager  nohup.out  server_migration  service_migration  setDomainEnv.sh 
startManagedWebLogic.sh  startWebLogic.sh  stopManagedWebLogic.sh  stopWebLogic.sh
[oracle@fa bin]# nohup ./startWebLogic.sh &
[oracle@fa bin]# nohup: appending output to `nohup.out'
[oracle@fa bin]# tail -f nohup.out 

Server state during the startup:
<Aug 7, 2013 11:07:18 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> 
<Aug 7, 2013 11:07:18 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> 
<Aug 7, 2013 11:07:21 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> 
<Aug 7, 2013 11:07:21 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> 
<Aug 7, 2013 11:07:22 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> 
<Aug 7, 2013 11:07:22 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode> 

Now you can access your weblogic console page.

Hope this post will helps you :)

No comments:

Post a Comment