日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Cannot obtain the required interface (IID_IDBCreateCommand) from OLE DB provider OraOLEDB.Oracle...

發(fā)布時間:2025/3/17 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Cannot obtain the required interface (IID_IDBCreateCommand) from OLE DB provider OraOLEDB.Oracle... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?

今天遇到了一個關于LINKED SERVER查詢報錯的案例,鏈接服務器鏈接ORACLE數(shù)據(jù)庫,測試沒有錯誤,但是執(zhí)行腳本的時候,報如下錯誤:

?

?

?

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "OraOLEDB.Oracle" for linked server "xxxx" reported an error. Access denied.

Msg 7301, Level 16, State 2, Line 1

Cannot obtain the required interface ("IID_IDBCreateCommand") from OLE DB provider "OraOLEDB.Oracle" for linked server "xxxx".

?

?

其實以前遇到過類似的案例,但是這次案例發(fā)生在SQL Server 2012 (SP4) (KB4018073) - 11.0.7001.0 (X64)下,LINKED SERVER使用?Oracle Provider for OLE DB驅動,跟之前遇到的案例Cannot create an instance of OLE DB provider "OraOLEDB.Oracle" for linked server "xxxxxxx".有一些區(qū)別。解決方案相同,需要在Oracle Provider for OLE DB驅動的選項里面勾選Allow inporcess",或者修改注冊表,具體參考下面Metalink官方文檔。(另外,今天還遇到了很奇葩的事情,設置后,SQL 語句在其他數(shù)據(jù)庫執(zhí)行OK,但是在master庫下面就一直報這個錯誤,但是一段時間后又OK了。十分奇怪,暫時不清楚具體原因)

?

?

?

?

?

MetalinkUsing Oracle OLE DB Provider and MS SQL Server To Acccess Oracle Database Raise Errors 7399 And 7301 (文檔 ID 396648.1)的詳細介紹

?

?

SYMPTOMS

You are unable to connect to the Oracle database when using Microsoft SQL Server's Linked Server and the Oracle Provider for OLE DB and receive errors messages like

?

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "OraOLEDB.Oracle" for linked server "TEST" reported an error. The provider reported an unexpected catastrophic failure.

Msg 7301, Level 16, State 2, Line 1

Cannot obtain the required interface ("IID_IDBCreateCommand") from OLE DB provider "OraOLEDB.Oracle" for linked server "TEST".

?

CAUSE

?

The Oracle Provider for OLE DB has been configured to run out-of-process (in a separate process than the SQL Server process, typically DLLHOST.EXE) but it is mandatory to run the Oracle Provider for OLE DB as in-process to function properly with SQL Server.

?

SOLUTION

?

Please apply solution from

Note:333327.1 Error "Could not execute query against OLE DB provider 'OraOLEDB.Oracle'" when Querying Against an Oracle Database using Microsoft SQL Server Linked Server and the Oracle Provider for OLE DB

which describes the same problem but with different symptoms.

?

REFERENCES

NOTE:333327.1 - Error "Could not execute query against OLE DB provider 'OraOLEDB.Oracle'" when Querying Against an Oracle Database using Microsoft SQL Server Linked Server and the Oracle Provider for OLE DB

?

?

?

另外,關于文檔333327.1 ——Error "Could not execute query against OLE DB provider 'OraOLEDB.Oracle'" when Querying Against an Oracle Database using Microsoft SQL Server Linked Server and the Oracle Provider for OLE DB (文檔 ID 333327.1)的具體內容如下:

?

APPLIES TO:

Oracle Provider for OLE DB - Version 10.2.0.1 and later
Microsoft Windows (32-bit)

***Checked for relevance on 10-Oct-2016***?



SYMPTOMS

You are unable to connect to the Oracle database when using Microsoft SQL Server's Linked Server and the Oracle Provider for OLE DB. When issuing the following query from Microsoft's SQL Query Analyzer??

You receive the following error

?

If you change the query so that it will not return any rows it runs successfully

CAUSE

The Oracle Provider for OLE DB has been configured to run out-of-process (in a separate process than the SQL Server process, typically DLLHOST.EXE).? The Oracle Provider for OLE DB must run in-process to function properly with SQL Server.

By SQL*Net tracing the failing query you can look at the TNS information inside of a SQL*Net trace you can see the difference between a provider running IN and OUT of process:

??
In-Process Trace:

??Out-Of-Process Trace:

In the?In-Process?trace the TNS information shows us that the Oracle Provider for OLE DB is running under the?sqlservr.exe?process.? In the?Out-Of-Processtrace we see that the same provider is running under the?DllHost.exe?process.? DllHost is used as a surrogate process in place of SQL Server to host out-of-process executions and clearly shows us that the Oracle OLE DB provider has been configured this way.

SOLUTION

  • Open the registry and check the value of the?AllowInProcess?key being used by the Oracle Provider for OLE DB
  • If the?AllowInProcess?key has been set to a value of 0 then it is configured to run out-of-process.? Change the value from 0 to 1 or if the key does not exist, create it as a DWORD with a value of 1.? The value 1 is also the default setting signifying in-process.
  • NOTE:? Microsoft states that the out-of-process setting?AllowInProcess=0, is not to be used with any provider other than SQLOLEDB (Microsoft's OLEDB Provider for SQL Server).? See the following link for more information:

    ? Microsoft Knowledge Base Article ID 833388
    ????? ?
    You cannot create out-of-process providers with MDAC OLE DB components

    Additionally, the?Oracle Provider for OLE DB Developer's Guide?states that the Oracle Provider for OLE DB (OraOLEDB) is an in-process server.

    ?

    ?

    ?

    ?

    參考資料

    ?

    Using Oracle OLE DB Provider and MS SQL Server To Acccess Oracle Database Raise Errors 7399 And 7301 (文檔 ID 396648.1)

    Error "Could not execute query against OLE DB provider 'OraOLEDB.Oracle'" when Querying Against an Oracle Database using Microsoft SQL Server Linked Server and the Oracle Provider for OLE DB (文檔 ID 333327.1)

    總結

    以上是生活随笔為你收集整理的Cannot obtain the required interface (IID_IDBCreateCommand) from OLE DB provider OraOLEDB.Oracle...的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。