DATABASE ADMIN GUID
XS ADMIN/ COCKPIT_ADMIN User locked?
SAP HANA XS Tips
You’ve probably heard of SAP HANA COCKPIT if you’ve ever utilized SAP HANA applications. When it comes to monitoring or management of distant databases, it’s properly designed. On top of XS advanced a.k.a XSA , you can also create bespoke applications.
Returning to the topic now.
If you can’t login to the database user with a known password, there’s no way to change it right now (that I’m aware of). If you are aware of admin credentials, simply issue-
xyzadm@hana–01:/usr/sap/XYZ/HDB96> xs-admin-login
Enter password for XSA admin user ‘COCKPIT_ADMIN’:API_URL: https://hanahost.xyzdomain.com:39630
USERNAME: COCKPIT_ADMIN
Authenticating…
Authentication failed: Bad credentials
Executing login failed: Execution ended with return code: 1
The credentials are invalid in the above situation. If you’re the SYSTEM or an admin user (with USER ADMIN privilege), the quickest approach to fix this is to reset the user with new credentials.
Connect to the database (this is necessary in order to reset the target user credential), and execute-
alter user <cockpit_admin> password “hello@1234”;
Voila! That is all there is to it. With the changed credentials, you can reconnect to the cockpit UI. With the updated password, the xs-admin-login command from the OS terminal should also work ☺️
Finally, you may be wondering why the user credential was initially incorrect. You won’t be able to uncover the root cause until someone tells you who modified it, or unless you look at the OS history (very less chance of finding cause). To figure this out next time, enable database auditing so you’ll know who changed it and when (albeit it won’t tell you what’s new credential because auditing data on credentials is masked and can’t be cracked 😉 )
The game is to figure out how to enable audits for such activities. See my earlier blog — SAP HANA Database Auditing
I’d love to hear whether this topic impacted your life, if there’s any area for improvement, or anything else!