oracel 12c 在实列下新建表空间和用户

第一步 :创建表空间

--默认使用的表空间
create tablespace 表空间名 datafile'/oradata/xxx/xxx.dbfA' size 20G autoextend on next 1G maxsize unlimited extent management local;
--临时表空间  使用order by group by 子句数据量过大时保存的临时表空间
create temporary tablespace 表空间名 tempfile'/oradata/xxx/xxx.dbfA' size 20G autoextend on next 1G maxsize unlimited extent management local;

第二部:创建用户,指定表空间 

--创建用户
 create user 用户名
 identified by 密码
 default tablespace 默认表空间名 
 temporary tablespace 临时表空间名
 account unlock;
 

grant unlimited tablespace to 用户名; 授予用户使用表空间的权限


create profile oldjcj_profile limit  --概要文件
cpu_per_session 10000   --每个session占用cpu的最长时间
logical_reads_per_session 20000 --每个session 最多允许读取20000个数据块
connect_time 60 -- 每个session最多允许连接60分钟
idle_time 30 --一个session最大空闲时间30分钟
sessions_per_user 10 --一个用户最多可以创建10个session连接
failed_login_attempts 5  -- 每个用户登录错误5次
password_lock_time unlimited -- 超过5次登录错误则密码长期锁定

alter user 用户名 profile oldjcj_profile;--给用户设置概要文件

grant connect,resource to 用户名; --授予连接的权限
grant create table,create sequence , create view to 用户名 with admin option;  --授予的权限可以由该用户授予其他账号
grant create session to 用户名;  -- 不能授予其他账号 创建session的权限


grant select any table to 用户名;--授予查询所有表的权限
grant drop any table to 用户名;; --授予卸载任何表的权限
grant update any table to 用户名; -- 授予修改任何表的权限
grant insert any table to 用户名; --授予插入任何表的权限
grant all to 用户名; --授予所有权限给用户

 

revoke create table from 用户名;  --收回赋予的权限

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值