Technology Blog Posts by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
shalabhkumar
Discoverer
1,197

Source System Details.                               Target System Details.

DB SID HXP.                                                DB SID is HXD.

Kumarshalabh_0-1744866979706.png

 

Prerequisites--- 1.   root key password require.  2.  HANA Studio require.

We are restoring HXP backup in HXD system, but we don’t have root key then how to restore backup in Target (HXD) HANA DB.

Facing the error message below in HANA Studio while restoring backup in HANA HXD.

Kumarshalabh_2-1744867448376.png

Backup rootkey 3ef7cae23ce897c7748807d98689abc1bfd3d265654140b244b4ae8918c6e096 is required for decryption of backup files, but not found in key store. Please make sure you have provided the necessary keys before

recovery.,

No root key matching hash=3ef7cae23ce897c7748807d98689abc1bfd3d265654140b244b4ae8919c6e096

Reason is During the HANA DB installation below option selected Yes and HXP backup was taken with encryption key.

Kumarshalabh_3-1744867510651.png

While restore HANA DB backup in Target system you have to provide root key password other wise backup will not restore and throw the error.

Source System Step (HXP)

Solution

Step 1. 

Login to the source system (HXP) at os level and go below path.

Take the backup of the ssfs keys.

Kumarshalabh_4-1744867626128.png

We have taken backup with ssfs_backup

Step 2.

Login in Source DB HXP and run below query in HANA Studio.

From SYSTEM DB we need to run below query.

We need to set ENCRYPTION root key password.

ALTER SYSTEM SET ENCRYPTION ROOT KEYS BACKUP PASSWORD (password)

Kumarshalabh_5-1744867678399.png

Step 3.

Now Validate the password from below query in HANA Studio.

ALTER SYSTEM VALIDATE ENCRYPTION ROOT KEYS BACKUP PASSWORD (password)

Kumarshalabh_6-1744867731555.png

Step 4.

Now run this query for checking DB ID in tenant DB.

SELECT DATABASE_NAME, 
	CASE WHEN (DBID = '' AND 
	DATABASE_NAME = 'SYSTEMDB') 
	THEN 1
	WHEN (DBID = '' AND 
	DATABASE_NAME <> 'SYSTEMDB') 
	THEN 3
	ELSE TO_INT(DBID)
	END DATABASE_ID 
FROM (SELECT DISTINCT DATABASE_NAME, SUBSTR_AFTER (SUBPATH,'.') AS DBID FROM SYS_DATABASES.M_VOLUMES);

Kumarshalabh_7-1744867807239.png

HXP DB ID is 3.

Step 5.

Login in source system HXP at os level and take the Backup of root keys.

hdbnsutil -backupRootKeys /backup/backup/rootkey/rootkey_HXP.rkb --dbid=3 --type='BACKUP'

We used here dbid 3 which we checked in Tenant DB earlier screen shot.

Kumarshalabh_8-1744867861074.png

Step 6.

Login to source system  os level validate root keys.

Kumarshalabh_9-1744867887128.png

This is rootkey location and root key copy from HXP to HXD.

/backup/backup/rootkey

Kumarshalabh_10-1744867915013.png

Note: Copy the rootkey_HXP.rkb file from HXP (Source ) to HXD (Target)

Target System Step (HXD)

Step 7.  (HXD Target DB)

Check the encryption status

Login in Target system in SYSTEM DB and run below query in HANA Studio.

SELECT * FROM SYS_DATABASES.M_ENCRYPTION_OVERVIEW

Encryption Status TRUE Coming. It means now Encryption is ok and we can restore backup easlily.

Kumarshalabh_11-1744867976990.png

Step 8.

Login to target system (HXD) SYSTEMDB and Check the DBID with below query in HANA Studio.

       

SELECT DATABASE_NAME, 
	CASE WHEN (DBID = '' AND 
	DATABASE_NAME = 'SYSTEMDB') 
	THEN 1
	WHEN (DBID = '' AND 
	DATABASE_NAME <> 'SYSTEMDB') 
	THEN 3
	ELSE TO_INT(DBID)
	END DATABASE_ID 
FROM (SELECT DISTINCT DATABASE_NAME, SUBSTR_AFTER (SUBPATH,'.') AS DBID FROM SYS_DATABASES.M_VOLUMES);

      We can see DB ID 3 same coming which was coming in HXP (Source DB )

Kumarshalabh_12-1744868135090.png

DB ID is 3.

Step 9.

Login to target system HXD os level and take the backup of ssfs keys.

Kumarshalabh_13-1744868162319.png

We have taken backup with ssfs_backup.

Step 10.

Login to target system (HXD) SYSTEMDB and Stop tenant DB.

Kumarshalabh_14-1744868184104.png

Step 11.

Login to target system (HXD) OS level and Import the root keys which we export from HXP system.

Go to same location /backup/backup/rootkey and run below command for import

/backup/backup/rootkey

hdbnsutil -recoverRootKeys rootkey_HXP.rkb --dbid=3 --password="password" --type='BACKUP'

Kumarshalabh_15-1744868214366.png

Step 12.

Now you can start Restore again it will work.

Kumarshalabh_18-1744868961393.png

Kumarshalabh_19-1744868986605.png

Thanks for watching it. 😊

 

Labels in this area