zoukankan      html  css  js  c++  java
  • oracle grant 授权语句

    用户授权 grant create session, connect, resource to xxx;

    授权试图 grant select on KA04_N to HIS_DLL;

    创建同义试图   CREATE SYNONYM KA04_N FOR MCHIS.KA04_N;

    查询数据库中的所有用户 select * from dba_users; 

    锁住用户 alter user TEST_SELECT account lock; 

    给用户解锁 alter user TEST_SELECT account unlock; 

    建立用户 create user xujin identified by xujin; 

    授权 grant create tablespace to xujin; 

    授权查询 grant select on tabel1 to xujin; 

    授权更新 grant update on table1 to xujin;

    授权存储过程 grant execute on procedure1 to xujin 

    授权更新权限转移给xujin用户,许进用户可以继续授权  grant update on table1 to xujin with grant option; 

      --收回权限

      --revoke select on table1 from xujin1; 收回查询select表的权限;

      --revoke all on table1 from xujin;

      /*grant connect to xujin;

      revoke connect from xujin

      grant select on xezf.cfg_alarm to xujin;

      revoke select on xezf.cfg_alarm from xujin;*/

      --select table_name,privilege from dba_tab_privs where grantee='xujin' 查询一个用户拥有的对象权限

      --select * from dba_sys_privs where grantee='xujin' 查询一个用户拥有的系统权限

      --select * from session_privs --当钱会话有效的系统权限

      --角色

      --create role xujin1;--建立xujin1角色

      --grant insert on xezf.cfg_alarm to xujin1; 将插入表的信息

      --revoke insert on xezf.cfg_alarm from xujin1; 收回xujin1角色的权限

      --grant xujin1 to xujin ; 将角色的权限授权给xujin;

      -- create role xujin2;

      --grant xujin1 to xujin2; 将角色xujin1授权给xujin2;

      --alter user xujin default xujin1,xujin2; 修改用户默认角色

      -- DROP ROLE xujin1;删除角色1;

      --select * from role_sys_privs where role=xujin1;

      --查看许进1角色下有什么系统权限;

      --select granted_role,admin_option from role_role_privs where role='xujin2';

      --查看xujin1角色下面有什么角色权限

      --select * from role_sys_privs where role='xujin2';

      --select table_name,privilege from role_tab_privs where role='xujin1';

      --select * from dba_role_privs where grantee='xujin' --查看用户下面有多少个角色;

  • 相关阅读:
    Manjaro 安装与初步使用
    hp 820 G3 驱动安装不上
    Linux Mint
    PHP模板引擎原理
    报名系统跟商品购物有点类似,可以参考一下他们的ER图
    tp5接口开发流程(思路版)
    mysql中主键和外键的作用,主表和从表如何区分,以及如何使用联合查询和TP5的联合查询
    关于会员-考生-考生自定义表单-预览打印
    PHP unserialize()和serialize两者的用法
    如何解决复杂的问题?如何在未知的领域里,解决需求?
  • 原文地址:https://www.cnblogs.com/xxxyz/p/13444354.html
Copyright © 2011-2022 走看看