Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to find listener service without running lsnrctl program

RE: How to find listener service without running lsnrctl program

From: Reardon, Bruce (CALBBAY) <Bruce.Reardon_at_comalco.riotinto.com.au>
Date: Thu, 22 Feb 2001 00:42:16 -0800
Message-ID: <F001.002BA04B.20010221135549@fatcity.com>

Rao,

Thanks for the summary.

However, I thought I would offer an NT perspective for 816 / 817.

In this combination on my PC, the status command does not require a password - the services command does though.

Regards,
Bruce

eg:

C:\>lsnrctl

LSNRCTL for 32-bit Windows: Version 8.1.7.0.0 - Production on 22-FEB-2001 08:53:03

(c) Copyright 1998 Oracle Corporation. All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL>
LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) TNS-01169: The listener has not recognized the password LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) STATUS of the LISTENER


Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 8.1.7.0.0 -
Production
Start Date                22-FEB-2001 08:40:36
Uptime                    0 days 0 hr. 12 min. 36 sec
Trace Level               off
Security                  ON
SNMP                      OFF
Listener Parameter File   D:\ORACLE\ADMIN\TNS_ADMIN\listener.ora
Listener Log File         D:\oracle\product\817\network\log\listener.log
Services Summary...
  ACCESSLP              has 1 service handler(s)
  BDB6          has 1 service handler(s)
  MI31          has 1 service handler(s)
  PLSExtProc            has 1 service handler(s)
  BDB5          has 1 service handler(s)
The command completed successfully
LSNRCTL> set password fred
The command completed successfully
LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) Services Summary...
  ACCESSLP has 1 service handler(s)     DEDICATED SERVER established:0 refused:0
      LOCAL SERVER
  BDB6          has 1 service handler(s)
    DEDICATED SERVER established:0 refused:0
      LOCAL SERVER
  MI31          has 1 service handler(s)
    DEDICATED SERVER established:0 refused:0
      LOCAL SERVER
  PLSExtProc            has 1 service handler(s)
    DEDICATED SERVER established:0 refused:0
      LOCAL SERVER
  BDB5          has 1 service handler(s)
    DEDICATED SERVER established:0 refused:0
      LOCAL SERVER

The command completed successfully
LSNRCTL> exit

C:\>

-----Original Message-----
Sent: Thursday, 22 February 2001 8:15

List

This problem is solved thanks to Chuck Hamilton suggestion. I thank all the list members who took their time in suggesting the solution.

Following is the solution given by Chuck Hamilton.

You can do what you want by using the setuid bit. On some version of unix you may need a kernel parameter change to allow shell scripts to run with the setuid bit turned on.

  1. Log in as the "oracle" user.
  2. Remove the password from the shell script and put it into a separate file protected with unix permissions. echo "mypassword" > listener.pass chmod 600 listener.pass # Now only "oracle" can read this file
  3. Change the line in your shell script to read the password from the listener.pass file. For KSH something like this works. lsnrctl <<! | grep ORCL # (or whatever service you're looking for) set password $(<listener.pass) status !
  4. Change the permission on the shell script and add the setuid bit. This causes the run-time user id to be set to the owner of the shell script
    (which should also be "oracle").
    chmod u+s check_listener.sh or chmod 4755 check_listener.sh

Any user can now run the script, and even read the script, but can't see the password because he can only cat the script, not the password file.

Thank You Chuk Hamilton.

Rao

Maheswara.Rao_at_SunGardP3.com

Hi DBAs,

I would like to find out whether a specific listener service is up or not without running the command ---> lsnrctl services. Is there any way I can do this through a shell script or unix command?

My environment : Solaris 2.7 : Oracle 8.0.4

Thanks for your help,

Rao

Maheswara.Rao_at_SunGardP3.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Reardon, Bruce (CALBBAY)
  INET: Bruce.Reardon_at_comalco.riotinto.com.au

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Feb 22 2001 - 02:42:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US