I got ” ORA-02303: cannot drop or replace a type with type or table dependents ” error in Oracle database.
ORA-02303: cannot drop or replace a type with type or table dependents
Details of error are as follows.
ORA-02303: cannot drop or replace a type with type or table dependents. Cause: An attempt was made to drop or replace a type that has type or table dependents. Action: For DROP TYPE, drop all type(s) and table(s) depending on the type and then retry the operation, or use the FORCE option. For CREATE TYPE, drop all type(s) and table(s) depending on the type and then retry the operation, or drop all table(s) depending on the type and retry with the FORCE option.
Upgrading the database from 12.2.0.1 to 18c .Following error is encountered- SQL> -- contains dbms_output (odci procedures dependent on this) SQL> @@dbmsotpt SQL> rem SQL> rem $Header: rdbms/admin/dbmsotpt.sql /main/29 2014/02/20 12:45:51 surman Exp $ SQL> rem SQL> Rem Copyright (c) 1991, 2013, Oracle and/or its affiliates. SQL> Rem All rights reserved. SQL> Rem NAME SQL> Rem dbmsotpt.sql - used by sql*dba 'set serveroutput on' cmd SQL> Rem DESCRIPTION SQL> Rem NOTES SQL> Rem SQL*DBA and SQL*PLUS depend on this package. SQL> Rem RETURNS SQL> SQL> Rem This script must be run as user SYS. SQL> SQL> -- create varray type of varchar2(32767) SQL> CREATE OR REPLACE TYPE dbmsoutput_linesarray IS 2 VARRAY(2147483647) OF VARCHAR2(32767); 3 / CREATE OR REPLACE TYPE dbmsoutput_linesarray IS * ERROR at line 1: ORA-02303: cannot drop or replace a type with type or table dependents
cannot drop or replace a type with type or table dependents
This ORA-02303 error is related with the attempt was made to drop or replace a type that has type or table dependents.
For DROP TYPE, drop all type(s) and table(s) depending on the type and then retry the operation, or use the FORCE option. For CREATE TYPE, drop all type(s) and table(s) depending on the type and then retry the operation, or drop all table(s) depending on the type and retry with the FORCE option.
Object type not created due to object dependencies.This could also cause Oracle Server Component to become INVALID.
Oracle Database Release 18 Post-Upgrade Status Tool 04-23-2019 11:55:5 Component Current Full Elapsed Time Name Status Version HH:MM:SS Oracle Server ORA-02303: cannot drop or replace a type with type or table dependents Oracle Server INVALID 18.3.0.0.0 00:15:17 JServer JAVA Virtual Machine VALID 18.3.0.0.0 00:00:00 Oracle XDK UPGRADED 18.3.0.0.0 00:00:00 Oracle Database Java Packages UPGRADED 18.3.0.0.0 00:00:00 Oracle Text UPGRADED 18.3.0.0.0 00:00:00 Oracle Real Application Clusters OPTION OFF 18.3.0.0.0 00:00:00 Oracle XML Database UPGRADED 18.3.0.0.0 00:00:00 Upgrade Datapatch 00:00:21 Final Actions 00:00:28 Post Upgrade 00:00:11 Post Upgrade Datapatch 00:00:14 Total Upgrade Time: 00:16:37
Execute the below command in Upgrade Mode from 18c Home
If this was the only error,then run utlrp 4-5 times & check for the status of the “Oracle Server” Component.
Below SQLs also need to be executed,if they had failed previously.
SQL> create or replace public synonym dbmsoutput_linesarray for dbmsoutput_linesarray; SQL> grant execute on dbmsoutput_linesarray to public;
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )