One mistake can lead to a lot of work. When you’ve installed Oracle Database 11g, you can’t change the<br />Windows Hostname without reinstalling Oracle Enterprise Manager.</p><p>These are the steps:</p><p>1. Change the %ORACLE_HOME%\network\admin\listener.ora file from an IP number to machine name.</p><p>2. Change the %ORACLE_HOME%\network\admin\tnsnames.ora file from an IP number to a machine name.</p><p>3. Change the C:\WINDOWS\System32\drivers\etc\hosts file by adding this line beneath the default<br />localhost line (for the new Hostname value):</p><p>127.0.0.1 localhost<br />172.16.113.128 mclaughlin11g mclaughlin11g.techtinker.com</p><p>4. Change the Windows hostname by navigating: Start > Control Panel > System (classic view) from the<br />random assignment of VMWare Fusion.</p><p>5. Reboot the machine, and then drop the em configuration with the following commands:</p><p>C:\Data> set ORACLE_SID=orcl<br />C:\Data> emca -deconfig dbcontrol db -repos drop</p><p>6. You’ll receive the following prompts, enter the Oracle SID and Port number without double quotes but you<br />must enter all passwords with double quotes (at least in Oracle Database 11g):</p><p>STARTED EMCA at Jul 13, 2008 8:26:42 AM<br />EM Configuration Assistant, Version 11.1.0.5.0 Production<br />Copyright (c) 2003, 2005, Oracle. All rights reserved.</p><p>Enter the following information:<br />Database SID: orcl<br />Listener port number: 1521<br />Password for SYS user:<br />Password for SYSMAN user:<br />Password for SYSMAN user:<br />Do you wish to continue? [yes(Y)/no(N)]: y</p><p>7. You should then drop the SYSMAN user manually because it doesn’t happen without your assistance (or, it<br />didn’t happen when I did it). If you don’t drop the SYSMAN schema, you’ll raise an error when you try to<br />recreate it:</p><p>CONFIG: ORA-20001: SYSMAN already EXISTS..<br />ORA-06512: at line 17</p><p>oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-20001: SYSMAN already EXISTS..<br />ORA-06512: at line 17The Java stack trace will look like this, more or less based on version and release:</p><p>at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1530)<br />at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:880)<br />at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java<br />at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java<br />at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:492)<br />at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:218)<br />at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:147)<br />at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:222)<br />at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:535)<br />at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1215)<br />at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:519)<br />at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:468)</p><p>Drop the user and dependent on version a few other objects, like:</p><p>DROP USER sysman CASCADE;<br />DROP PUBLIC SYNONYM setemviewusercontext;<br />DROP ROLE mgmt_user;<br />DROP PUBLIC SYNONYM mgmt_target_blackouts;<br />DROP USER mgmt_view;8. You can then create the em environment with the following syntax:</p><p>C:\Data> emca -config dbcontrol db -repos create</p><p>9. Again, you’ll receive the following prompts, enter the Oracle SID and Port number without double quotes but<br />you must enter all passwords with double quotes (at least in Oracle Database 11g):</p><p>STARTED EMCA at Jul 13, 2008 8:28:48 AM<br />EM Configuration Assistant, Version 11.1.0.5.0 Production<br />Copyright (c) 2003, 2005, Oracle. ALL rights reserved.</p><p>Enter the following information:<br />DATABASE SID: orcl<br />Listener port NUMBER: 1521<br />Password FOR SYS USER:<br />Password FOR DBSNMP USER:<br />Password FOR SYSMAN USER:<br />Password FOR SYSMAN USER: Email address FOR notifications (optional):<br />Outgoing Mail (SMTP) server FOR notifications (optional):<br />-----------------------------------------------------------------</p><p>You have specified the following settings</p><p>DATABASE ORACLE_HOME ................ C:\app\Administrator\product\11.1.0\db_1</p><p>LOCAL hostname ................ mclaughlin11g<br />Listener port NUMBER ................ 1521<br />DATABASE SID ................ orcl<br />Email address FOR notifications ...............<br />Outgoing Mail (SMTP) server FOR notifications ...............</p><p>-----------------------------------------------------------------</p><p>Do you wish TO continue? [yes(Y)/no(N)]: y</p><p>A note to me, remember haste makes waste. I’m just glad that rebuilding the MarkLogic server was easy.</p><p>
FROM: http://blog.mclaughlinsoftware.com/oracle-architecture-configuration/changing-windows-hostname-and-oracle-enterprise-manager/