Changing hostname of the DB2 Server

Source: Internet
Author: User

Http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp? Topic =/com.ibm.db2.luw.messages. SQL .doc/doc/msql06031n.html

 

Question

Changing hostname of the DB2 server. What updates in DB2 need to be made?

Cause

Changing the DB2 server's hostname.

Answer

Perform the following on the DB2 Server:

1) login as the dasadm user on Unix/Linux or local administrator on Windows. Stop the DB2 Administration Server (DAS ):

    Db2admin stop

2) login as the instance owner on Unix/Linux or local administrator on Windows. Stop the DB2 instance:

    Db2stop

3) change the server's hostname. on a Windows system, a reboot is required before this change will take effect. do not reboot the Windows server at this time-you must make the DB2 configuration changes first.

4) login as user root on Unix/Linux and local administrator on Windows. Update the db2system registry varibale:

    Db2set-G db2system = <new hostname>

5) locate db2nodes. cfg in one of the following directories:

  • Unix/Linux:
    <DB2 instance home directory>/sqllib/db2nodes. cfg
  • All windows flavors running DB2 V8 and v9.1:
    Program Files/IBM/sqllib/DB2/db2nodes. cfg
  • Windows XP and 2003 running DB2V9.5:
    Documents and Settings/all users/Application Data/IBM/DB2/<db2copy>/DB2/db2nodes. cfg

    Note: Application Data is a hidden folder

  • Windows Vista and later Operating Systems: programdata/IBM/DB2/<db2copy>/DB2/db2nodes. cfg

Note that only DB2 ESE has a db2nodes. cfg. If you are running other editions (workgroup server, or Personal Edition) Then you can skip this step and the next.

6) in the db2nodes. cfg file change <Current hostname> to <new hostname>.

7) run the following command to list the current Hostname/system name that is cataloged:

    DB2 list admin node directory show detail

    If there are no admin node directory entries then you can skip the next 2 steps. it simply means that you haven't started the control center. the admin node directory will get updated the next time the control center is started, based upon the current hostname.

    #----------------------------------
    Error: 'db21061e command line environment not initialized' when attempting to run scripts
    Question

    When attempting to run the database creation scripts from a command prompt (learning management module [lmm], IBM Delivery Server [DS], Audit) for IBM Lotus Learning Management System (LMS ), you receive the following error message:

      Db21061e command line environment not initialized.

    Cause

    This error occurs when the db2cmd.exe file has not been initialized.

     

    Answer

    To start db2cmd.exe:

    1. From the Windows taskbar, choose start --> Run --> type "cmd" (without quotes "and press Enter.

    2. Type "db2cmd" (without quotes) and press Enter. You will now be able to run the lmm, DS, or audit database scripts.

    #----------------------------------

8) uncatalog the current hostname using this command:

    DB2 uncatalog node <nodename>

9) catalog the admin node with the new hostname using this command:

  •  
  • DB2 catalog admin TCPIP node <nodename> remote <new hostname> System <new hostname>

    <Nodename>Can be anything you want it to be (8 characters or less). It does not relate directly to the hostname itself.

10) Update the admin configuration file using these commands:

    DB2 update admin CFG using db2system <new hostname>
    DB2 update admin CFG using smtp_server <new hostname>

11) at this time, you should restart your server if running Windows. note that if your instances are set to auto-start, you may get error messages. these will occur if you have db2_extsecurity enabled. to correct this, you will need to update the db2_admingroup and db2_usersgroup registry entries using the db2extsec command. see the 'note' at the end of this operation te for more details.

12) login as the dasadm user on Unix/Linux or local administrator on Windows. Start the DB2 Administration Server (DAS ):

    Db2admin start

13) login as the instance owner on Unix/Linux or local administrator on Windows. Start the DB2 instance:

    Db2start

14) in control center find the old hostname under the "All systems" folder and right click, choose remove.

15) in control center add the new hostname. Right click on the "All systems" folder and choose "add". Click on "Discover" to locate the new hostname.

Note:
Starting in v9.1 fp2, DB2 supports the use of domain groups for extended security. therefore, when you change the computer name and the computer groups db2admns and db2users are local computer groups, you must update the db2_admingroup and db2_usersgroup global registries. please see the related URL for instructions on how to do this.

 

Related information

Domain groups for extended Windows Security

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.