1 / 14
文档名称:

数据库实验四报告.docx

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

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

分享

预览

数据库实验四报告.docx

上传人:花开花落 2019/4/26 文件大小:554 KB

下载得到文件列表

数据库实验四报告.docx

文档介绍

文档介绍:蒆《数据库原理与应用》实验报告肆实验名称:羄莇班级:薈芄学号:莃膈姓名:芅莃一、实验目的袂(1)了解Oracle数据库中的用户管理,模式,权限管理和角色管理。袈(2)掌握为用户分配权限的方法。莆(3)了解为不同用户分配不同权限的目的及原因。蚅二、,分别创建数据库内部用户user_one和user_two,创建时自己为用户分配帐户口令。蕿语句:蒈createuseruser_one袃identifiedby123456蚁defaulttablespaceusers荿temporarytablespacetemp芅quotaunlimitedonusers;膆createuseruser_two肀identifiedby123456聿defaulttablespaceusers芇temporarytablespacetemp芄quotaunlimitedonusers;螄执行结果:。薀语句:膅grantcreatesessiontouser_one;螅grantcreatesessiontouser_two;蚃执行结果:莁***,在任何模式下删除表的权限,授予用户user_two可以在任何模式下创建表的权限,查询任何模式下表中数据的权限和在任何模式下创建视图的权限。袃语句:肂grantcreatetable,dropanytabletouser_one;肁grantcreateanytable,createanyview,selectanytabletouser_two;芈执行结果:,写出相应的SQL语句验证为其授予的权限。(如果建立的表中有主键约束,需要预先授予user_one和user_two用户createanyindex的权限。)螁语句:肅createtablet1(avarchar2(10));;(bvarchar2(10));***,,ame,grade莀fromstudent,sc,==oandmajor='生物工程';,,ame,grade袅fromstudent,sc,==oandmajor='生物工程';螈执行结果:,创建用户user_three,将角色权限DBA授予用户user_three,并将S、P、J、SPJ四张表导入到user_three模式下。袂语句:艿createuseruser_three肈identifiedby123456蒄defaulttablespaceusers莂temporarytablespacetemp羀quotaunlimitedonusers;袆grantdbatouser_three;袆执行结果:螁 ,完成如下授权,在user_one和user_two用户下执行相应的SQL语句验证授权是否成功。羅(1)把对表S的INSERT权力授予用户user_one,并允许他再将此权限授予其他用户。膀语句:蒀grantinsert罿ons肃touser_one袄withgrantoption;芁执行结果:螆蒅(2)用户user_two对S,P,J三个表有SELECT和INSERT权力芃语句:羁grantselect,insertonstouser_two;袇grantselect,insertonptouser_two;薄grantselect,insertonjtouser_two;螂执行结果:蒇罿(3)用户user_one对SPJ表有DELETE权力,对QTY字段具有UPDATE权力。羆语句:grantdelete,update(qty)onspjtouser_one;膂执行结果:膈蚆(4)收回user_one对S表的插入权限。肄语句:revokeinsertonsfromuser_one;薁执行结果:,只保留登录权限。(系统权限和对象权限应该分别收回)膃语句:revokecreateanytable,createanyview,selectanytablefromuser_two;羁执行结果: