I have installed DB2 10.1 in a Red hat box. During the installation I was asked to create several users (db2inst1, db2fenc1 etc). I have been using db2inst1 to perform all operations with DB2 and it works perfectly fine. The sqllib files are located in
/home/db2inst1/sqllib
The installation files are located in
/opt/ibm/db2/V10.1/
All users have access to both these folders. I now want to perform the DB2 operations with another user, namely "john". Given that db2 uses the underlying user/password of the host machine, I added the groups dasadm1 and ds2iadm1 to the "john" user (which are the ones listed in db2inst1).
uid=500(john) gid=500(john) groups=500(john),101(dasadm1),102(db2iadm1)
I can properly enter the db2 cmd with the user "john"
[john@rhel6 java]$ /home/db2inst1/sqllib/bin/db2
but when I run my java app as user "john" I get the following error:
SQLException: com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.13.127] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: db2jcct2 (Not found in java.library.path): ERRORCODE=-4472, SQLSTATE=null
this error does not appear if I run the same java app as user db2inst1. The library paths are the exactly the same for both users. Any idea what is going wrong?
db2iadm1
anddasadm1
will provide elevated (SYSADM
) privileges – you probably do not want to do that unless the user account is for a DBA. Grant general user access either directly to the user IDs or using either operating system groups or database roles.