1、创建用户
create user kd identified by 123456;
2、授予连接数据库的权限
grant connect to kd;
3、将scott用户的emp表授权给kd可以查询
grant select on scott.emp to kd; grant create table to kd;
4、回收权限
revoke select on scott.emp from kd;
5、表的增删改权限授权
grant select,inset,delete,update on scott.emp to kd; revoke select,inset,delete,update on scott.emp from kd;
6、删除用户
sql 错误: ora-01940: 无法删除当前连接的用户
退出已经连接得kd用户后再执行
drop user kd;
会提示:错误: ora-01922: 必须指定 cascade 以删除 ‘kd’
drop user kd cascade;
7、查看当前用户所拥有的权限
select * from session_privs;
8、查看当前用户所拥有的角色
select * from user_role_privs;
9、查看角色所有的权限
select * from dba_sys_privs; select * from dba_sys_privs where grantee='connect'; --create session select * from dba_sys_privs where grantee='resource'; /* create trigger create sequence create type create procedure create cluster create operator create indextype create table */ select * from dba_sys_privs where grantee='dba'; --有最高权限 所有的权限都有
创建一个开发人员并授权:
create user curry identified by 123456; create connet,resource to curry;
10、用户解锁
alter user hr account unlock;
11、修改用户密码
alter user hr identified by 123456;
以上所述是www.887551.com给大家介绍的纯oracle的用户、角色以及权限相关操作,希望对大家有所帮助