You can use the CREATE OR REPLACE TYPE command to change the definition for an existing user-defined type. However, this command throws an error if the referenced type has table or type dependencies.
Oracle Database 11g Release 2 allows you to use FORCE with the CREATE OR REPLACE TYPE command to replace a type that has a type dependency:
CREATE TYPE mytype1 AS OBJECT (a number) NOT FINAL; CREATE TYPE mytype2 UNDER mytype1 (b varchar(10)); CREATE OR REPLACE TYPE mytype1 FORCE AS OBJECT (c varchar(20));
Oracle Database 11g Release 2 does not allow you to use FORCE with the CREATE OR REPLACE TYPE command to replace a type that has a table dependency:
CREATE TABLE mytable1 (colA mytype1); CREATE OR REPLACE TYPE mytype1 FORCE AS OBJECT (d number);
The last command results in an error because mytype1 has a table dependency on mytable1:
ERROR at line 1: ORA-22866: cannot replace a type with table dependents
Replication Agent supports use of the FORCE option with the CREATE OR REPLACE TYPE command in Oracle Database 11g Release 2 to replace types with type dependencies but not for types with table dependencies.