设为首页 加入收藏

TOP

Perl脚本访问Greenplum数据库安装指导(六)
2015-07-24 10:52:28 来源: 作者: 【 】 浏览:2
Tags:Perl 脚本 访问 Greenplum 数据库 安装 指导
u are using the right one.

?

Press return to continue... Looking for odbc_config in : nowhere

Looking for odbc_config in (PATH)/usr/local/greenplum-connectivity-4.3.0.0-build-2/bin:/sybaseclient/IQ-16_0/bin64:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/local/freetds0.91/bin:/usr/bin:/sybaseclient/IQ-16_0/bin64:/home/hadoop/nodesetup/java/jdk1.6.0_29/bin:/sybaseclient/IQ-16_0/lib64

Found odbc_config (via odbc_config) version 2.2.12

?

odbc_config reports --prefix=/usr

odbc_config reports --include-prefix=/usr/include

odbc_config reports --lib-prefix=/usr/lib64

butcannot find header files sql.h,sqlext.h,sqltypes.h in that path so ignoring

NOTE: Have you installed the unixodbc-devpackage

Looking for iodbc-config in PATH /usr/local/greenplum-connectivity-4.3.0.0-build-2/bin:/sybaseclient/IQ-16_0/bin64:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/local/freetds0.91/bin:/usr/bin:/sybaseclient/IQ-16_0/bin64:/home/hadoop/nodesetup/java/jdk1.6.0_29/bin:/sybaseclient/IQ-16_0/lib64

iodbc_config not found

odbc_config not found - ok, there are otherthings I can do

Still trying to guess ODBCHOME - lookingfor headers now

trying /usr/include

trying /usr/local/include

trying /usr/pkg/include

trying /usr/local/easysoft/unixODBC/include

?

I cannot find drivermanager header files. Perhaps you need to install the

unixodbc-dev package orthe iodbc-dev package

?

?

The DBD::ODBC moduleneeds to link with an ODBC 'Driver Manager'.

(The Driver Manager, inturn, needs one or more database specific ODBC

drivers. The DBD::ODBCmodule does _not_ include any ODBC drivers!)

?

You need to indicate where your ODBC DriverManager is installed.

You can do this by:

?

o setting the ODBCHOME environment variable

o running 'perl Makefile.PL -o odbcdir'

o adding path to odbc_config/iodbc_configto PATH

?

If you do not have an ODBC Driver Manageryou should try to get hold of

the unixODBC packages for your system orbuild it from source (see

http://www.unixodbc.org). If you installdriver manager packages you

need to include the "XXX-dev"package which includes the C header files.

?

上面的主要问题是没有设置如下变量导致的:

export ODBCHOME=/usr/local/unixODBC

export LD_LIBRARY_PATH=/usr/local/unixODBC/lib

?

但是我们安装的unixODBC是RPM形式的包,安装后的目录不满足要求,所以我们需要重新编译安装unixODBC:

解压unixODBC-2.3.2.tar.gz包并安装

tar -zxvf unixODBC-2.3.2.tar.gz

./configure --prefix=/usr/local/unixODBC

make

make install

?

unixODBC安装好之后,设置环境变量:

export ODBCHOME=/usr/local/unixODBC

export LD_LIBRARY_PATH=/usr/local/unixODBC/lib

然后再重新安装DBD-ODBC驱动,就可以成功安装了。

?

同时不要忘记,将之前配置的/etc/unixODBC/odbc.ini和/etc/unixODBC/odbcinst.ini文件都拷贝到/usr/local/unixODBC/etc目录下面,因为Perl脚本将/usr/local/unixODBC/etc这里获取GP的数据库配置驱动信息。

测试perl脚本

(1) 准备perl测试脚本,如下:

linux-82:/etc/unixODBC

#!/usr/bin/perl

####################################################################

# name:hellokitty.pl

#describe: 测试perl访问Greenplum数据库

####################################################################

use DBI;

usestrict;

usePOSIX;



#判断入参个数:dbname数据库名; dbuser 用户名; p
首页 上一页 3 4 5 6 下一页 尾页 6/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇怎样收集EBS各种相关业务的表的数.. 下一篇PfileVSSpfile(MOSNote249664.1)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·PostgreSQL 索引 - (2025-12-25 22:20:43)
·MySQL Node.js 连接 (2025-12-25 22:20:41)
·SQL 撤销索引、表以 (2025-12-25 22:20:38)
·Linux系统简介 (2025-12-25 21:55:25)
·Linux安装MySQL过程 (2025-12-25 21:55:22)