Doubt with DMBS_LOCK.SLEEP

Hi, I'using this code in a program unit of a Form:
DBMS_LOCK.SLEEP(p_seconds);
The purpose os this is, obviously, to delay the execution of the program in 'p_seconds' seconds.
My problem is that DBA doesn't want to grant execute permission on DBMS_LOCK (full package) to the application user. I've read that a possible solution could be to create a new wrapper procedure that calls DBMS_LOCK.SLEEP and to grant permission only to this procedure. That's right, but I want to avoid creating new objects in SYS schema.
I've found another solution, this is to create a new procedure in the application user, called 'LOCALSLEEP', and this is its code:
PROCEDURE LOCALSLEEP (i_nMilliseconds in number)
as language java name 'java.lang.Thread.sleep(long)';
So, in my Form, I could use this call instead of previous:
LOCALSLEEP(p_seconds*1000);
My question is: Is this solution fully the same as the other ? Can this function to be created in any Oracle database, or it depends on Java, or need to configure anything else ?
Thanks a lot by your help.

vbarres wrote:
Hi, I'using this code in a program unit of a Form:
DBMS_LOCK.SLEEP(p_seconds);
The purpose os this is, obviously, to delay the execution of the program in 'p_seconds' seconds.
My problem is that DBA doesn't want to grant execute permission on DBMS_LOCK (full package) to the application user. I've read that a possible solution could be to create a new wrapper procedure that calls DBMS_LOCK.SLEEP and to grant permission only to this procedure. That's right, but I want to avoid creating new objects in SYS schema.Why create it in the SYS schema?
Just create it within a pre-defined user schema and grant execute permissions to public (or all the users that require it).
Then, only this pre-defined user schema will require execute permissions on DBMS_LOCK, and can have the rest of it's permissions restricted so it's limited to only do what you require.

Similar Messages

  • Mac Mini Server 2011, with lion, sleeps every day

    My new Mac Mini Server 2011, with lion, sleeps every day! Server not responding.
    All services are down, smb, vnc, ssh too. And it not should be happen because this is a server, right?
    Please, I need help with this problem!
    How to fix it?

    1.  Go to System Preferences.
    2.  Select Engery Saver
    3.  Slide the setting for Computer sleep to never.
    4.  Slide the setting for Display sleep to never (though I believe the display should be able to sleep without much issue.
    5.  Make sure the following are not selected:
    a.  Put the hard disk(s) to sleep when possible.
    b.  Allow power button to put the computer to sleep.
    6.  Make sure the following are selected:
    a.  Wake for network access
    b.  Start up automatically after a power failure
    c.  Restart automatically if the computer freezes.
    Good luck!

  • Doubt with creation of Model in the application Webdynpro Java

    Good Morning,
    I have the following doubts with the fields when i am creating a models in WebDynpro Java
    Model Package
    Source Fólder
    Default logical system name for model instances
    Default logical system name for RFC metadata
    Logical Dictionary
    Dictionary Type Package.
    Can Help me?
    Kind Regards

    Hi,
        Please check this link:
    [https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ%20-%20Models%20-%20Adaptive%20Web%20Service]
    Thanks and Regards

  • My macbook isn't powering up and makes a beeping noise in time with the sleep light

    Hi There I hope someone can help!!!
    I had disconnected the power cable and left the MacBook in sleep mode with the lid shut. When I now go to open my MacBook up, and wait for my system to resume from where I left off the screen doesn't on and the sleep light goes off. when I close the lid the sleep light goes back on as if it is in sleep mode but the same happens when I open it again, no power to the screen.
    I order to try get my MacBook working again I tried holding down the power button and switching it back on again but the MacBook now looks as if it is going to power up but the sleep light comes on for about 3 secs and then beeps, then every 4-5 secs constantly the MacBook beeps once in time with the sleep light (to note the sleep light is not following its usual fade on fade off rhythm).
    I have tried resetting the SMC using the shift command control option and power button (also this is the only way to stop the beeping and flashing) and when you try and switch on the MacBook if you just press the power button it just follows the same beep with sleep light routine, but if you hold the power button in then the sleep light then flashes quickly about 4-6 times and then starts to beep in time with the flash again.
    I will also add I have not reconfigured anything or added any RAM to my MacBook it is still on the standard (manufacturing) configuration as I have been looking about for anyone with similar issues and the main question back seems to be have you changed the RAM, I have also tried resetting teh RAM and the proble still persists.
    If someone can help it would be awesome!

    Here's the Apple support article on beeps https://support.apple.com/kb/HT1547

  • How do i run two threads with different sleep times?

    How do i run two threads with different sleep times?
    Ive got thread A and thread B, they both update a jpanel.
    They both start when i press the start button.
    However thread A updates every 250ms and thread B updates every 1000ms. i cant just run them both at 250ms becuase this will mess it up.
    So for every four runs of thread A i want thread b to only be run once
    Does anyone know how to do this?
    Thanks, Ant...

    ok, ive done it but now i cant stop it!
    ive added buttons to start and stop, the start button works but the stop button doesnt. why doesnt "t.stop();" work?
        public void run() {
            while(t == Thread.currentThread()) {
                System.out.println("No " + t.getName());
                if (t.getName().equals("1")){
                    try {
                        t.sleep(1000); // in milliseconds
                    } catch (InterruptedException e) {}
                } else{
                    try {
                        t.sleep(250); // in milliseconds
                    } catch (InterruptedException e) {}
        }

  • Doubt with a Insert query!

    hi friends i have a doubt with a query in sql here is the following code.
    INSERT INTO
                         (SELECT employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id
                           FROM employees
                          WHERE department_id = 50)
               VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);The same insert statement can be achieved with
    INSERT INTO EMPLOYEES (employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id)
                        VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);What advantage does the first query have over the second one.
    Thanks in advance to everyone.
    Regards,
    Manoj

    Those two statements are identical.
    However this one would be different:
    INSERT INTO
      (SELECT employee_id, last_name,
            email, hire_date, job_id, salary,
            department_id
       FROM employees
       WHERE department_id = 50
       with check option )
    VALUES (99999, 'Taylor', 'DTAYLOR', TO_DATE('07-JUN-99', 'DD-MON-RR'), 'ST_CLERK', 5000, 50);The "WITH CHECK OPTION" would guarantee that only employees for department 50 are inserted.
    see also:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_10002.htm#i2066598
    Edited by: Sven W. on Mar 17, 2011 7:22 PM - typo correction

  • Doubts with working in BI

    Dear Experts,
    I am sure SAP follows the same concepts in BI as just recently i have worked in JasperSoft Talend Open studio.
    But i have some doubts with BI.
    I created a RFC in ABAP. Used that RFC to bring data for a single day as parameter  on to ingres database table .The ingres table is of same schema as of structure output.Finally i find that ingres table is populated after running relevant job.
    Now i thought to work twoards report and that worked as well.But still i have doubts.
    As i am new to BI ,i dont know what advantage i got by doing this breathless activity.
    (1) I would have simply used sap itself to generate report.What was the need to bring to mysql.Load to my server remain same because definitely RFC will be executed nowhere but on server itself.
    (2)If daily i have to run the same job ,obviously i could have done same with sap.Same amount of data will be retrieved with
    same overheads.
    As i said that i am new to BI.Plz explain me about power of BI  and what i am missing to conceptualize ?

    Aditya,
    You can definitely use SAP R/3 to generate these issues - the only issues are :
    SAP R/3 is an OLTP system
    by OLTP system the system is optimized / tuned to be able to do inserts and updates to tables but then the default indices are not tuned for reads ... this might cause report performance issues...
    SAPR/3 is not supposed to hold more than 2 years of data at best ( unless your system is small enough ) whereas a BI system can hold and should hold much more information.
    Getting the master data descriptions for the data you are reporting upon and that too across languages can be a challenge - whereas it can be better handled in a BI system...
    As for extracting large volumes of data you should use the Service API that comes with SAP Bi for better extraction performance ...
    some points why you need a BI system.....

  • Doubt with Implicit Enhacement in SAP ABAP

    Dear.
    I have the following doubt with the Implicit Enhacement in SAP ABAP created by me in several applications standard-
    If I Create an Implicit Enhacement in SAP ABAP for a function module or program standard , when the team basis is doing an upgrade the code abap created in the Implicit Enhacement not is deleted?
    I have created several Implicit Enhacement for Applications WD ABAP and FM, but I have this doubt.
    http://wiki.sdn.sap.com/wiki/display/ABAP/HowToDoImplicitEnhancement
    Thanks a lot in advance.
    Carmen G.

    Hi,
    you code will be retain after upgrade. If you have done implicit enhancements doesnt mean your code would get deleted after upgrades.
    In some cases you might have to activate your enhancments using SPAU.
    Thanks

  • My iPad screen has gone black.  I have tried resetting it with the sleep and home buttons and it only flashes the apple on the screen for a nano second and then it goes black again.  I can even hear notifications arriving, but I cannot see anything...

    My iPad screen has gone black.  I have tried resetting it with the sleep and home buttons and it only flashes the apple on the screen for a nano second and then it goes black again.  I can even hear notifications arriving, but I cannot see anything...I'd rather not reset it to the factory settings as I have a lot of things I worry about using.  Either way seems to me that the system itself is working since I can hear it working, but its the screen that isn't.  It has not been dropped and has been in a case for years!  Please help!

    When the power is on and I press the home button, I can slide my finger where the slider bar "would be" and it makes the noise as if its "opening" flashes a blue screen then returns black...

  • IPhoto 4.0 interferes with computer sleep mode?

    It seems that when IPhoto 4.0 app is open, it interferes with automatic sleep mode. I've narrowed it down to iPhoto by trial and error. Any thoughts on correcting this issue?
    My thanks

    I can't be more clear because I don't know what the problem is. My iPhoto is just not behaving the way it should. This is my second Mac with OS X and I know two ways to create a new Library and the results are the same in both senarios...
    I have tried to create a Library by doing what you suggested. I get the box that says my iPhoto Library was not found. If I click "Create Library", it asks "save as" and "where" then iPhoto opens and says "Loading Photos" but never does (and will create an iPhoto Library with the "Library.iPhoto" and "Thumb32.data" docs).
    The same thing happens when I try to create a new Library by starting iPhoto while holding the option key.
    My first post indicated the one thing that worked was to login as a new user. I was asking what the next step was because I thought there was a next step to that process. Guess not?

  • Troubles with the sleeper: how can I avoid it restarting on its own?

    When on sleeper, my MacPro early 2008 restarts on its own after a while.
    Until very recently, it worked perfectly well.

    Thanks for your help.
    I wonder if the the troubles I have with the sleeper and with the start button are not linked with an issue on the main disk. Apparently, I need to repair my main drive:
    - the number of volume files is not valid
    - the numner of volume directories is not valid.
    2013-12-15 11:02:20 +0100: Utilitaire de disque a commencé.
    2013-12-15 11:04:13 +0100: Vérification du volume « 1 Main HD »
    2013-12-15 11:04:13 +0100: Démarrage de l’outil de vérification :
    2013-12-15 11:04:15 +0100: Vérification en direct en cours.
    2013-12-15 11:05:18 +0100: Vérification du volume HFS Plus journalisé.
    2013-12-15 11:05:18 +0100: Vérification du fichier de blocs en excès.
    2013-12-15 11:05:18 +0100: Vérification du fichier de catalogue.
    2013-12-15 11:05:18 +0100: Vérification des fichiers à liens multiples.
    2013-12-15 11:05:18 +0100: Vérification de la hiérarchie du catalogue.
    2013-12-15 11:05:18 +0100: Vérification du fichier des attributs étendus.
    2013-12-15 11:05:18 +0100: Vérification bitmap du volume.
    2013-12-15 11:05:18 +0100: Vérification des informations du volume.
    2013-12-15 11:05:18 +0100: Nombre de fichiers de volume non valide
    2013-12-15 11:05:19 +0100: (normalement 617151 au lieu de 617152)
    2013-12-15 11:05:19 +0100: Nombre de répertoires de volume non valide
    2013-12-15 11:05:19 +0100: (normalement 173934 au lieu de 173933)
    2013-12-15 11:05:19 +0100: Le volume 1 Main HD s’avère corrompu et doit être réparé.
    2013-12-15 11:05:19 +0100: Erreur : Le disque nécessite un réparation. Démarrez votre ordinateur depuis un autre disque (tel que votre disque d’installation Mac OS X), puis ouvrez Utilitaire de disque pour réparer ce disque.2013-12-15 11:05:19 +0100:
    2013-12-15 11:05:19 +0100: Utilitaire de disque a cessé de vérifier « 1 Main HD »: Le disque nécessite un réparation. Démarrez votre ordinateur depuis un autre disque (tel que votre disque d’installation Mac OS X), puis ouvrez Utilitaire de disque pour réparer ce disque.
    2013-12-15 11:05:19 +0100:

  • My Iphone 4 keeps trying to turn itself off and also takes random screen shots.  I think it might have something to do with the Sleep/Awake button but any help would be greatly appreciated.

    My Iphone is constantly trying to turn itself off and also taking screen shots when I'm not touching it.  I think it may have something to do with the Sleep button but would welcome any suggestions. I have already restored it to Factory settings but it didn't help.
    Thanks,

    Did you try to set it up as new device, without using the latest backup?
    How to back up your data and set up as a new device

  • My Ipod Nano shuts off after awhile during use? Is this a defect or is this something correctable with the sleep/wake button? I want it to play continuously while I use it, not continually shut down?

    My Ipod nano shuts down continuously during use? Is this a problem/defect or can this be corrected with the sleep/wake button? While working out the unit goes black and the music stops?

    You don't have the headset jack plugged all the way in. Make sure the plastic on the headset jack is flush with the body of the Nano.

  • My 2011 iMac doesn't work with display sleep anymore after installing a clean copy of OSX 10.8 Mountain Lion

    My 2011 iMac doesn't work with display sleep anymore after installing a clean copy of OSX 10.8 Mountain Lion.
    I have it on upper left corner but it take the whole computer to sleep, no way to turn just the display.

    Hi, thaks for response, meant to post as a discussion (not question), wanted to save others time if they get the same problem

  • Doubt with alter system

    I have the doubt with the statement like :
    SQL> alter system set OPTIMIZER_FEATURES_ENABLE=8.1.7 scope=both;
    is going to permanently alter the system or for that particular instance or session. I mean is it done once or everytime in a new session. Also, how to see the currect value of this parameter, I mean how to query it?
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    user574290 wrote:
    I have the doubt with the statement like :
    SQL> alter system set OPTIMIZER_FEATURES_ENABLE=8.1.7 scope=both;
    is going to permanently alter the system or for that particular instance or session. I mean is it done once or everytime in a new session. Also, how to see the currect value of this parameter, I mean how to query it?
    I hope, my question is clear. Well, here is what alter system about SPFILE is
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref445
    From it,
    >
    SCOPE = BOTH     The change is applied in both the server parameter file and memory. The effect is as follows:
    For dynamic parameters, the effect is immediate and persistent.
    For static parameters, this specification is not allowed.>
    So this setting will persist across the session logon and log off.
    Suggestion, its good to check oracle docs, choke full of useful info.
    HTH
    Aman....

Maybe you are looking for