---------------------------------------------------
SQL> drop table agents cascade constraints;表已删除。SQL> describe agents
ERROR:
ORA-04043: 对象 agents 不存在
SQL> column type format a10
SQL> select original_name, object_name, type
2 from user_recyclebin;未选定行
----------------------------------------------------
如上述代码
我用的是System用户
是否System用户删除的表就不在回收站里呢?或者有其他原因?谢谢
drop table的命令里面只是在数据库字典里面删除了表agents的所有信息,并不删除物理数据文件。
SQL> show user
USER 为 "SYSTEM"
SQL> create table agents (id number,name varchar2(8));表已创建。SQL> drop table agents cascade constraints;表已删除。SQL> describe agents
ERROR:
ORA-04043: 对象 agents 不存在
SQL> column type format a10
SQL> select original_name, object_name, type
2 from user_recyclebin;未选定行SQL> conn scott/scott@test
已连接。
SQL> show user
USER 为 "SCOTT"
SQL> create table agents (id number,name varchar2(8));表已创建。SQL> drop table agents cascade constraints;表已删除。SQL> describe agents
ERROR:
ORA-04043: 对象 agents 不存在
SQL> column type format a10
SQL> select original_name, object_name, type
2 from user_recyclebin;ORIGINAL_NAME OBJECT_NAME TYPE
-------------------------------- ------------------------------ ----------
AGENTS BIN$7qNAoiSJRnybayTjHdnqog==$0 TABLESQL>
drop table purge就会直接的drop。system表空间里的table drop也是直接drop的。
SQL> show user;
USER 为 "SYS"
SQL>
SQL> drop table lijie.lijie_temp; --lijie用户下的lijie_temp表已删除。SQL> select count(*) from user_recyclebin;--“sys” 的user_recyclebin 不存在,但“lijie”的user_recyclebin中存在此记录 COUNT(*)
----------
0
SQL> flashback table lijie.lijie_temp to before drop;--闪回成功闪回完成。SQL> spool off; 在空间不足的时候Drop表,是不能放到回收站里的。
没有放入回收站的table,是不是不能使用flashback table XX before drop恢复?各位大侠?
那么system表空间到底是完全不支持回收站功能,还是默认不启用回收站功能。有待查找文档。
2 ; ID
----------
1[SYSTEM@orcl#15-4月 -10] SQL>drop table t1;表已删除。[SYSTEM@orcl#15-4月 -10] SQL>select count(*) from user_recyclebin; COUNT(*)
----------
0[SYSTEM@orcl#15-4月 -10] SQL>flashback table t1 to before drop;
flashback table t1 to before drop
*
第 1 行出现错误:
ORA-38305: 对象不在回收站中
我一直都是用System用户的
不小心就出了这问题
之前删除行用rollback就可以恢复
回收站在很多情况下是跟flashback table一起使用的。
而且flashback工具在sys or system 下是无效的。
sys or system 用户使用 flashback table table_name to before drop 无效