configure HS from oracle to postgres

Rinka777
Дата: 14.10.2015 15:08:26
Installing : postgresql94-odbc 1/1

Installed:
postgresql94-odbc.i386 0:09.03.0400-1PGDG.rhel5

cat $ORACLE_HOME/odbc.ini
[ODBC Data Sources]
PG_LINK         =       PostgreSQL

[PG_LINK]
Debug           =       1
CommLog         =       1
Description     =       to Postgres
Driver              = /usr/pgsql-9.4/lib/psqlodbc.so
Database            = postgres
Servername          = 10.0.1.6
UserName            = postgres
Password            = postgres
Port                = 5433
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
QuotedId            = No
FetchBufferSize = 99

[Default]
Driver = /usr/lib/liboplodbcS.so.1


cat $ORACLE_HOME/hs/admin/initPG_LINK.ora

HS_FDS_CONNECT_INFO = PG_LINK
HS_FDS_TRACE_LEVE = OFF
HS_FDS_TRACE_FILE_NAME = /tmp/odbc_trace.trc
HS_FDS_SHAREABLE_NAME = /usr/lib/libodbc.so
set ODBCINI=/etc/odbc.ini


 cat $ORACLE_HOME/network/admin/tnsnames.ora

PG_LINK =
  (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = bi-6.bi.ru) (PORT = 1523))
  (CONNECT_DATA =   (SID  = PG_LINK) (HS=OK))
  )


cat $ORACLE_HOME/network/admin/listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
       (SID_DESC =
      (SID_NAME = PG_LINK)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
      (PROGRAM = dg4odbc)
   )
  )

LISTENER =
    (DESCRIPTION_LIST =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP) (HOST = bi-6.bi.ru) (PORT = 1523))
      (ADDRESS = (PROTOCOL = IPC) (KEY  = EXTPROC0))
      )
    )


lsnrctl reload ;



SQL>  create public database link PG_LINK connect to "postgres" identified by "postgres" using 'PG_LINK';
SQL>  select * from dual@PG_LINK;
 select * from dual@PG_LINK
                    *
ERROR at line 1:
ORA-28546: connection initialization failed, probable Net8 admin error
ORA-02063: preceding line from PG_LINK
Rinka777
Дата: 14.10.2015 15:08:53
что я делаю не так?
логи dg и листенера
Дата: 14.10.2015 15:19:34
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
выражаю сомнение, что DG установлен в хоум db_1.
landy
Дата: 14.10.2015 15:19:55
Для начала проверить

isql -v PG_LINK postgres postgres
Rinka777
Дата: 14.10.2015 15:40:34
landy
Для начала проверить

isql -v PG_LINK postgres postgres

 isql -v PG_LINK postgres postgres
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
roadster
Дата: 14.10.2015 15:41:25
Rinka777
landy
Для начала проверить

isql -v PG_LINK postgres postgres


 isql -v PG_LINK postgres postgres
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
вам перевести?
Vadim Lejnin
Дата: 14.10.2015 15:48:13
Rinka777
Дата: 14.10.2015 16:16:15
roadster
Rinka777
пропущено...

 isql -v PG_LINK postgres postgres
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
вам перевести?



yum search ODBC
Loaded plugins: security
======================================================================= Matched: ODBC ========================================================================
postgresql94-odbc.i386 : PostgreSQL ODBC driver
postgresql94-odbc-debuginfo.i386 : Debug information for package postgresql94-odbc
unixODBC.i386 : A complete ODBC driver manager for Linux.
unixODBC-devel.i386 : Development files for programs which will use the unixODBC library.


rpm -q unixODBC
unixODBC-2.2.11-7.1
Е_Гусева
Дата: 14.10.2015 16:37:10
отходите от оракела?


похвально!!!
Rinka777
Дата: 14.10.2015 17:33:46
[oracle@bi-6 admin]$ isql -v PSQL  postgres postgres
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL>


линк создался, ссылка полезная, спасибо.
не хватало

export ODBCSYSINI=/etc
export ODBCINI=/etc/odbc.ini


[oracle@bi-6 etc]$ tnsping PSQL

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-OCT-2015 17:29:47

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

Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = bi-6.bipartner.ru) (PORT = 1523)) (CONNECT_DATA = (SID = PSQL) (HS=OK)))
OK (0 msec)
[oracle@bi-6 etc]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Oct 14 17:29:54 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create public database link PG_LINK connect to "postgres" identified by "postgres" using 'PSQL';

Database link created.

SQL>  select * from pg_tables@PG_LINK;
 select * from pg_tables@PG_LINK
                         *
ERROR at line 1:
ORA-28546: connection initialization failed, probable Net8 admin error
ORA-02063: preceding line from PG_LINK


ну теперь-то чего...