Thursday 15 October 2015

Configure Oracle Enterprise Manager on Windows







This post will Specially help you to run Oracle Enterprise Manager on Windows 7,Windows 8 and Windows 2012

If you are receiving following error this will help.

CONFIG: OpenSCManager FAILED: Access is denied.

Tips

0. Always Assign Static IP to your Machine in windows host file.
1. Change IP to Machine name as listed below.
2. Run CMD as administrator
3. Execute Drop EM Repo Command
4. Unlock DBSNMP and SYSMAN  users
5. Execute Create EM Repo Command

These are the steps:
1. Change the %ORACLE_HOME%\network\admin\listener.ora file from an IP number to machine name.
2. Change the %ORACLE_HOME%\network\admin\tnsnames.ora file from an IP number to a machine name.
3. Change the C:\WINDOWS\System32\drivers\etc\hosts file by adding this line beneath the default localhostline (for the new Hostname value):
127.0.0.1       localhost
192.168.10.22  win7-22
4. Change the Windows hostname by right click mycomputer >properties>change settings>change
and change the computername
5. Reboot the machine to set the networking. Unlock the SYSMAN account because it ensures that emca can drop it and all dependencies. Then, drop the em configuration with the following commands.
Start cmd As administrator
C:\Data> set ORACLE_SID=orcl
C:\Data> emca -deconfig dbcontrol db -repos drop


6. You’ll receive the following prompts, enter the Oracle SID and Port number without double quotes but you must enter all passwords with double quotes (at least in Oracle Database 11g):
Oracle Database 11gR1
STARTED EMCA at Jul 13, 2008 8:26:42 AM
EM Configuration Assistant, Version 11.1.0.5.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
 
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Oracle Database 11gR2
STARTED EMCA at Sep 3, 2012 7:40:07 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.
 
Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
 
Do you wish to continue? [yes(Y)/no(N)]: y
7. If you failed to unlock the SYSMAN account in step #5, you should drop the SYSMAN user manually. If youdon’t drop the SYSMAN schema, you’ll raise an error when you try to recreate it:
CONFIG: ORA-20001: SYSMAN already EXISTS..
ORA-06512: at line 17
 
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already EXISTS..
ORA-06512: at line 17
The Java stack trace will look like this, more or less based on version and release:
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1530)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:880)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:492)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:218)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:222)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:535)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1215)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:519)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:468)
Drop the user and dependent on version a few other objects, like:
DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view;
8. You can then create the em environment with the following syntax:
C:\Data> emca -config dbcontrol db -repos create
9. Again, you’ll receive the following prompts, enter the Oracle SID and Port number without double quotes but you must enter all passwords with double quotes (at least in Oracle Database 11g):

C:\>emca -config dbcontrol db -repos create

STARTED EMCA at Oct 15, 2015 2:57:02 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: ow113
Listener port number: 1521
Listener ORACLE_HOME [ C:\oracle\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for DBSNMP user: Oct 15, 2015 2:57:22 PM oracle.sysman.emcp.util.Genera
lUtil initSQLEngineLoacly
WARNING: ORA-28000: the account is locked
Password for SYSMAN user: Terminate batch job (Y/N)? y
C:\Windows\system32>sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 15 14:57:34 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter user DBSNMP account unlock;
User altered.
SQL> exit
C:\>emca -config dbcontrol db -repos create
STARTED EMCA at Oct 15, 2015 3:03:55 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: ow113
Listener port number: 1521
Listener ORACLE_HOME [ C:\oracle\product\11.2.0\dbhome_1 ]:
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 ................ C:\oracle\product\11.2.0\dbhome_1
Local hostname ................ SUPPER-1049
Listener ORACLE_HOME ................ C:\oracle\product\11.2.0\dbhome_1
Listener port number ................ 1521
Database SID ................ ow113
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y

No comments:

Post a Comment