Skip Headers
Oracle® Database Installation Guide
10g Release 2 (10.2) for hp OpenVMS

Part Number B25414-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

I Identifying Listener Processes

The following set of commands can be used to display information about all listener processes:

$!
$!  To identify and report on any active SQL*Net listener processes
$!  on this OpenVMS Server (used as part of 10g pre-installation 
$!  check activities)
$!
$ found_any = 0
$ say = "write sys$output"
$!
$ say " "
$ say " Collecting system information - please wait..."
$!
$!  First, get a list of all disk on this system
$!
$ pipe show dev d/mount > sys$scratch:lsnrchk_devices.tmp
$!
$ close/nolog flsnr
$ open/read flsnr sys$scratch:lsnrchk_devices.tmp
$!
$!  Skip the records we know we don't need
$!
$ read flsnr record
$ read flsnr record
$ read flsnr record
$!
$!  Loop on each disk we found
$!
$ loop:
$ read flsnr/end=done_it record
$ dev = f$element(0," ", record)
$!
$!  Look for any processes accessing tnslsnr.exe
$!
$ pipe show device/files 'dev' | search/nowarn -    
$ sys$input tnslsnr > sys$scratch:lsnr_chk1.tmp
$!  If we found something, check the process(es) returned
$!
$ if $status .eqs. "%X10000001"
$ then
$    close/nolog tmmp
$    open/read tmmp sys$scratch:lsnr_chk1.tmp
$loop1:
$    read/end=done_it_1 tmmp record
$    if record .nes. ""
$    then
$       record = f$edit(record,"COMPRESS,TRIM,UPCASE")
$! Skip tnslsnr.com records
$       if f$locate(".COM;",record) .ne. f$length(record) then goto loop1
$       proc = f$element(1," ",record)
$!
$!  The following check ensures we skip records that we don't want
$!  (for example, records that reflect that we have a installed image)
$!
$       if proc .nes. "" .and. f$locate(".EXE",proc) .eq. f$length(proc)
$       then
$          img = f$getjpi("''proc'","IMAGNAME")
$          lsnr_loc = f$extract(0,f$locate(".]",img),img)
$          lsnr_loc = f$extract(0,f$locate(".NETCONFIG]",lsnr_loc),lsnr_loc)
$          lsnr_loc = lsnr_loc  + ".NETWORK.ADMIN]"
$          prcnm = f$getjpi("''proc'","PRCNAM")
$!
$!  Display the result
$!
$          if found_any .eq. 0
$          then
$             say " "
$             say " The following listener(s) need to be checked :"
$             say " "
$             say " If they use the IPC Protocol with (key = EXTPROC) and/or "
$             say " the TCP Protocol with (Port = 1521) then they need to "
$             say " be shutdown when installing Oracle 10g"
$             say " "
$          endif
$          say "=============="
$          say "  Listener process name          : ''prcnm'"
$          say "  VMS pid                        : ''proc'
$          say "  Probable LISTENER.ORA location : ''lsnr_loc'"
$          found_any = found_any + 1
$       endif
$       goto loop1
$    endif
$ done_it_1:
$    close/nolog sys$scratch:lsnr_chk1.tmp
$ endif
$ goto loop
$!
$ done_it:
$ close/nolog flsnr
$!  Remove all work files
$!
$ delete/noconfirm sys$scratch:lsnrchk_devices.tmp;*
$ delete/noconfirm sys$scratch:lsnr_chk1.tmp;*
$!
$ if found_any .eq. 0
$ then
$    say " "
$    say "       No active SQL*Net Listeners detected on this node"
$    say " "
$ else
$    say "=============="
$    say " "
$ endif
$!
$ say " End of processing"
$ say " "
$ exit