oracle 创建 temporary tablespace

编程入门 行业动态 更新时间:2024-10-25 10:27:59

os: centos 7.4
db: oracle 12.1.0.2

A bigfile tablespace contains only one data file or temp file, which can contain up to approximately 4 billion (2的32次方) blocks. The minimum size of the single data file or temp file is 12 megabytes (MB) for a tablespace with 32K blocks and 7MB for a tablespace with 8K blocks. The maximum size of the single data file or temp file is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.

A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 data files or temp files, each of which can contain up to approximately 4 million (2的22次方) blocks.

bigfile tablespace 只能包含一个文件,不可以再添加.block 是 2的32次方(4G) 寻址
smallfile tablespace 是可以添加至1022个数据文件.block 是 2的22次方(4M) 寻址

create temporary smallfile tablespace


CREATE TEMPORARY TABLESPACE peiyb_temp 
TEMPFILE '/data/orcl/pdborcl/peiyb_temp01.dbf' 
SIZE 1G 
AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED
TABLESPACE GROUP ''
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512M;

create temporary bigfile tablespace


CREATE BIGFILE TEMPORARY TABLESPACE peiyb_temp 
TEMPFILE  '/data/orcl/pdborcl/peiyb_temp01.dbf' 
SIZE 1G 
AUTOEXTEND ON NEXT 1G MAXSIZE 34359738344K
TABLESPACE GROUP ''
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512M;

设置成 default temporary tablespace

SQL> alter database default temporary tablespace peiyb_temp ;
SQL> drop tablespace temp;

add temporary smallfile

ALTER TABLESPACE peiyb_temp
  ADD TEMPFILE '/data/orcl/pdborcl/peiyb_temp02.dbf'
  SIZE 1G
  AUTOEXTEND ON
  NEXT 1G
  MAXSIZE UNLIMITED;

resize temporary smallfile tablespace

select 'alter database tempfile '''||dtf.file_name||''' autoextend on next 1g maxsize UNLIMITED; ', 
       dtf.*
from dba_temp_files dtf
where 1=1
;

ALTER DATABASE TEMPFILE '/data/orcl/pdborcl/peiyb_temp02.dbf'
RESIZE 1G;

ALTER DATABASE TEMPFILE '/data/orcl/pdborcl/peiyb_temp02.dbf' 
AUTOEXTEND ON NEXT 1G MAXSIZE UNLIMITED;

参考:
https://docs.oracle/database/121/SQLRF/statements_7003.htm#SQLRF01403

更多推荐

oracle 创建 temporary tablespace

本文发布于:2023-06-14 07:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1452877.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:oracle   temporary   tablespace

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!