Oracle 中的更改类型失败并出现 ORA-22324 和 ORA-21700

发布于 2024-09-06 10:12:02 字数 299 浏览 3 评论 0 原文

我正在尝试向 Oracle 10.2.0.4 DB 中现有的对象类型添加属性。 该架构是有效的,并且在运行以下语句之前一切正常:

ALTER TYPE sometype ADD ATTRIBUTE (somefield varchar(14))
CASCADE INCLUDING TABLE DATA
/
SHOW ERRORS

更改失败并显示 ORA-22324 和 ORA-21700。 之后,大多数依赖于某种类型的模式对象都无效了。 编译所有这些,将架构恢复到工作状态。

有人见过这种错误吗?

I'm trying to add an attribute to an already existing Object Type in an Oracle 10.2.0.4 DB.
The schema is valid, and everything is working before running the following statement:

ALTER TYPE sometype ADD ATTRIBUTE (somefield varchar(14))
CASCADE INCLUDING TABLE DATA
/
SHOW ERRORS

The alter fails with an ORA-22324 and an ORA-21700.
Afterwards most of the schema objects which depend on sometype are invalid.
Compiling them all, restores the schema to a working state.

Anyone seen that kind of error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寂寞笑我太脆弱 2024-09-13 10:12:02

ORA-22324 是“更改的类型有编译错误”,ORA-21700 是“对象不存在或被标记为删除”。听起来您的类型的主体可能正在引用已被删除的内容。

我希望这有帮助。

ORA-22324 is "Altered type has compilation errors", and ORA-21700 is "Object does not exist or is marked for delete". Sounds like the body of your type may be referencing something which has been deleted.

I hope this helps.

抱猫软卧 2024-09-13 10:12:02

我知道这已经很旧了,但我的回答可能会帮助后来发现这个的人。

如果您收到此消息,请确保断开连接并重新连接,这可能会解决您的问题。

然而,在更改类型之前了解 oracle 开发指南很重要(特别是当您有使用该类型的表时):

以下是 oracle 9i 的对象开发指南:
http://docs.oracle.com/cd/B10501_01/appdev.920 /a96594.pdf

也指向重新编译正文
http://database-geek。 com/2005/05/26/oracle-objects-types-and-collections-part-3/

EXEC DBMS_UTILITY.compile_schema(schema => 'SOME_SCHEMA'); --如果您有很多内容因您的更改而变得无效,也可能为您提供有用的结果。

I know this is old, but my answer may help people who find this later.

Make sure to disconnect and reconnect if your getting this, Its possible that will solve your issue.

However, Understanding the oracle Dev guide before altering types is important(especially when you have tables using the type):

Here is the object dev guide for oracle 9i:
http://docs.oracle.com/cd/B10501_01/appdev.920/a96594.pdf

Also points to recompiling the body
http://database-geek.com/2005/05/26/oracle-objects-types-and-collections-part-3/

EXEC DBMS_UTILITY.compile_schema(schema => 'SOME_SCHEMA'); --may also provide a useful results for you if you have alot of stuff that became invalid with your change.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文