Sql query can be monitored?

Is there any way to monitor sql base query through performance monitor in scom both version 2007 and 2012?

Hi
if i am not wrong, you are looking to monitor the performace of SQL query.
you can you OLEDB templete to collect the performace data.
refer below link for more information
http://technet.microsoft.com/en-us/library/hh457575.aspx
http://blogs.technet.com/b/authormps/archive/2011/02/24/oledb-based-monitoring.aspx
Regards
sridhar v

Similar Messages

  • SQL query can be executed through TOAD but not through Discoverer

    Hallo, everybody:
    Got another problem. A SQL query can be executed through TOAD, but when I want to execute it by a worksheet of Discoverer Plus, it always shows there is no data.
    PS: I copied this query from Discoverer Plus to TOAD, which means, this query is generated through the Discoverer. Does anybody know about how could it be?
    Thank you.
    Geng

    Hi,
    If you are able to get data in TOAD with the same user credential as that of Discoverer Plus then it will implies an issue with Discoverer.
    Else it is privilege issue , your TOAD user has select privilege to the base objects (tables/views etc) where as your Disoverer used does not.
    Compare the privileges granted to these 2 users and you can narrow done to the issue .
    Thanks,
    Sutirtha

  • SQL query in SCOM monitor or rule

    Hello good people,
    im looking for a script so I can create monitor's. The monitor mustl query against the ops database.
    For example:
    SELECT ManagedEntityGenericView.DisplayName, ManagedEntityGenericView.AvailabilityLastModified
     FROM ManagedEntityGenericView
     INNER JOIN ManagedTypeView ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id
     WHERE (ManagedTypeView.Name = 'microsoft.systemCenter.agent') AND (ManagedEntityGenericView.IsAvailable = 0)
     ORDER BY ManagedEntityGenericView.DisplayName
    this query will display " grey agents"...so the script I need must alert on output...no output: is healthy, otherwise the output must be put in an alert....Ive seen different scripts but none of them is working or is giving the right result.
    Thx for reading this en hopefully you can provide me with a answer
    kind regards

    How should I adjust the following script si its suitable for my needs? the script works because its not generating any event id's but is not alerting also :-)
    Dim objCN, strConnection
    Set objCN = CreateObject("ADODB.Connection")
    Dim objAPI, oBag
    Set objAPI = CreateObject("MOM.ScriptAPI")
    Set oBag = objAPI.CreateTypedPropertyBag(StateDataType)
    strConnection = "Driver={SQL Server};Server=XXXXX;Database=XXXXX;Trusted_Connection=TRUE"
    objCN.Open strConnection
    Dim strSQLQuery
    strSQLQuery = "SELECT ManagedEntityGenericView.DisplayName, ManagedEntityGenericView.AvailabilityLastModified FROM ManagedEntityGenericView INNER JOIN ManagedTypeView ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id WHERE (ManagedTypeView.Name
    = 'microsoft.systemCenter.agent') AND (ManagedEntityGenericView.IsAvailable = 0) ORDER BY ManagedEntityGenericView.DisplayName"
    Dim objRS
    Set objRS=CreateObject("ADODB.Recordset")
    Set objRS = objCN.Execute(strSQLQuery)
    Do Until objRS.EOF 'WScript.Echo objRS.Fields("Expr1?)
    if objRS.Fields("Expr1?) = "SPECIFY TRIGGER FROM RESULT TO SET MONITOR in BAD State" then
    Call oBag.AddValue("State","BAD") Call oBag.AddValue("Custom1?,objRS.Fields("Expr1?)) Call objAPI.Return(oBag)
    else
    Call oBag.AddValue("State","GOOD") Call objAPI.Return(oBag)

  • Need SQL query - can anyone help

    have a table which contains
    Name StartDate EndDate Billable NonBillbale
    AAA 01-Jan-2007 31-Mar-2007 2 3
    AAA 01-Apr-2007 31-Jun-2007 4 6
    BBB 01-Jan-2007 31-Mar-2007 2 3
    I need to create a table from this table where the entry would be
    Name Jan2007Billable Jan2007NonBillable
    feb2007Billable Feb2007NonBillable Mar2007Billable Mar2007NonBillable
    April2007Billable April2007NonBillable May2007Billable May2007NonBillable Jun2007Billable Jun2007NonBillable
    AAA 2 3 2 3 2 3 4 6 4 6 4 6
    BBB 2 3 2 3 2 3
    I am very new to database programming... It will be highly appreciated if anyone help me to genrate the query

    This is called a PIVOT and you can see plenty of examples if you search this forum.
    An example would be...
    SQL> WITH t AS (select 'AAA' AS cust_name, to_date('01-jan-2007','dd-mon-yyyy') as StartDate, to_date('31-mar-2007','dd-mon-yyyy') EndDate, 2 as Billable, 3 as NonBillable from dual union all
      2             select 'AAA', to_date('01-apr-2007','dd-mon-yyyy'), to_date('30-jun-2007','dd-mon-yyyy'), 4, 6 from dual union all
      3             select 'BBB', to_date('01-jan-2007','dd-mon-yyyy'), to_date('31-mar-2007','dd-mon-yyyy'), 2, 3 from dual)
      4  -- END OF TEST DATA - "CUT HERE" --
      5  select cust_name
      6        ,sum(case when to_date('jan-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as jan2007_b
      7        ,sum(case when to_date('jan-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as jan2007_nb
      8        ,sum(case when to_date('feb-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as feb2007_b
      9        ,sum(case when to_date('feb-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as feb2007_nb
    10        ,sum(case when to_date('mar-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as mar2007_b
    11        ,sum(case when to_date('mar-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as mar2007_nb
    12        ,sum(case when to_date('apr-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as apr2007_b
    13        ,sum(case when to_date('apr-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as apr2007_nb
    14        ,sum(case when to_date('may-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as may2007_b
    15        ,sum(case when to_date('may-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as may2007_nb
    16        ,sum(case when to_date('jun-2007','mon-yyyy') between startdate and enddate then billable else 0 end) as jun2007_b
    17        ,sum(case when to_date('jun-2007','mon-yyyy') between startdate and enddate then nonbillable else 0 end) as jun2007_nb
    18  from t
    19  group by cust_name
    20  order by 1
    21  /
    CUS  JAN2007_B JAN2007_NB  FEB2007_B FEB2007_NB  MAR2007_B MAR2007_NB  APR2007_B APR2007_NB  MAY2007_B MAY2007_NB  JUN2007_B JUN2007_NB
    AAA          2          3          2          3          2          3          4          6          4          6          4          6
    BBB          2          3          2          3          2          3          0          0          0          0          0          0
    SQL>

  • SQL Query to show active alerts

    Hi, i want to build a ASP page that shows a gridview with the current alerts in scom so we can see them clearly.
    What SQL query can get me the current alerts that are showing on Monitoring - Active Alerts, where severity is Critical?
    I use System Center 2012 SP1
    I checked this post
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/898c6f62-9daf-493b-bfd9-193d1f42fc18/sql-query-to-view-current-active-alerts?forum=operationsmanagergeneral
    And this page:
    http://blogs.technet.com/b/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx
    But i can't see the correct query.
    I don't want to use Powershell as i want to display it properly in a formatted gridview.
    Thanks

    Hi,
    SELECT * FROM [OperationsManager].[dbo].[AlertView] where Severity = 2 and ResolutionState <> 255 and LanguageCode='ENU'
    I want to report on all severity levels, but I'd like to see Warning instead of 1, and Critical instead of 2 and so on. Am I missing a field somewhere?
    Jeffrey S. Patton Jeffrey S. Patton Systems Specialist, Enterprise Systems University of Kansas 1001 Sunnyside Ave. Lawrence, KS. 66045 (785) 864-0242 | http://patton-tech.com

  • Ssrs expression to sql query

    Hi,
    I am unable to convert the below ssrs expression to sql query. can you guys help.
    --          IIF(Parameters!parameter1.Value Is Nothing, 
    --               " 3>2 ", 
    --               "column1 NOT LIKE
    --                           Replace(IIF(Left(Parameters!parameter1.Value, 1) = "'", 
    --                                             Parameters!parameter1.Value, 
    --                                             "'" & Replace(Parameters!parameter1.Value, "'", "''")  "'"),
    Thanks.

    Thank you for your response Carnegie,
    I actually have two stored procedures as below. (columns and joined tables are excluded)
    I need to change the dates of @DateFrom and @DateTo parameter, I am passing @DateFrom_FD and @DateTo_LD as well.
    CREATE ROCEDURE [dbo].[Test]
    (@DateFrom
    SMALLDATETIME
      , @DateTo
    SMALLDATETIME
      , @program
    VARCHAR(MAX))
    AS
    DECLARE
    @DateFrom_FD
    SMALLDATETIME
           , @DateTo_LD
    SMALLDATETIME
    SET @DateFrom_FD = DATEADD(MONTH,DATEDIFF(MONTH,0,@DateFrom),0)
    SET @DateTo_LD = DATEADD(DAY,-1,DATEADD(MONTH,DATEDIFF(MONTH,0,@DateTo)+1,0)) 
    SELECT 
      DimDate.[Year]
    , DimDate.[Month]
    , DimDate.PK_Date
    , CustomerID
    FROM DimDate
    WHERE DimDate.PK_Date BETWEEN @DateFrom_FD AND @DateTo_LD
    Now I am using one of the SP as a main report and the other SP as a subreport.
    In order to configure the main report and the subreport, I believe that I need to link them with parameters.
    However, in the parameters of subreport properties, the option given are only @DateFrom and @DateTo.
    No @DateFrom_FD AND @DateTo_LD
    Therefore, I am thinking to use expressions to convert @DateFrom and @DateTo the same way I did in SQL.
    I am not sure if this works....but this is the only thing that I could think of.
    Thank you,
    YJB5151

  • Changing Column Value Style using SQL Query

    Hi,
    I'm trying to build a fantasy basketball game with APEX. I have a table that has a list of games. I need to change the color of the column value i.e. the name of the team that wins according to a SQL query Here's an example:
    TABLE NAME: LATESTGAMES
    Home Away Homepoints Awaypoints
    Boston Cleveland 105 101
    Toronto Washington 122 83
    What I want to do is display the winning team i.e. Boston and Toronto in Green since that's the team that won.
    The SQL query is:
    SELECT HOME,
    AWAY,
    HOMEPOINTS,
    AWAYPOINTS
    from LATESTGAMES;
    What do I need to do in order to display the Winning Team as Green on every column? Please Help

    Hello Devilfish,
    I did something like that in my DG Tournament application (http://www.dgtournament.com)
    Your SQL query can look like this:
    SELECT CASE
              WHEN (homepoints > awaypoints)
                 THEN '<span style="color:green;">' || home || '</span>'
              ELSE home
           END AS home,
    SELECT CASE
              WHEN (awaypoints > homepoints)
                 THEN '<span style="color:green;">' || away|| '</span>'
              ELSE away
           END AS away,
    HOMEPOINTS,
    AWAYPOINTS
    from LATESTGAMES;Hope that gives you an idea,
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

  • Storing data filters to construct a SQL query

    Hi, this is the picture:
    I have list or table of data object, they are shown in more detail in another panel as an action occurs (mouse / keys). The objects of that list or table are fetch from a db. What I would like to do is create some user based filters of many fields to the fetch data and also store the filters so other users may use them. To add some more complexity I would also like to be able to group various filters.
    The approaches that I am thinking about would be to store a hash table<db Filed, Criteria> for each filter (a filter may have many criterias). Based on the hashtable a SQL Query can be build.
    To join or group various filters I would use union/except or sub queries (have not decided).
    This brings me to ask for some advise, is their any patterns or libs for this and if someone else has done something similar and would like to share his approaches or logic they will be very welcomed.
    Thanks
    Billy

    Hi Billy,
    I have come across a similar scenario.
    I need to develop a way to store, retrieve and use user defined filter criteria.
    I see that you were developing a similar design in March this year.
    Can you please let me know how did you do it.
    Thanks,
    Chetan Jindal.

  • Monitoring OBI EE SQL query session in TOAD.

    Hi,
    I thought I would be able to monitor the SQL session based on an OBI EE Answers query in Toad. The query is running for a while but the session is not shown in Toad. I am sure that SQL queries run by other tools like Oracle Reports/Discoverer can be monitored in TOAD.
    If there is any other tool to monitor the OBI EE query sessions, could you please let me know?
    Thanks,
    Manoj.

    You should be able to see the session - select * from gv$session where program like 'nq%' and status = 'ACTIVE';
    But you're better off changing your loglevel in obiee if necessary and checking the query log to see which queries are taking the time (could be many physical queries for one analytics request). It's also possible that the 'query' had already fetched all the data from the database but work was being performed on the BI Server to join information and so the database session was no longer active.

  • SQL query to get the monitor target on a monitor

    Hi!
    I have a list of some custom created Monitors. I need a list of which computers that are using the monitors, the "Monitor target". Please help me with this. It need to be a SQL Query because my powershell have stopped working.

    Yes that is what i have explained you with the screenshot right it is the one in your screen shot also which is mentioned as (This). If this is a default group then you will not get agents for that refer the below link on how to pull agent list of the Target
    group
    http://msdn.microsoft.com/en-us/library/bb960484.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
    Or look at this. You can see what groups the agents are associated manually one by one by using the default SCOM Task.
    Go to Administration==> Agent managed==> Select the agent ==> Right click it and click View ==> Select state view.
    Once you select this you will have another window opened for that particular agent.
    Then click on the name of the agent and on the right hand side bottom you will have a default made task to check to what group's or Targets this agent is associated to. Run that task and you will get the output.
    Look at the ones highlighted in RED
    Below is the screenshot for your reference. Hope this helps
    Gautam.75801

  • [SQL QUERY] Select TCP Port Monitors and their related Watcher Node

    Hi everybody,
    I'm working on a SSRS report and SQL Query, I have no problem to find all my TCP Port Monitor (SCOM 2012 R2) based on the DisplayName, but I can't figure out how to get their related watcher nodes (in my case only 1 computer is a watcher node).
    I can't find which table, which field, contains this information..?
    Here is the query i started to write (i select * since i still searching for the right column):
    SELECT
    FROM StateView s
    INNER JOIN BaseManagedEntity me on me.BaseManagedEntityId=s.BaseManagedEntityId
    INNER JOIN MonitorView mv on mv.Id=s.MonitorId
    INNER JOIN ManagedTypeView mtv on mtv.Id=s.TargetManagedEntityType
    --where mv.DisplayName like 'Ping Target Status Check%'
    AND me.IsDeleted = '0'
    where mv.DisplayName like '%tcpmon%'
    and mv.LanguageCode = 'ENU'
    --and s.HealthState in (@state)
    ORDER BY s.Lastmodified DESC
    It would be great if someone can help me !
    Thanks,
    Julien

    Hi,
    After creating a TCP port monitor, we can find a table for this monitor under operationsmanager database :
    SELECT *
    FROM [OperationsManager].[dbo].[MT_TCPPortCheck_******WatcherComputersGroup]
    You will find the warcher computer group.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Can we use session variables in BI publisher's Data Model SQL Query?

    Hi Experts,
    We need to implement Data level security in BI Publisher 11g.
    In OBIEE we do so by using session variables, so just wanted to ask if we can use the same session variables in BI Publisher as well
    ie can we include the where clause in the Data Models SQL Query like
    Where ORG_ID = @{biServer.variables['NQ_SESSION.INV_ORG']}
    Let me know your views on this.
    PS: We are implementing EBS r12 security in BI Publisher.
    Thanks

    Read this -> OBIEE 11g: Error: "[nQSError: 23006] The session variable, NQ_SESSION.LAN_INT, has no value definition." when Creating a SQL Query using the session variable NQ_SESSION.LAN_INT in BI Publisher [ID 1511676.1]
    Follow the ER - BUG:13607750 - NEED TO BE ABLE TO SET A SESSION VARIABLE IN OBIEE AND USE IT IN BI PUBLISHER
    HTH,
    SVS

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • How can I show all the results returned by a sql query?

    Hi guys,
    I need your help.
    Let's say I have one table: TableA. Fields of TableA are aleg, anon, apes. The following sentence can return, in general, several rows: select anon from TableA where aleg = somevalue. I'd like to show the result of column anon but no luck. If I try to show the results in a TextArea and the origin is an sql query only shows the first row value. I tried Show as: show as text (based in PLSQL) and coding an anonymous plsql block as
    DECLARE
    v_anon TableA.anon%TYPE;
    CURSOR v_cur IS
         select anon from TableA where aleg = somevalue;
    BEGIN
    OPEN v_cur;
    LOOP
    FETCH v_cur INTO v_anon;
    EXIT WHEN v_cur%NOTFOUND;
    :FIELD_IN_FORM := v_anon;
    END LOOP;
    CLOSE v_cur;
    END;
    but in this case it's not shown any result.
    So the first question is what kind of field should I use to show the result. And the second one is what can I do to being able to show all the results returned by the query (provided that is more than one single row).
    regards

    Hi Denes,
    Just starting with apex. I think I know how to show the results in a report region. I've simplified the posted question.
    A more detailed question would be: Suppose you have a region where you have put several text areas to accommodate the result of a multi-column query (lets say for TableA) that only returns one row, each column value returned put in a different text area. Also you want to show the values of other fields in TableB that depends on some value just retrieved from TableA and that you want all values retrieved (from TableA and the linked TableB) to be show in the same region. Is that possible? If yes, how?
    Thank you in advance

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

Maybe you are looking for

  • S_ALR_87012089-Display changes to Vendor:does not show details of change

    Hi Experts, S_ALR_87012089 report displays the changes to vendor master. However in ECC 6.0, the same report is not displaying the details of the change ('old' and 'new' ) value, wheras it was in 4.6 C. Now in ECC 6.0 it just says whether 'Created' /

  • Changing document size ?

    How can I change the size of my page in Illustrator? I'm working with a PDF. I've followed the directions here: http://help.adobe.com/en_US/Illustrator/14.0/WS714a382cdf7d304e7e07d0100196cbc5f-64bea.htm l They say to go to the print menu and do it th

  • Asset Balances not matching with G.L accounts

    hi, we some issue in asset accounting, the asset balances is not matching with g.l accounts, there are some amount which is updated in asset but it is not updated in G.Laccounts, how to match the asset balances with g.l accounts , when i run the ABST

  • G3 Hard drive problems

    This is a G3 Dual USB 500mhz iBook running Tiger. The problem started with "localised string not found" in Safari. I thought I'd restart the iBook to see if that helped, but I just got the flashing question mark and no restart. I tried putting in the

  • Music playing, just not listed in interface

    I'm experiencing a slight problem. I can play my music just fine, but for some strange reason the music files aren't showing up in the list. Clicking around between playlists or some such doesn't help! Can someone help me!?