select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
SQL> select file_name from dba_data_files; FILE_NAME --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /opt/oracle/oradata/orcl/users01.dbf /opt/oracle/oradata/orcl/undotbs01.dbf /opt/oracle/oradata/orcl/sysaux01.dbf /opt/oracle/oradata/orcl/system01.dbf /opt/oracle/oradata/orcl/example01.dbf /opt/oracle/oradata/orcl/neo.dbf 6 rows selected.
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 8M autoextend on next 5M maxsize 10M;
maxsize unlimited 是大小不受限制
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 800M autoextend on next 50M maxsize unlimited
unform表示区的大小相同,默认为1M
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local uniform;
unform size 500K表示区的大小相同,为500K
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local uniform size 500K;
autoallocate 表示区的大小由随表的大小自动动态改变
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 800M autoextend on next 50M maxsize 1000M extent management local autoallocate;
temporary 创建字典管理临时表空间
create tablespace test datafile '/opt/app/oracle/oradata/test.dbf' size 800M autoextend on next 50M maxsize 1000M temporary;
例 34.2. 创建表空间实例
SQL> create tablespace ts_b01_def datafile '/opt/oracle/oradata/orcl/ts_b01_def.dbf' size 100m autoextend on; Tablespace created. SQL> create tablespace ts_b01_idx datafile '/opt/oracle/oradata/orcl/ts_b01_idx.dbf' size 100m autoextend on; Tablespace created.
更改自动扩展属性
alter database datafile '/opt/app/oracle/oradata/test.dbf', '/opt/app/oracle/oradata/test01.dbf' '/opt/app/oracle/oradata/test02.dbf' autoextend off;
drop tablespace "空间名" including contents and datafiles drop tablespace test including contents and datafiles
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。