Showing posts with label hana replication. Show all posts
Showing posts with label hana replication. Show all posts

Sunday, 24 October 2021

Disable SAP HANA System Replication with hdbnsutil

We can disable SAP HANA system replication in an SAP HANA system using hdbnsutil.

Remember before disable Replication :-

  • Login as SIDADM user
  • Secondary system must be offline
Disable Procedure :-  

1. Unregister Secondary System
  • Stop Secondary System
  • Unregister Secondary System  using below command
           hdbnsutil –sr_unregister

Disable SAP Hana system replication with hdbnsutil

2. Disable system replication 
Use Below command on Primary System 

          hdbnsutil –sr_disable

Disable SAP Hana system replication with hdbnsutil

Check the status using command /hdbnsutil -sr_state

After Disable the replication we can replicate the systems again ,

On Primary System :-

            hdbnsutil –sr_enable

If it not working the use below command to forcefully disable the replication,
    
            hdbnsutil –sr_disable --force

the start replication again,

            hdbnsutil –sr_enable

On Secondary System :-

Stop Secondary system
Use below command to start again the replication,

            hdbnsutil -sr_register

Full Command :- 
hdbnsutil -sr_register --replicationMode=<sync> --operationMode=<logreplay> --name=<SiteB>     --remoteInstance=<instId> --remoteHost=<hostname_of_SiteA>

Start Secondary System

If the above steps not worked the use below option to configure the replication again,
Stop Secondary system then,
                hdbnsutil -sr_cleanup --force
                  hdbnsutil -sr_register   (Full command mentioned above)

      Start the secondary system

      Also Read,

      Thanks for reading, Please share your valuable feedback

      Thursday, 21 October 2021

      SAP HANA System Replication setup with hdbnsutil

      The following steps show how to configure such a system. In this scenario there are two SAP HANA systems: A, B named SiteA & SiteB. This scenario supports a tier 2 secondary with sync replication mode.

      Check the Replication prerequisites using below link,
      Prerequisites for Configuring SAP HANA System Replication

      1. Enable system replication in Primary System.
          Primary System Loggical Name - SiteA

           Login as SIDDM
          cd /usr/sap/<sid>/HDB<instancenr>/exe
          /hdbnsutil -sr_enable --name=SiteA

         To check if the site has been successfully enabled for system replication with hdbnsutil run:
         
          /hdbnsutil -sr_state

      2. Stop the tier 2 secondary System
           sapcontrol -nr <instance_number> function StopSystem HDB or HDB stop

      3. Register Secondary System on Primary

      hdbnsutil -sr_register --replicationMode=sync --operationMode=logreplay --name=SiteB     --remoteInstance=<instId> --remoteHost=<hostname_of_SiteA>

      4. Start the secondary system
      sapcontrol -nr <instance_number> –function StopSystem HDB  or  HDB start

      To check if the site has been successfully enabled for system replication with hdbnsutil run

      /hdbnsutil -sr_state

      HANA System Replication with hdbnsutil

      Also Read,

      Thanks for reading, Please share your valuable feedback.  

      Sunday, 10 October 2021

      Replication Modes of SAP HANA System Replication

      Check the Prerequisites for Configuring SAP HANA System Replication using below link,

      While registering the secondary system for replication, we may specify the replication mode to use otherwise the default replication mode will use.

      Following are the different SAP HANA replication modes for the redo logs,

      Synchronous in-memory (SYNCMEM) :- 
      The secondary system sends an acknowledgment back to the primary system as soon as the data is received in memory.  When the connection to the secondary system is lost, the primary system continues the transaction processing and writes the changes only to the local disk. Data loss can occur when primary and secondary fail at the same time as long as the secondary system is connected or when a takeover is executed, while the secondary system is disconnected.
      This option provides better performance because it is not necessary to wait for disk I/O on the secondary system, but it is more vulnerable to data loss. The disk I/O speed on the secondary system doesn't influence the primary's performance.

      Synchronous (SYNC) :-

      The primary system waits with committing the transaction until it gets a reply that the log is persisted in the secondary system. This option guarantees immediate consistency between both systems.

      When the connection to the secondary system is lost, the primary system continues the transaction processing and writes the changes only to the local disk. No data loss occurs in this scenario as long as the secondary system is connected. Data loss can occur, when a takeover is executed while the secondary system is disconnected.

      Additionally, this replication mode can run with a full sync option. This means that log write is successful when the log buffer has been written to the log file of the primary and the secondary system. When the secondary system is disconnected, the primary system suspends the transaction processing until the connection to the secondary system is reestablished. No data loss occurs in this scenario. 
       Prerequisites for Configuring Full Sync option,
      • Configure your system replication with the SYNC replication mode. 
      • Check that the system replication status is active and in sync for all services. 
      • Enable the full sync option with hdbnsutil -sr_fullsync --enable
      The full sync option can be switched on and off using the command:
      hdbnsutil -sr_fullsync --enable|--disable

      Asynchronous (ASYNC) :
      The primary system commits the transaction after sending the log without waiting for a response. Here we have no delay because the data transmission is asynchronous to the transaction in the primary system.

      This option provides better performance because it is not necessary to wait for log I/O on the secondary system. Database consistency across all services on the secondary system is guaranteed. However, it is more vulnerable to data loss. Data changes may be lost during takeover.

      Replication Mode Change Command :-
      hdbnsutil -sr_changemode --mode=sync|syncmem|async
      Replication Mode Status check Command :-
      hdbnsutil -sr_state --sapcontrol=1
      Replication Modes of SAP HANA System Replication
      Thanks for reading, Please share your valuable feedback.  

      Thursday, 7 October 2021

      Prerequisites for Configuring SAP HANA System Replication

       SAP Hana 2.0 System Replication Structure 

      Hana System Replication

      Hana System Replication Pre-requisite

      • Primary & Secondary database must be Installed and configured
      • Confirm both systems are up & running independently
      • PKI SSFS key and data should be copy from Primary to secondary system
      • Both Systems are in same size & configuration
      • Both Systems are in same Hana Version
      • Both Systems are in same SID & Instance Number
      • Both Systems should be installed on different hosts
      • Both Systems should be one same network segment
      • Initial database backup must be performed on Primary System before replication start (System DB & All Tenant DB)
      For DR Configuration, Instead of the above below points also required,

      • Both Servers are in different location / Data Centers
      • DB System can be with same structure or minimum compared with PRD 
      Tools using configure Hana Replication
      • hdbnsutil 
      • SAP Hana Cockpit
      • SAP Hana Studio
      Hana 1.0 also having same Replication structure, but Hana Cockpit will not support  till Hana 1.0 SPS 11.

      Also Read,

      Thanks for reading, Please share your valuable feedback.