1
 ls -al /home/dmsinst1/sqllib/adm/db2start
-r-sr-sr-x 1 root dmsiadm1 93613 Jun 26 14:14 /home/dmsinst1/sqllib/adm/db2start


 ls -al /home/bpminst1/sqllib/adm/db2start
-r-sr-sr-x 1 root bpmiadm1 93613 Jun 26 14:15 /home/bpminst1/sqllib/adm/db2start


groups dmsinst1
dmsinst1 : dmsiadm1

groups bpminst1
bpminst1 : bpmiadm1

So, when running the following script as root:

#!/bin/bash

su bpminst1 -c "/home/bpminst1/sqllib/adm/db2start"
su dmsinst1 -c "/home/dmsinst1/sqllib/adm/db2start"

I get:

[root@dmsnl857-vm ~]# ./startAll.sh 
SQL1092N  The requested command or operation failed because the user ID does not have the authority to perform the requested command or operation.  User ID: "BPMINST1".
06/29/2017 09:16:03     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.

The second command is apparently executed without errors.

update: with set -x

[root@dmsnl857-vm ~]# ./startAll.sh 
+ echo 'Starting BPM DB2 instance ... '
Starting BPM DB2 instance ... 
+ su bpminst1 -c /home/bpminst1/sqllib/adm/db2start
SQL1092N  The requested command or operation failed because the user ID does not have the authority to perform the requested command or operation.  User ID: "BPMINST1".
+ echo 'Starting DMS DB2 instance ... '
Starting DMS DB2 instance ... 
+ su dmsinst1 -c /home/dmsinst1/sqllib/adm/db2start
06/29/2017 09:44:13     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
  • It is not clear to me that the log output refers to first the first invocation and then to the second. I'm unfamiliar with the database you are using. Can't all log output that you show come from only the first invocation? Could you run the script with set -x at the top? – Kusalananda Jun 29 '17 at 9:29
  • The number in the question text is the size of the file. You would have to use ls -i to see the inode numbers. – Kusalananda Jun 29 '17 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.