dmlink creation of oracle arrival dream

Posted by ZimmerX on Wed, 05 Jan 2022 09:31:14 +0100

odbc installation and configuration and common problems

For installation and configuration, refer to:

1. Modification of configuration file

This use yum Installation, modification after installation odbc Two profiles:

cat /etc/odbc.ini
Driver       = DM8 ODBC DRIVER
Description  = DM ODBC DSND
UID         = SYSDBA
TCP_PORT     = 5236

cat /etc/odbcinst.ini
Description = ODBC DRIVER FOR DM8
Driver = /usr/lib/

2. Test

[oracle@localhost ~]$ isql -v dm8
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |

3. Common problems

(1) If the Damon client is not installed on the oracle server, you can install one or directly copy and upload it from the bin directory of the installed Damon.
(2) Note libdodbc So file, oracle needs permission to access this file. It can be found in / home / oracle / bash_ Add the path of Dameng bin directory in the profile, for example:

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/dmbin

Also pay attention to permissions. Here, the file is directly copied to / usr/lib.

File configuration and points for attention


1. File location


2. Configuration
Add the following contents to the document:


3. Restart listening

[oracle@localhost ~]$ lsnrctl reload

4. Attention
PROGRAM=dg4odbc. Dg4odbc cannot be modified here. Do not change it to sid. Here, $Oracle will be executed_ A file named dg4odbc under home / bin is a protocol for Oracle to understand different databases;


1. File location


2. Configuration
Add the following after the document

dm8 =
        (PROTOCOL=TCP) (HOST=localhost) (PORT=1521)

3. Test

 [oracle@localhost ~]$ tnsping dm8

TNS Ping Utility for Linux: Version - Production on 30-JUL-2021 15:29:18

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

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=localhost) (PORT=1521)) (CONNECT_DATA= (SID=dm8)) (HS=OK))
OK (0 msec)

4. Attention
Both host and port are written in oracle, not the address and port of Dameng library.


1. Location


2. Configuration

vim initdm8.ora //new file
HS_LANGUAGE="simplified chinese_china.al32utf8"
set ODBCINI=/etc/odbc.ini

3. Attention
(1) The new file name is init ora
(2)HS_ FDS_ CONNECT_ The names in info and odbc are consistent
(3)HS_ FDS_ TRACE_ Setting level to debug makes it easy to view the error log. Otherwise, an error is often reported during testing. In many cases, such an error is reported. I don't know what the problem is. Open the debug log to facilitate troubleshooting.

Create dblink

create  database link  dmlink  connect to "SYSDBA" identified by "SYSDBA" using 'dm8';

Troubleshooting methods

If you put init HS in ora_ FDS_ TRACE_ Level is set to off. Once an error occurs, it is difficult to troubleshoot the problem. Problem encountered in configuration:

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
ORA-02063: preceding line from <dblinkname>

We can't see the specific error information, and later tests found that many cases will report errors like this, such as init This error will be reported if the sid in the ora file name is written incorrectly, there is a problem with the character set in the configuration file, and the dynamic library file cannot be found.
After configuring to debug, in the directory


You can see the detailed error reporting reasons in the to facilitate troubleshooting.
For example, was written incorrectly in the test So file name (written as

vim initdm8.ora

[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release Production on Fri Jul 30 15:48:14 2021
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@orcl> select * from v$version@dmlink;
select * from v$version@dmlink1
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
ORA-02063: preceding line from DMLINK1

You can't tell the problem by reporting the wrong information.
Viewing the log, you can see:

Oracle Corporation --- FRIDAY    JUL 30 2021 13:57:22.023


Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "debug"
Entered hgosdip
 setting HS_OPEN_CURSORS to default of 50
Exiting hgosdip, rc=0
ORACLE_SID is "dm8"
 Port Rls/Upd:1/0 PrdStat:0
 Agent:Oracle Database Gateway for ODBC
Failed to load ODBC library symbol: /usr/lib/

Problem found.

For more information, please visit Dameng community: