GBase 8s
安装配置
文章

构建最优数据平台:GBase 8s数据库多种安装方式详解之配置环境变量

发表于2025-09-12 13:48:4375次浏览7个评论

配置环境变量

    在使用 GBase 8s 数据库服务前需要设置几个环境变量。可以把安装目录下的ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户主目录下的 .bash_profile文件中,以便于 gbasedbt 用户在登录后即自动应用这些环境变量。注意,此处的ol_gbasedbt1210.ksh为安装过程中Server Instance Creation步骤创建的数据库实例文件,所以在定制化安装过程中,该文件名称会发生变化。
 

[root@vip soft]# cd /opt/GBASE/gbase/
[root@vip gbase]# ls
aaodir    etc                                                    gls   ol_gbasedbt1210.csh      SDK
bin       extend                                                 incl  ol_gbasedbt1210.ksh      ssl
dbssodir  GBase_GLS_Install_04_24_2023_13_58_45.log              isa   ol_gbasedbt1210.log      storage
demo      GBase_Install_04_24_2023_13_58_52.log                  lib   release                  tmp
doc       GBase_Software_Bundle_Install_04_24_2023_13_58_38.log  msg   RUNasroot.installserver  uninstall
--查看ol_gbasedbt1210.ksh配置文件内容
[root@vip gbase]# cat ol_gbasedbt1210.ksh 
 GBASEDBTDIR=/opt/GBASE/gbase
 GBASEDBTSERVER=ol_gbasedbt1210
 ONCONFIG=onconfig.ol_gbasedbt1210
 GBASEDBTSQLHOSTS=/opt/GBASE/gbase/etc/sqlhosts.ol_gbasedbt1210
 GL_USEGLU=1
 PATH=${GBASEDBTDIR}/bin:${GBASEDBTDIR}/extend/krakatoa/jre/bin:${PATH}
export GBASEDBTDIR GBASEDBTSERVER ONCONFIG GBASEDBTSQLHOSTS GL_USEGLU PATH

--切换到gbasedbt用户,查看当前配置文件内容
[root@vip gbase]# su - gbasedbt 
[gbasedbt@vip ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
[gbasedbt@vip ~]$ exit
logout
[root@vip gbase]# 


 

[root@vip gbase]# pwd
/opt/GBASE/gbase
[root@vip gbase]# ls
aaodir    etc                                                    gls   ol_gbasedbt1210.csh      SDK
bin       extend                                                 incl  ol_gbasedbt1210.ksh      ssl
dbssodir  GBase_GLS_Install_04_24_2023_13_58_45.log              isa   ol_gbasedbt1210.log      storage
demo      GBase_Install_04_24_2023_13_58_52.log                  lib   release                  tmp
doc       GBase_Software_Bundle_Install_04_24_2023_13_58_38.log  msg   RUNasroot.installserver  uninstall

--将 GBase 8s 安装目录下的 ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户主目录下的 .bash_profile 文件中
[root@vip gbase]# cat ol_gbasedbt1210.ksh >> /home/gbasedbt/.bash_profile
[root@vip gbase]# cd /home/gbasedbt/
--进入到gbasedbt用户下执行source .bash_profile命令使配置文件生效
[root@vip gbasedbt]# source .bash_profile 
[root@vip gbasedbt]# su - gbasedbt 
Last login: Mon Apr 24 14:21:09 CST 2023 on pts/1
--查看gbasedbt用户下配置文件
[gbasedbt@vip ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
 GBASEDBTDIR=/opt/GBASE/gbase
 GBASEDBTSERVER=ol_gbasedbt1210
 ONCONFIG=onconfig.ol_gbasedbt1210
 GBASEDBTSQLHOSTS=/opt/GBASE/gbase/etc/sqlhosts.ol_gbasedbt1210
 GL_USEGLU=1
 PATH=${GBASEDBTDIR}/bin:${GBASEDBTDIR}/extend/krakatoa/jre/bin:${PATH}
export GBASEDBTDIR GBASEDBTSERVER ONCONFIG GBASEDBTSQLHOSTS GL_USEGLU PATH
[gbasedbt@vip ~]$ 


 

配置完毕后,即可正常使用 GBase 8s 数据库。

评论

登录后才可以发表评论
我是火炎焱燚发表于 10个月前
感谢分享
用户头像
levvel发表于 7个月前
我看好你哟!
用户头像
levvel发表于 7个月前
虚心向前辈学习
崔哥发表于 6个月前
乔木生云气。访中兴、英雄陈迹,暗追前事。战舰东风慳借便,梦断神州故里。旋小筑、吴宫闲地。华表月明归夜鹤,叹当时、花竹今如此。枝上露,溅清泪。遨头小簇行春队。步苍苔、寻幽别坞,问梅开未。重唱梅边新度曲,催发寒梢冻蕊。此心与、东君同意。后不如今今非昔,两无言、相对沧浪水。怀此恨,寄残醉。
用户头像
levvel发表于 5个月前
太赞了!
崔哥发表于 2个月前
黄师塔前江水东,春光懒困倚微风。桃花一簇开无主,可爱深红爱浅红?
GBase用户51934发表于 2个月前
学习了