Friday 17 July 2020

SAP HANA DB Migration/Restore from Multi-Node to Single-Node

Introduction:


As HANA DB is growing, there are many DB Migrations/Conversions coming up in the SAP world. I always had a question how to perform DB Refresh/Restore Multi Node(PRD) to single Node(QAS).  This post mainly outlines/answers the below questions

◉ How to Migrate HANA DB from Multi-Node to Single-Node (M:1)?
◉ How to Restore/Refresh HANA DB from Multi-Node to Single-Node?
◉ How to Convert HANA DB from Multi-Node to Single-Node?
—————————————————————————————————

Prerequisites:


Install the target system, the target SAP HANA Database can be of same or higher revision compared to the source.

If target system is new server, please add script server using HANA Studio

◉ scriptserver (demon.ini -> [scriptserver] -> instance = 1 )

Make sure that the statistics server on the target is same as that of the source either stand-alone or embedded.

In case the source already has embedded statistics server and the target has stand-alone then enable embedded statistics also on the target by setting the parameter.

◉ daemon.ini -> [statisticsserver] -> active = true

In case Target is Old systems like QAS, make sure both PRD and QAS DB are same revision and patch level.

Solution:


1. Install target DB system with same version of Source Data Base.

2. Check and Enable Script Server in target DB system.

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

3. Perform backup of source SAP HANA Data Base (Multi-Node).

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

4. Compare both source DB(Old/PRD) and target DB(New/QAS) systems for active services and add missed services to target DB(New/QAS) using SQL.

New/QAS:

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

Old/PRD:

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

Add missing Active services to New DB or QAS System by using below commands

◉ ALTER SYSTEM ALTER CONFIGURATION (‘daemon.ini’, ‘host’, ‘<hostname>’) SET (‘indexserver.c’,’instanceids’) = ’40, 50, 60′ WITH RECONFIGURE;

◉ ALTER SYSTEM ALTER CONFIGURATION (‘daemon.ini’, ‘host’, ‘<hostname>’) SET (‘scriptserver.c’,’instanceids’) = ’42, 52, 62′ WITH RECONFIGURE;

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

5. Compare both systems for actives services, if both Systems are having same active services, please copy the backup from Old/PRD to New/QAS DB system and  proceed with Restore target DB with source backup.

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

6. REORG all the data and Remove extra added services from target system.

Please follow below procedure to REORG and remove

1. Set for Remove
2. Plan for Reorg
3. Execute Reorg

Perform above steps for all extra added services on new DB

◉ call SYS.UPDATE_LANDSCAPE_CONFIGURATION (‘SET REMOVE’,'<hostname>:<port>’);
◉ call REORG_GENERATE (2,”);
◉ call REORG_EXECUTE(?);

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

Once All data is migrated to other instance/service, right click and delete the service.

Before removing, Check is there any data existed in that service, if count is 0, Please remove the service

SELECT COUNT(*) FROM sys.M_TABLE_PERSISTENCE_LOCATIONS_ where (host = ‘<hostname>’ and port = ‘<port>’);

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

SAP HANA, SAP HANA Platform Edition, SAP HANA Tutorial and Materials, SAP HANA Exam Prep

7. Repeat the step 6 for all extra added service in New /QAS DB.

8. Restart the HANA DB and check the services. We will have only single host services.

9. Start Sap and Validate the system and release for normal operations.

No comments:

Post a Comment