Oracle管理表空间
创建表空间
create [temporary] tablespace
tablespace_name
tempfile | datafile 'xxx.dbf' size xx;
create tablespace temptest1_tablespace
datafile 'H:\Oracle\test1file.dbf' size 10m;
create temporary tablespace temptest1_tablespace
tempfile 'H:\Oracle\tempfile1.dbf' size 10m;
desc dba_data_files;
select file_name from dba_data_files where tablespace_name='TEST1_TABLESPACE';
desc dba_temp_files;
select file_name from dba_temp_files where tablespace_name='TEMPTEST1_TABLESPACE';
修改表空间的状态
alter tablespace tablespace_name online | offline;
desc dba_tablespaces
select status from dba_tablespaces where tablespace_name='TEST1_TABLESPACE';
alter tablespace tablespace_name read only | read write;
修改数据文件
alter tablespace tablespace_name
add datafile 'xx.dbf' size xx;
alter tablespace tablespace_name
drop datafile 'filename.dbf';
删除表空间
drop tablespace tablespace_name [including contents];