Friday, April 11, 2025

How to reset System user password of Tenant DB and System DB

 Process to reset the system user password of the tenant:

1. Ensure that your tenant DB is offline. 

There are multiple ways to check it (HDB info, SELECT * FROM M_DATABASES; ==>Stastus active means running).

Process:

You need to run all the below commands from System DB

1. Login to system DB in HANA studio--> run the command ALTER SYSTEM STOP DATABASE <database_name>;

2. Go to SQL console of SYSTEM-DB and use command ALTER DATABASE <database_name> SYSTEM USER PASSWORD <new_password>; [Put your password in double quotes if you have special character in your password.]

3. Start the tenant database using command ALTER SYSTEM START DATABASE <database_name>;

4. It will ask you to change the password once you log in for the first time after resetting.

Process to reset System user password in System DB

 The system administrator can reset the password of any SYSTEM user if it has been irretrievably lost.

You must have the credentials of the operating system administrator (<sid>adm).

Shut down the instance by executing the following command:

/usr/sap/HDB/HDB<instance>/exe/sapcontrol -nr <instance> -function StopSystem HDB
or

HDB stop

Reset the system user: 

Now we will run the following commands to set the environment variables.

/usr/sap/<SID>/HDB<INSTANCE>/hdbenv.sh

Now we will start the name server with the option to reset the SYSTEM user password of SystemDB.

/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbnameserver -reserUserSystem



Now the name server will be started; it will prompt you to enter password and stop the name server

You can start the HANA system with the following command.

          "HDB start" OR "sapcontrol -nr <instanceNumber> -function StartSystem HDB"

No comments:

Post a Comment