A question about sleep procedure

I want to create a process that will call a function periodically with a certain repeating time which is decided by another process.
I write a process with a infinite LOOP, then I use DBMS_LOCK.sleep() to control the repeating time of that function. So I wonder how accurate the sleep() is? I know the accuracy is hundredth of a second. If I set the time is 1.99, will this process really sleep exactly for 1.99 second and then be invoked? Thnaks.

Hi,
I don't know the exact accuracy and I suspect that no guarantees are made. However, simple tests show that dbms_lock is accurate to about +/- .01 seconds.
e.g.
sqlplus
SQL> set timing on
SQL> exec dbms_lock.sleep(1.5555)
SQL> exec dbms_lock.sleep(1.5555)
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.57
You should dismiss the first result since this includes overhead to cache some stuff (although maybe you need to take that into account too).
Hope this helps,
Ravi.

Similar Messages

  • A question about sleep.

    Two months ago I upgraded (perhaps downgraded is a better term, depending on perspective), anyways changed machines from my trusted 1 Ghz Powerbook G4 Ti to a White MacBook Intel 2.1 Ghz Intel Core 2 Duo.
    My main question here is does the MacBook put itself to sleep when the battery reaches a certain level? My PowerBook always put itself to sleep when the battery went down to around 20% or so. But recently I have discovered that when I leave and have my MacBook running it turns itself off when the battery reaches 0% even after a smc reset and a reformat and reinstall. At least that's what it says when I plug it in and have to turn it on instead of just waking it from sleep. Is this something that is normal now or should it be going to sleep like the PowerBook did? Yes I know - just plug it in before I leave. If I know I am going to be gone a long time I do - sometimes I plan to be gone only a short time but plans change. Plus I believe everyone who can, should save energy when they can.
    I have contacted apple about this problem and several others (now and then the speakers will crackle and unplugging headphones there will be no sound, and keys sticking) and they will be picking up the MB to check it out. Just curious if anyone else has had this/these problems and if you got them fixed.
    *Little Rant* And I have to admit I find the intel machine a bit frustrating and I am totally unimpressed with it. (Final Cut Pro 4/5 doesn't work as well as some other costly PPC apps not working or working poorly). Yes I know, why get a MacBook for doing stuff like that - because I don't do a lot of creating anymore - generally just upkeep and small changes. Not enough to justify the cost difference.
    Also I thought the increased cpu power would make it fly - but I still get the spinning beach ball a lot. Although processing short videos and animations is quicker (obviously 1 Ghz vs 2.1 Ghz) - but I wonder if the 2.1 intel is actually much faster (I mean more than a minute) than the 1.67 ppc - does anyone know?

    Thanks for the input iBod.
    Setting the time to go to sleep when idle is not really the problem. I've been using Macs for about 8 years now and I already know about setting the preferences. This year was my first intel MacBook and it isn't as similar as I thought it would be. Sorry if I wasn't more clear in my earlier post.
    When I do leave it unattended and running it is because it is processing some stuff for me (be it a video, music, downloading, or whatever) as well as for example a project in iwork and/or photoshop is still open so I can just start where I left off when I return.
    The problem I am having is (I am not sure if this is what you mean by "deep sleep") that the computer literally shuts down and I have to push the power button and the MB does a total restart (vs the Powerbook which would just go to sleep so I'd plug it in, press a key and it was exactly where I left off).
    This worries me, as I know hard shut downs (which what this seems like to me) aren't good for a computer at all, plus the possible and probable data loss. It seems to be a step away from having things "Just Work" rather than a step forward.
    I don't suppose you (or anyone else reading this) knows of any script, terminal setting or preference that I could use to put my MB to sleep when the battery reaches a certain low level?
    About final cut 4/5 not working. I didn't mean it that it worked slowly, I meant that it won't even install. When I tried to install it gave some weird video error (can't remember clearly but it was something like 'this machine isn't equipped with agp video card (or something like that) and can't be installed'.
    Thanks again for chipping in though.

  • Question about sleep resume issue

    Hi friends! I have the following question: When I resume my T430 Thinkpad from sleep and is not plugged in instead of bringing back the screen of my last session the computer starts booting. This cause lots of problems especially if I have any unsaved work. I didn't have this problem in the past (after I was pressing the green button my computer was always starting at the session that I left it before I chose SLEEP). I usually don't have this problem if the computer is plugged in. I also noticed that this happens only if the remaining battery time is 2 hours or less (or maybe this is just a coincidence). Has anyone else experienced the same problem? Is there a setting that I can change? Thank you!

    Yes. I have this problem with my T430, but only when I have both the main battery and also the battery "slice" installed. What happens is that after the first battery is run down (the "slice" is run down first), the T430 switches to the other battery (the main battery). If I then suspend the computer, it appears that it tries to maintain the memory during sleep mode using the depleted battery which, of course, results in the same thing as removing the battery while in sleep.
    I've tried to figure out how to contact Lenovo but, despite having an extended support contract, I have been unable to do so. I'm hoping someone here can help or can direct me to where I can find out how to contact Lenovo about what is obviously a flaw in their design.

  • Need  help....question about transit procedure  ..

    Hello gurus
    Can somebody help me understand the transit procedure ?
    my question is
    if we are implementing GTS for a company in US and its not a global implementation . and the company does
    only exports to the EU customers for example to France
    Is it necessary for us to file a transit declaration ?
    If yes to which customs offices we have to send the EDI for declaration ?
    Does the american company have to follow NCTS?
    and if we are like importing goods from EU to USA what is the process?
    Is NCTS strictly for the companies which operates in EU and EFTA?
    thanks alot for the help

    hi,
    transit declarations are only for processes within a customs union (NAFTA or EU).
    However if you export to or import from the EU you have to file customs declarations. With GTS you can do this all electronically in the US (with AES and ABI) and in many european countries. (Germany, NL, CH, FR etc.).
    Balazs

  • Some question about replication procedure?

    1.At the function __rep_process_message in the file D:\db-4.5.20\rep\rep_record,
    there are several types of messages to be handled.
    REP_LOG/REP_LOG_MORE : It indicates starting to transfer log record from
    client to master
    REP_PAGE/REP_PAGE_MORE: What are these messages used to ?
                   Does it indicate in some special case, master
    will transferdatabase file directly to client to
    accomplish replication synchronization ?
    2. When does the master start to send log records to client?
    I mend source code of ex_rep_base example provided by BDB as follow:
              ret=dbenv->txn_begin(dbenv,NULL,&txn,0);
              //step 1
              Sleep(3000);
              printf("---------------txn_begin Waken--------------------\n");
              if (ret !=0 )
                   dbenv->err(dbenv,ret,"transaction begin fail");
                   goto err;
              if ((ret = dbp->put(dbp,
              txn, &key, &data, 0)) != 0) {
                   dbp->err(dbp, ret, "DB->put");
                   goto err;
              //step 2
              Sleep(3000);
              printf("---------------Waken--------------------\n");
              ret=txn->commit(txn,0);
              //step 3
              if (ret!=0)
                   dbenv->err(dbenv,ret,"transaction commit fail");
                   goto err;
    I print message being processed at client.
    At step 1: no message is processed.
    At step 2: two REP_LOG message are processed.
    At step 3: one REP_LOG message is processed.
    Does it mean: the master don not need to wait for the put transaction commit to send log records to clients?
    And when does the master send log records to clients ?
    3. A test case is tried as follow:
         Step 1: Start Master and client;
         Step 2: Add records to master.
         Step 3: kill client and delete the database file of the client.
         Step 4: restart client, and query client's database to check if it has
    caught with master.
         (there is not write requests to master at step 4)
         Step 5: send write requests to master.
    Result: At step 4, it takes a long period of time for the client to catch
    up with master.
         But after step 5, the synchronization procedure is very fast. It takes a
    very short period of time for the client to catch up with master.
         What is the reason?
    Thanks a lot !

    1. LOG and LOG_MORE messages convey log records, usually from the master to the client. (If using client-to-client synchronization, log records may be copied from one client to another, in certain circumstances.)
    PAGE and PAGE_MORE messages convey the contents of database pages during "internal init" (which is mentioned in db-4.5.20/docs/ref/rep/mastersync.html). Again, this is usually from master to client, but could be from client to client in some circumstances.
    2. The master generally sends log records to clients as soon as the operations that generated them occur (db->put, txn->commit, env->txn_checkpoint, etc). (See also the discussion of Bulk Transfer, however: db-4.5.20/docs/ref/rep/bulk.html)
    3. The client realizes it has "caught up" with the master (STARTUPDONE event) when it can process the first "live" log record generated by the master. Thus it relies on the master doing some new write requests after the client has started synchronization.
    Alan Bram
    Oracle

  • Curious question about sleep light.

    Currently loving my new 2011 17" MBP, it's been completely great, no problems at all.
    I'm just curious about one little thing. My sleep light, seems a little dimmer on the right half. Looking at it at different angles seems to make it look "full". I was just wondering if this is the normal?
    Like I said, I love the computer, and I don't plan on returning it because of this, I'm simply curious if this is what it's supposed to look like.
    I'm thinking perhaps there's some dust or something in there affecting how it looks at certain angles.

    I just got the new 15' mbp myself an have had no problems.
    Except the issue you have. Although mine seems like its lost lighting on left side. Its very very minor but I can tell, which bothers me becuase I'v paid $2000 for it brand new for a reason (to look brand new).
    Have you had problems with it since than?
    An also wondering if you could would you exchange it for a brand new one because I do have 14 days to take back?

  • Really silly question about Sleep

    I am accustomed to my old MacBook Pro, which recently died, being put to Sleep by closing the lid.
    I am accustomed to my ancient G4 iMac, where you put it to Sleep by the keyboard combination Command-Option-Eject.
    I just bought a refurbished late-2012 iMac with the Bluetooth keyboard and mouse. Do I have to invoke Sleep by selecting in in the Apple menu, or is there a new keystroke command?
    Thanks in advance,
    --WA

    You can put your Mac to sleep by two ways:
    1. Through a shortcut: hold Option, Command and Eject keys.
    2. Go to  > Sleep.
    Both options will work by the same way because both do the same

  • Question about sleeping

    I have to check at regular intervals for files in a directory and do some work with the files. I want to check every 5 minutes and see if the files have been updated or changed (by some other nonJava process), do some processing on the files and sleep for the next 5 minutes. I was not sure how I can check the files at the regular intervals. Any help is welcome. Thanks.
    -kn

    Hmmmm...well, I can think of two ways:
    1. Use Thread.sleep(int millis)
    "(from 1.4 api)Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds. The thread does not lose ownership of any monitors.
    Parameters:
    millis - the length of time to sleep in milliseconds."
    In your case, milliseconds would be 5 (minutes) * 60 (seconds) * 1000 (milliseconds) = 300000
    2. Make your program check the files only once and run it every 5 minutes in a cron job. If you don't know what this is or are not on Unix, maybe check out Scheduled Tasks on Windows.
    The first option is best for you, probably...
    Tarabyte

  • I just got a new macbook pro and I had a question about sleep vs off.

    When do you turn it off? i hear from alot of people that they never turn it off, rather they keep it on sleep mode, even overnight. What os the best for your macbook?

    One of the reasons that people just sleep it is that OS X is based on the Unix operating system, which was designed for servers, which means the OS was designed to be run 24/7. It has no problem with not being shut down in weeks.
    And in fact that's how I run my Macs. They stay up for weeks, sleeping at night, often they are only restarted if a software update requires it.
    Avoiding a full shutdown has many practical benefits too. You can leave many apps and documents open when you sleep it, and when you wake it, all your work and logins are already open and waiting for you.
    In other words, taking advantage of sleep means you have an "instant-on" computer. You don't need to care how long it takes a computer to boot up, if you hardly ever boot up, and if your own wake-to-work time is basically one or two seconds with no need to re-open anything.
    I and many other Mac users have successfully used sleep-only habits during extended travel. At least a couple times I have left on a trip, carried my MacBook Pro on a plane, across continents and oceans, and trains and buses and walking, and all the way back home, in a single OS X uptime session, never restarting or shutting it down at all. (Although sleeping it during transport, of course.)

  • Really really easy question about sleeping MBP

    I have a macbook pro and i am running a program that cannot save for whatever reason, and i want to know if i can close the screen (putting the computer to sleep, i havent changed any defaults), will my program QUIT causing me to loose all of my work, or will it remain "open" and open with my work the next time i open my screen
    thanks
    ben

    Your program may quit for other reasons which you have no control over.
    Backup and save your data frequently*:
    http://www.macmaps.com/backup.html
    - * Links to my pages may give me compensation.

  • Question about table/procedure being used by other objects

    Hi,
    I have a table xyz and a package abc. How can I check all sql scripts/objects/users that are using these objects (table xyz & package abc)?
    Neil

    Oh, and this is Oracke 10g running on AIX.

  • Questions about CIN tax procedure choice and pricing schemas

    Hi all,
    I have to implement SAP on a Indian company and I'm verifying all particularity about this country (in particular tax procedures and the great number of differents tax conditions used).
    I have two questions about tax procedures and pricing schemas. Every feedback about thse points will be appreciated.
    a) To choose tax procedure TAXINN or TAXINJ which are the elements that I have to consider?
         I have read lot of documentation about CIN implementation and Iu2019m oriented to choose TAXINN schema, but If possible I  would  to understand better which are on behalf of one choice or another.
    b) To define pricing schemas for India, after check with local users and using examples of documents (in particular tax invoice) actually produced, I have understood that taxes have to be applied on amount defined starting from price list, minus discounts recognized to customer plus surcharges eventually to bill (packing, transport,  etc.).
    Itu2019s correct for any type of taxes that tax amount is calculated on u201Cnet valueu201D defined at item level or there are exceptions to this rule?
    Thanks in advance
    Gianpaolo

    hi,
    this is to inform you that,
    a) About point 1 I know the difference between the 2 tax procedures (conditions or formulas). I also have read in others post in the FORUM that TAXINN is preferable. So I would to understand which are the advantages to choose instead TAXINJ. There are particular reasons or it'a only an alternative customizing setting?
    a.a. for give for posting the link : plese give me the advantages of TAXINJ and TAXINN
    CIN - TAXINN and TAXINJ
    b) About point 2, to define which value has to be used as base amount to calculate taxes isn't a choice, but is defined depending by fiscal requirement of the country, in this case India fiscal requirement. I know that, as Lakshmipathi
    write as answer on my question, exception could be, but it was important for me to understand if I have understood correctly the sequence of the pricing condition in the schema in "normal" situation.
    b.b. you can create your own pricing procedure for this and go ahead.
    hope this clears your issue.
    balajia

  • Question to Guided Procedures

    Hello,
    in our company I'm evaluating WFM-Tools.
    I have two questions about Guided Procedures:
    (1) Is it possible to delete entities of a running process in the CAF Guided Procedures? To stop a process is no problem, but I didn't solve to delete them completely.
    (2)Is it possible to escalate dates in a process?
    I would be very glad, when someone give me some links, informations, documents e.g. for implementing Composite Applications and Guided Procedures.
    Thanks a lot
    Steve Mussdorf

    Hi Steve,
    In addition to the link that Srini gave, you can check the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/39/198141f906040de10000000a1550b0/frameset.htm">GP documentation</a>.
    To your questions - the functionality to delete process instances is not yet available but will come soon.
    Changing the process due date is possible using the so-called process control items. See the following <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/42/cec68872c56baee10000000a1553f6/frameset.htm">docu</a>.
    Regards,
    Zornitsa

  • A question about the impact of SQL*PLUS SERVEROUTPUT option on v$sql

    Hello everybody,
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0  Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    OS : Fedora Core 17 (X86_64) Kernel 3.6.6-1.fc17.x86_64I would like to ask a question about the SQL*Plus SET SERVEROUTPUT ON/OFF option and its impact on queries on views such as v$sql and v$session. Here is the problem
    Actually I define three variables in SQL*Plus in order to store sid, serial# and prev_sql_id columns from v$session in order to be able to use them later, several times in different other queries, while I'm still working in the current session.
    So, here is how I proceed
    SET SERVEROUTPUT ON;  -- I often activate this option as the first line of almost all of my SQL-PL/SQL script files
    SET SQLBLANKLINES ON;
    VARIABLE mysid NUMBER
    VARIABLE myserial# NUMBER;
    VARIABLE saved_sql_id VARCHAR2(13);
    -- So first I store sid and serial# for the current session
    BEGIN
        SELECT sid, serial# INTO :mysid, :myserial#
        FROM v$session
        WHERE audsid = SYS_CONTEXT('UserEnv', 'SessionId');
    END;
    PL/SQL procedure successfully completed.
    -- Just check to see the result
    SQL> SELECT :mysid, :myserial# FROM DUAL;
        :MYSID :MYSERIAL#
           129   1067
    SQL> Now, let's say that I want to run the following query as the last SQL statement run within my current session
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;According to Oracle® Database Reference 11g Release 2 (11.2) description for v$session
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3016.htm#REFRN30223]
    the column prev_sql_id includes the sql_id of the last sql statement executed for the given sid and serial# which in the case of my example, it will be the above mentioned SELECT query on the employees table. As a result, right after the SELECT statement on the employees table I run the following
    BEGIN
        SELECT prev_sql_id INTO :saved_sql_id
        FROM v$session
        WHERE sid = :mysid AND serial# = :myserial#;
    END;
    PL/SQL procedure successfully completed.
    SQL> SELECT :saved_sql_id FROM DUAL;
    :SAVED_SQL_ID
    9babjv8yq8ru3
    SQL> Having the value of sql_id, I'm supposed to find all information about cursor(s) for my SELECT statement and also its sql_text value in v$sql. Yet here is what I get when I query v$sql upon the stored sql_id
    SELECT child_number, sql_id, sql_text
    FROM v$sql
    WHERE sql_id = :saved_sql_id;
    CHILD_NUMBER   SQL_ID          SQL_TEXT
    0              9babjv8yq8ru3    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;Therefore instead of
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;for the value of sql_text I get the following value
    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES);Which is not of course what I was expecting to find in v$sql for the given sql_id.
    After a bit googling I found the following thread on the OTN forum where it had been suggested (well I think maybe not exactly for the same problem) to turn off SERVEROUTPUT.
    Problem with dbms_xplan.display_cursor
    This was precisely what I did
    SET SERVEROUTPUT OFFafter that I repeated the whole procedure and this time everything worked pretty well as expected. I checked SQL*Plus documentation for SERVEROUTPUT
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Could anyone kindly make some clarification?
    thanks in advance,
    Regards,
    Dariyoosh

    >
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Hi Dariyoosh,
    SET SERVEROUTPUT ON has the effect of executing dbms_output.get_lines after each and every statement. Not only related to system view.
    Here below what Tom Kyte is explaining in this page:
    Now, sqlplus sees this functionality and says "hey, would not it be nice for me to dump this buffer to screen for the user?". So, they added the SQLPlus command "set serveroutput on" which does two things
    1) it tells SQLPLUS you would like it <b>to execute dbms_output.get_lines after each and every statement</b>. You would like it to do this network rounding after each call. You would like this extra overhead to take place (think of an install script with hundreds/thousands of statements to be executed -- perhaps, just perhaps you don't want this extra call after every call)
    2) SQLPLUS automatically calls the dbms_output API "enable" to turn on the buffering that happens in the package.Regards.
    Al

  • Question about download file in OAS4

    Question about download file in OAS4:
    I use Oracle Application Server 4.0.7 on my Windows NT 4.0 SP6;
    I use PL/Sql Cartridge developer a document system; It's use the
    upload/download in PL/Sql Cartridge;
    I read the document , the Upload/download in Pl/Sql Base on the
    Oracle Application Server's Content Service. the Problem is when I
    download a document, If I upload a Html or MsWord file, It will store in a LongRaw column, when me download ; It's tell me can't
    find a application to open this file; I will select a application
    from list to open the download file;
    As normal, It will open MsWord Automatic when download a "doc" file ; also It will open a new window of Browser to view a Html file;
    I check the download process on client Browser; when download
    file, The content-type always return "application/octet-stream";
    Also the download File will lost the postfix of the file,
    So Browser don't open the File Automatic;
    I think If I set the correct Content-Type , Browser can know how open the file; So I use owa_content.set_content_type procedure
    set the Doc file to "application/msword" , but the WEb Server always
    return "application/octet-stream";
    I didn't know how to do this problem, Plese help me.
    null

    I have a Tecra M2 and rely on your email update to ensure I have the latest drivers on my machine.
    When I received a Toshiba support email on 14 April 2005 giving reference to a QFE from Microsoft I assumed it would be necessary for my Tecra.
    I was very confused when I found that this QFE and subsequent ones posted on the 16 April 2005 relate to Pre SP2 critical updates no9t required if one has already taken earlier advice of updating to Service Pack, at the very least your narrative should make mention of this. I find it very difficult to believe that your updates are two+ years out of date.

Maybe you are looking for

  • How to unSelect checkBoxes inside a buttonBar

    Hello! I've been a Flex developer for several months now and have made some great strides.  However, I've ran across a problem that requires some help from the Pros. I'm using Flash Builder 4.5 Premium. Scenerio: I have a buttonBar whose dataProvider

  • Trying to use SOUNDTRACK to edit a radio audtion tape?

    I am trying to use soundtrack to record audition tapes to be sent out to different radio statioins on CD's. I have a mixer hooked up to the G5 audio inputs which feeds the program just find. What I need help with is editiing out mall parts of audio (

  • The fields of type Int 1  not appearing in Infopackage selection

    Hello Gurus, I have created a generic datasource on two tables . The fields that should be set as Selection fields for the DataSource are the following: -     field 1------type char -     field  2---- type char -               field 3---- type Int1 -

  • HOW TO INTERACT TO EXTERNAL SYSTEM FROM OBIEE.

    Hi Guys, REQUIREMENT My requirement is need to navigate to a ADF page from my OTBI content passing along login/authentication credentials of ADF page,Such that ADF page should open seamless... So far am able to navigate to ADF page ,but every time ne

  • Re: Low data cap for highest tier internet makes no sense

    AWESOME NEWS EVERYONE!  Comcast has decided to Give me an unlimited service. YAY! I can know Call China, Hong Kong, India, Mexico, Singapore, South Korea via my comcast landline. Plus any calls to these countries no longer count against my carefree m