Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle connects to GBase 8a MPP Cluster through dblink

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle connects to GBase 8a MPP Cluster through dblink

Source side:

Oracle version: Oracle 11.2.0.3.0 OS version: Redhat 7.5 IP:192.168.38.20

Destination side:

GBase version: GBase 8a Cluster OS version: Redhat 7.5IP:192.168.38.10

Install gateway on one Oracle side

Description: gateway is installed by default in Oracle 11.2.0.3.0

[oracle@cjcos02 hs] $pwd

/ u01/app/oracle/product/11.2.0/db_1/hs

View gateway information

[oracle@cjcos02 hs] $dg4odbc

Oracle Corporation-SATURDAY MAY 09 2020 1514 0714 10.503

Heterogeneous Agent Release 11.2.0.3.0-64bit Production Built with

Oracle Database Gateway for ODBC

Install GBase ODBC on the second Oracle side

Download address of GBase ODBC:

Http://www.gbase8a.com/forum.php?mod=viewthread&tdtype=document&tid=1319

Installation:

[root@cjcos02 odbc] # rpm-ivh GBaseODBC-8.3.81.53-build53.17-redhat7-x86_64.rpm

Preparing... # # [100%]

Updating / installing...

1:gbaseodbc-8.3-53.17 # #

3. Configure odbcinst.in on Oracle side

[root@cjcos02 odbc] # vim / etc/odbcinst.ini

[GBase ODBC 8.3 Driver]

Driver=/usr/lib64/libgsodbc8.so

UsageCount=1

DontDLClose=1

Threading=0

4. Configure GBase ODBC data source on Oracle side

4.1 View profile location

[root@cjcos02 odbc] # odbcinst-j

UnixODBC 2.3.1

DRIVERS.: / etc/odbcinst.ini

SYSTEM DATA SOURCES: / etc/odbc.ini

FILE DATA SOURCES..: / etc/ODBCDataSources

USER DATA SOURCES..: / root/.odbc.ini

SQLULEN Size.: 8

SQLLEN Size.: 8

SQLSETPOSIROW Size.: 8

4.2 configure odbc.in

[root@cjcos02 odbc] # vim / etc/odbc.ini

[gbase]

Description = ODBC for GBase

Driver = GBase ODBC 8.3 Driver

Server = 192.168.38.10

Port = 5258

UID = cjc

Password = cjc

Database = cjcdb

Five verify ODBC connection

[root@cjcos02 odbc] # isql gbase

SQL > select version ()

SQL > select * from T1

Six configuration tnsnames.ora

[oracle@cjcos02 ~] $cd $ORACLE_HOME/network/admin

[oracle@cjcos02 admin] $vim tnsnames.ora

[oracle@cjcos02 admin] $tnsping gbase

Seven configure listener.ora

[oracle@cjcos02 admin] $vim listener.ora

[oracle@cjcos02 admin] $lsnrctl reload

[oracle@cjcos02 admin] $lsnrctl status

Eight configure initgbase.ora

[oracle@cjcos02 admin] $pwd

/ u01/app/oracle/product/11.2.0/db_1/hs/admin

[oracle@cjcos02 admin] $vim initgbase.ora

HS_FDS_CONNECT_INFO = gbase

HS_FDS_TRACE_LEVEL = 0

HS_FDS_SHAREABLE_NAME=/usr/lib64/libodbc.so

HS_FDS_SUPPORT_STATISTICS=FALSE

HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P15

Set ODBCINI = / etc/odbc.ini

9. Create dblink

SQL > create public database link gbase connect to "cjc" identified by "cjc" using 'gbase'

Database link created.

Ten validate data

Oracle side:

[oracle@cjcos02 ~] $sqlplus / as sysdba

SQL > select * from t1@gbase

Gbase side:

[gbase@cjcos01] $gccli-ucjc-p

Gbase > use cjcdb

Gbase > select * from T1

Eleven: common mistakes

The following error is usually caused by initgbase.ora configuration. You can add HS_FDS_SHAREABLE_NAME parameter.

SQL > select * from t1@gbase

Select * from t1@gbase

*

ERROR at line 1:

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

ORA-02063: preceding line from GBASE

Oracle stop Library Times error ORA-01097, after switching sessions before the session will be automatically submitted or rolled back, in the execution of the stop command.

SQL > shutdown immediate

ORA-01097: cannot shutdown while in a transaction-commit or rollback first

Switch session

SQL > conn / as sysdba

Connected.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

Welcome to follow my Wechat official account "IT Little Chen" and learn and grow together!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report