暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

GBase-从8s安装开始

原创 不想用随机名字 2023-04-25
1808

GBase关系型数据库产品简介

  很早之前就像学习一下GBase数据库,因为公司有一个客户使用到了GBase的产品,但是由于这个项目不是我负责,因此就搁浅下来了。
  GBase关系型数据库产品比较多,通过官网介绍也了解了一下每个关系型数据库的定位,根据与其他数据库产品进行比较可能更容易理解一下,如果理解的不对还请指正:
  GBase8s: 完全自主研发的关系型数据库,我觉得可以把它跟oracle一块来看,可以是单实例,也可以是类似于RAC的基于共享存储的多实例数据库产品。
  GBase8a: 属于分析型数据库OLAP,目前我们公司的部分客户的数据仓库就使用了这款产品。
  GBase8c: 内核是基于OpenGauss的分布式数据库,也是目前国内比较流行的,比如TiDB、OceanBase、TDSql、Gaussdb等等,其中华为的GaussDB有一个模式也是基于OpenGauss内核的,所以它俩在数据库管理上会有很多相似之处。

白话一段

  GBase8s很多命令与INFORMIX类似,两者同出一源,INFORMIX已经退出了历史的舞台,但是也有人仍然在使用。当前国产数据库行业百花齐放,有来源于opengauss的、有mysql的、pg的、oracle的,不能说谁好谁坏,大家都在数据库的历史车轮中绽放过光彩。多元化国产的数据库提供了给大家更多的选择,希望国产数据库越来越好,生态越来越完善。
  GBase8s支持的数据库对象也比较全,个人觉得跟达梦的传统数据库定位查不多。比如支持表、函数、存储过程、视图、触发器、同义词等等,目前国产分布式数据库中部分对象是不支持的。GBase8s产品的价格应该比分布式数据库便宜很多(个人遐想),因此也希望GBase8s抓住自己的优势能够服务更多的客户。

GBase8s安装

下载

  提前通过官网下载8s的试用版以及安装帮助手册。下载地址:http://www.gbase.cn/tech_info/474.html
image.png
  其中第一个PDF中是一个百度网盘的连接,根据自己的处理器和操作系统选择适合的安装包,否则在解压jdk的时候就会报错,我的操作系统是CentOS所以下载了这个版本
image.png
  解压后的文件列表如下
image.png
  GBase8sV8.8_TL_3.3.0_2_36477d_RHEL6_x86_64.tar文件就是我们要安装的8s产品。

安装

1、创建用户和组
  虽然安装的时候需要使用root安装,运维操作还是要到特定的用户上

groupadd gbasedbt useradd -g gbasedbt gbasedbt

2、创建安装目录并赋权

mkdir -p /opt/GBASE/gbase chown gbasedbt:gbasedbt /opt/GBASE/gbase

3、上传压缩包到/opt目录,并且使用root用户解压

cd /opt tar -xvf GBase8sV8.8_TL_3.3.0_2_36477d_RHEL6_x86_64.tar

4、使用root用户执行安装命令

cd /opt sh ids_install

  因为我选择的是典型安装(交互式),除了中间输入了一个Y,其余的都是按回车,我在看ids_install这个脚本的时候发现有slient静默安装的方式,这个后面在去尝试吧,总体来说跟oracle的DBCA的安装方式有点类似,以下是安装日志。

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

Launching installer...

===============================================================================
GBase Software Bundle                            (created with InstallAnywhere)
-------------------------------------------------------------------------------

Preparing CONSOLE Mode Installation...




===============================================================================
Getting Started
---------------

This application  will guide you through the installation of GBase Software 
Bundle.
Copyright General Data Corporation 2014, 2023. All rights reserved.

1. Release Notes
The Release Notes can be found in /opt/doc/ids_unix_relnotes_12.10.html.
2. Launch Information Center
Access the GBase Information Center at http://www.gbase.cn.
To Begin Installation, respond to each prompt to proceed to the next step in 
the installation.
If you want to change something on a previous step, type 'back'.
You may cancel this installation at any time by typing 'quit'.


PRESS <ENTER> TO CONTINUE: 



===============================================================================
License Agreement
-----------------

Installation and Use of GBase Software Bundle Requires Acceptance of the 
Following License Agreement:

Thank you for choosing GBase product!



Please read carefully the following licencing agreement before installing any 
product: TIANJIN GENERAL DATA TECHNOLOGY CO. LTD. LICENSE AGREEMENT



READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSETERMS  
(COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWAREMEDIA PACKAGE. 
BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS 
AGREEMENT.  IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR 
ACCEPTANCE OF THESE  TERMS. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY 
RETURN THE UNUSED  SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND.

1. LICENSE TO USE. GeneralData grants you a non-exclusive and non-transferable 
license for  the internal use only of the accompanying software and 
documentation and any error corrections  provided by GeneralData(collectively 
"Software"), by the number of users and the class of  computer hardware for 
which the corresponding fee has been paid.

2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software 

PRESS <ENTER> TO CONTINUE: 

and all  associated intellectual property rights is retained by GeneralData 
and/or its licensors. Except as  specifically authorized in any Supplemental 
License Terms, you may not make copies of Software,  other than a single copy 
of Software for archival purposes. Unless enforcement is prohibited by  
applicable law, you may not modify, decompile, or reverse engineer Software. 
You acknowledge  that Software is not designed, licensed or intended for use in
the design, construction, operation  or maintenance of any nuclear facility. 
GeneralData disclaims any express or implied warranty  of fitness for such 
uses. No right, title or interest in or to any trademark, service mark, logo or
trade name of GeneralData or its licensors is granted under this Agreement.

3. DISCLAIMER OF WARRANTY. Unless specified in this agreement, all express of 
implied  conditions, representations and warranties, including any implied 
warranty of merchantability,  fitness for aparticular purpose or 
non-infringement are disclaimed, except to theextent that  these disclaimers 
are held to be legally invalid.

4. LIMITATION OF LIABILITY. To the extent not prohibited by law, in no event 
will GeneralData  or its licensors be liable for any lost revenue, profit or 
data, or for special, indirect,  consequential, incidental orpunitive damages, 
however caused regardless of the theory of liability,  arising out of or 
related to the use of or inability to use software, even if GeneralData has 

PRESS <ENTER> TO CONTINUE: 

been  advised of the possibility of such damages. In no event will 
GeneralData's libility to you, whether  incontract, tort(including negligence),
or otherwise, exceed the amount paid by you for Software  under this Agreement.
The foregoing limitations will apply even if the above stated warranty  fails 
of itsessential purpose.

5. TERMINATION. This Agreement is effective until terminated. You may terminate
this  Agreement at any time by destroying all copies of Software. This 
Agreement will terminate  immediately without noticefrom GeneralData if you 
fail to comply with any provision of this  Agreement. Upon Termination, you 
must destroy all copies of Software.



6. EXPORT REGULATIONS. All Software and technical data delivered under this 
Agreement are  subject to US export control laws and may be subject to export 
or import regulations in other  countries. You agree to comply strictly with 
all such laws and regulations and acknowledge that  you have the responsibility
to obtain such licenses to export, re-export, or import as may be  required 
after delivery to you.

7. CHINESE GOVERNMENT RESTRICTED. If Software is being acquired by or on behalf

PRESS <ENTER> TO CONTINUE: 

of the  Chinese Government, then the Government's rights in Software and 
accompanying documentation  will be only as set forth in this Agreement.

8. GOVERNING LAW. Any action related to this Agreement will be governed by 
Chinese law:  "COPYRIGHT LAW OF THE PEOPLE'S REPUBLIC OF CHINA", "PATENT LAW OF
THE PEOPLE'S  REPUBLIC OF CHINA", "TRADEMARK LAW OF THE PEOPLE'S REPUBLIC OF 
CHINA", "COMPUTER  SOFTWARE PROTECTION REGULATIONS OF THE PEOPLE'S REPUBLIC OF 
CHINA". No choice of  law rules of any jurisdiction will apply."

9. SEVERABILITY. If any provision of this Agreement is held to be 
unenforceable, this  Agreement will remain in effect with the provision 
omitted, unless omission would frustrate the  intent of the parties, in which 
case this Agreement will immediately terminate.

10. INTEGRATION. This Agreement is the entire agreement between you and 
GeneralData  relating to its subject matter. It supersedes all prior or 
contemporaneous oral or written  communications, proposals, representations and
warranties and prevails over any conflicting or  additional terms of any quote,
order, acknowledgment, or other communication between the  parties relating to 
its subject matter during the term of this Agreement. No modification of this  
Agreement will be binding, unless in writing and signed by an authorize 
depresentative of each  party. When the translation document has the different 

PRESS <ENTER> TO CONTINUE: 

meaning or has the conflicting views with  Chinese original text conflict, 
should take the laws and regulations promulgation unit as well as  the 
GeneralData issue Chinese original text as the standard.



All trademarks and registered trademarks mentioned herein are the  property of 
their respective owners.



DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y



===============================================================================
Installation Location
---------------------

Choose location for software installation.

  Default Install Folder: /opt/GBASE/gbase

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
      : 



===============================================================================
Installation or Distribution
----------------------------

Select the installation type.

Typical: Install the database server with all features and a database server 
that
is configured with default values. Includes:
** Client Software Development Kit (CSDK)
** Java Database Connectivity (JDBC)
Minimum disk space required: 700-800MB

Custom: Install the database server with specific features and software that 
you need.
Optionally install a configured database server instance.
Minimum disk space required: 75 MB (without a server instance)

  ->1- Typical installation
    2- Custom installation
    3- Extract the product files (-DLEGACY option)
    4- Create a RPM package for redistribution

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 




===============================================================================
Server Instance Creation
------------------------

Create a server instance?

  ->1- Yes - create an instance
    2- No - do not create an instance

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 




===============================================================================
Configuration - Number of Users
-------------------------------

Select the number of expected database users.

  ->1- 1 - 100
    2- 101 - 500
    3- 501 - 1000
    4- 1000+

ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 




===============================================================================
Ready To Install
----------------

InstallAnywhere is now ready to install GBase Software Bundle onto your system 
at the following location:

   /opt/GBASE/gbase

PRESS <ENTER> TO INSTALL: 



===============================================================================
Installing...
-------------

 [==================|==================|==================|==================]
 [------------------|------------------|------------------|------------------]



===============================================================================
Server Initialization
---------------------

The server will now be initialized. Initialization might take quite a while, 
depending on the performance of your computer.

PRESS <ENTER> TO CONTINUE: 



===============================================================================
Using the new instance
----------------------

A database server instance was created. If you chose to initialize the 
instance, it is ready to use.

You can open a command prompt to an initialized instance by running one of the 
following commands at /opt/GBASE/gbase, where ol_gbasedbt1210 is the path or 
filename of the instance.

Windows:
ol_gbasedbt1210.cmd

UNIX csh:
source ol_gbasedbt1210.csh

UNIX ksh or bourne:
./ol_gbasedbt1210.ksh

If initialization fails, check the online.log file for messages. The instance's
root chunk must be owned by the correct user and group, and it must have 
readable and writable (rw) permission bits set only for owner and group.

PRESS <ENTER> TO CONTINUE: 



===============================================================================
Installation Complete
---------------------

Congratulations! GBase Software Bundle installation is complete.

Product install status:
GBase: Successful
GBase Connect: Successful

GBase 8s V8.8


For more information about using GBase products, see the GBase Information 
Center at http://www.gbase.cn.

PRESS <ENTER> TO EXIT THE INSTALLER: 

  我在安装的时候选择了同时创建实例。
5、配置环境变量
  使用root用户,把安装目录/opt/GBASE/gbase中ol_gbasedbt1210.ksh文件里的内容拷贝到gbasedbt用户的.bash_profile中

cd /opt/GBASE/gbase cat ol_gbasedbt1210.ksh >> /home/gbasedbt/.bash_profile source /home/gbasedbt/.bash_profile

  到这里我的数据库就安装成功了。

启动和停止数据库实例

1、检查进程

ps -ef | grep oninit

image.png
可以看到,进程都是以root启动的。
2、停止服务,使用gbasedbt用户

onmode -ky

image.png
  使用-k就可以,只是会提示是否关闭数据,以及是否断开正在使用的连接。加y就是不进行提示,直接关闭
3、启动服务,使用gbasedbt用户

oninit -v

image.png
4、登录数据库

dbaccess - -

image.png
  命令中的- -代表两个参数,第一个参数是代表数据库名字,第二个参数为固定的-,表示标准输入,可以是一个sql脚本文件。

dbaccess mydb demo.sql

5、其他数据库模式
image.png
  上图是从官网截取的一张图片,表示在各个模式下切换的命令。
  单用户模式: 可以执行SQL操作和命令行维护操作。只能管理员(GBASEDBT / DBSA)连接,其它普通用户不能连接,如果业务系统正在使用,建议不要随便切换,除非特殊的维护窗口。
  静态模式: 只能执行命令行维护操作(如备份数据库),不可以执行sql语句,如果业务系统正在使用,建议不要随便切换,除非特殊的维护窗口。
  通过在线模式切换到静态模式时,有两个命令 oninit -U和oninit -s,-s可以理解为安全切换,是所有事务完成提交以后再进行切换,尽量不影响正在执行的事务;-U表示不等待事务结束,理解就进行切换。
  在线模式: 对应Online,数据库正常应用状态。
  离线模式: 不能执行任何操作,其实就是数据库已经关闭了,只是叫法跟别的数据库不一样。

一些常用的数据库管理命令

  GBase8s的一些管理命令都是通过在OS用户下进行管理的,可以不用登录数据库,命令也比较多,请移步博客进行参考。
https://blog.csdn.net/jihui8848/article/details/119217074?spm=1001.2014.3001.5501

总结

  在安装GBase的之前并没有安装依赖包,这一点还是比较友好,做到了“开箱即用”。官方帮助文档中还有其他安装方案而且也比较详细,不得不过中文的帮助手册就是香,学习环境有了接下来就开始我的GBase学习之旅了。

最后修改时间:2023-06-01 16:22:18
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论