DB2 : to bring down / startup HADR

 (1) 

[tst3ins3@db2tst601  ~]

$ db2 connect to wctst10


   Database Connection Information


 Database server        = DB2/LINUXX8664 11.5.8.0

 SQL authorization ID   = TST3INS3

 Local database alias   = wctst10


[tst3ins3@db2tst601  ~]


$ db2haicu disable

Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).


Option 'disable' is not recognized.

>>-db2haicu-----+------------------------------------------+->

                +- -f--input file--------------------------+

                +- -o--output file-------------------------+

                +- -disable--------------------------------+

                '- -delete--+---------------------------+--'

                            |                   .-,---. |

                            |                   V     | |

                            +- -dbpartitionnum--number+-+

                            |           .-,-.           |

                            |           V   |           |

                            '- -hadrdb--name+-----------'

>-----------------------------------------------------------><

[tst3ins3@db2tst601  ~]




(2) 

[root@db2tst602 ~]# su - tst3ins3

Last login: Thu Aug  3 13:19:38 CDT 2023


Welcome to the db2tst602 Db2 server in GCP

In a standard configuration, this server houses databases for Development & Testing


Use an alias to change to the desired Db2 instance


The current instance is tst3ins3


[tst3ins3@db2tst602  ~]


$ db2haicu disable

Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).


Option 'disable' is not recognized.

>>-db2haicu-----+------------------------------------------+->

                +- -f--input file--------------------------+

                +- -o--output file-------------------------+

                +- -disable--------------------------------+

                '- -delete--+---------------------------+--'

                            |                   .-,---. |

                            |                   V     | |

                            +- -dbpartitionnum--number+-+

                            |           .-,-.           |

                            |           V   |           |

                            '- -hadrdb--name+-----------'

>-----------------------------------------------------------><

[tst3ins3@db2tst602  ~]



(3) 

$ db2 deactivate db wctst10

DB20000I  The DEACTIVATE DATABASE command completed successfully.

[tst3ins3@db2tst602  ~]




(4) 

$ db2 stop hadr on db wctst10

DB20000I  The STOP HADR ON DATABASE command completed successfully.

[tst3ins3@db2tst602  ~]



(5) 

$ db2stop

06/01/2023 10:44:13     0   0   SQL1064N  DB2STOP processing was successful.

SQL1064N  DB2STOP processing was successful.

[tst3ins3@db2tst602  ~]



(6)

On db2tst601 (as tst3ins3):

$ db2 stop hadr on db wctst10

DB20000I  The STOP HADR ON DATABASE command completed successfully.

[tst3ins3@db2tst601  ~]




(7) 

[tst3ins3@db2tst601  ~]

$ db2pd -db wctst10 -hadr


Database Member 0 -- Database wctst10 -- Active -- Up 1 days 20:07:52 -- Date 2023-06-01-10.45.30.130037


HADR Information:

HADR is not active.


[tst3ins3@db2tst601  ~]



To double check it is down:

(8) On db2tst602

[tst3ins3@db2tst602  ~]

$ db2pd -db wctst10 -hadr

Unable to attach to database manager on member 0.

Please ensure the following are true:

   - db2start has been run for the member.

   - db2pd is being run on the same physical machine as the member.

   - DB2NODE environment variable setting is correct for the member

     or db2pd -mem setting is correct for the member.

Another possibility of this failure is the Virtual Address Space Randomization is currently enabled on this system.

[tst3ins3@db2tst602  ~]




[tst3ins3@db2tst602  ~]

$ lssam

Online IBM.ResourceGroup:db2_tst3ins3_db2tst601_0-rg Nominal=Online

        '- Online IBM.Application:db2_tst3ins3_db2tst601_0-rs

                '- Online IBM.Application:db2_tst3ins3_db2tst601_0-rs:db2tst601

Pending online IBM.ResourceGroup:db2_tst3ins3_db2tst602_0-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst3ins3_db2tst602_0-rs Control=StartInhibitedBecauseSuspended

                '- Offline IBM.Application:db2_tst3ins3_db2tst602_0-rs:db2tst602

Pending online IBM.ResourceGroup:db2_tst3ins3_tst3ins3_wctst10-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs Control=StartInhibitedBecauseSuspended

                |- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs:db2tst601

                '- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs:db2tst602

Online IBM.Equivalency:db2_public_network_0

        |- Online IBM.NetworkInterface:eth0:db2tst601

        '- Online IBM.NetworkInterface:eth0:db2tst602

Online IBM.Equivalency:db2_tst3ins3_db2tst601_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst601:db2tst601

Online IBM.Equivalency:db2_tst3ins3_db2tst602_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst602:db2tst602

Online IBM.Equivalency:db2_tst3ins3_tst3ins3_wctst10-rg_group-equ

        |- Online IBM.PeerNode:db2tst601:db2tst601

        '- Online IBM.PeerNode:db2tst602:db2tst602

[tst3ins3@db2tst602  ~]





[tst3ins3@db2tst601  ~]

$ lssam

Online IBM.ResourceGroup:db2_tst3ins3_db2tst601_0-rg Nominal=Online

        '- Online IBM.Application:db2_tst3ins3_db2tst601_0-rs

                '- Online IBM.Application:db2_tst3ins3_db2tst601_0-rs:db2tst601

Pending online IBM.ResourceGroup:db2_tst3ins3_db2tst602_0-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst3ins3_db2tst602_0-rs Control=StartInhibitedBecauseSuspended

                '- Offline IBM.Application:db2_tst3ins3_db2tst602_0-rs:db2tst602

Pending online IBM.ResourceGroup:db2_tst3ins3_tst3ins3_wctst10-rg Request=Lock Nominal=Online

        '- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs Control=StartInhibitedBecauseSuspended

                |- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs:db2tst601

                '- Offline IBM.Application:db2_tst3ins3_tst3ins3_wctst10-rs:db2tst602

Online IBM.Equivalency:db2_public_network_0

        |- Online IBM.NetworkInterface:eth0:db2tst601

        '- Online IBM.NetworkInterface:eth0:db2tst602

Online IBM.Equivalency:db2_tst3ins3_db2tst601_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst601:db2tst601

Online IBM.Equivalency:db2_tst3ins3_db2tst602_0-rg_group-equ

        '- Online IBM.PeerNode:db2tst602:db2tst602

Online IBM.Equivalency:db2_tst3ins3_tst3ins3_wctst10-rg_group-equ

        |- Online IBM.PeerNode:db2tst601:db2tst601

        '- Online IBM.PeerNode:db2tst602:db2tst602

[tst3ins3@db2tst601  ~]

$






Steps to bring up tst3:

On db2tst602 (as tst3ins3):

db2start

db2 start hadr on db wctst10 as standby

On db2tst601 (as tst3ins3)

db2 start hadr on db wctst10 as primary

On each host AFTER steps 1 and 2:

db2haicu         <=== follow prompts

$ db2haicu

Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).


You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.


For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.


db2haicu determined the current DB2 database manager instance is 'tst3ins3'. The cluster configuration that follows will apply to this instance.


db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...

When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'Creating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing active cluster domain ...

db2haicu found a cluster domain called 'tsa' on this machine. The cluster configuration that follows will apply to this domain.


Select an administrative task by number from the list below:

  1. Add or remove cluster nodes.

  2. Add or remove a network interface.

  3. Add, remove or modify HADR databases.

  4. Add or remove an IP address.

  5. Move DB2 database partitions and HADR databases for scheduled maintenance.

  6. Create a new quorum device for the domain.

  7. Destroy the domain.

  8. Exit.

Enter your selection:

1

Do you want to review the status of each cluster node in the domain before you begin? [1]

1. Yes

2. No

1

Domain Name: tsa

  Node Name: db2tst601 --- State: Online

  Node Name: db2tst602 --- State: Online

Do you want to add or remove cluster nodes to or from the domain? [1]

1. Add

2. Remove

1

Enter the host name of a machine to add to the domain:

db2tst602.gcp.tmw.com

Node 'db2tst602' cannot be added to the domain 'tsa' because it is already in the domain.

Do you want to add another node to the domain? [1]

1. Yes

2. No

2

Do you want to make any other changes to the cluster configuration? [1]

1. Yes

2. No

2

All cluster configurations have been completed successfully. db2haicu exiting ...









Same commands to verify HADR/TSA

db2pd -db wctst10 -hadr

lssam

Comments

Popular posts from this blog

Oracle: To clean up WRI$_ADV_OBJECTS