你关注过Linked Server OLE DB选项吗?

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

曾经遇到过一个由于第三方的OLE DB创建的Linked Server 导致SQL Server Crash的案例,最后的解决办法是修改OLE DB Provider选项“Allow inprocess”。所以解决Linked Server的某些问题还是要知道这些选项的含义。

 

这里我将这些选项以及解释列出来,希望能够对大家有所帮助:

 

 

Provider option

Description

DynamicParameters

If nonzero, indicates that the provider allows for the '?' parameter marker syntax for parameterized queries. Set this option only if the provider supports the ICommandWithParameters interface and supports a '?' as the parameter marker. Setting this option enables SQL Server to execute parameterized queries against the provider. Executing parameterized queries against the provider can yield better performance for certain queries.

NestedQueries

If nonzero, indicates that the provider allows for nested SELECT statements in the FROM clause. Setting this option enables SQL Server to delegate certain queries to the provider that require nesting SELECT statements in the FROM clause.

LevelZeroOnly

If nonzero, only level 0 OLE DB interfaces are invoked against the provider.

AllowInProcess

If nonzero, SQL Server allows for the provider to be instantiated as an in-process server. When this option is not set in the registry, the default behavior is to instantiate the provider outside the SQL Server process. Instantiating the provider outside the SQL Server process helps protect the SQL Server process from errors in the provider. When the provider is instantiated outside the SQL Server process, updates or inserts referencing LOB columns (varchar(max)nvarchar(max)varbinary(max)textntext, or image) are not allowed.

The SQL Server Native Client OLE DB provider cannot be instantiated out of process. An error is raised if you set the SQL Server Native Client OLE DB provider to run out of process and try to run a distributed query.

NonTransactedUpdates

If nonzero, SQL Server allows for updates, even if ITransactionLocal is not available. If this option is enabled, updates against the provider are not recoverable, because the provider does not support transactions.

IndexAsAccessPath

If nonzero, SQL Server tries to use indexes of the provider to fetch data. By default, indexes are used only for metadata and are never opened.

DisallowAdhocAccess

If a nonzero value is set, SQL Server does not allow for ad hoc access through the OPENROWSET and OPENDATASOURCE functions against the OLE DB provider. When this option is not set, SQL Server also does not allow for ad hoc access.

This option controls the ability of non-administrators to run ad hoc queries. Administrators are not affected by this option.

SqlServerLike

If nonzero, the provider supports the LIKE operator as the operator is implemented in SQL Server. When this option is set, SQL Server will consider pushing to the provider the queries that have LIKE predicates against remote columns as part of the evaluation of the distributed query.

 

更多信息参考MSDN:ConfiguringOLE DB Providers for Distributed Queries

 

另外关于Linked Server选项的解释参考:LinkedServer Properties


本文转自 lzf328 51CTO博客,原文链接:

http://blog.51cto.com/lzf328/1039439
相关实践学习
使用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
相关文章
|
SQL BI 数据库
SQL Server 2012 The report server cannot open a connection to the report server database
案例环境:        操作系统版本:    Windows Server 2012 R2 Standard        数据库版本  :    SQL SERVER 2012 SP2 案例介绍:         今天进入一台新安装的SQL Server服务器的Reporting S...
1357 0
|
SQL Go 数据库
SQL Server使用sys.master_files计算tempdb大小不正确
原文:SQL Server使用sys.master_files计算tempdb大小不正确 一直习惯使用sys.master_files来统计数据库的大小以及使用情况,但是发现sys.master_files不能准确统计tempdb的数据库大小信息。
1157 0
|
SQL 关系型数据库 数据库
Confluence 6 Microsoft SQL Server 设置准备
在开始前,请检查: 请查看 Supported Platforms 页面来获得 Confluence 系统支持的 SQL Server 数据库版本。
1164 0
|
SQL Go 数据库
Microsoft SQL Server Product Samples:Database
原文:Microsoft SQL Server Product Samples:Database 从SQL Server 2005 之后示例数据都为AdventureWorks,需要的通过codeplex网站下载。
939 0
|
SQL 数据库
Microsoft SQL Server 2000数据附加
Microsoft SQL Server 2000附加数据操作流程 1、开始 - 所有程序 - Microsoft SQL Server - 企业管理器(如图1-1)。
1059 0