oracle 赋予权限 转发 评论 02 月21 日 13:00 最基础的 sqlplus username/password@[sid] 连接数据库 sqlplus username/password as sysdba 以管理员连接数据库 管理员连接后 创建用户 sqlplus system/manager@demo as sysdba create user abc identified by abc ; 创建用户abc 密码为abc grant all privileges to abc; 给abc 用户赋予所有的权限 给自己留个备份 以备不时之需 oracle grant 授权语句--select * from dba_users; 查询数据库中的所有用户 --alter user USERNAME account lock; 锁住用户 --alter user USERNAME account unlock; 给用户解锁 --create user USERNAME identified by USERPASS; 建立用户 一般创建用户后需要授予链接数据库权限 grant connect,resource to USERNAME; --grant create tablespace to USERNAME; 授权创建表空间 --grant SELECT on TABLENAME to USERNAME; 授权查询 授权其他动作格式相同 如果要把所有表的查询权限分配给用户可以用这样的 grant select any table to USERNAME; --grant execute on procedure1 to xujin 授权存储过程 --grant UPDATE on TABLENAME to USERNAME with grant option; 授权更新权限转移给xujin 用户,许进用户可以继续授权; --收回权限 --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 授权给xu...