DBMS_LOCK

sqlplus / as sysdba

SQL> grant execute on dbms_lock to scott;

Grant succeeded.

SQL> quit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
-bash-4.2$ sqlplus scott/*****

SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 24 13:48:29 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> CREATE OR REPLACE PROCEDURE sleep(seconds NUMBER) AS
2  BEGIN
3    DBMS_LOCK.SLEEP(seconds);
4  END;
5  /

Procedure created.

SQL> EXEC sleep(2);

PL/SQL procedure successfully completed.

http://info.michael-simons.eu/2010/09/07/oracle-sleep-procedure-dbms_lock-sleep/

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