2

我在 CentOS 7 VM 的目录下安装了 ASE-15 /opt/sybase,然后我跑去SYBASE.sh设置环境变量,但它不起作用,因为当我echo $SYBASE在 OS 上输入时它什么也没输出。所以我通过cat SYBASE.env >> ~/.bash_profile在下面的 SYBASE.env 中键入内容来手动设置环境变量。

[sybase@localhost sybase]$ cat /opt/sybase/SYBASE.env
SYBASE_JRE7_32=/opt/sybase/shared/JRE-7_0_7_32BIT
SYBASE_JRE7=/opt/sybase/shared/JRE-7_0_7_64BIT
SYBASE_JRE7_64=/opt/sybase/shared/JRE-7_0_7_64BIT
SYBASE_OCS=OCS-15_0
INCLUDE=/opt/sybase/OCS-15_0/include:$INCLUDE
LIB=/opt/sybase/OCS-15_0/lib:$LIB
PATH=/opt/sybase/OCS-15_0/bin:$PATH
LD_LIBRARY_PATH=/opt/sybase/OCS-15_0/lib:/opt/sybase/OCS-
15_0/lib3p64:/opt/sybase/OCS-15_0/lib3p:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/opt/sybase/DataAccess/ODBC/lib:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/opt/sybase/DataAccess64/ODBC/lib:$LD_LIBRARY_PATH
PATH=/opt/sybase/DBISQL/bin:$PATH
PATH=/opt/sybase/SCC-3_2/bin:$PATH
SCC_JAVA_HOME=/opt/sybase/shared/JRE-7_0_7_64BIT
SYBASE=/opt/sybase
SYBASE_ASE=ASE-15_0
PATH=/opt/sybase/ASE-15_0/bin:/opt/sybase/ASE-15_0/install:$PATH
SYBROOT=/opt/sybase
SYBASE_JRE_RTDS=/opt/sybase/shared/JRE-7_0_7_64BIT
LD_LIBRARY_PATH=/opt/sybase/ASE-15_0/lib:$LD_LIBRARY_PATH
SYBASE_WS=WS-15_0
PATH=/opt/sybase/ASE-15_0/jobscheduler/bin:$PATH
[sybase@localhost sybase]$ 

但是,当我执行isqlcmd 连接 ASE-15 数据库时,出现以下错误。

[sybase@localhost sybase]$ isql


The context allocation routine failed when it tried to load localization files!!
One or more following problems may caused the failure

Your sybase home directory is /home/sybase. Check the environment variable SYBASE if it is not the one you want!
Cannot access file /home/sybase/config/objectid.dat
An error occurred when attempting to allocate localization-related structures.
[sybase@localhost sybase]$ 

然后我输入echo $SYBASE检查环境变量$SYBASE是否正确。

[sybase@localhost sybase]$ echo $SYBASE
/opt/sybase

所以我想我已经指定了sybase主目录/opt/sybase,为什么isql命令find file objectid.datunder/home/sybase/config而不是/opt/sybase/config

4

1 回答 1

1

Sybase 对文件的后缀和权限SYBASE.[csh|sh]有点误导。您不想执行/运行这些文件,而是想获取它们,例如:

# sh / bash / ksh
. SYBASE.sh

# csh
source SYBASE.csh

您只需将以下内容添加到您的个人资料即可成功访问isql

# sh / bash / ksh
SYBASE=/opt/sybase
. ${SYBASE}/SYBASE.sh
于 2017-09-18T17:19:38.163 回答