Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a listener 1

Status
Not open for further replies.

maswien

Technical User
Sep 24, 2003
1,286
CA

How can I manually create a listener and then switch the current default listener to this newly created listener? I'm talking about solaris machine, how can I control the lsnrctl use which listener.ora? Do the different listener listen on separate ports?

Thanks
 
Maswien,

First, a single LISTENER can create connections for virtually any number of Oracle instances, even if they are of different Oracle versions. (You do not need to have multiple LISTENERs, listening on different ports, for different versions of Oracle.)

But (as you and I have discovered), for some reason, Oracle seems to have elected to require an Oracle 10g LISTENER to make connections to an Oracle 10g instance. (Luckily, a 10g LISTENER also can make connections to earlier versions of Oracle.)

To lay the groundwork for the Oracle 10g LISTENER to become your default LISTENER for your Solaris machine, do the following:

1) locate your oratab file (which, on a Solaris machine resides in "/var/opt/oracle").

2) edit the oratab file (using "vi", for example) and cause the oratab definition for your Oracle 10g instance to become the first entry for your multiple Oracle instances that appear in that file. (For example, presently, I'm willing to bet that your Oracle 10g entry is not the first one in your oratab file...it needs to become the top/first entry of your Oracle instances appearing there.)

3) Ensure that you have appropriate LISTENER-related files in your 10g's $ORACLE_HOME/network/admin path (including "listener.ora", "sqlnet.ora", "tnsnames.ora", et cetera)

4) Shut down your Oracle 9i LISTENER. For this, you should ensure that your current environment variables point to your Oracle 9i ORACLE_HOME. To ensure this, at your Solaris o/s prompt, and as a Unix user that is a member of your Oracle administrator group, enter the command:
Code:
% . oraenv
(then respond with the oratab alias for an Oracle 9i instance)
Then, invoke the lsnrctl utility that manages the LISTENER, and shutdown the currently running LISTENER:
Code:
% lsnrctl
lsnrctl> status
(which displays the currently running LISTENER values)
lsnrctl> stop
(which shuts down that currently running LISTENER)

5) Bring up the Oracle 10g LISTENER:
Code:
% . oraenv
(this time, enter the oratab alias for a 10g instance so that when you invoke "lsnrctl", it will use the 10g LISTENER executables.)
% lsnrctl
lsnrctl> status
(should show that no LISTENER is running)
lsnrctl> start
(this should bring up your Oracle 10g LISTENER)

Once the 10g LISTENER is up and running, you should be able to connect successfully to any of your up-and-running Oracle instances.

Let us know your findings and of your successes with this.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 


Thanks Mufasa,

I didn't check the content of listener.ora file before I installed ORACLE 10G or created the 10g database. There is only one listener.ora file which locates in /var/opt/oracle/. It looks like when I created the 10G database, there wasn't an entry added to listener.ora file, is it because I didn't stop the 9i listener? after I added an entry to listener.ora, then stop the 9i listener and start the 10g listener as you suggested, everything seems working fine now.

A few questions:

1. Does the DBCA find the listener.ora file no matter it's for what version and add an entry to it when a new database is being created?

2. Any special reason for putting the 10G instance to the beginning?

edit the oratab file (using "vi", for example) and cause the oratab definition for your Oracle 10g instance to become the first entry for your multiple Oracle instances that appear in that file.


 
1. Actually, since 9i, the Oracle LISTENER has an "auto-discovery" capability for the Oracle instances running on a server. It means that you needn't explicitly specify the Oracle instance in the listener.ora file. But it also does not hurt to make the explicit definition in your listener.ora either.

2. The reason that I place the 10g instance first in the oratab file is because the first instance/$ORACLE_HOME definition in the oratab file becomes the default instance definition for that machine. Thus, Oracle uses the listener executables for that default instance to startup your listener...At least that's my understanding. If anyone knows more/better than that, I'm a quick "repenter".[smile]

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top