Db2 SQLCODE

SQLCODE -567: Bind authorization error

SQLCODE -567 (SQLSTATE 42501) means a BIND, REBIND or FREE of a package failed because the authorization ID that owns the package lacks a privilege it needs, such as BINDADD, BIND, COPY or CREATE IN on the collection.

Other names for this code

Also written as SQL -567, SQLCODE=-567, SQLCODE = -567, db2 -567, sqlstate 42501, bind authorization error, authorization error using authority package.

What it means

Binding a package needs privileges, and Db2 for z/OS checks them against the package owner. The OWNER bind option sets the owner, and it defaults to the ID that runs the bind. If the owner lacks what the bind needs, Db2 rejects it with -567 and the package isn't bound, rebound or freed.

The message has four tokens. The bind type is BIND, REBIND or FREE. The auth ID is the package owner, or a role in a trusted context. The package is shown as location.collection.package.version. The privilege token says what was missing.

  • BINDADD is the system privilege to create a new package with BIND ACTION(ADD).
  • BIND is the package privilege needed to replace or rebind an existing package.
  • COPY is the package privilege needed to bind with the COPY option from another package.
  • CREATE IN is the privilege to create packages in a collection.

On Db2 for LUW and Db2 for i, SQLCODE -567 means something different. There it reports an authorization name that isn't valid or allowed, with SQLSTATE 42602.

Common causes

  • A new program is bound into a collection for the first time, and the owner has neither BINDADD nor CREATE IN on that collection.
  • OWNER names an ID or group that doesn't hold the privileges, often a production owner used from a test job.
  • Someone rebinds or replaces a package and the owner's BIND privilege on it was revoked or never granted.
  • A BIND COPY copies from a package the owner has no COPY privilege on.
  • A client binds packages remotely over DRDA, for example driver packages from a distributed application, with an ID that has no bind authority on z/OS.

How to find the problem

  1. Read the privilege and package tokens. They tell you exactly what's missing and where.
  2. Check BINDADD with SELECT GRANTEE, BINDADDAUTH FROM SYSIBM.SYSUSERAUTH WHERE GRANTEE = 'PAYOWNR'.
  3. Check CREATE IN on the collection in SYSIBM.SYSRESAUTH, and BIND or COPY on the package in SYSIBM.SYSPACKAUTH (columns BINDAUTH and COPYAUTH).
  4. Confirm which ID was the owner. Look for OWNER in the bind statement, and remember an existing package keeps its owner on REBIND unless you change it.
  5. If the owner is a RACF group, check that the binding user is connected to it.

How to fix it

  • Grant what the message names, for example GRANT BINDADD TO PAYOWNR, GRANT CREATE IN COLLECTION PAYCOLL TO PAYOWNR or GRANT BIND ON PACKAGE PAYCOLL.PAYCALC TO PAYOWNR.
  • Set OWNER to an ID or group that holds the bind privileges for that collection.
  • For client driver packages, have a DBA with the right authority bind them once.
  • Ask the DBA how the BIND NEW PACKAGE subsystem setting is configured. It controls whether BIND privilege on a package is enough to add new versions of it, or whether BINDADD is also needed.

IBM documentation

IBM documentation: -567. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Why does the message show an ID that isn't mine?

Db2 checks the package owner, not necessarily the person running the bind. If OWNER was coded, or the package already existed, the owner can be a different ID or group.

I got SQL0567N on Db2 for LUW. Is it the same problem?

No. On LUW and IBM i, -567 means an authorization name isn't valid or allowed, SQLSTATE 42602. The bind privilege meaning described here is specific to Db2 for z/OS.

Do I need BINDADD and CREATE IN?

Adding a new package needs BINDADD and the right to create packages in that collection. Replacing or rebinding an existing one needs BIND on the package.