Skip to content
January 13, 2017 / doganay

DBMS_LOCK.SLEEP ALNERNATIVES


1) JAVA(milisecond):

SQL> create or replace procedure sleep(x_ms in number) as language java
2 name 'java.lang.Thread.sleep(int)';
3 /

Procedure created.

SQL> set timing on
SQL> exec sleep(10000);

PL/SQL procedure successfully completed.

Elapsed: 00:00:10.02


2) USERLOCK

@?/rdbms/admin/userlock
--use 1 for 10 ms, 100 for 1 sec
exec user_lock.sleep(100);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: