分类: Oracle
2013-02-22 09:06:07
一,建立表空間
create tablespace TBS datafile '/data/oradata/orcl/tbs01.dbf' size 2048M
autoextend off
segment space management auto
二,增加表空間(不自動擴展,制定大小2G)
alter tablespace users add datafile '/data/oradata/orcl/users03.dbf'
size 2048M
autoextend off
三,創建臨時表空間
create temporary tablespace temp1 tempfile '/data/oradata/orcl/temp1.dbf' size 1024M
autoextend off;
四,刪除表空間
drop tablespace undotbs_a INCLUDING CONTENTS;
# INCLUDING CONTENTS 數據文件一起刪除
DROP TABLESPACE TEMP1 INCLUDING CONTENTS AND DATAFILES;
重建臨時表空間并擴容:
#先建立tmp臨時表空間
create temporary tablespace tmp tempfile '/data/oradata/orcmisdb/tmp01.dbf' size 1024M
autoextend off
#修改臨時表空間為tmp
alter database default temporary tablespace tmp;
#刪除temp臨時表空間
drop tablespace temp including contents and datafiles;
#建立新的temp表空間,并設置大小,禁止自動擴展
create temporary tablespace temp tempfile '/data/oradata/orcmisdb/temp01.dbf'
size 1024m
autoextend off;
#增加temp表空間的數據文件
ALTER TABLESPACE temp ADD TEMPFILE '/data/oradata/orcmisdb/temp02.dbf'
size 1024m
autoextend off;
#將默認表空間改回到temp
alter database default temporary tablespace temp;
#刪除表空間tmp
drop tablespace tmp including contents and datafiles;