创建表空间:
create tablespace ts1 detafile '地址\表名.dbf' size 50M; 固定50M的表空间
create tablespace ts1 detafile '地址\表名.dbf' size 50M autoextend on next 10M; 表空间不够时,自动扩展10M
create tablespace ts1 detafile '地址\表名.dbf' size 50M autoextend on next 10M maxsize 1024M; 表空间最大扩展到1024M
更改用于默认的表空间:
alter database default tablespace ts1;
在 Views 下 DBA_USERS
查看用户建表的默认表空间
或select * from dba_users;
表空间改名:
alter tablespace ts1 rename to tss1;
删除表空间:
drop tablespace ts1 including contents and datafiles;
-----------------
CREATE TABLESPACE NNC_DATA01 DATAFILE 'D:\app\oracleDB\nnc_data01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;
CREATE TABLESPACE NNC_DATA02 DATAFILE 'D:\app\oracleDB\nnc_data02.dbf' SIZE 300M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;
CREATE TABLESPACE NNC_DATA03 DATAFILE 'D:\app\oracleDB\nnc_data03.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K ;
CREATE TABLESPACE NNC_INDEX01 DATAFILE 'D:\app\oracleDB\nnc_index01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;
CREATE TABLESPACE NNC_INDEX02 DATAFILE 'D:\app\oracleDB\nnc_index02.dbf' SIZE 300M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;
CREATE TABLESPACE NNC_INDEX03 DATAFILE 'D:\app\oracleDB\nnc_index03.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;