Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » User and database security » User security (roles and privileges) » Roles » Compatibility roles

 

Restoring a compatibility role (SQL)

Restores a compatibility role that has been migrated or dropped. This method cannot be used to restore any other kinds of roles.

Prerequisites

You must have the MANAGE ROLES system privilege and have administrative rights on all of the system privileges granted to the role being restored. For example, to restore the SYS_AUTH_BACKUP_ROLE compatibility role, you must have the MANAGE ROLES system privilege, and administrative rights on the BACKUP DATABASE system privilege.

Context and remarks

You can restore compatibility roles that are no longer in the database. Restoring one of these roles can be helpful to remember the privileges the original role had or to migrate them to user-defined roles.

If you migrated the compatibility role (causing it to be dropped), grantees of the role were automatically granted the new user-defined role you migrated it to. Restoring a compatibility role does not restore the grantees back to the compatibility role. They remain grantees of the user-defined role you created.

 Task
  • Execute a CREATE ROLE statement similar to the following, where role-name is the name of the role:

    CREATE ROLE role-name;

Results

The role is restored. Administrative privileges on the restored role are automatically granted to the SYS_AUTH_DBA_ROLE system role if it still exists in the database.

When you restore the SYS_AUTH_DBA_ROLE system role, the SYS_AUTH_SA_ROLE and SYS_AUTH_SSO_ROLE system roles are automatically restored as well.

Example

The following example restores the SYS_AUTH_BACKUP_ROLE compatibility role and sets the user TomW as the administrator (only):

CREATE ROLE SYS_AUTH_BACKUP_ROLE;

The following example restores the SYS_AUTH_DBA_ROLE, SYS_AUTH_SA_ROLE, and SYS_AUTH_SSO_ROLE system roles:

CREATE ROLE SYS_AUTH_DBA_ROLE;

 See also