[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] How SQR program is connection to the database



Yelena,

SQL*Net message from client is Oracle-speak for "think time"--Oracle
sent off a message and it's waiting to hear back. Oracle does not know
whether you're pushing megabytes over a dial-up line, or whether you've
gone for coffee, or--the most likely case, I believe--your SQR is
running complex calculations. (message to client is another matter, to
be sure).

Run the following SQR with a username having SELECT on V$SESSION and
V$SESSION_EVENT. Do not use a connect-string. You should be able to run
the SQL*Net message from client arbitrarily high, e.g.

sqr snooze scott/tiger 2

! snooze.sqr
! a quick illustration

begin-program

  do get_input($secs_string)
  do simple_select($secs_string)
  do report_waits

end-program


Begin-Procedure simple_select ($secs_string)
Begin-Select
table_name
   do snooze($secs_string)
>From user_tables
Where Rownum <= 10
End-Select
End-Procedure

begin-procedure get_input(:$secs_string)
 input $secs_string  'Seconds to sleep'
 If IsNull($secs_string) 
   let $secs_string = '2'
 End-If
End-procedure

Begin-Procedure snooze($secs_string)
 let $sleep_string = 'sleep ' || $secs_string
 call system using $sleep_string #ignore
End-Procedure

begin-procedure report_waits
Begin-Select
event  (+1,1)
  display &event noline
  display ' -> ' noline
time_waited 
  display &time_waited
>From 
  (SELECT e.event, e.time_waited
   FROM v$session_event e, v$session s
   WHERE e.sid = s.sid
     AND s.audsid = Sys_Context('USERENV', 'SESSIONID')
   ORDER BY time_waited
   )
Order by event
End-Select
End-Procedure



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users