1, DB2 installation
This installation of the server system is Linux, version is redhat6.3[uname-a results: Linux pss-seat2 2.6.32-279.el6.x86_64 #1 SMP Wed June 18:24:36 EDT x86_64 x86_64 Gnu/linux]. The installed version of DB2 is V10.1, using the command-line installation, which uses the Db2_install command instead of the Db2setup interface. The specific installation steps are as follows:
"1" View and set the system languageUsing the root account Input command in the Linux system: locale for viewing, the results are as follows:
Lang=zh_cn. GB18030
Lc_ctype= "ZH_CN. GB18030 "
Lc_numeric= "ZH_CN. GB18030 "
Lc_time= "ZH_CN. GB18030 "
Lc_collate= "ZH_CN. GB18030 "
Lc_monetary= "ZH_CN. GB18030 "
Lc_messages= "ZH_CN. GB18030 "
Lc_paper= "ZH_CN. GB18030 "
Lc_name= "ZH_CN. GB18030 "
Lc_address= "ZH_CN. GB18030 "
Lc_telephone= "ZH_CN. GB18030 "
Lc_measurement= "ZH_CN. GB18030 "
Lc_identification= "ZH_CN. GB18030 "
Lc_all=
Set the value of the Lc_all: Export Lc_all=en_us,export Lang=en_us to see the results as follows:
Lang=zh_cn. GB18030
Lc_ctype= "en_US"
Lc_numeric= "en_US"
Lc_time= "en_US"
Lc_collate= "en_US"
lc_monetary= "en_US"
Lc_messages= "en_US"
Lc_paper= "en_US"
Lc_name= "en_US"
Lc_address= "en_US"
Lc_telephone= "en_US"
Lc_measurement= "en_US"
lc_identification= "en_US"
Lc_all=en_us
Note: The above action is intended to facilitate the entry of English. Because if Chinese is easy to get into a dead loop when installing a selection.
repeat: Do you want to install the application Cluster Transparency Feature? [Yes/no]
"2" View the SELinux value of RedhatWhen the system is initially installed, this value is set to enforcing, at which point error number 1 is installed and set to disabled. Specific setup steps: Enter/etc/selinux to change the contents of the config file [cd/etc/selinux,vi config]
Note: If this value is set to enforcing, error 1 error will occur.
the error encountered:
Error number |
1 |
Error description |
|
Solution Solutions |
1, cd/etc/selinux;2, vi config;3, the selinux=enforcing of the document is changed to selinux=disabled. |
Error number |
2 |
Error description |
|
Solution Solutions |
This warning does not affect the installation of DB2, which is a package used by C + + compilation |
"3" Installation DB2This is only the installation of the DB2 database, excluding the DB instance. The installation file name is: V10.1_linuxx64_ese.tar.
①Copy the installation files to the appropriate directory and make sure that the directory has more than 10G of space. This is copied into the/OPT/DB2 (created by yourself).
②Decompression: TAR-XVF V10.1_linuxx64_ese.tar, the ESE directory will be produced in the current directory, containing the installation files.
③To install: Cd/ese; Execute the Install command:./db2_install if there is no error, the following information appears and the appropriate information is entered as prompted.
DBI1324W the Db2_install command is deprecated. For more information, see the DB2 information Center.
Default directory for installation of products-/opt/ibm/db2/v10.1
***********************************************************
Install into default directory (/opt/ibm/db2/v10.1)? [Yes/no] (Author Note: enter Yes)
Yes
Specify one of the following keywords to install DB2 products.
Ese
CLIENT
Rtcl
Enter ' help ' to redisplay product names.
Enter "Quit" to exit. (Author Note: Enter ESE---stand-alone version)
***********************************************************
Ese
***********************************************************
Do you want to install the application Cluster Transparency Feature? [Yes/no] (Author Note: enter NO)
No
DB2 installation is being initialized.
Total number of the tasks to be performed:45
After that there will be 45 task start and end information, knowing to see
The execution completed successfully.
Description The DB2 database is already installed.
second, the creation of the instance
"1" view values in the hostsThis problem is very hidden, be sure to note that the previous installation is always reported error 1. Execute the command before changing the file: Cat/etc/hosts the results are as follows:And the server IP we installed is: 172.27.18.30,HOSTNAME:PSS-SEAT1. After the change [
note the last line]:Change step: cd/etc; VI hosts; In the last line add the IP address of the installation machine, space, hostname.
"2" Create an instance
①Create a user group/usr/sbin/groupadd Db2iadm1/usr/sbin/groupadd db2fadm1/usr/sbin/groupadd dasadm1 (not required, generally not built)
②Create users, and set up groups. /usr/sbin/useradd-m-G db2iadm1-d/home/db2inst1 db2inst1-s/bin/bash[Instance user]/usr/sbin/useradd-m-G db2fadm1-d/home/db 2FENC1 db2fenc1-s/bin/bash[Protected User] The above statement can also be performed in steps
Cat/etc/group [View DB2IADM1 's gid]/usr/sbin/useradd-d/home/db2inst1 db2inst1-s/bin/bashusermod-g[ Here 1000 is db2iadm1 's gid]/usr/sbin/useradd-d/home/db2fenc1 db2fenc1-s/bin/bashusermod-g 999 db2fenc1 [Here 999 is DB2FADM1 's GID] |
If you create a second instance, the 1> does not need to be built, just perform the second step. /usr/sbin/useradd-m-G db2iadm1-d/home/db2inst2 db2inst2[Instance user]/usr/sbin/useradd-m-G db2fadm1-d/home/db2fenc2 Db2fen c2[protected User] |
③Change the directory permissions and set the password for the user chown Db2inst1/home/db2inst1chown db2fenc1/home/db2fenc1passwd db2inst1 set the password, To connect to the database using Datastudio passwd db2fenc1
④Create a user's. profile file su-db2inst1cd ~touch. Profiles
⑤Create Instance su-rootcd/opt/ibm/db2/v10.1/instance[enter DB2 installation directory]./db2icrt-u db2fenc1 db2inst1[./db2icrt-a server-u db2fenc1 db2i Nst1] Of course, here can also specify the port, do not DB2 themselves looking for the port, the command is as follows:./db2icrt-p 60000-u db2fenc1 db2inst1[at this time default-a SERVER] enters/ etc under the document services can be seen below the words similar to the following description of the creation success!Start the DB2 instance (the following string will appear after you log on to the system first to execute su–db2inst1db2start[boot success)
⑥Configuration instance Configuration connection is Tcpip:su-db2inst1 (modify TCP/IP variable) db2set db2comm=tcpipdb2 update dbm CFG using SVCENAME db2_db2test [Note: db2_db2i NS1 is automatically written when the DB2 instance is created
/etc/servicesMap, you can change it directly to the port you want]
⑦Other settings set the Oracle Compatibility Switch Db2set Db2_compatibility_vector=ora launch DB2 instance (this is the first to execute su–db2inst1 after logging into the system) Db2start if you can start the instructions to create the success! and enter/etc under the document services can be seen in the bottom of the words similar to the following.
the problem encountered:
Error number |
1 |
Error description |
Operating system Information:linux 2.6.32-279.el6.x86_64. #1 SMP Wed June 18:24:36 EDT x86_64error:dbi1702e the S Pecified Service name or port number conflicts with existing values in the TCP/IP Services file. Explanation:the Service name or port number conflicts with existing values in Theservices file. The service name might already is used with a differentport number, or the port number might already is used with a differ Entservice name. |
Solution Solutions |
1, cd/etc;2, vi hosts; 3, add a line: IP address + space +hostname |
Note |
If the error indicates that a suitable port is not found, it is trapped in an infinite loop to listen for available ports. |
third, the creation of the database (to undertake above, is still db2inst1 users)
①DB2 "CREATE DB seatmap USING codeset UTF-8 TERRITORY CN";
②DB2 Connect to Seatmap;
③Executes the created SQL statement, which includes the buffer pool, tablespace, schema, sequence, table structure, and indexes, constraints, and so on. Enter DB2-TVF seatmap.sql on the command line.
④Insert the necessary static data DB2-TVF Seatmap_staticdata.sql.
installation process of DB2