ALTER TABLESPACE XH_DM DROP DATAFILE ‘F:\DEV\ORACLE-DATA\ORCL\XH_DM_1.DBF‘;
SQL> ALTER TABLESPACE XH_DM
2 DROP DATAFILE ‘F:\DEV\ORACLE-DATA\ORCL\XH_DM_1.DBF‘;
ALTER TABLESPACE XH_DM
*
ERROR at line 1:
ORA-03262: the file is non-empty
1 -- Oracle Storage 删除一个无效的数据文件,及上面的无效表 2 -- 1. 查看文件ID 3 select file_id,file_name,tablespace_name from dba_data_files order by file_id; 4 5 6 -- 2. G根据ID查找文件上存储的段,表,分区名称 7 select owner,SEGMENT_NAME,FILE_ID from dba_extents where file_id=9; 8 9 10 -- 3. 彻底删除表,如果表内容有效,先移动表到其他表空间 e.g. ALTER TABLE SQL_LOG MOVE TABLESPACE USERS; 11 drop table temp_user_extent purge; 12 drop table TEMP_USER_SEGMENTS purge; 13 drop table sql_log purge; 14 15 16 -- 4. 删除数据文件 17 ALTER TABLESPACE XH_DM DROP DATAFILE ‘F:\DEV\ORACLE-DATA\ORCL\XH_DM_1.DBF‘;
Tablespace altered.
时间: 2024-10-10 15:47:48