Query for registered agents

Is there a way to query for all the scheduler agents registered to the database, like a metadata table ?

At the moment (11.1.0.7) you can not see which agents are registered. You cn find which agents have been recently used by checking the schedulerrun_details view.
Ronald.
http://ronr.blogspot.com
Edited by: Ronald Rood on Jul 23, 2009 10:13 AM

Similar Messages

  • Customized Query for purchase register

    Hi All,
    I need a query for purchase register which gives excise information with biferication.
    OPCH, PCH1, ORPC, RPC1 and IEI4
    In excel reporter we get the purchase register report But excise amount does not come in that report.
    So, I need Customised report for that.
    Regards
    Shashi

    hi shashi,
    SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',
    (Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
    (SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
    (Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OPCH M LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
    WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND (T.TrgetEntry = ' ')
    GROUP BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
    Jeyakanthan

  • Operations manager failed to run a wmi query for wmi events (0x800706ba)

    Hi everyone,
    I've been working on this issue for a while and I am still no closer to finding out what the problem is.  If anybody can offer any other advice or things to check, I'm all ears.
    I'm running SCOM 2012 R2 with UR2, and the Cluster Management Pack v6.0.7063.0
    My problem is on one particular batch of cluster servers where I am getting the following error.
    Name: Operations Manager failed to run a WMI query for WMI events
    Alert Description:
    Module was unable to enumerate the WMI data
    Error: 0x800706ba
    Details: The RPC server is unavailable
    Workflow name: Microsoft.Windows.Cluster.Node.StateMonitoring
    Instance Name: servername.domain.local
    Instance ID: {instance_id}
    Management group: SCOM_Management_Grp_Name
    I am getting this alert regardless of whether I run the Windows Cluster Action Account as Local System, or as a domain user with full local admin privileges on all the cluster nodes.
    When looking at the management pack and the workflow in particular (Microsoft.Windows.Cluster.Node.StateMonitoring), I can see that it's trying to access
    MSCluster_Node in the root\MSCLUSTER WMI namespace.
    This is the workflow for your information...
    <UnitMonitor> ID="Microsoft.Windows.Cluster.Node.StateMonitoring" Accessibility="Public" Enabled="onEssentialMonitoring" Target="ClusLibrary!Microsoft.Windows.Cluster.Node" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="ClusLibrary!Microsoft.Windows.Cluster.CheckState" ConfirmDelivery="false">
    <Category>AvailabilityHealth</Category>
    <AlertSettings AlertMessage="Microsoft.Windows.Cluster.Node.StateMonitoring.AlertMessage">
    <AlertOnState>Warning</AlertOnState>
    <AutoResolve>true</AutoResolve>
    <AlertPriority>Normal</AlertPriority>
    <AlertSeverity>MatchMonitorHealth</AlertSeverity>
    <AlertParameters>
    <AlertParameter1>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
    <AlertParameter2>$Target/Property[Type="ClusLibrary!Microsoft.Windows.Cluster.Node"]/ClusterName$</AlertParameter2>
    </AlertParameters>
    </AlertSettings>
    <OperationalStates>
    <OperationalState ID="Success" MonitorTypeStateID="Online" HealthState="Success" />
    <OperationalState ID="Warning" MonitorTypeStateID="Partial" HealthState="Warning" />
    <OperationalState ID="Error" MonitorTypeStateID="NotOnline" HealthState="Error" />
    </OperationalStates>
    <Configuration>
    <ClusterObjectName>$Target/Property[Type='ClusLibrary!Microsoft.Windows.Cluster.Node']/NodeName$</ClusterObjectName>
    <PollInterval>60</PollInterval>
    <ClusterObjectClass>MSCLUSTER_Node</ClusterObjectClass>
    <OnlineExpression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </OnlineExpression>
    <OnlineExpressionOnDemand>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </OnlineExpressionOnDemand>
    <PartialExpression>
    <Or>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </Or>
    </PartialExpression>
    <PartialExpressionOnDemand>
    <Or>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </Or>
    </PartialExpressionOnDemand>
    <NotOnlineExpression>
    <And>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </And>
    </NotOnlineExpression>
    <NotOnlineExpressionOnDemand>
    <And>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </And>
    </NotOnlineExpressionOnDemand>
    <WMIFields>Name, State</WMIFields>
    </Configuration>
    </UnitMonitor>
    I can confirm that I am able to browse the MSCluster_Node class locally, as well as remotely using WMIEXPLORER and WBEMTEST,
    however it only works when I set the Authentication Level to
    Packet Privacy.  If I do not select Packet Privacy, a WMI event log error 5605 is logged on the remote servers application log that says...
    The root\mscluster namespace is marked with the RequiresEncryption flag.  Access to this namespace might be denied if the script or application does not have the appropriate authentication level.  Change the authentication level to Pkt_Privacy
    and run the script or application again.
    I can confirm that all firewalls are turned off, and there are no firewalls between the management servers and the agents in question.  AV exclusions have been done and appear to be in place.  The nodes are all Windows 2008 R2 with SP1.  As
    far as I can tell there is plenty of memory available on each of the nodes in question (50%+) of RAM is available. 
    If I manually run the "Discover the Windows Server 2008 R2 Cluster Components" task in the Cluster Service State section of the management pack in the Monitoring Pane in the console, on the nodes in question - the discovery runs successfully.
    Does anybody have any other ideas or suggestions I could try?
    Many thanks in advance,
    Noel.
    http://www.dreamension.net

    Hi,
    Common causes of RPC errors include:
    Errors resolving a DNS or NetBIOS name.
    The RPC service or related services may not be running.
    Problems with network connectivity.
    File and printer sharing is not enabled.
    For more information, please review the link below:
    Windows Server Troubleshooting: "The RPC server is unavailable"
    http://social.technet.microsoft.com/wiki/contents/articles/4494.windows-server-troubleshooting-the-rpc-server-is-unavailable.aspx#Identify
    Troubleshooting RPC Errors
    http://technet.microsoft.com/en-us/magazine/2007.07.howitworks.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • "Error [10151] The LCP Port on CCM Admin for Mobile Agent is not Configured or misconfigured"

    We are running into a problem which we have noticed on UCCE 8.5 and havent seen on earlier 7.5 release.
    If we setup a CTI port as agent device target and if we try to login the agent using Cisco Desktop (Not CAD, just CTI OS Client) then we get following error:
    "Error [10151] The LCP Port on CCM Admin for Mobile Agent is not Configured or misconfigured"
    But this wasnt the issue with 7.5 and we were able to do agent login with CTI Port as device target. We dont intend to use Mobile Agent feature but just login UCCE agent to CTI port as the device.
    Do we know if this is a known issue or if something has changed between 7.x and 8.x release which could be is causing this?

    So you can ping and nslookup from your ms to these agents and vice versa right?  I wouldn't do a manual install, I would push the agent from the management server.  You can uninstall the agent manually, or use cleanmom to get rid of them.  Then
    do an install from the console.  When you initiate the install from the console (management server), should it run into any issues it will dump out an error which will give you an idea of where the problem may be.
    From Holmans post on this:
    e MOM Server could not execute WMI Query "Select * from Win32_OperatingSystem" on 
    computer “servername.domain.com” 
    Operation: Agent Install 
    Install account: DOMAIN\account 
    Error Code: 800706BA 
    Error Description: The RPC server is unavailable.
    The MOM Server could not execute WMI Query "(null)” on 
    computer “servername.domain.com” 
    Operation: Agent Install 
    Install account: DOMAIN\account 
    Error Code: 800706BA 
    Error Description: The RPC server is unavailable.
    8004100A 
    800706BA
    1.  Ensure agent push account has local admin rights 
    2.  Firewall is blocking NetBIOS access.  If Windows 2008 firewall is enabled, ensure “Remote Administration (RPC)” rule is enabled/allowed.  We need port 135 (RPC) and the DCOM port range opened for console push through a firewall.  
    3.  Inspect WMI service, health, and rebuild repository if necessary 
    4.  Firewall is blocking ICMP  (Live OneCare) 
    5.  DNS incorrect 
    http://blogs.technet.com/b/kevinholman/archive/2009/01/27/console-based-agent-deployment-troubleshooting-table.aspx
    Regards, Blake Email: mengotto<at>hotmail.com Blog: http://discussitnow.wordpress.com/ If my response was helpful, please mark it as so, if it answered your question, then please also mark it accordingly. Thank you.

  • Question/issue regarding querying for uncommited objects in Toplink...

    Hi, was hoping to get some insight into this problem we are encoutering…
    We have this scenario were we are creating a folder hierarchy (using Toplink)
    1. a parent folder is created
    2. child elements are created (in the same transaction as step 1),
    3. we need to lookup the parent folder and assign it as the parent
    of these child elements
    4. end the transaction and commit all data
    In our system we control access to objects by appending a filter to the selection criteria, so we end up with SQL like this example
    (The t2 stuff is the authorization lookup part of the query.) ;
    SELECT t0.ID, t0.CLASS_NAME, t0.DESCRIPTION, t0.EDITABLE,
    t0.DATE_MODIFIED, t0.DATE_CREATED,
    t0.MODIFIED_BY, t0.ACL_ID, t0.NAME, t0.CREATED_BY,
    t0.TYPE_ID, t0.WKSP_ID, t1.ID, t1.LINK_SRC_PATH,
    t1.ABSOLUTE_PATH, t1.MIME_TYPE, t1.FSIZE,
    t1.CONTENT_PATH, t1.PARENT_ID
    FROM XDOOBJECT t0, ALL_OBJECT_PRIVILEGES t2,
    ARCHIVEOBJECT t1
    WHERE ((((t1.ABSOLUTE_PATH = '/favorites/twatson2')
    AND ((t1.ID = t2.xdoobject_id)
    AND ((t2.user_id = 'twatson2')
    AND (bitand(t2.privilege, 2) = 2))))
    AND (t1.ID = t0.ID))
    AND (t0.CLASS_NAME = 'oracle.xdo.server.repository.model.Archivable'))
    When creating new objects we also create the authorization lookup record (which is inserted into a different table.) I can see all the objects are registered in the UOW identity map.
    Basically, the issue is that this scenario all occurs in a single transaction and when querying for the newly created parent folder, if the authorization filter is appended to the query, the parent is not found. If I remove the authorization filter then the parent is found correctly. Or if I break this up into separate transactions and commit after each insert, then the parent is found correctly.
    I use the conformResultsInUnitOfWork attribute on the queries.
    This is related to an earlier thread I have in this discussion forum;
    Nested UnitOfWork and reading newly created objects...
    Thanks for any help you can provide,
    -Tim

    Hi Doug, we add the authorization filter directly in the application code as the query is getting set up.
    Here are some code examples; 1) the first is the code to create new object in the system, followed by 2) the code to create a new authorization lookup record (which also uses the first code to do the actual Toplink insert), then 3) an example of a read query where the authorization filter is appended to the Expression and after that 4) several helper methods.
    I hope this is of some use as it's difficult to show the complete flow in a simple example.
    1)
    // create new object example
    public Object DataAccess.createObject(....
    Object result = null;
    boolean inTx = true;
    UnitOfWork uow = null;
    try
    SessionContext sc = mScm.getCurrentSessionContext();
    uow = TLTransactionManager.getActiveTransaction(sc.getUserId());
    if (uow == null)
    Session session = TLSessionFactory.getSession();
    uow = session.acquireUnitOfWork();
    inTx = false;
    Object oclone = (Object) uow.registerObject(object);
    uow.assignSequenceNumbers();
    if (oclone instanceof BaseObject)
    BaseObject boclone = (BaseObject)oclone;
    Date now = new Date();
    boclone.setCreated(now);
    boclone.setModified(now);
    boclone.setModifiedBy(sc.getUserId());
    boclone.setCreatedBy(sc.getUserId());
    uow.printRegisteredObjects();
    uow.validateObjectSpace();
    if (inTx == false) uow.commit();
    //just temp, see above
    if (true == authorizer.requiresCheck(oclone))
    authorizer.grantPrivilege(oclone);
    result = oclone;
    2)
    // Authorizer.grantPrivilege method
    public void grantPrivilege(Object object) throws DataAccessException
    if (requiresCheck(object) == false)
    throw new DataAccessException(
    "Object does not implement Securable interface.");
    Securable so = (Securable)object;
    ModulePrivilege[] privs = so.getDefinedPrivileges();
    BigInteger pmask = new BigInteger("0");
    for (int i = 0; i < privs.length; i++)
    BigInteger pv = PrivilegeManagerFactory.getPrivilegeValue(privs);
    pmask = pmask.add(pv);
    SessionContext sc = mScm.getCurrentSessionContext();
    // the authorization lookup record
    ObjectUserPrivilege oup = new ObjectUserPrivilege();
    oup.setAclId(so.getAclId());
    oup.setPrivileges(pmask);
    oup.setUserId(sc.getUserId());
    oup.setXdoObjectId(so.getId());
    try
    // this recurses back to the code snippet from above
    mDataAccess.createObject(oup, this);
    catch (DataAccessException dae) {
    Object[] args = {dae.getClass().toString(), dae.getMessage()};
    logger.severe(MessageFormat.format(EXCEPTION_MESSAGE, args));
    throw new DataAccessException("Failed to grant object privilege.", dae);
    3)
    // example Query code
    Object object = null;
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression exp = eb.get(queryKeys[0]).equal(keyValues[0]);
    for (int i = 1; i < queryKeys.length; i++)
    exp = exp.and(eb.get(queryKeys[i]).equal(keyValues[i]));
    // check if need to add authorization filter
    if (authorizer.requiresCheck(domainClass) == true)
    // this is where the authorization filter is appended to query
    exp = exp.and(appendReadFilter());
    ReadObjectQuery query = new ReadObjectQuery(domainClass, exp);
    SessionContext sc = mScm.getCurrentSessionContext();
    if (TLTransactionManager.isInTransaction(sc.getUserId()))
    // part of a larger transaction scenario
    query.conformResultsInUnitOfWork();
    else
    // not part of a transaction
    query.refreshIdentityMapResult();
    query.cascadePrivateParts();
    Session session = getSession();
    object = session.executeQuery(query);
    4)
    // builds the authorzation filter
    private Expression appendReadFilter()
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression exp1 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("xdoobject_id");
    Expression exp2 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("user_id");
    Expression exp3 = eb.getTable("ALL_OBJECT_PRIVILEGES").getField("privilege");
    Vector args = new Vector();
    args.add(READ_PRIVILEGE_VALUE);
    Expression exp4 =
    exp3.getFunctionWithArguments("bitand",args).equal(READ_PRIVILEGE_VALUE);
    SessionContext sc = mScm.getCurrentSessionContext();
    return eb.get("ID").equal(exp1).and(exp2.equal(sc.getUserId()).and(exp4));
    // helper to get Toplink Session
    private Session getSession() throws DataAccessException
    SessionContext sc = mScm.getCurrentSessionContext();
    Session session = TLTransactionManager.getActiveTransaction(sc.getUserId());
    if (session == null)
    session = TLSessionFactory.getSession();
    return session;
    // method of TLTransactionManager, provides easy access to TLSession
    // which handles Toplink Sessions and is a singleton
    public static UnitOfWork getActiveTransaction(String userId)
    throws DataAccessException
    TLSession tls = TLSession.getInstance();
    return tls.getTransaction(userId);
    // the TLSession method, returns the active transaction (UOW)
    // or null if none
    public UnitOfWork getTransaction(String uid) {
    UnitOfWork uow = null;
    UowWrapper uw = (UowWrapper)mTransactions.get(uid);
    if (uw != null) {
    uow = uw.getUow();
    return uow;
    Thanks!
    -Tim

  • Select Query for Report

    Hi All
    I have a table called Agent. Each Agent processes requests.
    So accordingly Request is another table.
    Now the Agent can process the request successfully, fail or it could be
    in progress.
    So accordingly I have a status column in the Request table which can have the following values
    New - when the request is allocated to the agent
    Open- When the agent opens the request
    Action- when the agent acted upon the request
    Sold - when the agent was successful in processing the request
    Fail - when the agent could not process the request
    In the Request table there is column called requestDate which is the
    date when the Request was first inserted (i.e when its New)
    Now whenever the agent acts upon the request from the front end
    the status change is logged in a RequestLog table.
    So when the agent changes the status to Open, an entry is logged into
    RequestLog table.
    So when the agent open the request an entry in the RequestLog table
    would go with the status as open , the reference of the requestId &
    the date on which the status is changed
    Similar entries will be logged for each request when the agent acts on
    the respective requests like if its Sold then the status will be sold,
    the date of sale & the corresponding request Id will be logged into the
    RequestLog table.
    In the Request table the status will be changed to "Open" or "Sold" but the
    requestDate will not change & it will remain the date when it was inserted
    Now I want to generate a Report which shows the list of all agents within a state
    with all total number of requests they have handled, how many are in Opened status,
    how many are in Sold status & how many are in Fail status. I also have to show the
    average time(in days) it took for each agent to Open the request, make the sale or qualify it
    as Fail. This average time I want it for an agent & not request specific.
    & In the end I have to show the grand total of all the requests handled by all the agents,
    grand total of opened status requests,grand total of Sold status requests,grand total of Fail status requests as well as the total average time it took to Open ,total average time it took to sale & total average time it takes to Fail
    I have dabbled with simple SQL but not a complex report type like above. So I would need help from all you experts.
    Here is what I plan to do
    my from clause would include the Agent, Request, RequestLog table
    where Request.requestdate between <fromDate> and <toDate>
    group by agent.agentname,
    Select would have count(agent.requestid),
    Now how do i show the list of Open requests, sold requests & fail requests in different columns since all these values are in the same column.
    Also I am aware of the average fnction but I need help on how to use the same in such a scenario.
    Do post your thoughts on the same.
    Regards

    Hi All
    I have made some queries to fetch the Report data. I would want you to post your comments on the same.
    This is my first query which returns the total count of request per dealer, how much are in open, sent & dead state & total per status.
    select AGENT.COMPANY_NAME,count(REQUEST.REQUEST_ID) TOTAL ,
    sum(decode(REQUEST.status,'Open',1,0)) OPEN,
    sum(decode(REQUEST.status,'Sent',1,0)) SENT,
    sum(decode(REQUEST.status,'Dead',1,0)) DEAD
    from AGENT, REQUEST
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y'
    and AGENT.DEALER_ID = REQUEST.DEALER_NUMBER
    group by grouping sets(AGENT.COMPANY_NAME, ())
    Then I have to retrieve the average number of days it takes to change the request to Open, average number of days it takes to change the request to Sent & average number of days it takes to change the request to Dead
    per Agent. The base date is stored in REQUEST table (request_date column) & the subsequent change of status is stored in activity_date column
    of ACTIVITY table
    Here is what I do get the average number of days it takes to change the status for the Agent
    select AGENT.COMPANY_NAME,
    avg( decode (REQUEST.status,'Open',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_OPEN,
    avg( decode (REQUEST.status,'Sent',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_SENT,
    avg( decode (REQUEST.status,'Dead',ACTIVITY.ACTIVITY_DATE - REQUEST.REQUEST_DATE,0)) AVG_DEAD
    from REQUEST, ACTIVITY, AGENT
    where
    AGENT.STATE='ACT'
    and REQUEST.REQUEST_TYPE='B'
    and REQUEST.CONFIRMATION='Y '
    and REQUEST.dealer_number = AGENT.DEALER_ID
    and REQUEST.STATUS = ACTIVITY.STATUS
    group by grouping sets(AGENT.COMPANY_NAME, ())
    I hope this is the right way for calculating average number of days
    Since most part of the queries is the same
    I tried to merge both the queries into one because I need to render the report in that fashion. But the moment I merge the query its giving absurd results.
    Do post your thoughts on the same
    Regards

  • SQL Query for members of dynamic group - Need to include Name, Path and Type

    Hello,
    I built a custom dynamic group that has all my SQL databases in it using SCOM 2012 SP1.  The group works fine as I can see the Name(ie, Database name), Health State, Path (ie, hostname/instance) and Types (ie; SQL 2005).  Now I'm trying to
    build a custom report based off this same information using a SQL query.   I'm no DBA and could use some help.  So far this is what i have
    use
    select
    SourceObjectDisplayName as
    'Group Name',
    TargetObjectDisplayName,TargetObjectPath
    from RelationshipGenericView
    where isDeleted=0
    AND SourceObjectDisplayName
    like
    'SQL_Databases_All'
    ORDERBY TargetObjectDisplayName
    This gets me the Group Name (which i really don't care about), database name, and hostname/instance. What I am missing is the Health State and most importantly the Type (ie, SQL Server 2005 DB, SQL Server 2008DB).
    If someone could assist me here I would appreciate it. I believe I need to do some type of INNER JOIN but have no idea where the SQL type info lives or the proper structure to use. Thanks
    OperationsManager

    Here's the updated Query for OpsMan 2012 R2:
    To find all members of a given group (change the group name below):
    select SourceObjectDisplayName as 'Group Name', TargetObjectDisplayName as 'Group Members' 
    from RelationshipGenericView 
    where isDeleted=0 
    AND SourceObjectDisplayName = 'Agent Managed Computer
    Group' 
    ORDER BY TargetObjectDisplayName

  • VO Auto Refresh error - Unsupported query for Continuous Query Notification

    I created a read only view object and set the auto refresh property to true. According to the documentation that was all that need to be done in order to enable auto-refresh for a view instance of a shared application module (which I am using to retrieve reference data). When I run a test, I get the following error:
    [371] DCBindingContainer.reportException :oracle.jbo.SQLStmtException
    [372] oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT
    CCIPO_REF_SENSITIVITY_LEVEL.SENSITIVITY_ID SENSITIVITY_ID,
    CCIPO_REF_SENSITIVITY_LEVEL.SENSITIVITY_DESC SENSITIVITY_DESC
    FROM
    CCIPO_REF_SENSITIVITY_LEVEL
         at oracle.jbo.server.BaseSQLBuilderImpl.processException(BaseSQLBuilderImpl.java:3721)
         at oracle.jbo.server.OracleSQLBuilderImpl.processException(OracleSQLBuilderImpl.java:4722)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1386)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:928)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:6968)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1183)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1037)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2774)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2751)
         at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1580)
         at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3500)
         at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:9943)
         at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:779)
         at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:679)
         at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:474)
         at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4437)
         at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:347)
         at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1605)
         at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:116)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:88)
         at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:71)
         at oracle.jbo.jbotester.form.BindingForm.createMasterPanel(BindingForm.java:63)
         at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:98)
         at oracle.jbo.jbotester.form.JTForm.<init>(JTForm.java:72)
         at oracle.jbo.jbotester.form.BindingForm.<init>(BindingForm.java:50)
         at oracle.jbo.jbotester.form.FormType$1.createForm(FormType.java:63)
         at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199)
         at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207)
         at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:140)
         at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:123)
         at oracle.jbo.jbotester.tree.Tree.processTreeMouseClicked(Tree.java:728)
         at oracle.jbo.jbotester.tree.Tree.access$100(Tree.java:96)
         at oracle.jbo.jbotester.tree.Tree$TreeMouseListener.mouseClicked(Tree.java:141)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
         at java.awt.Component.processMouseEvent(Component.java:6292)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: ORA-29983: Unsupported query for Continuous Query Notification
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1262)
         ... 65 more
    The query is selecting two varchar2 columns and according to the criteria in the documentation is valid to be registered for QRCN in Guaranteed Mode. Any thoughts?
    JDev version: JDeveloper 11.1.1.5.0.

    Well, could be a DB bug. I seem to remember that there was a bug in that area in an older version of 11g.
    Or you could use jnettrace to trace the calls made by the driver to the DB. That should show you what's going wrong.
    Sascha

  • Query for last four rows?

    please write query for get the last four rows from a table

    ratnakar wrote:
    please write query for get the last four rows from a tablelast 4 rows is indeterminate.
    rows in a table are like balls in a basket.
    which are last 4 balls in any basket?
    Handle:     ratnakar
    Email:     [email protected]
    Status Level:     Newbie
    Registered:     Aug 27, 2012
    Total Posts:     34
    Total Questions:     16 (11 unresolved)
    why so MANY unanswered questions?

  • How to find the cpu usage per query for a time period

    Hi All,
    Is there a way to find the cpu used per query for a given time period?
    DB:10.2.0.5
    OS:AIX
    Thanks

    user13364377 wrote:
    if there are multiple queries starting at the same time, then what to do?Handle:      user13364377
    Status Level:      Newbie (10)
    Registered:      Jul 5, 2010
    Total Posts:      264
    Total Questions:      113 (84 unresolved)
    why so many unanswered questions?
    clarify your question
    same SQL multiple times from different sessions?
    or
    different SQLs from different sessions?

  • Customer support html (html service) - how can i query for 'closed' SRs

    hi,
    11.5.10.2
    in customer support html (html service - CSZ), is there any facility to query for SRs that are in 'closed' status?
    currently, a SR in 'closed' status can only be queried if agent knows the exact SR number. on Advanced Search page, even though the application allows 'closed' status to be selected, it does not return any record.
    help is appreciated, as this is critical to our business.
    regards.

    You can search for Closed SRs. Ensure that the search criteria 'Active' is set to 'No'. This will return back closed SRs.
    Who is the customer? Can you provide some more details on the implementation? (you can send me an email to [email protected])
    Thanks.
    Edited by: dejoseph on Mar 31, 2010 12:00 PM

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • Error while creating a query for my custom infotype

    Hi,
    I have created a custom infotype with fields currency amount and currency field .
    While I am creating a query for it its giving an error
    Message no. AQ_AD_HOC221 Error when generating the report(see long text )
    I tried to execute the standard program RPUMS40CCI but still I am facing same error .
    I have also maintained table T777i for my infotype but still problem exists.
    Please help.
    P

    Hi
    Check in PM01

  • Error while executing a sql query for select

    HI All,
    ORA-01652: unable to extend temp segment by 128 in tablespace PSTEMP i'm getting this error while i'm executing the sql query for selecting the data.

    I am having 44GB of temp space, while executing the below query my temp space is getting full, Expert please let us know how the issue can be resolved..
    1. I dont want to increase the temp space
    2. I need to tune the query, please provide your recomendations.
    insert /*+APPEND*/ into CST_DSA.HIERARCHY_MISMATCHES
    (REPORT_NUM,REPORT_TYPE,REPORT_DESC,GAP,CARRIED_ITEMS,CARRIED_ITEM_TYPE,NO_OF_ROUTE_OF_CARRIED_ITEM,CARRIED_ITEM_ROUTE_NO,CARRIER_ITEMS,CARRIER_ITEM_TYPE,CARRIED_ITEM_PROTECTION_TYPE,SOURCE_SYSTEM)
    select
    REPORTNUMBER,REPORTTYPE,REPORTDESCRIPTION ,NULL,
    carried_items,carried_item_type,no_of_route_of_carried_item,carried_item_route_no,carrier_items,
    carrier_item_type,carried_item_protection_type,'PACS'
    from
    (select distinct
    c.REPORTNUMBER,c.REPORTTYPE,c.REPORTDESCRIPTION ,NULL,
    a.carried_items,a.carried_item_type,a.no_of_route_of_carried_item,a.carried_item_route_no,a.carrier_items,
    a.carrier_item_type,a.carried_item_protection_type,'PACS'
    from CST_ASIR.HIERARCHY_asir a,CST_DSA.M_PB_CIRCUIT_ROUTING b ,CST_DSA.REPORT_METADATA c
    where a.carrier_item_type in('Connection') and a.carried_item_type in('Service')
    AND a.carrier_items=b.mux
    and c.REPORTNUMBER=(case
    when a.carrier_item_type in ('ServicePackage','Service','Connection') then 10
    else 20
    end)
    and a.carrier_items not in (select carried_items from CST_ASIR.HIERARCHY_asir where carried_item_type in('Connection') ))A
    where not exists
    (select *
    from CST_DSA.HIERARCHY_MISMATCHES B where
    A.REPORTNUMBER=B.REPORT_NUM and
    A.REPORTTYPE=B.REPORT_TYPE and
    A.REPORTDESCRIPTION=B.REPORT_DESC and
    A.CARRIED_ITEMS=B.CARRIED_ITEMS and
    A.CARRIED_ITEM_TYPE=B.CARRIED_ITEM_TYPE and
    A.NO_OF_ROUTE_OF_CARRIED_ITEM=B.NO_OF_ROUTE_OF_CARRIED_ITEM and
    A.CARRIED_ITEM_ROUTE_NO=B.CARRIED_ITEM_ROUTE_NO and
    A.CARRIER_ITEMS=B.CARRIER_ITEMS and
    A.CARRIER_ITEM_TYPE=B.CARRIER_ITEM_TYPE and
    A.CARRIED_ITEM_PROTECTION_TYPE=B.CARRIED_ITEM_PROTECTION_TYPE
    AND B.SOURCE_SYSTEM='PACS'
    Explain Plan
    ==========
    Plan
    INSERT STATEMENT ALL_ROWSCost: 129 Bytes: 1,103 Cardinality: 1                                                        
         20 LOAD AS SELECT CST_DSA.HIERARCHY_MISMATCHES                                                   
              19 PX COORDINATOR                                              
                   18 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10002 :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                         
                        17 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1                                    
                             15 HASH JOIN RIGHT ANTI NA PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,098 Cardinality: 1                               
                                  4 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 63 Bytes: 359,283 Cardinality: 15,621                          
                                       3 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10001 :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                     
                                            2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621                
                                                 1 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621           
                                  14 NESTED LOOPS ANTI PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 40,256,600 Cardinality: 37,448                          
                                       11 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 6,366,160 Cardinality: 37,448                     
                                            8 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1002               
                                                 7 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 1 Bytes: 214 Cardinality: 2           
                                                      6 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000 Cost: 1 Bytes: 214 Cardinality: 2      
                                                           5 INDEX FULL SCAN INDEX CST_DSA.IDX$$_06EF0005 Cost: 1 Bytes: 214 Cardinality: 2
                                            10 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448                
                                                 9 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448           
                                       13 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT CST_DSA.HIERARCHY_MISMATCHES :Q1002Cost: 0 Bytes: 905 Cardinality: 1                     
                                            12 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT SYS.HIERARCHY_MISMATCHES_IDX3 :Q1002Cost: 0 Cardinality: 1                
                             16 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT CST_DSA.IDX$$_06EF0001 :Q1002Cost: 1 Bytes: 5 Cardinality: 1

  • Return Code - Query for Multiple Rows as XML

    Hi,
    I'm executing an MSSQL stored procedure through the "Query for Multiple Rows as XML" activity in LiveCycle ES. I do this through a call statement such as this:
    { call MyStoredProc(?) }
    This works great, the stored procedure always returns a record set (with or without records). I use this activity rather than "Call Stored Procedure" because I can transform the record set into XML right away within this activity. Unfortunately any exception arising from invoking this stored procedure cannot be handled within the workflow as this activity does not have an exception handler (lightning bolt). In an attempt to handle at least some exceptions we have decided to use try/catches within the stored procedures and return different error codes. Now the problem I am faced with is that there is no way to retrieve the returned code within any of the SQL activities. We don't want to have to write an execute script for each of these SQL calls. Is there any way to do this? Seems like I'm 95% there.
    Thanks
    Nic

    Thanks for the offer, unfortunately we would need something certified by Adobe.
    Nic

Maybe you are looking for