SSISDB 系列随笔汇总:

Package的每一次执行(Execution),集成服务引擎都会在SSISDB中创建唯一的操作实例(Operation) 和 执行实例(Execution),实例都有唯一的ID进行标识。跟SSIS工程操作相关的是操作实例,跟Package的运行相关的是执行实例。Package的每次执行都会生成一个唯一的ExecutionID,并记录执行实例运行的结果和状态。在每个Execution Instance中,Package都会执行Task或Container,每一个Task或Container都是一个Executable,SSISDB会记录每个Executable执行的状态。

一,创建转存文件

转存文件(dump file)主要用于Package的开发阶段,用于对Package进行测试和故障排除。转存文件默认存储在ErrorDumps文件夹下:C:\Program Files\Microsoft SQL Server\110\Shared\ErrorDumps,扩展名是.tmp和 .mdmp,前者是以文本格式存储,该文件会记录Package执行实例的最近的消息,后者是而二进制文件。

创建转存文件,有两种方式:

  • 第一种方式:使用特殊的执行参数,配置执行实例,当Package在运行过程中出现错误,或者错误事件被触发时,集成服务引起自动创建转存文件。
  • 第二种方式:在Package正在运行(running)时,调用 catalog.create_execution_dump  存储,暂停当前的执行实例,创建转存文件。

1,为正在运行的Package创建转存文件

调用存储过程:catalog.create_execution_dump,暂停正在执行的Package,创建转存文件。一旦成功创建转存文件,那么package将会终止运行。

exec catalog.create_execution_dump [ @execution_id = ] execution_id

2,在执行Package之前,设置执行参数

通过设置Package执行实例的配置参数:DUMP_ON_ERROR,在Package运行出现错误时,自动创建转存文件。

exec catalog.set_execution_parameter_value
@execution_id = @package_execution_id
, @object_type = 50
, @parameter_name = 'DUMP_ON_ERROR'
, @parameter_value = 1

二,查询执行实例

执行实例都会对应一个操作实例,执行实例是Package的一次执行,该Package可能会调用其他Package。每个Package都会执行其包含的可执行组件(Executable),处理数据;集成服务引擎会记录Package和可执行组件的状态。

1,查询执行实例

select e.execution_id,
e.folder_name,
e.object_type,
obt.object_type_descr,
e.project_name,
e.package_name,
opt.operation_type_descr,
e.created_time,
ops.operation_status_descr as execution_status,
e.caller_name,
e.start_time,
e.end_time
from catalog.executions e
inner join helper.OperationType opt
on e.operation_type=opt.operation_type
inner join helper.ObjectType obt
on e.object_type=obt.object_type
inner join helper.OperationStatus ops
on e.status=ops.operation_status
order by e.start_time desc

2,查询Executable

select e.executable_id,
e.package_name,
e.package_path,
e.executable_name,
--e.executable_guid,
er.execution_result_descr,
es.execution_duration/1000/60 as execution_duration_m,
cast(es.start_time as datetime) as start_time,
cast(es.end_time as datetime) as end_time,
es.execution_value
from catalog.executables e
inner join catalog.executable_statistics es
on e.executable_id=es.executable_id
and e.execution_id=es.execution_id
inner join helper.ExecutionResult er
on es.execution_result=er.execution_result
where e.execution_id=23537
order by es.end_time desc

三,查看Execution的资源消耗

如果一个 执行实例正在运行,处于running 状态,可以通过函数 catalog.dm_execution_performance_counters(@execution_id) 查看资源利用情况,该函数返回12个performance counter,统计该running execution自开始执行到现在为止的信息。

select e.execution_id,
e.folder_name,
e.project_name,
e.package_name,
e.start_time,
epc.counter_name,
epc.counter_value
from catalog.executions e
cross apply catalog.dm_execution_performance_counters(e.execution_id) as epc
where e.status=2 --running
order by e.execution_id,
epc.counter_name

四,在package执行错误时,查看失败的Executable

select e.folder_name,
e.project_name,
opt.operation_type_descr as operation,
obt.object_type_descr as object_type,
ops.operation_status_descr as operation_status,
et.package_name,
et.package_path as executable_path,--relative path
--es.execution_path as executable_full_path,
et.executable_name,
cast(es.execution_duration/1000/60.0 as decimal(10,1))as duration_m,
er.execution_result_descr as execution_result,
es.start_time
--,es.end_time
from catalog.executions e
inner join helper.OperationType opt
on e.operation_type=opt.operation_type
inner join helper.ObjectType obt
on e.object_type=obt.object_type
inner join helper.OperationStatus ops
on e.status=ops.operation_status
inner join catalog.executables et
on e.execution_id=et.execution_id
inner join catalog.executable_statistics es
on et.executable_id=es.executable_id
and et.execution_id=es.execution_id
inner join helper.ExecutionResult er
on es.execution_result=er.execution_result
where e.execution_id=23537 --Specified ExecutionID
and es.execution_result=1 -- 1 (Failure)
--and et.package_name=N'PackageName.dtsx'
order by et.package_name
,es.start_time desc;

附,helper 辅助表

关于helper 辅助表,请参考《SSISDB2:Operation》的“Appendix”

参考文档:

Views (Integration Services Catalog)

catalog.set_execution_parameter_value (SSISDB Database)

SSIS Catalog

SSISDB3:Package的执行实例的更多相关文章

  1. 怎样使用oracle 的DBMS_SQLTUNE package 来执行 Sql Tuning Advisor 进行sql 自己主动调优

     怎样使用oracle 的DBMS_SQLTUNE package 来执行 Sql Tuning Advisor 进行sql 自己主动调优 1>.这里简单举个样例来说明DBMS_SQLTUN ...

  2. Activiti的流程实例【ProcessInstance】与执行实例【Execution】

    最近,我在做流程引擎Activiti相关的东西,刚开始时的一个知识点困扰了我许久,那就是Activiti的ProcessInstance与Execution的区别,这是一个Activiti的难点,能够 ...

  3. java 反射机制之 getDeclaredMethod()获取方法,然后invoke执行实例对应的方法

    关于反射中getDeclaredMethod().invoke()的学习,来源于项目中的一行代码: SubjectService.class.getDeclaredMethod(autoMatchCo ...

  4. JVM 字节码执行实例分析

    前言 最近在看<Java 虚拟机规范>和<深入理解JVM虚拟机>,对于字节码的执行有了进一步的了解.字节码就像是汇编语言,是 JVM 的指令集.下面我们先对 JVM 执行引擎做 ...

  5. crontab 在指定时间范围每隔2小时执行一次和指定时间执行实例

    crontab 在指定时间范围每隔2小时执行一次和指定时间执行,下面实例实现了:10-23点每两个小时执行一次,2点执行一次,分钟依次是1 2 3 ,没有24点的,晚上12点是0点注:*代表所有的取值 ...

  6. jquery 延迟执行实例介绍

    代码如下: $(function(){ var $inputs = $('input[type=button]') .delay(500) .queue(function(){$(this).hide ...

  7. SSISDB2:使用TSQL执行Package

    在SSISDB中,能够使用TSQL脚本执行Package:每执行一次Package,SSIS都会创建一个Operation 和一个执行实例(Execution Instance),每个Executio ...

  8. SSISDB5:使用TSQL脚本执行Package

    SSISDB 系列随笔汇总: SSISDB1:使用SSISDB管理Package SSISDB2:SSIS工程的操作实例 SSISDB3:Package的执行实例 SSISDB4:当前正在运行的Pac ...

  9. SSISDB7:查看当前正在运行的Package

    在项目组中做ETL开发时,经常会被问到:“现在ETL跑到哪一个Package了?” 为了缩短ETL运行的时间,在ETL的设计上,经常会使用并发执行模式:Task 并发执行,Package并发执行.对于 ...

随机推荐

  1. 使用UICollectionView

    使用UICollectionView 使用UICollectionView的流程: 1. 设定一个UICollectionViewFlowLayout 2. 使用这个设定的UICollectionVi ...

  2. 一份非常完整的 MySQL 规范

    源自:https://www.cnblogs.com/huchong/p/10219318.html 一.数据库命令规范 所有数据库对象名称必须使用小写字母并用下划线分割. 所有数据库对象名称禁止使用 ...

  3. Inside Amazon's Kafkaesque "Performance Improvement Plans"

    Amazon CEO and brilliant prick Jeff Bezos seems to have lost his magic touch lately. Investors, empl ...

  4. MacOS(苹果电脑&苹果系统)连接京瓷300i 打印机

    前往京瓷官网下载打印机驱动: http://www.kyoceradocumentsolutions.com.cn/support/mfp/download/taskalfa300i.html 驱动安 ...

  5. Build path entry is missing: config 引起的 The project: configwhich is referenced by the classpath, does not exist.

    运行Junit的时候报错, The project: XXXX which is referenced by the classpath, does not exist. 在Java Build Pa ...

  6. AOP-Pointcut-笔记

    一.Pointcut 这是切点的抽象.一个切点由一个的类过滤器和一个方法匹配器组成. 将整个代码贴上来 /** * Core Spring pointcut abstraction. * * < ...

  7. vue部署到tomcat

    # vue打包到tomcat部署步骤a.进入项目目录运行npm run devb.将dist目录复制到远程服务器下的tomcat/webapps下c.重启tomcatd.浏览器中访问 http:本机i ...

  8. 浏览器地址栏运行JavaScript代码

    这个很多人应该还是知道的,在浏览器地址栏可以直接运行JavaScript代码,做法是以javascript:开头后跟要执行的语句.比如: javascript:alert('hello from ad ...

  9. (第一章)改善JavaScript,编写高质量代码。

    根据<编写高质量代码改善JavaScript程序的188个建议>这本书,来记录我目前所了解的建议方式. 建议1:警惕Unicode乱码 根据ECMA标准规定JavaScript语言可以使用 ...

  10. 创建ROS工程結構

    图像化显示目录工程结构:tree $ sudo apt install tree 1.创建ROS工作空间 $ mkdir -p catkin_ws/src # Create mutil-level d ...