Comunidad Oracle Hispana

Estimados Colegas DBA's,

El motivo del presente mail, tiene la finalidad de poder obtener retroalimentacion acerca de una problematica que se me esta presentado en la conexion de una base de datos oracle a mysql.

La manera en la cual estoy haciendo la conexion es mediante HS (Heterogeneous Services), atravez de dg4odbc.

 

El SO es Oracle Linux 7.1 x64 y Oracle Database 11g R2 11.2.0.4

 

Anexo Configuraciones:

 

Log HS:

 

[oracle@oracle log]$ cat DEMO_agt_4641.trc

 

Oracle Corporation --- THURSDAY  SEP 15 2016 11:21:26.188

 

Heterogeneous Agent Release

11.2.0.4.0

 

 

 

Oracle Corporation --- THURSDAY  SEP 15 2016 11:21:26.188

 

 

    Version 11.2.0.4.0

 

 

Entered hgogprd

HOSGIP for "HS_FDS_TRACE_LEVEL" returned "debug"

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"

setting HS_NLS_NCHAR to default of "AL32UTF8"

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"

setting HS_FDS_DELAYED_OPEN to default of "TRUE"

setting HS_FDS_WORKAROUNDS to default of "0"

Exiting hgosdip, rc=0

ORACLE_SID is "DEMO"

Product-Info:

  Port Rls/Upd:4/0 PrdStat:0

  Agent:Oracle Database Gateway for ODBC

  Facility:hsa

  Class:ODBC, ClassVsn:11.2.0.4.0_0019, Instance:DEMO

Exiting hgogprd, rc=0

Entered hgoinit

HOCXU_COMP_CSET=1

HOCXU_DRV_CSET=46

HOCXU_DRV_NCHAR=873

HOCXU_DB_CSET=46

HS_LANGUAGE not specified

LANG=es_MX.utf8

HOCXU_SEM_VER=112000

Entered hgolofn at 2016/09/15-11:21:26

HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/lib/libmyodbc5.so"

Entered hgolofns at 2016/09/15-11:21:26

hoaerr:28500

Exiting hgolofns at 2016/09/15-11:21:26

Failed to load ODBC library symbol: /usr/lib/libmyodbc5.so(SQLAllocHandle)

Exiting hgolofn, rc=28500 at 2016/09/15-11:21:26

Exiting hgoinit, rc=28500 with error ptr FILE:hgoinit.c LINE:424 FUNCTION:hgoinit() ID:Loading ODBC aray of function ptrs

Entered hgoexit

HS Gateway:  NULL connection context at exit

Exiting hgoexit, rc=0 with error ptr FILE:hgoexit.c LINE:113 FUNCTION:hgoexit() ID:Connection context

 

 

 

Configuracion initDEMO.ora

 

[oracle@oracle admin]$ cat initDEMO.ora

# This is a sample agent init file that contains the HS parameters that are

# needed for the Database Gateway for ODBC

 

 

#

# HS init parameters

#

HS_FDS_CONNECT_INFO = DEMO

HS_FDS_TRACE_LEVEL = debug

HS_FDS_SHAREABLE_NAME = /usr/lib/libmyodbc5.so

 

#

# ODBC specific environment variables

#

set ODBCINI= /etc/odbc.ini

 

#

# Environment variables required for the non-Oracle system

#

#set <envvar>=<value>

 

 

Configuracion del Listener

 

[oracle@oracle admin]$ cat listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

 

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (GLOBAL_DBNAME = db01)

      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)

      (SID_NAME = db01)

    )

    (SID_DESC =

      (GLOBAL_DBNAME = DEMO)

      (PROGRAM = dg4odbc)

      (ENVS = LD_LIBRARY_PATH =/usr/lib64:/usr/lib)

      (SID_NAME = DEMO)

      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)

    )

  )

 

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.8.10)(PORT = 1521))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

  )

 

 

ADR_BASE_LISTENER = /u01/app/oracle

 

 

Configuracion del tnsnames:

[oracle@oracle admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

 

DEMO =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.8.10)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SID = DEMO)

    )

    (HS = OK)

  )

 

 

DB01 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.8.10)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = db01)

    )

  )

 

 

Configuracion Conector mysql:

 

[oracle@oracle admin]$ cat /etc/odbcinst.ini

# Example driver definitions

# Driver from the mysql-connector-odbc package

# Setup from the unixODBC package

 

[MySQL]

Description = ODBC for MySQL

Driver = /usr/lib/libmyodbc5.so

Setup = /usr/lib/libodbcmyS.so

Driver64 = /usr/lib64/libmyodbc5.so

Setup64 = /usr/lib64/libodbcmyS.so

FileUsage = 1

 

[oracle@oracle admin]$

 

 

Al tratar de hacer la consulta me indica el siguiente error:

 

[oracle@oracle admin]$ sqlplus  / as sysdba

 

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 15 11:42:14 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select * from "nombretabla"@DEMO;

 

select * from "nombretabla"@DEMO

                        *

ERROR at line 1:

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

ORA-02063: preceding line from DEMO

 

 

Espero poder Contar con su apoyo para resolver esta problematica.

 

 

Saludos

Visitas: 128

Responde a esto

Respuestas a esta discusión

Hola,

Hace tiempo tuve esta misma necesidad y conseguí resolverlo con éxito.

Aquí tienes todos los pasos que  seguí:

http://comunidadoraclehispana.ning.com/forum/topics/conexi-n-a-mysq...

Ahora bien, yo estaba usando un Sistema GNU / Linux CentOS, puede ser que en Debian cambien algunas cosas. Puedes tomar este minitutorial como referencia.

 

Un saludo,

Gracias Isaac Naranjo, lo probare, el SO que utilizo es Oracle Linux 7, ahora bien he colocado el fichero init<SID>.ora de la siguiente manera: 

initDEMO.ora  pero al parecer debe de ser initdemo.ora es decir en minuscula...¿?

Lo probare y te comento 

Saludos

Aun no puedo hacer la conexion con la Base de datos MySQL.

He seguido los pasos de acuerdo a lo que me indican en el documento y la respuesta es la misma.

Alguna recomendación.

Saludos

Aun no puedo hacer la conexion con la Base de datos MySQL.

He seguido los pasos de acuerdo a lo que me indican en el documento y la respuesta es la misma.

Alguna recomendación.

Aun no puedo hacer la conexion con la Base de datos MySQL.

He seguido los pasos de acuerdo a lo que me indican en el documento y la respuesta es la misma.

Alguna recomendación.

Responder a debate

RSS

Siguenos en Twitter

Escucha nuestro podcast!

Eventos

Insignia

Cargando…

© 2017   Creado por Fernando Garcia.   Tecnología de

Insignias  |  Informar un problema  |  Términos de servicio