Example documentationROLES Locate this document in the navigation structure

 

Use of the system tableDOMAIN.ROLES

Prerequisites

You can use the demo data for the SQL tutorial. Start the Database Studio as database administrator MONA with the password RED and log on to demo database DEMODB: Logging On to a Database.

Define and use roles. Proceed as described in SQL Tutorial, Roles.

Activities

You can use Database Studio to enter and execute SQL statements. More information: Working with SQL Statements: Overview

Note the General Instructions for formulating SQL statements.

You can use the system table ROLES to determine the following database information, among other things:

  • All roles for which it is necessary to enter a password to activate them

    SELECT owner, role

    FROM DOMAIN.ROLES

    WHERE password_required = 'YES'

  • Role of the current database user that is automatically activated when a database session is opened

    SELECT role

    FROM DOMAIN.ROLES

    WHERE defaultrole = 'YES'

More Information

All active roles in the current database session: see SESSION_ROLES

Role privilege: see ROLEPRIVILEGES