SSIS Component的ValidateExternalMetadata属性

本文涉及的产品
云数据库 RDS SQL Server,独享型 2核4GB
简介:

ValidateExternalMetadata Property

Indicates whether the component validates its column metadata against its external data source at design time. When this property is true, the component connects to its external data source during design time and validates the columns in its input or output collections against the columns at the external data source. When set to false, the component does not perform this "connected" validation.

ValidateExternalMetadata Property是Componet的属性,在VS中,出现在Data Flow选项卡中的组件存在该属性。 

 

默认情况下,ValidateExternalMetadata属性是设置为True的,因此任何时候我们打开包、添加组件或者运行包,SSIS都会链接到数据源,并验证外部元数据。当ValidateExternalMetadata属性是设置为False时,SSIS在运行到该组件时才验证数据源,在Desgin time不会验证源数据。

 

在Design time时,发现SSIS 组件对外部源数据貌似有种缓存机制,不会实时更新metadata。

Most SSIS components which interact with an external system (for example, the Lookup Transform, or Source/Destination components) will define External Metadata Columns. These represent the columns in the table/view/query the component is interacting with. This metadata information gets cached within the package file (.dtsx).

During the Validation phase, a component is supposed to check to make sure that the cached metadata in the package is still in sync with the underlying table/view/query. If there is a mismatch, the component returns a special status (VS_NEEDSNEWMETADATA). When this happens at design-time, SSIS triggers a metadata refresh by calling ReinitializeMetadata(). At runtime, this results in an error.

Because metadata validation can be expensive (large table with a lot of columns, for example), the ValidateExternalMetadata flag can set to false to disable this validation. Typically, you'd only do this when you are certain that your package and underlying table/view/query will remain in sync.

 

适用的case是,一个Staging表在Design time是不存在的,当package runtime时,该组件的上流组件创建Staging表,当package运行到该组件时,由于Staging表已经存在,该组件验证通过,能够运行成功。

 

如果开启DTC Transaction,ValidateExternalMetadata Property设置不当会导致死锁,亲测,确实会导致死锁,在debug时,死锁不会自动解除。详细情况请参考:https://support.microsoft.com/en-us/kb/2253391

 

The execution of a SQL Server Integration Services (SSIS) package stops responding when you enable DTC transactions for a package in Microsoft SQL Server 

SYMPTOMS
Consider the following scenario:
  • You create a SQL Server Integration Services (SSIS) package in Microsoft SQL Server 2005, in SQL Server 2008, or in SQL Server 2008 R2.
  • The SSIS package contains a data flow task and some other tasks.
  • The TransactionOption property of the SSIS package is set to Required to use DTC transactions.
  • The other tasks run in a DTC transaction before the execution of the data flow task.
  • You add a component to the data flow task.
  • The ValidateExternalMetadata property of a data flow component is set to True.
  • The data flow task contains an OLE DB Destination component that has the data access mode set to Table or view, or to Table name or view name variable. 
When you run the package in this scenario, the execution stops responding. Additionally, if you debug the SSIS package in Visual Studio, you receive messages that resemble the following in the  Progress view:
SSIS package "Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
Information: 0x4001100A at Package: Starting distributed transaction for this container.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
CAUSE
This problem occurs because the connection in the data flow is not enrolled in the DTC transaction. This causes the execution of the sp_cursoropen stored procedure to be blocked. This is a design feature because a connection cannot be enrolled in a DTC transaction during the validation process. In the scenario that is described in the "Symptoms" section, the validation process of a data flow component is blocked when you run the package because the connection in the data flow task has not been enrolled in the DTC transaction.
RESOLUTION
To resolve this problem, use one of the following methods:
  • Set ValidateExternalMetadata for all component in the data flow task to False
  • Set the data access mode of the OLE DB Destination component to one of the following modes:
    • Table or view – fast load 
    • Table name or view name variable – fast load
    • SQL command
MORE INFORMATION
The  Table or View data access mode is blocked but other data access modes are not blocked because the different commands issued by the data provider for each data access mode. To obtain more details about this issue, use SQL Server Profiler to see the different commands issued by the data provider.
For more information about how to use SQL Server Profiler, visit the following Microsoft Developer Network (MSDN) website: Using SQL Server Profiler
For more information about how to troubleshoot SSIS packages, visit the following Microsoft Developer Network (MSDN) website: Troubleshooting Package Development

 

作者悦光阴
本文版权归作者和博客园所有,欢迎转载,但未经作者同意,必须保留此段声明,且在文章页面醒目位置显示原文连接,否则保留追究法律责任的权利。
分类: SSIS 组件




本文转自悦光阴博客园博客,原文链接:http://www.cnblogs.com/ljhdo/p/4803533.html,如需转载请自行联系原作者
相关实践学习
使用SQL语句管理索引
本次实验主要介绍如何在RDS-SQLServer数据库中,使用SQL语句管理索引。
SQL Server on Linux入门教程
SQL Server数据库一直只提供Windows下的版本。2016年微软宣布推出可运行在Linux系统下的SQL Server数据库,该版本目前还是早期预览版本。本课程主要介绍SQLServer On Linux的基本知识。 相关的阿里云产品:云数据库RDS SQL Server版 RDS SQL Server不仅拥有高可用架构和任意时间点的数据恢复功能,强力支撑各种企业应用,同时也包含了微软的License费用,减少额外支出。 了解产品详情: https://www.aliyun.com/product/rds/sqlserver
目录
相关文章
|
6月前
|
缓存
关于 Spartacus ProdutList Component Service model$ 的填充逻辑
关于 Spartacus ProdutList Component Service model$ 的填充逻辑
28 0
|
1月前
|
前端开发 开发者
类组件(Class component)和 函数式组件(Functional component) 之间有何区别?
类组件(Class component)和 函数式组件(Functional component) 之间有何区别?
35 0
|
5月前
|
前端开发 Go 图形学
Unity中查找子组件GameObject或Component的操作汇总
Unity中查找子组件GameObject或Component的操作汇总
84 0
|
5月前
|
前端开发 JavaScript
写文章 类组件(Class component)和 函数式组件(Functional component)之间有何区别
写文章 类组件(Class component)和 函数式组件(Functional component)之间有何区别
23 0
|
6月前
|
算法
sap.ui.comp.smarttable.SmartTable 一些属性的用法阐述
sap.ui.comp.smarttable.SmartTable 一些属性的用法阐述
52 1
|
7月前
|
资源调度
SAP 电商云 Spartacus UI Component 级别的延迟加载实现(Lazy Load)
SAP 电商云 Spartacus UI Component 级别的延迟加载实现(Lazy Load)
36 0
|
前端开发 JavaScript 开发者
介绍 class 创建的组件中 this.state |学习笔记
快速学习介绍 class 创建的组件中 this.state
104 0
动态组件<component :is=‘‘></component>
动态组件<component :is=‘‘></component>
|
自然语言处理 JavaScript 前端开发
Component 组件props 属性设置
Component 组件props 属性设置
310 0