【发布时间】:2015-01-29 22:30:17
【问题描述】:
我已尝试自行删除数据文件,但出现此错误。
SQL> alter tablespace USERS drop datafile '/u01/app/oracle/oradata/orcl/users01.dbf';
alter tablespace USERS drop datafile '/u01/app/oracle/oradata/orcl/users01.dbf'
*
ERROR at line 1:
ORA-03261: the tablespace USERS has only one file
我也尝试过使表空间脱机并删除整个表空间,但这也不起作用。
SQL> drop tablespace users including contents and datafiles;
drop tablespace users including contents and datafiles
*
ERROR at line 1:
ORA-12919: Can not drop the default permanent tablespace
编辑:这是用于模拟我将要恢复的数据文件故障的分配。我会手动删除它,但作业要求我使用 SQL。
【问题讨论】:
-
"不能删除默认的永久表空间" 很清楚不是吗?您需要先将不同的表空间设为默认表空间,然后才能删除
USERS -
一个(或多个)用户将
USERS表空间设置为默认表空间。您需要先更改它,然后才能删除表空间。 -
我只想删除数据文件而不是整个表空间来模拟硬件故障。
-
在该表空间中创建另一个文件,然后首先删除要删除的文件。如果任务是删除和恢复 1 个文件,那应该会很好。
标签: oracle ddl tablespace