Oracle练习题(八)

Oracle练习题(八)

(1) 创建新用户 TEST 密码为123456,默认表空间为USERS

create user TEST identified by 123456 default tablespace users;

(2) 让TEST用户连接数据库服务器

grant connect to TEST;
conn TEST/123456;

(3) 让TEST用户可以建表

conn sys/123456 as sysdba;
grant create table to TEST;

(4) 授予TEST可以访问SCOTT用户下表的权限

grant select on scott.emp to TEST;
//所有表
grant select any table to TEST;

(5) 删除TEST用户

drop user TEST cascade;

(6) 建立角色

create role r1;

(7) 再重新建立用户TEST

create user TEST identified by 123456 default tablespace users;

(8) 把创建的角色授予给TEST用户

grant r1 to TEST;

(9) 查询TEST用户下所具有的系统权限的角色

select * from user_role_privs;

(10) 创建资源文件

create profile test01 limit idle_time 30 connect_time 480;

(11) 并使TEST用户使用该资源文件

alter user TEST profile test01;
posted on 2021-12-13 21:43  JAVA开发区  阅读(15)  评论(0)    收藏  举报  来源