Configuring the DB2 System Environment

  • 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


Location on Windows platform

Location on Linux and UNIX platform

Authorization required on Windows platform

Authorization required on Linux and UNIX platform



Not applicable

For Bourne or korn

Not applicable

-rwxr-xr-x on




shell: instance_


db2profile or






db2cshrc files,






and part of the




For C shell:


SYSADM group













User level



Not applicable

Member of DB2

Not applicable



Directory Access






Protocol (LDAP)














Member of DB2

drwxrwxr-x on the

node level





nodes directory




File Name:


and -rw-rw-r—






on the env file,






and part of the






SYSADM group











Member of DB2

-rw-rw-r—on the






file profile.env,






and part of the






SYSADM group







Global level



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


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

I,DB2,,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]]



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



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









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)




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


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


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


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


  • 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])


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


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


Indicates that a remote DAS instance node name is specified


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


Indicates that a password for the specified authentication ID is provided


Indicates that all instance profiles will be listed


Indicates that all registry variables supported will be listed


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


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




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



-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] DB2_LOAD_COPY_NO_OVERRIDE=nonrecoverable












[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, ...]




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:





DBI1319W The variable "DB2_REDUCED_OPTIMIZATION" has been explicitly set and

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



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:






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





Mohankumar Saraswatipura

Mohankumar (Mohan) Saraswatipura works as a database solutions architect at Kronsys, Inc., focusing on IBM DB2, Linux, UNIX, and Windows solutions. Prior to his current position, he worked as a database solutions architect at Reckitt Benckiser Group, plc (UK), focusing on IBM Smart Analytics System 5600, Siebel, SQL Server, and SAP HANA solutions. 

Mohan is an IBM Champion (2010–2015) and a DB2’s Got Talent 2013 winner. He has written dozens of technical papers for IBM developerWorks and IBM Data magazine. He is an IBM-Certified DB2 Advanced Database Administrator, DB2 Application Developer, and DB2 Problem Determination Master. Mohan holds a Master’s of Technology (M Tech) degree in computer science and an Executive MBA (IT).

MC Press books written by Mohankumar Saraswatipura available now on the MC Press Bookstore.

DB2 10.1/10.5 for Linux, UNIX, and Windows Database Administration (Exams 611 and 311) DB2 10.1/10.5 for Linux, UNIX, and Windows Database Administration (Exams 611 and 311)
Master DB2 database administration and prepare for IBM's Exams 611 and 311: Certified Database Administrator.
List Price $134.95

Now On Sale



Support MC Press Online





  • White Paper: Node.js for Enterprise IBM i Modernization

    SB Profound WP 5539

    If your business is thinking about modernizing your legacy IBM i (also known as AS/400 or iSeries) applications, you will want to read this white paper first!

    Download this paper and learn how Node.js can ensure that you:
    - Modernize on-time and budget - no more lengthy, costly, disruptive app rewrites!
    - Retain your IBM i systems of record
    - Find and hire new development talent
    - Integrate new Node.js applications with your existing RPG, Java, .Net, and PHP apps
    - Extend your IBM i capabilties to include Watson API, Cloud, and Internet of Things

    Read Node.js for Enterprise IBM i Modernization Now!


  • Profound Logic Solution Guide

    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 companyare not aligned with the current IT environment.

    Get your copy of this important guide today!


  • 2022 IBM i Marketplace Survey Results

    Fortra2022 marks the eighth edition of the IBM i Marketplace Survey Results. Each year, Fortra captures data on how businesses use the IBM i platform and the IT and cybersecurity initiatives it supports.

    Over the years, this survey has become a true industry benchmark, revealing to readers the trends that are shaping and driving the market and providing insight into what the future may bring for this technology.

  • Brunswick bowls a perfect 300 with LANSA!

    FortraBrunswick is the leader in bowling products, services, and industry expertise for the development and renovation of new and existing bowling centers and mixed-use recreation facilities across the entertainment industry. However, the lifeblood of Brunswick’s capital equipment business was running on a 15-year-old software application written in Visual Basic 6 (VB6) with a SQL Server back-end. The application was at the end of its life and needed to be replaced.
    With the help of Visual LANSA, they found an easy-to-use, long-term platform that enabled their team to collaborate, innovate, and integrate with existing systems and databases within a single platform.
    Read the case study to learn how they achieved success and increased the speed of development by 30% with Visual LANSA.


  • The Power of Coding in a Low-Code Solution

    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:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks



  • Why Migrate When You Can Modernize?

    LANSABusiness 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.
    In this white paper, you’ll learn how to think of these issues as opportunities rather than problems. We’ll explore motivations to migrate or modernize, their risks and considerations you should be aware of before embarking on a (migration or modernization) project.
    Lastly, we’ll discuss how modernizing IBM i applications with optimized business workflows, integration with other technologies and new mobile and web user interfaces will enable IT – and the business – to experience time-added value and much more.


  • UPDATED: Developer Kit: Making a Business Case for Modernization and Beyond

    Profound Logic Software, Inc.Having trouble getting management approval for modernization projects? The problem may be you're not speaking enough "business" to them.

    This Developer Kit provides you study-backed data and a ready-to-use business case template to help get your very next development project approved!

  • What to Do When Your AS/400 Talent Retires

    FortraIT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators is small.

    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:

    • Why IBM i skills depletion is a top concern
    • How leading organizations are coping
    • Where automation will make the biggest impact


  • Node.js on IBM i Webinar Series Pt. 2: Setting Up Your Development Tools

    Profound Logic Software, Inc.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. In Part 2, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Attend this webinar to learn:

    • Different tools to develop Node.js applications on IBM i
    • Debugging Node.js
    • The basics of Git and tools to help those new to it
    • Using as a pre-built development environment



  • Expert Tips for IBM i Security: Beyond the Basics

    SB PowerTech WC GenericIn this session, IBM i security expert Robin Tatam provides a quick recap of IBM i security basics and guides you through some advanced cybersecurity techniques that can help you take data protection to the next level. Robin will cover:

    • Reducing the risk posed by special authorities
    • Establishing object-level security
    • Overseeing user actions and data access

    Don't miss this chance to take your knowledge of IBM i security beyond the basics.



  • 5 IBM i Security Quick Wins

    SB PowerTech WC GenericIn today’s threat landscape, upper management is laser-focused on cybersecurity. You need to make progress in securing your systems—and make it fast.
    There’s no shortage of actions you could take, but what tactics will actually deliver the results you need? And how can you find a security strategy that fits your budget and time constraints?
    Join top IBM i security expert Robin Tatam as he outlines the five fastest and most impactful changes you can make to strengthen IBM i security this year.
    Your system didn’t become unsecure overnight and you won’t be able to turn it around overnight either. But quick wins are possible with IBM i security, and Robin Tatam will show you how to achieve them.

  • Security Bulletin: Malware Infection Discovered on IBM i Server!

    SB PowerTech WC GenericMalicious programs can bring entire businesses to their knees—and IBM i shops are not immune. It’s critical to grasp the true impact malware can have on IBM i and the network that connects to it. Attend this webinar to gain a thorough understanding of the relationships between:

    • Viruses, native objects, and the integrated file system (IFS)
    • Power Systems and Windows-based viruses and malware
    • PC-based anti-virus scanning versus native IBM i scanning

    There are a number of ways you can minimize your exposure to viruses. IBM i security expert Sandi Moore explains the facts, including how to ensure you're fully protected and compliant with regulations such as PCI.



  • Encryption on IBM i Simplified

    SB PowerTech WC GenericDB2 Field Procedures (FieldProcs) were introduced in IBM i 7.1 and have greatly simplified encryption, often without requiring any application changes. Now you can quickly encrypt sensitive data on the IBM i including PII, PCI, PHI data in your physical files and tables.
    Watch this webinar to learn how you can quickly implement encryption on the IBM i. During the webinar, security expert Robin Tatam will show you how to:

    • Use Field Procedures to automate encryption and decryption
    • Restrict and mask field level access by user or group
    • Meet compliance requirements with effective key management and audit trails


  • Lessons Learned from IBM i Cyber Attacks

    SB PowerTech WC GenericDespite the many options IBM has provided to protect your systems and data, many organizations still struggle to apply appropriate security controls.
    In this webinar, you'll get insight into how the criminals accessed these systems, the fallout from these attacks, and how the incidents could have been avoided by following security best practices.

    • Learn which security gaps cyber criminals love most
    • Find out how other IBM i organizations have fallen victim
    • Get the details on policies and processes you can implement to protect your organization, even when staff works from home

    You will learn the steps you can take to avoid the mistakes made in these examples, as well as other inadequate and misconfigured settings that put businesses at risk.



  • The Power of Coding in a Low-Code Solution

    SB PowerTech WC GenericWhen 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:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks



  • The Biggest Mistakes in IBM i Security

    SB Profound WC Generic The Biggest Mistakes in IBM i Security
    Here’s the harsh reality: cybersecurity pros have to get their jobs right every single day, while an attacker only has to succeed once to do incredible damage.
    Whether that’s thousands of exposed records, millions of dollars in fines and legal fees, or diminished share value, it’s easy to judge organizations that fall victim. IBM i enjoys an enviable reputation for security, but no system is impervious to mistakes.
    Join this webinar to learn about the biggest errors made when securing a Power Systems server.
    This knowledge is critical for ensuring integrity of your application data and preventing you from becoming the next Equifax. It’s also essential for complying with all formal regulations, including SOX, PCI, GDPR, and HIPAA
    Watch Now.

  • Comply in 5! Well, actually UNDER 5 minutes!!

    SB CYBRA PPL 5382

    TRY 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.

    Request your trial now!

  • Backup and Recovery on IBM i: Your Strategy for the Unexpected

    FortraRobot automates the routine 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:
    - Simplified backup procedures
    - Easy data encryption
    - Save media management
    - Guided restoration
    - Seamless product integration
    Make sure your data survives when catastrophe hits. Try the Robot Backup and Recovery Solution FREE for 30 days.

  • Manage IBM i Messages by Exception with Robot

    SB HelpSystems SC 5413Managing messages on your IBM i can be more than a full-time job if you have to do it manually. 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:
    - Automated message management
    - Tailored notifications and automatic escalation
    - System-wide control of your IBM i partitions
    - Two-way system notifications from your mobile device
    - Seamless product integration
    Try the Robot Message Management Solution FREE for 30 days.

  • Easiest Way to Save Money? Stop Printing IBM i Reports

    FortraRobot 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:

    - Automated report distribution
    - View online without delay
    - Browser interface to make notes
    - Custom retention capabilities
    - Seamless product integration
    Rerun another report? Never again. Try the Robot Report Management Solution FREE for 30 days.

  • Hassle-Free IBM i Operations around the Clock

    SB HelpSystems SC 5413For over 30 years, Robot has been a leader in systems management for IBM i.
    Manage your job schedule with the Robot Job Scheduling Solution. Key features include:
    - Automated batch, interactive, and cross-platform scheduling
    - Event-driven dependency processing
    - Centralized monitoring and reporting
    - Audit log and ready-to-use reports
    - Seamless product integration
    Scale your software, not your staff. Try the Robot Job Scheduling Solution FREE for 30 days.