Help with Autodiscover.Proxy Unhealthy state.

Hello, I am trying to diagnose unhealthy systems in Exchange 2013.  Here is my command and output.  Lets start with the first one, Autodiscover.Proxy.
[PS] C:\Windows\system32>Get-HealthReport -Server email| where {$_.alertvalue -ne "Healthy" }
Server State HealthSet AlertValue LastTransitionTime MonitorCount
email Offline Autodiscover.Proxy Unhealthy 11/19/2014 10:52... 1
email Online HubTransport Unhealthy 11/24/2014 6:38:... 96
email Online FrontendTransport Unhealthy 9/25/2014 9:28:3... 12
email NotApplicable MSExchangeCertif... Disabled 1/1/0001 12:00:0... 2
I go to follow this article here: http://technet.microsoft.com/en-us/library/ms.exch.scom.autodiscover.proxy%28v=exchg.150%29.aspx
But the issue is that Invoke-MonitoringProbe does not return anything of value to me.  Can you help me analyze this output?
[PS] C:\Windows\system32>Invoke-MonitoringProbe Autodiscover.Proxy\AutoDiscoverProxyTestProbe -Server email | Format-Lis
t
RunspaceId : bfa8f7cf-cc0b-4395-b3c8-75ab16fc227c
Server : email
MonitorIdentity : Autodiscover.Proxy\AutoDiscoverProxyTestProbe
RequestId : d677ac2a-43fa-4147-b806-b2f433c5a6e3
ExecutionStartTime : 11/25/2014 3:23:33 PM
ExecutionEndTime : 11/25/2014 3:23:33 PM
Error : Unknown app pool name:
Exception : System.InvalidOperationException: Unknown app pool name:
at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(Cancellati
onToken cancellationToken)
at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
joinedToken)
at
Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<StartExecuting>b__0()
at System.Threading.Tasks.Task.Execute()
PoisonedCount : 0
ExecutionId : 60170839
SampleValue : 0
ExecutionContext : Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms
FailureContext :
ExtensionXml :
ResultType : Failed
RetryCount : 0
ResultName : d677ac2a43fa4147b806b2f433c5a6e3-AutoDiscoverProxyTestProbe
IsNotified : False
ResultId : 27004887
ServiceName : InvokeNow
StateAttribute1 :
StateAttribute2 :
StateAttribute3 :
StateAttribute4 :
StateAttribute5 :
StateAttribute6 : 0
StateAttribute7 : 0
StateAttribute8 : 0
StateAttribute9 : 0
StateAttribute10 : 0
StateAttribute11 :
StateAttribute12 :
StateAttribute13 :
StateAttribute14 :
StateAttribute15 :
StateAttribute16 : 0
StateAttribute17 : 0
StateAttribute18 : 0
StateAttribute19 : 0
StateAttribute20 : 0
StateAttribute21 :
StateAttribute22 :
StateAttribute23 :
StateAttribute24 :
StateAttribute25 :
Identity : 956989c13cc44e6faf102491a8d7a11b
IsValid : True
ObjectState : New
I'm not seeing any issue right now with Autodiscover but I don't want a larger issue to show up in the near future.

Ok, I guess we can do that.  A new health set came up today Unhealthy.  Its Compliance and in a NotApplicable state.  I will try to determine the impact of this and start a different thread on that if I can't figure that one out.
Otherwise I don't see any problem with mail.
More info, not sure if I posted this, but if this helps, the Event Viewer states this:
Log Name: Microsoft-Exchange-ManagedAvailability/Monitoring Source: Microsoft-Exchange-ManagedAvailability Date: 12/23/2014 7:03:08 AM Event ID: 4 Task Category: Monitoring Level: Error Keywords: User: SYSTEM Computer: email.domain.com Description: The Autodiscover.Proxy
health set has detected a problem on EMAIL beginning at 12/22/2014 3:01:12 PM (UTC). The health manager is reporting that recycling the MSExchangeAutodiscoverAppPool app pool has failed to restore health and it has requested the protocol be marked offline.
Attempts to auto-recover from this condition have failed and administrator attention is required.
Details below: MachineName: EMAIL
ServiceName: Autodiscover.Proxy
ResultName: AutodiscoverProxyTestProbe/MSExchangeAutodiscoverAppPool
Error: The remote server returned an error: (500) Internal Server Error.
Exception: System.ApplicationException: The remote server returned an error: (500) Internal Server Error. at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(CancellationToken cancellationToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
joinedToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<startexecuting>b__0() at System.Threading.Tasks.Task.Execute() </startexecuting>
<startexecuting>ExecutionContext: Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms FailedResponse after 0 milliseconds. The remote server returned an error: (500) Internal Server Error.
[000.000] Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms [000.000] Starting HTTP request task [000.000] Waiting 59000 ms [000.000] Issuing GET against https://autodiscover.domain.com/AutoDiscover/ [000.000] Awaiting
GET response [000.000] Performing SSL validation [000.000] Failed with exception: The remote server returned an error: (500) Internal Server Error. </startexecuting>
<startexecuting>FailureContext:</startexecuting>
<startexecuting></startexecuting>ResultType: Failed
IsNotified: False
DeploymentId: 0
RetryCount: 0
ExtensionXml:
StateAttribute1: No response headers available.
StateAttribute2: [email protected] cfj>M!T@O-;XNkj+=u8[SL#f8Oby*S:(&Bg@GTal_=R@3YXtGi=%Vj832L_AE|l>Jhy18K/an^cNHv7i*3-8d*9?#FQa8u!IUoAai-mr(&PG|ZALs2&?6hI2N]9NKK][
StateAttribute3:
StateAttribute4:
StateAttribute5:
StateAttribute6: 0
StateAttribute7: 0
StateAttribute8: 0
StateAttribute9: 0
StateAttribute10: 0
StateAttribute11:
StateAttribute12:
StateAttribute13:
StateAttribute14:
StateAttribute14:
StateAttribute16: 0
StateAttribute17: 0
StateAttribute18: 0
StateAttribute19: 0
StateAttribute20: 0
StateAttribute21:
StateAttribute22:
StateAttribute23:
StateAttribute24:
StateAttribute25:
PoisonedCount: 0
Client Access Array: Client Access Array name could not be retrieved.
ExecutionId: 30334093
ExecutionStartTime: 12/23/2014 12:03:08 PM
ExecutionEndTime: 12/23/2014 12:03:08 PM
ResultId: 32263287
SampleValue: 0 Event Xml:
<event style="font-size:0.75em;line-height:1.5;" xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><system><provider guid="{C424A887-A89F-455F-8319-960917152221}" name="Microsoft-Exchange-ManagedAvailability"><eventid>4</eventid>
<version>0</version> <level>2</level> <task>2</task> <opcode>0</opcode> <keywords>0x8000000000000000</keywords> <timecreated systemtime="2014-12-23T12:03:08.889029200Z"><eventrecordid>7753</eventrecordid>
<correlation activityid="{ED377619-21A3-44A7-9444-751CDE95B0A1}"><execution processid="4204" threadid="14216"><channel>Microsoft-Exchange-ManagedAvailability/Monitoring</channel> <computer>email.domain.com</computer>
<security userid="S-1-5-18"></security></execution></correlation></timecreated></provider></system> <userdata><eventxml xmlns="myNs" xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events"><healthset>Autodiscover.Proxy</healthset>
<subject>Exchange Server Alert: The Autodiscover.Proxy health set is unhealthy.</subject> <message>The Autodiscover.Proxy health set has detected a problem on EMAIL beginning at 12/22/2014 3:01:12 PM (UTC). The health manager is reporting
that recycling the MSExchangeAutodiscoverAppPool app pool has failed to restore health and it has requested the protocol be marked offline. Attempts to auto-recover from this condition have failed and administrator attention is required. Details below: <b>MachineName:</b>
EMAIL <b>ServiceName:</b> Autodiscover.Proxy <b>ResultName:</b> AutodiscoverProxyTestProbe/MSExchangeAutodiscoverAppPool <b>Error:</b> The remote server returned an error: (500) Internal Server Error. <b>Exception:</b>
System.ApplicationException: The remote server returned an error: (500) Internal Server Error. at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(CancellationToken cancellationToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
joinedToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<StartExecuting>b__0() at System.Threading.Tasks.Task.Execute() <b>ExecutionContext:</b> Probe Absolute Timeout=60000ms, Timeout Value=60000ms,
Calculated HttpRequest Timeout=59000ms FailedResponse after 0 milliseconds. The remote server returned an error: (500) Internal Server Error. [000.000] Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms [000.000]
Starting HTTP request task [000.000] Waiting 59000 ms [000.000] Issuing GET against https://autodiscover.domain.com/AutoDiscover/ [000.000] Awaiting GET response [000.000] Performing SSL validation [000.000] Failed with exception: The remote server returned
an error: (500) Internal Server Error. <b>FailureContext:</b> <b>ResultType:</b> Failed <b>IsNotified:</b> False <b>DeploymentId:</b> 0 <b>RetryCount:</b> 0 <b>ExtensionXml:</b> <b>StateAttribute1:</b>
No response headers available. <b>StateAttribute2:</b> [email protected] cfj>M!T@O-;XNkj+=u8[SL#f8Oby*S:(&Bg@GTal_=R@3YXtGi=%Vj832L_AE|l>Jhy18K/an^cNHv7i*3-8d*9?#FQa8u!IUoAai-mr(&PG|ZALs2&?6hI2N]9NKK][
<b>StateAttribute3:</b> <b>StateAttribute4:</b> <b>StateAttribute5:</b> <b>StateAttribute6:</b> 0 <b>StateAttribute7:</b> 0 <b>StateAttribute8:</b> 0 <b>StateAttribute9:</b>
0 <b>StateAttribute10:</b> 0 <b>StateAttribute11:</b> <b>StateAttribute12:</b> <b>StateAttribute13:</b> <b>StateAttribute14:</b> <b>StateAttribute14:</b> <b>StateAttribute16:</b>
0 <b>StateAttribute17:</b> 0 <b>StateAttribute18:</b> 0 <b>StateAttribute19:</b> 0 <b>StateAttribute20:</b> 0 <b>StateAttribute21:</b> <b>StateAttribute22:</b> <b>StateAttribute23:</b>
<b>StateAttribute24:</b> <b>StateAttribute25:</b> <b>PoisonedCount:</b> 0 <b>Client Access Array:</b> Client Access Array name could not be retrieved. <b>ExecutionId:</b> 30334093 <b>ExecutionStartTime:</b>
12/23/2014 12:03:08 PM <b>ExecutionEndTime:</b> 12/23/2014 12:03:08 PM <b>ResultId:</b> 32263287 <b>SampleValue:</b> 0</message> <monitor>AutodiscoverProxyTestMonitor/MSExchangeAutodiscoverAppPool</monitor></eventxml></userdata></event>

Similar Messages

  • Help with filling a if statement

    hello everyone i hope someone can help me
    if you look at my code below the arraylist contains the number 8. but i want to know how i can use that number 8 inside the if statement (if (i%10 == 1)) where the number 1 is, so that number 1 will change to the number 8.
    could someone please help me.
    thanks for your time
    loftty
    hash.put(new Integer(8), st1);
    if(hash.containsValue(st1)) {
                             Enumeration e = hash.keys();
                                  while (e.hasMoreElements()) {
    Object it = e.nextElemenet();
    Object it1 = hash.get(it);
    if (it1.equals(st1){
    arraylist.add(it);
    Enumeration e = v.elements();
                        Object o;
                        for(int i = 1;e.hasMoreElements();i++) {
                        o = e.nextElement();
                             if (i%10 == 1){
                        System.out.println(o);

    By ArrayList do you mean the hashtable in your code?
    Because a hastable is not the same as an arraylist....
    For one thing your hashtable is wrong...
    The first parameter you pass in a put method is a key, the second is an object...
    When you want to get the object from the hashtable you pass it the key.... like so:
    hash.put("Str1", new Double(8));
    Double l_Double = (Double)hash.get("Str1");With an ArrayList you don't use keys by the way...
    Vermelh0

  • Help with a "AT NEW" statement

    I am debugging at some code and I am trying to understand the following statement
    <i>LOOP AT it_data_item_final INTO st_data_item_final.
    MOVE st_data_item_final-waers TO w_waers.
    <b>AT NEW xblnr."xblnr." budat xblnr waers.</b>
          MOVE-CORRESPONDING st_data_item_final TO s_bbkpf.
          s_bbkpf-waers = w_waers.
          t_upload_file = s_bbkpf.
          APPEND t_upload_file.
    ENDAT.</i>
    I know this code is to only execute when there is a change in the fields but I am not sure how to read the statement. I am assuming there if there is a change in the budat xblnr waers fields of the st_data_item_final table, this code will execute. I am not sure what the xblnr."xblnr." code is trying to do.
    thanks for the help in advance

    hi,
    LOOP AT it_data_item_final INTO st_data_item_final.
    v_tabix = sy-tabix.
    MOVE st_data_item_final-waers TO w_waers.
    AT NEW xblnr.
      read table it_data_item_final into st_data_item_final index v_tabix.
      MOVE-CORRESPONDING st_data_item_final TO s_bbkpf.
      s_bbkpf-waers = w_waers.
      t_upload_file = s_bbkpf.
      APPEND t_upload_file.
    ENDAT.
    endloop.
    After the at new XBLNR, the structure gets empty and only contains the fields that are left to the field (in the internal table) at which we are performing at end/at new.
    XBLNR F1 F2
    1     2   4 <-
    1     3   6
    2     2   4 <-
    3     3   3 <-
    then it gets triggered at these three positions. To fill the structure again with the values we need to read the table again with sy-tabix.
    Hope this helps.
    Regards,
    Richa

  • Help with a large compound statement - sort of

    Hi all. Hopefully you can help me. I'm trying to develop a little application in htmldb/ application express and having troubles with one little box.
    I have a page item that will have a value between 2003 and 2036. I will be referencing the value of this item from the session state, no worries. The next item in the page will be based on this value and the session state will trigger one of 33 possible queries for this 2nd item. I know that sounds complex but it has to be that way unfortunately, the queries that will be triggered by this :ITEM_1 value are very different so there is no pretty way of doing that bit.
    So say the value of Item1 = :ITEM1(session state value)
    I need to do something like
    IF
    :ITEM1 = '2004'
    THEN
    select column.name from table.name where condition
    ELSEIF
    :ITEM = '2005'
    THEN
    select column.name from table.name where condition
    ELSEIF
    :ITEM = '2006'
    THEN
    ''you get the idea
    I need to repeat this the 33 times for 33 different SELECT statements. I've tried to figure out the best way to approach it, whether that is an IF statement, a WHERE statement or similar but am really struggling. I have no training in any of this and am not an IT person or programmer, just a cartograpaher who got an extra job to do :)
    Which is the best approach for me here? And what is the syntax I need to use? I tried the IF statements but must be making some really fundamental mistakes in syntax. Forums are the only support available to me. Please help.....
    Cheers and thanks for your time. Michael

    :ITEM1 = '2004' ... :ITEM = '2005'
    select column.name from table.name where conditionAssuming ITEM1 and ITEM is just a typo and if the select statement is the same, you can use
    if :ITEM BETWEEN TO_NUMBER('2004') and TO_NUMBER('2005') THEN
    select column.name from table.name where condition
    end if;
    HTH
    Ghulam

  • Help with parsing an UPDATE statement

    I am stuck and need help! The teacher has not gone over parsing with us
    and it is not on his scheduled topics list. But, I am a person that likes to
    scope out and learn new things. For our final project, we have to allow
    updates, delete and inserts into the 5 main tables of the Premiere Products
    database. I have done everything except for the updates. I can achieve
    the updates of the entities by pretty much hardcoding them and that is
    okay by the teacher, but I want to learn about parsing because Barbara
    from this site mentioned this to me.
    This is what I was able to write and I am getting errors:
    CREATE OR REPLACE PROCEDURE updatecust_proc (
    v_cust_num IN customera.cust_num%TYPE,
    v_attributetoupdate VARCHAR2 ,
    v_updatedvalue VARCHAR2 )
    AS
    e_invalidcustnum_error EXCEPTION;
    BEGIN
    v_isvalidcustnum := iscust(v_cust_num);
    IF (v_isvalidcustnum = FALSE) THEN
    RAISE e_invalidcustnum_error;
    END IF;
    PARSE(
    'UPDATE customer
    SET' | | v_attributetoupdate | | '=' | | v_updatedvalue | |
    'WHERE cust_num =' | | v_cust_num
    END;
    EXCEPTION
    WHEN e_invalidcustnum_error THEN
    DBMS_OUTPUT.PUT_LINE('Cannot be updated. Invalid customer number');
    END;
    Any help would be useful. I went to the Oracle help site but their examples are a little too complicated for me to understand, plus, I am not using any C code.
    Thanks in advance!
    Bob

    Now we are getting somewhere. Identifier 'PARSE' must be declared.
    I again used the 'Search' link just above the forum posts and entered 'dbms_sql.parse' and got a short list of hits (as I suggested in my previous reply).
    There is one with Barbara's name on it. It shows exactly how to do what you are trying to do. In particular note her code:
    DBMS_SQL.PARSE
    (cursor_name,
    'UPDATE client SET '
    | | v_column
    | | ' = ' | | '''' | | v_new_data | | ''''
    | | ' WHERE account_id = '
    | | v_account_id,
    DBMS_SQL.NATIVE);
    Compare her PARSE statement to yours and you will see some major differences. The PARSE procedure is defined in the DBMS_SQL package and must be reference by DBMS_SQL.PARSE as Barbara shows.
    In addition to dynamic SQL using the DBMS_SQL package Oracle 8i also supports the EXEC IMMEDIATE statement.
    All of Oracle's documentation is available online via the 'Documentation' link on the left side of the OTN home page.
    The 'Supplied PL/SQL Packages Reference' has a chapter for each package (including DBMS_SQL) and describes the procedures/functions in the package and how to use them.
    The 'Application Developers Guide - Fundamentals' has chapters on 'processing SQL statements' and 'dynamic SQL' that go into some detail on performing dynamic sql.
    Yes, Barbara's code uses a CURSOR. The DBMS_SQl package requires it and so does your code. Almost all SQL uses a CURSOR either implicitly or explicitly.
    My comments are not, and were not, directed at you personally so I hope you don't take them that way.
    Your latest reply has a lot of useful information in it.
    1. 19/1 PLS-00201: identifier 'PARSE' must be declared. This is the explicit error message we need to help someone. We don't have to guess which error they are talking about. We can look it up in the MESSAGES manual if necessary. When someone says 'I get an error', or 'I get a PARSE error' we can only guess which error they are talking about.
    In your reply you state that you looked at Barbara's code, she uses a cursor and you don't need a cursor. That is very useful information to someone trying to help you because it tells us two things: you are trying to find the answer for yourself (a lot of people just want someone to write the code for them) and it shows that you haven't made the connection between Barbara's example (which shows EXACTLY what you need to do) and your own code.
    This is a public forum and I have found it useful to keep repeating certain suggestions.
    For whatever reason many people still do not seem to realize that:
    1. ALL of Oracle's documentation is available on-line via the 'Documentation' link on the left side of the OTN main page.
    2. You can purchase (for about $50) a CD-ROM that has all of the Oracle documentation on it in both PDF and HTML format.
    3. The 'search' link just above each discussion forum allows one to search any or all forums for topics, users, etc.
    The above resources should be used by everyone.
    Good luck!
    null

  • Help with a update,select statement

    Hi all please can you help me with a update statement i am struggling with.
    I have 2 tables
    Holiday and data
    In the Holiday table i have columns for
    Machine_ID NUMBER,
    date_from DATE,
    date_to DATE,
    ID NUMBER
    Machine column represents a type of machine, the two dates represent the start and end date of a holiday and ID represents the ID of the machines that the holiday effects (as you can have many machines that are the same, so the ID unique field to seperate them.
    i.e.
    996     25-DEC-08 00:00:00     27-DEC-08 00:00:00     91     
    996     25-DEC-08 00:00:00     27-DEC-08 00:00:00     92     
    100     28-DEC-08 00:00:00     29-DEC-08 00:00:00     1
    100     28-DEC-08 00:00:00     29-DEC-08 00:00:00     2
    In the data table i have the following columns:
    DATE DATE
    Machine NUMBER
    SHIFT1S DATE
    SHIFT1F DATE
    SHIFT2S DATE
    SHIFT2F DATE
    CALS DATE
    CALF DATE
    CAP NUMBER
    CALCAP NUMBER
    total_hrs_up NUMBER
    In here i have data for every date in the calendar. The machines are cross references with the machine in holidays table.
    I run two shifts so have shift 1 start, finish. shift 2 start, finish. These are dates with times, so shift1s could be 01-01-08 09:00:00 shift1f could be 01-01-08 17:00:00.
    shift2S could be 01-01-08 21:00:00 shift2f could be 01-01-08 23:59:00.
    so that machine would be up between them hours of the day.
    Other columns include
    CALS, ,CALF = calendar start, finish, - This needs to be populated from the holiday table. currently null. So if the date is the 26 DEC and the machine is the same as what is in the holiday table then these two columns should be populated with them data
    CAP is the total number of these machines i have available.
    CALCAP is the no of machines the holiday affects -currently null
    total_hrs_up is the number of hours this machine is up and running -currently null.
    So what i need to do is populate the cals, calf calcap, total_hrs_up columns.
    total_hrs_up is the important one, this needs to work out based on the two shift patterns the number of hours that the machine is available and then take off the holiday hours to give a final value.
    so current data example in data is
    date machine shifts shiftf shift2s shift2f cals, calf, cap, calcap, total_hrs
    16-JUL-08     100 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''     
    16-JUL-08     105 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''
    16-JUL-08     107 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''
    id like to see based on the holiday table if there is a holiday then this data is updated as such and a total_hrs machine is available populated on that date.
    Any help is very much appreciated!
    Thanks

    Hi,
    The following query does what you requested.
    It makes the following assumptions:
    (a) in data, shift1start <= shift1finish
    (b) in holiday, hol_start <= hol_finish
    (b) in data, the combination (machine, shift1start) is unique
    (c) in holiday, hol_start <= hol_finish
    (d) in holiday, rows for the same machine and id never have overlapping dates (including times). For example:
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 09:59:59');
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');will cause a probem. Multiple rows for the same machine and day are okay, however, if the times do not overlap, like the following:
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 08:59:59');
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');Here's the UPDATE statement:
    UPDATE     data     m
    SET     (     hol_start
         ,     hol_finish
         ,     no_of_available_minutes
         ) =
    (     SELECT     MIN (date_from)
         ,     MAX (date_to)
         ,     (     MAX (shift1finish - shift1start)     -- Total from data
              -     ( NVL     ( SUM     ( LEAST (date_to, shift1finish)
                             - GREATEST (date_from, shift1start)
                        , 0
                        )                    -- Total from holiday
                   / MAX (total_no_of_machines)          -- Average
              ) * 24 * 60                         -- Convert days to minutes
         FROM          data     d
         LEFT OUTER JOIN     holiday     h     ON     h.machine     = d.machine
                             AND NOT     (     date_from     > shift1finish
                                  OR      date_to          < shift1start
         WHERE          d.machine     = m.machine
         AND          d.shift1start     = m.shift1start
    );The subquery has to use its own copy of data (that is, in needs d, not m), since the subquery has to return a non-NULL number of minutes when no rows in h match m.

  • Help with TYPE and LIKE statements

    HI guys,
    I know this is really novice stuff, but I am a little confused.
    Can anyone please explain the exact difference between TYPE and like with the help of a program, to understand it.
    What situation would demand the use of each of the LIKE statement, since I can do all these things using the TYPE ?

    Hi Akhil,
    I summarized the info in SDN posts and SAP Help, to make it easier for you to understand. I also included some code snippets. Hope these prove to be helpful to you.
    The following is from SAP Help:
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    Example
    TYPES: BEGIN OF struct,
             number_1 TYPE i,
             number_2 TYPE p DECIMALS 2,
           END OF struct.
    DATA:  wa_struct TYPE struct,
           number    LIKE wa_struct-number_2,
           date      LIKE sy-datum,
           time      TYPE t,
           text      TYPE string,
           company   TYPE s_carr_id.
    This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
    The following info is from various posts:
    --> Type: It is used when userdefined object link with SAP system data type.
    Local types mask global types that have the same names. When typing the interface parameters or field symbols, a reference is also possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or STANDARD TABLE, SORTED TABLE and HASHED TABLE.
    --> Like: It is when data object link with the other data object.
    --> TYPE, you assign datatype directly to the data object while declaring.
    --> LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.
    you can refer to all visible data objects at the ABAP program's positon in question. Only the declaration of the data object must be known. In this case it is totally irrelevant whether the data object already exists physically in
    memory during the LIKE reference. Local data objects mask global data objects that have the same name.
    --> Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.
    Types: var1(20) type c.
    data: var2 type var1. ( type is used bcoz var1 is defined with TYPES and it
    does not occupy any memory spce.
    data: var3 like var2. ( like is used here bcoz var2 is defined with DATA
    so it does occupy space in memory ).
    data: material like mara-matnr. ( like is used here bcoz mara-matnr is stored in memory)
    --> Type refers the existing data type
    --> Like refers the existing data object
    Please Reward Points if any of the above points are helpful to you.
    Regards,
    Kalyan Chakravarthy

  • Need some quick help with server proxy on PI 7.1 system

    Hi,
    I am implementing a server proxy on the PI 7.1 system to do some logging to a table. So, when I go the the proxy in sproxy and generate it, in the interface section on the properties tabs I only see a drop down that says point to point enabled. There is no implementing class to click into and thus not method to populate with the custom code. Some direction would be appreciated, I have been working 7.0 for a while, so the missing implementing class is new to me! I know the method name has changed from the execute_asycronous etc... Am I going to the wrong place now to find the implementing method?
    Thanks,
    Chris

    Whoops! Brain cramp. accidentally set the interface to outbound and not inbound in the ESR lol. Sorry.

  • Help with decode or case statement

    I have the following insert statement
    insert into t_outcome (
    TRANSACTION_ID,
    charge_DATE,
    Charge_TIME,
    STATUS_CODE)
    values(cur_tem.transaction_id,
    cur_tem.charge_date,
    cur_tem.charge_time,
    cur_tem.STATUS_code)
    I require to incorporate the following rules into the population of charge_TIME
    if cur_tem.STATUS_code is 7 and cur_temp.charge_time is not null then populate charge_TIME with cur_temp.charge_time
    else if cur_tem.STATUS_code is 7 and cur_temp.charge_time is null then populate charge_TIME with -9
    else if cur_tem.STATUS_code is not 7 then populate charge_TIME with -7
    How do I add these rules into the insert statement ?
    Thanks
    Brendon

    decode(cur_tem.STATUS_code, 7, nvl(cur_tem.charge_time, -9), -7)
    I think that will work.
    Lee
    Message was edited by:
    Lee Forkenbrock

  • Help with a union all statement

    Hello
    I am pulling a query much like this:
    (select ID, Created_timestamp from snapshot1
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    UNION ALL
    (select ID, created_timestamp from snapshot2
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    UNION ALL
    (select ID, created_timestamp from data_history
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    Is there an easier way to handle created_timestamp?
    I would like to put it at the beginning so I only have to change it in one place.

    I don't understand.
    I try your with statement and get: "end_date" invalid identifier as an error
    I start my query out:
    WITH start_date as
    (select to_date ('08/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') from dual),
    end_date as (select to_date ('08/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM) from dual)
    select sales.id, start_date as callstart, end_date as callend
    where sales.created_timestamp >= start_date
    and sales.created_timestamp < end_date
    UNION ALL
    <<<<<<<here is where you take the last select statement and replace sales with manufacturing>>>>>>>>>>>>>
    UNION ALL
    <<<<<<<here is where you take the last select statement and replace sales with engineering>>>>>>>>>>>>>
    and it still fails.

  • Help with a simple select statement

    $x = oci_parse($c, "select quantity from balance where item_num=101");
    oci_execute($x);
    echo "the quant is: ".$x;
    I try to run this select statement without success
    then I tried...
    $x = oci_parse($c, "select quantity from balance where item_num=101");
    $y= oci_execute($x);
    echo "the quant is: ".$y;
    and it didn't work either...
    What should I change?
    thanks!

    The Oracle library operates a bit differently from some other PHP libraries, notably MySQL/MySQLi. With Oracle (OCI8), you have to execute the statement, and then afterward use an oci_fetch...() function to pull things from your $statement variable. Here's a small example that hopefully will illustrate the basic usage:
    <?php
         $conn = oci_connect('hr','hr','xe');
         if(!$conn) {
              echo 'Could not connect!';
              exit;
         $sql = 'select * from jobs';
         $stmt = oci_parse($conn, $sql);
         if(!$stmt) {
              echo 'Could not parse query.';
              exit;
         $result = oci_execute($stmt, OCI_DEFAULT);
         if(!$result) {
              echo 'Could not execute query.';
              exit;
         echo "Query ran successfully.\n";
         // Fetch rows as associative arrays, so
         // we can ask for values by column name.
         // Other options include oci_fetch_row(),
         // oci_fetch_array(), and oci_fetch_object().
         // Note that oci_fetch_assoc() will create
         // an associative array using upper-case
         // column names for the keys.
         while(($row = oci_fetch_assoc($stmt)) != null)
              echo $row['JOB_ID'] . ': ' . $row['JOB_TITLE'] . "\n";
         echo "All data returned.\n";
         oci_close($conn);
    ?>When I run this, I get the following:
    C:\workspace\php>php select.php
    Query ran successfully.
    AD_PRES: President
    AD_VP: Administration Vice President
    AD_ASST: Administration Assistant
    FI_MGR: Finance Manager
    FI_ACCOUNT: Accountant
    AC_MGR: Accounting Manager
    AC_ACCOUNT: Public Accountant
    SA_MAN: Sales Manager
    SA_REP: Sales Representative
    PU_MAN: Purchasing Manager
    PU_CLERK: Purchasing Clerk
    ST_MAN: Stock Manager
    ST_CLERK: Stock Clerk
    SH_CLERK: Shipping Clerk
    IT_PROG: Programmer
    MK_MAN: Marketing Manager
    MK_REP: Marketing Representative
    HR_REP: Human Resources Representative
    PR_REP: Public Relations Representative
    All data returned.
    C:\workspace\php>For more information, take a look at the OCI8 library documentation in the PHP manual online:
    OCI8
    http://us.php.net/manual/en/book.oci8.php
    Some other examples
    http://us.php.net/manual/en/oci8.examples.php
    Kind regards,
    Christopher L. Simons

  • Help with error select case statement (ORA-00932: inconsistent datatypes)

    Hi,
    I'm struggling to get my sql query work on Oracle..
    I have a table MyTable with 5 columns ( Column1, Column2, Column3, Column4, Column5 ) all are of type NVARCHAR2.
    I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2.
    For example
    If a row contains the following values,
    Column 2 = a.b
    Column 3 = 123
    Column 4 = xyz
    then column CA = a.b/123/xyz where column CA = temp column
    If either Column 3 or Column 4 is empty/null, then I don't need to append value for that column..
    For example
    Column 2 = a.b
    Column 3 = either NULL or ''
    Column 4 = xyz
    then CA = a.b/xyz where column CA = temp column
    similarly..
    Column 2 = a.b
    Column 3 = 123
    Column 4 = either NULL or ''
    then CA = a.b/123 where column CA = temp column
    Here is my query..
    select MyTable.Column1 as CA0,
    MyTable.Column2 as CA1,
    MyTable.Column3 as CA2,
    MyTable.Column4 as CA3,
    MyTable.Column5 as CA4,
    MyTable.Column2 + CASE WHEN MyTable.Column3 > '' THEN '/' + MyTable.Column3 ELSE '' END + CASE WHEN MyTable.Column4 > '' THEN '/' + MyTable.Column4 ELSE '' END CA
    from MyTable;
    This query works just fine against SQL Server db, but gainst Oracle I'm getting
    ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    Could you please let me know what I'm doing wrong. I need to get this query working on both SQL Server and Oracle..
    Please let me know your suggestions and thoughts..
    Cheers,

    I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2. In Oracle, you can do it this way - no need to do all kinds of difficult things:
    select col2||col3||col4
      from tbl

  • Need help with itunes proxy, URGENT!!! please reply

    Hello, im currently living in boarding school, and the wifi, recures a proxy server, I got it, and now i can acces internet perfectly, I can do everything perfectly, but when i go into the itunes store and try to buy something, this is what comes up. "We can not complete yout Itunes store request, you must log in into the proxy server in order to confirm your request."
    so how do I sign into the proxy server,
    PLEASE HELP

    Hey,
    Try downloading and re-installing iTunes as described here:
    http://support.apple.com/kb/TS2388
    Jason

  • Need help with correcting the select statement

    I have two tables mkt & error.
    The fields of mkt are
    app_id (xxx)
    c_mkt_id
    app_mkt_id
    The fields of error table are
    mkt_id
    intr_id (its in format xxx.yyy or xxx)
    xyz
    abc
    pqr
    I have to select * fields from error table such that
    ->mkt.app_id = error.intr_id (here i am using combination of sbstr & instr to get the part before "." if present)
    ->mkt.c_mkt_id=error.mkt_id
    Where ever the above two conditions match i have to replace the mkt_id field in my select * from error table query with the
    app_mkt_id field from mkt table. If the above two condtions dont match my select * from error table should return the original mkt_id present in the error table.
    I have presently developed a query(*) which selects the app_mkt_id from mkt table where ever the two conditions match.
    How should i go about using this to get my actual requirement.
    (*)=select app_mkt_id from mkt where app_id in (select case when case_when=1 then substr(intr_id, 1, instr(intr_id,'.')-1) else substr(intr_id, 1) end from (select intr_id, case when instr(intr_id,'.',1)=0 then 0 else 1 end case_when from error)) and
    c_mkt_id in (select mkt_id from error)

    you wrote:
    (*)=select app_mkt_id from mkt where ....What is this?
    If you are writing PL/SQL the syntax is:
    SELECT ....
    INTO ....
    FROM ....
    WHERE ....This seems to be school work and thus you really need to puzzle this out for yourself.

  • Help with 'connect by prior' statement

    I've got a quoting report that is sporadically ordering incorrectly and I've traced the source down to a 'connect by prior' statement. Can I get an explanation of what the statement is doing so I can figure out how to change it to get the desired results?
    select rownum config_rownum, quote_line_id,related_quote_line_id rlid, level
    from aso_line_relationships
    where relationship_type_code = 'CONFIG'
    connect by prior related_quote_line_id = quote_line_idsample output for the line_ids for one quote:
    CONFIG_ROWNUM     QUOTE_LINE_ID     RLID     LEVEL
    1          7438          7439     2
    2          7440          7441     2
    3          7430          7431     2
    4          7432          7433     2
    5          7432          7434     2
    6          7432          7435     2
    7          7436          7437     2
    8          7442          7443     2
    9          7442          7444     2
    10          7442          7445     2
    11          7442          7446     2
    12          7442          7447     2
    13          7442          7448     2
    14          7442          7449     2
    15          7450          7451     2
    16          7452          7453     2
    17          7452          7454     2
    18          7452          7455     2
    19          7456          7457     2
    20          7456          7458     2
    21          7456          7459     2
    22          7460          7461     2
    23          7460          7462     2
    24          7463          7464     2
    25          7430          7431     1
    26          7432          7433     1
    27          7432          7434     1
    28          7432          7435     1
    29          7436          7437     1
    30          7438          7439     1
    31          7440          7441     1
    32          7442          7443     1
    33          7442          7444     1
    34          7442          7445     1
    35          7442          7446     1
    36          7442          7447     1
    37          7442          7448     1
    38          7442          7449     1
    39          7450          7451     1
    40          7452          7453     1
    41          7452          7454     1
    42          7452          7455     1
    43          7456          7457     1
    44          7456          7458     1
    45          7456          7459     1
    46          7460          7461     1
    47          7460          7462     1
    48          7463          7464     1 The correct ordering can be seen by running this statement:
    select rownum config_rownum, quote_line_id,related_quote_line_id rlid
    from aso_line_relationships
    where relationship_type_code = 'CONFIG' and quote_line_id between 7430 and 7464
    CONFIG_ROWNUM     QUOTE_LINE_ID     RLID
    1          7430          7431
    2          7432          7433
    3          7432          7434
    4          7432          7435
    5          7436          7437
    6          7438          7439
    7          7440          7441
    8          7442          7443
    9          7442          7444
    10          7442          7445
    11          7442          7446
    12          7442          7447
    13          7442          7448
    14          7442          7449
    15          7450          7451
    16          7452          7453
    17          7452          7454
    18          7452          7455
    19          7456          7457
    20          7456          7458
    21          7456          7459
    22          7460          7461
    23          7460          7462
    24          7463          7464I tried to substitute the simple query above for the 'connect by prior' query in the report but failed because something in the report is expecting input from the 'connect by prior' statement. So eliminating the statement is not a choice.

    "connect by prior " is for for hierarchical queries which is for data has parent-children relationship, and ususlly its' result is used to populate tree-like data result. and order by is NOT recommend since it will destroy the hierarchical order.
    you could use "order by sibiling" if you would like to order inside the same level of data

Maybe you are looking for