CentOS 6.4 x64 DB2 Database installation

Source: Internet
Author: User
Tags db2 connect db2 connect to

CentOS 6.4 x64 DB2 Database Installation

System: CentOS 6.4 x64

Database: db2-v10.1

Preparation Environment steps

Vi/etc/hosts # modifying the hosts host name is best if it is the same as the computer name.

Reboot

Yum Install Libaio Libaio-devel

for the installation DB2 database Create corresponding account and user group permissions

Groupadd-g DB2IADM2

Groupadd-g DB2FADM2

Groupadd-g DB2ASGRP2

Useradd-m-G db2iadm2-d/home/db2inst2 Db2inst2

Useradd-m-G db2fadm2-d/home/db2fenc2 DB2FENC2

Useradd-m-G db2asgrp2-d/home/db2as2 DB2AS2

Set DB2 Database related account password

passwd Db2inst2

passwd DB2FENC2

passwd DB2AS2

Installation steps

Tar zxvf db2_ese_10_linux_x86-64.tar.gz

CD ESE

./db2_install

Enter the installation database directory

Cd/opt/ibm/db2/v10.1/instance

Chmod-r 775 *

Create an instance Db2inst2

./db2icrt-p 50111-u Db2fenc2 Db2inst2


Switch to the newly created user

Sudb2inst2

Start the sample database

Db2start


To Create a sample database , sample

Db2sampl


DB2 Connect to sample


in for connection DB2 Data Success

To test the sample database SQL statement

DB2 "SELECT * from Staff"

###### View database All table Commands # # # #

DB2 "SELECT Name Fromsysibm.systables"

Switch to the newly created user

Su-db2as2

Configure ports

DB2 update dbm CFG using SVCENAME 50111

View configuration information

DB2 Get dbm Cfg|grep SVCENAME

Create a database --------------------------------------------

Su Db2inst2

Cd/opt/ibm/db2/v10.1/instance

--1, creating the database ( you need to specify the encoding that cannot be modified after creation GBK territory CN)

DB2 "CREATE DB Qydb_dev USING CODESETGBK Territory CN"

DB2 "UPDATE DB CFG for Qydb_dev usingapplheapsz 4096"

DB2 "UPDATE DB CFG for Qydb_dev USINGAPP_CTL_HEAP_SZ 1024"

DB2 "UPDATE DB CFG for Qydb_dev usingstmtheap 8192"

DB2 "UPDATE DB CFG for Qydb_dev usingdbheap 2400"

DB2 "UPDATE DB CFG for Qydb_dev usinglocklist 1000"

DB2 "UPDATE DB CFG for Qydb_dev usinglogfilsiz 1000"

DB2 "UPDATE DB CFG for Qydb_dev usinglogprimary 12"

DB2 "UPDATE DB CFG for Qydb_dev usinglogsecond 20"

DB2 "UPDATE DB CFG for Qydb_dev Usinglogbufsz 32"

DB2 "UPDATE DB CFG for Qydb_dev usingavg_appls 5"

DB2 "UPDATE DB CFG for Qydb_dev usinglocktimeout 30"

Db2start # #启动DB2数据库

Online backup command: DB2 BACKUP DATABASE DBname to/home/db2inst1/backup/compress

View Historical backups: DB2 list historybackup all for DBname compress

DB2 force application All//forcibly terminates all connections

DB2 terminate //Clear all DB2 background processes

DB2 Stop Force //Stop Database

DB2 start //Restart Database


This article is from "Linux learner" blog, reprint please contact the author!

CentOS 6.4 x64 DB2 Database installation

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.