SSISDB5:Parameter

Parameter 是Package 给外部提供的接口,通过修改Parameter,能够控制Package执行的属性,产生不同的结果。Parameter 有三种值:design_default_value,Default_Value 和 Execution_Value。

1,design_default_value是project 部署前,designer 设置的parameter的默认值。

2,Default_Value 是project 部署到SSISDB后,Parameters的默认值,如果不对Parameters进行修改,Default_Value  和 design_default_value是相同的。可以在Integration Services Catalog中,选中Project->右击Configure,修改Parameters的Default_Value。

3,Execution_Value是package 执行时,Package parameters的值。可以在Integration Services Catalog中,选中Project->package,右击Execute,将Parameters 的 Default_Value修改为此次执行的参数值。

4,Parameter 还可以引用Environment 中的 Variables。

参数的属性

Sensitive 是parameter的敏感性,对于敏感参数,SSIS对值进行加密

Required是Parameter的必需性,对于必需参数,在执行时,必须设置值;在Create Agent执行Package,必须显示必需参数的值。

一,在SSISDB中,从 [catalog].[object_parameters] 和 [catalog].[execution_parameter_values] 中查看 package的这三种参数值。

--object_type : 20 (project parameter), 30 (package parameter)
--value_type: V (parameter_value is a literal value),R(referencing an environment variable)
--value_set:1(the parameter value has been assigned), 0 (the parameter value has not been assigned)

select op.project_id,p.name as ProjectName,
    op.object_type,
    op.object_name,op.parameter_name,op.data_type,
    op.required,op.sensitive,
    op.design_default_value,op.default_value,
    op.value_type,op.referenced_variable_name,
    op.value_set
from [catalog].[object_parameters] op with(NOLOCK)
inner join catalog.projects p with(nolock)
    on op.project_id=p.project_id
where object_type in(20,30)

二,通过TSQL 来使用参数

declare @Execution_ID bigint
exec catalog.create_execution @package_name=N‘Test.dtsx‘,
    @Execution_ID=@Execution_ID output,
    @folder_name=N‘MyProjectFloder‘,
    @project_name=N‘MyProject‘,
    @use32bitruntime=FALSE,
    @reference_id=null

declare @var0 sql_variant=N‘Package_Parameter_value‘;
exec catalog.set_execution_parameter_value
    @Execution_ID=@Execution_ID,
    @object_type=30,        --Package
    @parameter_name=N‘Package_Parameter_Name‘,
    @parameter_value=@var0

exec catalog.start_execution @Execution_ID=@Execution_ID

三,特殊参数

SSISDB的特殊参数,用于控制Package执行时的特殊行为,这些参数的值,通过 catalog.set_execution_parameter_value 来设置。

  • LOGGING_LEVEL
  • CUSTOMIZED_LOGGING_LEVEL
  • DUMP_ON_ERROR
  • DUMP_ON_EVENT
  • DUMP_EVENT_CODE
  • CALLER_INFO
  • SYNCHRONIZED

LOGGING_LEVEL – Integer – 0 | 1* | 2 | 3 – Sets the logging level for this execution.  The values represent no logging, basic, performance, and verbose levels respectively.

SYNCHRONIZED - Boolean - 0 synchronous | 1 asynchronous

参考文档:《SSIS Parent-Child Architecture in Catalog Deployment Mode

First of all, by default when executing a package using T-SQL, the package is started asynchronously.  This means that when you call the stored procedure [SSISDB].[catalog].[start_execution], the T-SQL command will return immediately (assuming you passed in a valid package name and parameters), giving no indication of either success or failure.  That’s why, on this example, I’m setting the execution parameter named SYNCHRONIZED to force the T-SQL command to wait until the package has completed execution before returning.  (Note: For additional information about execution parameters, check out this post by Phil Brammer).  Second, regardless of whether you set the SYNCHRONIZED parameter, the T-SQL command will not return an error even if the package fails.

DECLARE @execution_id BIGINT

EXEC [SSISDB].[catalog].[create_execution] @package_name = N‘ChildPkgRemote.dtsx‘
    ,@execution_id = @execution_id OUTPUT
    ,@folder_name = N‘SSIS Parent-Child‘
    ,@project_name = N‘SSIS Parent-Child Catalog Deployment - Child‘
    ,@use32bitruntime = False
    ,@reference_id = NULL

-- Set user parameter value for filename
DECLARE @filename SQL_VARIANT = N‘E:\Dropbox\Presentations\_sampleData\USA_small1.txt‘

EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id
    ,@object_type = 30
    ,@parameter_name = N‘pSourceFileName‘
    ,@parameter_value = @filename

-- Set execution parameter for logging level
DECLARE @loggingLevel SMALLINT = 1

EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id
    ,@object_type = 50
    ,@parameter_name = N‘LOGGING_LEVEL‘
    ,@parameter_value = @loggingLevel

-- Set execution parameter for synchronized
DECLARE @synchronous SMALLINT = 1

EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id
    ,@object_type = 50
    ,@parameter_name = N‘SYNCHRONIZED‘
    ,@parameter_value = @synchronous

-- Now execute the package
EXEC [SSISDB].[catalog].[start_execution] @execution_id

-- Show status
SELECT [status] AS [execution_status]
FROM SSISDB.CATALOG.executions
WHERE execution_id = @execution_id

参考文档:

catalog.object_parameters (SSISDB Database)

catalog.set_execution_parameter_value (SSISDB Database)

Quick Tip – Run SSIS 2012 packages synchronously and other execution parameters

时间: 2024-11-03 20:50:30

SSISDB5:Parameter的相关文章

MyBatis批量操作报错:Parameter 'xxxList' not found. Available parameters are [list]

需求: 根据传入的参数批量 删除数据: DAO: List ll = new ArrayList<Integer>(); for(int i=10;i<25;i++){ ll.add(i); } int res = userMapper.delUser(li); System.out.println(res); xml: <delete id="delUser" parameterType="list" > delete from us

初学Java9:学习Mybatis时报错:Parameter &#39;name&#39; not found. Available parameters are [1, 0, param1, param2]

报错-->Parameter 'name' not found. Available parameters are [1, 0, param1, param2] 百度找到这篇文章完成修改 http://blog.csdn.net/w86440044/article/details/29363067 我之前写的操作类是和博主一样,是这样的: 1 // 登录·查询 2 @Select("select * from t_users where uname=#{name} and pswd=#{p

mybatis:Parameter &#39;list&#39; not found. Available parameters are [templateId, param1, param2, valueList]

我的EsdTemplateSealMapper.java里面定义的接口是这样的 public List<EsdTemplateSeal> getFilteOutSeal(@Param("filterList")List<String> list,@Param("templateId")String templateId); 然后我的EsdTemplateSealMapper.xml里面的sql是这样的: <select id="

Mybatis错误:Parameter &#39;XXX&#39; not found. Available parameters are [1, 0, param1, param2]

Mybatis错误:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2] 原因:传递的参数超过一个 记 解决办法: (1)直接把值改成数字 <select id="LoginUser" parameterType="String" resultMap="userMap"> SELECT * FROM user where emplnumb

MyBatis:Parameter Maps collection does not contain value for 的问题解决

发现配置: Java代码   <resultMap type="com.demo.sys.entity.Module" id="moduleMap"> <id property="id" column="id" /> <result property="name" column="name" /> <result property="r

MyBatis批量操作报错:Parameter ‘xxxList‘ not found. Avail

需求: 根据传入的参数批量 删除数据: DAO: List ll = new ArrayList<Integer>();   for(int i=10;i<25;i++){          ll.add(i);   }        int res = userMapper.delUser(li);   System.out.println(res); xml: <delete id="delUser" parameterType="list&quo

IDEA_MyBatis_SQLException:Parameter index out of range坑

报错信息:超出数据库数据表设定的规定长度了 nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='apply_id', mode=IN, javaType=class java.lang.Object, jdbcType=BIGINT, numericScale=null, resultMapId='nul

SSISDB5:使用TSQL脚本执行Package

通常情况下,ETL工程师创建一个Agent Job来周期性地执行Package,Agent底层调用SSISDB的存储过程(catalog.start_execution)以同步模式来启动执行实例,这就意味着,我们可以模拟Agent Job的行为,使用TSQL脚本执行Package.SSIS引擎每执行一次Package,都会创建一个执行实例(Execution Instance),每个执行实例都有唯一的标识 ExecutionID,数据类型是bigint. 执行实例可以包含参数,使用存储过程(ca

Qt 3D的研究(五):Gooch Shader

Qt 3D的研究(五):Gooch Shader Qt 3D的一个很大的优势就是采用数据驱动的方式,将C++和GLSL使用QML来表示,动态语言的优势尽显.在上一次的研究中,我实现了一个非常简单的着色器,接下来,我们可以在此基础上,通过设定着色器的数据,制作出更加绚丽的着色效果.作为开始,我们先从几个非真实渲染(Non-Photorealistic Rendering,NPR)开始吧. 蒋彩阳原创文章,首发地址:http://blog.csdn.net/gamesdev/article/deta