电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

数据库试验四报告

数据库试验四报告_第1页
1/9
数据库试验四报告_第2页
2/9
数据库试验四报告_第3页
3/9
《数据库原理与应用》实验报告实验名称:学号:班级:姓名:一、实验目的(1)了解 Oracle 数据库中的用户管理,模式,权限管理和角色管理。(2)掌握为用户分配权限的方法。(3)了解为不同用户分配不同权限的目的及原因。二、实验过程1.用系统帐户 sys 登录数据库,分别创建数据库内部用户 user_one 和 user_two,创建时自己为用户分配帐户口令。语句:create user user_oneidentified by 123456default tablespace userstemporary tablespace tempquota unlimited on users;create user user_twoidentified by 123456default tablespace userstemporary tablespace tempquota unlimited on users;执行结果:1 / 92.为了使两位用户登录数据库请为其授予相应的权限。语句:grant create session to user_one;grant create session to user_two;执行结果:3.授予用户user_one 在自己模式下创建表的权限,在任何模式下删除表的权限,授予用户 user_two 可以在任何模式下创建表的权限,查询任何模式下表中数据的权限和在任何模式下创建视图的权限。语句:grant create table,drop any table to user_one;grant create any table,create any view,select any table to user_two;执行结果:2 / 94.分别用 user_one 和 user_two 登录,写出相应的 SQL 语句验证为其授予的权限。(如果建立的表中有主键约束,需要预先授予 user_one 和 user_two 用户 createany index 的权限。)语句:create table t1 (a varchar2(10));drop table heart.change_major;create table heart.t2(b varchar2(10));create view heart.abcasselect sc.sno,student.sname,course.cname,gradefrom student,sc,coursewhere student.sno=sc.sno and course.cno=sc.cno and major='生物工程';select sc.sno,student.sname,course.cname,gradefrom student,sc,coursewhere student.sno=sc.sno and course.cno=sc.cno and major='生物工程';执行结果:3 / 95.用系统帐户 sys 登录数据库,创建用户 user_three,将角色权限 DBA 授予用户 user_three,并将 S、P、J、SPJ 四张表导入到 user_three 模式下。语句:create user user_three4 / 9identified by 123456default tablespace userstemporary tablespace tempquota unlimited on users;grant d...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

数据库试验四报告

您可能关注的文档

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部