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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to make the SQL to run longer?

Re: How to make the SQL to run longer?

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 29 Jun 2007 13:45:23 -0700
Message-ID: <1183149842.932881@bubbleator.drizzle.com>


a.quick.email_at_gmail.com wrote:

> On Jun 28, 4:30 am, Raj <jkama..._at_gmail.com> wrote:

>> Hell All,
>> To reproduce one of our cusotmer's probem, I need to make the SQL to
>> run for more than a minutes before it returns the result set. I do
>> not
>> have large amount of data in the database to simulate the dealy.
>>
>> Is there a way in SQL to cause the delay while returning the result
>> set
>>
>> Thanks for the help.
>> Regards
>> Raj
> 
> Raj wrote:
> Raj wrote:

>> Hell All,
>> To reproduce one of our cusotmer's probem, I need to make the SQL to
>> run for more than a minutes before it returns the result set. I do
>> not
>> have large amount of data in the database to simulate the dealy.
>>
>> Is there a way in SQL to cause the delay while returning the result
>> set
>>
>> Thanks for the help.
>> Regards
>> Raj
>>
> 

>> Hell All,
>> To reproduce one of our cusotmer's probem, I need to make the SQL to
>> run for more than a minutes before it returns the result set. I do
>> not
>> have large amount of data in the database to simulate the dealy.
>>
>> Is there a way in SQL to cause the delay while returning the result
>> set
>>
>> Thanks for the help.
>> Regards
>> Raj
>>
> 
> grant execute on dbms_lock to the_user ;
> 
> create or replace function the_user.sleep_for ( sleep_time in
> integer )
> 	return integer is
> begin
> 	DBMS_LOCK.SLEEP(sleep_time) ;
> 	return sleep_time ;
> end;
> /
> 
> -- Sleep for five seconds
> select sleep_for(5) from dual ;

For those interested there are multiple ways to grant "sleep" privileges.

You will find 4 of them here
http://www.psoug.org/reference/sleep.html

If the purpose is to grant the privilege to a user then it is safer to create user_lock (not built by default) and grant privileges on that package.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Jun 29 2007 - 15:45:23 CDT

Original text of this message

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