创建临时表空间组

使用不同的临时表空间为不同用户进行配置来减少i/o争用

那如何为同一个用户分配不同的临时表空间来实现会话级的减少i/o争用。

这种需求在高并发的开发环境下还是很多的

在oracle的10g 11g及之后的版本可以通过配置临时表空间组,为同一用户的不同会话分配不同临时表空间。

此处以scott用户为例

1)查询是否存在表空间组

select * from dba_tablespace_groups;
2)创建临时表空间组
create temporary tablespace temp1 tempfile '/oradata/orcl/temp011.dbf' size 100m tablespace group tmp_grp1;
create temporary tablespace temp2 tempfile '/oradata/orcl/temp012.dbf' size 100m tablespace group tmp_grp1;
create temporary tablespace temp3 tempfile '/oradata/orcl/temp013.dbf' size 100m tablespace group tmp_grp1;
3)将某个表空间移动到组内(如果之前有创建的可以加入到组中)
alter tablespace temp4 tablespace group tmp_grp1;
4)修改某用户的临时表空间 (这里指定的是组)
alter user scott temporary tablespace tmp_grp1;
5)查看用户默认表空间
select temporary_tablespace from dba_users where username='SCOTT';
6)使用scott用户创建多个会话,测试7的结果
select a.table_name,b.table_name from all_tables a,all_tables b order by a.table_name;
7)查询临时表空间
select username,session_num,tablespace from v$sort_usage where username='SCOTT';
8)删除临时表空间,回收空间,当全部删完后,组消失了。
drop tablespace temp3 including contents and datafiles;

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值