1、添加用户组和用户:
[code]groupadd db2grp
groupadd db2fgrp
groupadd dasadm
useradd -m -g db2grp -d /home/db2inst -s /bin/bash db2inst
useradd -m -g db2fgrp -d /home/db2fenc -s /bin/bash db2fenc
useradd -m -g dasadm -d /home/dasusr -s /bin/bash dasusr [/code]
2、安装缺失的软件包
[code][root@db1 server]# yum install compat-libstdc++-33
[root@db1 server]# yum install libstdc++.so.5[/code]
3、解压运行安装文件
[code][root@db1 ~]# cd /db2/soft/
[root@db1 soft]# ls
server v9.5fp4_linuxx64_server.tar.gz
[root@db1 soft]# cd server/
[root@db1 server]# ls
db2 db2_deinstall db2_install db2prereqcheck db2setup doc installFixPack
[root@db1 server]# ./db2_install
Default directory for installation of products - /opt/ibm/db2/V9.5
***********************************************************
Do you want to choose a different directory to install [yes/no] ?
Do you want to choose a different directory to install [yes/no] ?
no
Specify one of the following keywords to install DB2 products.
ESE
CONSV
WSE
EXP
PE
CLIENT
RTCL
Enter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
ESE
DB2 installation is being initialized.
Total number of tasks to be performed: 44
Total estimated time for all tasks to be performed: 1950
Task #1 start
Description: Checking license agreement acceptance
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Base Client Support for installation with root privileges
Estimated time 3 second(s)
Task #2 end
Task #3 start
Description: Product Messages - English
Estimated time 11 second(s)
Task #3 end
Task #4 start
Description: Base client support
Estimated time 160 second(s)
Task #4 end
Task #5 start
Description: The DB2 required component.
Estimated time 81 second(s)
Task #5 end
Task #6 start
Description: Java Help (HTML) - English
Estimated time 7 second(s)
Task #6 end
Task #7 start
Description: Base server support for installation with root privileges
Estimated time 8 second(s)
Task #7 end
Task #8 start
Description: Integrated Flash Copy Support
Estimated time 51 second(s)
Task #8 end
Task #9 start
Description: Global Secure ToolKit
Estimated time 14 second(s)
Task #9 end
Task #10 start
Description: Java support
Estimated time 11 second(s)
Task #10 end
Task #11 start
Description: SQL procedures
Estimated time 3 second(s)
Task #11 end
Task #12 start
Description: ICU Utilities
Estimated time 59 second(s)
Task #12 end
Task #13 start
Description: Java Common files
Estimated time 23 second(s)
Task #13 end
Task #14 start
Description: Base server support
Estimated time 228 second(s)
Task #14 end
Task #15 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 30 second(s)
Task #15 end
Task #16 start
Description: Control Center Help (HTML) - English
Estimated time 13 second(s)
Task #16 end
Task #17 start
Description: Connect support
Estimated time 3 second(s)
Task #17 end
Task #18 start
Description: Communication support - TCP/IP
Estimated time 3 second(s)
Task #18 end
Task #19 start
Description: Parallel Extension
Estimated time 3 second(s)
Task #19 end
Task #20 start
Description: Replication tools
Estimated time 19 second(s)
Task #20 end
Task #21 start
Description: Relational wrappers common
Estimated time 3 second(s)
Task #21 end
Task #22 start
Description: Control Center
Estimated time 50 second(s)
Task #22 end
Task #23 start
Description: DB2 data source support
Estimated time 4 second(s)
Task #23 end
Task #24 start
Description: DB2 LDAP support
Estimated time 4 second(s)
Task #24 end
Task #25 start
Description: DB2 Instance Setup wizard
Estimated time 4 second(s)
Task #25 end
Task #26 start
Description: Spatial Extender client
Estimated time 4 second(s)
Task #26 end
Task #27 start
Description: XML Extender
Estimated time 10 second(s)
Task #27 end
Task #28 start
Description: Base application development tools
Estimated time 33 second(s)
Task #28 end
Task #29 start
Description: First Steps
Estimated time 3 second(s)
Task #29 end
Task #30 start
Description: Product Signature for DB2 Enterprise Server Edition
Estimated time 5 second(s)
Task #30 end
Task #31 start
Description: Sample database source
Estimated time 4 second(s)
Task #31 end
Task #32 start
Description: DB2 Text Search
Estimated time 206 second(s)
Task #32 end
Task #33 start
Description: Informix data source support
Estimated time 4 second(s)
Task #33 end
Task #34 start
Description: Setting DB2 library path
Estimated time 180 second(s)
Task #34 end
Task #35 start
Description: Installing or updating SA MP Base Component
Estimated time 40 second(s)
Task #35 end
Task #36 start
Description: Executing control tasks
Estimated time 20 second(s)
Task #36 end
Task #37 start
Description: Updating global registry
Estimated time 20 second(s)
Task #37 end
Task #38 start
Description: Installing IBM Tivoli Monitoring for Databases
Estimated time 600 second(s)
Task #38 end
Task #39 start
Description: Starting DB2 Fault Monitor
Estimated time 10 second(s)
Task #39 end
Task #40 start
Description: Updating the db2ls link
Estimated time 1 second(s)
Task #40 end
Task #41 start
Description: Registering DB2 licenses
Estimated time 5 second(s)
Task #41 end
Task #42 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #42 end
Task #43 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #43 end
Task #44 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #44 end
A minor error occurred while installing "DB2 Enterprise Server Edition " on
this computer. Some features may not function correctly.
For more information see the DB2 installation log at
"/tmp/db2_install.log.1256”.[/code]
4、序列号
[code][root@db1 instance]# cd ../adm/
[root@db1 adm]# ./db2licm -a /db2/soft/server/db2/license/db2ese_t.lic
LIC1402I License added successfully.
LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V9.5/license/en_US.iso88591"
[root@db1 adm]#[/code]
5、初始化
[code][root@db1 instance]# ./dascrt -u dasusr
SQL4401C The DB2 Administration Server encountered an error during startup.
DBI1070I Program dascrt completed successfully.
[root@db1 instance]# ./db2icrt -p 50001 -u db2fenc db2inst
/opt/ibm/db2/V9.5/instance/db2iutil: line 4841: 9347 Segmentation fault ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?}
db2test
2014-02-17-11.19.42.078069+480 I1E1406 LEVEL: Event
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, RAS/PD component, pdLogInternal, probe:120
START : New Diagnostic Log file
DATA #1 : Build Level, 152 bytes
Instance "db2inst" uses "64" bits and DB2 code release "SQL09054"
with level identifier "06050107".
Informational tokens are "DB2 v9.5.0.4", "s090429", "MI00303", Fix Pack "4".
DATA #2 : System Info, 440 bytes
System: Linux db1 6 2 x86_64
CPU: total:1 online:1 Cores per socket:1 Threading degree per core:1
Physical Memory(MB): total:997 free:70
Virtual Memory(MB): total:2633 free:1706
Swap Memory(MB): total:1636 free:1636
Kernel Params: msgMaxMessageSize:65536 msgMsgMap:65536 msgMaxQueueIDs:1985
msgNumberOfHeaders:65536 msgMaxQueueSize:65536
msgMaxSegmentSize:16 shmMax:68719476736 shmMin:1 shmIDs:4096
shmSegments:4096 semMap:32000 semIDs:128 semNum:32000
semUndo:32000 semNumPerID:250 semOps:32 semUndoSize:20
semMaxVal:32767 semAdjustOnExit:32767
Cur data size (bytes) = 0xFFFFFFFF
Cur stack size (bytes) = 0x00A00000
Cur core size (bytes) = 0x00000000
nofiles (descriptors) = 0x00000400
Information in this record is only valid at the time when this file was
created (see this record's time stamp)
2014-02-17-11.19.42.073407+480 I1408E707 LEVEL: Severe
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, base sys utilities, sqleInitApplicationEnvironment, probe:32
MESSAGE : ZRC=0xFFFFE871=-6031
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -6031 sqlerrml: 4
sqlerrmc: 0 11
sqlerrp : SQLFRCFG
sqlerrd : (1) 0x00000000 (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
2014-02-17-11.19.42.127619+480 I2116E331 LEVEL: Severe
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, command line process, clp_bp_main, probe:2
DATA #1 : Hexdump, 4 bytes
0x00007FFFA369BE78 : 71E8 FFFF q...
2014-02-17-11.20.42.043899+480 I2448E387 LEVEL: Error
PID : 9771 TID : 140172847159040PROC : db2
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, command line process, clp_start_bp, probe:3
MESSAGE : CLP frontend unable to get REQUEST queue handle
DATA #1 : Hexdump, 4 bytes
0x00007FFFF7FF90B8 : 4200 0F87 B...
DBI1703E No valid service name or port number found.
Explanation:
No valid service name or port number for this instance can be found in
the TCP/IP services file. This information is either missing or is
invalid.
If you installed "DB2 Extended Server Edition" product, a service name
must be specified for the instance before using this command.
User response:
Specify valid service name and port number for this instance and enter
this command again.
DBI1079I Output is saved in the log file /tmp/db2icrt.log.8756.
Explanation:
All processed and failed operations have been saved into this log file.
User response:
Do not modify this file in any way. This file is for IBM Technical
Support reference.
/opt/ibm/db2/V9.5/instance/db2iutil: line 4841: 9347 Segmentation fault ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?}
https://www-304.ibm.com/support/docview.wss?uid=swg21385667
[root@db1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@db1 ~]# hostname
db1
[root@db1 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.3.10 db1 localhost
10.0.3.15 db1 localhost
~
[root@db1 ~]# cd /opt/ibm/db2/V9.5/instance/
[root@db1 instance]# ./db2icrt -p 50001 -u db2fenc db2inst
DBI1768W Unable to add /home/db2inst/sqllib/db2profile to the .profile file or
/home/db2inst/sqllib/db2cshrc to the .login file of user db2inst.
Explanation:
DB2 has failed to modify the .profile file or the .login file of this
user. These files may not exist, or you may not have write permission to
them. Without the modification you need to set your environment manually
each time when you log in as this user to use DB2.
User response:
Add the following line to the .profile file or the .login file:
. /home/db2inst/sqllib/db2profile to the .profile file, or
source /home/db2inst/sqllib/db2cshrc to the .login file
See the Quick Beginning Guide for more details on how to set the DB2
environment automatically.
DBI1070I Program db2icrt completed successfully.[/code]
6、手工设置环境变量
[code][root@db1 instance]# su - db2inst
-bash-4.1$ cat db2profile >> ../.profile
-bash-4.1$ cd ..
-bash-4.1$ cat .profile[/code]
7、创建数据库
[code]db2 => ?
ACTIVATE DATABASE GET CONTACTS RECOVER
ADD CONTACT GET/UPDATE DB CFG REDISTRIBUTE DB PARTITION
ADD CONTACTGROUP GET/UPDATE DBM CFG REFRESH LDAP
ADD DATALINKS MANAGER GET DBM MONITOR SWITCHES REGISTER LDAP
ADD DBPARTITIONNUM GET DESCRIPTION FOR HEALTH REGISTER XMLSCHEMA
ADD XMLSCHEMA GET NOTIFICATION LIST REGISTER XSROBJECT
ARCHIVE LOG GET HEALTH SNAPSHOT REORG INDEXES/TABLE
ATTACH GET INSTANCE REORGCHK
AUTOCONFIGURE GET MONITOR SWITCHES RESET ADMIN CFG
BACKUP DATABASE GET RECOMMENDATIONS RESET ALERT CFG
BIND GET ROUTINE RESET DB CFG
CATALOG APPC NODE GET SNAPSHOT RESET DBM CFG
CATALOG APPN NODE HELP RESET MONITOR
CATALOG DATABASE HISTORY RESTART DATABASE
CATALOG DCS DATABASE IMPORT RESTORE DATABASE
CATALOG LDAP DATABASE INITIALIZE TAPE REWIND TAPE
CATALOG LDAP NODE INSPECT ROLLFORWARD DATABASE
CATALOG LOCAL NODE LIST ACTIVE DATABASES RUNCMD
CATALOG NPIPE NODE LIST APPLICATIONS RUNSTATS
CATALOG NETBIOS NODE LIST COMMAND OPTIONS SET CLIENT
CATALOG ODBC DATA SOURCE LIST DATABASE DIRECTORY SET RUNTIME DEGREE
CATALOG TCPIP NODE LIST DB PARTITION GROUPS SET TABLESPACE CONTAINERS
CHANGE DATABASE COMMENT LIST DATALINKS MANAGERS SET TAPE POSITION
CHANGE ISOLATION LEVEL LIST DBPARTITIONNUMS SET UTIL_IMPACT_PRIORITY
COMPLETE XMLSCHEMA LIST DCS APPLICATIONS SET WRITE
CREATE DATABASE LIST DCS DIRECTORY START DATABASE MANAGER
CREATE TOOLS CATALOG LIST DRDA INDOUBT START HADR
DEACTIVATE DATABASE LIST HISTORY STOP DATABASE MANAGER
DECOMPOSE XML DOCUMENT LIST INDOUBT TRANSACTIONS STOP HADR
DEREGISTER LIST NODE DIRECTORY TAKEOVER HADR
DESCRIBE LIST ODBC DATA SOURCES TERMINATE
DETACH LIST PACKAGES/TABLES UNCATALOG DATABASE
DROP CONTACT LIST TABLESPACE CONTAINERS UNCATALOG DCS DATABASE
DROP CONTACTGROUP LIST TABLESPACES UNCATALOG LDAP DATABASE
DROP DATABASE LIST UTILITIES UNCATALOG LDAP NODE
DROP DATALINKS MANAGER LOAD UNCATALOG NODE
DROP DBPARTITIONNUM LOAD QUERY UNCATALOG ODBC DATA
DROP TOOLS CATALOG MIGRATE DATABASE UNQUIESCE DATABASE
ECHO PING UNQUIESCE INSTANCE
EDIT PREP/PRECOMPILE UPDATE ALERT CFG
EXPORT PRUNE HISTORY/LOGFILE UPDATE COMMAND OPTIONS
FORCE APPLICATION PUT ROUTINE UPDATE CONTACT
GET/UPDATE ADMIN CFG QUERY CLIENT UPDATE CONTACTGROUP
GET ALERT CFG QUIESCE DATABASE UPDATE NOTIFICATION LIST
GET AUTHORIZATIONS QUIESCE INSTANCE UPDATE HISTORY
GET/UPDATE CLI CFG QUIESCE TABLESPACES UPDATE LDAP NODE
GET CONNECTION STATE QUIT UPDATE MONITOR SWITCHES
GET CONTACTGROUP REBIND XQUERY
GET CONTACTGROUPS RECONCILE
Note: Some commands are operating system specific and may not be available.
For further help:
? db2-command - help for specified command
? OPTIONS - help for all command options
? HELP - help for reading help screens
The preceding three options can be run as db2 <option> from an OS prompt.
!db2ic - DB2 Information Center (Windows only)
This command can also be run as db2ic from an OS prompt.
db2 =>
db2 => get DB cfg
-bash-4.1$ db2start
02/18/2014 03:04:16 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
-bash-4.1$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.5.4
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 => create database db2test[/code]
[code]groupadd db2grp
groupadd db2fgrp
groupadd dasadm
useradd -m -g db2grp -d /home/db2inst -s /bin/bash db2inst
useradd -m -g db2fgrp -d /home/db2fenc -s /bin/bash db2fenc
useradd -m -g dasadm -d /home/dasusr -s /bin/bash dasusr [/code]
2、安装缺失的软件包
[code][root@db1 server]# yum install compat-libstdc++-33
[root@db1 server]# yum install libstdc++.so.5[/code]
3、解压运行安装文件
[code][root@db1 ~]# cd /db2/soft/
[root@db1 soft]# ls
server v9.5fp4_linuxx64_server.tar.gz
[root@db1 soft]# cd server/
[root@db1 server]# ls
db2 db2_deinstall db2_install db2prereqcheck db2setup doc installFixPack
[root@db1 server]# ./db2_install
Default directory for installation of products - /opt/ibm/db2/V9.5
***********************************************************
Do you want to choose a different directory to install [yes/no] ?
Do you want to choose a different directory to install [yes/no] ?
no
Specify one of the following keywords to install DB2 products.
ESE
CONSV
WSE
EXP
PE
CLIENT
RTCL
Enter "help" to redisplay product names.
Enter "quit" to exit.
***********************************************************
ESE
DB2 installation is being initialized.
Total number of tasks to be performed: 44
Total estimated time for all tasks to be performed: 1950
Task #1 start
Description: Checking license agreement acceptance
Estimated time 1 second(s)
Task #1 end
Task #2 start
Description: Base Client Support for installation with root privileges
Estimated time 3 second(s)
Task #2 end
Task #3 start
Description: Product Messages - English
Estimated time 11 second(s)
Task #3 end
Task #4 start
Description: Base client support
Estimated time 160 second(s)
Task #4 end
Task #5 start
Description: The DB2 required component.
Estimated time 81 second(s)
Task #5 end
Task #6 start
Description: Java Help (HTML) - English
Estimated time 7 second(s)
Task #6 end
Task #7 start
Description: Base server support for installation with root privileges
Estimated time 8 second(s)
Task #7 end
Task #8 start
Description: Integrated Flash Copy Support
Estimated time 51 second(s)
Task #8 end
Task #9 start
Description: Global Secure ToolKit
Estimated time 14 second(s)
Task #9 end
Task #10 start
Description: Java support
Estimated time 11 second(s)
Task #10 end
Task #11 start
Description: SQL procedures
Estimated time 3 second(s)
Task #11 end
Task #12 start
Description: ICU Utilities
Estimated time 59 second(s)
Task #12 end
Task #13 start
Description: Java Common files
Estimated time 23 second(s)
Task #13 end
Task #14 start
Description: Base server support
Estimated time 228 second(s)
Task #14 end
Task #15 start
Description: IBM Software Development Kit (SDK) for Java(TM)
Estimated time 30 second(s)
Task #15 end
Task #16 start
Description: Control Center Help (HTML) - English
Estimated time 13 second(s)
Task #16 end
Task #17 start
Description: Connect support
Estimated time 3 second(s)
Task #17 end
Task #18 start
Description: Communication support - TCP/IP
Estimated time 3 second(s)
Task #18 end
Task #19 start
Description: Parallel Extension
Estimated time 3 second(s)
Task #19 end
Task #20 start
Description: Replication tools
Estimated time 19 second(s)
Task #20 end
Task #21 start
Description: Relational wrappers common
Estimated time 3 second(s)
Task #21 end
Task #22 start
Description: Control Center
Estimated time 50 second(s)
Task #22 end
Task #23 start
Description: DB2 data source support
Estimated time 4 second(s)
Task #23 end
Task #24 start
Description: DB2 LDAP support
Estimated time 4 second(s)
Task #24 end
Task #25 start
Description: DB2 Instance Setup wizard
Estimated time 4 second(s)
Task #25 end
Task #26 start
Description: Spatial Extender client
Estimated time 4 second(s)
Task #26 end
Task #27 start
Description: XML Extender
Estimated time 10 second(s)
Task #27 end
Task #28 start
Description: Base application development tools
Estimated time 33 second(s)
Task #28 end
Task #29 start
Description: First Steps
Estimated time 3 second(s)
Task #29 end
Task #30 start
Description: Product Signature for DB2 Enterprise Server Edition
Estimated time 5 second(s)
Task #30 end
Task #31 start
Description: Sample database source
Estimated time 4 second(s)
Task #31 end
Task #32 start
Description: DB2 Text Search
Estimated time 206 second(s)
Task #32 end
Task #33 start
Description: Informix data source support
Estimated time 4 second(s)
Task #33 end
Task #34 start
Description: Setting DB2 library path
Estimated time 180 second(s)
Task #34 end
Task #35 start
Description: Installing or updating SA MP Base Component
Estimated time 40 second(s)
Task #35 end
Task #36 start
Description: Executing control tasks
Estimated time 20 second(s)
Task #36 end
Task #37 start
Description: Updating global registry
Estimated time 20 second(s)
Task #37 end
Task #38 start
Description: Installing IBM Tivoli Monitoring for Databases
Estimated time 600 second(s)
Task #38 end
Task #39 start
Description: Starting DB2 Fault Monitor
Estimated time 10 second(s)
Task #39 end
Task #40 start
Description: Updating the db2ls link
Estimated time 1 second(s)
Task #40 end
Task #41 start
Description: Registering DB2 licenses
Estimated time 5 second(s)
Task #41 end
Task #42 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #42 end
Task #43 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #43 end
Task #44 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #44 end
A minor error occurred while installing "DB2 Enterprise Server Edition " on
this computer. Some features may not function correctly.
For more information see the DB2 installation log at
"/tmp/db2_install.log.1256”.[/code]
4、序列号
[code][root@db1 instance]# cd ../adm/
[root@db1 adm]# ./db2licm -a /db2/soft/server/db2/license/db2ese_t.lic
LIC1402I License added successfully.
LIC1426I This product is now licensed for use as outlined in your License Agreement. USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V9.5/license/en_US.iso88591"
[root@db1 adm]#[/code]
5、初始化
[code][root@db1 instance]# ./dascrt -u dasusr
SQL4401C The DB2 Administration Server encountered an error during startup.
DBI1070I Program dascrt completed successfully.
[root@db1 instance]# ./db2icrt -p 50001 -u db2fenc db2inst
/opt/ibm/db2/V9.5/instance/db2iutil: line 4841: 9347 Segmentation fault ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?}
db2test
2014-02-17-11.19.42.078069+480 I1E1406 LEVEL: Event
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, RAS/PD component, pdLogInternal, probe:120
START : New Diagnostic Log file
DATA #1 : Build Level, 152 bytes
Instance "db2inst" uses "64" bits and DB2 code release "SQL09054"
with level identifier "06050107".
Informational tokens are "DB2 v9.5.0.4", "s090429", "MI00303", Fix Pack "4".
DATA #2 : System Info, 440 bytes
System: Linux db1 6 2 x86_64
CPU: total:1 online:1 Cores per socket:1 Threading degree per core:1
Physical Memory(MB): total:997 free:70
Virtual Memory(MB): total:2633 free:1706
Swap Memory(MB): total:1636 free:1636
Kernel Params: msgMaxMessageSize:65536 msgMsgMap:65536 msgMaxQueueIDs:1985
msgNumberOfHeaders:65536 msgMaxQueueSize:65536
msgMaxSegmentSize:16 shmMax:68719476736 shmMin:1 shmIDs:4096
shmSegments:4096 semMap:32000 semIDs:128 semNum:32000
semUndo:32000 semNumPerID:250 semOps:32 semUndoSize:20
semMaxVal:32767 semAdjustOnExit:32767
Cur data size (bytes) = 0xFFFFFFFF
Cur stack size (bytes) = 0x00A00000
Cur core size (bytes) = 0x00000000
nofiles (descriptors) = 0x00000400
Information in this record is only valid at the time when this file was
created (see this record's time stamp)
2014-02-17-11.19.42.073407+480 I1408E707 LEVEL: Severe
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, base sys utilities, sqleInitApplicationEnvironment, probe:32
MESSAGE : ZRC=0xFFFFE871=-6031
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -6031 sqlerrml: 4
sqlerrmc: 0 11
sqlerrp : SQLFRCFG
sqlerrd : (1) 0x00000000 (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
2014-02-17-11.19.42.127619+480 I2116E331 LEVEL: Severe
PID : 9773 TID : 139920643495680PROC : db2bp
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, command line process, clp_bp_main, probe:2
DATA #1 : Hexdump, 4 bytes
0x00007FFFA369BE78 : 71E8 FFFF q...
2014-02-17-11.20.42.043899+480 I2448E387 LEVEL: Error
PID : 9771 TID : 140172847159040PROC : db2
INSTANCE: db2inst NODE : 000
FUNCTION: DB2 UDB, command line process, clp_start_bp, probe:3
MESSAGE : CLP frontend unable to get REQUEST queue handle
DATA #1 : Hexdump, 4 bytes
0x00007FFFF7FF90B8 : 4200 0F87 B...
DBI1703E No valid service name or port number found.
Explanation:
No valid service name or port number for this instance can be found in
the TCP/IP services file. This information is either missing or is
invalid.
If you installed "DB2 Extended Server Edition" product, a service name
must be specified for the instance before using this command.
User response:
Specify valid service name and port number for this instance and enter
this command again.
DBI1079I Output is saved in the log file /tmp/db2icrt.log.8756.
Explanation:
All processed and failed operations have been saved into this log file.
User response:
Do not modify this file in any way. This file is for IBM Technical
Support reference.
/opt/ibm/db2/V9.5/instance/db2iutil: line 4841: 9347 Segmentation fault ${DB2DIR?}/instance/db2isrv -addfcm -i ${INSTNAME?}
https://www-304.ibm.com/support/docview.wss?uid=swg21385667
[root@db1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@db1 ~]# hostname
db1
[root@db1 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.3.10 db1 localhost
10.0.3.15 db1 localhost
~
[root@db1 ~]# cd /opt/ibm/db2/V9.5/instance/
[root@db1 instance]# ./db2icrt -p 50001 -u db2fenc db2inst
DBI1768W Unable to add /home/db2inst/sqllib/db2profile to the .profile file or
/home/db2inst/sqllib/db2cshrc to the .login file of user db2inst.
Explanation:
DB2 has failed to modify the .profile file or the .login file of this
user. These files may not exist, or you may not have write permission to
them. Without the modification you need to set your environment manually
each time when you log in as this user to use DB2.
User response:
Add the following line to the .profile file or the .login file:
. /home/db2inst/sqllib/db2profile to the .profile file, or
source /home/db2inst/sqllib/db2cshrc to the .login file
See the Quick Beginning Guide for more details on how to set the DB2
environment automatically.
DBI1070I Program db2icrt completed successfully.[/code]
6、手工设置环境变量
[code][root@db1 instance]# su - db2inst
-bash-4.1$ cat db2profile >> ../.profile
-bash-4.1$ cd ..
-bash-4.1$ cat .profile[/code]
7、创建数据库
[code]db2 => ?
ACTIVATE DATABASE GET CONTACTS RECOVER
ADD CONTACT GET/UPDATE DB CFG REDISTRIBUTE DB PARTITION
ADD CONTACTGROUP GET/UPDATE DBM CFG REFRESH LDAP
ADD DATALINKS MANAGER GET DBM MONITOR SWITCHES REGISTER LDAP
ADD DBPARTITIONNUM GET DESCRIPTION FOR HEALTH REGISTER XMLSCHEMA
ADD XMLSCHEMA GET NOTIFICATION LIST REGISTER XSROBJECT
ARCHIVE LOG GET HEALTH SNAPSHOT REORG INDEXES/TABLE
ATTACH GET INSTANCE REORGCHK
AUTOCONFIGURE GET MONITOR SWITCHES RESET ADMIN CFG
BACKUP DATABASE GET RECOMMENDATIONS RESET ALERT CFG
BIND GET ROUTINE RESET DB CFG
CATALOG APPC NODE GET SNAPSHOT RESET DBM CFG
CATALOG APPN NODE HELP RESET MONITOR
CATALOG DATABASE HISTORY RESTART DATABASE
CATALOG DCS DATABASE IMPORT RESTORE DATABASE
CATALOG LDAP DATABASE INITIALIZE TAPE REWIND TAPE
CATALOG LDAP NODE INSPECT ROLLFORWARD DATABASE
CATALOG LOCAL NODE LIST ACTIVE DATABASES RUNCMD
CATALOG NPIPE NODE LIST APPLICATIONS RUNSTATS
CATALOG NETBIOS NODE LIST COMMAND OPTIONS SET CLIENT
CATALOG ODBC DATA SOURCE LIST DATABASE DIRECTORY SET RUNTIME DEGREE
CATALOG TCPIP NODE LIST DB PARTITION GROUPS SET TABLESPACE CONTAINERS
CHANGE DATABASE COMMENT LIST DATALINKS MANAGERS SET TAPE POSITION
CHANGE ISOLATION LEVEL LIST DBPARTITIONNUMS SET UTIL_IMPACT_PRIORITY
COMPLETE XMLSCHEMA LIST DCS APPLICATIONS SET WRITE
CREATE DATABASE LIST DCS DIRECTORY START DATABASE MANAGER
CREATE TOOLS CATALOG LIST DRDA INDOUBT START HADR
DEACTIVATE DATABASE LIST HISTORY STOP DATABASE MANAGER
DECOMPOSE XML DOCUMENT LIST INDOUBT TRANSACTIONS STOP HADR
DEREGISTER LIST NODE DIRECTORY TAKEOVER HADR
DESCRIBE LIST ODBC DATA SOURCES TERMINATE
DETACH LIST PACKAGES/TABLES UNCATALOG DATABASE
DROP CONTACT LIST TABLESPACE CONTAINERS UNCATALOG DCS DATABASE
DROP CONTACTGROUP LIST TABLESPACES UNCATALOG LDAP DATABASE
DROP DATABASE LIST UTILITIES UNCATALOG LDAP NODE
DROP DATALINKS MANAGER LOAD UNCATALOG NODE
DROP DBPARTITIONNUM LOAD QUERY UNCATALOG ODBC DATA
DROP TOOLS CATALOG MIGRATE DATABASE UNQUIESCE DATABASE
ECHO PING UNQUIESCE INSTANCE
EDIT PREP/PRECOMPILE UPDATE ALERT CFG
EXPORT PRUNE HISTORY/LOGFILE UPDATE COMMAND OPTIONS
FORCE APPLICATION PUT ROUTINE UPDATE CONTACT
GET/UPDATE ADMIN CFG QUERY CLIENT UPDATE CONTACTGROUP
GET ALERT CFG QUIESCE DATABASE UPDATE NOTIFICATION LIST
GET AUTHORIZATIONS QUIESCE INSTANCE UPDATE HISTORY
GET/UPDATE CLI CFG QUIESCE TABLESPACES UPDATE LDAP NODE
GET CONNECTION STATE QUIT UPDATE MONITOR SWITCHES
GET CONTACTGROUP REBIND XQUERY
GET CONTACTGROUPS RECONCILE
Note: Some commands are operating system specific and may not be available.
For further help:
? db2-command - help for specified command
? OPTIONS - help for all command options
? HELP - help for reading help screens
The preceding three options can be run as db2 <option> from an OS prompt.
!db2ic - DB2 Information Center (Windows only)
This command can also be run as db2ic from an OS prompt.
db2 =>
db2 => get DB cfg
-bash-4.1$ db2start
02/18/2014 03:04:16 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
-bash-4.1$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.5.4
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 => create database db2test[/code]
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




