Jump to Navigation

OEM Database Control: change port numbers

Symptoms

Several port numbers are used internally by Oracle Enterprise Manager Database Control. You want to change them, for instance because they collide with reserved ports for other applications on the same server.

Solution

You can change the port numbers, provided you have command-line access on the database server as the user Oracle was installed with. This will cause no downtime on the database, though Enterprise Manager itself will need to be restarted.

Assumptions

  • You are running Oracle database 11g 1
  • You are running on Linux or Unix 2
  • You have not implemented Grid Control, but are using the out of the box version of Oracle Enterprise Manager (also known as Database Control).
  • You have access to the Oracle server and can log in as the user Oracle was installed with (usually: user oracle).

Changing the HTTP(S) port on which the web interface listens is described elsewhere on this site.

Theory

If you create a new database instance and choose to add Database Control for local management 3 you will get a web-based management console for just this database instance. It actually consists of several parts, just like the full-blown Grid Control option:

  • The database console (dbconsole)
    The front end, among which the web server.
  • The agent (emagent)
    The agent gathers (some of) the data displayed. It is automatically started by the database console.
  • The repository
    This will be created under the SYSMAN schema

Apart from the HTTP(S) port, the dbconsole also listens to a RMI port and a JMS port 4. The agent listens to its own TCP port. These ports are only used internally within the server and need not be accessible from the outside.

Procedure

Getting the currently assigned ports is a little tricky.

The agent port can be found by trying:

# You should probably be user oracle
# Replace SID with the SID of your database
ORACLE_SID=SID emctl status agent

This will print among other information an Agent URL, for example:

Agent URL         : https://machine.example.com:10003/emd/main

In this case, you have the agent listening on port 10003 and using HTTPS.

The RMI and JMS ports can be found by examining two configuration files within $ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_INSTANCE/config: rmi.xml and jms.xml. In both cases, the port number is somewhere in the first few lines.

To change the port numbers, try:

# You should probably be user oracle
# Replace SID with the SID of your database
# Replace PORT1 with the RMI port you wish to use
# Replace PORT2 with the JMS port you wish to use
# Replace PORT3 with the Agent port you wish to use.
emca -reconfig ports -SID SID -RMI_PORT PORT1 -JMS_PORT PORT2 -AGENT_PORT PORT3

This will automatically restart Enterprise Manager. Note that it is also possible to specify just one or two port numbers; the ports you do not specify will remain unchanged. Do not specify ports below 1024 on Linux or Unix systems5.

  • 1. This procedure will probably also work on 10i or 12c, but has not been tested
  • 2. This procedure will probably also work on Windows, but has not been tested
  • 3. In dbca, this is step 4
  • 4. Actually, it seems that at least the JMS port is not always in use
  • 5. Ports with numbers below 1024 can only be bound to by the root user


Technical_article | by Dr. Radut