Changing object ownership
You can make a Db2 role, a primary authorization ID, or a secondary authorization ID the owner of an object. You can change the ownership from one user to another or from an authorization ID to a role.
About this task
Object ownership carries with it a set of privileges on the object. Because owner privileges are implicit, you cannot revoke them from the current owner. You can manage implicit ownership privileges in one of the following ways:
- Transfer the ownership of an existing object from one user to another.
FL 509 You can issue the TRANSFER OWNERSHIP statement to transfer the ownership of a database object, system object, or application object from one user to another.
The new owner can be an authorization ID or a role. For more information, see TRANSFER OWNERSHIP statement.
FL 509 The following types of application objects can be transferred by TRANSFER OWNERSHIP statements: - Functions
- Procedures
- Sequences

- Change the ownership of an existing object from an authorization ID to a role. If the owner of an object is a role, all users that are associated with the role have the same owner privileges. You can change the current owner from an authorization ID to a role by using the CATMAINT UPDATE utility with the OWNER option. To do so, you must also have the installation SYSADM authority and define a trusted context with the ROLE AS OBJECT OWNER AND QUALIFIER clause. For more information, see Changing the ownership of objects from an authorization ID to a role.
- Assign the ownership of a new object to a role. You can make a role the owner of an object by creating the object in a trusted context that is defined with the ROLE AS OBJECT OWNER AND QUALIFIER clause. For more information, see Ownership of objects within a trusted context.
- Assign the ownership of a new object to a secondary authorization ID. You can make the object owning ID a secondary ID with which several primary IDs are associated. You can change the list of primary IDs that are associated with the secondary ID without dropping and re-creating the object.