DB2 Version 10.1 for Linux, UNIX, and Windows

OBJECTOWNERS administrative view - Retrieve object ownership information

The OBJECTOWNERS administrative view returns all object ownership information for every authorization ID of type USER that owns an object and that is defined in the system catalogs from the currently connected database.

The schema is SYSIBMADM.

Authorization

One of the following authorizations is required:
  • SELECT privilege on the OBJECTOWNERS administrative view
  • CONTROL privilege on the OBJECTOWNERS administrative view
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority

Default PUBLIC privilege

In a non-restrictive database, SELECT privilege is granted to PUBLIC when the view is automatically created.

Example

Retrieve all object ownership information for object schema 'THERESAX'.
SELECT SUBSTR(OWNER,1,10) AS OWNER, OWNERTYPE,
   SUBSTR(OBJECTNAME,1,30) AS OBJECTNAME,
   SUBSTR(OBJECTSCHEMA,1,10) AS OBJECTSCHEMA, OBJECTTYPE
   FROM SYSIBMADM.OBJECTOWNERS WHERE OBJECTSCHEMA='THERESAX'
The following is an example of output for this query.
OWNER      OWNERTYPE OBJECTNAME           OBJECTSCHEMA OBJECTTYPE
---------- --------- -----------------... ------------ ----------------
THERESAX   U         MIN_SALARY           THERESAX     TRIGGER
THERESAX   U         POLICY_IR            SYSTOOLS     TRIGGER
THERESAX   U         CUSTOMER             THERESAX     XML SCHEMA
THERESAX   U         DB2DETAILDEADLOCK                 EVENTMONITORS
THERESAX   U         SAMPSEQUENCE         THERESAX     SEQUENCE
THERESAX   U         SQLE0F00             NULLID       PACKAGE
...
THERESAX   U         HI_OBJ_UNIQ          SYSTOOLS     TABLE CONSTRAINT

  257 record(s) selected.

Information returned

Table 1. Information returned by the OBJECTOWNERS administrative view
Column name Data type Description
OWNER VARCHAR(128) Authorization ID that owns this object.
OWNERTYPE VARCHAR(1) Authorization ID type:
  • U: user
  • S: system
OBJECTNAME VARCHAR(128) object_name - Object name monitor element
OBJECTSCHEMA VARCHAR(128) object_schema - Object schema monitor element
OBJECTTYPE VARCHAR(24) Database object type.