Query performance difference -- CPU time difference on two servers

Two SQL servers, server A & B, Hardware information as below:
Server A: Clustered. Two physical processors (4 cores). RAM 64GB, SQL Server max memory: 58GB.
Server B: Standalone. One physical processor (4 cores). RAM 16GB, SQL Server max memory: 10GB.
The two databases on A & B are identical (using backup & restore method), same query execution CPU time are different, it is slower on the cluster server with more CPU & Mmeory. I tried many times and all same result, I also tried run DBCC DROPCLEANBUFFERS
& DBCC FREEPROCCACHE before running the query.
When I run the query, on Server A (Slow one), CPU usage is at 20% ~30%. RAM usage is 14%. It is new set up environment so just me using it now.
When I run the query on Server B (Fast one), CPU usage is 40%, RAM usage is 85%.
Both two servers have SAN connected storage.
Query execution plan is exactly same on two serers.
Could someone give me some advise how to troubleshoot this problem? Any suggestion is appreciated a lot! Thanks a lot!
FYI, Below are the statistics when running same query in same DB on two servers:
Server A CPU & IO Statistics:
SQL Server parse and compile time: 
   CPU time = 109 ms, elapsed time = 297 ms.
(1005301 row(s) affected)
Table 'PODT'. Scan count 1, logical reads 55184, physical reads 3, read-ahead reads 55180, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'MRICLDEFENT'. Scan count 0, logical reads 71898, physical reads 3, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'POHD'. Scan count 1, logical reads 103154, physical reads 3, read-ahead reads 103150, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
 SQL Server Execution Times:
CPU time = 7769 ms,  elapsed time = 16693 ms.
Server B CPU & IO Statistics:
SQL Server parse and compile time: 
   CPU time = 32 ms, elapsed time = 39 ms.
(1005301 row(s) affected)
Table 'PODT'. Scan count 1, logical reads 55184, physical reads 3, read-ahead reads 55180, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'MRICLDEFENT'. Scan count 0, logical reads 71898, physical reads 3, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'POHD'. Scan count 1, logical reads 103154, physical reads 3, read-ahead reads 103150, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
 SQL Server Execution Times:
CPU time = 3931 ms,  elapsed time = 14387 ms.                             

hi, Vivian_Vivian
i just want to ask you 
which sql version do you use?
have you ever tried xevent before??
if you use the sql2k8 or latter you can try xevent out to find somgthing clues about your cpu time problem
i provide you the script,pls post your output in the xevent here so that we could judge what  the head of the problem is
USE [master]
GO
CREATE EVENT SESSION [TrackSQLWait] ON SERVER
ADD EVENT sqlserver.sql_statement_starting (
    ACTION ( sqlserver.session_id, sqlserver.database_id,sqlserver.sql_text ,package0.collect_system_time)
    WHERE ( sqlserver.database_id = 7 ) ), --★Do
ADD EVENT sqlserver.sql_statement_completed (
    ACTION ( sqlserver.session_id, sqlserver.database_id, sqlserver.sql_text ,package0.collect_system_time)
    WHERE ( sqlserver.database_id = 7 ) ), --★Do
ADD EVENT sqlserver.error_reported (
    ACTION ( sqlserver.session_id, sqlserver.database_id, sqlserver.sql_text ,package0.collect_system_time)
    WHERE ( sqlserver.database_id = 7 ) ), --★Do
ADD EVENT sqlos.wait_info (
    ACTION ( sqlserver.database_id, sqlserver.session_id, sqlserver.sql_text,sqlserver.plan_handle ,package0.collect_system_time)
    WHERE 
    ( duration > 1000
      AND ( ( wait_type > 31    -- Waits for latches and important wait resources (not locks) 
                            -- that have exceeded 10 seconds. 
              AND ( ( wait_type > 47
                      AND wait_type < 54
                    OR wait_type < 38
                    OR ( wait_type > 63
                         AND wait_type < 70
                    OR ( wait_type > 96
                         AND wait_type < 100
                    OR ( wait_type = 107 )
                    OR ( wait_type = 113 )
                    OR ( wait_type > 174
                         AND wait_type < 179
                    OR ( wait_type = 186 )
                    OR ( wait_type = 207 )
                    OR ( wait_type = 269 )
                    OR ( wait_type = 283 )
                    OR ( wait_type = 284 )
            OR ( duration > 30000        -- Waits for locks that have exceeded 30 secs.
                 AND wait_type < 22
ADD TARGET package0.asynchronous_file_target (  SET filename = 'E:\ExtendedEvent\TrackSQLWait.xel' ,
                                                metadatafile = 'E:\ExtendedEvent\TrackSQLWait.xem' )
WITH ( MAX_MEMORY = 4 MB ,
        EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS )
GO
ALTER EVENT SESSION [TrackSQLWait]
ON SERVER
STATE=START
-- Query the Event data from the Target.
SELECT  event_data.value('(event/@name)[1]', 'varchar(50)') AS [event_name] ,
        event_data.value('(event/data[@name="source_database_id"]/value)[1]',
                         'int') AS [source_database_id] ,
        OBJECT_NAME(event_data.value('(event/data[@name="object_id"]/value)[1]',
                                     'int')) AS [object] ,
        event_data.value('(event/data[@name="object_type"]/value)[1]',
                         'varchar(60)') AS [object_type] ,
        event_data.value('(event/data[@name="state"]/text)[1]', 'varchar(50)') AS [state] ,
        event_data.value('(event/data[@name="duration"]/value)[1]', 'bigint') AS [duration] ,
        event_data.value('(event/data[@name="cpu"]/value)[1]', 'bigint') AS [cpu] ,
        event_data.value('(event/data[@name="reads"]/value)[1]', 'bigint') AS [reads] ,
        event_data.value('(event/data[@name="writes"]/value)[1]', 'bigint') AS [writes] ,
        event_data.value('(event/data[@name="error"]/value)[1]', 'bigint') AS [error] ,
        event_data.value('(event/data[@name="severity"]/value)[1]', 'int') AS [severity] ,
        event_data.value('(event/data[@name="user_defined"]/value)[1]',
                         'varchar(5)') AS [user_defined] ,
        event_data.value('(event/data[@name="message"]/value)[1]',
                         'varchar(max)') AS [message] ,
        event_data.value('(event/data[@name="wait_type"]/text)[1]',
                         'varchar(250)') AS wait_typetype ,
        event_data.value('(event/data[@name="wait_type"]/value)[1]',
                         'varchar(250)') AS wait_typevalue ,
        event_data.value('(event/data[@name="max_duration"]/value)[1]',
                         'bigint') AS max_duration ,
        event_data.value('(event/data[@name="completed_count"]/value)[1]',
                         'bigint') AS [completed_count] ,
        event_data.value('(event/action[@name="plan_handle"]/value)[1]',
                         'varchar(max)') AS [plan_handle] ,
        DATEADD(hh, DATEDIFF(hh, GETUTCDATE(), CURRENT_TIMESTAMP),
                event_data.value('(event/action[@name="collect_system_time"]/text)[1]',
                                 'datetime2')) AS [system_time] ,
        event_data.value('(event/action[@name="session_id"]/value)[1]',
                         'bigint') AS [session_id] ,
        event_data.value('(event/action[@name="sql_text"]/value)[1]',
                         'varchar(max)') AS [sql_text]
FROM    ( SELECT    CAST(event_data AS XML) AS event_data
          FROM      sys.fn_xe_file_target_read_file('E:\ExtendedEvent\TrackSQLWait_*.xel',
                                                    'E:\ExtendedEvent\TrackSQLWait_*.xem',
                                                    NULL, NULL)
        ) AS tab
WHERE   event_data.value('(event/data[@name="duration"]/value)[1]', 'bigint') > 100
        AND event_data.value('(event/@name)[1]', 'varchar(50)') LIKE 'wait_info'
ORDER BY [system_time]
ALTER EVENT SESSION [TrackSQLWait]
ON SERVER
STATE=STOP
GO
DROP EVENT SESSION [TrackSQLWait] ON SERVER
please replacing the related parameter to fit for your situation
thanks

Similar Messages

  • How to write a query to get the time difference of two varchar type time columns

    Hi,
    I want to get the time difference between the two varchar type columns.please see the attached image for more details:
    My requirement is like:
    timestarted
    timeended
    timediff
    9:00:00
    10:00:00
    1:00
    9:15
    9:30:00
    0:15

    Storing time alone as VARCHAR2 value is a incorrect design. Always store it as DATE or TIMESTAMP.
    If you already have a messed up design and cant change it, then you need to convert your VARCHAR2 time into a DATE or TIMESTAMP and find the difference. I have converted it to TIMESTAMP and obtained the difference as INTERVAL.
    SQL> with t
      2  as
      3  (
      4  select '09:00:00' timestarted, '10:00:00' timeended from dual
      5  union all
      6  select '09:15:00' timestarted, '09:30:00' timeended from dual
      7  )
      8  select timestarted
      9       , timeended
    10       , (timeended - timestarted) day to second diff
    11    from (
    12          select to_timestamp('01011900' || timeended, 'ddmmyyyyhh24:mi:ss') timeended
    13               , to_timestamp('01011900' || timestarted, 'ddmmyyyyhh24:mi:ss') timestarted
    14            from t
    15         );
    TIMESTARTED                                        TIMEENDED                                          DIFF
    01-JAN-00 09.00.00.000000000 AM                    01-JAN-00 10.00.00.000000000 AM                    +00 01:00:00.000000
    01-JAN-00 09.15.00.000000000 AM                    01-JAN-00 09.30.00.000000000 AM                    +00 00:15:00.000000
    SQL>

  • Query performance difference with same script in two servers

    Dear all,
    I have problem with an INSERT Procedure. I have 2 servers, say Server A and Server B, In Server A the query execution will be finished in 4 minutes where in the Server B the same Query its taking more than 2 hours. 
    If I look into the execution plan in both servers, it looks different.
    Both have the Default Parallelism settings.
    Cost Threshold for Parallelism : 5
    Locks : 0
    Max Degree of Parallelism : 0
    Query Wait : -1
    What causing to slow down the process? Is the parallelism slowing down the process? 
    When I look into the SERVER A's active running processes in management studio, I found that there are 8 INSERT Queries running with only 2 RUNNABLE and 6 SUSPENDED. Anything is getting locked out or Waiting? 
    Please help and suggest my a solution for it. Thanks in advance.
    Regards,
    kranthi kumar G.

    Thanks Tony for your reply. Here are my answers.
    Are we talking a large amount of inserts?
    YES
    What is the autogrowth settings for the database files on the two Servers?
    Autogrowth by 10%
    The Server you are having an issue with, are the any triggers on the Tables?
    No.
    Is there a background or other trace running on the slow Server that could be impacting performance?
    Yes, we are running a monitoring tool to check the performance of the load.
    Is there another database on the slow Server causing issues?
    No.
    This could be a hardware issue; have you use perfmon to see if there are any disk queues?
    We will check with our DBA on this.
    What is the Raid Configuration?  Are the files on a single spindle?  If so what is the fragmentation state of any single spindle volume?
    There is no Rain Configuration. Its a Windows Azure A7.
    Are you automatically updating statistics on the slow Database?
    Yes.
    Is the Anti Virus Software on the Slow server scanning the data files?
    Yes, but not on the database level.
    Regards,
    kranthi.

  • Old query taking substantial CPU time in AWR report

    Hi,
    We have a particular query which used to generate substantial CPU wait event in the AWR report.On of our DBA's killed the query some days back but still today's AWR report shows that particular query as the largest CPU consumer (50%). When I checked from the view V$SQL the last execution time was of 23-02-2011.
    My question is after the query gets killed does it still show in the v$SQL ? And why is it still showing in the SQL BY ELAPSED TIME section ?
    Please help.

    No it is a select statement. I AM PASTING THE QUERY BELOW.
    select  /*+ FULL(COMP_TM) FULL(TRANS_TM) FULL(INVC_TM) */
                CUST_BE_ID     ,
                DISTR_BE_ID    ,
                FG_BE_ID         ,
                KIT_BE_ID        ,
                BG_ID_NO_BE_ID         ,
             ACTL_TERR_BE_ID       ,
                CORE_TERR_BE_ID      ,
            sum(     JNJ_LIST_AMT  ) AS JNJ_LIST_AMT,
                sum(     JNJ_PYMT_AMT            )  AS  JNJ_PYMT_AMT,
                sum(     JNJ_QTY           ) AS JNJ_QTY,
                sum(     JNJ_REB_AMT  ) AS JNJ_REB_AMT,
                sum(     JNJ_SLS_AMT  ) AS JNJ_SLS_AMT,
                sum(     KIT_LIST_AMT   ) AS KIT_LIST_AMT,
                sum(     KIT_QTY           ) AS KIT_QTY,
                sum(     KIT_SLS_AMT   ) AS KIT_SLS_AMT,
                sum(     FG_PYMT_AMT            ) AS FG_PYMT_AMT,
                sum(     FG_QTY           ) AS FG_QTY,
                sum(     FG_REB_AMT   ) AS FG_REB_AMT,
                sum(     FG_SLS_AMT   ) AS FG_SLS_AMT,
                sum(     FG_LIST_AMT   ) AS FG_LIST_AMT,
                to_date('15'||substr(COMP_TM.FISC_MO_CD,8,2)||substr(COMP_TM.FISC_MO_CD,3,4),'DDMMYYYY') AS     TRANS_MO_DATE,
                to_number(substr(COMP_TM.FISC_MO_CD,3,4) ) AS PRD_YR_CD, 
                to_number(substr(COMP_TM.FISC_MO_CD,8,2) ) AS PRD_MO_CD, 
                CONTR_PRD_TIER_NO,
                COMP_TM.FISC_MO_OID AS COMP_MO_BE_ID,
                CLSD_YR_FLG,
                ADJM_TRANS_CD,
                INVC_TM.FISC_MO_OID AS INVC_MO_BE_ID,
                ORD_TYP_CD,
                TRANS_TM.FISC_MO_OID AS TRANS_MO_BE_ID
    from
                FACT_DLY_ALGND_SLS F, DIM_TM_MV TRANS_TM,
                DIM_TM_MV INVC_TM, DIM_TM_MV COMP_TM
    /***** comment out for loading historical data....  ***/
    WHERE F.PRD_YR_CD >= (select case when to_number(to_char(sysdate,'MM')) <= 3
                         then to_number(to_char(sysdate,'YYYY'))-1
                               else to_number(to_char(sysdate,'YYYY'))
                               end case from dual
    -- and F.PRD_YR_CD = '2008'
    AND F.COMP_DT_BE_ID=COMP_TM.BE_ID
    AND F.TRANSACTION_DATE = TRANS_TM.DAY_STRT_PRD_OF_TM
    AND TRANS_TM.DAY_OID = TRANS_TM.BE_ID
    AND F.INVC_DT = INVC_TM.DAY_STRT_PRD_OF_TM
    AND INVC_TM.DAY_OID = INVC_TM.BE_ID
    group by
                CUST_BE_ID     ,
                DISTR_BE_ID    ,
                FG_BE_ID         ,
                KIT_BE_ID        ,
                BG_ID_NO_BE_ID         ,
             ACTL_TERR_BE_ID       ,
                CORE_TERR_BE_ID      ,
                to_date('15'||substr(COMP_TM.FISC_MO_CD,8,2)||substr(COMP_TM.FISC_MO_CD,3,4),'DDMMYYYY'),
                to_number(substr(COMP_TM.FISC_MO_CD,3,4) ), 
                to_number(substr(COMP_TM.FISC_MO_CD,8,2) ), 
                CONTR_PRD_TIER_NO,
                COMP_TM.FISC_MO_OID ,
                CLSD_YR_FLG,
                ADJM_TRANS_CD,
                INVC_TM.FISC_MO_OID ,
                ORD_TYP_CD,
                TRANS_TM.FISC_MO_OIDI am wrong in the previous post. Actually the elapsed time in the AWR was showing 840 mins.

  • Query Performance Issue - Max time spent on DB read

    Hi Experts,
    We have a big query which is having two levels and it is pulling data from 10 underlying cubes which have different sales organizations in each. Due to design of the query and amount of data in cubes the maximum time is being spent on DB read. Now we have checked the trace of the query execution and we have seen that the system goes and check , say a Cube A even when it does not contain data for the sales org that is requested by the user. Please note that we have mandatory selection for Sales org on the Level 1 query.
    In order to resolve this issue we have maintained entry of SALESORG in the RRKMULTIPROVHINT table, but on running the trace again we are seeing that for Level 2 query the system is still querying the cubes which do not contain the data for the sales org requested by the user there by increasing the run time of the query many folds. Can you please help us out if you have faced similar issue?
    Regards,
    Prashant Shah

    I think your Query data selection is expecting data from all the cubes. You have to analyze right from the Query definition and the variables selection to know further.
    Please put "H" for your MP in RSDIPROP t-code and choose H in Query read mode in RSRT-->Properties.

  • CPU time from a multi processor

    Hi
    I need to get the CPU time from a multi processor machine,
    The top command will not do the job for me, and I will need to use the command in automation for testing the CPU time for 2 hours or more, I thinking about redirect the CPU % to a file, and in the end I will run the average for the numbers in that file.
    If I will be able to see the CPU time for the two processors it will be grate, but more important is to collect the global CPU status.
    I don�t have a command line that a can use, I can use some help.
    Thanks Shay

    mpstat in fact works on my Opteron 270 dual-processor dual-core machine running Soalris 10. For instance 'mpstat 3 5' displays 5 reports each 3 seconds apart, showing status of each CPU:
    % mpstat 3 5
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 1 0 1 383 245 73 0 5 0 0 87 1 0 0 99
    1 1 0 1 33 4 51 0 4 0 0 57 0 0 0 99
    2 0 0 1 38 0 72 0 2 0 0 42 0 0 0 100
    3 1 0 1 53 26 49 0 1 1 0 47 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 393 252 76 0 8 0 0 94 1 0 0 99
    1 0 0 0 48 4 82 0 7 1 0 71 0 0 0 100
    2 3 0 0 39 0 76 0 4 1 0 51 0 0 0 100
    3 0 0 0 44 25 35 0 3 2 0 49 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 382 250 64 0 5 0 0 111 0 0 0 100
    1 0 0 0 29 4 43 0 4 0 0 56 1 0 0 99
    2 0 0 1 48 1 93 0 3 0 0 39 0 0 0 100
    3 0 0 0 69 29 78 0 1 1 0 65 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 1 386 250 72 0 4 0 0 111 0 0 0 99
    1 0 0 0 28 3 42 0 3 0 0 55 1 0 0 99
    2 0 0 0 42 0 81 0 1 0 0 43 0 0 0 100
    3 0 0 0 67 29 74 0 0 1 0 63 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 404 252 98 0 5 0 0 100 1 0 0 99
    1 0 0 0 45 9 68 0 5 1 0 53 0 0 0 100
    2 0 0 0 34 0 64 0 4 0 0 50 0 0 0 100
    3 0 0 0 58 27 60 0 2 2 0 73 0 0 0 100
    (The first report summarizes all activity since boot.)

  • How to split mailservices among two servers (no xsan yet)

    How can I split the load on our mailserver (getting rid of the daily VM growth and potential crashes / down time) by using TWO servers as opposed to one?
    Apparently the root of the cause is too many imapd connections and DirectoryServices then gets in to problems stalling the whole server (EG see my latest 3-4 posts)
    SMTP out of the house should not pose a problem, and access for the end users to the (manually moved) imap data location should be handled easily after pointing the users to the second mailserver in WGM.
    BUT incoming mail makes me unsure - port 25 can only be pointed to one server on the LAN (naturally , so how do I configure the ("primary") mailserver to make sure that the local mail-delivery (for the users that use the second mailserver) will actually be sent to this second server.
    I would think that this should be easily possible - somehow - and that the LMTP service will be the part responsible for this change.
    PS.: I still cannot understand why a dual 2 GHz intel server is unable to perform satisfactory - with 10.5.6 server - serving the small amount of IMAP users we have, ca. 250 users.
    Currently ps ax | grep imapd | wc -l tells me that I have up to ca. 150 connections when the VM growth warnings starts to show up in the system.log

    The server is still pretty much having the default setup, though I have implemented Pterobytes "Frontline Spam Defense", but:
    A. I have incresed the number of processes as per an Apple article for "heavily loaded servers":
    cat /etc/launchd.conf
    limit maxproc 1000 2000
    B. I have changed /ets/cyrus.conf
    IMAP increased to 5
    LMTPUNIX increased to 2
    <pre> imap cmd="imapd" listen="imap" prefork=5
    imaps cmd="imapd -s" listen="imaps" prefork=0
    lmtpunix cmd="lmtpd" listen="/Volumes/Bric-RAID-03-up/Mail/imap/socket/lmtp" prefork=2</pre>
    I got this advise from Pterobyte a year ago when I had problems with the performance of the old mailserver (the hw was a G4, the hint helped a lot!)
    The timeout you refer to is not set in the config file (also not in a fresh in stall of 10.5.6), it's only listed (as 30) in /etc/imapd.conf.default.
    But I presume that if the parameter is not set in my cinf file, then the default files settings are in effect(?)
    I was thinking of changing this value just yesterday, but after reading the man imapd.conf I thought that it would not make any diference, since 30 is "the minimum":
    timeout: 30
    The length of the IMAP server's inactivity autologout timer, in minutes. The
    minimum value is 30, the default.
    I guess I have to make this chang anyway
    The server is a dual 2 GHz intel with 5 GB ram (and still 4 vacant slots).
    Today's top output looks like this (the server was rebooted 24 hours ago!)
    Mail spool (currently ca. 120 GB) is on an RAID-5 xraid
    <pre>Processes: 171 total, 2 running, 169 sleeping... 741 threads 10:57:37
    Load Avg: 0.21, 0.16, 0.06 CPU usage: 3.39% user, 3.39% sys, 93.23% idle
    SharedLibs: num = 12, resident = 44M code, 1532K data, 3200K linkedit.
    MemRegions: num = 16009, resident = 625M + 27M private, 231M shared.
    PhysMem: 708M wired, 942M active, 174M inactive, 1826M used, 3294M free.
    VM: 18G + 373M 645958(0) pageins, 75(0) pageouts</pre>
    I have been running Apples top-guide.pl script for a couple of days to monitor the servers "health" in general as well as I am logging the number of imapd connections every minute.
    I dont find the numbers alarming.
    During the max load yesterday (between 12.10-12.48) there was a peak of 210 imapd connection (users coming back from lunch and checking mail?).
    <pre>Fri Feb 6 12:42:00 CET 2009: 210
    Fri Feb 6 12:43:00 CET 2009: 210
    Fri Feb 6 12:44:00 CET 2009: 210
    Fri Feb 6 12:45:00 CET 2009: 209
    Fri Feb 6 12:46:00 CET 2009: 210
    Fri Feb 6 12:47:00 CET 2009: 209
    Fri Feb 6 12:48:00 CET 2009: 210
    </pre>
    During these 8 minutes is also when I was logging the highest number of VM growth:
    <pre>Feb 6 12:42:35 einstein DirectoryService[26]: Potential VM growth in DirectoryService since client PID: 0, has 875 open references when the warning limit is 500.
    </pre>
    top-guide.pl log's these vaulues:
    <pre>
    CPU usage: 300-s Reads/sec: Writes/sec: Net in/sec: Net out/sec: kernel
    Time: user sys Idle avg. number MB number MB pkts Mb pkts Mb CPU%
    12:46:29 8.0 3.8 88.3 87.4 0 0.0 65 3.1 2138 21.3 2081 11.4 3.7
    12:46:39 5.8 3.7 90.6 87.5 4 0.1 30 2.8 2166 21.2 2108 11.2 3.9
    12:46:49 5.4 4.5 90.1 87.5 0 0.0 22 3.1 2210 21.4 2180 11.7 4.0
    12:46:59 10.3 4.6 85.1 87.3 0 0.0 54 3.1 2123 21.2 2091 11.4 3.8
    12:47:09 13.8 5.2 81.0 86.9 0 0.0 46 3.2 2110 21.2 2071 11.4 3.9
    12:47:19 4.7 3.1 92.2 87.0 4 0.1 24 2.6 2109 21.1 2073 11.4 3.7
    12:47:29 5.0 3.8 91.2 87.6 0 0.0 58 3.3 2136 21.2 2110 11.3 3.8
    12:47:39 5.4 3.6 91.0 87.6 35 0.5 61 2.9 2091 21.3 2042 11.4 3.8
    12:47:49 7.9 5.9 86.2 87.5 61 0.7 54 4.8 2424 23.8 2409 13.8 4.5
    12:47:59 5.2 4.1 90.8 87.4 0 0.0 52 3.7 2224 21.4 2222 12.2 4.0
    12:48:09 15.9 5.9 78.2 87.0 0 0.0 25 3.0 2146 21.1 2127 11.8 4.0
    12:48:19 7.4 3.4 89.2 87.1 0 0.0 15 2.6 2129 21.2 2111 11.8 3.6
    12:48:29 4.9 3.7 91.4 87.2 0 0.0 34 2.9 2176 21.4 2158 11.8 3.7
    12:48:39 4.9 3.7 91.4 88.0 0 0.0 18 2.6 2128 21.0 2118 11.8 3.7
    12:48:49 5.6 4.5 89.9 88.1 0 0.0 35 2.7 2097 21.2 2082 11.7 3.7
    12:48:59 6.8 4.6 88.7 88.0 0 0.0 60 3.1 2204 21.4 2228 12.1 4.0
    12:49:09 5.6 4.0 90.4 88.0 0 0.0 15 2.9 2091 21.3 2072 11.7 3.6
    12:49:20 13.9 4.9 81.2 87.6 0 0.0 14 2.7 2103 21.2 2084 11.6 3.7
    12:49:30 9.1 4.0 86.9 87.5 1 0.1 70 2.8 2111 21.1 2129 12.1 3.8
    12:49:40 7.4 4.8 87.8 87.3 1 0.0 52 4.5 2195 21.4 2200 12.0 4.1
    </pre>

  • Find the Difference in time for creation of two activities for the same SR

    Hi
    I need to find the difference in time of cretaion of two different activities for an SR. Is there any function which I can use to get the same
    For e.g.
    SR # |Activity Created Date |Duration
    123 12-nov
    123 13 nov 1 day
    Thanks in advance
    Meena

    There's a TIMESTAMPDIFF function.
    An example from the book Oracle CRM On Demand Reporting has the following example...
    TIMESTAMPDIFF( SQL_TSI_MINUTE, Activity."Start Time", Activity."End Time" )
    which would return the difference in minutes.
    As I type this, I'm thinking you probably know this and your problem is how to get the Activity start time for the next activity into this function. I sorry can't think of any way to do that.

  • Send the same   message to two receivers with some  time difference..

    Hi
      I want to send the same message to Two receivers  with the slight time difference.. becuase  but not at the same time.. if the same time means.. just we can  specify the two receivers in the one receiver determination..
       but  if i want to send the   same message to Two  reveivers with the time difference means..(after sending the  message to first receiver.. after  some time gap.. i need to send the  message to second receiver..
      this type of scenarios how can we do.. is it possible to do with out BPM...  please suggest me the solution..
    Thanks
    Jain .P

    Hi Jain,
    With BPM you can easily do it.
    i am giving you the steps:
    1)first add a receive strep to get your message
    2)then, put a receiver determination step with a multiline receiver container element assigned to its Receivers property.
    3)then, put a block in dynamic mode(ie. ForEach/ParForEach mode) and assign the multiline receiver container element to its multiline element and assign a simple(single line) receiver container element to its current line property.
    4) add a send step within the block, choose Receivers List in its Receiver From property and choose the current line receiver element in its Receivers property.
    5) then add a wait step in the BPM, in its type select Wait Specified Time Period and then mention the duration in your desired time unit.
    **Reward points if helpful...
    --Sankar Choudhury

  • Stopping a while loop using the time difference of two tick counts

    Hi Guys,
    I'm currently writing a code which test how long does it take for a formula node to perform its operation. The program uses a while loop to perform the calculation, and the program stops after calculating when tick count has reached 10 seconds. The program then displays the number of iterations it does in 10 seconds. 
    So initially I created 2 frames of sequence structure. In my first frame I have my initial tick count, and in my second frame I have my final tick count and the while loop. I used the subtract function and divide the output by 1000 to get the time difference. Then using the comparison function, I set if output > 10 then the program should stop, to do this I linked the output of the comparison function to the stop button inside the while loop. 
    However, when I tried to run the code, the program just didn't run. Hence I created a similar program which puts the last tick count in new frame sequence. When I ran this code, the program never stopped. 
    Do you guys have any idea what went wrong with my codes.
    Thank you!
    Erry
    Solved!
    Go to Solution.
    Attachments:
    1. Tick Count.vi ‏27 KB
    tickcoun2.vi ‏27 KB

    Dataflow!
    In both VI's the stop terminal of the while loop is controlled by a boolean whose source is ouside of the while loop.  So that loop will either run once, or run forever, depending on the value of the boolean that is calculated before the loop starts and shows up at the tunnel going into the loop.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Avg Time  Difference of Two timestamps in Oracle SQL

    Hello Members,
      I am trying to find the average of Time Difference of two timestamp columns by order number. I need to show the average of the time difference in hours:mins format. I have is SQL Server , but unable to get this in Oracle SQL. Could anyone please let me know how I need to find the time difference of two timestamp columns and show them in hh:mm fomat and then take average of these differences and show them in hh:mm format.  Below is what I have tried in SQL server.
    CREATE TABLE temp
    startdate smalldatetime,
    enddate smalldatetime
    INSERT temp
    SELECT '6/22/2013 19:00',
    '6/22/2013 19:20'
    UNION ALL
    SELECT '6/22/2013 19:22',
    '6/22/2013 19:44'
    UNION ALL
    SELECT '6/22/2013 19:45',
    '6/22/2013 19:50'
    UNION ALL
    SELECT '6/22/2013 19:52',
    '6/22/2013 20:02'
    UNION ALL
    SELECT '6/22/2013 20:05',
    '6/22/2013 20:10'
    UNION ALL
    SELECT '6/22/2013 20:15',
    '6/22/2013 20:20'
    SELECT CAST
    CAST
    ( SUM
    DATEDIFF(MINUTE,startdate,enddate)
    6*60
    As float)
    as varchar) + ':' +
    cast
    cast
    cast
    SUM
    DATEDIFF(MINUTE,startdate,enddate)
    6
    as int )
    % 60 as float )
    as varchar ) AS avg_time_diff_in_hh_mm_format
    FROM temp
    Please let me know if you need additional information.
    Thanks in Advance.

    Thanks for the reply Frank,
      I have tried some similar lines with your suggested approach, please see below:
    --DDL
    CREATE TABLE XX_ORD_TIMES
    (ORDER_NUM NUMBER(15),
             ACTUAL_START_DATE DATETIME,
             ACTUAL_FINISH_DATE DATETIME)
    --Sample Data
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SFM-07', TO_DATE('06/20/2013 14:22:58', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/21/2013 07:58:55', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SFM-07', TO_DATE('06/21/2013 09:12:42', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/21/2013 09:18:15', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SFM-07', TO_DATE('06/20/2013 15:59:07', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/20/2013 17:06:17', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SVCEXT', TO_DATE('05/16/2013 11:56:05', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/24/2013 14:47:54', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SVCEXT', TO_DATE('05/07/2013 09:23:37', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/07/2013 13:00:14', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SVCEXT', TO_DATE('05/09/2013 14:06:08', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/22/2013 13:25:03', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SVCNEWPLON', TO_DATE('05/21/2013 13:17:45', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/24/2013 14:35:04', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into XX_ORD_TIMES
       (ORDER_NUM, ACTUAL_START_DATE, ACTUAL_FINISH_DATE)
    Values
       ('SVCNEWPLON', TO_DATE('05/24/2013 09:00:04', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('05/29/2013 09:30:32', 'MM/DD/YYYY HH24:MI:SS'));
    --Avg time diffs
    SELECT  ORDER_NUM,
             ACTUAL_START_DATE
             ACTUAL_FINISH_DATE
                    TO_NUMBER (
                       SUBSTR (
                          NUMTODSINTERVAL (
                             AVG (
                                  CAST (ACTUAL_FINISH_DATE AS DATE)
                                - CAST (ACTUAL_START_DATE AS DATE)),
                             'DAY'),
                          2,
                          9))
                  * 24
                + TO_NUMBER (
                     SUBSTR (
                        NUMTODSINTERVAL (
                           AVG (
                                CAST (ACTUAL_FINISH_DATE AS DATE)
                              - CAST (ACTUAL_START_DATE AS DATE)),
                           'DAY'),
                        12,
                        2))
             || ':'
             || CASE
                   WHEN LENGTH (
                           TO_NUMBER (
                              SUBSTR (
                                 NUMTODSINTERVAL (
                                    AVG (
                                         CAST (ACTUAL_FINISH_DATE AS DATE)
                                       - CAST (ACTUAL_START_DATE AS DATE)),
                                    'DAY'),
                                 15,
                                 2))) < 2
                   THEN
                         '0'
                      || TO_NUMBER (
                            SUBSTR (
                               NUMTODSINTERVAL (
                                  AVG (
                                       CAST (ACTUAL_FINISH_DATE AS DATE)
                                     - CAST (ACTUAL_START_DATE AS DATE)),
                                  'DAY'),
                               15,
                               2))
                   ELSE
                      TO_CHAR (
                         SUBSTR (
                            NUMTODSINTERVAL (
                               AVG (
                                    CAST (ACTUAL_FINISH_DATE AS DATE)
                                  - CAST (ACTUAL_START_DATE AS DATE)),
                               'DAY'),
                            15,
                            2))
                END
                AS TIME_DIFF
        FROM XX_ORD_TIMES
       GROUP BY ORDER_NUM,
             ACTUAL_START_DATE
             ACTUAL_FINISH_DATE
             order by 1;
    Yes, I am trying to show the time difference of two timestamps ( finish date , start date ) in Hours:Mins  and also calculate the average of this Hours : Mins by ORDER_NUM .
    Please advise.
    Thanks again.

  • SXMB_MONI time difference in performance header

    Hi,
    I've noticed the time in the performance header trace in sxmb_moni is 5 hours later than the real time (System time).
    Even the time sent is 5 hours later. Exp :
    <SAP:TimeSent>2009-11-24T21:13:09Z</SAP:TimeSent>
    When it was actualy sent at 16:13:09 ?
    However , the start and end time in the alv list for sxmb_moni is correct.
    I've seen the other thread on user preferences (timezone) but this is not it ... any ideas ?
    Thanks Guys

    Dear Thierry,
    the reason for this difference in time is that the PerformanceHeader object needs to be filled with continous values. Discontinuities (for example, caused by daylight-saving time) might lead to tremendous deviations. Thus, timezone UTC is used to store performance data to that header object. Timezone UTC is also used for storing dates and time to the trace header object.
    Best regards,
    Harald Keimer
    XI Development Support
    SAP AG, Walldorf

  • QUERY NEED FOR TIME DIFFERENCE

    Hi
    I need a query to find the difference between time
    for example
    5.00 hours - 0.30 minutes = 4.30 hours
    Thanks in Advance
    Adina

    Is this what you are looking for -
    1  select to_date('05:00', 'hh24:mi') - 0.5/24   --Subtract ½ Hr from time
      2* from dual
    SQL> /
    TO_DATE('05:
    200804010430
      1  select to_date('05:00', 'hh24:mi') - 3/24     --Subtract 3 Hrs from time
      2* from dual
    SQL> /
    TO_DATE('05:
    200804010200
      1  select to_date('05:30', 'hh24:mi') + 0.5/24   --Adds ½ Hr to the time
      2* from dual
    SQL> /
    TO_DATE('05:
    200804010600
      1  select to_date('20080416 00:02', 'yyyymmdd hh24:mi') - 0.5/24     --Subtract ½ Hr from time  2* from dual
    SQL> /
    TO_DATE('200
    200804152332Shailender Mehta

  • How to measure time difference between two continous encoder pulse (PULSE A & PULSE B)

    im trying to figure out the time difference between two square
    wave pulse (PULSE A and PULSE B) from an encoder. I tried to modify many code but fail to capture thephase difference  for each pulse. the
    pulse only rise to 5V and fall to 0V like normal square wave pulse
    can you and all of experts here help me out with this?
    my problem
    1) Encoder pulse are continous (pulse A and pulse B)
    2) Square wave pulse have "0V" and "5V" please rapidly
    if possible someone show me correct method , Im using LABVIEW 7.1 and Hardware NI SCOPE (PCI 5102)
    your advice are highly appreciated
    among my idea as in attachment , but I failed to get it
    Attachments:
    Need to Get this wave.JPG ‏34 KB

    Hi Amirul,
    Check the attached JPG file. i think this will be use full to you
    Regards,
    Santhosh M

  • How to get the time difference (in seconds) between two timestamp fields?

    Hi All,
    I'm exploring validation expressions in SAP MDM Data Manager version 7.1.07.245
    I have two timestamp fields, suppose Update Date and Update-GDS.
    What I'm trying to do is prompt a warning when:
    (Update Date minus Update-GDS) is greater than or equal to zero seconds
    AND
    (Update Date minus Update-GDS) is less than or equal to 900 seconds
    the bottomline is, Update Date must be equal or greater than to Update-GDS but Update Date must not exceed 900 seconds difference.
    my initial try was:
    (Update Date - Update-GDS)>=0 s AND (Update Date - Update-GDS)<=900 s
    But it always returns true even the time difference between update date and update-gds is beyond the condition.
    Can you please guide me through this?
    Thank you very much in advance.
    Regards,
    ~erwin

    Hi Abhishek,
    I tried your code but it always returns true.
    It seems subtraction of timestamp fields do not actually get the time difference... (in seconds)
    Is this possible anyway? Or is there any other better approach on this?
    Thanks,
    ~erwin
    Edited by: erwin.j.rivera on Dec 14, 2011 8:40 AM

Maybe you are looking for

  • Movieclips loader loads png but does not display image in ie

    hello, i have created a static class to deal with the loading of images, it works great. yesterday, i found an issue: i try to load png files (those pngs are generated with quasimondo's bitmap exporter), they do load, but they are not displayed in ie

  • Classification field in tcode IL02

    Hi, Can anyone please tell me in which database table the function location field (TPLNR) and class field (CLASS) is stored. Because I tried and found that the class field is in a structure ITOBATTR. but I need the database table along with TPLNR. Pl

  • Problem in Service XML upload

    We are using MDM 2.0.1 on Windows 2008 R2 In the application.. Menu --> Admin Menu --> A --> Application Viewer In Application Viewer, when we are trying to upload a Service XML file, an error occured showing : Service XML does not exist+ But in the

  • Wait for Event won't work

    Hi Guru, I delegated an object zus2000140 and created a template.  everything was working until I added a "wait for event" as the first step, because I have to make the workflow to wait until "Assignment" created for the service item record.  What I

  • Resource Adaptor that calls Web Service?

    Can anyone share info regarding customizing IdM to use a web service API as a connected resource? We have a vendor supplied SDK that enables us to manipulate a vendor proprietary data store (that happens to be implemented as LDAP directory) via a web