Re: SQLNet.ora per Listener? - SOLVED
Date: Tue, 21 Apr 2009 15:28:04 -0500
Message-ID: <OF0AE9EC3F.0A28933B-ON8625759F.006E5B57-8625759F.00706D11_at_austinisd.org>
After much experimentation, I got lsnrctl to pay attention to the TNS_ADMIN variable. It's just backward from what you'd think. Instead of checking for the existence of TNS_ADMIN, using its value if present, or using the default of $ORACLE_HOME/network/admin if TNS_ADMIN is absent, lsnrctl first checks to see if $ORACLE_HOME/network/admin is present. If it is, lsnrctl uses it, no matter what TNS_ADMIN says. If the default directory is not there, THEN lsnrctl checks for and uses the value in TNS_ADMIN. If there's no default directory AND no TNS_ADMIN set, lsnrctl starts a Listener and establishes a log in $ORACLE_HOME/network/log, but says "The listener supports no services". I guess it would then depend on auto-registration by each database to be "listened for".
So, if you want separate Listener environments in the same ORACLE_HOME, you have to have two, separate TNS_ADMIN directories, neither of which can be the default of $ORACLE_HOME/network/admin. I can handle that with some simple shell scripts to set TNS_ADMIN for each Listener I want - just one for starting, since stuff like status and stop don't need to access the listener.ora or sqlnet.ora files.
Hope this helps someone else.
BTW, From my reading, I think TNS_ADMIN will direct Client tools to a specific tnsnames.ora files, even if in non-default locations. Haven't tested it thoroughly, but I know that works from past experience. It just doesn't work the same with lsnrctl.
Jack C. Applewhite - Database Administrator
Austin I.S.D. - MIS Department
512.414.9715 (wk) / 512.935.5929 (pager)
japplewhite_at_austinisd.org
Management Info - CAC; Management Info - CAC
Sent by: oracle-l-bounce_at_freelists.org
04/21/2009 10:15 AM
Please respond to
japplewhite_at_austinisd.org
To
Oracle-L Freelists <oracle-l_at_freelists.org>, oracle-l-bounce_at_freelists.org
cc
nigel.cl.thomas_at_googlemail.com
Subject
Re: SQLNet.ora per Listener?
Sounds like a good plan, but it doesn't work for any of my Oracle environments - 9i on HP-UX, 9i and 10g on Linux. It's easy to test. Just set TNS_ADMIN to a non-existent directory and try to start a non-existent Listener. The output below for me on HP-UX is exactly what I get on Linux for both 9i and 10g. Looks to me like lsnrctl totally ignores the TNS_ADMIN variable.
Am I missing something?
oracle>>TNS_ADMIN=$ORACLE_HOME/network/lsnr2222 lsnrctl start lsnr2222
LSNRCTL for HPUX: Version 9.2.0.8.0 - Production on 21-APR-2009 10:02:08
Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved.
Starting /oracle/product/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 9.2.0.8.0 - Production System parameter file is /oracle/product/9.2.0/network/admin/listener.ora Log messages written to /oracle/product/9.2.0/network/log/lsnr2222.log TNS-01151: Missing listener name, lsnr2222, in LISTENER.ORA
Listener failed to start. See the error message(s) above...
oracle>>export TNS_ADMIN=$ORACLE_HOME/network/lsnr2222 oracle>>lsnrctl start lsnr2222
LSNRCTL for HPUX: Version 9.2.0.8.0 - Production on 21-APR-2009 10:02:59
Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved.
Starting /oracle/product/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 9.2.0.8.0 - Production System parameter file is /oracle/product/9.2.0/network/admin/listener.ora Log messages written to /oracle/product/9.2.0/network/log/lsnr2222.log TNS-01151: Missing listener name, lsnr2222, in LISTENER.ORA
Listener failed to start. See the error message(s) above...
Jack C. Applewhite - Database Administrator
Austin I.S.D. - MIS Department
512.414.9715 (wk) / 512.935.5929 (pager)
Nigel Thomas <nigel.cl.thomas_at_googlemail.com>
Sent by: oracle-l-bounce_at_freelists.org 04/20/2009 05:26 PM
Please respond to
nigel.cl.thomas_at_googlemail.com
To
japplewhite_at_austinisd.org, Oracle-L Freelists <oracle-l_at_freelists.org>
cc
Subject
Re: SQLNet.ora per Listener?
Jack
The sqlnet.ora is found in $TNS_ADMIN (if that is set) so why not set it before starting one of the listeners (and change it or leave it default for the other)
eg
TNS_ADMIN=/my/nonstandard/net/admin lsnrctl start ...
NB:
env=value command parameters
causes the env to be set to value and included in the environment of the
command
In the non-default directory pointed to by $TNS_ADMIN you can make tnsnames.ora (if needed) a symbolic link to the "real" tnsnames.ora.
Cheers Nigel
2009/4/20 <japplewhite_at_austinisd.org>
9i on HP-UX and 10g on Linux.
Basic question: Can you somehow tie a particular sqlnet.ora file to a specific listener for a database that has two Listeners? I've looked in the docs and everywhere else I can think of and I can't find that you can somehow specify that a sqlnet.ora file applies to only a specific Listener, it applies to all Listeners in that ORACLE_HOME. The only way that my little brain has come up with is to create another ORACLE_HOME and have a Listener there with its own sqlnet.ora.
What we have is a Student Information database that is accessed District-wide via our internal WAN / LAN. It has a Listener on port 1521. We've had this setup for years. We also allow selected access to that database from the Internet. We opened up another port (not 1521 or any of the "usual" ones) in the firewall and we have a second Listener on that port. The sqlnet on the Client App server in the DMZ requires encryption, etc. via the parameters specific to those security settings. We'd like to require the matching encryption, etc. for any traffic coming to the non-standard Listener, but the single sqlnet.ora file on the server would apply to our internal Listener as well, killing our internal Users. For now, we only have the security settings Accepted, not Required, on the server.
Am I an idiot? I've done the standard setup of Listeners lots and lots over the years but am not well-versed in unusual setups or Advanced Security. Is there a relatively simple way to do what we want or is the separate ORACLE_HOME the ticket? Any guidance would be appreciated.
Thanks.
Jack C. Applewhite - Database Administrator
Austin I.S.D. - MIS Department
512.414.9715 (wk) / 512.935.5929 (pager)
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Apr 21 2009 - 15:28:04 CDT