Oracle用户及角色的权限管理[Oracle基础]

1.查看所有用户:

select * from dba_users;

select * from all_users;

select * from user_users;

2.查看用户或角色系统权限(直接赋值给用户或角色的系统权限):

select * from dba_sys_privs;

select * from user_sys_privs;

3.查看角色(只能查看登陆用户拥有的角色)所包含的权限

sql>select * from role_sys_privs;

4.查看用户对象权限:

select * from dba_tab_privs;

select * from all_tab_privs;

select * from user_tab_privs;

5.查看所有角色:

select * from dba_roles;

6.查看用户或角色所拥有的角色:

select * from dba_role_privs;

select * from user_role_privs;

7.查看哪些用户有sysdba或sysoper系统权限(查询时需要相应权限)

SQL> select * from dba_role_privs where grantee=‘CX_ZJ_ROS‘;                  -------------用户所拥有的角色

GRANTEE      GRANTED_ROLE   ADM  DEF

----------  --------------- ----- ----

CX_ZJ_ROS ZHRO NO  YES

SQL> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE=‘ZHRO‘;       --------这里查询的是用户和自定义角色所拥有的权限

GRANTEE   PRIVILEGE      ADM

-------- ------------ -------------------

ZHRO   CREATE SEQUENCE   NO

ZHRO   CREATE SESSION    NO

ZHRO    CREATE TABLE     NO

ZHRO   UNLIMITED TABLESPACE  NO

5 rows selected.

------------这里的UNLIMITED TABLESPACE权限其实是不能通过角色的方式授予的

SQL> select * from role_sys_privs where role=‘CONNECT‘;

-------这里查询的是系统角色所拥有的权限

ROLE       PRIVILEGE        ADM

--------- ---------------- ----------

CONNECT    CREATE SESSION   NO

SQL> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE=‘ILOG_RTS‘;

GRANTEE    PRIVILEGE             ADM

--------- --------------------- -------------

ILOG_RTS   UNLIMITED TABLESPACE  NO

SQL> select * from dba_role_privs where grantee=‘ILOG_RTS‘;

GRANTEE    GRANTED_ROLE        ADM DEF

---------- -------------       --- ---

ILOG_RTS   CONNECT              NO  YES

ILOG_RTS    RESOURCE            NO  YES

select * from V$PWFILE_USERS

TABLE_NAME            COMMENTS

-----------------   -------------------------------------

DBA_CONNECT_ROLE_GRANTEES      Information regarding which users are granted CONNECT

DBA_ROLES                      All Roles which exist in the database

DBA_ROLE_PRIVS                 Roles granted to users and roles

DBA_SCHEDULER_JOB_ROLES        All scheduler jobs in the database by database role

USER_ROLE_PRIVS                Roles granted to current user

ROLE_ROLE_PRIVS                Roles which are granted to roles

ROLE_SYS_PRIVS                 System privileges granted to roles

ROLE_TAB_PRIVS                 Table privileges granted to roles

SESSION_ROLES                  Roles which the user currently has enabled.

TABLE_NAME               COMMENTS

-------------------     -------------------------------------

DBA_AQ_AGENT_PRIVS

DBA_COL_PRIVS                  All grants on columns in the database

DBA_ROLE_PRIVS                 Roles granted to users and roles

DBA_RSRC_CONSUMER_GROUP_PRIVS  Switch privileges for consumer groups

DBA_RSRC_MANAGER_SYSTEM_PRIVS  system privileges for the resource manager

DBA_SYS_PRIVS                  System privileges granted to users and roles

DBA_TAB_PRIVS                  All grants on objects in the database

USER_COL_PRIVS                 Grants on columns for which the user is the owner, grantor or grantee

USER_COL_PRIVS_MADE            All grants on columns of objects owned by the user

USER_COL_PRIVS_RECD            Grants on columns for which the user is the grantee

USER_ROLE_PRIVS                Roles granted to current user

USER_RSRC_CONSUMER_GROUP_PRIVS Switch privileges for consumer groups for the user

USER_RSRC_MANAGER_SYSTEM_PRIVS system privileges for the resource manager for the user

USER_SYS_PRIVS                 System privileges granted to current user

USER_TAB_PRIVS                 Grants on objects for which the user is

the owner, grantor or grantee

USER_TAB_PRIVS_MADE            All grants on objects owned by the user

USER_TAB_PRIVS_RECD            Grants on objects for which the user is the grantee

ALL_COL_PRIVS                  Grants on columns for which the user is

the grantor, grantee, owner,or an enabled role or PUBLIC is the grantee

ALL_COL_PRIVS_MADE             Grants on columns for which the user is owner or grantor

ALL_COL_PRIVS_RECD             Grants on columns for which the user, PUBLIC or enabled role is the grantee

ALL_TAB_PRIVS                  Grants on objects for which the user is the grantor, grantee,

owner,or an enabled role or PUBLIC is the grantee

ALL_TAB_PRIVS_MADE             User‘s grants and grants on user‘s objects

ALL_TAB_PRIVS_RECD             Grants on objects for which the user, PUBLIC or enabled role is the grantee

ROLE_ROLE_PRIVS                Roles which are granted to roles

ROLE_SYS_PRIVS                 System privileges granted to roles

ROLE_TAB_PRIVS                 Table privileges granted to roles

SESSION_PRIVS                  Privileges which the user currently hasset

GV$ENABLEDPRIVS                Synonym for GV_$ENABLEDPRIVS

V$ENABLEDPRIVS                 Synonym for V_$ENABLEDPRIVS

set linesize 120

col username for a20

col ACCOUNT_STATUS for a30

col CREATED for a30

set pagesize 600

col DEFAULT_TABLESPACE for a30

select username,ACCOUNT_STATUS,CREATED,DEFAULT_TABLESPACE from dba_users order by CREATED,ACCOUNT_STATUS;

col GRANTEE for a30

col GRANTED_ROLE for a30

col ADMIN_OPTION for a20

col DEFAULT_ROLE for a20

-------------这里查询的是用户角色所拥有的角色

select * from dba_role_privs where grantee in (select username from dba_users where username not in (‘SYS‘,‘SYSTEM‘) AND ACCOUNT_STATUS=‘OPEN‘) order by GRANTEE,GRANTED_ROLE;

-------------这里查询的是用户和自定义角色所拥有的权限

select distinct GRANTEE,PRIVILEGE,ADMIN_OPTION from (SELECT GRANTEE,PRIVILEGE,ADMIN_OPTION FROM DBA_SYS_PRIVS WHERE GRANTEE in (select GRANTED_ROLE from dba_role_privs where grantee in (select username from dba_users where username not in (‘SYS‘,‘SYSTEM‘) AND
ACCOUNT_STATUS=‘OPEN‘)) union SELECT GRANTEE,PRIVILEGE,ADMIN_OPTION FROM DBA_SYS_PRIVS WHERE GRANTEE in (select username from dba_users where username not in (‘SYS‘,‘SYSTEM‘) AND ACCOUNT_STATUS=‘OPEN‘)) order by GRANTEE,PRIVILEGE;

Oracle用户及角色的权限管理[Oracle基础]

时间: 2024-11-20 20:16:51

Oracle用户及角色的权限管理[Oracle基础]的相关文章

ORACLE - 用户和角色的权限管理

在ORACLE中,创建用户后需要授权才能使用. 一.用户管理 1. 用户和角色信息查询 --查询所有用户 SQL> select * from dba_users; --经授予的用户或角色的系统权限 select * from dba_sys_privs; --数据对象上的所有权限 SQL>select * from dba_tab_privs; --查看当前用户的权限和角色 SQL>select * from user_sys_privs; SQL>select * from r

Oracle 用户,角色,权限等

权限管理是 Oracle 系统的精华,不同用户登录到同一数据库中,可能看到不同数量的表,拥有不同的权限.Oracle 的权限分为系统权限和数据对象权限,共一百多种,如果单独对用户授权,很囧,有一些用户需要的权限是相同的,就把这些用户归为同一类--某种角色,通过设立一些有预定权限的角色简化和明确授权操作,角色出现的动机也就是为了简化权限管理,它是权限的集合.一般做法是:系统把权限赋给角色,然后把角色赋给用户,当然也可以直接把某权限赋给用户.Oracle 提供细粒度的权限,可以对表的某一列单独设置权

oracle用户、角色及权限

1.oracle用户 Oracle 用户分两种,一种是系统用户sys system :另外一种是普通用户: 视图dba_users 存储着所有用户信息: 创建用户: Create user 用户名identified by 密码default tablespace 表空间 授予session 权限:grant create session to TEST; 锁定和开启帐号:alter user TEST account lock / unlock ; 修改用户密码:alter user TEST

Oracle 用户、角色、权限(系统权限、对象权限)的数据字典表

1?三者的字典表 1.1?用户 select?*?from?dba_users; select?*?from?all_users; select?*?from?user_users; 1.2?角色 select?*?from?dba_roles; 1.3?权限 分为系统权限与对象权限: select?*?from?system_privilege_map; select?*?from?table_privilege_map; 2?三者之间关系的字典表 这类关系字典表的表名后缀都包含"_privs

springBoot+springSecurity 数据库动态管理用户、角色、权限

本文使用springboot+mybatis+SpringSecurity 实现数据库动态的管理用户.角色.权限管理 本文细分角色和权限,并将用户.角色.权限和资源均采用数据库存储,并且自定义滤器,代替原有的FilterSecurityInterceptor过滤器, 并分别实现AccessDecisionManager.InvocationSecurityMetadataSourceService和UserDetailsService,并在配置文件中进行相应配置. spring security

springBoot+springSecurity 数据库动态管理用户、角色、权限(二)

序: 本文使用springboot+mybatis+SpringSecurity 实现数据库动态的管理用户.角色.权限管理 本文细分角色和权限,并将用户.角色.权限和资源均采用数据库存储,并且自定义滤器,代替原有的FilterSecurityInterceptor过滤器, 并分别实现AccessDecisionManager.InvocationSecurityMetadataSourceService和UserDetailsService,并在配置文件中进行相应配置. spring secur

【视频分享】Liger UI实战集智建筑工程管理系统配商业代码(打印报表、角色式权限管理)

QQ 2059055336 课程讲师:集思博智 课程分类:.net 适合人群:中级 课时数量:23课时 用到技术:Liger UI框架.AJAX.JSON数据格式的序列化与反序列化.角色的交叉权限管理 本课程代码为商业版代码,用户可直接部署运行. 一.系统介绍: 集智建筑工程管理系统是专为建筑类企业打造的一款管理软件.本着"一工程一台帐"的原则,加强对工程的资金管理,解决工程技术部门.工程管理部门.财务部之间数据的共享,方便领导查询工程进度与回款情况,更好的进行查询统计,提供多种统计图

ASP.net Membership角色与权限管理(一)

ASP.net Membership角色与权限管理(一) 本文目录:1.membership简介2.membership在sql server中的设置3.配置web.config4.创建用户CreateUserWizard控件5.用户登录login控件6.显示当前用户的名称LoginName控件7.检测用户的身份验证状态的LoginStatus控件8.为不同类别用户呈现不同内容的LoginView控件9.更改密码的ChangePassword控件10.自助找回密码的PasswordRecover

LINUX用户、用户组及权限管理

LINUX用户.用户组及权限管理 一.LINUX权限管理 LINUX权限分为:r,w,x,读,写,可执行 对文件来说: r 可读,即可以使用类似cat等命令查看文件的内容 w 可写,可以编辑或删除此文件: x 可执行,exacutable,可以在命令提示符下当做命令提交给内核运行. 对于目录来说(默认有x权限): r 可以对此目录执行ls以列出内部的所有文件 w 可以在此目录中创建文件 x 可以使用cd切换进此目录,也可以使用ls -l查看内部文件的详细信息. 文件 目录 r 可读,即可以使用类