Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Db2 v11 is installed on redhat7

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Set the hostname and modify / etc/hosts the same

Hostnamectl-static set-hostname db2v11

2. Install the operating system dependency package

Yum install libstdc++.so.6

3. Extract the package and install it

. / db2_deinstall

To install the directory, select the recommended directory (you can modify the directory, if you do not modify / reserve the size to 6G)

Enter "help" to redisplay product names. -Select the type of product to install. Select SERVER here.

Do you want to install the DB2 pureScale Feature? [yes/no]-choose whether to install the pureScale feature, and choose not to install it here

4. Initialize after installation

Groupadd db2iadm1

Groupadd db2fadm1

Useradd db2inst1-G db2iadm1

Useradd db2fenc1-G db2fadm1

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

. / db2icrt-a server-p 50000-u db2fenc1 db2inst1

5. Activate license

The following actions are all performed by db2inst1 users to view license information

Db2licm-l

License activation

Db2licm-a / usr/local/src/db2ese_c.lic

6. Modify the instance

A. Modify the db2nodes.cfg (optional) location in the $HOME/sqllib/. of the instance user The file format is:

/ / the hostname should be the same as the hostname of / etc/hosts or hostname command to view

(2) check the services file (multi-node configuration automatically generates multiple service ports)

Vi / etc/services

DB2c_db2inst1 50000/tcp / / must be consistent with dbm SVCENAME

(3) start the instance:

Configure environment variables-root and db2inst1 users

# vi ~ / .bash_profile

$vi ~ / .bash_profile

. / home/db2inst1/sqllib/db2profile # add this line of code

# source ~ / .bash_profile

$source ~ / .bash_profile

Set the service name

$db2 update dbm cfg using SVCENAME db2inst1

Set registration variable

$db2set DB2COMM=tcpip

Start the instance

$db2start

7. Create a database

[root@localhost ~] # su-db2inst1

[db2inst1@localhost ~] $cd / opt/ibm/db2/V9.7/bin

[db2inst1@localhost bin] $. / db2sampl

8. Adjust database parameters

Db2set DB2_PARALLEL_IO=*

Db2set DB2_SKIPINSERTED=YES

Db2set DB2_USE_ALTERNATE_PAGE_CLEANING=YES

Db2set DB2_EVALUNCOMMITTED=YES

Db2set DB2_ANTIJOIN=EXTEND

Db2set DB2_SKIPDELETED=YES

Db2set DB2CODEPAGE=1208

Db2 update dbm cfg using DFT_MON_BUFPOOL on

Db2 update dbm cfg using DFT_MON_LOCK on

Db2 update dbm cfg using DFT_MON_SORT on

Db2 update dbm cfg using DFT_MON_STMT on

Db2 update dbm cfg using DFT_MON_TABLE on

Db2 update dbm cfg using DFT_MON_TIMESTAMP on

Db2 update dbm cfg using DFT_MON_UOW on

[db2inst1@db2v11 ~] $db2 get dbm cfg | grep-I mon

Transaction processor monitor name (TP_MON_NAME) =

Default database monitor switches

Buffer pool (DFT_MON_BUFPOOL) = OFF

Lock (DFT_MON_LOCK) = OFF

Sort (DFT_MON_SORT) = OFF

Statement (DFT_MON_STMT) = OFF

Table (DFT_MON_TABLE) = OFF

Timestamp (DFT_MON_TIMESTAMP) = ON

Unit of work (DFT_MON_UOW) = OFF

Monitor health of instance and databases (HEALTH_MON) = OFF

SYSMON group name (SYSMON_GROUP) =

Database monitor heap size (4KB) (MON_HEAP_SZ) = AUTOMATIC (90)

Authorization

Db2 get dbm cfg | grep-I sysmon

Groupadd db2user

Db2 update dbm cfg using SYSMON_GROUP db2user

Db2 attach to db2inst1

Db2 force applications all

Db2stop force

Db2 get dbm cfg | grep-I sysmon

Useradd-g db2user-d / home/dpmmon-s / bin/bash-m dpmmon

Su-db2inst1

Db2 connet to database

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_SERVICE_SUBCLASS TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLESPACE TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_CONTAINER TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_PKG_CACHE_STMT TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_BUFFERPOOL TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.ENV_GET_SYSTEM_RESOURCES TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.ENV_GET_DB2_SYSTEM_RESOURCES TO USER dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.ENV_GET_NETWORK_RESOURCES TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_CONNECTION TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_TABLE TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_LOCKS TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_ACTIVITY TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.MON_BP_UTILIZATION TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.MON_BP_UTILIZATION TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.MON_LOCKWAITS TO user dpmmon"

Db2 "grant sqladm on database to user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_FORMAT_LOCK_NAME TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_SERVICE_SUBCLASS TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.SNAPDB TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.SNAPDB_MEMORY_POOL TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.MON_LOCKWAITS TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.SNAPDBM TO user dpmmon"

Db2 "GRANT SELECT ON TABLE SYSIBMADM.ENV_INST_INFO TO user dpmmon"

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.SNAP_GET_HADR TO user dpmmon"-need to be configured on the configuration hadr

Db2 "GRANT EXECUTE ON FUNCTION SYSPROC.MON_GET_SYSTEM_RESOURCES TO user dpmmon"-error reported, negligible

Su-dpmmon

If [- f / home/db2inst1/sqllib/db2profile]; then

. / home/db2inst1/sqllib/db2profile

Fi

Db2 connect to sample

/ home/db2inst1/sqllib/misc

Db2-tvf EXPLAIN.DDL

[dpmmon@db2v11 misc] $db2 list tables

Table/View Schema Type Creation time

ADVISE_INDEX DPMMON T 2018-12-30-18.01.12.076928

ADVISE_INSTANCE DPMMON T 2018-12-30-18.01.11.780594

ADVISE_MQT DPMMON T 2018-12-30-18.01.12.737807

ADVISE_PARTITION DPMMON T 2018-12-30-18.01.13.200973

ADVISE_TABLE DPMMON T 2018-12-30-18.01.13.707483

ADVISE_WORKLOAD DPMMON T 2018-12-30-18.01.12.454300

EXPLAIN_ACTUALS DPMMON T 2018-12-30-18.01.16.561204

EXPLAIN_ARGUMENT DPMMON T 2018-12-30-18.01.08.940831

EXPLAIN_DIAGNOSTIC DPMMON T 2018-12-30-18.01.10.379307

EXPLAIN_DIAGNOSTIC_DATA DPMMON T 2018-12-30-18.01.10.858547

EXPLAIN_INSTANCE DPMMON T 2018-12-30-18.01.07.627235

EXPLAIN_OBJECT DPMMON T 2018-12-30-18.01.09.203827

EXPLAIN_OPERATOR DPMMON T 2018-12-30-18.01.09.322018

EXPLAIN_PREDICATE DPMMON T 2018-12-30-18.01.09.593889

EXPLAIN_STATEMENT DPMMON T 2018-12-30-18.01.08.443878

EXPLAIN_STREAM DPMMON T 2018-12-30-18.01.09.938834

OBJECT_METRICS DPMMON T 2018-12-30-18.01.11.477921

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report