创建和修改临时表空间

创建和修改临时表空间
创建临时表空间需要使用temporary,关键字为tempfile,一般用于执行排序等操作
SQL> create temporary tablespace mytemp
  2  tempfile 'D:\oradata\mytemp.dbf'
  3  size 5M autoextend on next 2M maxsize 20M;
SQL> select tablespace_name,status from dba_tablespaces;
增加临时文件,add tempfile,修改大小resize,也可修改状态为online或者offline
SQL> column name format A50
SQL> select file#,status,name from v$tempfile; 查看状态
SQL> alter tablespace mytemp
  2  add tempfile 'D:\oradata\mytemp2.dbf'
  3  size 5M;
SQL> select file#,status,name from v$tempfile;

 

临时表空间组
使用临时表空间组,可并发执行排序操作,避免空间不足问题
创建使用tablespace group在创建时指定一个组,查看临时表空间组信息,数据字典

dba_tablespace_groups,移动alter tablespace
SQL> create temporary tablespace tempgroup
  2  tempfile 'D:\oradata\tempgroup01.dbf' size 5M
  3  tablespace group group01;
SQL> select * from dba_tablespace_groups;
SQL> create temporary tablespace tempgroup02
  2     tempfile 'D:\oradata\tempgroup02.dbf' size 5M
  3    tablespace group group02;
SQL> select * from dba_tablespace_groups;
SQL> alter tablespace tempgroup tablespace group group02; //将tempgroup移动到group02
SQL> select * from dba_tablespace_groups;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值