如何查看SSAS多维数据集为何无法刷新表

问题描述

我们有一个表格模型多维数据集,它每天通过调用SSAS命令的SQL代理作业进行刷新。命令很简单:

{ “刷新”:{ “ type”:“ full”, “对象”:[ { “数据库”:“ KPIDashboardv1” } ] } }

该工作每天运行并成功。但是我注意到多维数据集中的某些表没有刷新。 select * from $ system.TMSCHEMA_partitions显示这些表,其刷新时间为几周前。

在尝试处理这些表时,如何查找SSAS存在什么错误或问题?

我尝试过:

  • 从$ system.TMSCHEMA_partitions进行表属性查询 然后针对相关数据源执行该查询。它 成功并包含最新数据。
  • 查看了为SQL Agent作业步骤配置的输出文件。它 是空的。

解决方法

您是否尝试过检查XE收集的数据? 您需要“ ProgressReportEnd”事件

    <Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
  <ObjectDefinition>
    <Trace>
      <ID>ETLExecutionLogs</ID>
      <Name>ETLExecutionLogs</Name>
      <AutoRestart>true</AutoRestart>
      <XEvent xmlns="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
        <event_session name="ETLExecutionLogs" dispatchLatency="0" maxEventSize="0" maxMemory="4" memoryPartition="none" eventRetentionMode="AllowSingleEventLoss" trackCausality="true" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
          <event package="AS" name="ProgressReportEnd" />
          <target package="package0" name="event_file">
            <parameter name="filename" value="d:\YourServerLogPath\OLAP\Log\ETLExecutionLogs.xel" />
            <parameter name="max_file_size" value="250" />
            <parameter name="max_rollover_files" value="4" />
            <parameter name="increment" value="50" />
          </target>
        </event_session>
      </XEvent>
    </Trace>
  </ObjectDefinition>
</Create>

之后,您可以使用powershell提取信息:

$SharedPath = "C:\Program Files\Microsoft SQL Server\150\Shared";


$xeCore = [System.IO.Path]::Combine($SharedPath,"Microsoft.SqlServer.XE.Core.dll");
$xeLinq = [System.IO.Path]::Combine($SharedPath,"Microsoft.SqlServer.XEvent.Linq.dll");
Add-Type -Path $xeLinq;

if( [System.IO.File]::Exists($xeCore) )
{
    Add-Type -Path $xeCore;
}

[Microsoft.SqlServer.XEvent.Linq.QueryableXEventData] $xEvents = $null;


    $files = [System.IO.Directory]::EnumerateFiles("d:\YourServerLogPath\OLAP\Log","ETLExecutionLogs*.xel")
    $xEvents = 
        New-Object -TypeName Microsoft.SqlServer.XEvent.Linq.QueryableXEventData(
            $files
        );
    $dt = New-Object System.Data.Datatable;
    $dt.Columns.Add("EventSubclass",[int]);
    $dt.Columns.Add("ObjectType",[int]);
    $dt.Columns.Add("NTCanonicalUserName",[String]);
    $dt.Columns.Add("DatabaseName",[String]);
    $dt.Columns.Add("ObjectPath",[String]);
    $dt.Columns.Add("ObjectID",[String]);
    $dt.Columns.Add("EndTime",[DateTimeOffset]);
    $dt.Columns.Add("StartTime",[DateTimeOffset]);
    $dt.Columns.Add("RequestID",[Guid]);
    $dt.Columns.Add("ReEncoding",[String]);
    
    
    foreach($publishedEvent in $xEvents)
    {
if( ($publishedEvent.Fields["EventSubclass"].value -In 55) -or   ($publishedEvent.Fields["EventSubclass"].Value -In 59 -And $publishedEvent.Fields["ObjectType"].Value -In 802016,802015,802014,802013,802018 -And 
      $publishedEvent.Name -eq "ProgressReportEnd" -And $publishedEvent.Fields["Success"].Value -eq "1" ))
        {
            $row = $dt.NewRow();
            
            $row.EventSubclass = $publishedEvent.Fields["EventSubclass"].Value;
            $row.ObjectType = $publishedEvent.Fields["ObjectType"].Value;
            $row.NTCanonicalUserName = $publishedEvent.Fields["NTCanonicalUserName"].Value;
            $row.DatabaseName = $publishedEvent.Fields["DatabaseName"].Value;
            $row.ObjectPath = $publishedEvent.Fields["ObjectPath"].Value;
            $row.ObjectID = $publishedEvent.Fields["ObjectID"].Value;
            $row.EndTime = $publishedEvent.Fields["EndTime"].Value;
            $row.StartTime = $publishedEvent.Fields["StartTime"].Value;
            $row.RequestID = $publishedEvent.Fields["RequestID"].Value;
            $row.ReEncoding = $publishedEvent.Fields["TextData"].Value;
            $dt.Rows.Add($row)
            
        }
    }

    $dt

}

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...