Correct operation steps for implementing DB2HADRv8.2 EE

Source: Internet
Author: User
Tags db2 connect db2 connect to

The following articles mainly describe how to correctly implement the implementation of DB2HADRv8.2 EE. If you are curious about the actual operation steps of DB2HADRv8.2 EE, the following articles will unveil its secrets and hope to help you in this regard.

1. The database version must be consistent. In this example, run db2licm-l to check whether the hadr feature is supported. 3. Two servers: serverA 10.10.20.16 255.255.255.0 serverB 10.20.110 255.255.255.0.

1. The database versions must be consistent. In this example, 8.2ese

2. Run db2licm-l to check whether the hadr feature is supported.

3. Two servers: serverA 10.10.20.16 255.255.255.0 serverB 10.20.110 255.255.255.255.0

4. Both machines use the default instance DB2, and the service port number is 50000.

5. Since the Registry parameter db2comm = TCPIP is the default value after installation, it is not configured below. If not,

You must use the command db2set db2comm = TCPIP to set

6. Disable the firewall or open the port */

Run set db2instance = DB2 db2set db2comm = TCPIP on serverA. The default value is

 
 
  1. db2 terminate db2stop db2start 

Create a database db2sampl

Modify database Parameters

 
 
  1. db2 update db cfg for sample using logretain=on 
  2. db2 update db cfg for sample using trackmod=on 
  3. db2 update db cfg for sample using logindexbuild=on 
  4. db2 update db cfg for sample using indexrec=restart 

DB2HADRv8.2 backup database db2 backup db sample to f: \ test

On serverB: set db2instance = DB2

The following command causes the database to be In the rollback and suspension status,

 
 
  1. db2 restore db sample from f:\test replace history file  
  2. db2 update db cfg for sample using HADR_LOCAL_HOST 10.10.20.110  
  3. db2 update db cfg for sample using HADR_LOCAL_SVC 44444  
  4. db2 update db cfg for sample using HADR_REMOTE_HOST 10.10.20.16  
  5. db2 update db cfg for sample using HADR_REMOTE_SVC 33333  
  6. db2 update db cfg for sample using HADR_REMOTE_INST DB2  
  7. db2 update db cfg for sample using HADR_SYNCMODE nearsync  

Configure sample Database parameters on serverA

 
 
  1. set db2instance=DB2 db2 update db cfg for sample using HADR_LOCAL_HOST 10.10.20.16  
  2. db2 update db cfg for sample using HADR_LOCAL_SVC 33333  
  3. db2 update db cfg for sample using HADR_REMOTE_HOST 10.10.20.110  
  4. db2 update db cfg for sample using HADR_REMOTE_SVC 44444  
  5. db2 update db cfg for sample using HADR_REMOTE_INST DB2  
  6. db2 update db cfg for sample using HADR_SYNCMODE nearsync  

Start the sample database in standby mode on server B

 
 
  1. set db2instance=DB2 db2 deactivate database sample  
  2. db2 start hadr on database sample as standby  

Start the sample database in primary mode on serverA

 
 
  1. set db2instance=DB2 db2 start hadr on database sample as primary 

View the hadr status of the sample database on serverA

 
 
  1. set db2instance=DB2 db2pd -d sample -hadr 

View the hadr status of the sample database on server B

 
 
  1. set db2instance=DB2 db2pd -d sample -hadr 

Test:

On serverA

 
 
  1. set db2instance=DB2 
  2. db2 connect to sample  
  3. db2 create table test(id integer)  
  4. db2 insert into test(1)  
  5. db2 insert into test(2)  
  6. db2 commit  
  7. db2 select * from sample  

Set db2instance = DB2 on server B to take over hadr. If you cannot establish a connection with the DB2 instance on serverA,

For example, if the serverA server or DB2 instance is disabled, the by force option must be used as follows:

 
 
  1. db2 takeover hadr on database sample user db2admin using db2admin by force 

Normal takeover

 
 
  1. db2 takeover hadr on database sample user db2admin using db2admin 

Db2 connect to sample db2 select * from test shows that the data on serverA is applied to serverB.

View hadr status

 
 
  1. db2pd -d sample -hadr 

The above content is an introduction to the implementation steps of DB2HADRv8.2 EE. I hope you will have some gains.

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.