Sql1159 initialization error with db2 net data provider reason code 10

A DB2 .NET application may receive an exception as follows: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.3

Problem

A DB2 .NET application may receive an exception as follows:
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.3
 

Cause

An SQL1159 error may be returned if the DB2 .NET data provider had a problem during initialization.

When the DB2 .NET data provider is initialized it will perform some checks to ensure that the DB2 .NET data provider can be used properly. One of those checks is to see if it can execute a function from within the DB2 native client library called db2app.dll, and before that can be done it tries to load the db2app.dll library in memory.

Several different reason codes can be returned with the SQL1159 exception, but reason code 10 occurs when there is a mismatch between the DB2 native client library (db2app.dll) and the DB2 .NET data provider library (IBM.Data.DB2.dll).

SQL1159 reason code 10 will return two tokens. The first token is the version of the DB2 client library, and the second token is the version of the DB2 .NET data provider.

If the version of the DB2 client library is returned as 0.0.0, then that means that there was a problem during the initialization of the db2app.dll library.

There are potentially two reasons why a token of 0.0.0 is returned for the native DB2 client library.

The first is that the db2app.dll is not compatible with the version of the DB2 client that is installed. The second is that there was a permission problem when trying to use the db2app.dll library with the application process.
 

Resolving The Problem

Incompatible db2app.dll version

Every DB2 fixpak and release has its own version of the db2app.dll library. The file size and signature will be different for each fixpak and release. It is very important that when DB2 is installed that the db2app.dll library is the one that came from that level of DB2 that is being installed.

DB2 will update the db2app.dll library during the install of a fixpak or during the migration from one release to another. If there was a problem updating the db2app.dll, DB2 will document that in its installation log file.

Here is an example of a typical error in the DB2 install log when the db2app.dll could not be updated:

InstallFiles: File: db2app.dll, Directory: C:Program FilesIBMSQLLIBBIN, Size: 9680160

Info 1603.The file C:Program FilesIBMSQLLIBBINdb2app.dll is being held in use. Close that application and retry.
MSI (s) (CC:B0) [11:18:48:389]: Product: DB2 Connect Server — DB2COPY1. The file C:Program FilesIBMSQLLIBBINdb2app.dll is being held in use by the following process Name: msiexec , Id 5392.

If this was the case, then it is important that all applications were shut down before upgrading DB2. This includes any applications that run as Windows services, such as an application server that might be making DB2 connections. The above error is a result of an application holding a lock on the db2app.dll file, thus disallowing DB2 from updating the file.

To verify that the db2app.dll library is in fact compatible with the DB2 level, issue the db2level command, and then compare the level with the file version of the db2app.dll. To retrieve the file version, find the db2app.dll using Windows Explorer and right-click on it and go to Properties->Version.

Invalid priviliges
When the db2app.dll library is initialized by the DB2 .NET data provider, it initializes an application environment. This process will ensure that the db2app.dll library can be used. Some of the things it does is it checks to see what DB2 environment variables are set, and it checks things like the client-side database manager configuration file. If the DB2 .NET data provider could not initialize the application environment properly then DB2 .NET will return 0.0.0 for the native DB2 client library version.

The most common reason why the initialization of the application environment fails is because of invalid privileges. And the most common reason why there are invalid privileges is if DB2 Extended Security is enabled, and the userid that the application process runs under is not a member of either the DB2ADMNS or the DB2USERS groups.

If DB2 Extended Security is enabled (this is the default behavior for DB2 installations), then it is mandatory that any DB2 ‘user’ belongs to either the DB2ADMNS or the DB2USERS group. This is not just the userid that is used during authentication with DB2, but it also includes the owner of the application process.

Some application processes like the w3wp.exe process (which is a process used by Microsoft Information Integrator (IIS)) can run under a different userid than the one that connects to DB2. It is important that this user belongs to the proper DB2 Extended Security group, if DB2 Extended Security is enabled.

If running IIS 7, the default account used for anonymous access is called «IUSR». This user can be added to the extended security group to resolve this error.

To determine what userid is actually trying to use the .NET application then you can use a utility called the Microsoft® Process Monitor located here:

That utility will track all file and registry operations issued by any Windows process. If that process failed to read a file, then it will record an ACCESS DENIED error. Microsoft® Process Monitor can show who the userid was that tried to access the file when it failed. Adding that userid to the proper DB2 Extended Security group should then resolve that problem. The userid that is used by the application can be impersonated by another userid. Microsoft® Process Monitor will show who the Impersonating userid is, and that is the userid that needs to be added to the proper DB2 Extended Security group.

If DB2 Extended Security is enabled, and the preference is to not use DB2 Extended Security, then the ideal thing to do would be to uninstall DB2 and reinstall it without the DB2 Extended Security option.

If Microsoft Windows® 7 or Microsoft Windows Vista® are being used, and DB2 Extended Security is disabled, the problem may still occur due to invalid privileges, specifically if the userid that installed DB2 was not given elevated administrator rights. Typically when User Account Control (UAC) is enabled, users with administrator rights run with least user privileges. These rights can be elevated to perform administrative tasks. If a non-elevated administrator installed DB2 then certain Windows registry settings used by DB2 may not be set properly, preventing the DB2 .NET data provider from working properly. It is important to ensure that a userid with elevated administrator privileges has installed DB2 to resolve this problem.
 

If using the IBM Data Server Driver Package, then you could also get this error if you were hitting APAR JR30952 (that is fixed in DB2 v9.5 FP5) or APAR IC63971 (that is fixed in DB2 v9.7 FP1). DB2 Extended Security was being enabled implicitly for the IBM Data Server Driver when it should not have been, and that would result in this error since DB2 would think that the userid running the application would not be a member in the proper DB2 Extended Security group.

[{«Product»:{«code»:»SSEPGG»,»label»:»Db2 for Linux, UNIX and Windows»},»Business Unit»:{«code»:»BU058″,»label»:»IBM Infrastructure w/TPS»},»Component»:»Programming Interface — .NET/.NET ADO»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»9.7;9.5;9.1;10.1;10.5;11.1″,»Edition»:»Enterprise Server;Express;Personal;Personal Developer’s;Workgroup Server»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Содержание

  1. SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3
  2. 5 ответы
  3. Sql1159 initialization error with db2 net data provider reason code 10
  4. Лучший отвечающий
  5. Вопрос
  6. Ответы
  7. Все ответы
  8. SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3
  9. 5 ответов
  10. SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 7, токены 9.5.0.DEF.2, SOFTWARE IBM DB2 InstalledCopies
  11. SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 2
  12. 4 ответы

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3

Я пытаюсь установить соединение с DB2 в консольном приложении. Работает нормально. когда я использую тот же код в службе, размещенной в IIS, он выдает ошибку для DB2. Ниже приведены сведения об ошибке. Мне не хватает некоторых разрешений в IIS?

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3

Если я пробую DSN с ODBC в консоли, он работает, но в IIS возникает другая ошибка.

ASP.NET V4.0 не имеет полномочий для выполнения запрошенной команды или операции.

думаю, это как-то связано с идентификацией пула приложений. Я установил идентификатор пула приложений как «Сетевая служба» и дал полное разрешение «Сетевой службе» на «IBM.Data.DB.dll» в C: Program Files IBM SQLLIB BIN netf20_32 Worked аккуратно. — Shetty

5 ответы

думаю, это как-то связано с идентификацией пула приложений. Я установил идентификатор пула приложений как «Сетевая служба» и дал полное разрешение «Сетевой службе» на «IBM.Data.DB.dll» в C: Program Files IBM SQLLIB BIN netf20_32 Worked аккуратно.

ключ заключается в том, чтобы убедиться, что костюм драйвера (той же версии) находится в PATH — цинкование

Посмотрите нижеприведенную документацию службы поддержки IBM, в которой рассказывается, почему это происходит и что означает сообщение. http://www-01.ibm.com/support/docview.wss?uid=swg21413731. Мне помогло то, что добавление в группу DB2USERS позволило нашему приложению работать и, вероятно, лучше, чем запускать его как сетевую службу.

ответ дан 10 мая ’13, 18:05

При установке клиента IBM Data Server вы не снимали флажок, чтобы включить защиту операционной системы.

Таким образом, вы должны добавить пользователей, которым необходимо использовать dll клиента DB2, в группу DB2USERS, как указано на последнем этапе установки.

Если вы хотите использовать удостоверение пула приложений IIS: «IIS AppPool DefaultAppPool». Добавьте этого пользователя в группу DB2USERS. DefaultAppPool-> имя идентификатора вашего пула приложений

Я столкнулся с очень похожим сообщением об ошибке в одном из моих проектов:

Попробовав все решения, перечисленные выше и на сайте документации IBM, в конечном итоге оказалось, что установщик DB2 Connect нужно запускать как администратор, а не как учетную запись пользователя. Удаление и повторная установка от имени администратора устранили проблему.

Запуск установщика от имени администратора также разблокировал такие параметры, как возможность отключения расширенной безопасности, которые ранее не были представлены.

У меня была такая же проблема с приложением, работающим на IIS Express. Пробовал запускать Visual Studio от имени администратора, и проблема решена. Версии: Клиент DB2 Версия 10.5, Visual Studio 2015.

Источник

Sql1159 initialization error with db2 net data provider reason code 10

Лучший отвечающий

Вопрос

По требованию Nikonorov Evgeniy создам новый топик.

в конце топика я задал вопрос про проблему регистрации провайдера от IBM.

OlegGel , подключаюсь я с хоста к бд, которая стоит на виртуальной машине.

строка подключения така :

ConnectionString = new OleDbConnection ( «DSN=SAMPLE;UID=db2admin;Server=192.168.100.27:50000;PWD=1234@T@!k;Provider=’IBMDADB2.1′» );

Повторюсь: При попытке подключения выдается ошибка, что провайдер не зарегистрован. Хотя я его даже вручную зарегистровал через cmd. ОС Windows 7 x64.

Заранее спасибо за помощь.

Ответы

Все вроде проблема решена.

Я просто запустил Visual от имени администратора.

В выводится такая ошибка

ERROR [08001] [IBM] SQL30081N Ошибка связи. Использованный протокол связи: «TCP/IP». Использованный API связи: «SOCKETS». Место, где обнаружена ошибка: «192.168.100.27». Функция связи, обнаружившая ошибку: «connect». Коды ошибки протокола связи: «10060», «*», «*». SQLSTATE=08001

Насколько я понимаю это просто он не может подключиться к базе так как сервер отключен.

Спасибо большое Megano , что помогали.

Все ответы

Может просто я не правильно написал имя провайдера. Тогда как его узнать ?

Попробуйте строку вида

Какой дальше в exception идет код ?

а лучше выложите полный стек ошибки и посмотрите сообщения в журналах Мои документы/DB2LOG

Источник

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3

Я пытаюсь установить соединение с DB2 в консольном приложении. Работает нормально. когда я использую тот же код в службе, размещенной в IIS, он выдает ошибку для DB2. Ниже приведены сведения об ошибке. Мне не хватает некоторых разрешений в IIS?

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3

Если я пробую DSN с ODBC в консоли, он работает, но в IIS возникает другая ошибка.

ASP.NET V4.0 не имеет полномочий для выполнения запрошенной команды или операции.

5 ответов

Думаю, это как-то связано с идентификацией пула приложений. Я установил идентификатор пула приложений как «Сетевая служба» и дал полное разрешение «Сетевой службе» на «IBM.Data.DB.dll» в C: Program Files IBM SQLLIB BIN netf20_32 Worked аккуратно.

Посмотрите нижеприведенный документ службы поддержки IBM, в котором объясняется, почему это происходит и что означает сообщение http://www-01.ibm.com/support/docview.wss?uid=swg21413731. Мне помогло то, что добавление в группу DB2USERS позволило нашему приложению работать и, вероятно, лучше, чем запускать его как сетевую службу.

При установке клиента IBM Data Server вы не снимали флажок, чтобы включить защиту операционной системы.

Таким образом, вы должны добавить пользователей, которым необходимо использовать dll клиента DB2, в группу DB2USERS, как указано на последнем этапе установки.

Если вы хотите использовать удостоверение пула приложений IIS: «IIS AppPool DefaultAppPool». Добавьте этого пользователя в группу DB2USERS. DefaultAppPool-> имя вашего пула приложений

Я столкнулся с очень похожим сообщением об ошибке в одном из моих проектов:

Попробовав все решения, перечисленные выше и на сайте документации IBM, в конечном итоге оказалось, что установщик DB2 Connect нужно запускать как администратор, а не как учетную запись пользователя. Удаление и повторная установка от имени администратора устранили проблему.

Запуск установщика от имени администратора также разблокировал такие параметры, как возможность отключения расширенной безопасности, которые ранее не были представлены.

У меня была такая же проблема с приложением, работающим на IIS Express. Пробовал запускать Visual Studio от имени администратора, и проблема решена. Версии: Клиент DB2 Версия 10.5, Visual Studio 2015.

Источник

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 7, токены 9.5.0.DEF.2, SOFTWARE IBM DB2 InstalledCopies

Я пытаюсь заставить поставщика данных DB2 из 32-битного приложения .Net подключиться к DB2, работающей как 32-битное приложение в Vista 64 (достаточно ли это сбивает с толку)? К сожалению, я получаю следующую ошибку:

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWAREIBMDB2InstalledCopies

Есть несколько упоминаний об этом в Сообщения на форуме IBM, но мало полезных указаний. Кто-нибудь испытывал такое раньше? Или у вас есть идеи получше, как это исправить?

Я смутно помню, что у меня была аналогичная проблема со звуком с драйвером oledb DB2 for as / 400 при попытке настроить связанный сервер с sql 2005 на as / 400. Это была проблема с разрешениями, и в конце концов я обнаружил, что только учетные записи sql-сервера (не Windows) могут использовать связанный сервер, потому что (я думаю) тогда драйвер загружался с использованием учетных данных sql вместо олицетворенных. Если он работает при запуске от имени администратора, тогда это должны быть разрешения.

К сожалению для вас, коды причин заканчиваются на 6, а не на 7. В нем говорится:

User response: There was a problem with your DB2 installation. If this is the first time DB2 was installed on this computer, review the install logs for any possible errors and run a repair of DB2 from the Add/Remove Programs control panel applet. The default location of the installation logs is the My Documents/DB2LOG folder of the user that performed the installation. If this does not resolve the issue please contact IBM Support and provide the reason code associated with this message along with any installation logs.

Поэтому я думаю, попробуйте переустановить его, и если проблема не исчезнет, ​​вам придется связаться с IBM.

Извините, я знаю, что это не очень помогает.

Источник

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 2

Я пытаюсь подключиться к DB2 из приложения .NET 2.0 на моем компьютере для разработки под управлением 7-разрядной версии Windows 64.

Я получаю эту ошибку в открытом методе. Не нашел решения.

ExceptionType: InvalidOperationException ExceptionMessage: SQL1159 Ошибка инициализации с помощью поставщика данных DB2 .NET, код причины 2, токены D: . bin db2app. dll, StackTrace: в IBM.Data.DB2.DB2ConnPool.Open (соединение DB2Connection, String & szConnectionString, DB2ConnSettings и ppSettings, Object и ppConn) в IBM.Data.DB2.DB2Connection.Open ()

задан 20 сен ’11, 08:09

4 ответы

Узнал об этом от моего коллеги. Проблема заключалась в том, что db2app.dll отсутствовал в каталоге bin папки приложения.

Скопировал db2app.dll и db2app64.dll из C: Program Files IBM SQLLIB BIN в папку bib приложения, и он работал нормально.

да, вам нужно убедиться, что костюм драйвера DB2 находится в ПУТИ — цинкование

См. «Ответ пользователя» внизу Документ IBM для SQL1159N, в котором также перечислены различные причины, по которым вы можете получить этот код ошибки:

При установке DB2 возникла проблема. Если это первая установка DB2 на этот компьютер, просмотрите журналы установки на предмет возможных ошибок и запустите восстановление DB2 с помощью апплета панели управления «Установка и удаление программ». Местоположение журналов установки по умолчанию — это папка Мои документы / DB2LOG пользователя, выполнившего установку. Если это не решит проблему, обратитесь в службу поддержки IBM и предоставьте код причины, связанный с этим сообщением, вместе со всеми журналами установки.

У меня был 32-разрядный клиент DB2, и я обращался к нему из веб-приложения, размещенного в IIS, с использованием пула приложений (для параметра «Включить 32-разрядное приложение» установлено значение false). В этом случае 64-битный клиент (db2app64.dll) ожидается, в то время как db2app.dll выдаст ошибку выше.

Просто к вашему сведению . Эту ошибку сложно отладить в Visual Studio, так как по умолчанию IIS Express использует 32-битный пул приложений. Чтобы изменить его на 64-битный, необходимо внести изменения в реестр (установить Use64BitIISExpress на 1). Для IIS Express нет inetmgr.

После разговора с IBM они настоятельно рекомендуют не помещать библиотеки DLL IBM в папку bin. Мы позволили IBM удаленно настроить наш сервер, и теперь все работает хорошо, и мы не должны помещать ibm * .dll в наши папки bin, иначе он не будет работать.

ответ дан 26 авг.

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками c# .net db2 or задайте свой вопрос.

Источник

Hi,

I have one utility on Custome Web Part using User controal.ascx.

here i am connectind IBM DB2 databse for inserting updating and deliting data.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: SQL1159  Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.0

Source Error:

i have ussing IB.Data.DB2 dll for coonecting db2 data abs e by connection string

<

add assembly=»IBM.Data.DB2, Version=9.0.0.1, Culture=neutral, PublicKeyToken=7C307B91AA13D208″/>

<

add key=»IBMDB2ConnectionString» value=»Server=****…:0;Database=C;UID=a;PWD=c7″/>

this is working fine with local usser operation but when other domain usse login  then get the error like:

Server Error in ‘/’ Application.


SQL1159  Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.5.0

Also i have geeting below error: 

Server Error in ‘/’ Application.


ERROR [] [IBM] SQL1092N  «PRAKASH» does not have the authority to perform the requested command.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: IBM.Data.DB2.DB2Exception: ERROR [] [IBM] SQL1092N  «PRAKASH» does not have the authority to perform the requested command.

Source Error:

Line 507:        pnlUpdateMobileNo.Visible = true;
Line 508:        DataSet ds = new DataSet();
Line 509:        ds = ExecuteDataset(System.Configuration.ConfigurationManager.AppSettings["IBMDB2ConnectionString"], CommandType.Text, "SELECT * FROM CONTACT_DETAILS where PHONE_NO= '" + OldNumber.ToString() + "'");
Line 510:
Line 511:        DataTable table = ds.Tables[0];

Source File: c:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATECONTROLTEMPLATESSMSSMSUserControl.ascx.cs    Line:
509

Stack Trace:

[DB2Exception (0x80004005): ERROR [] [IBM] SQL1092N  "PRAKASH" does not have the authority to perform the requested command.
]
   IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2, Object& A_3) +3603
   IBM.Data.DB2.DB2Connection.Open() +609
   MyChoice.Shared.MyChoiceIBMDB2DBTask.ExecuteDataset(String connectionString, CommandType commandType, String commandText, DB2Parameter[] commandParameters) +109
   SMSUserControl.MobileUpdateShow(String OldNumber) in c:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATECONTROLTEMPLATESSMSSMSUserControl.ascx.cs:509
   SMSUserControl.grdResult_RowCommand(Object sender, GridViewCommandEventArgs e) in c:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATECONTROLTEMPLATESSMSSMSUserControl.ascx.cs:413
   System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs e) +108
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +112
   System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207
   System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Please help me.


Hasan Jamal Siddiqui(MCTS),Share Point Application Developer,TCS

  • Edited by

    Wednesday, May 30, 2012 11:34 AM
    change

Update – 12-01-2010-  If you are running DB 9.7.2 you no longer need to do the following.  IBM has added the ability to connect 64 and 32 bit apps to a single client with Fix Pack 3.  Follow the links below for information.

http://www-01.ibm.com/support/docview.wss?uid=swg24028317

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14552668

So I ran into this error this week on our Server 2008 R2. So after a few days of troubleshooting I did find where the issue was. It appears that on 64 bit OS’s during installation of the DB2 32 bit client calls machine.config incorrectly.

So to fix this, you need to update machine.config manually.

1. Open machine.config in a text editor (notepad ++) as administrator

    For .NET 2.0 to 3.5

  • C:WindowsMicrosoft.NETFrameworkv2.0.50727CONFIGmachine.config
    For .NET 4.0

  • C:WindowsMicrosoft.NETFrameworkv4.0.30319CONFIGmachine.config

2. Add the following lines to <DbProviderFactories> of course correct for the version you are using. For this example I am using IBM DB2 .NET Data Provider 9.7.0

<add name=”IBM DB2 .NET Data Provider” invariant=”IBM.Data.DB2″ description=”IBM DB2 Data Provider for .NET Framework 2.0″ type=”IBM.Data.DB2.DB2Factory, IBM.Data.DB2, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208″/><add name=”IBM Informix .NET Data Provider” invariant=”IBM.Data.Informix” description=”IBM Informix Data Provider for .NET Framework 2.0″ type=”IBM.Data.Informix.IfxFactory, IBM.Data.Informix, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208″/><add name=”IBM DB2 .NET Data Provider 9.7.0″ invariant=”IBM.Data.DB2.9.7.0″ description=”IBM DB2 Data Provider 9.7.0 for .NET Framework 2.0″ type=”IBM.Data.DB2.DB2Factory, IBM.Data.DB2.9.7.0, Version=9.7.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208″/><add name=”IBM Informix .NET Data Provider 9.7.0″ invariant=”IBM.Data.Informix.9.7.0″ description=”IBM Informix Data Provider 9.7.0 for .NET Framework 2.0″ type=”IBM.Data.Informix.IfxFactory, IBM.Data.Informix.9.7.0, Version=9.7.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208″/>

3. Verify that you have IBM.Data.DB2 listed in <runtime> if not add the following. Again modify to the version you are installing

<runtime><assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″><dependentAssembly><assemblyIdentity name=”IBM.Data.DB2″ publicKeyToken=”7c307b91aa13d208″ culture=””/><bindingRedirect oldVersion=”8.1.2.0″ newVersion=”9.0.0.2″/><bindingRedirect oldVersion=”8.1.2.1″ newVersion=”9.0.0.2″/><bindingRedirect oldVersion=”9.0.0.1″ newVersion=”9.0.0.2″/></dependentAssembly><dependentAssembly><assemblyIdentity name=”IBM.Data.Informix” publicKeyToken=”7c307b91aa13d208″ culture=””/><bindingRedirect oldVersion=”3.0.0.2″ newVersion=”9.0.0.2″/><bindingRedirect oldVersion=”2.81.0.0″ newVersion=”9.0.0.2″/><bindingRedirect oldVersion=”9.0.0.1″ newVersion=”9.0.0.2″/></dependentAssembly><dependentAssembly><assemblyIdentity name=”IBM.Data.DB2.9.7.0″ publicKeyToken=”7c307b91aa13d208″ culture=””/><bindingRedirect oldVersion=”9.7.0.1″ newVersion=”9.7.0.2″/><codeBase version=”9.7.0.2″ href=”C:Program FilesIBMSQLLIBbinnetf20specificIBM.Data.DB2.9.7.0.dll”/></dependentAssembly><dependentAssembly><assemblyIdentity name=”IBM.Data.Informix.9.7.0″ publicKeyToken=”7c307b91aa13d208″ culture=””/><codeBase version=”9.7.0.2″ href=”C:Program FilesIBMSQLLIBbinnetf20specificIBM.Data.Informix.9.7.0.dll”/></dependentAssembly></assemblyBinding></runtime>

4. After that save, reboot and things should start working.

This entry was posted in Database and tagged DB2. Bookmark the permalink.

Я пытаюсь установить соединение с DB2 в консольном приложении. Работает нормально. когда я использую тот же код в службе, размещенной в IIS, он выдает ошибку для DB2. Ниже приведены сведения об ошибке. Мне не хватает некоторых разрешений в IIS?

dll: IBM.data.DB2.dll

Код:

DB2Connection db2Connection = new DB2Connection(connectionString);
DB2Command cmdSelectUsrNameAndPassword = new DB2Command(querySelectUsernameAndPassword, db2Connection);
cmdSelectUsrNameAndPassword.Connection.Open();

Броски:

SQL1159 Ошибка инициализации с поставщиком данных DB2 .NET, код причины 10, токены 0.0.0, 9.7.3

Если я пробую DSN с ODBC в консоли, он работает, но в IIS возникает другая ошибка.

OdbcConnection DbConnection = new OdbcConnection(DSNName);
DbConnection.Open();

Броски:

ASP.NET V4.0 не имеет полномочий для выполнения запрошенной команды или операции.

5 ответы

думаю, это как-то связано с идентификацией пула приложений. Я установил идентификатор пула приложений как «Сетевая служба» и дал полное разрешение «Сетевой службе» на «IBM.Data.DB.dll» в C: Program Files IBM SQLLIB BIN netf20_32 Worked аккуратно.

Создан 14 ноя.

Посмотрите нижеприведенную документацию службы поддержки IBM, в которой рассказывается, почему это происходит и что означает сообщение. http://www-01.ibm.com/support/docview.wss?uid=swg21413731. Мне помогло то, что добавление в группу DB2USERS позволило нашему приложению работать и, вероятно, лучше, чем запускать его как сетевую службу.

ответ дан 10 мая ’13, 18:05

При установке клиента IBM Data Server вы не снимали флажок, чтобы включить защиту операционной системы.

Таким образом, вы должны добавить пользователей, которым необходимо использовать dll клиента DB2, в группу DB2USERS, как указано на последнем этапе установки.

Если вы хотите использовать удостоверение пула приложений IIS: «IIS AppPool DefaultAppPool». Добавьте этого пользователя в группу DB2USERS. DefaultAppPool-> имя идентификатора вашего пула приложений

Создан 14 фев.

Я столкнулся с очень похожим сообщением об ошибке в одном из моих проектов:

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 10.1.5

Попробовав все решения, перечисленные выше и на сайте документации IBM, в конечном итоге оказалось, что установщик DB2 Connect нужно запускать как администратор, а не как учетную запись пользователя. Удаление и повторная установка от имени администратора устранили проблему.

Запуск установщика от имени администратора также разблокировал такие параметры, как возможность отключения расширенной безопасности, которые ранее не были представлены.

Создан 11 сен.

У меня была такая же проблема с приложением, работающим на IIS Express. Пробовал запускать Visual Studio от имени администратора, и проблема решена. Версии: Клиент DB2 Версия 10.5, Visual Studio 2015.

ответ дан 20 мая ’21, 21:05

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

asp.net
iis
db2

or задайте свой вопрос.

  •  
  • asp.net

  • iis

  • db2

  •  28-02-2021
  •  | 

  •  

Question

I am trying to open a connection to DB2 in console application. It works fine.
when I use the same code in a service, hosted in IIS it throws an error for DB2. Following is the error details. Am I missing some permissions in IIS ?

dll :IBM.data.DB2.dll

Code :

DB2Connection db2Connection = new DB2Connection(connectionString);
DB2Command cmdSelectUsrNameAndPassword = new DB2Command(querySelectUsernameAndPassword, db2Connection);
cmdSelectUsrNameAndPassword.Connection.Open();

Throws :

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.7.3

If I try a DSN with ODBC in console it works, but same throws another error in IIS.

OdbcConnection DbConnection = new OdbcConnection(DSNName);
DbConnection.Open();

Throws :

ASP.NET V4.0 does not have the authority to perform the requested command or operation.

Solution

guess it has something to do with App pool identity. I set the app pool identity as «Network service» and gave full permission to «Network Service» on «IBM.Data.DB.dll» in C:Program FilesIBMSQLLIBBINnetf20_32 Worked neat.

OTHER TIPS

While installing IBM data server client you did not uncheck the option to enable operating system security.

So you have to add the user(s), that need to use DB2 client dll, to DB2USERS group as it states in the final step of installation.

If you want IIS application pool identity use: «IIS AppPoolDefaultAppPool». Add that user to DB2USERS group.
DefaultAppPool-> your application pool identity name

I had the same problem with an application running from IIS Express. Tried running Visual Studio as administrator and problem solved.
Versions:
DB2 Client Version 10.5,
Visual Studio 2015.

I encountered a very similar error message on one of my projects:

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 10.1.5

Having tried all of the solutions listed above and on the IBM documentation site, it ultimately ended up just being the case that the DB2 Connect installer needed to be run as administrator, rather than as a user account. Uninstalling it and reinstalling it as administrator resolved the problem.

Running the installer as administrator also unlocked options such as the ability to turn off extended security which had previously not been presented.

Я использую IBM DB2 для LUW v10.5. webapi (приложение ASP.NET) — это имя приложения, размещенного в IIS. Обнаружена ошибка ниже при вызове методов webapi.

<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>The underlying provider failed on Open.</ExceptionMessage>
<ExceptionType>System.Data.EntityException</ExceptionType>
<StackTrace>
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) at System.Data.EntityClient.EntityConnection.Open() at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at WriteArrayOfPCMUSERToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract ) at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context) at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle) at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType) at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver) at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver) at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph) at System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content) at System.Net.Http.Formatting.XmlMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Owin.HttpMessageHandlerAdapter.<BufferResponseContentAsync>d__27.MoveNext()
</StackTrace>
<InnerException>
<Message>An error has occurred.</Message>
<ExceptionMessage>
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 10.5.4, Process Owner: IIS APPPOOLwebapi
</ExceptionMessage>
<ExceptionType>System.InvalidOperationException</ExceptionType>
<StackTrace>
at IBM.Data.DB2.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn) at IBM.Data.DB2.DB2Connection.Open() at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
</StackTrace>
</InnerException>
</Error>

Понравилась статья? Поделить с друзьями:
  • Sql ошибка 924
  • Sql ошибка 8152
  • Sql ошибка 3241
  • Sql ошибка 3041 серьезность 16 состояние 1
  • Sql ошибка 1364