oracle用户,权限,表空间管理

-- 1.创建表空间
create tablespace zhu_tablespace
datafile 'D:/oracleTableSpace/zhu/zhu_tablespace.dbf'
size 512M
extent management local segment space management auto;
-- 查看表空间
select dba_tablespaces.tablespace_name,bytes,file_name
from dba_tablespaces left join dba_data_files
on dba_tablespaces.tablespace_name = dba_data_files.tablespace_name
where dba_tablespaces.tablespace_name = 'ZHU_TABLESPACE'
-- 删除表空间
drop tablespace zhu_tablespace including contents and datafiles;

-- 2.建用户并指定默认表空间
create user zhu identified by 123456
default tablespace zhu_tablespace;
-- 查看用户
select * from dba_users where username = 'ZHU'
-- 删除用户
drop user zhu cascade
 
-- 3.赋予权限
grant connect,resource to zhu;
grant create any sequence to zhu;
grant create any table to zhu;
grant delete any table to zhu;
grant insert any table to zhu;
grant select any table to zhu;
grant unlimited tablespace to zhu;
grant execute any procedure to zhu;
grant update any table to zhu;
grant create any view to zhu;
-- 查看权限与角色
select * from dba_sys_privs where grantee='ZHU';
select * from dba_role_privs where grantee='ZHU';
-- 回收权限
revoke CREATE ANY VIEW from zhu;

-- 4.查看用户,权限,表空间
select * from dba_users where username = 'ZHU';

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值