Authorities and privileges for view tasks


Task Authorities and privileges
To alter a view You must either be the definer of the view as recorded in the DEFINER column of the SYSCAT.VIEW catalog view, or have one of the following privileges:
  • SYSADM or DBADM authority
  • ALTERIN privilege on the view schema
  • CONTROL privilege on the view
To create a view You must have either:
  • SYSADM or DBADM authority
  • Both
    • One of the following privileges for each table or view:
      • CONTROL privilege on the table or view
      • SELECT privilege on the table or view
    • One of the following privileges for each table or view:
      • IMPLICIT_SCHEMA authority on the database, if the implicit or explicit schema name of the view does not exist
      • CREATEIN privilege on the schema, if the schema name of the view exists

PUBLIC and group privileges are not checked for any table or view specified in the CREATE VIEW statement. If you create a view and you have only SYSADM authority, you are explicitly granted DBADM authority.

To drop a view You must either be the definer as recorded in the DEFINER column of SYSCAT.VIEW, or have at least one of the following authorities:
  • SYSADM or DBADM
  • DROPIN privilege on the schema for the view
  • CONTROL privilege on the view
To grant and revoke privileges on a view You need the proper authorizations:
  • To grant and revoke privileges on a catalog view, you need either SYSADM or DBADM authority.
  • To grant and revoke privileges on a user-defined view, you need to meet the following requirements:
    • To grant and revoke the CONTROL privilege, you need SYSADM or DBADM authority.
    • To grant privileges other than CONTROL, you need one of the following authorizations. To revoke privileges other than CONTROL, you need one of the first three of these authorizations.
      • SYSADM authority
      • DBADM authority
      • The CONTROL privilege on the view
      • The privilege that you want to grant, along with the Grant option (the right to grant the privilege to other users and groups)

      Example

      You can grant the ALTER privilege on a user-defined view if you hold one of these authorizations:

      • SYSADM authority
      • DBADM authority on the database in which the view resides
      • The CONTROL privilege on the view
      • The ALTER privilege, along with the right to grant the ALTER privilege on this view to other users and groups
To show related views You must have one of the following privileges:
  • SYSADM or DBADM authority
  • SELECT privilege on the system catalog views