Pages

Monday, January 8, 2024

High Availability Architecture implementation Commands - Part 2

 High Availability Architecture implementation Commands


  1. Add Application VIP service in Source cluster

Run below commands from the root user.


# $GRID_HOME/bin/appvipcfg create -network=1 -ip="10.10.10.74" \

-vipname gg-sourcedb-vip -user=root -group=oinstall -failback=0





# $GRID_HOME/bin/crsctl modify res 'gg-sourcedb-vip' \

 -attr "HOSTING_MEMBERS=sourcedb01"





# $GRID_HOME/bin/crsctl modify res 'gg-sourcedb-vip' \

-attr "USR_ORA_VIP=10.10.10.74"




# $GRID_HOME/bin/crsctl start resource gg-sourcedb-vip -n sourcedb01





# $GRID_HOME/bin/crsctl stat resource gg-sourcedb-vip -p → This command displays the resource properties.



  1. Add Application VIP service in Target cluster

Run below commands from the root user.


# $GRID_HOME/bin/appvipcfg create -network=1 -ip="10.10.10.75" \

-vipname gg-targetdb-vip -user=root -group=oinstall -failback=0



# $GRID_HOME/bin/crsctl modify res 'gg-targetdb-vip' \

 -attr "HOSTING_MEMBERS=targetdb01"



# $GRID_HOME/bin/crsctl modify res 'gg-targetdb-vip' \

-attr "USR_ORA_VIP=10.10.10.75"


# $GRID_HOME/bin/crsctl start resource gg-targetdb-vip -n targetdb01


# $GRID_HOME/bin/crsctl stat resource gg-targetdb-vip -p → This command displays the resource properties.


  1. Add Goldengate service in Source database.

Note: Run below command from oracle user 


Command to add the goldengate service


$ agctl add goldengate GG_SOURCEDB \

--gg_home /u01/app/oracle/product/gghome \

--use_local_services \

--instance_type source \

--dataguard_autostart no \

--oracle_home /u01/app/oracle/product/db_1/19c \

--critical_extracts EXT,PMP \

--db_services ora.sourcedb.sourcedb_ogg.svc \

--nodes sourcedb01,sourcedb02 \

--vip_name gg-sourcedb-vip \

--filesytems dbfs_mount \

--user oracle \

--group oinstall 


Command to check the Goldengate service Configuration:

$ agctl config goldengate GG_SOURCEDB 

Command to start the Goldengate service on node-1:

$ agctl start goldengate GG_SOURCEDB --node sourcedb01 



Command to relocate the Goldengate service on node-2:

$ agctl relocate goldengate GG_SOURCEDB --node sourcedb02



Command to start the Goldengate service:

$ agctl stop goldengate GG_SOURCEDB



Command to disable the Goldengate service:

$ agctl disable goldengate GG_SOURCEDB



Command to enable the Goldengate service:

$ agctl enable goldengate GG_SOURCEDB



  1. Add Goldengate service in Target database.

Note: Run below command from oracle user 


$ agctl add goldengate GG_TARGETDB \

--gg_home /u01/app/oracle/product/gghome \

--use_local_services \

--instance_type target \

--dataguard_autostart no \

--oracle_home /u01/app/oracle/product/db_1/19c \

--critical_extracts REP \

--db_services ora.targetdb.targetdb_ogg.svc \

--nodes targetdb01,targetdb02 \

--vip_name gg-targetdb-vip \

--filesytems dbfs_mount \

--user oracle \

--group oinstall 



Command to check the Goldengate service Configuration:

$ agctl config goldengate GG_TARGETDB



Command to start the Goldengate service on node-1:

$ agctl start goldengate GG_TARGETDB --node targetdb01 



Command to relocate the Goldengate service on node-2:

$ agctl relocate goldengate GG_TARGETDB --node targetdb02



Command to start the Goldengate service:

$ agctl stop goldengate GG_TARGETDB


Command to disable the Goldengate service:

$ agctl disable goldengate GG_TARGETDB


Command to enable the Goldengate service:

$ agctl enable goldengate GG_TARGETDB



Reference:
https://www.oracle.com/database/technologies/xag-agents-download.html

Tuesday, January 2, 2024

High Availability Architecture implementation Commands - Part 1

 High Availability Architecture implementation Commands:

Environment Details: 


Source Cluster:

 It is two node cluster and Grid Home & database versions are 19c


Node1 → sourcedb01.oracle.com

Node2 → sourcedb02.oracle.com


Source DB Name: sourcedb


Target Cluster:

 It is two node cluster and Grid Home & database versions are 19c


Node1 → targetdb01.oracle.com

Node2 → targetdb02.oracle.com


Target DB Name: targetdb


Installed Goldengate Version: 19

Architecture: Classic Architecture


Source side GG services: EXT, PMP are extract and pump processes.

Target side GG services: REP is the replicat process.


Note: This implementation is considered that unidirectional goldengate replication is already setup and only implementing HA for Goldengate services. 



Implementation Steps:

  1. Download XAG agent binaries.
    What is XAG: Oracle Grid Infrastructure Bundled Agents (XAG) are Oracle Grid Infrastructure components that provide the HA framework to application resources and resource types managed through the bundled agent management interface, AGCTL.
    https://www.oracle.com/database/technologies/xag-agents-download.html

  2. To configure Grid agent, application vip resource is needed, select a free ip from cluster’s public network and assign it to a vip host.

Source cluster application vip is gg-sourcedb-vip.oracle.com

Target Cluster Application vip is gg-targetdb-vip.oracle.com

Note: These application vip names should be added in the DNS before the configuration.

  1. XAG installation

Copy the downloaded zip file in step-1 to source and target cluster nodes ( sourcedb01, sourcedb02, targetdb01 & targetdb02 ) stage directory and follow below steps in all the nodes.


  1. Unzip the file to stage directory:


$ cd /u01/app/oracle/xag_stage

$ unzip -q p31215432_190000_Generic.zip



  1. Create XAG installation directory:

$ mkdir -p /u01/app/oracle/xag

  1. Add XAG agent to PATH variable and also update the .bash_profile for persistence:


$ export PATH=$PATH:/u01/app/oracle/xag/bin



  1. Install XAG agent:

$ cd /u01/app/oracle/xag_stage/xag

$ ./xagsetup.sh --install --directory \

/u01/app/oracle/xag --all_nodes



  1. Verify the XAG agent release version after installation


$ agctl query releaseversion




  1.  Add service & TNS alias as mentioned below.

Commands for Goldengate source database: 


Run below commands from grid home owner:


$ srvctl add service -db SOURCEDB -service SOURCEDB_OGG -role PRIMARY -preferred SOURCEDB1 -available SOURCEDB2        



$ srvctl start service -db SOURCEDB -service SOURCEDB_OGG



$ srvctl status service -db SOURCEDB -service SOURCEDB_OGG



Node-1 TNS Names:


SOURCEDB_OGG=

   (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = sourcedb01.oracle.com)(PORT = 1521))

    (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = sourcedb_ogg)))


Node-2 TNS Names:


SOURCEDB_OGG=

   (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = sourcedb02.oracle.com)(PORT = 1521))

    (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = sourcedb_ogg)))


Verify the service status using crsctl from Grid Home:

$ crsctl stat res | grep -i sourcedb_ogg


NAME=ora.sourcedb.sourcedb_ogg.svc → Command Output



Commands for Goldengate Target database: 


Run below commands from grid home owner:


$ srvctl add service -db TARGETDB -service TARGETDB_OGG -role PRIMARY -preferred TARGETDB1 -available TARGETDB2        



$ srvctl start service -db TARGETDB -service TARGETDB_OGG

$ srvctl status service -db TARGETDB -service TARGETDB_OGG



Node-1 TNS Names:


TARGETDB_OGG=

   (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = targetdb01.oracle.com)(PORT = 1521))

    (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = targetdb_ogg)))


Node-2 TNS Names:


TARGETDB_OGG=

   (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = targetdb02.oracle.com)(PORT = 1521))

    (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = targetdb_ogg)))


Verify the service status using crsctl:

$ crsctl stat res | grep -i targetdb_ogg


NAME=ora.targetdb.targetdb_ogg.svc → Command Output