cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset HANA sidadm user envrioment?

Former Member
0 Kudos

Hi all,

Please help me to solved a strange peoblem.

The hana prd system`s sidadm user envrioment has been changed after upgrade by command"./hdbupd".

e.g:

right status:

hanad01:/#su - hd1adm

hanad01:/usr/sap/HD1/HDB00>

Wrong status:

hanap01:/#su - hp1adm

hanap01:~>

I can not run any hana command as hana user:

hanap01:~>HDB ?

-sh:HDB : command not found

So could you please let me know how to check and correct this problem?

Best regards,

william

Accepted Solutions (1)

Accepted Solutions (1)

former_member182967
Active Contributor
0 Kudos

Hello Wei Zhang,

I don't know why you face this kind of problem.

1. Please check if the home directory of user sidadm is /usr/sap/SID/home (cat /etc/passwd) and the directory /usr/sap/SID/home exists or not.

2. After you executing su - sidadm, the directory you locate should be /usr/sap/SID/HDBnn, please check.

When you run su - sidadm, it run .profile -> .bashrc -> .sapenv.sh ( in last several lines, change to directory /usr/sap/SID/HDBnn)

3. Please check the environment variable PATH of user sidadm, it should direct to (SID, hostname, HDBnn according to your environment)

/usr/sap/SID/HDBnn/hostname:/usr/sap/SID/HDBnn:/usr/sap/SID/HDBnn/exe:/usr/sap/SID/HDBnn/exe/Python/bin:/usr/sap/SID/HDBnn/exe/dat_bin_dir:.:/usr/sap/SID/home:/usr/sap/SID/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin

Hope it helps.

Regards,

Ning

Former Member
0 Kudos

Hello Ning Tong,

Thanks a lot for your reply!

system check as your description:

1\cat /etc/passwd

right system inf:

hanad01:/ # cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

bin:x:1:1:bin:/bin:/bin/bash

daemon:x:2:2:Daemon:/sbin:/bin/bash

lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash

mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false

games:x:12:100:Games account:/var/games:/bin/bash

wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false

ftp:x:40:49:FTP account:/srv/ftp:/bin/bash

nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash

messagebus:*:100:101:User for D-Bus:/var/run/dbus:/bin/false

haldaemon:*:101:102:User for haldaemon:/var/run/hald:/bin/false

sshd:*:71:65:SSH daemon:/var/lib/sshd:/bin/false

man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash

news:x:9:13:News system:/etc/news:/bin/bash

uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash

uuidd:x:102:104:User for uuidd:/var/run/uuidd:/bin/false

puppet:x:103:106:Puppet daemon:/var/lib/puppet:/bin/false

at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash

postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false

polkituser:x:104:107:PolicyKit:/var/run/PolicyKit:/bin/false

ntp:x:74:108:NTP daemon:/var/lib/ntp:/bin/false

nginx:x:105:109:user for nginx:/var/lib/nginx:/bin/false

pulse:x:106:110:PulseAudio daemon:/var/lib/pulseaudio:/bin/false

yastws:x:107:113:User for YaST-Webservice:/var/lib/yastws:/bin/false

suse-ncc:x:108:114:Novell Customer Center User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash

gdm:x:109:115:Gnome Display Manager daemon:/var/lib/gdm:/bin/false

hd1adm:x:1000:79:SAP HANA Database System Administrator:/usr/sap/HD1/home:/bin/sh

daaadm:x:1002:79:SAP System Administrator:/home/daaadm:/bin/csh

sapadm:x:1003:79:SAP System Administrator:/home/sapadm:/bin/false

hq1adm:x:1001:79:SAP HANA Database System Administrator:/usr/sap/HQ1/home:/bin/sh

wrong system inf:

hanap01:/ # cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

bin:x:1:1:bin:/bin:/bin/bash

daemon:x:2:2:Daemon:/sbin:/bin/bash

lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash

mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false

games:x:12:100:Games account:/var/games:/bin/bash

wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false

ftp:x:40:49:FTP account:/srv/ftp:/bin/bash

nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash

messagebus:*:100:101:User for D-Bus:/var/run/dbus:/bin/false

haldaemon:*:101:102:User for haldaemon:/var/run/hald:/bin/false

sshd:*:71:65:SSH daemon:/var/lib/sshd:/bin/false

man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash

news:x:9:13:News system:/etc/news:/bin/bash

uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash

uuidd:x:102:104:User for uuidd:/var/run/uuidd:/bin/false

puppet:x:103:106:Puppet daemon:/var/lib/puppet:/bin/false

at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash

postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false

polkituser:x:104:107:PolicyKit:/var/run/PolicyKit:/bin/false

ntp:x:74:108:NTP daemon:/var/lib/ntp:/bin/false

nginx:x:105:109:user for nginx:/var/lib/nginx:/bin/false

pulse:x:106:110:PulseAudio daemon:/var/lib/pulseaudio:/bin/false

yastws:x:107:113:User for YaST-Webservice:/var/lib/yastws:/bin/false

suse-ncc:x:108:114:Novell Customer Center User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash

gdm:x:109:115:Gnome Display Manager daemon:/var/lib/gdm:/bin/false

hp1adm:x:1000:79:SAP HANA Database System Administrator:/usr/sap/HP1/home:/bin/sh

daaadm:x:1001:79:SAP System Administrator:/home/daaadm:/bin/csh

sapadm:x:1002:79:SAP System Administrator:/home/sapadm:/bin/false

2\more .profile\.sapenv.sh\.bashrc:

right system inf:

hanad01:/ # find / -name .sapenv.sh -print

/usr/sap/HQ1/home/.sapenv.sh

/usr/sap/HD1/home/.sapenv.sh

/home/daaadm/.sapenv.sh

hanad01:/ # find / -name .profile -print

/etc/skel/.profile

/usr/sap/HQ1/home/.profile

/usr/sap/HD1/home/.profile

/home/sapadm/.profile

/home/daaadm/.profile

hanad01:/ # find / -name .bashrc -print

/etc/skel/.bashrc

/usr/sap/HQ1/home/.bashrc

/usr/sap/HD1/home/.bashrc

/home/sapadm/.bashrc

/home/daaadm/.bashrc

hanad01:/ #

wrong system inf:

hanap01:/ # find / -name .sapenv.sh -print

/home/daaadm/.sapenv.sh

hanap01:/ #  find / -name .profile -print

/etc/skel/.profile

/home/daaadm/.profile

/home/sapadm/.profile

hanap01:/ #  find / -name .bashrc -print

/etc/skel/.bashrc

/home/daaadm/.bashrc

/home/sapadm/.bashrc

hanap01:/ #

I  think the system prd lost some key files ,do you know how to recreate it ?

best regards,

zhang wei

Former Member
0 Kudos

Hello zhang wei,

Ning Tong has already given a nice explanation of the logon process flow and pointed you in the right direction.

What bothers me about all of this is that this is the second message I have seen this week where the sidadm environment has been lost. I would open a message with SAP to try and understand how and why this has occurred.

That said, in order for you to move forward you can proceed as follows:

/usr/sap/HP1/home/.profile (copy from another HDB user account - no editing required)

/usr/sap/HP1/home/.bashrc (copy from another HDB user account - no editing required)

/usr/sap/HP1/home/.sapsrc.sh (copy from another HDB user account - no editing required)

/usr/sap/HP1/home/.sapenv.sh (copy from another HDB user account - Set  SAPSYSTEMNAME=HP1)

For the sake of completeness, I would do the same for the .csh as well.

Give or take a little variance, the contents of /usr/sap/HP1/home would look similar to the following (cross checking on your system HD1/HQ1)

.bash_history

.bashrc

.cshrc

.customer.sh

.emacs

.fonts

.gnu-emacs

.hdb

.inputrc

.kshrc_history

.lesshst

.mozilla

.muttrc

.profile

.sapenv.csh

.sapenv.sh

.sapsrc.csh

.sapsrc.sh

.sdb

.ssh

.viminfo

.vimrc

.xim.template

.xinitrc.template

bin

Once you've made the changes, logoff and logon again as hp1adm.

Kindest Regards,

Amerjit

Former Member
0 Kudos

Hi Ning Tong,

Thanks very much for your help,the problem has been solved.

Best regards,

zhang wei

Former Member
0 Kudos

Hello Amerjit CHAHAL,

I am very glad to receive your reply,and the problem has been solved because of your help.

Best regards,

Zhang wei

Answers (0)