(一) 授权 1. 创建用户”S学号u1”,S学号u2,S学号u3,S学号U4,并为其赋予connect角色。 其中,学号是指你的学号,比如你的学号为20130001,则你创建的用户应该是S20130001u1,S20130001u2,S20130001u3,S20130001u4 create user S2015214070u1 identified by nefu1234; create user S2015214070u2 identified by nefu1234; create
一、用户相关SQL语句
/*新建用户*/
create user SA identified by 2013;
说明:SA用户名,2013密码
/*授权connect,resource给用户sa*/
grant connect,resource to sa;
说明:CONNECT角色: –是授予最终用户的典型权利,最基本的 。
ESOURCE 角色: –是授予开发人员的
/*查询所有的用户*/
select * from all_users;
/*将表STU查询
创建用户tea,stu,并给这两个用户resource,connect角色
conn system/orcl;
create user tea identified by tea;
create user stu identified by stu;
grant resource to tea;
grant connect to tea;
grant resource to stu;
grant connect to stu;
使用scott用户把对emp表的select权限给tea
conn
创建用户tea,stu,并给这两个用户resource,connect角色
conn system/orcl;
create user tea identified by tea;
create user stu identified by stu;
grant resource to tea;
grant connect to tea;
grant resource to stu;
grant connect to stu;
使用scott用户把对emp表的select权限给tea
conn
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,up