ASE-15 isql 命令在 CentOS 7 上找不到 sybase home
ASE-15 isql command can not find sybase home on CentOS 7
我在CentOS 7 VM上的/opt/sybase
目录下安装了ASE-15,然后我运行 SYBASE.sh
设置环境变量,但是没有用,因为当我在 OS 上输入 echo $SYBASE
时它没有输出任何内容。所以我通过输入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]$
但是,当我执行 isql
cmd 连接 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
命令在 /home/sybase/config
下查找文件 objectid.dat
而不是 /opt/sybase/config
?
Sybase 对 SYBASE.[csh|sh]
文件的后缀和权限有点误导。您不想 execute/run 这些文件,而是获取它们,例如:
# sh / bash / ksh
. SYBASE.sh
# csh
source SYBASE.csh
您只需将以下内容添加到您的个人资料中即可成功访问 isql
:
# sh / bash / ksh
SYBASE=/opt/sybase
. ${SYBASE}/SYBASE.sh
我在CentOS 7 VM上的/opt/sybase
目录下安装了ASE-15,然后我运行 SYBASE.sh
设置环境变量,但是没有用,因为当我在 OS 上输入 echo $SYBASE
时它没有输出任何内容。所以我通过输入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]$
但是,当我执行 isql
cmd 连接 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
命令在 /home/sybase/config
下查找文件 objectid.dat
而不是 /opt/sybase/config
?
Sybase 对 SYBASE.[csh|sh]
文件的后缀和权限有点误导。您不想 execute/run 这些文件,而是获取它们,例如:
# sh / bash / ksh
. SYBASE.sh
# csh
source SYBASE.csh
您只需将以下内容添加到您的个人资料中即可成功访问 isql
:
# sh / bash / ksh
SYBASE=/opt/sybase
. ${SYBASE}/SYBASE.sh