Linux – How to set up tns listeners for Multiple Oracle Installations on One machine

linuxoracle

So I have two oracle installations on a development/testing machine (10g and 11g, respectively).

The platform is RHEL4.

Now I need to have both these oracle up and have tns listeners for them running.

How do I do that?

I've tried having separate listener.ora files in 10g's home dir and 11g's home dir, and try to start them up separately (under different users, oracer10 for 10g, oracer11 for 11g).

However, as soon as one of the tns listener is started, the other wont start and complain something like "TNS-01106: Listener using listener name LISTENER11 has already been started".

I do have different name for the two listeners. (LISTENER10 and LISTENER11)

Thanks,

Here are the listener.ora files

For 10g:

SID_LIST_LISTENER10 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /home/oracer/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CER)
      (ORACLE_HOME = /home/oracer/oracle/product/10.2.0/db_1)
    )
  )

LISTENER10 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
     (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = SAP_1)(PORT = 1521))
      )
    )
  )

For 11g:

SID_LIST_LISTENER11 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /home/oracer11/app/oracer11/product/11.2.0/dbhome_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CID)
      (ORACLE_HOME = /home/oracer11/app/oracer11/product/11.2.0/dbhome_1)
    )

  )

LISTENER11 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
     (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = SAP_1)(PORT = 1522))
      )
    )
  )

Best Answer

You need to have different keys for the IPC entries in the two configurations, e.g. KEY = EXTPROC10 and KEY = EXTPROC11. IPC uses memory and semaphores etc. that may be shared across the machine, so you need to provide a way for the instances to be differentiated.

Also make sure you're starting the listeners explicitly, e.g. lsnrctl start listener10, and you have the environment set properly for your two accounts, including LD_LIBRARY_PATH pointing to the right ORACLE_HOME.