- 52
- 0
- 约1.77千字
- 约 4页
- 2017-03-05 发布于重庆
- 举报
lab10_oracle安全管理1
大型数据库实验报告
学院: 班级: 专业: 姓名: 日期: 学号: 实验目的
复习SQL语句
复习数据库设计的相关知识
实验内容(注意,实验代码和过程中产生的数据要上交,请同学们用spool命令记录下代码和过程)
创建一个用户口令认证的数据库用户usera_exer,口令为usera,默认表空间为USERS,配额为10MB,初始账户为锁定状态。
userb_exer,口令为userb。
Cteate user userb_exer identified by userb;
为usera_exer用户授权CREATE SESSION权限、scott.emp的SELECT权限和UPDATE权限,同时允许该用户将获得的权限授予其他用户。
(先连接到sysdba)
Grant create session to usera_exer with admin option;
Grant select,update on scott.emp to usera_exer with admin option;
将用户usera_exer的账户解锁。
Alter user usera_exer account unlock;
用usera_exer登录数据库,查询和更新scott.emp中的数据。同时将scott.emp的SELECT权限和UPDATE权限授予用户userb_exer。
登录后进行查询:
Conn usera_exer/usera;
Select * from scott.emp;
Update scott.emp set ename = ‘FJY’ where deptno = 7369;
Grant select,update on scott.emp to userb_exer;
更新:
更新后进行查看是否更新成功:
6.禁止用户usera_exer将获得的CREATE SESSION权限再授予其他用户。
Conn system/Bnuep5090
Revoke create session from usera_exer;
Grant create session to usera_exer;
7禁止用户usera_exer将获得的scott.emp的SELECT权限和UPDATE权限再授予其他用户。
同理先将权限回收,然后再进行授权:
Revoke select,updateon scott.emp from usera_exer;
Grant select,updateon scott.emp to usera_exer;
8建角色rolea和roleb,将CREATE TABLE权限,scott.emp的INSERT权限和DELETE权限授予rolea;将CONNECT,RESOURCE角色授予roleb。
Created role rolea not identified;
Created role roleb not identified;
Grant create table to rolea;
Grant insert,delect on scott.emp to rolea;
Grant connect,resource to roleb;
将角色rolea,roleb授予用户usera_exer。
Grant rolea,roleb to usera_exer;
为用户usera_exer创建一个概要文件,限定该用户的最长会话时间为30分钟,如果连续10分钟空闲,则结束会话.同时,限定其口令有效期为20天,连续登陆4次失败后将锁定用户,10天后自动解锁.
Create profile usera_profile limit connect_time 30 idle_time 10 password_life_time 20 failed_login_attempts 4 password_lock_time 10;
实验记录
实验代码和过程中产生的数据要上交,请同学们用spool命令记录下代码和过程
分析总结
遇到的问题及解决方法
实验心得及存在的问题
您可能关注的文档
最近下载
- 语文阅读题答题技巧.pptx VIP
- 最新初三中考初中语文阅读理解训练题及答案带解析 .pdf VIP
- 杭州北游—皋亭山景区一期项目统筹规划大纲.pptx VIP
- 教科版二年级下册科学知识点期末测试卷附参考答案(突破训练).docx VIP
- 六年级语文阅读专项训练PDF打印.pdf VIP
- 最新教科版小学二年级科学下册第二单元提升精练检测试卷(含答案).docx VIP
- 电力建设“五新”推广应用信息目录.pdf VIP
- 2025年度组织生活会个人对照检查材料.doc VIP
- DL-T-1843-2018垃圾发电厂危险源辨识和评价规范.docx VIP
- 四年级脱式计算100道数学题.pdf VIP
原创力文档

文档评论(0)