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

本文涉及的产品
云数据库 RDS SQL Server,基础系列 2核4GB
RDS SQL Server Serverless,2-4RCU 50GB 3个月
推荐场景:
简介:

曾经遇到过一个由于第三方的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
相关文章
|
2月前
|
SQL 安全 Oracle
SQL Server 链接服务器(Linked Servers)
【9月更文挑战第12天】SQL Server 的链接服务器功能强大,可让你在一个实例中访问其他数据源,包括其他 SQL Server 实例、Oracle 数据库等。它支持数据集成、分布式查询和数据同步,无需复制数据。创建链接服务器需在 SQL Server Management Studio 中进行,并配置名称、类型及安全性。使用时需注意权限、性能和安全性问题,确保系统稳定和数据安全。
|
4月前
|
数据库
数据库bug-[08001] Could not create connection to database server. Attempted reconnect 3,主机名ip必须写对
数据库bug-[08001] Could not create connection to database server. Attempted reconnect 3,主机名ip必须写对
|
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...
1376 0
|
SQL 安全 测试技术
MS SQL 错误:The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "test" was unable to begin a distributed transact
一同事在测试服务器(系统:Windows 2008 R2 Standard 数据库:SQL SERVER 2008 R2)通过链接服务器test使用分布式事务测试时出错,出错信息如下: set xact_abort on begin tran update test.
1479 0
|
SQL Go 数据库
Microsoft SQL Server Product Samples:Database
原文:Microsoft SQL Server Product Samples:Database 从SQL Server 2005 之后示例数据都为AdventureWorks,需要的通过codeplex网站下载。
982 0
下一篇
无影云桌面