oracle数据库为用户创建权限和取消授权

创建用户

 

create user username

identified by password

 

例:create user martin

identified by 123456

 

查询新用户是否添加成功

 

select username, account_status

from dba_users

where account_status = 'OPEN'

 

 

select username, account_status

from dba_users

where username = 'MARTIN'

 

 

查询数据库用户本身拥有权限

 

select * from session_privs

 

查询数据库用户本身拥有角色

 

select * from user_role_privs

 

查看某个角色拥有哪些权限 例:DBA角色

 

select * from dba_sys_privs where grantee='DBA'

 

对martin用户授权数据库连接权限

 

grant connect to martin

 

切换martin帐号查询本身的权限

 

 

对martin用户授权数据库某张表查询权限

 

例:增加dba_sys_privs查询权限

 

grant select on dba_sys_privs to martin

 

回收用户权限

 

例:回收martin用户dba_sys_privs表查询权限

 

revoke select on dba_sys_privs from martin

 

对martin用户授权数据库某张表查询、插入、删除、更新、权限

 

grant select,insert,delte,update on dba_sys_privs to martin

 

回收martin用户授权数据库某张表查询、插入、删除、更新、权限

 

revoke select,insert,delte,update on dba_sys_privs from martin

 

删除用户

 

drop user martin

 

或者

 

drop user martin cascade 

相关文章

Java Oracle 结果集是Java语言中处理数据库查询结果的一种方...
Java AES和Oracle AES是现代加密技术中最常使用的两种AES加密...
Java是一种广泛应用的编程语言,具备可靠性、安全性、跨平台...
随着移动互联网的发展,抽奖活动成为了营销活动中不可或缺的...
Java和Oracle都是在计算机领域应用非常广泛的技术,他们经常...
Java 是一门非常流行的编程语言,它可以运行于各种操作系统上...