Search found 6 matches

by dosjediwannabe
15 Feb 2013 08:42
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

Re: How to extract port number in listener.ora

actually what is unresolved is that the previous code is not able to resolve PORT number if the following happens LISTENER = (DESCRIPTION_LIST =(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bn-william)()(PORT=1521))) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) ) it works if the followi...
by dosjediwannabe
14 Feb 2013 22:30
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

Re: How to extract port number in listener.ora

if my configuration is as follow LISTENER = (DESCRIPTION_LIST =(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sg-chlengnb1)(PORT=1521))) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) ) what should be the correct way to extract the port number? thanks existing code @echo off set LISTENER_F...
by dosjediwannabe
14 Feb 2013 03:36
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

Re: How to extract port number in listener.ora

@echo off set LISTENER_FILE=%ORACLE_HOME%\network\admin\listener.ora rem for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<listener.ora') do echo %%a for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<%LISTENER_FILE%') do ( rem echo %%a set EXISTING_...
by dosjediwannabe
14 Feb 2013 02:16
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

Re: How to extract port number in listener.ora

hi firstly thanks for the suggestion, I managed to get that portion working. @echo off set LISTENER_FILE=%ORACLE_HOME%\network\admin\listener.ora rem for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<listener.ora') do echo %%a for /f "tokens=7 delims=)= " %%a in ('...
by dosjediwannabe
14 Feb 2013 01:22
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

Re: How to extract port number in listener.ora

@echo off set LISTENER_FILE=%ORACLE_HOME%\network\admin\listener.ora rem for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<listener.ora') do echo %%a for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<%LISTENER_FILE%') do ( echo %%a set EXISTING_PORT...
by dosjediwannabe
13 Feb 2013 22:22
Forum: DOS Batch Forum
Topic: How to extract port number in listener.ora
Replies: 11
Views: 5181

How to extract port number in listener.ora

I have the following in ksh, i.e. bash script it is working fine, LISTENER_FILE=`cat $ORACLE_HOME/network/admin/listener.ora | grep "PORT"` EXISTING_PORT=${LISTENER_FILE##*=} EXISTING_PORT=${EXISTING_PORT%%\)*} if [ -z "$LISTENER_PORT" ] && [ -z "$EXISTING_PORT"...