Oracle通过dblink连接GBase 8a MPP Cluster

发布时间:2020-08-11 23:59:14 作者:chenoracle
来源:ITPUB博客 阅读:197

Oracle 通过 dblink 连接 GBase 8a MPP Cluster

源端:

Oracle 版本: Oracle 11.2.0.3.0    OS 版本: Redhat 7.5  IP:192.168.38.20

目标端:

GBase 版本: GBase 8a Cluster    OS 版本: Redhat 7.5  IP:192.168.38.10

Oracle 端安装 gateway

说明:Oracle 11.2.0.3.0 默认安装了 gateway

[oracle@cjcos02 hs]$ pwd

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

查看gateway 信息

[oracle@cjcos02 hs]$ dg4odbc

Oracle Corporation --- SATURDAY  MAY 09 2020 15:07:10.503

Heterogeneous Agent Release 11.2.0.3.0 - 64bit Production  Built with

   Oracle Database Gateway for ODBC

Oracle 端安装 GBase ODBC

GBase ODBC 下载地址:

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

安装:

[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              ################################# [100%]

Oracle 端配置 odbcinst.in

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

[GBase ODBC 8.3 Driver]

Driver=/usr/lib64/libgsodbc8.so

UsageCount=1

DontDLClose=1

Threading=0

Oracle 端配置 GBase ODBC 数据源

4.1 查看配置文件位置

[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 配置 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

验证ODBC 连接

[root@cjcos02 odbc]# isql gbase

Oracle通过dblink连接GBase 8a MPP Cluster

SQL> select version();

Oracle通过dblink连接GBase 8a MPP Cluster

SQL> select * from t1;

Oracle通过dblink连接GBase 8a MPP Cluster

配置 tnsnames.ora

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

[oracle@cjcos02 admin]$ vim tnsnames.ora 

Oracle通过dblink连接GBase 8a MPP Cluster

[oracle@cjcos02 admin]$ tnsping gbase

Oracle通过dblink连接GBase 8a MPP Cluster

  配置listener.ora

[oracle@cjcos02 admin]$ vim listener.ora

Oracle通过dblink连接GBase 8a MPP Cluster

[oracle@cjcos02 admin]$ lsnrctl reload

Oracle通过dblink连接GBase 8a MPP Cluster

[oracle@cjcos02 admin]$ lsnrctl status

Oracle通过dblink连接GBase 8a MPP Cluster

配置 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

  创建dblink

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

Database link created.

验证数据

Oracle 端:

[oracle@cjcos02 ~]$ sqlplus / as sysdba

SQL> select * from t1@gbase;

Oracle通过dblink连接GBase 8a MPP Cluster

Gbase 端:

[gbase@cjcos01 ~]$ gccli -ucjc -p

gbase> use cjcdb;

gbase> select * from t1;

Oracle通过dblink连接GBase 8a MPP Cluster

十一:常见错误

如下报错一般都是 initgbase.ora 配置问题,添加 HS_FDS_SHAREABLE_NAME 参数即可。

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 停库时报错 ORA-01097 ,切换会话后之前的会话会自动提交或回滚,在执行停库命令。

SQL> shutdown immediate  

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

切换会话

SQL> conn / as sysdba

Connected.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

欢迎关注我的微信公众号"IT小Chen",共同学习,共同成长!!!

Oracle通过dblink连接GBase 8a MPP Cluster

推荐阅读:
  1. expdp+dblink 实现远程备份,特别实用
  2. 通过案例学Oracle之--一次AIX rac误操作引起的“血案”

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

8a cluster dblink

上一篇:Mac文件加密软件Boxcryptor for Mac v2.34.1023免费版

下一篇:zTree点击节点内容改变当前节点及下级(一级)节点的状态

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》