Change Hostname and Keep Oracle 10g Running

posted in: Allgemein | 0

Step 1 – Create Hosts Entry for Old Hostname
Locate your hosts file, typically located at %WINDIR%system32driversetchosts and add an entry for the old (current) hostname.

#
# HOSTS file
#

win2k3r2 172.16.10.10

Note the IP address – this is the address of a Loopback Adapter installed on the guest machine. As outlined by the Oracle Installer, a Loopback Adapter is required on systems that do not have a static IP address (as do virtual machines using NAT, etc.)

Step 2 – Uninstall Enterprise Manager Console
Because there are configuration settings stored with Enterprise Manager Console that reference the hostname, the same must be uninstalled.

emca -deconfig dbcontrol db -repos drop

Note, before executing this command, ensure that the Oracle instance is running – it has to be in order for Enterprise Manager Configuration Assistance to drop the repository and de-configure the Console.

Step 3 – Stop All Oracle Services
Once the uninstall of Enterprise Manage Console has completed, stop all Oracle Services on the guest machine.

iSQL*Plus Service – typically named OracleiSQL*Plus
Oracle Listener Service – typically named OracleTNSListener
Oracle Database Instance Service – typically named OracleServer
Step 4 – Update listener.ora and tnsnames.ora
Once all the Oracle services have stopped, update the listener.ora and tnsnames.ora files, located in %ORACLE_HOME%networkadmin to reflect the desired (new) hostname.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = win2k3r2)(PORT = 1521))
)
)

DEVBOX =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = win2k3r2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = devbox)
)
)

Step 5 – Rename Host and Restart
Now, rename the computer and restart the guest machine.

Step 6 – Ensure Oracle Instance is Running
Once the guest machine has started up, log in and ensure the Oracle instance is running using the following command line (typically required, unless the instance, not the Windows Service, is configured to auto-start.)

oradim -startup –sid devbox

Step 7 – Reinstall Enterprise Manager Console
After ensuring the Oracle instance is running, reinstall Enterprise Manager Console using the following command line:

emca -config dbcontrol db -repos create

Step 8 – Validate Enterprise Manager Console Installation
Lastly, after the successful installation of Enterprise Manager Console, validate the installation by navigating to the logon page – typically http://:1158/em/.

emctl stop dbconsole
emca -deconfig dbcontrol db
emca -repos recreate
emca -config dbcontrol db