准备实验环境:
创建一个名为baby的表空间及一个数据文件/export/home/oracle/baby.dbf,使baby表空间处于offline状态;
SQL> create tablespace baby datafile '/export/home/oracle/baby.dbf' size 10m;
Tablespace created.
SQL> select tablespace_name,contents,status from dba_tablespaces where tablespace_name='BABY' ;
TABLESPACE_NAME CONTENTS STATUS
------------------------- ------------------------- -------------------------
BABY PERMANENT ONLINE
SQL> alter tablespace baby offline;
Tablespace altered.
SQL> select tablespace_name,contents,status from dba_tablespaces where tablespace_name='BABY';
TABLESPACE_NAME CONTENTS STATUS
------------------------- ------------------------- -------------------------
BABY PERMANENT OFFLINE
删除表空间及数据文件:
SQL> drop tablespace baby including contents and datafiles;
Tablespace dropped.
测试:
SQL> select tablespace_name,file_name from dba_data_files where tablespace_name='BABY';
no rows selected
SQL> !ls /export/home/oracle/*.dbf
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27168315/viewspace-735883/
,如需转载,请注明出处,否则将追究法律责任。