GBase 8s 安装

1 系统要求
1.1 硬件要求
硬件
最低配置
推荐配置
处理器
1×2 核 2.0GHz
4×4 核 3.0GHz
内存
4GB
64GB 或更多
硬盘
100GB
1TB
光驱
CD-ROM
CD-ROM


1.2 操作系统要求

GBase 8s 产品需要部署于 UOS V20 操作系统,鲲鹏920芯片上,建议以 Software Development Workstation 模式安装。


2 安装及配置数据库服务器

2.1 安装准备
1.创建 gbasedbt 组和用户
在启动安装过程之前,必须准备系统以确保您有足够权限来执行安装。
您必须以 root 用户身份登录才能执行许多与安装有关的任务。同时要求服务器操作系统
上具有 gbasedbt 组和 gbasedbt 用户。
登录系统后可以执行以下命令创建 gbasedbt 组和 gbasedbt 用户:
[root@localhost ~]# groupadd gbasedbt
[root@localhost ~]# useradd -g gbasedbt gbasedbt
为 gbasedbt 用户设置密码,密码为 gbasedbt:
[root@localhost ~]# passwd gbasedbt


2.创建 GBase 8s 数据库安装目录

GBase 8s 数据库缺省的安装目录为 /opt/GBASE/gbase,并且此文件夹必须为空。
[root@localhost ~]# mkdir -p /opt/GBASE/gbase
[root@localhost ~]# chown gbasedbt:gbasedbt /opt/GBASE/gbase


3.上传并解压安装包

将产品安装光盘插入光驱,取出光盘中 Setup 目录下的文件,复制到本地目录 /opt。
Setup目录中包含 GBase 8s 产品的安装包文件,该文件通常是形如
GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar 的压缩文件。
在本手册中,以 GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar为例进行安装说明。
解压该 tar 包,解压命令为:tar –vxf filename.tar。
[root@localhost ~]# cd /opt
[root@localhost opt]# tar -vxf
GBase8sV8.8_AEE_3.1.0_1_UOS_KP920.tar
ids_install
onsecurity
ids.properties
.gbase.properties


2.2 安装方法

2.2.1 典型安装
您可以通过使用典型安装设置来快速安装 GBase 8s 及其所有功能部件。
缺省情况下,典型安装设置将创建为您的主机环境配置的即时可用的数据库服务器实例。
但是,您可以禁用安装应用程序中的创建服务器实例选项。
以 root 身份登录,进入解压目录,执行要安装的产品的安装脚本 ids_install,即可进行安
装,具体命令如下:
[root@localhost /]# cd /opt
[root@localhost opt]# sh ids_install
执行安装过程中,安装程序先检查系统环境,如果系统没有安装JDK,那么安装包会先解
压JDK,自动安装到该系统中。如果已经安装,那么将显示产品的授权条款,并等待确认
是否接受这些版权条款。
具体安装过程示例如下:
[root@localhost opt]# sh ids_install
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, 2019. 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
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 TO CONTINUE:
=======================================================================
License Agreement
-----------------
Installation and Use of GBase 8s 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 nontransferable
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
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 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. Youmay 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 underthis 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 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, inwhich 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 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
输入”Y”接受授权条款,按回车键继续。
1. 指定安装路径 根据界面提示确认默认安装路径 /opt/GBASE/gbase,并回车。
=======================================================================
Installation Location
---------------------
Choose location for software installation
Default Install Folder: /opt/GBASE/gbase

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


2. 选择安装类型
========================================================================== =====
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 TO ACCEPT THE DEFAULT::
1
使用默认安装选项 1,直接回车,进行典型安装。
3. 创建实例
系统提示是否创建一个实例,默认选项 1 为创建,直接回车,创建一个实例。
4. 选择数据库用户数
选择实例预期要支持的数据库用户数,默认选项为 1,直接回车继续。
=======================================================================
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 TO ACCEPT THE DEFAULT::
5. 配置结束,点击回车进行安装。
=======================================================================
Ready To Install
----------------
InstallAnywhere is now ready to install GBase 8s Software Bundle onto your
system at the following location:
/opt/GBASE/gbase
PRESS TO INSTALL:
=======================================================================
Installing...
=======================================================================
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 TO ACCEPT THE DEFAULT::
[==================|==================|==================|===============]
[------------------|------------------|------------------|--------------
-]
=======================================================================
Server Initialization
---------------------
The server will now be initialized. Initialization might take quite a
while,
depending on the performance of your computer.
PRESS TO CONTINUE:
安装后会提示将进行数据库实例的初始化,按回车继续。
6. 数据库实例创建成功并使用,点击回车后继续。
==========================================================================
=====
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 TO CONTINUE:
7. 安装完成,回车后退出安装程序。
==========================================================================
=====
Installation Complete
---------------------
Congratulations! GBase Software Bundle installation is complete.
Product install status:
GBase: Successful
GBase Connect: Successful
Main Version: GBase 8s V8.7
For more information about using GBase products, see the GBase Information
Center at
PRESS TO EXIT THE INSTALLER:
8. 配置环境变量
在使用 GBase 8s 数据库服务前需要设置几个环境变量。可以把安装目录下的
ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户主目录下的 .bash_profile文件中,以
便于 gbasedbt 用户在登录后即自动应用这些环境变量。
如果要把 GBase 8s 安装目录下的 ol_gbasedbt1210.ksh 文件的内容追加到 gbasedbt 用户
主目录下的 .bash_profile 文件中,可以执行以下命令:
[root@localhost ~]# cd /opt/GBASE/gbase
[root@localhost gbase]# cat ol_gbasedbt1210.ksh >>
/home/gbasedbt/.bash_profile
[root@localhost ~]# cd /home/gbasedbt/
[root@localhost ~]# source .bash_profile

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


2.2.2 定制安装
定制安装,也就是通常说的自定义安装。
使用定制安装可在安装 GBase 8s 时只带有您所需的功能部件。
2.2.2.1 执行安装
进入解压目录,执行安装脚本 ids_install,即可进行安装。具体命令如下:
[root@localhost ~]# cd /opt
[root@localhost opt]# sh ids_install
定制安装过程如下所示:
1.接受授权协议,内容详见 2.1.1 典型安装。
2.选择安装类型,输入 2 选择 Custom installation。
==========================================================================
=====
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 TO ACCEPT THE DEFAULT::
2
下面所有选项,一律<回车>
==========================================================================
=====
"Choose Install Features" Help
------------------------------
On the next screen, type the number of a feature to change whether it is
selected or deselected. You can provide a list of numbers, separated by
commas,
with no leading or trailing spaces.
For example, assume that the screen contains this list:
1- [X] ABC
2- [ ] XYZ
Please choose the Features to be installed by this installer.: ___
If you want to install both ABC and XYZ, type: 2
If you want to install only XYZ, type: 1,2
PRESS TO CONTINUE:
========================================================================== =====
========================================================================== =====
Choose Install Set
------------------
========================================================================== =====
Choose Product Features
-----------------------
ENTER A COMMA_SEPARATED LIST OF NUMBERS REPRESENTING THE FEATURES YOU
WOULD
LIKE TO SELECT, OR DESELECT. TO VIEW A FEATURE'S DESCRIPTION, ENTER
'?'. PRESS WHEN YOU ARE DONE:
1- [X] GBase database server
2-
|-[X] Base Server

3-
|-[X] Extensions and tools

4-
|-[X] J/Foundation

5-
|-[X] Database extensions

6-
|-[X] Conversion and reversion support

7-
|-[X] XML publishing

8-
|-[X] Demonstration database scripts

9-
|-[X] Enterprise Replication

10-
|-[X] Data loading utilities

11-
|-[X] onunload and onload utilities

12-
|-[X] dbload utility

13-
|-[X] Backup and Restore

14-
|-[X] archecker utility

15-
|-[X] ON-Bar utility

16-
|-[X] Interface to Tivoli Storage Manager

17-
|-[X] Administrative utilities

18-
|-[X] Performance monitoring utilities

19-
|-[X] Miscellaneous monitoring utilities

20-
|-[X] Auditing utilities

21-
|-[X] Database import and export utilities

22-
|-[X] JSON Client Support

23- [X] Global Language Support (GLS)


24-
|-[X] Chinese

Please choose the Features to be installed by this installer.:
==========================================================================
=====
Feature review
--------------
Would you like to review the features that you have selected, or change
which
features you have selected?
->1- Continue
2- Return to feature tree
ENTER THE NUMBER OF THE DESIRED CHOICE, OR PRESS TO ACCEPT THE
DEFAULT:
==========================================================================
=====
Get Role Separation choice
--------------------------
Enable role separation for auditing procedures.
If you enable role separation, you can assign existing groups of users to
specific roles.
If you do not enable role separation, the database server administrator
performs all administration tasks.
1- Enable role separation
->2- Do not enable role separation
ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS TO ACCEPT THE DEFAULT::
==========================================================================
=====
Server Instance
---------------
Type 'back' to go to the previous step or 'quit' to cancel the
installation.
Create a database server instance?
1- Yes - create a server instance
->2- No - do not create a server instance
ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS TO ACCEPT THE DEFAULT::
========================================================================== =====
Installation Summary
--------------------
Please review the following before continuing:
Product Name:
GBase Software Bundle
Install Folder:
/opt/GBASE/gbase
Product Features:
GBase database server,
Base Server,
Extensions and tools,
J/Foundation,
Database extensions,
Conversion and reversion support,
XML publishing,
Demonstration database scripts,
Enterprise Replication,
Data loading utilities,
onunload and onload utilities,
dbload utility,
Backup and Restore,
archecker utility,
ON-Bar utility,
Interface to Tivoli Storage Manager,
Administrative utilities,
Performance monitoring utilities,
Miscellaneous monitoring utilities,
Auditing utilities,
Database import and export utilities,
JSON Client Support,
Global Language Support (GLS),
Chinese
Disk Space Information (for Installation Target):
Required: 497,274,517 Bytes
Available: 9,861,873,664 Bytes
PRESS TO CONTINUE:

========================================================================== =====
Ready To Install
----------------
InstallAnywhere is now ready to install GBase Software Bundle onto your
system
at the following location:
/opt/GBASE/gbase
PRESS TO INSTALL:
========================================================================== =====
Installing...
-------------
[==================|==================|==================|================ ==]
[------------------|------------------|------------------|--------------- ---]
========================================================================== =====
Installation Complete
---------------------
Congratulations! GBase Software Bundle installation is complete.
Product install status:
GBase: Successful
GBase Connect: Successful
Main Version: GBase 8s V8.7
For more information about using GBase products, see the GBase Information
Center at
PRESS TO EXIT THE INSTALLER:


2.2.2.2 使用脚本自动创建和初始化实例
安装完成后,解压如下文件获得脚本:
将 GBseInit_gbasedbt.sh 脚本拷贝到 opt/GBASE/gbase 目录下。更改此脚本的执行权
限:
[root@localhost ~]# cd /opt/GBASE/gbase
[root@localhost gbase]# chown -R gbasedbt:gbasedbt GBaseInit_gbasedbt.sh
[root@localhost gbase]# ls -l GBaseInit_gbasedbt.sh
-rw-r--r--. 1 gbasedbt gbasedbt 32705 Jan 15 10:10 GBaseInit_gbasedbt.sh
使用 gbasedbt 用户执行该脚本。使用 GBseInit_gbasedbt.sh 脚本,自动创建并初始化实 例。
[root@localhost gbase]# su - gbasedbt
[gbasedbt@localhost gbase]$ sh GBaseInit_gbasedbt.sh
Initializing Program...OK
ENTER THE INSTANCE INFORMATION or PRESS TO ACCEPT THE DEFAULT.
// 创建实例名称,默认为 gbaseserver
ENTER GBASE INSTANCE NAME (GBASEDBTSERVER) [Default:gbaseserver]:
//选择安装目录。默认为 /opt/GBASE/gbase
GBASE INSTALL FOLDER LIST:
1) /opt/GBASE/gbase
CHOOSE GBASE INSTALL FOLDER(GBASEDBTDIR) [Default:/opt/GBASE/gbase]:
//选择本机 IP 地址
CHOOSE SERVICE IP ADDRESS FROM THE LIST:
1) 192.168.127.101
2) 127.0.0.1
ENTER THE NUMBER FOR YOUR CHOICE [Default:192.168.127.101]:
//指定数据库的监听端口,缺省为 9088
SPECIFY THE PORT NUMBER FOR GBASE [Default:9088]:
//选择安装方式: 2 定制安装
INITIALIZE TYPE:
1) TYPICAL -- Initialize the instance with all features configured with
default values.
2) CUSTOM -- Initialize the instance with specific features that you
need.
ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 2
//选择数据库字符集
GBASE CHARACTER SET LIST:
1) en_US.8859-1
2) zh_CN.GB18030-2000
GBaseInit_gbasedbt.rar

3) zh_CN.utf8
ENTER THE NUMBER FOR YOUR CHOICE [Default:1]: 2
//输入数据库空间存储路径
ENTER THE DATA SPACE PATH [Default:/opt/GBASE/gbase/gbaseserver_dbs]:
//设置逻辑日志空间大小
ENTER THE LOGICAL LOG DBSPACE SIZE(MB) [Default:540]:
//设置物理日志空间大小
ENTER THE PHYSICAL LOG DBSPACE SIZE(MB) [Default:540]:
//设置智能大对象空间大小
ENTER THE SMART LOB DBSPACE SIZE(MB) [Default:138]:
//设置临时数据空间大小
ENTER THE TEMPORARY DBSPACE SIZE(MB) [Default:138]:
// 输入 Y 启动以上设置,N 重新进行配置
ENTER "Y" TO START DATABASE ADVANCED SETTINGS, OR ENTER "N" TO ACCEPT
DEFAULT VALUES: [Default:Y]: Y
ENTER THE NUMBER OF DATA DBSPACES [Default:1]:
ENTER THE NUMBER OF TEMP DBSPACES [Default:1]:
//实例配置如下所示:
INSTANCE SUMMARY:
Instance name: gbaseserver
GBase install directory: /opt/GBASE/gbase
IP address & port: 192.168.127.101:9088
Character set: zh_CN.GB18030-2000
Logical log space size: 430 MB
Physical log space size: 430 MB
Smart LOB space size: 116 MB
Temp DBSpace size: 116 MB
Data path: /opt/GBASE/gbase/gbaseserver_dbs
Data path free size: 4292 MB
The number of data DBSpace: 1
The number of temp DBSpace: 1
Environment GL_USEGLU: 1
Enter "Y" to Start database initializing, or Enter "N" to Edit Again:
Enter "Y" to Start database initializing, or Enter "N" to Edit Again: Y
Touching Chunks...OK
Create sqlhosts File: /opt/GBASE/gbase/etc/sqlhosts.gbaseserver ...OK
Setting Parameters in /opt/GBASE/gbase/etc/onconfig.gbaseserver :
ROOTPATH.ROOTSIZE.DBSERVERNAME.FULL_DISK_INIT.SBSPACENAME.SYSSBSPACENAME.D BSPACETEMP.LOGFILES.MULTIPROCESSOR.VPCLASS.NETTYPE.CLEANERS.DEF_TABLE_LOCK MODE.DIRECT_IO.LOCKS.TAPEDEV.LTAPEDEV.CKPTINTVL.DS_MAX_QUERIES.DS_TOTAL_ME MORY.DS_NONPDQ_QUERY_MEM.PHYSBUFF.LOGBUFF.AUTO_TUNE.MSGPATH.SERVERNUM.ALLO W_NEWLINE.TEMPTAB_NOLOG.DUMPSHMEM.USEOSTIME.STACKSIZE.ON_RECVRY_THREADS.OF F_RECVRY_THREADS.USELASTCOMMITTED.SHMVIRTSIZE.SHMADD.GBASEDBTCONTIME.BUFFE RPOOL2K.BUFFERPOOL16K...AUTO_CKPTS.OK
Initializing Root DBSpace & Share Memory...OK
Creating system database.......OK
Creating logical log Dbspace...OK
Creating physical log Dbspace...OK
Creating smart LOB Dbspace...OK
Creating temp Dbspace.1...OK
Creating data Dbspace.1...OK
Setting dbscheduler...OK
Moving physical log...OK
Adding 40 logical logs:
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28
.29.30.31.32.33.34.35.36.37.38.39.40...OK
Setting data chunks extendable...OK
Cleaning logical logs in rootdbs.........OK
Database restarting.......OK
Creating database: gbasedb...OK
Now you can use this URL to connect to gbasedb:
jdbc:gbasedbtsqli://192.168.8.123:9088/gbasedb:GBASEDBTSERVER=gbaseserver;
Version:
GBase Database Server Version 12.10.FC4G1AEE -- On-Line -- Up 00:00:13 --
1121592 Kbytes
Build Number: 2.0.1A2_N303
GBase Initializing Finished!
Initialize log file : ./InitGBaseDB_201901081452.log
Press to Exit and Logout...
自动创建和初始化实例完毕,回车退出。
2.2.2.3 手动创建和初始化实例
您也可以按照如下步骤,手动创建实例并初始化。
(1)创建一个实例,假设其实例名为“gbaseserver”。
(2)创建一个实例需要配置以下三个文件,使用用实例名作为文件的后缀:
a) 环境变量文件名为 profile.gbaseserver
b) 配置参数文件名称为 onconfig.gbaseserver
c) sqlhosts 配置文件名称为 sqlhosts.gbaseserver


具体步骤如下:

1 创建数据库的数据文件存储目录 /dbs
以 root 身份登录,进入安装目录,创建数据目录:
[root@localhost ~]# cd /opt/GBASE/gbase
[root@localhost gbase]# mkdir dbs
[root@localhost gbase]# cd dbs
[root@localhost dbs]# touch rootdbs
[root@localhost dbs]# chown gbasedbt:gbasedbt rootdbs
[root@localhost dbs]# chmod 660 rootdbs


2 配置 profile.gbaseserver 环境变量文件

切换到 gbasedbt 用户身份登录,将默认环境变量 .bash_profile 文件复制一份,命名为
profile.gbaseserver,并对它进行编辑。
[root@localhost dbs]# su gbasedbt
[gbasedbt@localhost ~]$ cd /home/gbasedbt
[gbasedbt@localhost ~]$ cp .bash_profile profile.gbaseserver
[gbasedbt@localhost ~]$ vi profile.gbaseserver
(进入文件后按“i”建,开启 insert 模式)
注意:根据实例的实际情况更改红色部分字段信息
export GBASEDBTSERVER= gbaseserver //实例名
export GBASEDBTDIR= /opt/GBASE/gbase //安装路径
export > onconfig.gbaseserver //配置参数文件名称
export GBASEDBTSQLHOSTS=$GBASEDBTDIR/etc/ sqlhosts.gbaseserver //sqlhosts 文件名称
export PATH=$GBASEDBTDIR/bin:/usr/bin:${PATH}:.
export GL_DATE="%iY-%m-%d"
export DATETIME="%iY-%m-%d %H:%M:%S"
export DB_LOCALE=zh_cn.GB18030-2000
export CLIENT_LOCALE=zh_cn.GB18030-2000
export
LD_LIBRARY_PATH=${GBASEDBTDIR}/lib:${GBASEDBTDIR}/lib/esql:${GBASEDBTDIR}/lib/cli
export TERM=vt100
export TERMCAP=$GBASEDBTDIR/etc/termcap
export GBASEDBTTERM=termcap
export DBTEMP=$GBASEDBTDIR/tmp
完成之后保存退出。(第一步按 ESC ;第二步 输入冒号“:”;第三步输入 wq 代表保
存退出,q 代表退出,q! 代表强制退出。最后回车)。

[gbasedbt@localhost ~]$ source profile.gbaseserver
为了 gbasedbt 用户在登录后自动应用这些环境变量,请执行以下操作:
vi .bash_profile 文件,此文件后添加以下内容。
source /home/gbasedbt/profile.gbaseserver
然后执行以下命令,使环境变量生效:
[gbasedbt@localhost ~]$ source .bash_profile


3 配置 onconfig.gbaseserver 参数文件

将 /opt/BASE/gbase/etc/ 目录中的 onconfig.std 文档复制一份,命名为 $ONCONFIG 变
量指定的名称 onconfig.gbaseserver。
[gbasedbt@localhost ~]$ cd /opt/GBASE/gbase/etc/
[gbasedbt@localhost etc]$ cp onconfig.std onconfig.gbaseserver
vi onconfig.gbaseserver 文件,配置以下参数并保存:
提示:vi 编辑器中模糊查找字符串“XXX”方法:输入”/XXX”后回车即可向下检索到该字符串位 置。
ROOTPATH /opt/GBASE/gbase/dbs/rootdbs //系统数据库文件存储空间路径,参照步骤 1 中 的设置
SERVERNUM 1
//实例编号,多实例中每个实例编号要唯一
DBSERVERNAME gbaseserver
TAPEDEV /dev/null
LTAPEDEV /dev/null
//数据库服务器实例名称
//用于存储空间备份的磁带设备
//用于逻辑日志备份的磁带的设备路径


4 配置 sqlhosts.gbaseserver 文件

GBase 8s 数据库使用的监听端口默认为 9088,多实例中每个实例的端口必须唯一。
将 /opt/GBASE/gbase/etc/ 目录中的 sqlhosts.std 文档复制一份,命名为 GBASEDBTDQLHOSTS 变量指定的名称 sqlhost.gbaseserver。
[gbasedbt@localhost ~]$cd /opt/GBASE/gbase/etc/
[gbasedbt@localhost etc]$ cp sqlhosts.std sqlhosts.gbaseserver
vi sqlhosts.gbaseserver 文件,在文件末尾添加相关实例名、网络连接方式、IP 及端 口号。
[gbasedbt@localhost etc]$ vi sqlhosts.gbaseserver
在文件末尾按照如下格式添加内容并保存:
实例名 网络连接方式 IP 端口
gbaseserver onsoctcp 192.168.127.101 9088

(IP 地址是 当前虚拟机中 IP ,可使用 ifconfig 命令查看)


5 初始化数据库
使用 gbasedbt 用户执行初始化命令:

[gbasedbt@localhost ~]$ oninit -ivy


2.2.3 静默安装
准备响应文件
要执行静默安装(又称为无人管理的安装),请使用响应文件,其中包含关于想要如何进
行该产品安装的信息。
要完成包含先前安装配置的静默安装,必须有响应文件,其带有想要如何安装该产品的定
制设置。下列过程概述创建响应文件的两种不同方式:记录您安装的配置,或定制
bundle.properties 模板文件。该安装介质包含基于文本的 bundle.properties 文件,
可将其用作创建响应文件的模板。
如果知道自己已有有效的响应文件,则请从下列过程中的步骤 3 开始。
1. 通过下列步骤之一来创建响应文件:
l 执行 GBase 8s 安装脚本,录制模板生成响应文件。
[root@localhost opt] ./ids_install -r /opt/bundle.properties
安装完成后,将在 /opt 路径下生成响应文件 bundle.properties。
l 创建安装介质上的 bundle.properties 文件的副本,并为想要的安装配置编辑该
文件。
重要:请不要对安装介质中发送的 bundle.properties 文件进行重写、移动或删
除。必须将定制的 .properties 文件中的产品许可证条款协议设置更改为“true”
(-DLICENSE_ACCEPTED=TRUE),以便在静默安装期间作为响应文件。
2. 将响应文件复制至想要安装 GBase 8s 和任何打包的客户机程序的计算机。
3. 运行静默安装命令,指示响应文件的相对或绝对路径:
[root@localhost opt] ./ids_install -i silent -f /opt/bundle.properties - DLICENSE_ACCEPTED=TRUE
(DLICENSE_ACCEPTED 参数指示接受许可协议)

4. 在想要部署同一安装设置的每一位置上,重复步骤 2 和 3。
5. 配置数据库服务器。
安装完成后,需要设置环境变量、配置参数和连接文件信息,才能使用数据库服务
器。
可参阅 2.1.2.2 2.1.2.3 章节的内容进行配置。
3 使用 GBase 8s 数据库
3.1.1 启动/停止数据库服务
通常情况下,使用 gbasedbt 用户来启动和停止数据库服务。
成功安装数据库 GBase 8s 后,数据库会自动处于启动状态,可通过以下命令检查服务进
程是否存在:
[root@localhost opt]# ps -ef|grep oninit
gbasedbt 10830 1 0 19:52 ? 00:00:04 /opt/GBASE/gbase/bin/oninit -vy
root 10831 10830 0 19:52 ? 00:00:00 /opt/GBASE/gbase/bin/oninit -vy
root 10832 10831 0 19:52 ? 00:00:00 /opt/GBASE/gbase/bin/oninit -vy
root 10833 10831 0 19:52 ?
root 10834 10831 0 19:52 ?
root 10835 10831 0 19:52 ?
root 10836 10831 0 19:52 ?
root 10837 10831 0 19:52 ?
root 10915 10831 0 19:52 ?
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
00:00:00 /opt/GBASE/gbase/bin/oninit -vy
root 11997 5051 0 20:02 pts/0 00:00:00 grep oninit
以 gbasedbt 用户身份登录后,输入 onmode –ky,可停止数据库服务,示例如下:
[gbasedbt@localhost ~]$ onmode -ky
输入 oninit –vy,启动数据库服务,示例如下:
[gbasedbt@localhost ~]$ oninit -vy
Warning: Parameter's user-configured value was adjusted. (DS_MAX_SCANS)
Warning: Parameter's user-configured value was adjusted. (ONLIDX_MAXMEM)
Reading configuration file
'/opt/GBASE/gbase/etc/onconfig.ol_gbasedbt1210'...succeeded
Creating /GBASEDBTTMP/.infxdirs...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 8310 kbytes...succeeded
Creating infos file
"/opt/GBASE/gbase/etc/.infos.ol_gbasedbt1210"...succeeded
Linking conf file "/opt/GBASE/gbase/etc/.conf.ol_gbasedbt1210"...succeeded
Initializing rhead structure...rhlock_t 16384 (512K)... rlock_t (5312K)...
Writing to infos file...succeeded
Initialization of Encryption...succeeded
Initializing ASF...succeeded
Initializing Dictionary Cache and SPL Routine Cache...succeeded
Bringing up ADM VP...succeeded
Creating VP classes...succeeded
Forking main_loop thread...succeeded
Initializing DR structures...succeeded
Forking 1 'soctcp' listener threads...succeeded
Forking 1 'soctcp' listener threads...succeeded
Forking 1 'soctcp' listener threads...succeeded
Starting tracing...succeeded
Initializing 2 flushers...succeeded
Initializing SDS Server network connections...succeeded
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Validating chunks...succeeded
Initialize Async Log Flusher...succeeded
Starting B-tree Scanner...succeeded
Init ReadAhead Daemon...succeeded
Init DB Util Daemon...succeeded
Initializing DBSPACETEMP list...succeeded
Init Auto Tuning Daemon...succeeded
Checking database partition index...succeeded
Initializing dataskip structure...succeeded
Checking for temporary tables to drop...succeeded
Updating Global Row Counter...succeeded
Forking onmode_mon thread...succeeded
Creating periodic thread...succeeded
Creating periodic thread...succeeded
Starting scheduling system...succeeded
Verbose output complete: mode = 5

输入 ps -ef|grep oninit 检查数据库服务进程是否存在:


[gbasedbt@localhost ~]$ ps -ef|grep oninit
gbasedbt 12056 1 0 20:14 ? 00:00:00 oninit -vy
root 12057 12056 0 20:14 ? 00:00:00 oninit -vy
root 12058 12057 0 20:14 ? 00:00:00 oninit -vy
root 12059 12057 0 20:14 ? 00:00:00 oninit -vy
root 12060 12057 0 20:14 ? 00:00:00 oninit -vy
root 12061 12057 0 20:14 ? 00:00:00 oninit -vy
root 12062 12057 0 20:14 ? 00:00:00 oninit -vy
root 12063 12057 0 20:14 ? 00:00:00 oninit -vy
root 12064 12057 0 20:14 ? 00:00:00 oninit -vy

gbasedbt 12134 12116 0 20:25 pts/0 00:00:00 grep oninit


3.1.2 登录数据库
以 gbasedbt 用户身份登录,输入 dbaccess - - 命令进入数据库命令行模式,示例如下:
[gbasedbt@localhost ~]$ dbaccess – -
>
3.1.3 创建数据库
在 dbaccess 交互命令行中,执行如下SQL语句,创建数据库,示例如下:
[gbasedbt@localhost~]$ dbaccess - -
> create database gbase8s;

Database created.


4 卸载 GBase 8s
当用户需要卸载 GBase 8s 数据库系统时,需要先停止数据库服务,切换到 root 用户,
进入安装目录下的 uninstall/uninstall_ids,执行该目录下的 uninstallids 命令进行卸载。
卸载程序开始后,选择 2 并回车,删除所有相关联的数据库文件,示例如下:
[root@localhost ~]# cd /opt/GBASE/gbase/uninstall/uninstall_ids
[root@localhost uninstall_ids]# ./uninstallids
========================================================================== =====
GBase Software Bundle (created with
InstallAnywhere)
-------------------------------------------------------------------------- -----
Preparing CONSOLE Mode Uninstallation...
========================================================================== =====
Uninstall GBase Software Bundle
-------------------------------
About to uninstall GBase Software Bundle.
In this uninstall process, all GBase Software Bundle products in
/opt/GBASE/gbase will be uninstalled.
It is recommended that you first shutdown all database server instances
related
to this installation prior to uninstalling the product.
PRESS TO CONTINUE:
========================================================================== =====
Server Uninstall Options
------------------------
Server action:
Important: Choosing to remove all databases will remove all database
chunks,
environment files, registry entries, and message log files for all
database
server instances associated with this installation.
->1- Retains all databases, but removes all server binaries
2- Removes server binaries and all databases associated with them
ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS TO ACCEPT THE DEFAULT::
2
========================================================================== =====
Uninstalling...
---------------
...*
*
************************* *************************
************************* ************************
...*
*
************************* *************************
************************* ************************
...*
*
************************* *************************
************************* ************************
...*
*
************************* *************************
************************* ************************
...*
*
************************* *************************
************************* ************************
...*
*
************************* *************************
************************* *************************
==========================================================================
=====
Uninstall Complete
------------------
Uninstall is complete for GBase Software Bundle.
Product uninstall status:
GBase: Successful


请使用浏览器的分享功能分享到微信等