SlideShare a Scribd company logo
5
Most read
6
Most read
13
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

PPT
Db2
PPT
2 db2 instance creation
PPTX
Ibm db2
PPTX
DB2 Basic Commands - UDB
PPT
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
PPTX
SKILLWISE-DB2 DBA
PDF
IBM DB2 for z/OS Administration Basics
 
Db2
2 db2 instance creation
Ibm db2
DB2 Basic Commands - UDB
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
SKILLWISE-DB2 DBA
IBM DB2 for z/OS Administration Basics
 

What's hot (20)

PPTX
Basic sql Commands
DOC
DB2 utilities
DOCX
Db2 Important questions to read
PDF
DB2 TABLESPACES
PDF
DB2 for z/OS Architecture in Nutshell
PPTX
JCL UTILITIES IEBCOPY
PDF
DB2 LUW - Backup and Recovery
DOC
DB2 DOCUMENT
PDF
5 Steps to PostgreSQL Performance
DOC
Mainframe interview
PPTX
Mainframe JCL Part - 1
PDF
MVS ABEND CODES
PPTX
Z OS IBM Utilities
PPSX
Solving the DB2 LUW Administration Dilemma
PPT
Lenguaje SQL
DOCX
Index in sql server
PPT
Ms sql server architecture
PPTX
Sql server basics
PDF
DBA Basics guide
PDF
InnoDB Internal
Basic sql Commands
DB2 utilities
Db2 Important questions to read
DB2 TABLESPACES
DB2 for z/OS Architecture in Nutshell
JCL UTILITIES IEBCOPY
DB2 LUW - Backup and Recovery
DB2 DOCUMENT
5 Steps to PostgreSQL Performance
Mainframe interview
Mainframe JCL Part - 1
MVS ABEND CODES
Z OS IBM Utilities
Solving the DB2 LUW Administration Dilemma
Lenguaje SQL
Index in sql server
Ms sql server architecture
Sql server basics
DBA Basics guide
InnoDB Internal
Ad

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

PPT
DB2UDB_the_Basics
PDF
Episode 2 DB2 pureScale Installation, Instance Management & Monitoring
PPTX
Herd your chickens: Ansible for DB2 configuration management
PPTX
A DBA’s guide to using TSA
ODP
Asian Spirit 3 Day Dba On Ubl
PPTX
S3 l3 db2 environment - instances
PDF
Setup oracle golden gate 11g replication
PDF
MySQL for Oracle DBAs
DOC
Oracle data guard configuration in 12c
PDF
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
PDF
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
PPT
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
PPT
173955573244324324324424322adsadsaasd.ppt
PPTX
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
PDF
FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...
PPT
Windows Server 2008 (Active Directory Yenilikleri)
PDF
Mongodb workshop
DOC
Oracle applications 11i hot backup cloning with rapid clone
PDF
MariaDB training
PDF
Oracle applications 11i hot backup cloning with rapid clone
DB2UDB_the_Basics
Episode 2 DB2 pureScale Installation, Instance Management & Monitoring
Herd your chickens: Ansible for DB2 configuration management
A DBA’s guide to using TSA
Asian Spirit 3 Day Dba On Ubl
S3 l3 db2 environment - instances
Setup oracle golden gate 11g replication
MySQL for Oracle DBAs
Oracle data guard configuration in 12c
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
173955573244324324324424322adsadsaasd.ppt
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...
Windows Server 2008 (Active Directory Yenilikleri)
Mongodb workshop
Oracle applications 11i hot backup cloning with rapid clone
MariaDB training
Oracle applications 11i hot backup cloning with rapid clone
Ad

More from Ravikumar Nandigam (12)

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

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Complications of Minimal Access Surgery at WLH
PDF
Classroom Observation Tools for Teachers
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharma ospi slides which help in ospi learning
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Complications of Minimal Access Surgery at WLH
Classroom Observation Tools for Teachers
Supply Chain Operations Speaking Notes -ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharma ospi slides which help in ospi learning
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
TR - Agricultural Crops Production NC III.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
2.FourierTransform-ShortQuestionswithAnswers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Anesthesia in Laparoscopic Surgery in India
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf

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