Tuesday, February 4, 2014

Reconfigure Oracle EM 11g

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 localhost line (for the new Hostname value):
127.0.0.1       localhost
172.16.113.128  mclaughlin11g mclaughlin11g.techtinker.com
4. Change the Windows hostname by navigating: Start > Control Panel > System (classic view) from the random assignment of VMWare Fusion.
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.
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 you don’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):
STARTED EMCA at Jul 13, 2008 8:28:48 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 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:\app\Administrator\product\11.1.0\db_1
 
LOCAL hostname ................ mclaughlin11g
Listener port NUMBER ................ 1521
DATABASE SID ................ orcl
Email address FOR notifications ...............
Outgoing Mail (SMTP) server FOR notifications ...............
 
-----------------------------------------------------------------
 
Do you wish TO continue? [yes(Y)/no(N)]: y
A note to me, remember haste makes waste. I’m just glad that rebuilding the MarkLogic server was easy.

Source:http://blog.mclaughlinsoftware.com/oracle-architecture-configuration/changing-windows-hostname-and-oracle-enterprise-manager/

Uninstalling Oracle 10g Manually from Windows 7

I have uninstalled Oracle 10g manually for my  Windows 7. Here are the steps bellow:

SQL> shut immediate

SQL> startup mount exclusive restrict;
ORACLE instance started.

SQL> select name from v$database;

SQL> drop database;
Database dropped.


Step 1:
Use Oracle Universal installer to deinstall Oracle.
Follow the steps and select correct oracle home to remove it.
1. Go to,
 start --> all programs oracle –-> xxx db –-> Oracle Installation Products –-> Universal Installer.
Following screen will open,Click on Deinstall products to deinstall the Oracle.
2. Select the appropriate ORACLE HOME which we have to uninstall.
3. Click on Yes to deinstall the selected ORACLE HOME.
4.
5.
6. After completing the deinstallation, click on Exit to exit the setup.
Step 2:

After running the supplied Oracle uninstallation utility (which may or may not do some or all of the following):
Stop any Oracle services that have been left running.
Start->Settings->Control Panel->Services.
Look for any services with names starting with ‘Oracle’ and stop them.
Step 3:
Take the backup of your registry in case you accidentally delete other thing (wrongly delete any entry in registry might let to reinstall whole server.)
Go to DOS command prompt type regedit
Step 4:
• Run regedit and delete the following keys (some may have slightly different names in your registry):
HKEY_CURRENT_USER\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Oracle.oracle
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleDBConsole
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle10g_home
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OraclService
Step 5:
Reboot the system.
• Delete the Oracle home directory.
D:\Oracle.
• Delete the Oracle Program Files directory:.
D:\Program Files\Oracle.
• Delete the Oracle Start Menu shortcuts directory:.
D:\Documents and Settings\All Users\Start Menu\Programs\Oracle*
Where * indicates the name of your install. Look for and remove all Oracle directories from that location.
Step 6:
• Remove Oracle refereces from the path. To edit your path go to:
Start->Settings->Control Panel->System->Advanced->Environment Variables.
Edit both of the environment variables user PATH and system PATH. Remove any Oracle references in them.

Source:http://deveshdba.wordpress.com/2012/06/27/uninstalling-oracle-10g-manually-from-windows-2003-server/

WIN: Manually Removing all Oracle Components on Microsoft Windows Platforms (Doc ID 124353.1)

Oracle Universal Installer: Abnormal Program Termination

After installing/uninstalling Oracle  there may appear the following alert:
Abnormal Program Termination OUI
This is very known error.

To solve this, do the following steps:
Note that I am explaining the steps for installing Oracle, after you read this you will be able to solve the problem during uninstalling Oracle.
1. Find setup.exe file and go to its properties(right click -> properties)
setup_properties
2.  Go to “Compatibility” tab  and check “Run this program in compatibility mode for:“. Then choose “Windows XP (Service pack 3)” or what ever you prefer.
setup_properties_Compatibility
Click ok.
3. Right click “setup.exe” and choose “Run as administrator

Source:http://dba010.wordpress.com/2012/02/02/oracle-universal-installer-abnormal-program-termination/