a role is (almost) a user in oracle

March 12, 2013 — 1 Comment

in postgresql there is the “create role” command to create both: a role and a user. in oracle there is “create user” and “create role”. but in the background it is almost the same:

SQL> create role my_role;

Role created.

SQL> create user u identified by u;

User created.

SQL> select name, type# from user$ where name in ('MY_ROLE','U');

NAME				    TYPE#
------------------------------ ----------
MY_ROLE 				0
U					1

it is the type, that matters.

Trackbacks and Pingbacks:

  1. can you tell which id a new user will get in oracle? « Daniel Westermann's Blog - January 8, 2015

    […] described previously all roles and users are stored in the user$ […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.