1 / 11
文档名称:

数据库实验四报告.docx

格式:docx   大小:3,669KB   页数:11页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数据库实验四报告.docx

上传人:久阅文学 2022/3/26 文件大小:3.58 MB

下载得到文件列表

数据库实验四报告.docx

文档介绍

文档介绍:数据库实验四报告
2 / 11
3 / 11
4 / 11
4.分别用user_one和user_two登录,写出相应的SQL语句验证为其授予的权限。(如果建立的表中
数据库实验四报告
2 / 11
3 / 11
4 / 11
4.分别用user_one和user_two登录,写出相应的SQL语句验证为其授予的权限。(如果建立的表中有主键约束,需要预先授予user_one和user_two用户create any index的权限。)
语句:
create table t1 (a varchar2(10));
drop table ;
create table (b varchar2(10));
create view
as
select ,,,grade
from student,sc,course
where = and = and major='生物工程';
select ,,,grade
from student,sc,course
where = and = and major='生物工程';
执行结果:
5 / 11
5.用系统帐户sys登录数据库,创建用户user_three,将角色权限DBA授予用户user_three,并将S、P、J、SPJ四张表导入到user_three模式下。
语句:
create user user_three
6 / 11
identified by 123456
default tablespace users
temporary tablespace temp
quota unlimited on users;
grant dba to user_three;
执行结果:

6.使用user_three登录,完成如下授权,在user_one和user_two用户下执行相应的SQL语句验证授权是否成功。
(1)把对表S的INSERT权力授予用户user_one,并允许他再将此权限授予其他用户。
语句:
grant insert
on s
to user_one
7 / 11
with grant option;
执行结果:
(2)用户user_two对S,P,J三个表有SELECT和INSERT权力
语句:
grant select,insert on s to user_two;
grant select,insert on p to user_two;
grant select,insert on j to user_two;
执行结果:
(3)用户user_one对SPJ表有DELETE权力,对QTY字段具有UPDATE权力。
语句:grant delete,update(qty) on spj to user_one;
执行结果:
8 / 11
(4)收回user_one对S表的插入权限。
语句:revoke insert on s from user_one;
执行结果:
7.把对用户user_two授予的所有权限收回,只保留登录权限。(系统权限和对象权限应该分别收回)
语句:revoke create any table,create any view,select any table from user_two;
执行结果:
8.用系统帐户sys登录数据库,创建用户user_four,将角色权限DBA授予此用户,在user_four的模式下导入Sudent、Course和SC表。
语句:
create user user_four
identified by 123456
default tablespace users
temporary tablespace temp
quota unlimited on users;
grant dba to user_four;
执行结果:
9 / 11