南大通用GBase 8t

2016-11-15 00:31:44
刘佳俊
367
最后编辑:大黄鱼 于 2016-11-22 16:58:23

南大通用GBase 8t

测试说明

本次测试用于验证GBase 8t在红旗Linux OpenPower平台上的可用性。对数据库的基本功能进行测试。

测试环境

设备型号 示例
处理器 128核
内存 64G
硬盘 示例
网卡 示例
操作系统 示例
数据库 GBase 8t V8.5

测试过程

安装

数据库安装前的准备

创建informix组

使用root用户执行

groupadd informix;

创建informix用户并修改口令

useradd -g informix -d /opt/informix -s /bin/bash -m informix

3.1.1.2 准备存放GBase 8t数据库目录

假设数据库安装路径为/home/informix/gbase

mkdir /home/informix/gbase

chown -Rf informix:informix /home/informix/gbase

假设将数据库的数据文件存放在/opt/dbs目录

cd /opt

mkdir dbs

chown -Rf informix:informix dbs

准备informix用户环境变量

GBase 8t数据库软件的安装目录为/home/informix/gbase目录;

GBase 8t数据库使用的实例名为gbaseserver

登录informix用户,vi .bash_profile,并加入如下内容:

export INFORMIXSERVER=gbaseserver

export INFORMIXDIR=/home/informix/gbase

export ONCONFIG=onconfig.gbaseserver

export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.gbaseserver

export PATH=$INFORMIXDIR/bin:/usr/bin:${PATH}:.

export GL_DATE="%m/%d/%iY"

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=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${INFORMIXDIR}/lib/cli

export TERM=vt100

export TERMCAP=$INFORMIXDIR/etc/termcap

export INFORMIXTERM=termcap

export DBTEMP=$INFORMIXDIR/tmp

保存退出!

数据库安装步骤

GBase 8t SERVER安装
上传安装介质

上传安装介质到服务器并在单独的目录中解压。解压后产生的安装文件如下:

drwxr-xr-x 2 informix informix 4096 01-07 14:20 doc

-rwxr-xr-x 1 informix informix 282311293 01-07 14:24 ids_install

-rw-r--r-- 1 informix informix 1952 01-07 14:24 ids.properties

-rwxr-xr-x 1 informix informix 82285 01-07 14:24 onsecurity

安装GBase 8t SERVER步骤

使用root用户执行ids_install文件进行安装 [root@linux70 soft]# ./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...

                                    (created with InstallAnywhere)

Preparing CONSOLE Mode Installation...

Getting Started


This application will guide you through the installation of GBase 8t Software Bundle. Copyright GBASE Corporation 2004, 2015. All rights reserved. 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 8t 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. 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

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, 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

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 //选择Y


Installation Location


Choose location for software installation

 Default Install Folder: /home/informix/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:: 2 //选择2进行Custom installation


"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 <ENTER> 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 '?<NUMBER>'. PRESS <RETURN> WHEN YOU ARE DONE:

   1- [X] GBase 8t 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] West European and Americas
  25-  |-[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 <ENTER> 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 <ENTER> 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 <ENTER> TO ACCEPT THE DEFAULT:: //回车


Installation Summary


Please review the following before continuing:

Product Name:

   GBase 8t Software Bundle

Install Folder:

   /home/informix/gbase

Product Features:

   GBase 8t 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),
   West European and Americas,
   Chinese

Disk Space Information (for Installation Target):

   Required:  424,782,934 Bytes
   Available: 6,979,428,352 Bytes

PRESS <ENTER> TO CONTINUE: //回车


Ready To Install


InstallAnywhere is now ready to install GBase 8t Software Bundle onto your

system at the following location:

  /home/informix/gbase

PRESS <ENTER> TO INSTALL: //回车


Installing...


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


Installation Complete


The installation of GBase 8t Software Bundle is complete.

  Please see the installation log for details.  Click 'Done' to exit the 

installation process.

Product install status:

GBase 8t: Successful

For more information about using GBase 8t products, see the GBASE Company website at www.gbase.cn .

PRESS <ENTER> TO EXIT THE INSTALLER: //回车,安装结束

初始化实例

配置数据库ONCONFIG文件和sqlhosts文件

GBase 8t使用的数据文件类型为操作系统文件(路径为/opt/dbs)

数据库所在机器ip地址为127.0.0.1

假设3:GBase 8t数据库使用的监听端口为9088

使用informix用户操作

  • 创建存放数据文件的目录,并生成rootdbs数据文件

cd /opt/dbs

touch rootdbs

chmod 660 rootdbs :

  • 将$INFORMIXDIR/etc/目录中的sqlhosts.std文档拷贝一份,名称为$INFORMIXSQLHOSTS变量制定的名称

. ~informix/.bash_profile;

cd /home/informix/gbase

cp $INFORMIXDIR/etc/sqlhosts.std $INFORMIXSQLHOSTS

  • 将$INFORMIXDIR/etc/目录中的onconfig.std文档拷贝一份,名称为$ONCONFIG变量制定的名称

cp $INFORMIXDIR/etc/onconfig.std $INFORMIXDIR/etc/$ONCONFIG

  • 编辑$INFORMIXSQLHOSTS文件

echo "$INFORMIXSERVER onsoctcp 127.0.0.1 9088" >> $INFORMIXSQLHOSTS

  • 编辑$ONCONFIG文件

sed -i "s#^ROOTPATH.*#ROOTPATH /opt/dbs/rootdbs #g" $INFORMIXDIR/etc/$ONCONFIG

sed -i "s#^DBSERVERNAME.*#DBSERVERNAME $INFORMIXSERVER #g" $INFORMIXDIR/etc/$ONCONFIG

sed -i "s#^TAPEDEV.*#TAPEDEV /dev/null #g" $INFORMIXDIR/etc/$ONCONFIG

sed -i "s#^LTAPEDEV.*#LTAPEDEV /dev/null #g" $INFORMIXDIR/etc/$ONCONFIG

3.2.2 初始化数据库

使用informix用户执行初始化命令:

oninit –ivy

增加空间

创建dbspace

数据库中需要创建五个存放数据的dbspace,名字分别为datadbs1 datadbs2 datadbs3 datadbs4,并且每个

dbspace空间大小为2G; 逻辑日志dbspace和物理日志dbspace空间大小均为2G;

所有dbspace使用操作系统文件;

数据库中使用4个temp dbspace,每个temp dbspace空间大小为200M;

使用informix用户操作

  • 在/opt/dbs目录中创建操作系统文件,并修改这些文件属性为660

cd /opt/dbs;

touch plogdbs llogdbs tmpdbs1 tmpdbs2 tmpdbs3 tmpdbs4 datadbs1 datadbs2 datadbs3 datadbs4 sbspace1;

chmod 660 plogdbs llogdbs tmpdbs1 tmpdbs2 tmpdbs3 tmpdbs4 datadbs1 datadbs2 datadbs3 datadbs4 sbspace1;

  • 通过onspaces命令添加dbspace


onspaces -c -d plogdbs -p /opt/dbs/plogdbs -o 0 -s 2000000;

onspaces -c -d llogdbs -p /opt/dbs/llogdbs -o 0 -s 2000000;

onspaces -c -d tmpdbs1 -p /opt/dbs/tmpdbs1 -o 0 -s 200000 -t -k 8k;

onspaces -c -d tmpdbs2 -p /opt/dbs/tmpdbs2 -o 0 -s 200000 -t -k 8k;

onspaces -c -d tmpdbs3 -p /opt/dbs/tmpdbs3 -o 0 -s 200000 -t -k 8k;

onspaces -c -d tmpdbs4 -p /opt/dbs/tmpdbs4 -o 0 -s 200000 -t -k 8k;

onspaces -c -S sbspace1 -p /opt/dbs/sbspace1 -o 0 -s 100000 -k 8k;

onspaces -c -d datadbs1 -p /opt/dbs/datadbs1 -o 0 -s 2000000 -k 8k;

onspaces -c -d datadbs2 -p /opt/dbs/datadbs2 -o 0 -s 2000000 -k 8k;

onspaces -c -d datadbs3 -p /opt/dbs/datadbs3 -o 0 -s 2000000 -k 8k;

onspaces -c -d datadbs4 -p /opt/dbs/datadbs4 -o 0 -s 2000000 -k 8k;

3.4 调整日志

添加逻辑日志/物理日志

  •  在静默状态下通过onmode命令添加物理日志,大小约2G

使用informix用户操作: onparams -p -s 1999000 -d plogdbs –y

  •  使用onmode命令添加逻辑日志,每个日志大小约100M,逻辑日志存放在llogdbs dbspace上。

使用informix用户操作: onparams -a -d llogdbs -s 100000 连续执行” onparams -a -d llogdbs -s 100000”命令多次,直到llogdbs空间用完,避免空间浪费。

数据库测试demo

执行命令dbaccessdemo,建立stores_demo数据库,过程包括建立database,包含所有数据类型的表,视图,存储过程,触发器等,并插入测试数据,进行统计更新。

执行$INFORMIXDIR/demo/esqlc下的demo程序,结果正确。

测试TPC-C

使用BenchMarkSQL4.1进行TPC-C测试,装载10Warehouse,配置100并发,通过JDBC

连接数据库,运行结果正常,性能优秀。

运行期间服务器CPU使用率保持在11%-12%。

2015-08-14 16:57:21,916 FATAL - Term-00 Running Average tpmC: 451484.73 , Current recentTpmC: 452328

2015-08-14 16:57:26,916 FATAL - Term-00 Running Average tpmC: 451376.37 , Current recentTpmC: 445200

2015-08-14 16:57:31,916 FATAL - Term-00 Running Average tpmC: 451380.09 , Current recentTpmC: 451596

2015-08-14 16:57:36,916 FATAL - Term-00 Running Average tpmC: 451094.49 , Current recentTpmC: 434244

2015-08-14 16:57:36,948 FATAL - Term-00 Running Average tpmC: 451053.58

2015-08-14 16:57:36,948 FATAL - Term-00 Measured tpmC = 451053.58

2015-08-14 16:57:36,948 FATAL - Term-00 Session Start = 2015-08-14 16:52:36

2015-08-14 16:57:36,948 FATAL - Term-00 Session End = 2015-08-14 16:57:36

2015-08-14 16:57:36,948 FATAL - Term-00 Transaction Count = 5010734


测试结果

经过以上操作测试,GBase 8t v8.5在红旗Linu OpenPower平台可以安装,并满足基本功能使用需求。

发表评论
评论通过审核后显示。