Thursday, January 20, 2011

Oracle Database Installation Notes (Loopback Adapter)

I found out that after installing Oracle Database 10g on a VM machine and restarting the machine, the database service won't start.  A colleague of mine determine that my problem is located on me not installing a Loopback Adapter prior installing the Oracle Database.  According to an Oracle Documentation, prior to installing Oracle Database you may need to determine whether or not you will need a loopback adapter installed.  I also found out that after installing the loopback adapter and then reinstalling the Oracle Database, the installation warning regarding network configuration management is gone.
A loopback adapter is required if:
  • You are installing on a DHCP computer, or
  • You are installing on a non-networked computer and plan to connect the computer to a network after installation.
I also found a good tutorial on how to install a Loopback Adapter here

Activating (Deactivating) Oracle Sample Database

Oracle Database 10g installer came with several sample database, and here is how to activate it.

  1. Log into the server home page as SYSTEM (http://localhost:1158/em from the server).
  2. Click the "Administration" tab, under "Schema", under "Users and Privileges" look and click at "Users" link.
  3. Click the schema link name (It may be HR, OE, SH, or any other link) to display its information.
    An unconfigured user are usually locked, to begin using it choose the "Unlock User" on the "Actions" selection and click "Go".  Then go ahead and confirm the unlock process.
  4. After it's unlocked, go ahead and click the "Edit" button (located beside the "Go" button).
    You may notice that its password is expired.  Go ahead and type the new password and confirm it to un-expire the password.  Click Apply.

Now your selected user account (sample database) is ready to use.

After you finished using the sample database, and you want to freeze the database (for future use) you may want to do the reverse process.  Generally all you have to do is :

  1. Expire the password.
  2. Lock the user schema.

Optionally when you want to really clean the database from the sample database you can also delete the user schema.

Cleanly uninstall/deinstall Oracle Database (10g)

In this post I'll describe steps to cleanly uninstall your oracle database off your Microsoft Windows system (Windows XP / Server 2003).  In my case I was using the Oracle Database 10g.  Follow this step if you want to reinstall oracle cleanly.  (I believe you may follow similar steps on other Microsoft Windows version and other Oracle Database version)
  1. Turn off any oracle related services from Start-Run-Services.msc or Control panel-Administrative Tools-Services.
    Turn off the services in this order : Oracle MTS - iSQLPlus - Listener - Oracle Instance (you may not have all the services I listed installed).
  2. Use The Oracle Universal Installer to uninstall/deinstall the Oracle database.
    When you use the Oracle Universal Installer (OUI) to uninstall Oracle database,it left out bits and pieces of data in your operating system.  So, after uninstalling using the OUI you may want to clear up some mess left by the oracle.
  3. Open up regedit (Start - Run - regedit) then find this references (if you can, if you didn't find it it was deleted by the OUI) and delete it.  
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\ 
    • Delete the reference starting with ora in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\.  (You may have more than one reference.)
    • Reboot the operating system
    • Delete the oracle base directory <usually its located in c:\oracle>
    • Delete the oracle folder in program files <usually it's located in c:\program files\oracle>
    • (Optional) You may want to clear/delete the temp folder (c:\TEMP)
    • Remove any Oracle references from Environment Variable (usually in your path)
      Start-Settings-Control Panel-System-Advanced-Environment Variables
      Edit the environment variables PATH and system PATH.
    • Remove Oracle.DataAccess and any Polic.Oracle files from the GAC (if any) at C:\Windows\assembly\
    • Clear the recycle bin