Odbc ошибка подключения oracle

Windows Server 2012 R2 Datacenter Windows Server 2012 R2 Standard Windows Server 2012 R2 Essentials Windows Server 2012 R2 Foundation Windows 8.1 Enterprise Windows 8.1 Pro Windows 8.1 Windows Server 2012 Datacenter Windows Server 2012 Datacenter Windows Server 2012 Standard Windows Server 2012 Standard Windows Server 2012 Essentials Windows Server 2012 Foundation Windows Server 2012 Foundation Windows Server 2008 R2 Service Pack 1 Windows Server 2008 R2 Datacenter Windows Server 2008 R2 Standard Windows Server 2008 R2 Enterprise Windows Server 2008 R2 Foundation Windows Server 2008 R2 for Itanium-Based Systems Windows 7 Service Pack 1 Windows 7 Ultimate Windows 7 Enterprise Windows 7 Professional Windows 7 Home Premium Windows 7 Home Basic Windows 7 Starter Windows Server 2008 Service Pack 2 Windows Server 2008 Datacenter Windows Server 2008 Standard Windows Server 2008 Enterprise Windows Server 2008 Foundation Windows Server 2008 for Itanium-Based Systems Windows Vista Service Pack 2 Windows Vista Ultimate Windows Vista Enterprise Windows Vista Business Windows Vista Home Premium Windows Vista Home Basic Windows Vista Starter Еще…Меньше

В данной статье описывается проблема, возникающая при использовании Microsoft ODBC или драйвер OLE DB для Oracle или координатора распределенных транзакций (DTC) для подключения к базе данных Oracle в Windows 8.1, Windows Server 2012 R2, Windows Server 2012, Пакет обновления 1 (SP1) для Windows 7, Windows Server 2008 R2 с пакетом обновления 1, Пакет обновления 2 (SP2) для Windows Vista или Windows Server 2008 SP2. Перед установкой этого обновления прочтите раздел Предварительные условия.

Примечание проблема возникает после установки обновления для системы безопасности 3126587.

Как получить это обновление

Важным при установке языкового пакета после установки этого обновления, необходимо переустановить это обновление. Таким образом, рекомендуется установить все языковые пакеты, которые вам нужны, прежде чем установить данное обновление. Дополнительные сведения содержатся в статье Установка языковых пакетов для Windows.

Метод 1. Центр обновления Windows

Это обновление предоставляется как Рекомендуемые обновления через Центр обновления Windows. Для получения дополнительных сведений о том, как выполнить обновление Windows, узнайте, как получить обновления через Центр обновления Windows.

Метод 2. Центр загрузки Майкрософт

Следующие файлы доступны для скачивания из Центра загрузки Майкрософт:

Операционная система

Обновление

Для всех поддерживаемых 86-разрядных версий Windows 8.1

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows 8.1

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows Server 2012 R2

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows Server 2012

Download
Скачать пакет.

Для всех поддерживаемых 86-разрядных версий Windows 7

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows 7

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows Server 2008 R2

Download
Скачать пакет.

Всех поддерживаемых версий Windows Server 2008 R2

Download
Скачать пакет.

Для всех поддерживаемых 86-разрядных версий Windows Vista

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows Vista

Download
Скачать пакет.

Для всех поддерживаемых 86-разрядных версий Windows Server 2008

Download
Скачать пакет.

Для всех поддерживаемых 64-разрядных версий Windows Server 2008

Download
Скачать пакет.

Всех поддерживаемых версий Windows Server 2008 для систем на базе процессоров IA

Download
Скачать пакет.

Для получения дополнительных сведений о том, как загрузить файлы поддержки Майкрософт, выберите номер ниже для просмотра статьи базы знаний Майкрософт:

Как загрузить файлы поддержки Microsoft через оперативные службы 119591
Корпорация Майкрософт проверила этот файл на наличие вирусов. Корпорация Майкрософт использует последнее антивирусное программное обеспечение, доступное на период публикации файла. Файл хранится на защищенных серверах, что предотвращает его несанкционированное изменение.

Подробные сведения об обновлении

Предварительные условия

Сведения о реестре

Чтобы применить это обновление, не нужно вносить изменения в реестр.

Необходимость перезагрузки

Возможно потребуется перезагрузить компьютер после установки этого обновления.

Сведения о замене обновлений

Это обновление не заменяет ранее выпущенное обновление.

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Ссылки

Дополнительные сведения о терминологии , которую корпорация Майкрософт использует для описания обновлений программного обеспечения.

Продукты независимых производителей, обсуждаемые в этой статье, производятся компаниями, независимыми от корпорации Майкрософт. Корпорация Майкрософт не дает никаких явных или подразумеваемых гарантий относительно производительности или надежности этих продуктов.

Сведения о файлах

Для списка файлы, включенные в данное обновление для загрузки сведений о файле обновления 3147071.

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

Arrhhh!! I RAN INTO THIS AGAIN!!!

Just install ToadForOracle in C: or any directory without parenthesis in the path.


In my case its because I was on a x64 PC and still using the old Oracle 9i with the 32bit drivers!

I am using SQL Reporting Services with an Oracle Database. The problem is the brackets in the path to Visual Studio (BIDS). Oracle doesn’t like apps that start in a path with brackets:

RDBMS 10g XE problem with parenthesis in path

So I made a BAT file to open Visual Studio with Progra~2 as the short path name for «Program Files (x86)».

Here is the contents of the BAT file:

rem Progra~2 is short path name for "Program Files (x86)" and works around an Oracle client bug that doesn't like the ()'s in the path
start /B "C:Progra~2Microsoft Visual Studio 9.0Common7IDE" "C:Progra~2Microsoft Visual Studio 9.0Common7IDEdevenv.exe"

I name this BAT file StartBIDS.BAT and put it in the directory:

«C:Program FilesMicrosoft SQL ServerStart BIDS.bat»

Then I make a short cut to the BAT file on my Desktop and also my Start Menu and change the ShortCuts icon. This allows me to open TOAD, Visual Studio, BIDS and etc apps that I use to work with Oracle.

Update:

Alternatively make a Junction:

mklink /J "C:Program Files (x86)" "C:Program Files x86"

Then remove the brackets in the shortcut:

enter image description here

I’m trying to connect to an Oracle 19 database using unixODBC 2.3.7.
I’m using the Oracle Developer Days VirtualBox VM.

When trying to troubleshoot via isql I always get this error:

# isql -v -3 oracledsn

[HY000][unixODBC][Oracle][ODBC][Ora]ORA-12545: Connect failed because target host or object does not exist
[ISQL]ERROR: Could not SQLConnect

Sadly I can’t reproduce it now, but when last trying it I always had

[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
[ISQL]ERROR: Could not SQLConnect

This is the same error message I get from my (proprietary) C++ code, so I’m pretty sure the problem is just the connection settings.

I have checked https://www.connectionstrings.com/oracle/ but none of the combinations work.

Here are all my config settings:

# odbcinst -j                                                                                                                                            -130-

unixODBC 2.3.7
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /home/florian/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
# cat /usr/local/etc/odbcinst.ini

[oraclex]
Description     = Oracle ODBC driver for Oracle 19
Driver          = /mnt/libsqora.so.19.1
Setup           =
FileUsage       =
CPTimeout       =
CPReuse         =
Driver Logging  = 7

[ODBC]
Trace      = Yes
TraceFile  = /tmp/odbc.log
ForceTrace = Yes
Pooling    = No
DEBUG      = 1
# cat ~/.odbc.ini 

[oracledsn]
Driver = oraclex
Server = 10.1.6.19
Port = 1521
Uid = system
Pwd = oracle
Database = orclcdb/orcl/"<empty>"

ORA-12545: Connect failed because target host or object does not exist

I also tried ServerName

ServerName = //10.1.6.19/orclcdb or //10.1.6.19/orcl
[28000][unixODBC][Oracle][ODBC][Ora]ORA-01017: invalid username/password; logon denied

Here’s the /tmp/odbc.log:

[ODBC][18832][1564563250.044774][__handles.c][460]
                Exit:[SQL_SUCCESS]
                        Environment = 0x1fd7780
[ODBC][18832][1564563250.044854][SQLSetEnvAttr.c][189]
                Entry:
                        Environment = 0x1fd7780
                        Attribute = SQL_ATTR_ODBC_VERSION
                        Value = 0x3
                        StrLen = 0
[ODBC][18832][1564563250.044886][SQLSetEnvAttr.c][381]
                Exit:[SQL_SUCCESS]
[ODBC][18832][1564563250.044914][SQLAllocHandle.c][377]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x1fd7780
[ODBC][18832][1564563250.044944][SQLAllocHandle.c][493]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x1fd8090
[ODBC][18832][1564563250.044983][SQLConnect.c][3721]
                Entry:
                        Connection = 0x1fd8090
                        Server Name = [oracledsn][length = 9 (SQL_NTS)]
                        User Name = [NULL]
                        Authentication = [NULL]
                UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UCS-2LE'

                DIAG [HY000] [Oracle][ODBC][Ora]ORA-12545: Connect failed because target host or object does not exist


[ODBC][18832][1564563250.082037][SQLConnect.c][4244]
                Exit:[SQL_ERROR]
[ODBC][18832][1564563250.082070][SQLGetDiagRec.c][677]
                Entry:
                        Connection = 0x1fd8090
                        Rec Number = 1
                        SQLState = 0x7fffeabcac60
                        Native = 0x7fffeabcac5c
                        Message Text = 0x7fffeabcac70
                        Buffer Length = 500
                        Text Len Ptr = 0x7fffeabcac5a
[ODBC][18832][1564563250.082092][SQLGetDiagRec.c][726]
                Exit:[SQL_SUCCESS]
                        SQLState = HY000
                        Native = 0x7fffeabcac5c -> 12545
                        Message Text = [[unixODBC][Oracle][ODBC][Ora]ORA-12545: Connect failed because target host or object does not exist

I’ve also been trying out this C code from https://www.easysoft.com/developer/languages/c/odbc_tutorial.html#connect_full — basically the same result.

# cat test2.c
#   compile with gcc -I ../include test2.c -o test2 -lodbc

#include <stdio.h>                                                              
#include <sql.h>                                                                
#include <sqlext.h>                                                             

/*                                                                              
 * see Retrieving ODBC Diagnostics                                              
 * for a definition of extract_error().                                         
 */                                                                             
static void extract_error(                                                      
    char *fn,                                                                   
    SQLHANDLE handle,                                                           
    SQLSMALLINT type);                                                          

main() {                                                                        
  SQLHENV env;                                                                  
  SQLHDBC dbc;                                                                  
  SQLHSTMT stmt;                                                                
  SQLRETURN ret; /* ODBC API return status */                                   
  SQLCHAR outstr[1024];                                                         
  SQLSMALLINT outstrlen;                                                        

  /* Allocate an environment handle */                                          
  SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);                        
  /* We want ODBC 3 support */                                                  
  SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);          
  /* Allocate a connection handle */                                            
  SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc);                                    
  /* Connect to the DSN mydsn */                                                
  ret = SQLDriverConnect(dbc, NULL, "DSN=oracledsn;", SQL_NTS,                  
                         outstr, sizeof(outstr), &outstrlen,                    
                         SQL_DRIVER_COMPLETE);                                  
  if (SQL_SUCCEEDED(ret)) {                                                     
    printf("Connectedn");                                                      
    printf("Returned connection string was:nt%sn", outstr);                  
    if (ret == SQL_SUCCESS_WITH_INFO) {                                         
      printf("Driver reported the following diagnosticsn");                    
      //extract_error("SQLDriverConnect", dbc, SQL_HANDLE_DBC);                 
    }                                                                           
    SQLDisconnect(dbc);               /* disconnect from driver */              
  } else {                                                                      
    fprintf(stderr, "Failed to connectn");                                     
    //extract_error("SQLDriverConnect", dbc, SQL_HANDLE_DBC);                   
  }                                                                             
  /* free up allocated handles */                                               
  SQLFreeHandle(SQL_HANDLE_DBC, dbc);                                           
  SQLFreeHandle(SQL_HANDLE_ENV, env);                                           
}

As another point reference I can connect to said Oracle Dev VM with sqlplus from another machine like this:

./sqlplus sys/oracle@10.1.6.19/orclcdb as sysdba

SQL>

./sqlplus system/oracle@10.1.6.19/orclcdb

SQL>

On the VM I have a file /u01/app/oracle/product/version/db_1/network/admin/tnsnames.ora but I am not completely sure if I also need one on the client?

ORCLCDB=localhost:1521/orclcdb
ORCL=
 (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

After bashing my head for a good while, I could make the ODBC 32 bits run. It was the VC ++ 2013 Redistributable.

My install is version 12.2.0.1.0. I can’t believe how stupidly hard it is to get the simple ODBC. You must uncompress the Instant CLient plus ODBC in the same folder and then manually install VCRedist to get this running. GEEEZ.

UPDATE:
Adding a few extra details on my exact steps:

Download Oracle Instant client from the download portal:

Make sure you download the version that you need: X64 or X32. NOTE: DO NOT MIX THE x64 and X32 folders!!!

After you choose the x64 or x86 version, you will be presented with a huge list of packages. You want to make sure you scroll down to the proper version, in my case, it was 12.2.0.1.0.

You must download 2 packages:

  • Basic Package
  • ODBC Package

If you are installing x32 and x64, you must then download 4 packages:

  • Basic Package x32
  • ODBC Package x32
  • Basic Package x64
  • ODBC Package x64

Then, download and install VCredist 2010 and VCredist 2013. Here is a good resource to download them, for x32 you must install x32 bits VCRedist.

Then, you must uncompress the Basic and ODBC package in the same folder. DO NOT MIX x32 and x64, you must create separate folders if you are going to install both bit parity versions.

Then, open CMD as administrator, navigate to your uncompressed folder and run odbc_install.exe.

Then go to ODBC Datasources (Start menu, type ODBC) and add a new DSN, you will be presented with the Oracle ODBC screen.
Here is a tutorial to create the DSN:

That’s it! the key part here is the VCRedist, if you don’t have it, you will have the error stated by the Original Poster.

  • Remove From My Forums
  • Question

  • I’ve been struggling to re-set up my ODBC for Oracle connection. My new laptop is Windows 10 pro, 64-bit. I’m running Access 2016. 

    I’ve been tinkering with the properties based on googling around. Below is a common solution provided, but it does not work. 

    Go to control panel -> administrative tools –> select data sources(ODBC) –> then right click on that file –> go to properties –> in the shortcut tab -> change the path from %windir%System32odbcad32.exe to %windir%SysWOW64odbcad32.exe

    Does anyone know how to resolve?

Понравилась статья? Поделить с друзьями:
  • Odbc ошибка компас
  • Odbc ошибка вызова access
  • Odbc sql server driver ошибка безопасности ssl
  • Odb 1 ошибки
  • Oculus произошла непредвиденная ошибка ovr40779122