[root@redflag11012601 app]# ll v*gz
-rw-r--r-- 1 root root 810576392 05-03 19:44 v9.7_linuxx64_server.tar.gz
[root@redflag11012601 app]# tar xzf v9.7_linuxx64_server.tar.gz
[root@redflag11012601 app]# cd server
[root@redflag11012601 server]# ls
db2db2ckupgradedb2_deinstalldb2_installdb2lsdb2prereqcheckdb2setupdocinstallFixPack
[root@redflag11012601 server]# ll
总计 64
drwxr-xr-x6 bin bin 4096 2009-11-16 db2
-r-xr-xr-x1 bin bin 5340 2009-11-16 db2ckupgrade
-r-xr-xr-x1 bin bin 5293 2009-11-16 db2_deinstall
-r-xr-xr-x1 bin bin 5163 2009-11-16 db2_install
-r-xr-xr-x1 bin bin 5127 2009-11-16 db2ls
-r-xr-xr-x1 bin bin 5145 2009-11-16 db2prereqcheck
-r-xr-xr-x1 bin bin 5145 2009-11-16 db2setup
drwxr-xr-x 15 bin bin 4096 2009-11-16 doc
-r-xr-xr-x1 bin bin 5181 2009-11-16 installFixPack
[root@redflag11012601 server]# ./db2prereqcheck
[root@redflag11012601 server]# ./db2_install
用于安装产品的缺省目录 - /opt/ibm/db2/V9.7
***********************************************************
要选择另一个目录用于安装吗?[是/否]
Y
要选择另一个目录用于安装吗?[是/否]
Yes
要选择另一个目录用于安装吗?[是/否]
是
输入安装目录的完整路径名 -
------------------------------------------------
/user1/ibm/db2/V9.7
指定下列其中一个关键字以安装 DB2 产品。
ESE
CONSV
WSE
EXP
PE
CLIENT
RTCL
按“帮助”以重新显示产品名称。
按“退出”以退出。
***********************************************************
ESE
正在初始化 DB2 安装。
要执行的任务总数为:47
要执行的所有任务的总估计时间为:2070
任务 #1 启动
描述:正在检查许可协议的接受情况
估计时间 1 秒
任务 #1 结束
任务 #2 启动
描述:具备 root 用户特权的情况下进行安装时的基本客户机支持
估计时间 3 秒
任务 #2 结束
任务 #3 启动
描述:产品消息 - 英语
估计时间 12 秒
任务 #3 结束
任务 #4 启动
描述:基本客户机支持
估计时间 189 秒
任务 #4 结束
任务 #5 启动
描述:Java 运行时支持
估计时间 109 秒
任务 #5 结束
任务 #6 启动
描述:Java 帮助(HTML)- 英语
估计时间 7 秒
任务 #6 结束
任务 #7 启动
描述:具备 root 用户特权的情况下进行安装时的基本服务器支持
估计时间 7 秒
任务 #7 结束
任务 #8 启动
描述:集成动漫复制支持
估计时间 57 秒
任务 #8 结束
任务 #9 启动
描述:全局安全工具箱
估计时间 54 秒
任务 #9 结束
任务 #10 启动
描述:Java 支持
估计时间 11 秒
任务 #10 结束
任务 #11 启动
描述:SQL 过程
估计时间 3 秒
任务 #11 结束
任务 #12 启动
描述:ICU 实用程序
估计时间 40 秒
任务 #12 结束
任务 #13 启动
描述:Java 公共文件
估计时间 20 秒
任务 #13 结束
任务 #14 启动
描述:基本服务器支持
估计时间 243 秒
任务 #14 结束
任务 #15 启动
描述:IBM Java? 软件开发包(SDK)
估计时间 34 秒
任务 #15 结束
任务 #16 启动
描述:控制中心帮助(HTML)- 英语
估计时间 13 秒
任务 #16 结束
任务 #17 启动
描述:连接支持
估计时间 3 秒
任务 #17 结束
任务 #18 启动
描述:通信支持 - TCP/IP
估计时间 3 秒
任务 #18 结束
任务 #19 启动
描述:并行扩展
估计时间 3 秒
任务 #19 结束
任务 #20 启动
描述:EnterpriseDB 代码
估计时间 3 秒
任务 #20 结束
任务 #21 启动
描述:复制工具
估计时间 19 秒
任务 #21 结束
任务 #22 启动
描述:公共关系型包装器
估计时间 3 秒
任务 #22 结束
任务 #23 启动
描述:控制中心
估计时间 41 秒
任务 #23 结束
任务 #24 启动
描述:命令行处理器加强版
估计时间 3 秒
任务 #24 结束
任务 #25 启动
描述:DB2 数据源支持
估计时间 6 秒
任务 #25 结束
任务 #26 启动
描述:DB2 LDAP 支持
估计时间 4 秒
任务 #26 结束
任务 #27 启动
描述:“DB2 实例安装”向导
估计时间 8 秒
任务 #27 结束
任务 #28 启动
描述:Spatial Extender 客户机
估计时间 3 秒
任务 #28 结束
任务 #29 启动
描述:基本应用程序开发工具
估计时间 35 秒
任务 #29 结束
任务 #30 启动
描述:DB2 更新服务
估计时间 4 秒
任务 #30 结束
任务 #31 启动
描述:第一步
估计时间 3 秒
任务 #31 结束
任务 #32 启动
描述:DB2 企业服务器版的产品特征符
估计时间 5 秒
任务 #32 结束
任务 #33 启动
描述:样本数据库源
估计时间 4 秒
任务 #33 结束
任务 #34 启动
描述:DB2 文本搜索
估计时间 198 秒
任务 #34 结束
任务 #35 启动
描述:Informix 数据源支持
估计时间 4 秒
任务 #35 结束
任务 #36 启动
描述:正在设置 DB2 库路径
估计时间 180 秒
任务 #36 结束
任务 #37 启动
描述:正在安装或更新 SA MP
估计时间 40 秒
任务 #37 结束
任务 #38 启动
描述:正在安装或更新 SA MP 的 DB2 HA 脚本
估计时间 40 秒
任务 #38 结束
任务 #39 启动
描述:正在执行控制任务
估计时间 20 秒
任务 #39 结束
任务 #40 启动
描述:正在更新全局注册表
估计时间 20 秒
任务 #40 结束
任务 #41 启动
描述:正在安装 IBM Tivoli Monitoring for Databases
估计时间 600 秒
任务 #41 结束
任务 #42 启动
描述:正在启动 DB2 故障监视器
估计时间 10 秒
任务 #42 结束
任务 #43 启动
描述:正在更新 db2ls 链接
估计时间 1 秒
任务 #43 结束
任务 #44 启动
描述:正在注册 DB2 许可证
估计时间 5 秒
任务 #44 结束
任务 #45 启动
描述:正在设置缺省全局概要文件注册表变量
估计时间 1 秒
任务 #45 结束
任务 #46 启动
描述:正在初始化实例列表
估计时间 5 秒
任务 #46 结束
任务 #47 启动
描述:正在注册 DB2 更新服务
估计时间 30 秒
任务 #47 结束
任务 #48 启动
描述:正在更新全局概要文件注册表
估计时间 3 秒
任务 #48 结束
已成功完成执行。
有关更多信息,请参阅 "/tmp/db2_install.log.27290" 上的 DB2 安装日志。
[root@redflag11012601 server]# ./installFixPack
DBI1073E安装程序脚本要求指定 -b
installFixPack。
输入安装目录的完整路径名 -
------------------------------------------------
/user1/ibm/db2/V9.7
DBI1017IinstallFixPack 正在更新安装在位置 /user1/ibm/db2/V9.7 处的 DB2
产品。
正在初始化 DB2 安装。
要执行的任务总数为:6
要执行的所有任务的总估计时间为:351
任务 #1 启动
描述:正在停止 DB2 故障监视器
估计时间 10 秒
任务 #1 结束
任务 #2 启动
描述:正在准备系统
估计时间 120 秒
任务 #2 结束
installFixPack 命令检测到已安装的 DB2 产品和修订包映像都处于 "9.7.0.1..0" 级别。不会更新任何内容。要添加新的功能部件,运行 db2setup
命令。要将已安装的 DB2 产品更新为更高级别,使用适当的修订包映像并再次运行 installFixPack 命令。要将已安装的 DB2 产品刷新为同一级别,
再次运行带有“-f level”选项的 installFixPack 命令。
执行期间发生了重大错误,导致此程序过早终止。如果问题仍然存在,请与技术服务代表联
系。
有关更多信息,请参阅 "/tmp/installFixPack.log.15259" 上的 DB2 安装日志。
[root@redflag11012601 server]# groupadd -g 901 db2grp
groupadd -g 902 db2fgrp
groupadd -g 903 db2agrp
[root@redflag11012601 server]# groupadd -g 902 db2fgrp
useradd -g db2grp -u 801 -d /home/db2inst1 -m -s /bin/sh db2inst1
[root@redflag11012601 server]# groupadd -g 903 db2agrp
useradd -g db2fgrp -u 802 -d /home/db2fenc -m -s /bin/sh db2fenc
[root@redflag11012601 server]# useradd -g db2grp -u 801 -d /home/db2inst1 -m -s /bin/sh db2inst1
useradd -g db2agrp -u 803 -d /home/db2das -m -s /bin/sh db2das
[root@redflag11012601 server]# useradd -g db2fgrp -u 802 -d /home/db2fenc -m -s /bin/sh db2fenc
[root@redflag11012601 server]# useradd -g db2agrp -u 803 -d /home/db2das -m -s /bin/sh db2das
[root@redflag11012601 server]#
[root@redflag11012601 server]# passwd db2inst1
Changing password for user db2inst1.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@redflag11012601 server]# more /etc/group |grep db2
db2grp:x:901:
db2fgrp:x:902:
db2agrp:x:903:
[root@redflag11012601 server]# more /etc/passwd |grep db2
db2inst1:x:801:901::/home/db2inst1:/bin/sh
db2fenc:x:802:902::/home/db2fenc:/bin/sh
db2das:x:803:903::/home/db2das:/bin/sh
[root@redflag11012601 server]# cd /user1/ibm/db2/V9.7/instance
[root@redflag11012601 instance]# pwd
/user1/ibm/db2/V9.7/instance
[root@redflag11012601 instance]# ./dascrt -u db2das
SQL4406WThe DB2 Administration Server was started successfully.
DBI1070IProgram dascrt completed successfully.
[root@redflag11012601 instance]# ./db2icrt -u db2inst1 db2inst1
DBI1070IProgram db2icrt completed successfully.
root@redflag11012601 V9.7]# ls
acs binconvdb2tss dsdriverha install java licensemiscReadmesecurity64
adm bnddas desktopfunctionincludeinstancelib32logs msg samples tivready
adsmcfgdasfcndocgskit infopopitmalib64mappropertiessecurity32tools
[root@redflag11012601 V9.7]# cd das
[root@redflag11012601 das]# ls
admbinconvdascshrcdasprofilefunctionjavalibmsg
[root@redflag11012601 das]# cd adm
[root@redflag11012601 adm]# ls
dasautodb2dasclndb2dasfupddb2dasrrmdb2dassecdb2dasstmldb2trc
[root@redflag11012601 adm]# cd ../bin
[root@redflag11012601 bin]# ls
db2admindb2cmnclpdb2dascfgdb2dasleveldb2dasstmdb2fmdb2fmddb2usrinf
[root@redflag11012601 bin]# ll
总计 344
-r-xr-xr-x 1 binbin 53023 05-03 19:51 db2admin
lrwxrwxrwx 1 root root 19 05-03 19:51 db2cmnclp -> ../../bin/db2cmnclp
-r-xr-xr-x 1 binbin 63025 05-03 19:51 db2dascfg
-r-xr-xr-x 1 binbin 59904 05-03 19:51 db2daslevel
-r-xr-xr-x 1 binbin154228 05-03 19:51 db2dasstm
lrwxrwxrwx 1 root root 15 05-03 19:51 db2fm -> ../../bin/db2fm
lrwxrwxrwx 1 root root 16 05-03 19:51 db2fmd -> ../../bin/db2fmd
lrwxrwxrwx 1 root root 19 05-03 19:51 db2usrinf -> ../../bin/db2usrinf
[root@redflag11012601 bin]# ./db2admin start
SQL4409WThe DB2 Administration Server is already active.
[root@redflag11012601 adm]# su - db2inst1
-sh-3.2$ cd /user1/ibm/db2/V9.7/adm
-sh-3.2$ cd /user1/ibm/db2/V9.7/bin
-sh-3.2$ ./db2ilist
db2inst1
-sh-3.2$ db2
-sh: db2: command not found
-sh-3.2$ ./db2
SQL10007N Message "-1390" could not be retrieved.Reason code: "3".
-sh-3.2$ whoami
db2inst1
-sh-3.2$ id
uid=801(db2inst1) gid=901(db2grp) groups=901(db2grp),903(db2agrp)
-sh-3.2$
-sh-3.2$ export DB2INSTANCE=db2inst1
-sh-3.2$ ./db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.1
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG
for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => connect to sample
SQL1031NThe database directory cannot be found on the indicated file system.
SQLSTATE=58031
db2 => quit
DB20000IThe QUIT command completed successfully.
-sh-3.2$ ./db2sampl
Starting the DB2 instance...
Creating database "SAMPLE"...
Connecting to database "SAMPLE"...
Creating tables and data in schema "DB2INST1"...
Creating tables with XML columns and XML data in schema "DB2INST1"...
Stopping the DB2 instance...
'db2sampl' processing complete.
-sh-3.2$
-sh-3.2$ pwd
/user1/ibm/db2/V9.7/bin
-sh-3.2$ cd ../adm
-sh-3.2$ ./db2start
05/03/2011 21:28:37 0 0 SQL1063NDB2START processing was successful.
SQL1063NDB2START processing was successful.
-sh-3.2$ cd ../bin
-sh-3.2$ ./db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.1
You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG
for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => connect to sample
Database Connection Information
Database server= DB2/LINUXX8664 9.7.1
SQL authorization ID = DB2INST1
Local database alias = SAMPLE
db2 => list tables
Table/View
Schema
TypeCreation time
------------------------------- --------------- ----- --------------------------
ACT
DB2INST1T 2011-05-03-21.26.36.504612
ADEFUSR
DB2INST1S 2011-05-03-21.26.37.655501
CATALOG
DB2INST1T 2011-05-03-21.26.39.833823
CL_SCHED
DB2INST1T 2011-05-03-21.26.36.233890
CUSTOMER
DB2INST1T 2011-05-03-21.26.39.774078
DEPARTMENT
DB2INST1T 2011-05-03-21.26.36.254746
DEPT
DB2INST1A 2011-05-03-21.26.36.294295
EMP
DB2INST1A 2011-05-03-21.26.36.327365
EMPACT
DB2INST1A 2011-05-03-21.26.36.503636
EMPLOYEE
DB2INST1T 2011-05-03-21.26.36.294788
EMPMDC
DB2INST1T 2011-05-03-21.26.38.120351
EMPPROJACT
DB2INST1T 2011-05-03-21.26.36.486256
EMP_ACT
DB2INST1A 2011-05-03-21.26.36.504181
EMP_PHOTO
DB2INST1T 2011-05-03-21.26.36.327799
EMP_RESUME
DB2INST1T 2011-05-03-21.26.36.362690
INVENTORY
DB2INST1T 2011-05-03-21.26.39.759422
IN_TRAY
DB2INST1T 2011-05-03-21.26.36.540853
ORG
DB2INST1T 2011-05-03-21.26.36.555101
PRODUCT
DB2INST1T 2011-05-03-21.26.39.605099
PRODUCTSUPPLIER
DB2INST1T 2011-05-03-21.26.39.883038
PROJ
DB2INST1A 2011-05-03-21.26.36.452210
PROJACT
DB2INST1T 2011-05-03-21.26.36.452653
PROJECT
DB2INST1T 2011-05-03-21.26.36.405451
PURCHASEORDER
DB2INST1T 2011-05-03-21.26.39.803358
SALES
DB2INST1T 2011-05-03-21.26.36.568205
STAFF
DB2INST1T 2011-05-03-21.26.36.561290
STAFFG
DB2INST1T 2011-05-03-21.26.37.504181
SUPPLIERS
DB2INST1T 2011-05-03-21.26.39.858900
VACT
DB2INST1V 2011-05-03-21.26.36.592619
VASTRDE1
DB2INST1V 2011-05-03-21.26.36.600497
VASTRDE2
DB2INST1V 2011-05-03-21.26.36.602428
VDEPMG1
DB2INST1V 2011-05-03-21.26.36.596996
VDEPT
DB2INST1V 2011-05-03-21.26.36.582523
VEMP
DB2INST1V 2011-05-03-21.26.36.590066
VEMPDPT1
DB2INST1V 2011-05-03-21.26.36.598825
VEMPLP
DB2INST1V 2011-05-03-21.26.36.615882
VEMPPROJACT
DB2INST1V 2011-05-03-21.26.36.595583
VFORPLA
DB2INST1V 2011-05-03-21.26.36.609395
VHDEPT
DB2INST1V 2011-05-03-21.26.36.588850
VPHONE
DB2INST1V 2011-05-03-21.26.36.614311
VPROJ
DB2INST1V 2011-05-03-21.26.36.591323
VPROJACT
DB2INST1V 2011-05-03-21.26.36.593912
VPROJRE1
DB2INST1V 2011-05-03-21.26.36.604119
VPSTRDE1
DB2INST1V 2011-05-03-21.26.36.605739
VPSTRDE2
DB2INST1V 2011-05-03-21.26.36.607661
VSTAFAC1
DB2INST1V 2011-05-03-21.26.36.610938
VSTAFAC2
DB2INST1V 2011-05-03-21.26.36.612556
47 record(s) selected.
db2 => select * from staff where dept=10
ID NAMEDEPT JOB YEARSSALARYCOMM
------ --------- ------ ----- ------ --------- ---------
160 Molinare10 Mgr782959.20 -
210 Lu
10 Mgr 1090010.00 -
240 Daniels 10 Mgr579260.25 -
260 Jones 10 Mgr 1281234.00 -
4 record(s) selected.
db2 => db2 =>
db2 => quit
DB20000IThe QUIT command completed successfully.
|