How to modify the DB2 server host name

Source: Internet
Author: User
Tags db2 express

In the management of DB2, you may need to modify the Host Name of the DB2 database server. I will instruct you to modify the Host Name of the DB2 server.

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 database 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 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=db2terminate 

The above command should not cause any problems on Windows. However, if your operating system is Linux or UNIX, errors may occur at this time, for example, 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   
  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, which is located in

 
 
  1. ** Linux and UNIX:/sqllib/db2nodes. cfg
  2. ** Windows: IBMSQLLIBDB2db2nodes. cfg

Change the host name to a new host name. For example, the original content of db2node. cfg is 0 red01 0.

Change to new host name 0 privates 0

If you have multiple instances, modify them together.

5) Update the configuration information of the DB2 Management Server

 
 
  1. a)db2listadminnodedirectoryshowdetail   
  2. b)db2uncatalognode   
  3. c)db2catalogadmintcpipnoderemotesystem   
  4. d)db2updateadmincfgusingDB2SYSTEM   
  5. e)db2updateadmincfgusingSMTP_SERVER 

6) Start the DB2 Management Server (DAS) and DB2 instances

A) db2admin start

On Windows, you can run the command to start 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 start" command after su-das91"

B) db2start

If you have multiple instances, you need to run them all. You can use the db2ilist command to list all instances on the host and start them one by one.

For Windows, you can

 
 
  1. setDB2INSTANCE=INST1   
  2. db2start 

In this way, start the instance.

For Linux or UNIX systems, you can log on to the instance user to run the "db2start" command"

7) Delete the old host name entry from the DB2 control center on the server, and click the "add system" menu to add a new host name. Skip this step if you never use GUI tools such as the control center. In addition, since DB2 V9.1, GUI tools such as control centers are no longer provided on UNIX systems.

  1. Install DB2 Express-C on Windows (1)
  2. IBM releases three features of DB2 9.7 guidelines for future applications
  3. Improve DB2 data backup and recovery efficiency
  4. DBase: Common commands and skills DB2 must understand
  5. XML data management practices using DB2 pureXML

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.