Thursday, 2 November 2017

SAP HANA System Copy- Homogeneous On Multi Tenant Database

I know there is already very good blogs on this topic, The purpose of this blog is to explain the process of performing  a simple homogeneous system copy of a HANA (MDC-multi tenant database container) based system using the recovery of the source backup on the target HANA DB using HANA Studio and Using SWPM , I don’t find More blogs and details regarding homogeneous system copy or backup/Restore on HANA 2.0 on multi tenant database container.

My Environment was:-

SAP HANA 2.0 ( For Both Target and Source )

SAP BW 7.50 ( For Both Target and Source )

Schema Name (SAPABAP1)( For Both Target and Source )

My SAP HANA 2.0 Database is on separate Box and PAS (BW) is on separate ,

There 3 way I found to perform the homogeneous System copy ,

1- If you want to install a full SAP system including the required application server instances. Standard System

2- If the target system already exists and you merely want to replace the content of the database.

Database Refresh or Move

3- DB Refresh of HANA Based systems using HANA Studio Backup/Recovery without Using SWPM

All the 3 Steps are very easy to do if we plan correctly and read system copy documents and Required SAP notes,

Here I will explain point 1 and 3 and later in Future I will explain point No 2,

So lets Start,

1- If you want to install a full SAP system including the required application server instances. Standard System

I assume that you have already required backup which need to be used , So I will not explain much about taking backup,

◉ Take a complete DB backup of the source Database
◉ Move the required database backup to the Target system on Database Host
◉ Check the permission of the backup fine and Note down the backup prefix
◉ Collect the Schema user password of the source System
◉ Collect the DDIC 000 Password of the source System
◉ Cross check you HANA DB version , its must be same or higher that source ,

Source SID- PRD

Target SID- QAS

Start SWPM as a user with administrative rights (root, Administrator) on the application server host

Select an option on the start screen.

1. If you want to install a full SAP system including the required application server instances, choose <your product> -> <your database> -> System Copy -> Target System -> <system variant> -> Based on <technical stack> -> Standard System.

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Here put your HANA Database SID host name and instance No,

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SWPM will automatically detect the SYSTEM DB and Tenant DB name, and create it, you can also create Tenant Database using HANA Cockpit or SQL command ,

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

given the SYSTEM user password ( be care Full in giving the password if its wrong it will lock the user)

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Give the required software path on SWPM

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

give the schema user password of the source system

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Put the database SIDADM user password

here SAPControl WSDL URL will come by default

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Note:- Your backup should be present on Database host and location of the backup will be the database host location,

Backup name should be the prefix name of the complete data backup. I have used the default backup name (COMPLETE_DATA_BACKUP)

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

I did SLD later

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Put the DDIC 000 Source Password

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

move SWPM

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

I had the issue during the recovery and checked the logs, I stopped the Tenant database manually from HANA Studio using SQL command ALTER SYSTEM STOP DATABASE SID, because during the recovery process Database must be stopped ,

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

This is completed now,
  • Additional adjustments after the installation
1. Checking the secondary database connections
After you copy the database, the target system has the same database connections (for example, for the DBA Cockpit) as the source system; this may cause problems. Therefore, you must check the database connections in transaction DBCO and adjust them if required.
2. Checking the RFC connections
After you copy the database, the target system has the same RFC connections as the source system; this may cause problems. Therefore, you must check the RFC connections in transaction SM59 and adjust them if required.
3. Checking the spool configuration
After you copy the database, the target system has the same spool configuration as the source system. Therefore, you must check the spool configuration in transaction SPAD and adjust it if required.
4. Changing the logical system name
If the SID of the ABAP system has changed, use transaction BDLS to change the logical system name.
5. Adjusting the SAP HANA calculation views
If you copied a BW system, you must adjust the SAP HANA calculation to the new system names views after the migration. This is done when calling the report RS_BW_POST_MIGRATION with all options.

Homogeneous system copy on SAP HANA without SWPN


Scenario

This SAP Note describes a scenario such as the following: You want to copy the BW system PRD connected to the database PR1 to the BW system DEV connected to the database DV1. The name of the ABAP schema in PR1 is SAPABAP1. Therefore, PRD is the source system (the system that is to be copied), PR1 is the source database (the database system that is to be copied), DEV is the target system (the copied system), and DV1 is the target database (the target database system). SAPABAP1 is the (database) schema (the schema name) or the database user of the system.

We will be doing this on SAP HANA 2.0 multi tenant database container ,

◉ Take the source system backup or finalize which backup need to be restored
◉ Collect the Schema user password of source database
◉ Move the backup to the target database ,

Login to the Target database HANA Studio,

Stop your tenant Database using SQL command -ALTER SYSTEM STOP DATABASE SID

Now right click on SYSTEMDB

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

and select the Recover Tenant database

Note:- Ensure that the target tenant database system is shut down. If you will not stop tenant database manually HANA studio will stop it automatically,

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

Select the tenant database you want to recover , there may few multiple tenant database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

SAP HANA Tutorials and Materials, SAP HANA Certification, SAP HANA Database

After the Restore your application will not start, You need to perform the steps as below

Changing the database information in the target system.

If the SID of the target system differs from that of the source system, the name of the database schema that the target system expects is also different. You must therefore adjust the database information.

If the application server of the target system does not on Windows (but instead on Linux, Unix, AIX, HP-UX, Solaris, and so on), open a command line on the computer of the target system as user<SID>adm, switch to the directory /usr/sap/<SID>/hdbclient and execute the following command:

hdbuserstore set default <dbhost>:<dbport> <dbuser> <dbpassword>

Note:- For tenant database you must put the indexserver port of the tenant database for which you want to do refresh

Replace the information in the angle brackets as follows:

<dbhost>: The host name of the target database server

<dbport>: The port of the target database Index server server

<dbuser>: The database user for the copied schema ( SAPABAP1)

<dbpassword>: The password of the database user (SAPABAP1 Password)

run

hdbuserstore list commad to check

You can now start the target system.
Now perform the post steps ,

1. Implement a new license

a) If the SID has changed, you must implement a new license that is valid for the new SID in the target system. You can use transaction SLICENSE to do this.

2. Execute ABAP reports

a) To update required information, you must execute the following reports, if available, as the user DDIC in client 000:

RSWBOINS

RUTCSADAPT (for table declustering, as of NW 7.40)

RADDBDIF

RUTTTYPSET

UMG_POOL_TABLE

RUTPOADAPT (for table depooling as of NW 7.40)

DBPROC_ACTIVATE_PROXIES (as of NW 7.40 Support Package 1)

b) In addition, execute the following function modules, if available:

SNHI_DELIVERY_UNIT_MIGRATION (activation of SAP HANA content, as of NW 7.40).

3. Additional adjustments

a) Check the secondary database connections

After you copy the database, the target system has the same database connections (for example, for the DBA Cockpit) as the source system; this may cause problems. Therefore, you must check the database connections in transaction DBCO and adjust them if required.

b) Check the RFC connections

After you copy the database, the target system has the same RFC connections as the source system; this may cause problems. Therefore, you must check the RFC connections in transaction SM59 and adjust them if required.

c) Check the spool configuration

After you copy the database, the target system has the same spool configuration as the source system. Therefore, you must check the spool configuration in transaction SPAD and adjust it if required.

d) Changing the logical system name

If the SID of the ABAP system has changed, use transaction BDLS to change the logical system name.

e) Adjusting the SAP HANA calculation views

The SAP HANA calculation views must be adjusted after migration to the new system name. This is done by calling the report RS_BW_POST_MIGRATION with all options.