Timer in the database

Hello, I have a question about the timer in the database.
I have a job that has a priority of 1. That job needs to run from time to time.( that is to run once and then sleep for a while.) The sleeping time is provided by another job. I am using DBMS_LOCK.sleep().
When the database is almost idle, if I set the sleeping time is 2 seconds, then it is accurate. But when the database has some workload (that means there are other jobs running), and the cpu util is not very high (around 70%). If I set the sleeping time as 2 sec, I found the actual sleeping time is almost 3 sec.
Are there any better ways to improve the accuracy? How about I set the timer on another idle machine, and that machine sends a request to the database and then the database response that request?
Great thanks.

Hi,
I don't think that the actual time taken by dbms_lock.sleep should vary that much with the load on the database. You can use plsql profiling or tracing to see where the time is really being taken up.
How are you using another job to provide the sleep time to the first job ? If you are using a table maybe you might be able to get a better response using dbms_pipe instead.
Depending on where your bottleneck is using another idle machine to do the scheduling may provide a better worst response time. But the average response time may be worse because of network latency.
Hope this helps,
Ravi.

Similar Messages

  • Changing the OS local time while the database is Up and Running

    Hi,
    Will there be any bad effect if I change the OS local time of my servers while the database and application is up and running?
    Why do I need to do this? because the database is RAC configured and I want to avoid "brain-split" because of discrepancies
    in the local time of DB Servers.
    NTP is not yet implemented so I am to adjust the time manually for each servers.
    BTW, I am using database 10gR2 (10.2.0.4) and EBS application (11.5.10.2). My nodes are running in Linux 4, 2.6.9-42ELsmp x86_64.
    Regards,
    Jay A

    But my very concern right now is if there will be negative effect on the data or timestamp in the datafiles of the database
    because I change the local time of the server while the database is running.Change time, that make time in database is changed. and you are changing time at milliseconds. you won't see affect.
    we should worry different time between servers more than time changing
    you can use ntpdate to query time different from server before.
    # ntpdate -q ntp.server.org
    http://linux.die.net/man/1/ntpdate

  • How do i update the current time to the database ?

    Hi guys...
    How do i connect the "Date/Time string" to the DB Tools Update Data.vi ??? Is it connect it to the point/pin called "condition" of DB Tools Update Data.vi ?
    I am kind of confuse of how do i connect...
    Thanks in Advance.
    Attachments:
    Att taking.png ‏102 KB

    This is the error i get...{    NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlibB Tools Update Data.vi->FYP_3.1.vi<ERR>ADO Error: 0x80040E14
    Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlibB Tools Update Data.vi->FYP_3.1.vi  }
    When u scans a card, it will show you your information with the Current Time/Date on the table. and update it on the database....
    I try the example of DB tools update data vi .. it make me more confuse :l

  • How to insert the sysdate time into the database

    hi all,
    when i execute the following query,
    insert into table_name
    (date_field)
    values
    (to_date(sysdate, 'yyyy/mm/dd hh24:mi:ss'));
    The value is inserted as 08-02-12 12:00:00. In this query, it always stores the default time as 12 a.m.
    But i need to insert the original system time not the default one.
    please help me how to rectify it.

    I do not understand as to why you are using the to_date function on sysdate since sysdate is already in date format.
    If date_field is of the data type date, then the following dml should work.
    insert into table_name(date_field) values (sysdate);
    In case date_field is a varchar2 field and you want to store the date and time in a string format, then the following statement should work.
    insert into table_name (date_field)
    values (to_char(sysdate, 'yyyy/mm/dd hh24:mi:ss'));

  • How can I use the database default time rather than Java supplied time

    I've searched over and over and nobody seems to have this issue so maybe its just me!
    When inserting a record I would like the a create_date column to automatically use the database time rather than a supplied time via JPA. That was all times a relative to the database which makes sense.
    The trouble is I cant figure out how to do this in a sensible manor.
    If I specify an column like :
         @Temporal(TemporalType.TIMESTAMP)
         @Column(name = "CREATE_DATE")
         private Date createDate;
    and IDL
    CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_DATE NOT NULL
    If I leave createDate null I get an exception. If modify the column to allow Nullable then column is set as Null.
    If I leave the column out of the entity bean and then and create a row then the database current time is inserted. The trouble then is that if I want to read the date I'm going to have to create a copy of the bean but with the CREATE_DATE in it, and this doesn't make sense.

    I should also mention that TopLink has always supported the ability to retrieve the current time from the database for use in optimistic locking. The TimestampLockingPolicy offers the ability to configure the next value being retrieved from the database instead of using the local time from the JVM. Our extended optimistic locking configuration does not currently support setting this option but it could be done using a descriptor customizer which can be configured in your persistence unit properties.
    Using optimistic locking may be a good solution for the last modified date since it will also ensure that you do not corrupt the database if someone else has incremented this value since your last read.
    Doug

  • In ICal is there a way to see all of the text in all day events on the month view of the calendar.  Seems to wrap text only if there is a time on the event

    In ICal is there a way to see all of the text in all day events on the month view of the calendar?  Seems to wrap text only if there is a time on the event

    The paths won't agree on the two OSs so a simple XML import isn't likely to work.
    See Sync iPod/iPad/iPhone with two computers and, if needed, Make a split library portable. The techniques in the first link will work when moving the library between Windows and OS X as long as the library is "portable", but iTunes takes quite some time checking the database when the library is opened under a different OS.
    tt2

  • How do i store and fetch image from the Database(Access)

    i am facing one problem in inserting the image into the database.the steps i followed as
    1)i have created one database(access) as "Image" and into that one table as "Image" and field as "image"
    type of the field is ole object.
    2)i have inserted one image into the image field through "database.vi"
    3)now i am trying to get the image from the database by "Fetching Example.vi"
    4)it will succesfully retrieve the image from that field .
    5)but when i close the both programs and reopen those that time i am unable to get retrieve the image.
    Attachments:
    Add_to_Database.vi ‏78 KB
    Fetch_from_database.vi ‏67 KB

    I would like to suggest different approach for saving the images in the database.
    I was working on Medical Imaging Company. The way we save the images in real-time was by writing the name and path of the images to database.
    The images themselves where saved directly to disk.
    I don�t think that access is very good in taking care of GBytes of data.
    It happens some time that the database gets damage. If you have the images separately you can create fix procedure. (We had one).
    Good Lack,
    Amit Shachaf,

  • Problem while inserting Date/Time in Oracle Database

    Hai,
    i want to insert the date and time in a date column. here, i am using java.sql.Date and java.sql.Time to assign the date in Prepared Statement.
    PreparedStatement psmt=con.prepareStatement("insert into test(ex_date) values(?)");
    java.util.Calendar c=Calendar.getInstance();
    c.set(2002,2,21,10,10,00);
    java.sql.Date d=new Date(c.getTime().getTime());
    java.sql.Time t=new Time(c.getTime().getTime());
    psmt.clearParameters();
    psmt.setDate(1,d);
    psmt.setDate(1,t);
    psmt.executeUpdate();
    Above program is inserted the Date and time in the database as the following "1900/2/21 10:10 AM"
    but i am giving the year as 2002. it inserted the year as 1900. what is the problem with the code?
    please let me know
    Thanks in advance.
    Regards
    sankarjune14

    Hai Franco,
    i put the wrong code. Here, is the Original Code.
    PreparedStatement psmt=con.prepareStatement("insert into test(ex_date) values(?)");
    java.util.Calendar c=Calendar.getInstance();
    c.set(2002,2,21,10,10,00);
    java.sql.Date d=new Date(c.getTime().getTime());
    java.sql.Time t=new Time(c.getTime().getTime());
    psmt.clearParameters();
    psmt.setDate(1,d);
    psmt.setTime(1,t); // Last time i put psmt.setDate(1,t);
    psmt.executeUpdate();
    and, the getTimeInMillis() method is a protected method in java.util.Calendar class. how can we use it
    please give me some other idea to insert the date and time in oracle database.
    Thanks in advance
    sankarjune14

  • Message: "The database structure has been modified" every time I log to SAP

    Hello,
    "The database structure has been modified. In order to resume this process, all open windows will be closed". Every time I log to one of my companies in SAP Business One this message appears.
    I haven't installed any new addons and made no changes in database structure (and any other user hasn't done any changes), but this message appears always when I log to company for the first time (when I try to log on another user or log to another company there is no message). Can anyone help me with this problem?
    Best regards
    Ela Świderska

    Hi Ela Świderska,
    You may check this thread first:
    UDFs disappeared
    Thanks,
    Gordon

  • Connecting to the database taking long time to connect database server

    Hi
    When I execute procedure i am getting the below message at bottom of the Oracle SQL Developer
    "Connecting to the database"
    it is taking more than 10 min plz guide

    Hi
    have you installed a normal Oracle Client also on your Host? normal Oracle Client
    Did you connect with host:port:sid or with a Oracle Naming Service? through TNS Service
    Can you test tnsping <alias> yes, It is working fine
    Did other user have the same problem? yes
    Did you connect through WAN or LAN connection? LAN (Intranet)
    Can you tell more about you client/database setup?
    Database setup:
    OS: Window 2008 server
    version: 11.1.0
    Client: 11.1.0
    OS: Window 2008 server
    Now I am not able to execute single select query which table contains 6 records and 15 columns it is taking long time I have waited 30 min still no resutls
    only one table is behaving like this remaining is working fine
    Edited by: user9235224 on Oct 6, 2012 7:06 PM

  • Takes more time to start & shutdown the database

    Hi All,
    I have created a database in oracle9i by following manual steps. Every thing was created successfully and am able to start the database and shutdown also.
    but the problem is while giving the startup command it takes more time to start the database and the same during the shutdown. So anyone help me..
    the follwing are the pfile specifications:
    db_name=practice
    instance_name=practice
    control_files= 'E:\practice\control\control1.ctl',
              'D:\practice\control\control2.ctl'
    db_block_size=2048
    db_cache_size=20m
    shared_pool_size=20m
    background_dump_dest='E:\practice\bdump'
    user_dump_dest='E:\practice\udump'
    Thanks in Advance

    Every thing was created successfully and am able to start the database and > shutdown also.Please restate the above.
    problem is while giving the startup command it takes more time to start the >database and the same during the shutdownHow have you compared? Could it be O/S resources, installation of additional software; you have not mentioned the O/S and complete version of your database.
    You can review the following although I am bit unclear;
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96533/instreco.htm#440322
    Adith

  • Secure Store Service Application takes a lot of time and does not create the database

    Hi everybody,
    I was trying to configure sharepoint performance point and I was following the instruction. After I created the performance point services application I tried to creat the secure store service application. When I do this, the progress window stays open forever
    even after 2 hours. If I close the window, I will see that the secure store service and proxy app is created and the application pool also is created in IIS but the database is not and the application service is stopped. even when I want to delete it, it's
    the same story and the progress window stays until I close it manually. Nothing has been logged in the event viewer because it doesn't throw any exceptions.
    I don't think that I have permission issues on the database server side because I have created the performance point service app and the database is there. I have used the same credentials to crete the secure store.
    I have restarted the secure store service and IIS for many times and even the server itself.
    I'm wondering if anybody has had this issue because I couldn't find anything on the web.
    Thanks,
    Edwin 

    Alex, please ignore my previous answer. I found more information in the ULS. At the time that I started creating the service application by power shell these things are logged and they are repeated several times:
       it starts with:
    11/13/2013 15:19:55.52 PowerShell.exe (0x1698)                
    0x170C
    Secure Store Service          
    Secure Store                  
    esj6 High    
    Creating Secure Store Service Application 'Secure Store Service Application'.
    c402af0c-5ff6-4995-83b8-3f95210a8b3d
    11/13/2013 15:19:55.54 PowerShell.exe (0x1698)                
    0x170C
    Secure Store Service          
    Secure Store                  
    esj9 Medium  
    Creating "database object" 'SP_SecureStore' for application. At this time database is not created.
    c402af0c-5ff6-4995-83b8-3f95210a8b3d
    11/13/2013 15:19:55.54 PowerShell.exe (0x1698)                
    0x170C
    Secure Store Service          
    Secure Store                  
    esk0 Medium  
    Saving "database object" 'SP_SecureStore' in the config db.
    c402af0c-5ff6-4995-83b8-3f95210a8b3d
    11/13/2013 15:19:55.83 w3wp.exe (0x0944)                      
    0x0DB4
    Secure Store Service          
    Secure Store                  
    d4gx Verbose
    BackgroundTasks instance accesed.
    11/13/2013 15:19:55.83 SPUCWorkerProcessProxy.exe (0x13A0)    
    0x02B0
    Secure Store Service          
    Secure Store                  
    d4gx Verbose
    BackgroundTasks instance accesed.
    11/13/2013 15:19:55.83 PowerShell.exe (0x1698)                
    0x1740
    Secure Store Service          
    Secure Store                  
    f7wk Verbose
    StartTracker called for secure store ''
    11/13/2013 15:19:55.83 PowerShell.exe (0x1698)                
    0x1740
    Secure Store Service          
    Secure Store                  
    f7wl Verbose
    Tracker not started because call not made from Service Host.
    11/13/2013 15:19:55.83 WebAnalyticsService.exe (0x0A6C)        
    0x1B88 Secure Store Service          
    Secure Store                  
    f7wk Verbose
    StartTracker called for secure store ''
    Finally it says:
    11/13/2013 15:19:55.90 PowerShell.exe (0x1698)                
    0x170C
    Secure Store Service          
    Secure Store                  
    esk9 High    
    Secure Store Service Application 'Secure Store Service Application' created.
    c402af0c-5ff6-4995-83b8-3f95210a8b3d

  • Error -1074384569; NI-XNET: (Hex 0xBFF63147) The database information on the real-time system has been created with an older NI-XNET version. This version is no longer supported. To correct this error, re-deploy your database to the real-time system.

    Hello
    I have a VeriStand-Project (VSP) created with my Laptop-Host (LTH) which works with my PXI, while
    deploying it from my LTH. Then I have installed the whole NI enviroment for PXI and VeriStand use on a
    industrial PC (iPC). I have tried to deploy my VSP from the iPC to the PXI but the following error
    message arose on my iPC:
    The VeriStand Gateway encountered an error while deploying the System Definition file.
    Details: Error -1074384569 occurred at Project Window.lvlibroject Window.vi >> Project
    Window.lvlib:Command Loop.vi >> NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Connect to System.vi
    Possible reason(s):
    NI-XNET:  (Hex 0xBFF63147) The database information on the real-time system has been created with an
    older NI-XNET version. This version is no longer supported. To correct this error, re-deploy your
    database to the real-time system. ========================= NI VeriStand:  NI VeriStand
    Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI
    VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> NI VeriStand Engine.lvlib:Initialize
    Inline Custom Devices.vi >> Custom Devices Storage.lvlib:Initialize Device (HW Interface).vi
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * • Unloading System
    Definition file... • Connection with target Controller has been lost.
    The software versions of the NI products (MAX/My System/Software) between my LTH and the iPC are
    almost the same. The only differences are:
    1. LabView Run-Time 2009 SP1 (64-bit); is installed on LTH but missing on iPC. The iPC has a 32-bit system.
    2. LabView Run-Time 2012 f3; is installed on LTH but missing on iPC.
    3. NI-DAQmx ADE Support 9.3.5; something strage on the LTH, because normally I am using NI-DAQmx 9.5.5 and all other DAQmx products on my LTH are 9.5.5. That means NI-DAQmx Device Driver 9.5.5 and NI-DAQmx Configuration 9.5.5.. On the iPC side all three products are 9.5.5.. That means NI-DAQmx ADE Support 9.5.5, NI-DAQmx Device Driver 9.5.5 and NI-DAQmx Configuration 9.5.5..
    4. Traditional NI-DAQ 7.4.4; The iPC has this SW installed. On the LTH this SW is missing.
    In order to fix this problem I have formatted my PXI and I have installed the following SW from the iPC:
    1. LabVIEW Real-Time 11.0.1
    2. NI-488.2 RT 3.0.0
    3. NI_CAN 2.7.3
    Unfortunately the above stated problem still arose.
    What can I do to fix this problem?
    I found a hint on http://www.labviewforum.de/Thread-XNET-CAN-die-ersten-Gehversuche.
    There it is written to deploy the dbc file againt.
    If this is a good hint, so how do I deploy a dbc file?
    I would feel very pleased if somebody could help me! :-)
    Best regards
    Lukas Nowak

    Hi Lukas,
    I think the problem is caused by differenet drivers for the CAN communication.
    NI provides two driver for CAN: NI-CAN and NI-XNET.
    NI-CAN is the outdated driver which is not longer used by new hardware. NI replaced the NI-CAN driver with NI-XNET some years ago, which supports CAN, LIN and the FLEXRAY communication protocol.
    You wrote:
    In order to fix this problem I have formatted my PXI and I have installed the following SW from the iPC:
    3. NI_CAN 2.7.3
    NI CAN is the outdated driver. I think that you should try to install NI-XNET instead of NI-CAN on your PXI-System, to get rid of the error message.
    Regards, stephan

  • Return value from database function taking a lot more time than the query

    Hi guys,
    I have a Query that does a call to a database function. The function takes in a few parameters and returns a Date. Now, the query within the function takes barely .05 seconds. However, doing a select get_join_dates from dual is taking almost 6 seconds for each call.
    Here is the Query:
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and    s.student_enrollment_date = get_join_dates( :p_year,
                                                       :p_month,
                                                       :p_student_id,
                                                       s.organization_code );And here is the database function. The select inside this function barely takes 0.05 seconds per call. This function gets called 3 times in my case as there are 3 records in the org_body table for this student.
    create or replace function
    get_join_dates( p_yyyy in org_body.fiscal_yyyy%type,
                           p_month in  org_body.fiscal_mm%type,
                           p_student_id in student.student_id%type,
                           p_organization_code in org_body.organization_code%type) return date as
        t_enrollment_date  date;
        cursor cur_latest_enrollment_date is
          select max(enrollment_date)
          from   org_body
          where  fiscal_yyyy = p_yyyy
          and    fiscal_mm = p_month
          and    student_id = p_student_id
          and    organization_code = p_organization_code;
      BEGIN
        open cur_latest_enrollment_date ;
        fetch cur_latest_enrollment_date into t_enrollment_date;
        close cur_latest_enrollment_date ;
        return t_enrollment_date;
      exception
        when others then
          null;
    end;owever, when I run the following statement below, it takes close to 6 seconds to retrieve a record. In turn, my Query is becoming really slow and taking almost 35 seconds. Imagine that with more records.
    select get_join_dates( 2010, '01', '2167543', 'PSYCH01' ) from dual;If I run my query with this condition below, it takes 0.5 seconds.
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and      s.student_enrollment_date = '01-JAN-10'Any ideas would be greatly appreciated.

    Any reason why you are doing this with the stored function?
    You could just do this with SQL. Embed the query in the function as a subquery in your initial query from STUDENT.
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and    s.student_enrollment_date =
    (select max(enrollment_date)
          from   org_body
          where  fiscal_yyyy = :p_year
          and    fiscal_mm = :p_month
          and    student_id = s.student_id
          and    organization_code = s.organization_code);Why your function is not performing: I cannot say that with the information you have provided.
    Maybe sqltrace a call and see what the reason is.

  • IPhoto needs to be upgraded everytime I open it.  Then it finds consistences. I have rebuilt the database many times

    iPhoto needs to be upgraded everytime I open it.  Then it finds consistences. Then it repairs the database. 
    I have also rebuilt the database many times useing command + alt. 
    Now it shows every event three times.  If I delete one version of that event, it deletes them all.
    Then next time I open iPhoto it needs updateing and repairing again
    I have used disk utility to repair permissions

    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

Maybe you are looking for

  • FIRMWARE ISSUES WITH CREATIVE ZEN V P

    What is going on?!?!! Just about every other thread i've read on here somebody has my same problem: ) My Zen V Plus was not recognized by my computer and it was always stuck on "rebuilding library" when i turned it on but when it got halfway through,

  • Error while using SWPR to restart a HCM P&F

    One of the HCM P&F worklfow went into error when the approver tried to approve the form from UWL. The error was due to Authorization issue. We rectified the issue and tried to restart from tcode SWPR. When we restarted the workflow from SWPR we got a

  • Apache denying http requests- could it be Security update 2006-007PPC?

    I've been webhosting off an iMac G4 for two years and yesterday no one could access any of the pages, coming from multiple DNSs. I opened up sharing and turned on the log, saw some denials. Some improvement by toggling Personal Web Sharing, but goes

  • HT3258 migration problem mac to mac

    i'm having a very strange problem migrating data from my macbook pro (10.6.8) to my new macbook air (10.7.5). i've been in touch with a supervisor level guy at apple support and he doesn't know what the problem could be. i keep some folders on the gr

  • Intel Imac or Dual 1.42 G4

    I have a first generation Intel Imac w/2gigs Ram. I also have a G4 dual 1.42 with 2 gigs ram. Is there much difference in performance doing Photoshop ( CS2 )? Because I would like to retire my G4 if the IMac is compatable in performance.