Error instantiating EM configuration files – Admin Command Prompt Needed

I was redeploying DB Console to a test DB after a rebuild and hostname change on a Windows server. However, after the intial steps the deployment failed with a SEVERE: Error instantiating EM configuration files.

 

E:\oracle\product\11.2.0.4\db1\RDBMS\ADMIN>emca -config dbcontrol db -repos recreate

STARTED EMCA at 09-Mar-2017 14:45:26
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: db1
Listener port number: 1521
Listener ORACLE_HOME [ E:\oracle\product\11.2.0.4\db1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ E:\oracle\product\11.2.0.4\db1

Local hostname ................ server
Listener ORACLE_HOME ................ E:\oracle\product\11.2.0.4\db1
Listener port number ................ 1521
Database SID ................ db1
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
09-Mar-2017 14:45:53 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at E:\oracle\cfgtoollogs\emca\db1\emca_2017_03_09_14_45_25.log.
09-Mar-2017 14:45:58 oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
09-Mar-2017 14:49:47 oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
09-Mar-2017 14:49:48 oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
09-Mar-2017 15:02:49 oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
09-Mar-2017 15:03:00 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
09-Mar-2017 15:05:46 oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
09-Mar-2017 15:05:49 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing CMD /C E:\oracle\product\11.2.0.4\db1\bin\nmesrvops.exe delete OracleDBConsoledb1
09-Mar-2017 15:05:53 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing CMD /C E:\oracle\product\11.2.0.4\db1\bin\emctl.bat deploy dbconsole -d db1 E:\oracle\product\11.2.0.4\db1\server_db1 server:1830 server db1
09-Mar-2017 15:05:53 oracle.sysman.emcp.EMConfig perform
SEVERE: Error instantiating EM configuration files
Refer to the log file at E:\oracle\cfgtoollogs\emca\db1\emca_2017_03_09_14_45_25.log for more details.
Could not complete the configuration. Refer to the log file at E:\oracle\cfgtoollogs\emca\db1\emca_2017_03_09_14_45_25.log for more details.

Thankfully, the log file held a bit more details as to the problem, critical line in bold:

09-Mar-2017 15:05:53 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Creating shared install...
Source location: E:\oracle\product\11.2.0.4\db1
Destination (shared install) : E:\oracle\product\11.2.0.4\db1\server_db1
DeployMode : dbconsole

Creating directories...
Setting console properties ... 
Setting log and trace files locations for Console ... 
Setting log and trace files locations for Agent ...

09-Mar-2017 15:05:53 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: OpenSCManager FAILED: Access is denied.


Service creation failed. Aborting...

09-Mar-2017 15:05:53 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing CMD /C E:\oracle\product\11.2.0.4\db1\bin\emctl.bat deploy dbconsole -d db1 E:\oracle\product\11.2.0.4\db1\server_db1 server:1830 server db1 
09-Mar-2017 15:05:53 oracle.sysman.emcp.EMAgentConfig instantiateEMConfigFiles
CONFIG: Failed to deploy state dirs.

So, the installer was unable to create a new Service using the SCManager.

Solution? Rerun the installer in an Admin Command Prompt:

You may need to do a clear up job if the installer fails creating the registry (SEVERE: Error creating the repository):

SQL> drop user SYSMAN cascade;
User dropped.
SQL> drop role MGMT_USER;
Role dropped.

SQL> drop user MGMT_VIEW cascade;
User dropped.

SQL> drop public synonym MGMT_TARGET_BLACKOUTS;
Synonym dropped.

SQL> drop public synonym SETEMVIEWUSERCONTEXT;
Synonym dropped.

And then re-run using the Admin Command Prompt as above.

Leave a Reply