Showing posts with label hana. Show all posts
Showing posts with label hana. 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.  

      Wednesday, 26 September 2018

      HANA Log volume Full

      Log Volume is full & HANA DB, SAP system is not responding the follow the below steps to resolve the issue.

      If we manually remove some file from the directory, data loss will happen & Hana system won't cam up after that. Recovery is the only option if we remove the file manually.

      Issue - /hana/log - 100%

      Hana Log Full

      Solution -

            1. Stop HANA Database, 
         
             Login as SIDADM user and stop Hana DB Process, 
       HDB Stop 

            2. Change user to root,
                Go to /hana/log/SID/mnt00001
          
        default location - /usr/sap/SID/global/hdb/log/mnt0001

            3. Check the space usage of log files,
                 du -ksh *

      Hana log full

      To start Hana DB at least 2 GB space is required, 
               
            4. Move one volume temporarily that having more than 2 GB to another location.
         
         example from above image :- hdb00005.00004 (Moving to /hana/data location)
         mv hdb00005.00004 /hana/data

      Hana log full

            5. Create symbolic link to the new folder in the old location
          ln -s /hana/data/hdb00005.00004  /hana/log/SID/mnt00001/hdb00005.00004

      Hana log full

      6. Start the HANA Database
          Change user to SIDADM and start Hana DB,
          HDB start

      7. Wait until log backup are performed in Hana System,

             8. Use the following SQL command to clean up the log volume.
                  Once Log backup generated reclaim the space using below command, (on hdbsql)
           ALTER SYSTEM RECLAIM LOG;

      Hana log full

            9. Stop the HANA database,
          HDB stop

      10. Remove symbolic link,
           Change user to root,
           rm -f /hana/log/SID/mnt00001/hdb00005.00004 
       
      Hana log full

           10. Move  the log volume back to the original location
                Go to log volume stored temporary location, 
         mv hdb00005.00004 /hana/log/SID/mnt00001
         
      Hana log full

           11. Start the HANA Database again,
         Change user to SIDADM,
         HDB Start

      Now the log Volume size will be fine.
      Reference - SAP note 1679938

      Also Read,

      Thursday, 28 December 2017

      Tenant Database in SAP HANA

      Hi All,

      SAP HANA supports multiple isolated databases in a single SAP HANA system. These are called tenant databases.

      An HANA system is capable of containing more than one tenant database.

      SAP HANA system will have one system database for central system administration and any number of tenant database.
      SAP HANA system will be identified by a single SID & databases are identified by SID & Database name. All the databases share the same installation of database system software, the same computing resources, and the same system administration. But, each tenant database has self-contained and fully isolated with its own
      • Set of database users
      • Database catalog
      • Repository
      • Persistence
      • Backups
      • Traces and logs
       An SAP HANA database consists of multiple servers, for example, name server, index server, preprocessor server, and so on. The databases in an SAP HANA system run different combinations of these servers.

      Tenant databases require only an own index server. Servers that do not persist data, such as the compile server and the preprocessor server, run on the system database and serve all databases.
        


       System Versus Tenant Database Administration

      Tenant database systems have two levels of administration.
      Some administration tasks are performed in the system database and apply globally to the system and all its databases. They include for example:

           · Starting and stopping the whole system
      · Monitoring the system
      · Configuring parameters in configuration (*ini) files at system level
      · Setting up and configuring tenant databases
      · Creating and dropping tenant databases
      · Disabling features on tenant databases
      · Configuring system- and database-specific parameters in configuration (*ini) files
      · Backing up tenant databases
      · Recovering tenant databases
      ·      
      Some administration tasks are performed in the Tenant database and apply only to that database. They include for example:

           · Monitoring the database
      · Provisioning database users
      · Creating and deleting schema's, tables, and indexes in the database
      · Backing up the database
      · Configuring database-specific parameters in configuration (*ini) files

      Thanks for reading, Please share your valuable feedback.