Db2 9.7 for linux 5.4 Installation Steps

Source: Internet
Author: User


Db2 9.7 for linux 5.4 Installation Steps 1. Unzip the installation package # gunzip v9.7_linuxia32_server.tar.gz # tar-xvf v9.7_linuxia32_server.tar 2. Go to the decompressed file directory and install the package: (we choose manual installation) Note: DB2_install install www.2cto.com #. /Db2_install ------- no ----- aese 3. Create the groups and users required for running DB2: # groupadd-g 901 db2grp # groupadd-g 902 db2fgrp # groupadd-g 903 db2agrp # useradd-g db2grp-u 801-d/home/db2inst1-m-s/bin/bash db2inst1 -- manage the current instance # useradd-g db2fgrp -U 802-d/home/db2fenc-m-s/bin/bash db2fenc # useradd-g db2agrp-u 803-d/home/db2das-m-s/bin/bash db2das -- manage all instance 4. Set the password: passwd db2inst1passwd db2fencpasswd db2das 5. Create an instance # cd/opt/ibm/db2/V9.7/instance #. /dascrt-u db2das #. /db2icrt-u db2inst1 db2inst1 Note: DBI1922N The host name is not valid. an error occurred while parsing. Add the resolution parameter to the/etc/hosts file to www.2cto.com. Note: Dascrt: the DB2 adminstration server is created, and each server has only one such server. DB2 management (such as the Operation Control Center) is required, and its management user is specified as db2das. Db2icrt: The instance is created, and its name is generally the same as the management user name, which is db2inst1 here. 6. start DB2 # su-db2das $ db2admin start ---- start DB2 Management Server sql00009w The DB2 Administration Server is already active. $ su-db2inst1 $ db2start ---- start the database instance 05/07/2012 01:30:04 0 0 SQL1063N DB2START processing was successful. SQL1063N DB2START processing was successful. 7. Check whether DB2 is in the following status: [db2inst1 @ jetsen ~] $ Ps-ef | grep db2db2das 10828 1 0 0:23? 00:00:00/home/db2das/das/adm/db2dasrrmroot 11345 1 0? 00:00:00/opt/ibm/db2/V9.7/bin/db2fmcddb2das 11354 1 0? 00:00:00/opt/ibm/db2/V9.7/das/bin/db2fmd-I db2das-m/opt/ibm/db2/V9.7/das/lib/libdb2dasgcf. so.1root 17267 2768 0 00:00:00 pts/1 00:00:00 su-db2dasdb2das 17268 17267 0 000:00:00 pts/1-bashroot 17329 17268 0 0pts/1 su-db2inst1db2inst1 17332 17329 0 0pts/1 00:00:00-bashroot 17446 1 1 00:00:01 pts/1 00:00:01 db2wdog 0 db2inst1 17448 17446 1 pts/1 db2sysc 0 root 17449 17448 0 000:00:00 pts/1 00:00:00 db2ckpwd 0 root 17450 17448 0 000:00:00 pts/1 db2ckpwd 0 www.2cto.com root 17451 17448 0 0pts/1 db2ckpwd 0 db2inst1 17455 17448 1 0pts/ 1 00:00:01 db2vend (PD Vendor Process-1) db2inst1 17462 17446 0 00:00:01 pts/1 db2acd, 1, 11fd0, 0x125f0000, 0x125f0000, expires, 2, b5800bdb2inst1 17494 17 332 0 00:00:00 pts/1 00:00:00 ps-efdb2inst1 17495 17332 0 pts/1 grep db2 [db2inst1 @ jetsen ~] $8. Configure DB2 to start automatically. log on to # cd/opt/ibm/db2/V9.7/instance/# With the root user /#. /db2iauto-on db2inst1 9. Configure the network # su-db2inst1 $ db2 update dbm cfg using SVCENAME50000 ---- change the DB2 remote access port, the default value is 5000 $ db2set DB2COMM = TCPIP ---- change the connection mode of DB2 to TCPIP. Note: You can also use JDBC, ODBC and other methods to access the DB2 database 10. instance startup and shutdown # su-db2inst1 $ db2 force applications all ---- close all DB2-related applications $ db2stop ---- close the database instance $ db2start ---- start database instance 11. create DATABASE # su-db2inst1 $ db2 CREATE database test ---- create DATABASE instance DB20000I The CREATE database command completed successfully. 12. Connect to the database we just created # su-db2inst1 $ db2 www.2cto.com db2 => Connect to test user db2inst1Enter current password for db2inst1: database Connection Information Database server = DB2/LINUX 9.7.5 SQLauthorization ID = DB2INST1 Local database alias = TEST db2 => Appendix: 1. Create a demo database # su-db2inst1 $ cd/opt/ibm/db2/V9.7/bin $. /db2sampl 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 "... 'db2sampl' processing complete. 2. Access the newly created Database $ db2 www.2cto.com db2 => connect to sample Database Connection Information database server = DB2/LINUX 9.7.5 SQLauthorization ID = DB2INST1 Local Database alias = SAMPLE db2 => 3, common operation commands db2 => connect to sample --- connect to the sample database db2 => list tables --- view all tables under the database db2 => select * from staff wheredept = 10 --- query a table dept is equal to 10 of all records db2 => quit www.2cto.com --- exit db2DB20000I The QUIT command completed successfully. $ db2ilist; --- view instance list db2inst1 $ db2 get instance --- view the currently running instance Thecurrent database manager instance is: db2inst1 author Wu weilong

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.