fy
发布于

【Cognos】IV-Cognos10.1.1如何适配odbc(32bit)

适配的系统版本

[root@localhost home]# cat /etc/redhat-release 
CentOS release 6.8 (Final)
[root@localhost home]# cat /proc/version 
Linux version 2.6.32-642.el6.x86_64 (mockbuild@worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue May 10 17:27:01 UTC 2016
[root@localhost home]#

odbcall.tar.gz 位置

链接:https://pan.baidu.com/s/1i0tG-LGBKentNWF6--D4Jw 
提取码:2gek 
--来自百度网盘超级会员V1的分享

odbcall 安装

解压

mkdir /softinstall

## 将odbcall.tar.gz解压

mv odbcall /usr/local/


用户 cognos 环境变量配置

配置。bashrc

export CPSQL_HOME=/usr/local/odbcall/pgsql
export CODBC_HOME=/usr/local/odbcall/unixodbc
export CPSQLODBC_HOME=/usr/local/odbcall/psqlodbc
export PATH=${CODBC_HOME}/bin:${CPSQLODBC_HOME}/bin:${CPSQL_HOME}/bin:$PATH
export LD_LIBRARY_PATH=${CODBC_HOME}/lib:${CPSQLODBC_HOME}/lib:${CPSQL_HOME}/lib:$LD_LIBRARY_PATH
export LD_RUN_PATH=${CODBC_HOME}/lib:${CPSQLODBC_HOME}/lib:${CPSQL_HOME}/lib:$LD_RUN_PATH
export ODBCINI=${CODBC_HOME}/etc/odbc.ini
export MAPRDRILLINI=${CODBC_HOME}/etc/.odbc.ini

生效。bashrc

source ~/.bashrc

用户 cognos 论证 odbc(32bit)可用性

odbcinst -j

[cognos@localhost ~]$ odbcinst -j
unixODBC 2.3.0
DRIVERS............: /usr/local/odbcall/unixodbc/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/odbcall/unixodbc/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/odbcall/unixodbc/etc/ODBCDataSources
USER DATA SOURCES..: /usr/local/odbcall/unixodbc/etc/odbc.ini
SQLULEN Size.......: 4
SQLLEN Size........: 4
SQLSETPOSIROW Size.: 2
[cognos@localhost ~]$

配置 $ODBCINI

[cognos@localhost ~]$ vi $ODBCINI
[ODB]                                
Driver       = /usr/local/odbcall/psqlodbc/lib/psqlodbcw.so
Description  = ODB                      
Servername   = 192.168.56.106                       
Database     = dw             
Username     = fy                     
Password     = 123456                 
Port         = 5432                       
ReadOnly     = No                       
ConnSettings = set client_encoding to UTF8
[cognos@localhost ~]$

测试可用性

[cognos@localhost ~]$ isql ODB -v
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select current_database();
+----------------------------------------------------------------+
| current_database                                               |
+----------------------------------------------------------------+
| dw                                                             |
+----------------------------------------------------------------+
SQLRowCount returns 1
1 rows fetched
SQL> quit
[cognos@localhost ~]$ 

cognos 软件适配 odbc(32bit)

浏览器输入

http://192.168.179.136:9300/p2pd/servlet/dispatch

1 点击-<IBM Cognos Connection>

2 点击-<Data Source Connections>

3 点击-<Configuration>

4 输入<Name>

5 选择-<Type>

6 填写-<ODBC data source>-<ODBC connect1 string>

7 点击-<Test the connection>

8 检查-<Connection string>并点击-<Test>

校验连接串

;LOCAL;OD;DSN=ODB;ODB@ASYNC=0@0/0@UNICODE@COLSEQ=

9 检查状态-<Succeeded>

10 关闭测试

11 关闭测试连接串

12 点击<Finish>

评论
    test