0% found this document useful (0 votes)
254 views

DB2 For Linux and Windows

The document discusses installation prerequisites, configuration, and management of DB2 database instances on Linux, including how to create and drop instances using db2icrt and db2idrop, start and stop instances with db2start and db2stop, configure the database manager and instances using db2set, and view instances and configuration details using db2ilist and db2 get dbm cfg.

Uploaded by

fptnam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
254 views

DB2 For Linux and Windows

The document discusses installation prerequisites, configuration, and management of DB2 database instances on Linux, including how to create and drop instances using db2icrt and db2idrop, start and stop instances with db2start and db2stop, configure the database manager and instances using db2set, and view instances and configuration details using db2ilist and db2 get dbm cfg.

Uploaded by

fptnam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

DB2 for Linux, Unix, and

Windows
- Ravi

AGENDA!
What is a Database Manager?
Installation pre-requisites
CREATE/DROP
START/STOP
DBM Configuration
db2set command
db2 CLP history
Q&A

Definition: DBM/Instance
Logical database manager environment where we catalog databases and set configuration
parameters

Instance = Database(s) + Processes/Threads

Installation Pre-requisites (Linux!)


Operating system:
- Red Hat Enterprise Linux (RHEL) 5 Update 2.0.4
- SUSE Linux Enterprise Server (SLES) 10 Service Pack 2
- SUSE Linux Enterprise Server (SLES) 11
- Ubuntu 8.0.4.1

Disk space requirements: 500 to 1GB


Memory requirements: Minimum of 512 MB of RAM
Root (vs) Non-root installation
Users/Groups

Root (vs) Non-Root Installations

USERS/GROUPS

db2icrt - Create Instance


Only one instance can be created under a user name
Location: DB2DIR/instance directory.
Syntax:

Example: db2icrt -u db2fenc1 db2inst1

db2idrop - Drop Instance


Removes a DB2 instance that was created by db2icrt.
You can only drop instances that are listed by db2ilist command
Syntax:

Example: db2idrop db2inst1

db2ilist - List Instances


Lists all the instances that are created using the db2icrt command
Syntax:
$ db2ilist -h
$ db2ilist
db2inst1
db2inst2

Gets data from /var/db2/global.reg


db2greg -dump

db2start - Start Instance


Login as the DB2 instance owner
. $DB2_HOME/db2profile
db2start

db2stop - Stop Instance


Login as the DB2 instance owner
Make sure you have all applications disconnected (db2 list applications)
$ db2stop
$ db2stop force (= db2 force application all + db2stop)
$ db2_kill

DBM CONFIGURATION
$ db2 get instance
$ db2 ? get dbm cfg
GET DATABASE MANAGER CONFIGURATION [SHOW DETAIL]
$ db2 get dbm cfg
$ db2 get dbm cfg | grep NUMDB
$ db2 update dbm cfg using NUMDB 10
$ db2 attach to db2inst1
$ db2 get dbm cfg show detail
$ db2 reset dbm cfg

DB2SET

IBM DB2 profile registry command


Allows for centralized control of environmental variables
4 Profile registries:
- Instance level profile registry [i] (~/sqllib/profile.env)
- Global level profile registry [g] (/var/db2/global.reg)
- Instance node level profile registry [n] (~/sqllib/nodes/node_number.env)
- Instance profile registry (/var/db2/global.reg)
db2set
db2set
db2set
db2set
db2set
db2set
db2set
db2set
db2set
db2set
db2set

?
-lr
registry_variable_name
registry_variable_name=
registry_variable_name=new_value
registry_variable_name=new_value -i instance_name
registry_variable_name=new_value -g
registry_variable_name=new_value -i instance_name node_number
-r registry_variable_name
-r registry_variable_name node_number

Priority of DB2 Env/registry variables:


- OS environment set with set/export
- Node instance
- Instance
- Global
SYSIBMADM.REG_VARIABLES admin view:
select substr(REG_VAR_NAME,1,35) NAME, substr(REG_VAR_VALUE,1,35) VALUE,
LEVEL from SYSIBMADM.REG_VARIABLES
REG_LIST_VARIABLES Table function:
SELECT CHAR(REG_VAR_NAME,35) AS REGVAR, CHAR(REG_VAR_VALUE,35) AS
VALUE,LEVEL FROM TABLE(REG_LIST_VARIABLES()) AS REG ORDER BY 3,1
To read global profile: db2greg -dump
Detecting DB2 products installed: /usr/local/bin/db2ls

*This internally checks global.reg file

Customizing DB2 CLP prompt:


db2set DB2_CLPPROMPT="(Instance: %i, Database: %d):"
Setting history limit:
db2set DB2_CLP_HISTSIZE=500

You might also like