Solved

Restoring SAP HANA Tenant database shows Error Code 18:146

  • 8 November 2023
  • 6 replies
  • 197 views

Badge +7

Im trying to restore tenant database to our HANA DR server but I’m getting Error Code 18:146 Failed to check and create tenant database. If doesn’t exist please create an empty tenant database and retry.

I checked with the SAP BASIS consultant and confirmed that tenant databases do exist in the HANA DR server.

I was able to restore the SYSTEMDB.

Any help is much appreciated.

icon

Best answer by ElmerT 12 November 2023, 12:39

View original

6 replies

Userlevel 4
Badge +12

Hi @ElmerT 

 

Could you have the DBA run the following command as SIDadm

 

hdbsql -u BACKUP -C “select * from "SYS"."M_DATABASES"

 

hdbsql -U BACKUP -C "ALTER SYSTEM STOP DATABASE <TNT_NAME>"

 

If this works then please attach the clHanaAgent.log 

 

Badge +7

Hi @Gowri Shankar 

commands have been run and the tenant databases are stopped. Attached is the ClHanaAgent.log.

 

 

 

Badge +7

Issue was fixed last Thursday, November 9, 2023. HDBUSERSTORE key recreated.

Badge +7

Unfortunately, upon doing another test restore the issue surfaces again.

I have verified the HDBUSERSTORE key is still present.

Checking ClHanagAgent.log, it is still showing 

45861 b325 11/13 17:07:22 1477399 ClHanaAgent::createTenantDbIfNotThere() - Creating the Tenant database [E01] ... [/usr/sap/JH1/HDB00/exe/hdbsql -U BACKUP "CREATE DATABASE E01 SYSTEM USER PASSWORD ******" 2>&1]
45861 b325 11/13 17:07:22 1477399 ClHanaAgent::createTenantDbIfNotThere() - <* 10: authentication failed SQLSTATE: 28000

The password is different from what I set in the HDBUSERSTORE key.

Any help would be appreciated.

 

 

Badge +7

Performed another test restore today I was able to restore the SYSTEMDB but when restoring the tenant database I’m getting the same error. HDBUSERSTORE key is already present but the restore overwrites it and assigns a different password for the SYSTEM user then it tries to create the tenant database using the previous password which then results to “authentication failed SQLSTATE:28000”.

Why does the restore overwrites the existing HDBUSERSTORE key? What was the new password for the SYSTEM user?

57814 e1d6 11/15 17:17:57 1426114 CvProcess::system() - /usr/sap/JH1/HDB00/exe/hdbuserstore List BACKUP 2>&1
57814 e1d6 11/15 17:17:57 1426114 CvProcess::system() - Command completed with rc=0
57814 e1d6 11/15 17:17:57 1426114 ClHanaAgent::createHdbStoreKey() - HDB Store key [BACKUP] exists. Still overwriting.
57814 e1d6 11/15 17:17:57 1426114 ClHanaAgent::createHdbStoreKey() - createBackupKeyCmd=</usr/sap/JH1/HDB00/exe/hdbuserstore -i set BACKUP jg-hanadr.jaidah.local:30013,jg-hanadr.jaidah.local:30015 SYSTEM '********'>
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::SwitchUserAndSetEnv() - Change user=jh1adm, gid=101, uid=1001
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::SwitchUserAndSetEnv() - Current uid = [0]gid = [0]
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::setEnvironment() - Not setting HANA environment variables as nSetHANAEnv is not set
57814 e1d6 11/15 17:17:59 1426114 JOBRESCACHEDIR: job 1426114 creating '/opt/commvault/iDataAgent/jobResults/CV_JobResults/2/0/1426114'
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::ExecuteRestore() - Successfully retrieved jobResultsDir=[/opt/commvault/iDataAgent/jobResults/CV_JobResults/2/0/1426114]
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::GetHanaVersionUsingHDB() - <HDB version info:
>
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::GetHanaVersionUsingHDB() - <  version:             2.00.070.00.1679989823
>
57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::GetHanaVersionUsingHDB() - verNum=<20007000>
57814 e1d6 11/15 17:17:59 1426114 ::checkSymbolicLinksForBackint() - Got Simpana installation directory=[/opt/commvault] Simpana backint path=[/opt/commvault/iDataAgent/backint]
 

57814 e1d6 11/15 17:17:59 1426114 ClHanaAgent::ExecuteRestore() - Starting the Instance [JH1] ... [/usr/sap/JH1/HDB00/HDB start 2>&1]
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::ExecuteRestore() - Started the Instance [JH1] successfully
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::updateGlobalIni() - Failed to rename the file </usr/sap/JH1/SYS/global/hdb/custom/config/DB_E01/global.ini> to </usr/sap/JH1/SYS/global/hdb/custom/config/DB_E01/global.ini.prev>
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::getTenantDBList() - hanaCmd=</usr/sap/JH1/HDB00/exe/hdbsql -U BACKUP -C  "Select DATABASE_NAME,ACTIVE_STATUS,OS_USER,OS_GROUP from M_DATABASES">
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::createTenantDbIfNotThere() - Creating the Tenant database [E01] ... [/usr/sap/JH1/HDB00/exe/hdbsql -U BACKUP "CREATE DATABASE E01 SYSTEM USER PASSWORD Pa55w0rdDR" 2>&1]
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::createTenantDbIfNotThere() - <* 10: authentication failed SQLSTATE: 28000
>
57814 e1d6 11/15 17:18:09 1426114 ClHanaAgent::createTenantDbIfNotThere() - Failed to create the tenant databse [E01]. Please create manually and retry.
 

Any suggestions?

 

 

Badge +7

issue resolved.

Reply