在报告中显示 Cube 的最后处理时间

发布于 2024-12-21 19:17:52 字数 163 浏览 3 评论 0原文

有什么方法可以显示上次在报表中处理多维数据集或维度的时间(我正在使用报表生成器)?

我尝试通过开始创建一个名为 LastProcessTime 的表,其中包含“Type”和“DateTimeProcessed”字段,并且我可以插入到该表中,但我不知道如何启动插入。也许有一种完全不同的方法。谢谢。

Is there any way to show the last time a Cube or a Dimension was last processed in a Report (I'm using Report Builder)?

I attempted this by starting off creating a table called LastProcessTime with the fields "Type", and "DateTimeProcessed", and I could Insert into this table, but I do not know how I would initiate the Insert. Perhaps there is an entirely different approach. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

恏ㄋ傷疤忘ㄋ疼 2024-12-28 19:17:52

不确定您是否可以将其添加到报告生成器中,但尝试标准 MDX 报告,并使用 SSAS DMV(动态管理视图):

http://dwbi1.wordpress.com/2010/01/01/ssas-dmv-dynamic-management-view/

在 MDX 查询窗口中针对多维数据集运行此命令(我知道,它看起来确实像 TSQL):

SELECT * FROM $system.mdschema_cubes

应该为您提供所需的内容吗?

Not sure you could add this into report builder, but try a standard MDX report, and use the SSAS DMVs (Dynamic Management Views):

http://dwbi1.wordpress.com/2010/01/01/ssas-dmv-dynamic-management-view/

Run this in an MDX query window against a cube (I know, it does look like TSQL):

SELECT * FROM $system.mdschema_cubes

Should give you what you need?

野の 2024-12-28 19:17:52

我知道有点晚了 - 但您可以在 SSAS 中使用自定义存储过程通过普通成员公开此信息

with 
     member [Measures].[LastProcessed] as ASSP.GetCubeLastProcessedDate()
select 
     [Measures].[LastProcessed] on 0
from [Your Cube]

这些信息可从 CodePex:分析服务存储过程项目

/*============================================================================
  File:    CubeInfo.cs

  Summary: Implements a function which returns the date when the current cube
           was last processed.

  Date:    July 12, 2006

  ----------------------------------------------------------------------------
  This file is part of the Analysis Services Stored Procedure Project.
  http://www.codeplex.com/Wiki/View.aspx?ProjectName=ASStoredProcedures

  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.
===========================

=================================================*/

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;
using Microsoft.AnalysisServices; //reference to AMO

namespace ASStoredProcs
{
    public class CubeInfo
    {
        //the assembly must be registered with unrestricted permissions for this function to succeed
        [SafeToPrepare(true)]
        public static DateTime GetCubeLastProcessedDate()
        {
            string sServerName = Context.CurrentServerID;
            string sDatabaseName = Context.CurrentDatabaseName;
            string sCubeName = AMOHelpers.GetCurrentCubeName();

            DateTime dtTemp = DateTime.MinValue;
            Exception exDelegate = null;

            System.Threading.Thread td = new System.Threading.Thread(delegate() 
            {
                try
                {
                    Microsoft.AnalysisServices.Server oServer = new Microsoft.AnalysisServices.Server();
                    oServer.Connect("Data Source=" + sServerName);
                    Database db = oServer.Databases.GetByName(sDatabaseName);
                    Cube cube =  db.Cubes.FindByName(sCubeName);

                    dtTemp = cube.LastProcessed;
                }
                catch (Exception ex)
                {
                    exDelegate = ex;
                }
            }
            );
            td.Start(); //run the delegate code
            while (!td.Join(1000)) //wait for up to a second for the delegate to finish
            {
                Context.CheckCancelled(); //if the delegate isn't done, check whether the parent query has been cancelled. If the parent query has been cancelled (or the ForceCommitTimeout expires) then this will immediately exit
            }

            if (exDelegate != null) throw exDelegate;

            return dtTemp;
            //return Context.CurrentCube.LastProcessed; //this doesn't work because of a bug: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124606
        }
.
.
.

Bit late I know - but you can use custom stored procedures in SSAS to expose this info via normal members

with 
     member [Measures].[LastProcessed] as ASSP.GetCubeLastProcessedDate()
select 
     [Measures].[LastProcessed] on 0
from [Your Cube]

These are available from CodePex : Analysis Services Stored Procedure Project,

/*============================================================================
  File:    CubeInfo.cs

  Summary: Implements a function which returns the date when the current cube
           was last processed.

  Date:    July 12, 2006

  ----------------------------------------------------------------------------
  This file is part of the Analysis Services Stored Procedure Project.
  http://www.codeplex.com/Wiki/View.aspx?ProjectName=ASStoredProcedures

  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.
===========================

=================================================*/

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;
using Microsoft.AnalysisServices; //reference to AMO

namespace ASStoredProcs
{
    public class CubeInfo
    {
        //the assembly must be registered with unrestricted permissions for this function to succeed
        [SafeToPrepare(true)]
        public static DateTime GetCubeLastProcessedDate()
        {
            string sServerName = Context.CurrentServerID;
            string sDatabaseName = Context.CurrentDatabaseName;
            string sCubeName = AMOHelpers.GetCurrentCubeName();

            DateTime dtTemp = DateTime.MinValue;
            Exception exDelegate = null;

            System.Threading.Thread td = new System.Threading.Thread(delegate() 
            {
                try
                {
                    Microsoft.AnalysisServices.Server oServer = new Microsoft.AnalysisServices.Server();
                    oServer.Connect("Data Source=" + sServerName);
                    Database db = oServer.Databases.GetByName(sDatabaseName);
                    Cube cube =  db.Cubes.FindByName(sCubeName);

                    dtTemp = cube.LastProcessed;
                }
                catch (Exception ex)
                {
                    exDelegate = ex;
                }
            }
            );
            td.Start(); //run the delegate code
            while (!td.Join(1000)) //wait for up to a second for the delegate to finish
            {
                Context.CheckCancelled(); //if the delegate isn't done, check whether the parent query has been cancelled. If the parent query has been cancelled (or the ForceCommitTimeout expires) then this will immediately exit
            }

            if (exDelegate != null) throw exDelegate;

            return dtTemp;
            //return Context.CurrentCube.LastProcessed; //this doesn't work because of a bug: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124606
        }
.
.
.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文