Article

What are the minimum DB2 permissions needed for a user to create packages?

« Go Back

Information

 
Article Number000023324
EnvironmentProduct: Connect for ODBC DB2 driver, Connect for JDBC DB2 driver, Connect for ADO.NET DB2 provider
Version: All supported versions
OS: All supported platforms
Databases: DB2
Application: All supported applications
Question/Problem Description
What are the minimim DB2 permissions needed for a user to create packages?
Is that the same across DB2 versions & UDB/390/400?
 
Steps to Reproduce
Clarifying Information
DataDirect Connect drivers automatically create and bind DB2 packages for use on the DB2 server. To do this, the initial connection requires certain database permissions.
Error MessageAUTHORIZATION ERROR BIND accountname
Bind process is not active. Please ensure that the user has permissions to create packages. Packages cannot be created in an XA Connection.
Defect/Enhancement Number
Cause
Resolution
The Connect Series for ODBC User's Guide lists these permissions as necessary to create the DB2 packages:
  • BINDADD for binding packages
  • CREATEIN on the collection specified by the Package Collection option
  • GRANT EXECUTE on the PUBLIC group for executing the packages
In more detail:
  • For DB2 on OS/390 or MVS, you need one of the following authorities:

    SYSADM,
    SYSCTRL


    or BINDADD and CREATE IN COLLECTION your-collection. You need the CREATE IN authority only if you only have the BINDADD authority.
  • For DB2 for OS/400, you need CHANGE authority or higher on the collection where you want to create your package.
  • For DB2 on Windows, UNIX, & Linux, you need DBADM authority.  If you do not, someone that has a user ID with DBADM privileges needs to create packages by connecting with the driver.

To set authorities for a specific user, type the following at a DB2 command prompt:

GRANT DBADM, CREATETAB, BINDADD, CONNECT ON DATABASE TO USER (username)

Replace (username) with the name of the user ID that you use to log on with when using the driver.

Workaround
Request that your DBA make the initial connection. Once the initial connection is made with a user with the appropriate permissions, all database users will be able to connect to the database.
Notes
If a second connection is made that requires the packages to be rebound and an existing connection is currently using the packages, the second connection attempt will likely fail while attempting to drop the package that is in use (like attempting to drop a table that has a lock on it).  However, some of the packages may have been successfully dropped so the first connection may also encounter problems.  This situation should be avoided.
Attachment 
Last Modified Date5/25/2016 2:54 PM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025