I got an error when trying to start Oracle Enterprise Manager Cloud Control 12c. It says AdminServer couldn’t be started:
ManagementException: Unable to obtain lock”
message. As you know, Enterprise Manager Cloud Control uses Weblogic.
Weblogic uses “lock” (*.lok) files to prevent a server to run multiple
times. I checked if EMGC_ADMINSERVER is running:
[oracle@oem12c bin]$./emctl start oms Oracle Enterprise Manager Cloud Control 12c Release 3 Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved. Starting Oracle Management Server... Starting WebTier... WebTier Successfully Started Oracle Management Server Already Started AdminServer Could Not Be Started Check Admin Server log file for details: /u01/oracle/gc_inst/user_When I examined the EMGC_ADMINSERVER.out file, I see that “<BEA-141281> <unable to get file lock, will retry …> weblogic.management.projects/ domains/GCDomain/servers/EMGC_ ADMINSERVER/logs/EMGC_ ADMINSERVER.out
ps -ef | grep EMGC_ADMINSERVERand see that it’s not up, so it’s obvious that somehow locks files were not properly cleaned. I shutdown the rest of OMS processes:
[oracle@oem12c bin]$./emctl stop oms -all Oracle Enterprise Manager Cloud Control 12c Release 3 Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved. Stopping WebTier... WebTier Successfully Stopped Stopping Oracle Management Server... Oracle Management Server Successfully Stopped AdminServer Already Stopped Oracle Management Server is Downthen searched for the lock files and removed them
[root@oem12c ~]# locate *.lok | grep EMGC_ADMINSERVER /u01/oracle/gc_inst/user_After removing the lock files, I succesfully started OMS including AdminServer.projects/domains/GCDomain/ servers/ EMGC_ADMINSERVER/data/ldap/ ldapfiles/EmbeddedLDAP.lok /u01/oracle/gc_inst/user_ projects/domains/GCDomain/ servers/ EMGC_ADMINSERVER/tmp/EMGC_ ADMINSERVER.lok [root@oem12c ~]# rm /u01/oracle/gc_inst/user_ projects/domains/GCDomain/ servers/ EMGC_ADMINSERVER/data/ldap/ ldapfiles/EmbeddedLDAP.lok [root@oem12c ~]# rm /u01/oracle/gc_inst/user_ projects/domains/GCDomain/ servers/ EMGC_ADMINSERVER/tmp/EMGC_ ADMINSERVER.lok