It is easy to modify the Host Name of the DB2 server!

Source: Internet
Author: User

The following article describes how to correctly modify the Host Name of a DB2 server. In practice, there may be many reasons, you may need to modify the Host Name of the DB2 database server. This article describes in detail how to modify the Host Name of DB2.

Environment:

Product: DB2 UDB

Platform: AIX, Solaris, HP-UX, Linux, Windows

Version: V8 V9.1V9.5

To modify the server host name, perform the following steps on the DB2 Server:

1) Stop the DB2 Management Server (DAS) and DB2 instances

A) db2admin stop

On Windows, you can directly run the command to stop the DAS. on Linux and UNIX, you can run the command to get the name of the DAS instance, and then stop the DAS, such

 
 
  1. db2set-all|grepDB2ADMINSERVER   
  2. [g]DB2ADMINSERVER=das91  

Run the "db2admin stop" command after su-das91"

B) db2stop

If you have multiple instances, you must stop them all. You can use the db2ilist command to list all instances on the host and then stop them one by one.

For Windows, you can

 
 
  1. setDB2INSTANCE=INST1   
  2. db2stop  

In this way, stop the instance.

For Linux or UNIX systems, you can log on to the instance user to execute "db2stop"

2) modify the DB2 server host name (for details about how to modify the host name in various operating systems, refer to the relevant operating system documentation)

3) Run

 
 
  1. db2set-gDB2SYSTEM=   
  2. db2terminate  

The above command should not cause any problems on Windows, but if your operating system is Linux or UNIX, you may encounter errors at this time, such:

If it is V8 or V9.1, you will encounter the following error message:

 
 
  1. $db2set–gDB2SYSTEM=pirates   
  2. DB2SETprocessingcomplete,rc=-2029059830,SQLCODE=0  

For V9.5, you will encounter the following error:

 
 
  1. $db2set-gDB2SYSTEM=privates   
  2. DBI1309ESystemerror.   
  3. Explanation:   
  4. Thetoolencounteredanoperatingsystemerror.   
  5. Userresponse:   
  6. Asystemerrorwasencounteredduringregistryaccess.Ensurethatthere   
  7. isenoughspaceonthefilesystemwheretheregistryislocated,and thatthereisavalidLANconnectioniftheregistryisremote. 

The reason for the above error is that the global variable operation involves system-level files. The instance user does not have the corresponding permission to modify the file, but needs the root permission. We can execute this command using the following methods:

 
 
  1. $suroot   
  2. root'sPassword:   
  3. $db2set-gdb2system=privates   
  4. $db2terminate  

Note: The preceding su command does not contain-, so that the root user has the environment variable of the Instance user.

If there are multiple instances, the above command only needs to be executed once

Use the instance user to check the modification. You can confirm that the modification has been completed.

 
 
  1. $db2set–all|grepDB2SYSTEM   
  2. [g]DB2SYSTEM=privates  

4) edit the db2nodes. cfg file

This file is located in

** Linux and UNIX:/sqllib/db2nodes. cfg

The above command should not cause any problems on Windows, but if your operating system is Linux or UNIX, you may encounter errors at this time, such:

If it is V8 or V9.1, you will encounter the following error message:

$ Db2set-gDB2SYSTEM = pirates

DB2SETprocessingcomplete, rc =-2029059830, SQLCODE = 0

For V9.5, you will encounter the following error:

 
 
  1. $db2set-gDB2SYSTEM=privates   
  2. DBI1309ESystemerror.   
  3. Explanation:   
  4. Thetoolencounteredanoperatingsystemerror.   
  5. Userresponse:   
  6. Asystemerrorwasencounteredduringregistryaccess.Ensurethatthere   
  7. isenoughspaceonthefilesystemwheretheregistryislocated,and   
  8. thatthereisavalidLANconnectioniftheregistryisremote.  

The reason for the above error is that the global variable operation involves system-level files. The instance user does not have the corresponding permission to modify the file, but needs the root permission. We can execute this command using the following methods:

 
 
  1. $suroot   
  2. root'sPassword:   
  3. $db2set-gdb2system=privates   
  4. $db2terminate  

Note: The preceding su command does not contain-, so that the root user has the environment variable of the Instance user.

If there are multiple instances, the above command only needs to be executed once

Use the instance user to check the modification. You can confirm that the modification has been completed.

 
 
  1. $db2set–all|grepDB2SYSTEM   
  2. [g]DB2SYSTEM=privates 

4) edit the db2nodes. cfg file

This file is located in

** Linux and UNIX:/sqllib/db2nodes. cfg

The above content is an introduction to how to modify the Host Name of the DB2 server.

Related Article

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.