• Oracle 用户权限管理


    SQL> select * from ROLE_SYS_PRIVS where ROLE='RESOURCE';
    
    ROLE			       PRIVILEGE				ADM
    ------------------------------ ---------------------------------------- ---
    RESOURCE		       CREATE SEQUENCE				NO
    RESOURCE		       CREATE TRIGGER				NO
    RESOURCE		       CREATE CLUSTER				NO
    RESOURCE		       CREATE PROCEDURE 			NO
    RESOURCE		       CREATE TYPE				NO
    RESOURCE		       CREATE OPERATOR				NO
    RESOURCE		       CREATE TABLE				NO
    RESOURCE		       CREATE INDEXTYPE 			NO
    
    SQL> select * from ROLE_SYS_PRIVS where ROLE='CONNECT';
    
    ROLE			       PRIVILEGE				ADM
    ------------------------------ ---------------------------------------- ---
    CONNECT 		       CREATE SESSION				NO
    
    
    Select  *  from  session_privs;SQL> 
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    UNLIMITED TABLESPACE
    CREATE TABLE
    CREATE CLUSTER
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE TRIGGER
    CREATE TYPE
    CREATE OPERATOR
    CREATE INDEXTYPE
    
    10 rows selected.
    
    
    
    只给test3用户connect权限:
    SQL> create user test3 identified by test3;
    
    User created.
    
    SQL> grant connect to test3;
    
    Grant succeeded.
    
    SQL> select * from session_privs;
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    
    SQL> create table id(id int);
    create table id(id int)
    *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    
    
    给test3用户connect和resource 角色:
    
    SQL> select * from session_privs;
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    UNLIMITED TABLESPACE
    CREATE TABLE
    CREATE CLUSTER
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE TRIGGER
    CREATE TYPE
    CREATE OPERATOR
    CREATE INDEXTYPE
    
    10 rows selected.
    SQL> create view v1 as select * from dual;
    create view v1 as select * from dual
                *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    
    SQL> grant create view to test3;
    
    Grant succeeded.
    
    SQL> create view v1 as select * from dual;
    
    View created.
    
    
    
    创建用户时一般给connect,resource和create view权限

  • 相关阅读:
    [转]select any dictionary与select_catalog_role区别
    [转]Oracle DB 权限与角色
    About Secure Application Roles
    [转]Oracle DB 用户
    [转]Oracle DB 管理数据库存储结构
    lsnrctl工具之service
    [转]Oracle DB 配置Oracle Network环境
    [转]Oracle DB 性能视图和数据字典
    [转]Oracle DB 查看预警日志
    判断数据库启动时使用的参数文件类型的方法
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352356.html
Copyright © 2020-2023  润新知