2011-12-19 5 views
4

큐브 또는 차원을 보고서에서 마지막으로 처리 한 마지막 시간을 표시하는 방법이 있습니까 (보고서 작성기를 사용하고 있습니까?).큐브의 마지막 프로세스 시간을 보고서에 표시합니다.

"Type"및 "DateTimeProcessed"필드가 포함 된 LastProcessTime 테이블 만들기를 시작하여이 테이블에 삽입 할 수 있었지만 삽입을 시작하는 방법을 모르겠습니다. 아마도 완전히 다른 접근 방식이있을 것입니다. 감사.

답변

7

확실하지 당신은 SSAS DMV에 (동적 관리 뷰)를 보고서 빌더에이를 추가 할 수 있지만 표준 MDX 보고서를 시도하고 사용할 수 있습니다

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

실행이에 대한 MDX 쿼리 창에서 큐브 (나는 TSQL처럼 보입니다) :

SELECT * FROM $system.mdschema_cubes 

필요한 것을 제공해야합니까?

+1

을이 정보를 노출 SSAS에서 저장 프로 시저를 사용할 수 있습니다, 그 쿼리를 실행 직접 분석 서버에 저장하면 전체 스키마 업데이트 목록이 반환됩니다. 정확히 내가 필요로하는 것. 감사. – Dave

2

비트 늦게 내가 알고있는 -하지만 당신은 사용자 정의 예, 일반 회원

다음은 CodePex : Analysis Services Stored Procedure Project에서 사용할 수 있습니다
with 
    member [Measures].[LastProcessed] as ASSP.GetCubeLastProcessedDate() 
select 
    [Measures].[LastProcessed] on 0 
from [Your Cube] 

를 통해

/*============================================================================ 
    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 
     } 
. 
. 
. 
관련 문제