SlideShare a Scribd company logo
6
Most read
14
Most read
15
Most read
DB2 for Linux, Unix, and
Windows
- Ravi
What is a Database Manager?
AGENDA!
Installation pre-requisites
CREATE/DROP
START/STOP
DBM Configuration
db2set command
db2 CLP history
Q&A
Logical database manager environment where we catalog databases and set configuration
parameters
Definition: DBM/Instance
Instance = Database(s) + Processes/Threads
IBM DB2 LUW UDB DBA Training by www.etraining.guru
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
Installation Pre-requisites (Linux!)
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
Only one instance can be created under a user name
db2icrt - Create Instance
Syntax:
Location: DB2DIR/instance directory.
Example: db2icrt -u db2fenc1 db2inst1
Removes a DB2 instance that was created by db2icrt.
db2idrop - Drop Instance
Syntax:
You can only drop instances that are listed by db2ilist command
Example: db2idrop db2inst1
Lists all the instances that are created using the db2icrt command
db2ilist - List Instances
Syntax:
$ db2ilist -h
$ db2ilist
db2inst1
db2inst2
Gets data from /var/db2/global.reg
db2greg -dump
Login as the DB2 instance owner
db2start - Start Instance
. $DB2_HOME/db2profile
db2start
Login as the DB2 instance owner
db2stop - Stop Instance
Make sure you have all applications disconnected (db2 list applications)
$ db2stop
$ db2stop force (= db2 force application all + db2stop)
$ db2_kill
$ 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
DBM CONFIGURATION
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 -lr
db2set
db2set registry_variable_name
db2set registry_variable_name=
db2set registry_variable_name=new_value
db2set registry_variable_name=new_value -i instance_name
db2set registry_variable_name=new_value -g
db2set registry_variable_name=new_value -i instance_name node_number
db2set -r registry_variable_name
db2set -r registry_variable_name node_number
Priority of DB2 Env/registry variables:
- OS environment set with set/export
- Node instance
- Instance
- Global
To read global profile: db2greg -dump
Detecting DB2 products installed: /usr/local/bin/db2ls *This internally checks global.reg file
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
Customizing DB2 CLP prompt:
db2set DB2_CLPPROMPT="(Instance: %i, Database: %d):"
Setting history limit:
db2set DB2_CLP_HISTSIZE=500
IBM DB2 LUW UDB DBA Training by www.etraining.guru

More Related Content

What's hot (20)

PDF
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
John Campbell
 
PDF
ALL ABOUT DB2 DSNZPARM
IBM
 
PPTX
DB2 Basic Commands - UDB
Srinimf-Slides
 
PDF
Best practices for DB2 for z/OS log based recovery
Florence Dubois
 
PPTX
Presentation db2 best practices for optimal performance
solarisyougood
 
PPT
MAINVIEW for DB2.ppt
Sreedhar Ambatipudi
 
PPSX
Solving the DB2 LUW Administration Dilemma
Randy Goering
 
TXT
Db2 hadr commands
vnanaji
 
PDF
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PgDay.Seoul
 
PDF
Db2 recovery IDUG EMEA 2013
Dale McInnis
 
PDF
PostgreSQL Deep Internal
EXEM
 
PDF
Presentation db2 connections to db2 for z os
xKinAnx
 
PDF
DB2 10 Universal Table Space - 2012-03-18 - no template
Willie Favero
 
PPTX
Z OS IBM Utilities
kapa rohit
 
PDF
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
 
PDF
DBA Basics guide
azoznasser1
 
PDF
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Cuneyt Goksu
 
PDF
PostgreSQL and RAM usage
Alexey Bashtanov
 
PDF
Ibm db2 interview questions and answers
Sweta Singh
 
PPT
Oracle backup and recovery
Yogiji Creations
 
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
John Campbell
 
ALL ABOUT DB2 DSNZPARM
IBM
 
DB2 Basic Commands - UDB
Srinimf-Slides
 
Best practices for DB2 for z/OS log based recovery
Florence Dubois
 
Presentation db2 best practices for optimal performance
solarisyougood
 
MAINVIEW for DB2.ppt
Sreedhar Ambatipudi
 
Solving the DB2 LUW Administration Dilemma
Randy Goering
 
Db2 hadr commands
vnanaji
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
PgDay.Seoul
 
Db2 recovery IDUG EMEA 2013
Dale McInnis
 
PostgreSQL Deep Internal
EXEM
 
Presentation db2 connections to db2 for z os
xKinAnx
 
DB2 10 Universal Table Space - 2012-03-18 - no template
Willie Favero
 
Z OS IBM Utilities
kapa rohit
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
 
DBA Basics guide
azoznasser1
 
Practical Recipes for Daily DBA Activities using DB2 9 and 10 for z/OS
Cuneyt Goksu
 
PostgreSQL and RAM usage
Alexey Bashtanov
 
Ibm db2 interview questions and answers
Sweta Singh
 
Oracle backup and recovery
Yogiji Creations
 

Similar to IBM DB2 LUW UDB DBA Training by www.etraining.guru (20)

PDF
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...
bupbechanhgmail
 
PDF
Quick beginning for db2 server
The Vision and Insight Corner
 
PPTX
S3 l3 db2 environment - instances
Mohammad Khan
 
PDF
Ibm db2 10.5 for linux, unix, and windows getting started with database app...
bupbechanhgmail
 
PDF
Tuning DB2 in a Solaris Environment
Jignesh Shah
 
PDF
Ibm db2 10.5 for linux, unix, and windows db2 connect installing and config...
bupbechanhgmail
 
DOCX
Db2 v9 dba for linux taining in bangalore
Suvash Chowdary
 
PDF
Db2exc guide 952_mac_x86_64
The Vision and Insight Corner
 
PPT
xTech2006_DB2onRails
webuploader
 
PDF
DB2 Upgrade instructions
The Vision and Insight Corner
 
PDF
Ibm db2 10.5 for linux, unix, and windows installing ibm data server clients
bupbechanhgmail
 
PDF
Ibm db2 10.5 for linux, unix, and windows db2 connect installing and config...
bupbechanhgmail
 
PPT
1) planning
guptavikki99
 
PDF
db2_tutorial.pdf
JrNtr8
 
PDF
2022-Scripting_Hacks.pdf
Roland Schock
 
PDF
Episode 2 Installation Triton Slides
Laura Hood
 
PDF
Ibm db2 10.5 for linux, unix, and windows db2 connect user's guide
bupbechanhgmail
 
DOC
VendorReview_IBMDB2
Aakash Parwani
 
PPTX
Database software
Aminul Islam
 
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...
bupbechanhgmail
 
Quick beginning for db2 server
The Vision and Insight Corner
 
S3 l3 db2 environment - instances
Mohammad Khan
 
Ibm db2 10.5 for linux, unix, and windows getting started with database app...
bupbechanhgmail
 
Tuning DB2 in a Solaris Environment
Jignesh Shah
 
Ibm db2 10.5 for linux, unix, and windows db2 connect installing and config...
bupbechanhgmail
 
Db2 v9 dba for linux taining in bangalore
Suvash Chowdary
 
Db2exc guide 952_mac_x86_64
The Vision and Insight Corner
 
xTech2006_DB2onRails
webuploader
 
DB2 Upgrade instructions
The Vision and Insight Corner
 
Ibm db2 10.5 for linux, unix, and windows installing ibm data server clients
bupbechanhgmail
 
Ibm db2 10.5 for linux, unix, and windows db2 connect installing and config...
bupbechanhgmail
 
1) planning
guptavikki99
 
db2_tutorial.pdf
JrNtr8
 
2022-Scripting_Hacks.pdf
Roland Schock
 
Episode 2 Installation Triton Slides
Laura Hood
 
Ibm db2 10.5 for linux, unix, and windows db2 connect user's guide
bupbechanhgmail
 
VendorReview_IBMDB2
Aakash Parwani
 
Database software
Aminul Islam
 
Ad

More from Ravikumar Nandigam (12)

PPT
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Ravikumar Nandigam
 
PPT
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Ravikumar Nandigam
 
PPT
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 
PPT
2 db2 instance creation
Ravikumar Nandigam
 
PPT
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Ravikumar Nandigam
 
DOC
IBM DB2 LUW UDB DBA Training by www.etraining.guru
Ravikumar Nandigam
 
DOC
online training for IBM DB2 LUW UDB DBA
Ravikumar Nandigam
 
DOC
Course content (netezza dba)
Ravikumar Nandigam
 
DOC
IBM DB2 LUW UDB DBA Online Training by Etraining Guru In Hyderabad
Ravikumar Nandigam
 
DOC
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
Ravikumar Nandigam
 
PPT
data loading and unloading in IBM Netezza by www.etraining.guru
Ravikumar Nandigam
 
PPT
Netezza Online Training by www.etraining.guru in India
Ravikumar Nandigam
 
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Ravikumar Nandigam
 
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Ravikumar Nandigam
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 
2 db2 instance creation
Ravikumar Nandigam
 
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Ravikumar Nandigam
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
Ravikumar Nandigam
 
online training for IBM DB2 LUW UDB DBA
Ravikumar Nandigam
 
Course content (netezza dba)
Ravikumar Nandigam
 
IBM DB2 LUW UDB DBA Online Training by Etraining Guru In Hyderabad
Ravikumar Nandigam
 
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
Ravikumar Nandigam
 
data loading and unloading in IBM Netezza by www.etraining.guru
Ravikumar Nandigam
 
Netezza Online Training by www.etraining.guru in India
Ravikumar Nandigam
 
Ad

Recently uploaded (20)

PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
epi editorial commitee meeting presentation
MIPLM
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Introduction to Indian Writing in English
Trushali Dodiya
 
infertility, types,causes, impact, and management
Ritu480198
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 

IBM DB2 LUW UDB DBA Training by www.etraining.guru

  • 1. DB2 for Linux, Unix, and Windows - Ravi
  • 2. What is a Database Manager? AGENDA! Installation pre-requisites CREATE/DROP START/STOP DBM Configuration db2set command db2 CLP history Q&A
  • 3. Logical database manager environment where we catalog databases and set configuration parameters Definition: DBM/Instance
  • 4. Instance = Database(s) + Processes/Threads
  • 6. 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 Installation Pre-requisites (Linux!) Disk space requirements: 500 to 1GB Memory requirements: Minimum of 512 MB of RAM Root (vs) Non-root installation Users/Groups
  • 7. Root (vs) Non-Root Installations
  • 9. Only one instance can be created under a user name db2icrt - Create Instance Syntax: Location: DB2DIR/instance directory.
  • 10. Example: db2icrt -u db2fenc1 db2inst1
  • 11. Removes a DB2 instance that was created by db2icrt. db2idrop - Drop Instance Syntax: You can only drop instances that are listed by db2ilist command Example: db2idrop db2inst1
  • 12. Lists all the instances that are created using the db2icrt command db2ilist - List Instances Syntax: $ db2ilist -h $ db2ilist db2inst1 db2inst2 Gets data from /var/db2/global.reg db2greg -dump
  • 13. Login as the DB2 instance owner db2start - Start Instance . $DB2_HOME/db2profile db2start
  • 14. Login as the DB2 instance owner db2stop - Stop Instance Make sure you have all applications disconnected (db2 list applications) $ db2stop $ db2stop force (= db2 force application all + db2stop) $ db2_kill
  • 15. $ 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 DBM CONFIGURATION
  • 17. 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 -lr db2set db2set registry_variable_name db2set registry_variable_name= db2set registry_variable_name=new_value db2set registry_variable_name=new_value -i instance_name db2set registry_variable_name=new_value -g db2set registry_variable_name=new_value -i instance_name node_number db2set -r registry_variable_name db2set -r registry_variable_name node_number
  • 18. Priority of DB2 Env/registry variables: - OS environment set with set/export - Node instance - Instance - Global To read global profile: db2greg -dump Detecting DB2 products installed: /usr/local/bin/db2ls *This internally checks global.reg file 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
  • 19. Customizing DB2 CLP prompt: db2set DB2_CLPPROMPT="(Instance: %i, Database: %d):" Setting history limit: db2set DB2_CLP_HISTSIZE=500

Editor's Notes

  • #2: http://www.ibm.com/developerworks/data/library/techarticle/dm-0509poon/
  • #5: Instance = Database(s) + Processes/Threads
  • #6: Instance view: A bit more detailed!
  • #7: Pre-requisites as of DB2 9.7!
  • #8: Instance IDs should not be root or have password expired.
  • #10: DB2DIR: DB2 installed location. You can find this using db2ls command http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/c0050566.html The instance directory stores all information that pertains to a database instance. You cannot change the location of the instance directory once it is created. The directory contains: The database manager configuration file (db2systm) The system database directory The node directory The node configuration file (db2nodes.cfg) Any other files that contain debugging information, such as the exception or register dump or the call stack for the DB2 database processes. The installation process creates a default DB2 instance, which is defined by the DB2INSTANCE environment variable. However, instances can be created/dropped after installation.
  • #14: Auto starting Instances: db2iauto -on instance_name On LUW, an instance created by using db2icrt is set as a manual start.
  • #15: ps -ef | grep ^db2inst1 | egrep -v "bash|sshd|grep"
  • #16: ps -ef | grep ^db2inst1 | egrep -v "bash|sshd|grep“ reset dbm cfg: Resets the DBM configuration file to its default values Location of DBM CFG file: ./sqllib/db2systm Link: https://www.columbia.edu/sec/acis/db2/db2d0/db2d0160.htm
  • #18: Instance node level profile registry: For partitioned databases **** To display help information for the command, use: db2set ? To list the complete set of all supported registry variables, use: db2set -lr To list all currently defined registry variables for this session, use: db2set To show the current session value of a registry variable, use: db2set registry_variable_name To delete the current session value of a registry variable, use: db2set registry_variable_name= To change a registry variable for this session only, use: db2set registry_variable_name=new_value To change a registry variable default for all databases in the instance, use: db2set registry_variable_name=new_value -I instance_name To change a registry variable default for all instances in the system, use: db2set registry_variable_name=new_value -g Note:The two parameters "-I" and "-G" cannot be used at the same time in the same command. To change a registry variable default for a particular node in an instance, use: db2set registry_variable_name=new_value -i instance_name node_number To reset all registry variables for an instance back to the defaults found in the Global Profile Registry, use: db2set -r registry_variable_name To reset all registry variables for a node in an instance back to the defaults found in the Global Profile Registry, use: db2set -r registry_variable_name node_number ***
  • #19: Instance node level profile registry: For partitioned databases **** To display help information for the command, use: db2set ? To list the complete set of all supported registry variables, use: db2set -lr To list all currently defined registry variables for this session, use: db2set To show the current session value of a registry variable, use: db2set registry_variable_name To delete the current session value of a registry variable, use: db2set registry_variable_name= To change a registry variable for this session only, use: db2set registry_variable_name=new_value To change a registry variable default for all databases in the instance, use: db2set registry_variable_name=new_value -I instance_name To change a registry variable default for all instances in the system, use: db2set registry_variable_name=new_value -g Note:The two parameters "-I" and "-G" cannot be used at the same time in the same command. To change a registry variable default for a particular node in an instance, use: db2set registry_variable_name=new_value -i instance_name node_number To reset all registry variables for an instance back to the defaults found in the Global Profile Registry, use: db2set -r registry_variable_name To reset all registry variables for a node in an instance back to the defaults found in the Global Profile Registry, use: db2set -r registry_variable_name node_number ***
  • #20: %ia: If instance attachment exists, the authid of the current instance attachment; otherwise a null string %i: Local alias of instance %da: If database connection exists, the authid. Else, null string %d: Database aliase %n: New line character