Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Run command on sqlplus repetitively without reconnection.
} I want to run a command on sqlplus without making re-connection. At the
} same time I also want to see the output.
With ksh93 (and pdksh, on Linux for example) you can use co-processes:
$ echo $KSH_VERSION
@(#)PD KSH v5.2.14 99/07/13.2
$ sqlplus -s / as sysdba|&
[1] 31631
$ while :;do
> print -p "select event,count(*) from v\$session group by event;"
> sleep 2
> done &
[2] 31633
$ while :;do
> read -p; echo "$REPLY"
> done
EVENT COUNT(*) ---------------------------------------------------------------- ---------- ASM background timer 1 rdbms ipc message 11 smon timer 1 pmon timer 1 Streams AQ: qmn slave idle wait 1 class slave wait 1 SQL*Net message to client 1 Streams AQ: waiting for time management or cleanup tasks 1 Streams AQ: qmn coordinator idle wait 1
9 rows selected.
EVENT COUNT(*) ---------------------------------------------------------------- ---------- ASM background timer 1 rdbms ipc message 11 smon timer 1 pmon timer 1 Streams AQ: qmn slave idle wait 1 class slave wait 1 SQL*Net message to client 1 Streams AQ: waiting for time management or cleanup tasks 1 Streams AQ: qmn coordinator idle wait 1
9 rows selected.
[...]
Regards
Dimitre
-- http://www.freelists.org/webpage/oracle-lReceived on Wed May 09 2007 - 14:53:39 CDT
![]() |
![]() |