无法删除刚刚创建的表
我创建了一个名为 dual2
的表。我在那里有一行,可以从中选择。当尝试删除它时,会产生以下错误:
第 1 行出现错误:
ORA-00604: 递归 SQL 级别 1 发生错误
ORA-00942: 表或视图不存在
但是,表仍然存在!它从 dba_tables
和 user_tables
返回。
对这里发生的事情有什么想法吗?
替代文本 http://img180.imageshack.us/img180/6012/28140463.png< /a>
这是我通过 plsql Developer 获得的表创建脚本:
-- Create table
create table
(
DUMMY VARCHAR2(1)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
PS:p.cambell 感谢您的编辑!抱歉我的英语不好:)
I created a table named dual2
. I've a rows there, and can select from it. When attempting to drop it, it produces this error:
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
However, the table still exists! It returns from dba_tables
and user_tables
.
Any ideas on what's happening here??
alt text http://img180.imageshack.us/img180/6012/28140463.png
Here is the script of table creation, that i got with plsql developer:
-- Create table
create table
(
DUMMY VARCHAR2(1)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
P.S.: p.cambell thanks for editing! and sorry for my bad english :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
规则 1 永远不要将任何东西创建为系统(或 SYS)。这些是内置对象的内置模式。
您可能必须以 SYSDBA 身份连接才能拥有足够的权限来删除系统拥有的任何对象。另外,根据安装的不同,可能会有一些触发器在删除表之前触发(我认为 MDSYS 有一个),并且可能不适用于 SYSTEM 对象。
就我个人而言,我很想清除数据库并重新开始,或者回到创建对象之前的状态。
Rule 1 in NEVER create anything as system (or SYS). These are built-in schemas for built-in objects.
You'll probably have to connect as SYSDBA to have sufficient privileges to drop any objects owned by system. Also, depending on the install, there can be triggers that fire before a drop table (I think MDSYS has one) and which might not work for a SYSTEM object.
Personally, I'd be tempted to blow the database away and start again, or go back to a back from before you created the object.
如果只想删除表中的数据,可以使用truncate。
它将删除所有行以及如果有任何自动增量(或标识)列。然后seed被设置为1。
if you want to delete only the data of the table then you can use truncate.
It will delete all the rows and If there is any autoincreament( or identity) column. then is seed is set to 1.