Dear all,
This question has been asked many times in this forum, and I have gone to many threads in this forum, but unfortunately i failed.
I want to connect to MySQL database from oracle. I have the following configurations.
- Oracle database enterprise edition 12c (12.1.0.2.0) 64bit on Windows server 2012 64bit
- i have MySQL 5.6.11 on windows 7 64bit
- i have downloaded ODBC driver from oracle delivery site (MySQL Connector/ODBC 5.3.4 MSI for Windows x86 (64bit))
- i install the ODBC on my oracle server, a full installation which install the Unicode and Ansi versions both.
- i create ODBC connection for Unicode by going to Control Panel—>Administrator Tools—>ODBC Data Sources (64-bit)—>System DSN. i test it and the test was successful.
- i configure my Listner.ora, Tnsname.ora and initmysql.ora files as below;
Listner.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = c:appAdministratorproduct12.1.0dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:c:appAdministratorproduct12.1.0dbhome_1binoraclr12.dll")
)
(SID_DESC=
(SID_NAME = mysql)
(ORACLE_HOME = C:appAdministratorproduct12.1.0dbhome_1)
(PROGRAM = dg4odbc)
(ENVS=LD_LIBRARY_PATH = C:appAdministratorproduct12.1.0dbhome_1LIB)
)
)LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORADEV.hct.org)(PORT = 1521))
)
Tnsnames.ora
PDBORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORADEV.hct.org)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pdborcl.hct.org)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORADEV.hct.org)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.hct.org)
)
)mysql =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = N410FS02)(PORT = 1521))
(CONNECT_DATA =
(SID = mysql)
)
(HS = OK)
)
initmysql.ora ( C:appAdministratorproduct12.1.0dbhome_1hsadmin)
HS_FDS_CONNECT_INFO = mysql
HS_FDS_TRACE_LEVEL = OFF
then i stop and start the listener, the listener status is below
LSNRCTL for 64-bit Windows: Version 12.1.0.2.0 - Production on 23-APR-2015 09:16
:52Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ORADEV.hct.org)(PORT=152
1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.2.0 - Produ
ction
Start Date 23-APR-2015 09:13:56
Uptime 0 days 0 hr. 2 min. 59 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File c:appAdministratorproduct12.1.0dbhome_1networka
dminlistener.ora
Listener Log File c:appAdministratordiagtnslsnrORADEVlisteneraler
tlog.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORADEV.hct.org)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "mysql" has 1 instance(s).
Instance "mysql", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "pdborcl.hct.org" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
tnsping MySQL
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 23-APR-2
015 09:17:54Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
c:appAdministratorproduct12.1.0dbhome_1networkadminsqlnet.oraUsed TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = N410FS02
)(PORT = 1521)) (CONNECT_DATA = (SID = mysql)) (HS = OK))
OK (40 msec)
then i open sqlplus and connect to my pluggable database as sys user and create a public database link for the test schema which i already created in MySQL database.
create public database link mysql connect to test identified by test using 'mysql';
then i try the table1 which is in test schema in MySQL from sqlplus as below
SQL> select * from table1@mysql;
select * from table1@mysql
*
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from MYSQL
i have tried both the Ansi and Unicode versions of ODBC but the same issue.
where is the problem in my configuration?
Thank you.
May 7, 2021
I got ” ORA-28545: error diagnosed by Net8 when connecting to an agent ” error in Oracle database.
ORA-28545: error diagnosed by Net8 when connecting to an agent
Details of error are as follows.
ORA-28545: error diagnosed by Net8 when connecting to an agent Cause: An attempt to call an external procedure or to issue SQL to a non-Oracle system on a Heterogeneous Services database link failed at connection initialization. The error diagnosed by Net8 NCR software is reported separately. Action: Refer to the Net8 NCRO error message. If this isn't clear, check connection administrative setup in tnsnames.ora and listener.ora for the service associated with the Heterogeneous Services database link being used, or with 'extproc_connection_data' for an external procedure call.
You are using DG4MSQL to connect to SQL*Server and a connection gives the following error - SQL> select * from [email protected]; select * from [email protected] * Error at line1: ORA-28545: error diagnosed by Net8 when connecting to an agent. Unable to retrieve text of NETWORK/NCR message 65535 ORA-02063: preceding 2 lines from TESTLINK. A listener log file shows the following errors - TNS-12518: TNS:listener could not hand off client connection TNS-12560: TNS:protocol adapter error TNS-00530: Protocol adapter error 32-bit Windows Error: 2: No such file or directory
error diagnosed by Net8 when connecting to an agent
This ORA-28545 error is related to the attempt to call an external procedure or to issue SQL to a non-Oracle system on a Heterogeneous Services database link failed at connection initialization. The error diagnosed by Net8 NCR software is reported separately.
The cause of this problem is that there is an ORACLE_HOME environment variable in the session starting the listener that is pointing to a 10.2 ORACLE_HOME . This is preventing the 11g listener finding the gateway executable file in the 11g directory.
The problem can be fixed by adding the full path name of the gateway executable to the listener.ora –
(PROGRAM=C:OracleGatewaysbindg4msql)
which allows the gateway connection to work. However, this is not the best solution for this problem as there may be future installs of other versions which will also have the same problem.
This error can also happen if the listener being used for the Gateway is in a different ORACLE_HOME from where the Gateway is installed.
For example, the listener being used for the Gateway is run from the directory –
D:oracleproduct12.1.0dbhome_1networkadmin
but the Gateway is installed in –
d:apporacleproduct12.1.0tghome_3
For the first cause the solution is –
The permanent and correct solution for this problem to prevent future problems with other Oracle version installs is to remove any ORACLE_HOME environment variable settings from the session starting the 11g listener.
The ORACLE_HOME parameter is not required on Windows operating systems.
When the Gateway is in a different ORACLE_HOME from the listener ORACLE_HOME then the solution is to create and use a listener from the Gateway ORACLE_HOME –
d:apporacleproduct12.1.0tghome_3networkadmin
Another solution is to try Set global_names=false.
How to configure HSODBC
———————————
(This section assumes that everything is done in the Oracle user account
that starts the listener!)
In general the following things must be configured:
1) listener
2) tnsnames
3) init<SID>.ora of the hs subsystem
4) environment
5) Oracle database
1) The listener needs a new SID entry like the following:
(SID_DESC =
(SID_NAME = hsodbc)
(ORACLE_HOME = /home/oracle/server/10.2.0/)
(PROGRAM = hsodbc)
(ENVS=LD_LIBRARY_PATH=/home/oracle/server/10.2.0/lib:/home/odbc/dd/lib)
)
Please correct the ORACLE_HOME entry and the ENVS entry according to your installation.
If the odbc driver requires the foreign data store client libraries (like the Progress ODBC driver), the LD_LIBRARY_PATH must contain this library path as well:
…
(ENVS=LD_LIBRARY_PATH=/home/oracle/server/10.2.0/lib:/home/odbc/dd/lib:
/progress/dcl/lib)
…
ORACLE_HOME must point to your ORACLE_HOME directory and the ENVS string contains entries for the LD_LIBRARY_PATH.
The minimum of the LD_LIBRARY_PATH setting must contain the Oracle library and the odbc library path; both 32 bit.
HSODBC is a 32 bit libray and thus it needs a 32 bit ODBC driver.
A correct setting of the path can be verified by typing
hsodbc
then pressing <ENTER> at the console. If the LD_LIBRARY_PATH contains the correct libraries, the version number of HSODBC should be displayed.
So a listener.ora file can look like:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = hsodbc)
(ORACLE_HOME = /home/oracle/server/10.2.0/)
(PROGRAM = hsodbc)
(ENVS=LD_LIBRARY_PATH=/home/oracle/server/10.2.0/lib:/home/odbc/dd/lib)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <hostname of the Oracle Server>)
(PORT = 1921))
)
)
)
The listener must be restarted (use stop and start) after changing the listener.ora file!
2) The tnsnames.ora needs an entry for the HSODBC alias:
HSODBC.DE.ORACLE.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = tcp)(HOST = <hostname of the Oracle Server)(PORT = 1521))
)
(CONNECT_DATA =
(SID = hsodbc)
)
(HS=OK)
)
The domain of the tns alias can differ from the one used above (de.oracle.com), depending on the parameter in the sqlnet.ora: NAMES.DEFAULT_DOMAIN = de.oracle.com
But the important entry is the (HS=)or (HS=OK) key word. This key word mustbe added manually and opening the Net Configuration Assistants will remove this entries from your tnsnames.ora file! The (HS=OK) parameter must be outside the SID section and specifies that this connector uses the Oracle Heterogeneous Service Option.
After adding the tnsnames alias and restarting the listener, a connectivity check is to use tnsping <alias>.
tnsping hsodbc should come back with a successfull message.
3) init.ora of the gateway:
The SID to use HS functionality is called in this example hsodbc. There are some restrictions how to name the SID (described in the Net Administrators Guide in detail).
At this place only a short note: don’t use dots in the SID and keep it short!
The SID is also relevant for the init.ora file of the gateway. The name of the file is init<SID>.ora. In this example it is called inithsodbc.ora. The file is located at $ORACLE_HOME/hs/admin.
It should contain the following entries:
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = mssql
HS_FDS_TRACE_LEVEL = off
HS_FDS_SHAREABLE_NAME = /home/odbc/dd/lib/libodbc.so
#
# ODBC specific environment variables
#
set ODBCINI=/home/odbc/dd/odbc.ini
#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>
Short explanation of the parameters:
HS_FDS_CONNECT_INFO points to the ODBC DSN configured in PART I of this note.
HS_FDS_SHAREABLE_NAME points to the ODBC Driver Manager library at $ODBC_HOME/lib/<ODBC_Driver_MANAGER_LIB>.
For the Data Direct Technologies odbc driver the generic odbc library on Linux is called libodbc.so. This library checks the ODBC DSN configuration and loads the driver to the foreign database server. The name of this library may differ
from odbc vendor to vendor. Please check out the driver documentation to figure out the generic odbc library.
Also some ODBC driver vendors do not require an ODBC Driver Manager; then the ODBC driver library itself can be
specified here. To determine if an ODBC Driver Manager is required, please contact the ODBC driver vendor.
(As not each ODBC Driver vendor documents its ODBC Driver Manager library and the library name might differ from Driver Manager to Driver Manager a possible way to figure out the Driver Manager library name could be to check for the existence of SQLAllocConnect ODBC function within this library:
strings <library name> |grep -i sqlalloc
)
The set ODBCINI=/home/odbc/dd/odbc.ini points to the location of an odbc.ini file you want to use with this hsodbc configuration.
4) Configuring the environment:
Normally there is nothing to configure anymore. But to test the odbc connectivity for the Oracle user the following should be performed:
Set the ODBCINI and ODBC_HOME environment variable and add the $ODBC_HOME/lib directory to the $LD_LIBRARY_PATH.
(The details how to do it are described in Part I.)
Now execute as the ORACLE User (who starts the listener) the demoodbc program:
$ODBC_HOME/demo/demoodbc -uid sa -pwd sa mssql
A similar output should be generated:
DataDirect Technologies, Inc. ODBC Sample Application. will connect to data source ‘mssql’ as user ‘sa/sa’.
First Name Last Name Hire Date Salary Dept
———- ——— ——— —— —-
Tyler Bennett 1977-01-06 00:00:00.000 32000.0 D101
George Woltman 1982-07-08 00:00:00.000 53500.0 D101
Rich Holcomb 1983-01-06 00:00:00.000 49500.0 D202
Richard Potter 1986-12-04 00:00:00.000 15900.0 D101
David Motsinger 1985-05-05 00:00:00.000 19250.0 D202
Tim Sampair 1987-02-12 00:00:00.000 27000.0 D101
SQLFetch returns: SQL_NO_DATA_FOUND
5)Configuring the Oracle database
The only thing that must be done here is to create a database link: connect with the username/password that has sufficient rights to create a database link (i.e. system). The syntax is:
create [public] database link <name>
connect to <UID> identified by <pwd> using ‘<tnsalias>’;
In other words, to connect to the MS SQL Server configured in the last steps, the syntax must be:
CREATE DATABASE LINK sqlserver
CONNECT TO “sa” IDENTIFIED BY “sa” USING ‘hsodbc’;
The db link name is sqlserver. Username and password must be in double quotes, because the username and password are case sensitive. ‘hsodbc’ points to the alias in the tnsnames.ora file that calls the HS subsystem.
If everything is configured well, a select of the EMP table -created for the demoodbc program- should be successful:
select * from “EMP”@sqlserver;
…
(Side note: The EMP table at the MS SQL Server is in capital letters. Because the MS SQL Server is case sensitive the EMP table must be surrounded by double quotes). @sqlserver points to the name of the database link to the
MS SQL Server.
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )
1,422 views last month, 3 views today
About Mehmet Salih Deveci
I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA, Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].- -Oracle DBA, SQL Server DBA, APPS DBA, Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için [email protected] a mail atabilirsiniz.
Содержание
- ORA-28545: error diagnosed by Net8 when connecting to an agent
- ORA-28545: error diagnosed by Net8 when connecting to an agent
- Answers
- ORA-28545 ORA-02063
- Answers
- ORA-28545: error diagnosed by Net8 when connecting to an agent error URGENT
- Comments
ORA-28545: error diagnosed by Net8 when connecting to an agent
Dear all,
This question has been asked many times in this forum, and I have gone to many threads in this forum, but unfortunately i failed.
I want to connect to MySQL database from oracle. I have the following configurations.
- Oracle database enterprise edition 12c (12.1.0.2.0) 64bit on Windows server 2012 64bit
- i have MySQL 5.6.11 on windows 7 64bit
- i have downloaded ODBC driver from oracle delivery site (MySQL Connector/ODBC 5.3.4 MSI for Windows x86 (64bit))
- i install the ODBC on my oracle server, a full installation which install the Unicode and Ansi versions both.
- i create ODBC connection for Unicode by going to Control Panel—>Administrator Tools—>ODBC Data Sources (64-bit)—>System DSN. i test it and the test was successful.
- i configure my Listner.ora, Tnsname.ora and initmysql.ora files as below;
Listner.ora
Tnsnames.ora
initmysql.ora ( C:appAdministratorproduct12.1.0dbhome_1hsadmin)
then i stop and start the listener, the listener status is below
then i open sqlplus and connect to my pluggable database as sys user and create a public database link for the test schema which i already created in MySQL database.
then i try the table1 which is in test schema in MySQL from sqlplus as below
i have tried both the Ansi and Unicode versions of ODBC but the same issue.
Источник
ORA-28545: error diagnosed by Net8 when connecting to an agent
I really hate to make another topic about a problem that many people have posted about already, but now matter how hard I try, I can’t resolve the following error:
ORA-28545: error diagnosed by Net8 when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535 ORA-02063: preceding 2 lines from DBLSS.WORLD
I’ve followed this tutorial with the exception of step 7, where I substituted hsodbc for dg4odbc: Database link from Oracle to SQL Server
Also, the database link worked before the databasename of the SQL Server had to change, so I know the right programs/drivers are installed.
MSSQL Server: MS10, database: SXSS
Oracle Server: OR39, database: SXSO
3. Test the ODBC drivers to ensure that connectivity is made to the SQL Server database.
On the oracle database server OR39:
Start -> Data Sources (ODBC) -> System DSN -> Name=SXSS, Server = MS10, change default database=SXSS
Test Data source results:
Microsoft SQL Server ODBC Driver Version 06.01.7601
Running connectivity tests.
Verifying option settings
Disconnecting from server
TESTS COMPLETED SUCCESSFULLY!
4. Ensure that your global_names parameter is set to False.
SQL> select name from v$database;
SQL> show parameter global_names
global_names | boolean | FALSE |
5. Configure the Oracle Heterogeneous services by creating an initodbc.ora file within the Oracle database.
In %Oracle_Home%/hs/admin I have the file initSXSS.ora:
also initdg4odbc.ora which I didn’t modify, and an extproc.ora which only says
7. Modify the Listener.ora file.
this is part of my listener
(ADDRESS = (PROTOCOL = TCP)(HOST = OR39)(PORT = 1521))
(SID_DESC = (SID_NAME = SXSS) (ORACLE_HOME = F:oracleora112) (PROGRAM = dg4odbc)
8. Modify the Tnsnames.ora file.
(ADDRESS= (PROTOCOL=TCP) (HOST = OR39 )(PORT=1521))
(CONNECT_DATA= (SID = SXSS))(HS=OK))
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION=[..])
9. Reload the listener on local Oracle database
10. Create a database link on the local Oracle installation that accesses the heterogeneous connection, which, in turn, connect to SQL Server.
CREATE PUBLIC DATABASE LINK «MICRO.WORLD» CONNECT TO «ORUSER» IDENTIFIED by «******» USING ‘SXSS’
Then I go to management studio, to my SXSO database, to Database Links, click on MICRO.WORLD, click on test and then I get the ORA-28545.
It had worked before following the same manual, but now it doesn’t seem to work anymore. Am I doing anything wrong? Or am I missing a step?
Answers
If you followed the doco then the only avenue left is creating an SR.
You may need to post your config files in their entirety* for us to better assist .
Message was edited by: RobbR * Masking sensitive data
The error ORA-28545 error you get is related to a configuration issue but the files you posted look good.
You have stated that you reloaded the Oracle listener — did you use the reload or the stop/start command?
The tnsping shows that there is a listener service running and serving the 1521 port. Unfortunately tnsping does not check, if there is a SID service. So could you please post the listener status output of your listener («lsnrctl status» executed in the command line window).
Also please provide the output of «F:oracleora112bindg4odbc» executed in the same command line window.
So, the weirdest thing just happened. On thursday I made the database link and when it still didn’t work after 1.5 workday, I wrote the opening post in this topic and then went home, frustrated. Monday morning I go to my work again, check this topic (Thanks for the replies!!) and before I was going do the any of the actions proposed here I decided to check if the database link was working, just in case. Guess what: It’s working now! The only thing that happened between Friday and Monday was that the server was rebooted (which happens once a month) . So I guess that is what fixed my problem. While that seems like a rigorous solution for such a «simple» problem, especially when you have an SLA which state the server may only be down once a month, I’m happy that it’s working now.
Well, you stated the server was rebooted and earlier you stated you reloaded the listener. I now assume that you have used the listener command reload rather then stop and start which is done explicit or when rebooting the server.
Источник
ORA-28545 ORA-02063
I’m installing DG4MSQL to connect to SQL server database. I installed the Oracle Gateway 11.2 on a server(server name — aris) where SQL Server 2005 is also running. Below are the config files for the gateway
Created DBLINK from Oracle database:
create public database link to_sqldb connect to «arisuser1» identified by «user1pwd»
using ‘dg4msql’;
SQL> select * from [email protected]_sqldb;
select * from [email protected]_sqldb
*
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from TO_SQLDB
Any help please.Thanks
Edited by: 817622 on Dec 16, 2010 2:58 PM
Answers
root cause of the 28545 is your listener — it does not support any service see the message: The listener supports no services
A listener configured for the SID dg4msq commonly states:
Service «dg4msql» has 1 instance(s).
Instance «dg4msql», status UNKNOWN, has 1 handler(s) for this service.
=> Are you sure the listener file you’ve posted is located in the directory: E:product11.2.0tg_1networkadminlistener.ora? For me it looks like you’ve edited the sample listener.ora file from E:product11.2.0tg_1dg4msqladmin.
By default the SQL+Net listener is reading the listener file from E:product11.2.0tg_1networkadmin, so please make sure you’ve edited this file. Then STOP and START the listener again.
You are right. I moved the listener.ora to Oracle Gateway home/network/admin and it worked. Thanks so much. But I get a different error now when I execute the select..
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[aris]/aris/sqldb
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=arisuser1
HS_FDS_RECOVERY_PWD=user1pwd
create public database link to_sqldb connect to «arisuser1» identified by «user1pwd»
using ‘dg4msql’;
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
[Oracle][ODBC SQL Server Driver][SQL Server]Login failed for user ‘arisuser1’.
<28000,NativeErr = 18456>[Oracle][ODBC SQL Server Driver]Invalid connection
string attribute <01s00>
ORA-02063: preceding 2 lines from TO_SQLDB
arisuser1 is the administrative account we use and the server name is aris.. Please help..
Thanks.. Our applications use windows authentication to connect to SQL Server databases.. Do we need to start using SQL Server authentication to use DG4MSQL? Or just create a sql server user for DG4MSQL and we can keep our windows authentication for the applications.. sorry I’m confused..
Thanks so much. You have been really helpful..
I’m using sql server authentication and get this error..
initdg4msql.ora in E:product11.2.0tg_1dg4msqladmin folder:
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for Microsoft SQL Server
#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[aris]/aris/sqldb
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=sqluser
HS_FDS_RECOVERY_PWD=sqluser
create public database link to_sqldb connect to «sqluser» identified by «sqluser»
using ‘dg4msql’;
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Oracle][ODBC SQL Server Driver][DBMSLPCN]SQL Server does not exist or access
denied. <08001,NativeErr = 17>[Oracle][ODBC SQL Server
Driver][DBMSLPCN]ConnectionOpen (Connect()). <01000,NativeErr =
53>[Oracle][ODBC SQL Server Driver]Invalid connection string attribute <01s00>
ORA-02063: preceding 2 lines from TO_SQLDB
‘sqluser’ has the db owner permissions in SQLDB database.. Please help
Источник
ORA-28545: error diagnosed by Net8 when connecting to an agent error URGENT
I’ve to setup and use SQL Server 2K db from Oracle10g 10.1.0 db. Basically, i’ve to
periodically PULL data from oracle to sql server 2k
Have done the necessary setup as specified in Oracle docs.
1. System DSN: MYSQLSERVERDSN
2. ini file: initMYSQLSERVERDSN.ora
contents of ini file
HS_FDS_CONNECT_INFO = MYSQLSERVERDSN
HS_FDS_TRACE_LEVEL = OFF
3. tnsnames entry:
MYSQLSERVERDSN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = WORKSTATION21)(PORT = 1522))
)
(CONNECT_DATA =
(SID = MYSQLSERVERDSN)
)
(HS = OK)
)
4. listener.ora entry
LISTENERMYSQLSERVERDSN =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=WORKSTATION21)(PORT=1522))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENERMYSQLSERVERDSN=
(SID_LIST=
(SID_DESC=
(SID_NAME=MYSQLSERVERDSN)
(ORACLE_HOME = d:oracleproduct10.1.0db_1)
(PROGRAM=hsodbc)
)
)
Did i miss something here?
I started the listener by
c:> lsnrctl start LISTENERMYSQLSERVERDSN. it started well and
I tried tnsping, that is also working. Then,
Did i miss something here? Coz when trying to connect to the tables in
SQLSERVER2K, get following error:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 — Production
With the Partitioning, OLAP and Data Mining options
SQL>create database link mysqlserverdsn connect to xx identified by xxxx using ‘MYSQLSERVERDSN’;
Database link created.
SQL> desc [email protected];
ERROR:
ORA-28545: error diagnosed by Net8 when connecting to an agent
NCRO: Failed to make RSLV connection
ORA-02063: preceding 2 lines from MYSQLSERVERDSN
I’m not able to figure out where the error lies.
Any inputs on this?? please help me, I am in urgent.
Hi I think you have to change your tns using .world after the tns name connection.
regards,
Joao Lanaro
Check the tnsnames.ora in the host you have to write the IP of oracle server.
MYSQLSERVERDSN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = IP ORACLE SERVER )(PORT = 1522))
)
(CONNECT_DATA =
(SID = MYSQLSERVERDSN)
)
(HS = OK)
)
28545 error is a configuration issue.
— please have a look at the tnsnames.ora file and make sure each line except of the tns alias starts at least with 1 space.
According to the posting all further lines start at position 1. but it might be only a
copy/paste issue.
— drop the database link and recreate it. SQL Server usernames and passwords are case sensitiver and thus need to be surrounded by double quotes like:
create database link mysqlserverdsn connect to «sa» identified by «xxxx» using ‘MYSQLSERVERDSN’;
— please provide:
lsnrctl status LISTENERMYSQLSERVERDSN
— please provide tnsping MYSQLSERVERDSN
— please provide: d:oracleproduct10.1.0db_1binhsodbc
ERROR:
ORA-28545: error diagnosed by Net8 when connecting to an agent
NCRO: Failed to make RSLV connection
ORA-02063: preceding 2 lines from MSQL2K
pour cette erreur dans mon cas, il est due au mauvias chemin de orcale_home dans le fichier listener.ora en effet j’ai mis (ORACLE_HOME = d:oracleproduct10.1.0db_1) au lieu de (ORACLE_HOME = c:oracleproduct10.1.0db_1) (oracle est installé sur partition C: et nod )
extrait de listener.ora
LISTENER_MSQL2K =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=T100266681002)(PORT=1522))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER_MSQL2K =
(SID_LIST=
(SID_DESC=
(SID_NAME=MSQL2K)
(ORACLE_HOME = c:oracleproduct10.1.0db_1)
(PROGRAM=hsodbc)
)
)
extrait de tnsnames.ora
# tnsnames.ora Network Configuration File: C:oracleproduct10.1.0db_1NETWORKADMINtnsnames.ora
# Generated by Oracle configuration tools.
PROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 128.0.0.152)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)
)
ORCLMIROIR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.15.20)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCLS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Server-OscarV4)(PORT = 1521))
)
(CONNECT_DATA =
(SID = ORCL)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = T100266681002)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
# HETEROGENEOUS SERVICES ###############################################
MSQL2K =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = T100266681002)(PORT = 1522 ))
)
(CONNECT_DATA =
(SID = MSQL2K)
)
(hs = ok)
)
Источник
Since our customers are forced to move to Oracle Database 12.1, I am in the role to support their upgrades. Recently I upgraded a Windows environment that used the Heterogeneous Services to connect to an external ODBC datasource via a database link. The configuration is a little tricky, but pretty straight forward once you get the idea.
First, there must be an ODBC datasource. That is a simple System DSN which was already in place.
Second, you have to choose a kind of “virtual” SID for your connection to this ODBC datasource.
Third, create an init.ora in the $ORACLE_HOME/hs/admin directory and put at least one parameter into it:
HS_FDS_CONNECT_INFO="<Name of ODBC System DSN>"
Fourth, add static SID to the listener by modifying the listener.ora file:
SID_LIST_LISTENER_STD = (SID_LIST = (SID_DESC= (SID_NAME=<virtual SID>) (ORACLE_HOME=c:oracleproduct12.1.0.2dbprod) (PROGRAM=dg4odbc) ) )
Then reload the listener configuration to make it active.
Fifth, create a tnsnames.ora entry that points to the listener and the virtual SID. Make sure, you specify “HS=OK”.
MYODBCDS = (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST = <listener host>)(PORT = 1521)) (CONNECT_DATA = (SID = <virtual SID>) ) (HS = OK) )
Sixth and finally, create a database link that points to the tnsnames entry:
SQL> create database link myodbcds connect to <user> identified by <pwd> using "MYODBCDS"; Database link created.
All those steps were done years ago in the old 11.2 environment. Everything worked fine there. So I simply copied all the configuration details to the new 12.1 Oracle home. Then I moved the listener to the new 12.1 home and upgraded the database. But when testing the HS connection, the following happened:
SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 28 11:30:45 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Last Successful login time: Tue Mar 28 2017 11:06:02 +02:00 Connected to: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production SQL> select * from dual@myodbcds ; select * from dual@myodbcds * ERROR at line 1: ORA-28545: error diagnosed by Net8 when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535 ORA-02063: preceding 2 lines from MYODBCDS
I checked the listener services, the connection seemed to be established successfully.
C:>lsnrctl services listener LSNRCTL for 64-bit Windows: Version 12.1.0.2.0 - Production on 28-MAR-2017 11:39:05 Copyright (c) 1991, 2014, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=1521))) Services Summary... Service "<virtual SID>" has 1 instance(s). Instance "<virtual SID>", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:1 refused:0 LOCAL SERVER The command completed successfully
So I created a new listener in the old 11.2 home that used another port to test things. The 11.2 listener worked fine. So what is the difference between both listeners?
After a little research I stumbled upon the Windows services. The database service was not running as LocalSystem but as a domain user. This is because the database writes it’s backups to an UNC share. Both, 11.2 and 12.1, listeners used the LocalSystem account. So I changed the 12.1 listener to use the domain account too and this solved the problem.
SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 28 11:39:10 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Last Successful login time: Tue Mar 28 2017 11:36:53 +02:00 Connected to: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production SQL> select * from dual@myodbcds; D - X
I have no idea why the 11.2 listener can run as LocalSystem whilst the 12.1 listener cannot. But generally I think it is a good practice to run listener and database services with the same user credentials.
4 / 4 / 0 Регистрация: 26.08.2014 Сообщений: 110 |
|
1 |
|
22.02.2017, 12:15. Показов 7488. Ответов 4
На одном серваке работают Oracle XE и PostgreSQL (Oracle XE 11g r2 / PostgreSQL 9.5 / odbc-postgresql 1:09.05.0400-1) При прокидывании линка gw4odbc база данных не поднимается, а с hsodbc база поднимается с бубнами, tnsping sucsess, но запросы не отрабатываются. Код $ tnsping "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) (CONNECT_DATA = (SID = NPGLINK)) (HS = OK))" TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 22-FEB-2017 12:08:31 Copyright (c) 1997, 2011, Oracle. All rights reserved. Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) (CONNECT_DATA = (SID = NPGLINK)) (HS = OK)) OK (0 msec) Но при попытке сделать селект в тестовую таблицу (SELECT * FROM «PUBLIC.TEST»@PG Код ORA-28545: error diagnosed by Net8 when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535 ORA-02063: preceding 2 lines from PG 28545. 0000 - "error diagnosed by Net8 when connecting to an agent" *Cause: An attempt to call an external procedure or to issue SQL to a non-Oracle system on a Heterogeneous Services database link failed at connection initialization. The error diagnosed by Net8 NCR software is reported separately. *Action: Refer to the Net8 NCRO error message. If this isn't clear, check connection administrative setup in tnsnames.ora and listener.ora for the service associated with the Heterogeneous Services database link being used, or with 'extproc_connection_data' for an external procedure call. Error at Line: 1 Column: 28 Что делать ума не приложу Приложил текущий конфиг : Код # listener.ora Network Configuration File: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = NPGLINK) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) #(PROGRAM = dg4odbc) (PROGRAM = hsodbc) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE)) (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 5432)) ) ) DEFAULT_SERVICE_LISTENER = (XE) Код # tnsnames.ora Network Configuration File: XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) ) EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) NPGLINK = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) (CONNECT_DATA = (SID = NPGLINK)) (HS = OK) ) Код #/u01/app/oracle/product/11.2.0/xe/hs/admin/initNPGLINK.ora HS_FDS_CONNECT_INFO = NPGLINK HS_FDS_TRACE_LEVEL = 0 HS_FDS_SHAREABLE_NAME = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so # ODBC specific environment variables set ODBCINI=/etc/odbc.ini Код [ODBC Data Sources] NPGLINK = PostgreSQL [NPGLINK] Description=PostgreSQL Unicode Driver=PostgreSQL Unicode Trace=No TraceFile= Database=stat_db Servername=StatServ2 Username=postgres Password=QWEasd07 Port=5432 Protocol=6.4 ReadOnly=No RowVersioning=No ShowSystemTables=No ShowOidColumn=No FakeOidIndex=No ConnSettings= [Default] Driver = /usr/lib64/liboplodbcS.so
__________________
0 |
Модератор 4192 / 3031 / 577 Регистрация: 21.01.2011 Сообщений: 13,109 |
|
22.02.2017, 13:01 |
2 |
tnsping sucsess, но запросы не отрабатываются. tnsping ходит только до listener-а, поэтому не показатель.
0 |
4 / 4 / 0 Регистрация: 26.08.2014 Сообщений: 110 |
|
26.03.2017, 12:34 [ТС] |
3 |
Как проверить Test connect в ODBC ?
0 |
Модератор 4192 / 3031 / 577 Регистрация: 21.01.2011 Сообщений: 13,109 |
|
27.03.2017, 10:45 |
4 |
Как проверить Test connect в ODBC ? Когда заходишь в Администратор ODBC и выбираешь нужный источник, то обычно проходишь ряд окошек, вот на последнем есть кнопка для проверки.
1 |
4 / 4 / 0 Регистрация: 26.08.2014 Сообщений: 110 |
|
28.03.2017, 17:10 [ТС] |
5 |
Итак проверил, и ODBC драйвер работает ! Код me@Serv:/u01/app/oracle/product/11.2.0/xe/network/admin$ echo "select * from test" | isql -v pg-connector +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select * from test +--------------------------+ | test | +--------------------------+ | lol | | lol2 | | lol22 | +--------------------------+ SQLRowCount returns 3 3 rows fetched
Как я догадываюсь, Oracle увидел ODBC драйвер картинко Код ORA-02063: preceding 2 lines from PG_CONNECTOR 28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:" *Cause: The cause is explained in the forwarded message. *Action: See the non-Oracle system's documentation of the forwarded message. Error at Line: 3 Column: 20 Куда копать ? текущий /network/admin/listener.ora Код # listener.ora Network Configuration File: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = pg-connector) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe) (PROGRAM = dg4odbc) (ENVS=LD_LIBRARY_PATH = /usr/lib/x86_64-linux-gnu; /usr/lib/odbc) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE)) (ADDRESS = (PROTOCOL = TCP)(HOST = StatServ2)(PORT = 1521)) ) ) DEFAULT_SERVICE_LISTENER = (XE) текущий hs/admin/Initpg-connector.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 = pg-connector HS_FDS_TRACE_LEVEL = 0 HS_FDS_SHAREABLE_NAME = /usr/lib/x86_64-linux-gnu/libodbc.so # # ODBC specific environment variables # set ODBCINI=/etc/odbc.ini lsnrctl status Код LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 28-MAR-2017 09:49:59 Copyright (c) 1991, 2011, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production Start Date 28-MAR-2017 09:11:04 Uptime 0 days 0 hr. 38 min. 55 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service XE Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/StatServ2/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=StatServ2)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=StatServ2)(PORT=8081))(Presentation=HTTP)(Session=RAW)) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "XE" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service... Service "XEXDB" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service... Service "pg-connector" has 1 instance(s). Instance "pg-connector", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully Добавлено через 24 минуты Добавлено через 6 часов 44 минуты
0 |