大型数据库实验报告
学院: 专业: 日期:
班级: 姓名: 学号:
1. 实验目的 ? 复习SQL语句
? 复习数据库设计的相关知识
2. 实验内容(注意,实验代码和过程中产生的数据要上交,请同学们用SPOOL命令记录下代码和过程) 1. 创建一个用户口令认证的数据库用户usera_exer,口令为usera,默认表空间为
USERS,配额为10MB,初始账户为锁定状态。 Create user usera_exer identefied by usera default tablespace users quota 10m on users account lock;
2. 创建一个口令认证的数据库用户userb_exer,口令为userb。 Cteate user userb_exer identified by userb;
3. 为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;
4. 将用户usera_exer的账户解锁。 Alter user usera_exer account unlock;
5. 用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;
9. 将角色rolea,roleb授予用户usera_exer。 Grant rolea,roleb to usera_exer;
10. 为用户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;
3. 实验记录
实验代码和过程中产生的数据要上交,请同学们用spool命令记录下代码和过程
4. 分析总结 4.1. 遇到的问题及解决方法
4.2. 实验心得及存在的问题
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库lab10_oracle安全管理1在线全文阅读。
相关推荐: