OEM reports using SQL queries

Hi
I'm working in oracle 9i
Aix 5.3
I dont have oem access. How ever, I would like to generate reports using queries for the following.
1. Response time overview - per statement execution response times and response time break down.
2. wait analysis overview
3. CPU Overview - stats that can pin point cpu usage areas.
4. TOP i/o's - at session level/ statement level.
I would appriciate queries/URLs
/Raj

Again what limitation? Afraid to ask the password? Do not know how to override the password?
Other than that: if some people don't want to tell you the perfstat password (maybe for valid reasons), do you think they will be happy when you start running your own queries against the v$ views (often quite expensive)
or do you think you will gain more by cooperate with them. Other than that: if you want to run your own v$ queries why do you outsource writing them to this forum?
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • SAP Crystal Report using SQL Server Authentication and Windows Authenticati

    I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
    my ingredients are
    1.windows 7 ultimate service pack1
    2.sql server 2008 standard edition
    3.visual studio 2010 pro
    4.SAP Crystal Report, version for visual studio.net
    I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
    Then, my ASP.NET files as following
    //ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
        </div>
        </form>
    </body>
    </html>
    //code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class viewCustomersByCity : System.Web.UI.Page
        private const string PARAMETER_FIELD_NAME = "city";   
        private ReportDocument customersByCityReport;
        private void ConfigureCrystalReports()
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.ServerName = @"WKM1925-PCWKM1925";
            connectionInfo.DatabaseName = "Northwind";
            connectionInfo.UserID = "sa";
            connectionInfo.Password = "sysadmin25";
            SetDBLogonForReport(connectionInfo);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
            TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
                tableLogOnInfo.ConnectionInfo = connectionInfo;
        private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
            ParameterValues currentParameterValues = new ParameterValues();
            foreach (object submittedValue in arrayList)
                ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                parameterDiscreteValue.Value = submittedValue.ToString();
                currentParameterValues.Add(parameterDiscreteValue);
            ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
            ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
        protected void Page_Load(object sender, EventArgs e)
            customersByCityReport = new ReportDocument();
            string reportPath = Server.MapPath("customersByCity.rpt");
            customersByCityReport.Load(reportPath);
            ConfigureCrystalReports();
            ArrayList arrayList = new ArrayList();
            arrayList.Add("paris");
            arrayList.Add("Madrid");
            arrayList.Add("Marseille");
            arrayList.Add("Buenos Aires");
            arrayList.Add("Sao Paulo");
            ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
            SetCurrentValuesForParameterField(customersByCityReport, arrayList);
            CrystalReportViewer1.ReportSource = customersByCityReport;
    1st scenario
    When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
    2nd scenario
    I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
    When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
    Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
    I'm looking for comment. Please help me

    Hello,
    MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
    Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
    The try again, if it still fails search, lots of sample log on code in this forum.
    Don

  • Create statspack report using sql*developer

    Hello,
    While connecting with PERFSTAT user I can not create statspack report using SQL*Developer:
    @?/rdbms/admin/awrrpt
    Error starting at line 1 in command:
    @?/rdbms/admin/awrrpt
    Error report:
    Unable to open file: "?/rdbms/admin/awrrpt.sql"
    Actually, my problem or question is that how can PERFSTAT user can generate statspack reports from a Client side. What is the other way a non-dba can see the snapshots histroy and generate report (by using perfstat user ) while joing tables or using views?
    Thanks a lot.
    Best Regards

    Hi,
    for awr reports @?/rdbms/admin/awrrpt (you need EE+Diagnostic Pack) there is a solution.
    Grant execute dbms_workload_repository to <user>;
    Grant select_catalog_role to <user>;
    get all SNAP_IDs
    SELECT   TO_CHAR(s.startup_time,'YYYY.MM.DD HH24:MI:SS') INSTART_FMT,
             di.instance_name INST_NAME,
             di.db_name DB_NAME,
             s.snap_id SNAP_ID,
             TO_CHAR(s.end_interval_time,'YYYY.MM.DD HH24:MI:SS') SNAPDAT,
             s.snap_level LVL
    FROM    dba_hist_snapshot s,
             dba_hist_database_instance di
    WHERE   di.dbid = s.dbid
             AND di.instance_number = s.instance_number
             AND Di.Startup_Time = S.Startup_Time
    ORDER BY snap_id desc;
    Select * From Table(Sys.Dbms_Workload_Repository.Awr_Report_Html(DBID, 1, BEGIN_SNAP_ID, END_SNAP_ID));
    For statspack i don't know a solutuion. I think the best idea is, create a job to make the statspack report on the server side and access it via external tables or mail them forward to you.
    Best regards
    Thomas

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • How to Custom Report using sql server report builder for SCCM 2012 SP1

    Hi ,
    I am new to database, if i want to create a manual report using sql server report builder for SCCM 2012 SP1, what step should i take.
    i want to create a report in which computer name, total disk space, physical disk serial no come together. i already added class (physical disk serial no.) in hardware inventory classes. refer snapshot

    Hi,
    Here is a guide on how to create custom reports in Configuration Manager 2012, it is a great place to start, change to the data you want to display instead.
    http://sccmgeekdiary.wordpress.com/2012/10/29/sccm-2012-reporting-for-dummies-creating-your-own-ssrs-reports/
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Date parameter does not work in SharePoint 2010 report using SQL 2008 Server Reporting Service

    Here is the settings:
    SharePoint 2010 with SQL server 2008 reporting services configured
    When create a report for a SP list using SQL server report builder (3.0) the date parameter does not work.
    The data parameter is set as "date and time" type and field name equals the col name in the SP list
    When run the report, the whatever dates I select, the result is always the same, so the parameters do not take any effect.
    Is any step missing?
    Thanks for any advice !

    Hi ,
    How did you configure you "date and time" type parameter and field name equals the col name in the SP list?
    Have you tested if other type parameter worked?
    Have you tried typing the date format as 20140722 in your date parameter filed before run the report?
    http://whitepages.unlimitedviz.com/2012/02/using-sharepoint-filters-with-reporting-services-parameters-for-personalized-reports/
    Thanks,
    Daniel Yang
    Forum Support
    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]
    Daniel Yang
    TechNet Community Support

  • Sysql - use SQL queries against output of linux commands

    Hello!
    Many linux commands have table-like output. Sometimes it is better to analyze such output as a real table in relational database. I have published prototype of utility that parses output of one or several linux commands, saves it in database and allows to make SQL queries to that data. Program is written on python and uses sqlite database engine.
    sysql at AUR
    sysql at Github
    Here is why I wrote it:
    * No need to remember command syntax to format command output - just select necessary fields in SQL query
    * No need to know sed, awk, head, join and other linux commands to manipulate with output - it's all SQLite
    * Table data is stored with meaningful column name and type (int, text, float, datetime etc)
    * All power of SQL can be used to query output (JOIN, WHERE, GROUP BY etc.)
    * To support new command, output parser must be developed only once and then can be shared with community to make life easier
    * All supported commands are kept in one place as set of python files, so it is easy to find out how to customize existing parsers or create new ones
    This is my first community contribution, so kindly ask everyone to share your opinions and advices on what can be done better. Thank you!
    Examples:
    Display help and list of available commands:
    sysql
    Display output of ps command:
    sysql ps
    Query output of lsblk command:
    sysql -q "SELECT device,uuid,filesystem FROM lsblk" lsblk
    Query output of several commands:
    sysql -q "SELECT ps.pid, ps.command, ps.elapsed_time, lsof.name FROM ps JOIN lsof ON ps.pid = lsof.pid WHERE name LIKE '%LISTEN%'" ps -e --- lsof -Pni4

    I am not sure, if I will ever use it, but I do think, this is an _amazing_ idea!
    You may consider something like a global repository for output parsers accessable directly via sysql.
    Last edited by myname (2013-11-24 09:16:59)

  • Using SQL queries via ODBC connection to obtain data for a report

    Post Author: adhiann
    CA Forum: General
    Hi All,
    I was trying to run a Crystal Reports report through Clearquest using an SQL query I designed in CQ to give me the data I need, however, from within ClearQuest, I cannot associate an SQL query on a report, so I went directly to Crystal Reports and am using the ODBC connection to the ClearQuest database to run the report. I selected the right tables and fields and am using the same formula that I used on ClearQuest's SQL query to get the data, however, the report doesn't return any data whereas I am getting at least 5 records from Clearquest for the same query.
    Granted there's a difference in the way you create a SQL formula in Crystal, but I don't know if I'm doing it right as I've never had to use CR as a standalone product.
    Is there a way I can directly plug my ClearQuest's SQL query into the CR and run it? I don't know why the results won't return any data for a query that has some results
    Thanks in advance
    nandita

    Post Author: Roscoe1822
    CA Forum: General
    Did you try to add a command through the Database Expert? Also creating a Business View that contains your sql query might help as well.

  • Using Sql Queries in OBIEE Reports

    Hi all,
    I need to use direct sql query in report function column.. How can I implement that.
    For example
    Our report name is /shared/Automotive/Vehicle Services/Most Serviced Vehicle Models
    we have to eliminate /shared/Automotive/Vehicle Services/ part from above report name.. I have done this in sql using the Query SUBSTR(COL,INSTR(COL,'/',1,4)+1).
    So kindly help how to implement above sql query in Obiee.. Urgent.
    Thanx in advance

    If "Report Name" is a column then you can simply create a custom formual and apply the substring logic to it to get at the single report name instead of the full path.
    Otherwise this logic can easily be accomplished within the RPD via a logic column expression.

  • SQL Monitoring using SQL Queries

    Hi
    I am using Oracle 10 g DB. I have an application which has Oracle as DB. Its a multiuser application. During the testing of one of the page we found that saving couple of records takes huge time (50-60 seconds). I dont have access to the logic written in application code to know which all queries gets executed when user click on save button.
    I know that there is SQL Monitoring available in OEM why which you can find out the queries which got executed and also the execution time for those queries.
    However I dont have OEM access.
    Can you please let me know teh set of queries which probably will use few of teh V$ data dictionary views and provide me the same details as generated in the Monitoting report generated by OEM ?
    I want to see all the queries which got executed in last defined time (say 10 mins, 1 hr etc) , same way as it is done in OEM and not just the last sql.
    TIA
    Regards
    Arun

    Hi,
    I recommend you to install STATSPACK - it's a free tool that can be used instead of the Automatic Workload Repository (that is used in OEM).
    This tool creates snapshots of V$ views in defined time period, so it enables you to see long runing queries in history.
    If I were you I would run SQL trace just before the problematic part and then stop it just as it has finished. It would be better to run trace only for the problematic session or module - not for the whole database. SQL trace generates a file with all the executed queries, explain plans, stats, ...
    In extreme case just create copy of v$sql before and after the problematic part and compare them (new sql_id, elapsed_time delta, ...)

  • Changing font color in a report using SQL query for APEX 5.0

    Hello,
    I am testing APEX 5.0 in my testing environment to see if I can migrate my internal apps from 4.2 to 5.0.
    How can I change the font color in a field based in the SQL query? I know how to do it in 4.2 but I can't find the same in 5.0.
    Thanks,

    Well, I used to put the html tags in the select as text getting the color value depending a CASE , then I had to change the Display attribute for the column in the report as "Display as text (espace special characters...)".
    I found an old post here: https://tylermuth.wordpress.com/2007/12/01/conditional-column-formatting-in-apex/ and  this method still worked for me in APEX 5.0
    Thanks anyways

  • Report Builder SQL Queries - Convert CN to clear text

    I am trying to customize a query in Report Builder to message values as they are delivered, and running into value expression errors.
    My query returns data from the AD Computer Object "managedBy" field. The problem is that this field returns data in the format of:
    CN=Security Group Name,OU=blah,OU=blah,DC=stuff,DC=com etc
    I am trying to get it to return just the "Security Group" value which is much more useful. I found this great article which almost works for me: https://social.technet.microsoft.com/forums/systemcenter/en-US/6610d238-72f2-4e75-a0cc-e1383dd8e94b/ad-system-discovery-convert-cn-to-clear-text
    However, once I try to save the report in Report Builder I get:
    System.Web.Services.Protocols.SoapException: The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified
    dataset scope. Letters in the names of fields must use the correct case.
    This is the original SQL query:
    select  all SMS_R_System.Name0,SMS_R_System.managedBy0,SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System
    INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
    My edited query:
    select  all SMS_R_System.Name0,REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',','),SMS_R_System.description0,SMS_G_System_OPERATING_SYSTEM.Caption00,SMS_R_System.Resource_Domain_OR_Workgr0,SMS_R_System.whenCreated0,SMS_R_System.Last_Logon_Timestamp0
    from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey  INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID
    = SMS_R_System.ItemKey
    Thoughts?

    Hey,
    Since you manipulate the original value of
    ManagedBy0 in your SELECT, the column name will change to
    (No column name). I did a test on my side and look what I get.
    Error : "The Value expression for the text box ‘managedBy0’ refers to the field ‘managedBy0’."
    He search for a variable
    ManagedBy0 in your query but don't find any because there's no name assigned.
    Try to run this query. Add
    AS ManagedBy0 after your REPLACE. 
    select all
    SMS_R_System.Name0,
    REPLACE(SUBSTRING(SMS_R_System.managedBy0,4,CHARINDEX(',OU',SMS_R_System.managedBy0,3)-4),'\,',',') AS ManagedBy0,
    SMS_R_System.description0,
    SMS_G_System_OPERATING_SYSTEM.Caption00,
    SMS_R_System.Resource_Domain_OR_Workgr0,
    SMS_R_System.whenCreated0,
    SMS_R_System.Last_Logon_Timestamp0 from vSMS_R_System AS SMS_R_System INNER JOIN Operating_System_DATA AS SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.MachineID = SMS_R_System.ItemKey INNER JOIN _RES_COLL_CAS000A9 AS SMS_CM_RES_COLL_CAS000A9 ON SMS_CM_RES_COLL_CAS000A9.MachineID = SMS_R_System.ItemKey
    Let me know.
    Nick Pilon | Blog : System Center Dudes

  • Generate dynamic reports using sql query and send via mail

    Can anyone provide me the links to dynamically generate the sql query based reports and send it to Mail. it should be called from the scheduler program using PL/SQL

    suppose you have the query as
    spool myrep.txt
    select * from emp where rowid<3;
    spool off
    write the query in the emp.sql query at any directory like d:\sqljobs\emp.sql
    the call make a batch file like sndml.bat and write the following codes
    sqlplus scott/tiger@orcl @d:\sqljobs\emp.sql
    explorer mailto:[email protected] d"\sqljobs\myrep.txt
    or if you are using any mailing software then you can use that..

  • How to create YTD and MTD reports using Sql Server 2008 r2 report builder 3.0

    Hi All,
    How can I create YTD report from the below data. please help me
    ProdA     ProdB     ProdC     Month     Year
    10       50        40          January      2012
    Data for full Year i.e. from Jan - December 2012
    50       90       100        January       2013
    Data for full Year i.e. from Jan - December 2013
    90       40         30        January        2014
    Data for full Year i.e. from Jan - Till Date 2014
    MercuryMan

    You can use a correlated subquery to calculate YTD in query behind. You can use APPLY operator for that
    so something like
    SELECT *
    FROM Table t1
    CROSS APPLY (SELECT SUM(ProdA) AS TotA,SM(prodB) AS TotB,SUM(prodC) AS TotC
    FROM Table
    WHERE Year = t.Year)t1
    And show TotA,TotB and TotC in the required total row
    Another method is to add required totals in SSRS by clicking on relevant group and choosing Add Total option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Retrieve Software metering from SCCM 2007 Database using SQL Queries

    Good Morning All,
    Can anybody shed any light on querying the SQL DB for Software metering from SCCM using a machine name. I am basically looking for the table names etc?
    Thanks
    Craig

    Hi,
    They are documented here:
    http://technet.microsoft.com/en-us/library/dd334612.aspx
    Regards,
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

Maybe you are looking for