SlideShare uma empresa Scribd logo
1 de 20
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
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
2 db2 instance creation

Mais conteúdo relacionado

Mais procurados

Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
锐 张
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
MongoDB
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1
sdiviney
 
DSpace Installation
DSpace InstallationDSpace Installation
DSpace Installation
Nur Ahammad
 
Subversion: A Getting Started Presentation
Subversion: A Getting Started PresentationSubversion: A Getting Started Presentation
Subversion: A Getting Started Presentation
Nap Ramirez
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 

Mais procurados (20)

Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
 
Drush
DrushDrush
Drush
 
Strategies for Backing Up MongoDB
Strategies for Backing Up MongoDBStrategies for Backing Up MongoDB
Strategies for Backing Up MongoDB
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1
 
DSpace Installation
DSpace InstallationDSpace Installation
DSpace Installation
 
Subversion: A Getting Started Presentation
Subversion: A Getting Started PresentationSubversion: A Getting Started Presentation
Subversion: A Getting Started Presentation
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
REDIS intro and how to use redis
REDIS intro and how to use redisREDIS intro and how to use redis
REDIS intro and how to use redis
 
Advanced Replication
Advanced ReplicationAdvanced Replication
Advanced Replication
 
Day 2-some fun coding
Day 2-some fun codingDay 2-some fun coding
Day 2-some fun coding
 
Archlinux install
Archlinux installArchlinux install
Archlinux install
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
DNS Server Configuration
DNS Server ConfigurationDNS Server Configuration
DNS Server Configuration
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Logical volume manager xfs
Logical volume manager xfsLogical volume manager xfs
Logical volume manager xfs
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Data analysis on hadoop
Data analysis on hadoopData analysis on hadoop
Data analysis on hadoop
 
Tablespaces
TablespacesTablespaces
Tablespaces
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 

Semelhante a 2 db2 instance creation

NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.pptNEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
MuraleedharanTV2
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70
UGIF
 

Semelhante a 2 db2 instance creation (20)

DB2UDB_the_Basics
DB2UDB_the_BasicsDB2UDB_the_Basics
DB2UDB_the_Basics
 
Episode 2 DB2 pureScale Installation, Instance Management & Monitoring
Episode 2 DB2 pureScale Installation, Instance Management & MonitoringEpisode 2 DB2 pureScale Installation, Instance Management & Monitoring
Episode 2 DB2 pureScale Installation, Instance Management & Monitoring
 
Herd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration managementHerd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration management
 
A DBA’s guide to using TSA
A DBA’s guide to using TSAA DBA’s guide to using TSA
A DBA’s guide to using TSA
 
S3 l3 db2 environment - instances
S3 l3   db2 environment - instancesS3 l3   db2 environment - instances
S3 l3 db2 environment - instances
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
DBA Basics guide
DBA Basics guideDBA Basics guide
DBA Basics guide
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
 
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...Analyze corefile and backtraces with GDB for Mysql/MariaDB on Linux - Nilanda...
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
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.pptNEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
 
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
 
FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...
FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...
FOSDEM'17: Disaster Recovery Management with ReaR (relax-and-recover) & DRLM ...
 
Windows Server 2008 (Active Directory Yenilikleri)
Windows Server 2008 (Active Directory Yenilikleri)Windows Server 2008 (Active Directory Yenilikleri)
Windows Server 2008 (Active Directory Yenilikleri)
 
Mongodb workshop
Mongodb workshopMongodb workshop
Mongodb workshop
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
MariaDB training
MariaDB trainingMariaDB training
MariaDB training
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70
 

Mais de Ravikumar Nandigam

Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 

Mais de Ravikumar Nandigam (14)

Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Online Training in IBM DB2 LUW/UDB DBA in HyderabadOnline Training in IBM DB2 LUW/UDB DBA in Hyderabad
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
 
Online Training in IBM DB2 LUW/UDB DBA in Hyderabad
Online Training in IBM DB2 LUW/UDB DBA in HyderabadOnline 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
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 
2 db2 instance creation
2 db2 instance creation2 db2 instance creation
2 db2 instance creation
 
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Managing user Online Training in IBM Netezza DBA Development by www.etraining...Managing user Online Training in IBM Netezza DBA Development by www.etraining...
Managing user Online Training in IBM Netezza DBA Development by www.etraining...
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guru
 
online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBA
 
Course content (netezza dba)
Course content (netezza dba)Course content (netezza dba)
Course content (netezza dba)
 
IBM DB2 LUW UDB DBA Online Training by Etraining Guru In Hyderabad
IBM DB2 LUW UDB DBA Online Training by Etraining Guru In HyderabadIBM DB2 LUW UDB DBA Online Training by Etraining Guru In Hyderabad
IBM DB2 LUW UDB DBA Online Training by Etraining Guru In Hyderabad
 
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guruIBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
 
IBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guruIBM DB2 LUW UDB DBA Training by www.etraining.guru
IBM DB2 LUW UDB DBA Training by www.etraining.guru
 
data loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.gurudata loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.guru
 
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guruIBM DB2 LUW UDB DBA Online Training by Etraining.guru
IBM DB2 LUW UDB DBA Online Training by Etraining.guru
 
Netezza Online Training by www.etraining.guru in India
Netezza Online Training by www.etraining.guru in IndiaNetezza Online Training by www.etraining.guru in India
Netezza Online Training by www.etraining.guru in India
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Último (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

2 db2 instance creation

  • 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
  • 5.
  • 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

Notas do Editor

  1. http://www.ibm.com/developerworks/data/library/techarticle/dm-0509poon/
  2. Instance = Database(s) + Processes/Threads
  3. Instance view: A bit more detailed!
  4. Pre-requisites as of DB2 9.7!
  5. Instance IDs should not be root or have password expired.
  6. 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.
  7. Auto starting Instances: db2iauto -on instance_name On LUW, an instance created by using db2icrt is set as a manual start.
  8. ps -ef | grep ^db2inst1 | egrep -v "bash|sshd|grep"
  9. 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
  10. 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 ***
  11. 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 ***
  12. %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