Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Why is my connection from Oracle 12c to PostgreSQL not working?

user2783794Oct 20 2015 — edited Oct 23 2015

My connection from Oracle 12c to PostgreSQL is returning the following:

select * from "test"@PG_LINK

                     *

ERROR at line 1:

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:

[unixODBC]connction string lacks some options {08001,NativeErr = 202}

ORA-02063: preceding 2 lines from PG_LINK

Here is my setup.  Anyone have a time to take a look?

.odbc.ini

[ODBC Data Sources]

  PG_LINK=PostgreSQL

[PG_LINK]

Debug=255

  CommLog=1

  ReadOnly=no

  Driver=/usr/pgsql-9.4/lib/psqlodbcw.so

  Servername=<remove IP address>

  FetchBufferSize=99

  Username=csm_test

  Password=<removed>

  Port=5432

  Database=postgres

  TRACE=Yes

  TraceFile=/tmp/sql.log

  Protocol=7.4

  sslmode=disable

[Default]

  Driver=/usr/lib64/liboplodbcS.so.1

initPG_LINK.ora

HS_FDS_CONNECT_INFO = PG_LINK

HS_FDS_TRACE_LEVEL = 255

HS_FDS_SHAREABLE_NAME=/ora/dba/work/unixODBC/lib/libodbc.so

HS_LANGUAGE=american_america.we8iso8859p1

HS_NLS_NCHAR=UCS2

set ODBCINI=/u01/app/oracle/.odbc.ini

Generated trace file: PG_LINK_agt_13870.trc

Oracle Corporation --- TUESDAY   OCT 20 2015 15:04:11.308

Heterogeneous Agent Release

  1. 12.1.0.2.0

Oracle Corporation --- TUESDAY   OCT 20 2015 15:04:11.307

    Version 12.1.0.2.0

Entered hgogprd

HOSGIP for "HS_FDS_TRACE_LEVEL" returned "255"

Entered hgosdip

setting HS_OPEN_CURSORS to default of 50

setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"

setting HS_FDS_RECOVERY_PWD to default value

setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG

setting HS_IDLE_TIMEOUT to default of 0

setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"

HOSGIP returned value of "UCS2" for HS_NLS_NCHAR

setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"

setting HS_FDS_DATE_MAPPING to default of "DATE"

setting HS_RPC_FETCH_REBLOCKING to default of "ON"

setting HS_FDS_FETCH_ROWS to default of "100"

setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"

setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"

setting HS_FDS_PROC_IS_FUNC to default of "FALSE"

setting HS_FDS_MAP_NCHAR to default of "TRUE"

setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"

setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"

setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"

setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"

setting HS_FDS_QUERY_DRIVER to default of "TRUE"

setting HS_FDS_SUPPORT_STATISTICS to default of "FALSE"

setting HS_FDS_QUOTE_IDENTIFIER to default of "TRUE"

setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"

setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"

setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"

Default value of 64 assumed for HS_FDS_SQLLEN_INTERPRETATION

setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo;gtw$:OPTTables;gtw$:OPTColumns;gtw$:OPTPrimaryKeys;gtw$:OPTForeignKeys;gtw$:OPTProcedures;gtw$:OPTStatistics"

setting HS_FDS_DELAYED_OPEN to default of "TRUE"

setting HS_FDS_WORKAROUNDS to default of "0"

setting HS_WORKAROUNDS to default of "0"

Exiting hgosdip, rc=0

ORACLE_SID is "PG_LINK"

Product-Info:

  Port Rls/Upd:2/0 PrdStat:0

  Agent:Oracle Database Gateway for ODBC

  Facility:hsa

  Class:ODBC, ClassVsn:12.1.0.2.0_0023, Instance:PG_LINK

Exiting hgogprd, rc=0

hostmstr:          0: HOA After hoagprd

hostmstr:          0: HOA Before hoainit

Entered hgoinit

HOCXU_COMP_CSET=1

HOCXU_DRV_CSET=31

HOCXU_DRV_NCHAR=1000

HOCXU_DB_CSET=873

HS_LANGUAGE is american_america.we8iso8859p1

rc=32512 attempting to get LANG environment variable.

HOCXU_SEM_VER=121000

HOCXU_VC2_MAX=4000

HOCXU_RAW_MAX=2000

Entered hgolofn at 2015/10/20-15:04:11

HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/ora/dba/work/unixODBC/lib/libodbc.so"

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLAllocHandle

symbol_peflctx=0xdc741040

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLBindCol

symbol_peflctx=0xdc741180

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLBindParameter

symbol_peflctx=0xdc741970

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLCancel

symbol_peflctx=0xdc742c20

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLDescribeParam

symbol_peflctx=0xdc74adb0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLDisconnect

symbol_peflctx=0xdc74b220

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLEndTran

symbol_peflctx=0xdc74ddd0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLExecute

symbol_peflctx=0xdc74f420

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLFetch

symbol_peflctx=0xdc74fc10

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLFreeHandle

symbol_peflctx=0xdc7516a0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLFreeStmt

symbol_peflctx=0xdc7516c0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetData

symbol_peflctx=0xdc752cb0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetEnvAttr

symbol_peflctx=0xdc756050

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetFunctions

symbol_peflctx=0xdc7563c0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLMoreResults

symbol_peflctx=0xdc757e20

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLNumResultCols

symbol_peflctx=0xdc758a30

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLParamData

symbol_peflctx=0xdc758d50

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLPutData

symbol_peflctx=0xdc75ac30

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLRowCount

symbol_peflctx=0xdc75b060

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLSetEnvAttr

symbol_peflctx=0xdc75cfe0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLSetDescRec

symbol_peflctx=0xdc75cd90

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLColAttribute

symbol_peflctx=0xdc743720

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLColumns

symbol_peflctx=0xdc744f40

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLConnect

symbol_peflctx=0xdc748960

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLDescribeCol

symbol_peflctx=0xdc74a6c0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLDriverConnect

symbol_peflctx=0xdc74bda0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLExecDirect

symbol_peflctx=0xdc74ee50

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLForeignKeys

symbol_peflctx=0xdc750520

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetConnectAttr

symbol_peflctx=0xdc7519f0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetDescField

symbol_peflctx=0xdc7533d0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetDescRec

symbol_peflctx=0xdc753930

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetDiagField

symbol_peflctx=0xdc754c40

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetDiagRec

symbol_peflctx=0xdc755870

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetInfo

symbol_peflctx=0xdc756db0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetStmtAttr

symbol_peflctx=0xdc757060

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLGetTypeInfo

symbol_peflctx=0xdc757a90

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLPrepare

symbol_peflctx=0xdc7594d0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLPrimaryKeys

symbol_peflctx=0xdc7599e0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLProcedureColumns

symbol_peflctx=0xdc759fd0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLProcedures

symbol_peflctx=0xdc75a670

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLSetConnectAttr

symbol_peflctx=0xdc75b320

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLSetStmtAttr

symbol_peflctx=0xdc75e360

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLSetDescField

symbol_peflctx=0xdc75c9d0

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLStatistics

symbol_peflctx=0xdc75fc30

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Entered hgolofns at 2015/10/20-15:04:11

libname=/ora/dba/work/unixODBC/lib/libodbc.so, funcname=SQLTables

symbol_peflctx=0xdc760920

hoaerr:0

Exiting hgolofns at 2015/10/20-15:04:11

Exiting hgolofn, rc=0 at 2015/10/20-15:04:11

HOSGIP for "HS_OPEN_CURSORS" returned "50"

HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"

HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"

HOSGIP for "HS_NLS_NUMERIC_CHARACTERS" returned ".,"

HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"

HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"

HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"

HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"

HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"

Invalid value of 64 given for HS_FDS_SQLLEN_INTERPRETATION

treat_SQLLEN_as_compiled = 1

Exiting hgoinit, rc=0 at 2015/10/20-15:04:11

hostmstr:          0: HOA After hoainit

hostmstr:          0: HOA Before hoalgon

Entered hgolgon at 2015/10/20-15:04:11

reco:0, name:csm_test, tflag:0

Entered hgosuec at 2015/10/20-15:04:11

Exiting hgosuec, rc=0 at 2015/10/20-15:04:11

HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"

HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"

HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"

HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"

HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"

HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"

HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"

HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"

HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"

using csm_test as default schema

HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"

Entered hgocont at 2015/10/20-15:04:11

HS_FDS_CONNECT_INFO = "PG_LINK"

RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"

Entered hgogenconstr at 2015/10/20-15:04:11

dsn:PG_LINK, name:csm_test

optn:

Entered hgocip at 2015/10/20-15:04:11

dsn:PG_LINK

Exiting hgocip, rc=0 at 2015/10/20-15:04:11

##>Connect Parameters (len=37)<##

## DSN=PG_LINK;

#! UID=csm_test;

#! PWD=*

Exiting hgogenconstr, rc=0 at 2015/10/20-15:04:11

Entered hgopoer at 2015/10/20-15:04:11

hgopoer, line 240: got native error 202 and sqlstate 08001; message follows...

[unixODBC]connction string lacks some options {08001,NativeErr = 202}

Exiting hgopoer, rc=0 at 2015/10/20-15:04:11

hgocont, line 2812: calling SqlDriverConnect got sqlstate 08001

Exiting hgocont, rc=28500 at 2015/10/20-15:04:11 with error ptr FILE:hgocont.c LINE:2832 ID:Something other than invalid authorization

Exiting hgolgon, rc=28500 at 2015/10/20-15:04:11 with error ptr FILE:hgolgon.c LINE:751 ID:Calling hgocont

hostmstr:          0: HOA After hoalgon

RPC Calling nscontrol(0), rc=0

hostmstr:          0: RPC Before Exit Agent

hostmstr:          0: HOA Before hoaexit

Entered hgoexit at 2015/10/20-15:04:11

Exiting hgoexit, rc=0

hostmstr:          0: HOA After hoaexit

hostmstr:          0: RPC After Exit Agent

Entered horcrces_CleanupExtprocSession at 2015/10/20-15:04:11

Entered horcrpooe_PopOciEnv at 2015/10/20-15:04:11

Entered horcrfoe_FreeOciEnv at 2015/10/20-15:04:11

Exiting horcrfoe_FreeOciEnv at 2015/10/20-15:04:11

Entered horcrfse_FreeStackElt at 2015/10/20-15:04:11

Exiting horcrfse_FreeStackElt at 2015/10/20-15:04:11

Exiting horcrpooe_PopOciEnv at 2015/10/20-15:04:11

Exiting horcrces_CleanupExtprocSession at 2015/10/20-15:04:11

Generated /tmp/sql.log file

$ more sql.log

[ODBC][13870][1445367851.328257][SQLSetConnectAttr.c][396]

                Entry:

                        Connection = 0x167eccc0

                        Attribute = SQL_ATTR_AUTOCOMMIT

                        Value = (nil)

                        StrLen = -5

[ODBC][13870][1445367851.328328][SQLSetConnectAttr.c][671]

                Exit:[SQL_SUCCESS]

[ODBC][13870][1445367851.328861][SQLDriverConnect.c][728]

                Entry:

                        Connection = 0x167eccc0

                        Window Hdl = (nil)

                        Str In = [DSN=PG_LINK;UID=csm_test;PWD=********][length = 37]

                        Str Out = 0x167eeda8

                        Str Out Max = 1024

                        Str Out Ptr = 0x7fffb8d3d3d0

                        Completion = 0

                UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UCS-2LE'

                DIAG [08001] connction string lacks some options

[ODBC][13870][1445367851.346106][SQLDriverConnect.c][1454]

                Exit:[SQL_ERROR]

[ODBC][13870][1445367851.346277][SQLGetDiagRec.c][686]

                Entry:

                        Connection = 0x167eccc0

                        Rec Number = 1

                        SQLState = 0x7fffb8d3d040

                        Native = 0x7fffb8d3cdf4

                        Message Text = 0x7fffb8d3ce00

                        Buffer Length = 510

                        Text Len Ptr = 0x7fffb8d3cdf2

[ODBC][13870][1445367851.346325][SQLGetDiagRec.c][723]

Exit:[SQL_SUCCESS]

                        SQLState = 08001

                        Native = 0x7fffb8d3cdf4 -> 202

                        Message Text = [[unixODBC]connction string lacks some options]

[ODBC][13870][1445367851.346404][SQLGetDiagRec.c][686]

                Entry:

                        Connection = 0x167eccc0

                        Rec Number = 2

                        SQLState = 0x7fffb8d3d040

                        Native = 0x7fffb8d3cdf4

                        Message Text = 0x7fffb8d3ce00

                        Buffer Length = 510

                        Text Len Ptr = 0x7fffb8d3cdf2

[ODBC][13870][1445367851.346438][SQLGetDiagRec.c][723]

                Exit:[SQL_NO_DATA]

[ODBC][13870][1445367851.346579][SQLDisconnect.c][208]

                Entry:

                        Connection = 0x167eccc0

[ODBC][13870][1445367851.346614][SQLDisconnect.c][237]Error: 08003

[ODBC][13870][1445367851.346714][SQLFreeHandle.c][284]

                Entry:

                        Handle Type = 2

                        Input Handle = 0x167eccc0

[ODBC][13870][1445367851.346748][SQLFreeHandle.c][333]

                Exit:[SQL_SUCCESS]

[ODBC][13870][1445367851.348941][SQLFreeHandle.c][219]

                Entry:

                        Handle Type = 1

                        Input Handle = 0x167d9f30

This post has been answered by Mkirtley-Oracle on Oct 21 2015
Jump to Answer

Comments

mxallen-Oracle

Are you able to test you ODBC DSN connection to PostgreSQL external of Oracle?

If the same error shows there, the issue is with the ODBC driver configuration and not DG4ODBC.

You would need to check into that with the ODBC vendor in that case.  So, check that out first.

Also, make sure you are using the 64-bit version of the unixODBC driver manager

Regards,

Matt

Mkirtley-Oracle

Hi,

  As Matt asked could you confirm that you can connect using ISQL or similar and that you are using a 64-bit driver and ODBC driver manager.
However, could you also review this thread for the same error -

[Oracle to PostgreSQL]connction string lacks some options

and check -

- that the user running the select and that started the gateway listener can access /u01/app/oracle/.odbc.ini

- that the ODBC driver manager has been correctly compiled

If you still have problems could you upload the listener.ora file ?

Regards,

Mike

user2783794

Matt,

I ran odbcinst -j and have the following:

unixODBC 2.3.4

DRIVERS............: /ora/dba/work/unixODBC/etc/odbcinst.ini

SYSTEM DATA SOURCES: /ora/dba/work/unixODBC/etc/odbc.ini

FILE DATA SOURCES..: /ora/dba/work/unixODBC/etc/ODBCDataSources

USER DATA SOURCES..: /opt/oracle/.odbc.ini

SQLULEN Size.......: 8

SQLLEN Size........: 8

SQLSETPOSIROW Size.: 8

It fails when I run isql:

$ isql -v PG_LINK

[IM002][unixODBC]Missing database name in call to CC_connect.

[ISQL]ERROR: Could not SQLConnect

The /etc/odbc.ini has the following:

[PG_LINK]

  Debug=Debug

  CommLog=1

  ReadOnly=no

  Driver=/usr/pgsql-9.4/lib/psqlodbc.so

  Servername=<cut>

  FetchBufferSize=99

  Username=<cut>

  Password=<cut>

  Port=5432

  Database=postgres

  TRACE=Yes

  TraceFile=/tmp/sql.log

  Protocol=7.4

What am I missing?

I attached the output from: strace -fae -o trace_out.log ../bin/isql -v PG_LINK

mxallen-Oracle

The issue is with the ODBC driver configuration.  The best place to check is in PostgreSQL documentation or with PostgreSQL

about what the issue might be.

At this point, you are not even getting into the DG4ODBC configuration.

Regards,

Matt

Mkirtley-Oracle
Answer

Hi,

  It could be either the odbc.ini information is not correct but could you also check that you set the 'env' variables LD_LIBRARY_PATH and ODBCINI to point to the location of the files.

Regards,

Mike

Marked as Answer by user2783794 · Sep 27 2020
user2783794

Agree.

My odbc.ini

[DB]

  Description=PostgreSQL

  Driver=PostgreSQL

  ServerName=<cut>

  Database=postgres

  UserName=postgres

  Password=<cut>

  Port=5432

My odbcinst.ini file

[ODBC]

Trace=Yes

traceFile=/tmp/sql.log

[PostgreSQL]

Description=ODBC for PostgreSQL

Driver=/usr/pgsql-9.4/lib/psqlodbc.so

FileUsage=1

When I run it:

$ isql -v DB

[IM002][unixODBC]Missing database name in call to CC_connect.

[ISQL]ERROR: Could not SQLConnect

user2783794

Thank you for your help!!

Mkirtley-Oracle

Hi,

  The problem is happening without Oracle being involved.  I tried a web search and found various hits but your best option is to follow it up with Postgres to check what the ODBC settings should be for the connection to work using 'isql'.

We can try to help but to do this upload an ODBC trace and let us know the 'env' settings when you try 'isql'.

Regards,

Mike

1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 20 2015
Added on Oct 20 2015
8 comments
2,408 views