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:
AL开发者_JS百科TER 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?
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.
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.
精彩评论