GBase 8t南大通用数据技术股份有限公司
数据库安装手册
GBase 8t数据库安装手册
南大通用数据技术股份有限公司
GBase版权所有©2004-2015,保留所有权利。
版权声明
本文档所涉及的软件著作权、版权和知识产权已依法进行了相关注册、登记,由南大通用数据技术股份有限公司合法拥有,受《中华人民共和国著作权法》、《计算机软件保护条例》、《知识产权保护条例》和相关国际版权条约、法律、法规以及其它知识产权法律和条约的保护。未经授权许可,不得非法使用。
免责声明
本文档包含的南大通用公司的版权信息由南大通用公司合法拥有,受法律的保护,南大通用公司对本文档可能涉及到的非南大通用公司的信息不承担任何责任。在法律允许的范围内,您可以查阅,并仅能够在《中华人民共和国著作权法》规定的合法范围内复制和打印本文档。任何单位和个人未经南大通用公司书面授权许可,不得使用、修改、再发布本文档的任何部分和内容,否则将视为侵权,南大通用公司具有依法追究其责任的权利。
本文档中包含的信息如有更新,恕不另行通知。您对本文档的任何问题,可直接向南大通用数据技术股份有限公司告知或查询。
未经本公司明确授予的任何权利均予保留。 通讯方式
南大通用数据技术股份有限公司
天津华苑产业区海泰发展六道6号海泰绿色产业基地J座(300384) 电话:400-817-9696 邮箱:info@gbase.cn
商标声明
是南大通用数据技术股份有限公司向中华人民共和国国家商标局申请注册的注
册商标,注册商标专用权由南大通用公司合法拥有,受法律保护。未经南大通用公司书面许可,任何单位及个人不得以任何方式或理由对该商标的任何部分进行使用、复制、修改、传播、抄录或与其它产品捆绑使用销售。凡侵犯南大通用公司商标权的,南大通用公司将依法追究其法律责任。
南大通用数据技术股份有限公司
GBase 8t数据库安装手册
1. 数据库安装前的准备 ................................................................................................................. 4
1.1 创建informix组 ................................................................................................................ 4 1.2 创建GBase 8t数据库安装目录 ....................................................................................... 4 1.3 准备informix用户环境变量 ............................................................................................ 4 2 GBase 8t 数据库安装 ................................................................................................................... 6
2.1上传安装介质 ..................................................................................................................... 6 2.2安装GBase 8t步骤 ............................................................................................................ 6 3 GBase 8t 数据库初始化 ............................................................................................................. 17
3.1 配置数据库ONCONFIG文件和sqlhosts文件 ............................................................... 17 3.2 初始化数据库 .................................................................................................................. 18 4 数据库配置................................................................................................................................. 19
4.1 创建dbspace ................................................................................................................... 19 4.2 添加物理日志/逻辑日志 .............................................................................................. 20 4.3 优化数据库参数重启数据库 .......................................................................................... 20
目 录
南大通用数据技术股份有限公司
GBase 8t数据库安装手册
1. 数据库安装前的准备
1.1 创建informix组
使用root用户执行
groupadd informix -g 505; 创建informix用户并修改口令
useradd -u 505 -g informix -d /home/informix -s /bin/bash -m informix passwd informix
1.2 创建GBase 8t数据库安装目录
假设数据库安装路径为/home/informix/gbase mkdir /home/informix/gbase cd /home
chmod 755 informix
chown -Rf informix:informix /home/informix/gbase
假设将数据库的数据文件存放在/opt/dbs目录 cd /opt mkdir dbs
chown -Rf informix:informix dbs
1.3 准备informix用户环境变量
假设1:GBase 8t数据库软件的安装目录为/home/informix/gbase目录; 假设2:GBase 8t数据库使用的实例名为gbaseserver 登录informix用户,vi .bash_profile(根据不同的SHELL环境编辑不同的环境变量文件,unix下默认为.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
南大通用数据技术股份有限公司
GBase 8t数据库安装手册
export TERM=vt100
export TERMCAP=$INFORMIXDIR/etc/termcap export INFORMIXTERM=termcap export DBTEMP=$INFORMIXDIR/tmp
保存退出!
南大通用数据技术股份有限公司
GBase 8t数据库安装手册
2 GBase 8t 数据库安装
2.1上传安装介质
上传安装介质到服务器并在单独的目录中解压。解压后产生的安装文件如下: 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
2.2安装GBase 8t步骤
使用root用户执行ids_install文件进行安装 [root@localhost 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) ------------------------------------------------------------------------------- 南大通用数据技术股份有限公司
GBase 8t数据库安装手册
Preparing CONSOLE Mode Installation... =============================================================================== Getting Started --------------- This application will guide you through the installation of GBase 8t V8.5 Software Bundle. Copyright GBASE Corporation 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 GBase 8t数据库安装手册 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 GBase 8t数据库安装手册 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 GBase 8t数据库安装手册 ============================================================================= Installation Location --------------------- Choose location for software installation Default Install Folder: ENTER AN ABSOLUTE PATH, OR PRESS GBase 8t数据库安装手册 ============================================================================== = 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 GBase 8t数据库安装手册 =========================================================================== OAT Administrator login setup ----------------------------- Enter the user name and password for accessing the OAT Admin pages. User name: (DEFAULT: admin): //回车 =========================================================================== Password: //输入密码 =========================================================================== Retype the password: //输入密码 =========================================================================== License Agreement ----------------- Installation and Use of 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 GBase 8t数据库安装手册 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 GBase 8t数据库安装手册 7. CHINESE GOVERNMENT RESTRICTED. If Software is being acquired by or on behalf PRESS GBase 8t数据库安装手册 Product Name: GBase 8t V8.5 Software Bundle Install Folder: /home/informix/gbase Product Features: GBase 8t V8.5 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, GBase 8t V8.5 Client SDK, GBase 8t V8.5 Object Interface for C++, GBase 8t V8.5 Object Interface for C++ Demos, GBase 8t V8.5 ESQL/C, GBase 8t V8.5 ESQL/C demos, 7.2 application compatibility module, GBase 8t V8.5 LIBDMI for client applications, GBase 8t V8.5 ODBC Driver, GBase 8t V8.5 ODBC Driver demos, Global Language Support (GLS), West European and Americas, Chinese, GBase 8t V8.5 JDBC, GBase 8t V8.5 OpenAdmin Tool, 南大通用数据技术股份有限公司 GBase 8t数据库安装手册 Replication Plug-in for OpenAdmin Tool, Schema Manager Plug-in for OpenAdmin Tool, TimeSeries Plug-in for OpenAdmin Tool, Health Advisor Plug-in for OpenAdmin Tool, JSON Plug-in for OpenAdmin Tool Disk Space Information (for Installation Target): Required: 3,047,209 Bytes Available: 5,059,833,856 Bytes PRESS GBase 8t数据库安装手册 3 GBase 8t 数据库初始化 3.1 配置数据库ONCONFIG文件和sqlhosts文件 假设1:GBase 8t使用的数据文件类型为操作系统文件(路径为/opt/dbs) 假设2:数据库所在机器ip地址为192.168.79.10 假设3:GBase 8t数据库使用的监听端口为9088 使用informix用户操作: 创建存放数据文件的目录,并生成rootdbs数据文件 cd /opt/dbs touch rootdbs chmod 660 rootdbs 将$INFORMIXDIR/etc/目录中的sqlhosts.std文档拷贝一份,名称为 $INFORMIXSQLHOSTS变量制定的名称 [informix@localhost dbs]$ cd ~ [informix@localhost ~]$ . .bash_profile [informix@localhost ~]$ cd /home/informix/gbase/ [informix@localhost gbase]$ cp $INFORMIXDIR/etc/sqlhosts.std $INFORMIXSQLHOSTS 将$INFORMIXDIR/etc/目录中的onconfig.std文档拷贝一份,名称为$ONCONFIG变量 制定的名称 cp $INFORMIXDIR/etc/onconfig.std $INFORMIXDIR/etc/$ONCONFIG 编辑$INFORMIXSQLHOSTS文件 echo \"$INFORMIXSERVER onsoctcp 192.168.1.60 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 南大通用数据技术股份有限公司 GBase 8t数据库安装手册 sed -i \"s#^TAPEDEV.*#TAPEDEV /dev/null #g\" $INFORMIXDIR/etc/$ONCONFIG sed -i \"s#^LTAPEDEV.*#LTAPEDEV /dev/null #g\" $INFORMIXDIR/etc/$ONCONFIG 3.2 初始化数据库 使用informix用户执行初始化命令: oninit –ivy 南大通用数据技术股份有限公司 GBase 8t数据库安装手册 4 数据库配置 4.1 创建dbspace 假设1:数据库中需要创建四个存放数据的dbspace,名字分别为datadbs1 datadbs2 datadbs3 datadbs4,并且每个dbspace空间大小为100M; 逻辑日志dbspace和物理日志dbspace空间大小均为1G; 假设2:所有dbspace使用操作系统文件; 假设3:数据库中使用4个temp dbspace,每个temp dbspace空间大小为100M; 使用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 -P plogdbs -p /opt/dbs/plogdbs -o 0 -s 1000000; onspaces -c -d llogdbs -p /opt/dbs/llogdbs -o 0 -s 1000000; onspaces -c -d tmpdbs1 -p /opt/dbs/tmpdbs1 -o 0 -s 100000 -t -k 8k; onspaces -c -d tmpdbs2 -p /opt/dbs/tmpdbs2 -o 0 -s 100000 -t -k 8k; onspaces -c -d tmpdbs3 -p /opt/dbs/tmpdbs3 -o 0 -s 100000 -t -k 8k; onspaces -c -d tmpdbs4 -p /opt/dbs/tmpdbs4 -o 0 -s 100000 -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 100000 -k 8k; onspaces -c -d datadbs2 -p /opt/dbs/datadbs2 -o 0 -s 100000 -k 8k; onspaces -c -d datadbs3 -p /opt/dbs/datadbs3 -o 0 -s 100000 -k 8k; onspaces -c -d datadbs4 -p /opt/dbs/datadbs4 -o 0 -s 100000 -k 8k; 注意: 如果需要使用裸设备存储数据,而不直接使用操作系统文件,那么需要事先通过操作系统命令文件创建络设备,并在/opt/dbs目录中创建指向裸设备的符号链接,并将裸设备的属性改为informix:Informix, 访问权限改为660 南大通用数据技术股份有限公司 GBase 8t数据库安装手册 4.2 添加物理日志/逻辑日志 在静默状态(onmode -u)下通过onparams命令添加物理日志,大小约1G 使用informix用户操作: onmode -uy onparams -p -s 999000 -d plogdbs –y //-s指定的单位为k 使用onparams命令添加逻辑日志,每个日志大小约100M,逻辑日志存放在 llogdbs dbspace上。 使用informix用户操作: onparams -a -d llogdbs -s 100000 //-s指定的单位为k 连续执行” onparams -a -d llogdbs -s 100000”命令多次,直到llogdbs空间用完为止,避免空间浪费。 执行onmode –m使得数据库online 使用informix用户操作: onmode –m 做一次数据库0级备份 使用informix用户操作: ontape -s -L 0 4.3 优化数据库参数重启数据库 修改$INFORMIXDIR/etc目录中的$ONCONFIG文件 使用informix用户操作: sed -i \"s#^SBSPACENAME.*#SBSPACENAME sbspace1 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^SYSSBSPACENAME.*#SYSSBSPACENAME sbspace1 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^DBSPACETEMP.*#DBSPACETEMP tmpdbs1,tmpdbs2,tmpdbs3,tmpdbs4 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^MULTIPROCESSOR.*#MULTIPROCESSOR 1 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^VPCLASS.*#VPCLASS cpu,num=2,noage #g\" $INFORMIXDIR/etc/$ONCONFIG; 南大通用数据技术股份有限公司 GBase 8t数据库安装手册 sed -i \"s#^CLEANERS.*#CLEANERS 32 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^LOCKS.*#LOCKS 100000 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^DEF_TABLE_LOCKMODE.*#DEF_TABLE_LOCKMODE row #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^SHMVIRTSIZE.*#SHMVIRTSIZE 326560 #g\" $INFORMIXDIR/etc/$ONCONFIG; sed -i \"s#^SHMADD.*#SHMADD 82656 #g\" $INFORMIXDIR/etc/$ONCONFIG sed -i \"s#^BUFFERPOOL size=8K.*#BUFFERPOOL size=8K,buffers=50000,lrus=32,lru_min_dirty=50,lru_max_dirty=60 #g\" $INFORMIXDIR/etc/$ONCONFIG; 使用informix用户关闭数据库 onmode –ky 使用informix用户启动数据库 oninit -vy 南大通用数据技术股份有限公司
因篇幅问题不能全部显示,请点此查看更多更全内容