1
create tablespace testspace
datafile 'd:/OracleTest/test001.dbf' size 10m autoextend on next 5m maxsize unlimited
extent management local ; //创建表空间
alter tablespace testspace add datafile 'd:/OracleTest/test002.dbf' size 5m
autoextend on next 3m maxsize 50m;
alter tablespace testspace drop datafile 'd:/OracleTest/test002.dbf';
alter database datafile 'd:/OracleTest/test001.dbf' resize 10m;
alter database datafile 'd:/OracleTest/test001.dbf' autoextend off;
alter tablespace testspace read only;(只读)
SQL> alter tablespace testspace read write;(读写)
SQL> alter tablespace testspace offline;
SQL> alter tablespace testspace online;
(1)设置表空间脱机 alter tablespac testspace offline;
(2)物理转移表空间文件;即把你的表空间物理文件转移到你想移动的路径
(3)逻辑转移:alter tablespace testspace rename datafile 'd:/OracleTest/test001.dbf' to 'e:/test001.dbf';
(4)设置表空间联机 alter tablespace testspace online;
(1)不删文件 drop tablespace testspace;
(2)删除文件 drop tablespace testspace including contents and datafiles;
(1)关闭数据库服务 shutdown
(2)alter database datafile 'd:/test001.dbf' offline drop;
(3)alter database open;
(4)开启数据库服务 startup;