21
Sat, Dec
3 New Articles

Configuring the DB2 System Environment

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Master all aspects of IBM DB2 database administration and prepare to take and pass IBM's Certification Exams 611 and 311: Certified Database Administrator.

 

Editor's note: This article is an excerpt from the new book DB2 10.1/10.5 for Linux, UNIX, and Windows Database Administration (Exams 611 and 311): Certification Study Guide.

 

During normal operation, the DB2 database manager's behavior is controlled, in part, by a collection of values that defines the DB2 operating environment. Some of these values are operating system environment variables, and others are special DB2-specific system-level values known as environment or registry variables. Registry variables provide a way to centrally control the database environment. Four different registry profiles are available, and each controls the database environment at a different level. The registry profiles are as follows:

 

  • The DB2 global-level profile registry—All machine-wide environment variable settings reside in this registry; one global-level profile registry exists on each DB2 workstation. To set an environment variable for all instances, use this profile registry.
  • The DB2 instance-level profile registry—The environment variable settings for a particular instance are kept in this registry; this is where you set the majority of the DB2 environment variables. The values defined in this profile registry override any corresponding settings in the global-level profile registry.
  • The DB2 instance node-level profile registry—This profile registry level contains variable settings that are specific to a partition (node) in a multi-partitioned database environment. The values defined in this profile registry override any corresponding settings in the global-level and instance-level profile registries.
  • The DB2 user-level profile registry—This profile registry level contains variable settings that are specific to each user and takes higher precedence over other registry settings.

 

Table 2.3 shows the order in which DB2 resolves the registry settings and the environment variables when configuring the system.

 

Table 2.3: DB2 Registry location and precedence

Profile Registry

Precedence

Location on Windows platform

Location on Linux and UNIX platform

Authorization required on Windows platform

Authorization required on Linux and UNIX platform

Environment

1

Not applicable

For Bourne or korn

Not applicable

-rwxr-xr-x on

variables

 

 

shell: instance_

 

db2profile or

 

 

 

home/sqllib/

 

db2cshrc files,

 

 

 

db2profile

 

and part of the

 

 

 

For C shell:

 

SYSADM group

 

 

 

instance_home/

 

 

 

 

 

sqllib/db2cshrc

 

 

User level

2

Lightweight

Not applicable

Member of DB2

Not applicable

 

 

Directory Access

 

administrators

 

 

 

Protocol (LDAP)

 

group

 

 

 

directory

 

(DB2ADMNS)

 

Instance

3

\HKEY_LOCAL_

$INSTHOME/

Member of DB2

drwxrwxr-x on the

node level

 

MACHINE\

sqllib/nodes

administrators

nodes directory

 

 

SOFTWARE\IBM\

File Name:

group

and -rw-rw-r—

 

 

DB2\PROFILES\

<nodenumber>.

(DB2ADMNS)

on the env file,

 

 

instance_name\

env

 

and part of the

 

 

NODES\

 

 

SYSADM group

 

 

node_number

 

 

 

Instance

4

\HKEY_LOCAL_

$INSTHOME/

Member of DB2

-rw-rw-r—on the

level

 

MACHINE\

sqllib/profile.env

administrators

file profile.env,

 

 

SOFTWARE\IBM\

 

group

and part of the

 

 

DB2\PROFILES\

 

(DB2ADMNS)

SYSADM group

 

 

instance_name

 

 

 

Global level

5

\HKEY_LOCAL_ MACHINE\ SOFTWARE\IBM\ DB2\GLOBAL_ PROFILE

For root installations: /var/ db2/global.reg For nonroot installations: home_directory/ sqllib/global.reg

Member of DB2 administrators group (DB2ADMNS)

For root installation, root authority is required; for nonroot

installation, the user who installed the product can modify the global setting

 

You can use the db2greg command to view and alter the global registry settings, which then modifies the file /var/db2/global.reg in root installations and $HOME/sqllib/global.reg in nonroot installations.

 

The command output in a root installation looks like this:

 

db2greg -dump

V,DB2GPRF,DB2SYSTEM,gb01qa,/opt/ibm/db2/V10.1,

S,TSA,3.2.2.5,/opt/IBM/tsamp,-,-,0,0,-,1389969042,0 S,DB2,10.1.0.3,/opt/ibm/db2/V10.1,,,3,0,,1389969093,0

I,DB2,10.1.0.3,db2inst1,/home/db2inst1/sqllib,,1,0,/opt/ibm/db2/V10.1,, V,DB2GPRF,DB2INSTDEF,db2inst1,/opt/ibm/db2/V10.1,

 

The global registry consists of three record types:

 

  • Service (S)—This records product-level information, such as version and install path.
  • Instance (I)—This records instance-level information, such as instance name, instance path, DB2 version, and the start-at-boot flag.
  • Variables (V)—This records variables and the value settings.

 

You can edit the global registry setting by using the db2greg command; editing in root installation needs a root privilege.

 

A wide variety of registry variables are available, and they vary depending on the operating system being used. Chapter 22 of the Database Administration Concepts and Configuration Reference manual contains a complete listing.

 

So how do you determine which registry variables have been set and what they have been set to? Or more important, how do you assign values to one or more registry variables? One way is by executing the db2set system command. The syntax for this command is:

 

db2set [variable=[value]]

[-g|-i instance [member-number]]

[-all]

[-null]

[-r [instance] [member-number]]

[-im|-immediate]

[-info]

[-n DAS Node [-u user [-p password]]]

[-l|-lr]

[-v]

[-ul|-ur]

[-?|-h]

 

 

where:

 

Variable--Identifies the registry variable whose value is to be displayed, set, or removed

Value--Identifies the value to assign to the specified registry variable; if no value is provided but a registry variable is specified, the specified registry variable is deleted

Instance--Identifies the instance profile with which to associate the specified registry variable

Member-number--Identifies the node number of the instance in cases regarding the use of a DPF database

DAS Node--Identifies the name of the node where the DAS instance resides (this is deprecated in DB2 9.7 and is no longer required to be created)

User--Identifies the authentication ID to use to attach to the DAS instance

Passwords--Identifies the password (for the authentication ID) to use to attach to the DB2 Administration Server instance

 

Table 2.4 describes all other options with this command.

 

Table 2.4: The db2set command options (continued)

Option

Meaning

-g

Indicates that a global profile variable is to be displayed, set, or removed

-gl

Indicates that a global profile variable stored in LDAP is to be displayed, set, or removed; this

 

option is effective only if the registry variable DB2_ENABLE_LDAP has been set to YES

-i

Indicates that an instance profile variable is to be displayed, set, or removed

-all

Indicates that all occurrences of the registry variable, as defined in the following, are to be

displayed:

  • The environment (denoted by [-e])
  • The node-level registry (denoted by [-n])

z The instance-level registry (denoted by [-i])

z The global-level registry (denoted by [-g])

-null

Indicates that the value of the variable at the specified registry level is to be set to NULL

-r

Indicates that the profile registry for the given instance is to be reset

-n

Indicates that a remote DAS instance node name is specified

-u

Indicates that an authentication ID that will attach to the DAS instance is specified

-p

Indicates that a password for the specified authentication ID is provided

-l

Indicates that all instance profiles will be listed

-lr

Indicates that all registry variables supported will be listed

-v

Indicates that the db2set command is to be executed in verbose mode

-ul

Accesses the user profile variables (this parameter is supported only on Windows operating

 

systems)

-ur

Refreshes the user profile variables (this parameter is supported only on Windows operating

 

systems)

-h | -?

Displays help information; when this option is specified, all other options are ignored, and only the

 

help information is displayed

 

 

It is important to note that if you execute the db2set command without options, a list containing every registry variable that has been set for the current (default) instance, along with its value, will be returned.

 

Thus, if you want to determine which registry variables have been set for each profile, execute the db2set command:

 

db2set -all

 

And the resulting output might look something like this:

 

[i] DB2FCMCOMM=TCPIP4

[i] DB2_SKIPINSERTED=ON

[i] DB2_OBJECT_TABLE_ENTRIES=10000

[i] DB2_USE_ALTERNATE_PAGE_CLEANING=ON

[i] DB2_LOAD_COPY_NO_OVERRIDE=nonrecoverable

[i] DB2_INLIST_TO_NLJN=YES

[i] DB2_REDUCED_OPTIMIZATION=ON

[i] DB2_EVALUNCOMMITTED=ON

[i] DB2_EXTENDED_OPTIMIZATION=Y

[i] DB2_ANTIJOIN=Y

[i] DB2TCPCONNMGRS=16

[i] DB2_SKIPDELETED=ON

[i] DB2DBDFT=SAMPLE

[i] DB2COMM=TCPIP

[i] DB2_PARALLEL_IO=*:5

[i] DB2AUTOSTART=YES

[g] DB2SYSTEM=prodbcuapp001

 

Alternatively, to see the current value of the DB2COMM registry variable for all DB2 instances, execute a db2set command that looks something like this: 

db2set -l DB2COMM

 

And finally, if you want to assign a value to the DB2COMM registry variable for all DB2 instances on a server, you can do so by executing a db2set command that looks something like this:

 

db2set -g DB2COMM=[Protocol, ...]

 

where:

 

Protocol Identifies one or more communications protocols to start when the DB2 database manager for the instance is started; any combination of the following values is valid: NPIPE, TCPIP, and SSL

 

Thus, to set the DB2COMM instance-level registry variable such that the DB2 database manager will start the TCP/IP communication manager each time any instance is started, execute a db2set command that looks like this:

 

/home/db2inst1/sqllib/adm/db2set -g DB2COMM=TCPIP

 

 You can unset the value assigned to any registry variable by providing just the variable name and the equal sign as input to the db2set command. Thus, if you want to disable the DB2COMM instance-level registry variable for an instance named db2inst1, you can do so by executing a db2set command that looks like this:

 

db2set -i DB2INST1 DB2COMM=

 

A Word About Aggregate Registry Variables

An aggregate registry variable is a group of several registry variables as a configuration that is identified by one registry variable name. Each registry variable that is part of the group has a predefined setting. The purpose of an aggregate registry variable is to ease registry configuration for broad operational objectives.

 

In DB2 10.1, the only valid aggregated registry variable is DB2_WORKLOAD, and the valid values for this variable are:

 

Value                        Description

                           1C                           1C application-specific workload setting

CM                          Content Manager–specific workload setting

COGNOS_CS        Cognos® Content Server–specific workload setting FILENET_CM         FileNet® Content Manager–specific workload setting INFOR_ERP_LN    Infor ERP Baan–specific workload setting

                           MAXIMO                 Maximo®-specific workload setting

                           MDM                       Master Data Management–specific workload setting

                          SAP                        SAP application–specific workload setting

                          TPM                        Tivoli® Provisioning Manager–specific workload setting

                          WAS                        WebSphere® Application Server–specific workload setting

                          WC                          WebSphere Commerce–specific workload setting

                          WP                          WebSphere Portal–specific workload setting

 

You can use an aggregate registry variable to explicitly define any registry variable that is implicitly configured, which in a way overrides the aggregated registry variable implicit value.

 

If you attempt to modify an explicitly set registry variable by using an aggregate registry variable, a warning is issued and the explicitly set value is kept. This warning tells you that the explicit value is maintained and will override the implicit value. For example, setting DB2_ REDUCED_OPTIMIZATION to YES and then setting the DB2_WORKLOAD to SAP will generate a warning message something like the following:

 

 

db2set DB2_REDUCED_OPTIMIZATION=YES

db2set DB2_WORKLOAD=SAP

DBI1319W The variable "DB2_REDUCED_OPTIMIZATION" has been explicitly set and

will not be affected by the configuration of the aggregate variable "DB2_

WORKLOAD".

 

If the aggregate registry variable is used first, and then you specify an explicit registry variable, no warning is given. To identify the override settings, use the db2set –all command and check for [O] displayed next to its value, as follows:

 

[i] DB2_INLIST_TO_NLJN=YES [O]

[i] DB2_REDUCED_OPTIMIZATION=YES [O]

[i] DB2COMM=TCPIP [O]

 

And wherever the DB2_WORKLOAD setting value is active, you will see [DB2_WORKLOAD] appear next to its value something like this:

 

[i] DB2_ROWCOMPMODE_DEFAULT=STATIC [DB2_WORKLOAD]

[i] DB2_INDEX_PCTFREE_DEFAULT=0 [DB2_WORKLOAD]

[i] DB2_SKIP_VIEWRECREATE_SAP=TRUE [DB2_WORKLOAD]

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: