[DB2 learning document 5] setting the DB2 Environment

Source: Internet
Author: User

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

1. Level correspondence
• Environment variables at the operating system level
• The DB2 profile registry variables at the operating system and instance levels
• The Database Manager (DBM) configuration file at the instance level
• The Database (db) configuration file at the database level
The DB2 environment consists of the following parts:
1) DB2 configuration file registration database
2) Operating System Environment Variables
3) DB2 database manager configuration parameters
4) DB2 database configuration parameters
The DB2 environment is very important because it controls the way DB2 operations and activities are performed.
1. DB2 configuration file registration Library
The DB2 configuration file registration database is a DB2-specific variable that affects the management, configuration, and performance of the DB2 system. To make changes to the DB2 configuration file registration database take effect, you usually need to stop and restart the instance. Most DB2 environment settings are controlled by the DB2 configuration file registration database. The environment variables that are not stored in the configuration file registration library are set as OS environment variables.
Scope of the DB2 configuration file registration database
1) [e] indicates the registration database set for the current session or environment
2) [u] indicates user-level registration database
3) [N] indicates the node-level registration database.
4) [I] indicates the instance-level registration database
Instance-level configuration parameters will affect all databases in the instance and all applications that use the databases in the instance.
Instance-level configuration parameters: DB2 get Database Manager Configuration
Configure instance-level configuration parameters: DB2 update Database Manager Configuration using parameter new_value
5) [g] indicates a globally registered database.
2. DB2 Environment
1) system environment variables:
Most of them have been set during installation. It is important:
Db2instance -- determines the instances active on the machine
Db2node -- determines the partitions of active databases in Multi-partition Environments
Temporary settings use export. Permanent settings can be set on related files in the system, or in db2profile or db2cshrc. These two files are called. Profile in your. login file.
2) DB2 profile registries
Most DB2-related information is stored. Profile registry variables is usually called profile registry variables.
It is divided into four categories:
• The DB2 instance-level profile registry:
Variable of an instance
• The DB2 global-level profile registry:
All instance variables
• The DB2 instance node-level profile registry:
Use in a partitioned database environment
• The DB2 instance profile registry:
Contains all instances in the system. The command db2ilist is used as the input to list all instances in the system.
It is actually stored in binary or text files. The location depends on the operating system.
Db2set-ALL: All DB2 profile registry variables are displayed.
There is a level setting before each variable, which can be set with-X:
[I] refers to the DB2 instance-level profile registry. An example is as follows: db2set db2comm = SSL-I myinst.
[G] refers to DB2 global-level profile registry. An example is as follows: db2set db2comm = NetBIOS-G.
[E] indicates environment variable. Example: Export set db2comm = TCPIP
Although most variables can be set to environment variables, we recommend that you set them to DB2 variables (using db2set)
If a variable is set to multiple levels, the system determines in the following order:
1. Environment Variable set using the set/export operating system commands.
2. DB2 instance node-level profile Registry
3. DB2 instance-level profile Registry
4. DB2 global-level profile Registry
3. configuration file registration operations:
View all existing DB2 configuration file registries
Db2set-LR
View all the configured DB2 configuration file registries
Db2set-all
Set the DB2 configuration file registration Library
Db2set db2comm = TCPIP
To set multiple values for the DB2 configuration file registration database:
Db2set db2comm = TCPIP, npipe, local
To delete a variable in the DB2 configuration file registration database and set it to the default value,
Db2set registry_variable =
Set the value of a specific variable (db2instprof in this example) at the local level
Db2set db2instprof = "C: Program filessqllib"-G
Make registry variables take effect
You need to stop and start the instance (db2stop and db2start ).
4. Operating System Environment Variables
A little simpler Export
5. DB2 database manager configuration parameters
There are two configuration parameters: database level and instance level. The former variables exist in the Database Configuration File. Changing these variables only affects a single database. The latter exists in dBm and affects all databases of an instance.
View the DB2 database manager configuration parameters:
DB2 get dBm cfg
DB2 get dBm CFG show detail displays more detailed information.
Update Database Manager configuration parameters (instance-level). The syntax is
Update dBm CFG using {Your parameter your desired value}
[Immediate | deferred]
The last optional parameter is the effective configuration.
For example:
Update dBm CFG using intra_parallel Yes immediate
DB2 database configuration parameters (Database-level)
Display database configuration parameters
DB2 get dB cfg
How to update database configuration parameters
DB2 update dB CFG using {Your parameter your desired value} [immediate | deferred]
Note that this command is only different from setting parameters at the instance level, but you can rest assured that the parameter names at the instance level and database level will never be the same.
How to Set default database configuration parameters
DB2 reset dB cfg
These operations can also be performed in the control center.

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.