MINI MINI MANI MO

Path : /proc/self/root/opt/oracle/product/18c/dbhomeXE/md/admin/
File Upload :
Current File : //proc/self/root/opt/oracle/product/18c/dbhomeXE/md/admin/sdoupgrdh.sql

Rem
Rem $Header: sdo/admin/sdoupgrdh.sql /main/20 2017/11/06 14:21:20 sravada Exp $
Rem
Rem sdoupgrdh.sql
Rem
Rem Copyright (c) 2015, 2017, Oracle and/or its affiliates. 
Rem All rights reserved.
Rem
Rem    NAME
Rem      sdoupgrdh.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    BEGIN SQL_FILE_METADATA 
Rem    SQL_SOURCE_FILE: sdo/admin/sdoupgrdh.sql 
Rem    SQL_SHIPPED_FILE: md/admin/sdoupgrdh.sql 
Rem    SQL_PHASE: UPGRADE
Rem    SQL_STARTUP_MODE: NORMAL 
Rem    SQL_IGNORABLE_ERRORS: NONE 
Rem    SQL_CALLING_FILE: sdo/admin/sdoupgrd.sql 
Rem    END SQL_FILE_METADATA
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    sravada     11/06/17 - break the big pl/sql block
Rem    sravada     08/05/17 - drop CS staging tables
Rem    jcwang      07/11/17 - drop sdonetmemh object types
Rem    sravada     07/10/17 - drop old CSW objects
Rem    bkazar      07/03/17 - Remove old CSW
Rem    sravada     06/15/17 - drop trigger SDO_INDEX_METADATA_UPDATE
Rem    sravada     05/31/17 - add trigger .. doest not exist exception
Rem    rjanders    05/10/17 - #26037683: Raise 'when other' exceptions
Rem    rjanders    04/27/17 - Correct "SQL_PHASE" metadata values
Rem    rjanders    03/23/17 - #25437999: Remove 'when others then NULL'
Rem                           handlers
Rem    sravada     01/11/17 - bug 25370681
Rem    sravada     03/30/16 - move alter types here
Rem    sravada     03/06/16 - move SDO_STRING_ARRAY alter here
Rem    sravada     02/24/16 - drop georaster triggers
Rem    matperry    12/04/15 - refactor for 12.2 - sdoupgrdh calls semdbmigi
Rem                           instead of sdoupgrd
Rem    czechar     08/14/15 - add SQL file metadata
Rem    matperry    06/05/15 - move rdf upgrade to sdoupgrd.sql
Rem    raeburns    02/12/15 - add required pre-upgrade actions
Rem    sravada     01/05/15 - Created
Rem


Rem ********************************************************************
Rem #16473696: Indicate Oracle-Supplied object
@@?/rdbms/admin/sqlsessstart.sql
Rem ********************************************************************

Rem Turn on Error Logging for the component
SET ERRORLOGGING ON TABLE SYS.REGISTRY$ERROR IDENTIFIER 'SDO';

Rem Display start timestamp
SELECT sys.dbms_registry_sys.time_stamp_display('SDO') AS timestamp FROM SYS.DUAL;

-- bug 13561951
grant ADMINISTER DATABASE TRIGGER to MDSYS;

Alter session set current_schema=MDSYS;

EXECUTE SYS.DBMS_REGISTRY.UPGRADING('SDO', NULL, 'validate_sdo');

-- /* unload all the java classes so that they can be recreated with catmloc.sql
--    or catmd.sql. This will prevent java classes from being invalid
--     if the seed is used with SE install */

COLUMN loc_fname NEW_VALUE loc_file NOPRINT;
SELECT sys.dbms_registry.script('JAVAVM','@sdounloadj.sql') AS loc_fname FROM SYS.DUAL;

@&loc_file

declare
  TYPE  classes_cur IS REF CURSOR;
  m_cur        classes_cur;
  className    varchar2(256);
begin
  OPEN m_cur FOR 'select dbms_java.longname(OBJECT_NAME) from sys.dba_objects where owner=''MDSYS'' and OBJECT_TYPE like ''JAVA%''';
  LOOP
    FETCH m_cur INTO className;
      EXIT WHEN m_cur%NOTFOUND;
    dbms_java.dropjava('-force -synonym -schema MDSYS  '||className);
  END LOOP;
  CLOSE m_cur;
  EXCEPTION
    WHEN OTHERS THEN
      IF m_cur%ISOPEN THEN
        CLOSE m_cur;
      END IF;
end;
/
select dbms_java.longname(OBJECT_NAME) from sys.dba_objects where owner='MDSYS' and OBJECT_TYPE like 'JAVA%';


alter session set current_schema=MDSYS;

declare
  object_not_found exception;
  pragma exception_init(object_not_found, -04043);
  compilation_error exception;
  pragma exception_init(compilation_error, -22324);
  trigger_not_found exception;
  pragma exception_init(trigger_not_found, -04048);
  object_does_not_exist exception;
  pragma exception_init(object_does_not_exist, -00942);
  sequence_does_not_exist exception;
  pragma exception_init(sequence_does_not_exist, -02289);
  dependent_objects exception;
  pragma exception_init(dependent_objects, -02303);
begin
   begin
     execute immediate 'drop package MDSYS.sdo_geor_lizardtech ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')1]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop library MDSYS.sdo_geor_lizardtech_lib ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')2]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop trigger MDSYS.SDO_INDEX_METADATA_UPDATE ';
     exception
       when object_not_found then NULL;
       when trigger_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')3]: ' || SQLERRM); RAISE;
   end;


   begin
     execute immediate 'drop trigger MDSYS.SDO_GEOR_TRIG_DEL2 ';
     exception
       when object_not_found then NULL;
       when trigger_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')4]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop trigger MDSYS.SDO_GEOR_TRIG_INS1 ';
     exception
       when object_not_found then NULL;
       when trigger_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')5]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop trigger MDSYS.SDO_GEOR_TRIG_DEL1 ';
     exception
       when object_not_found then NULL;
       when trigger_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')6]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop trigger MDSYS.SDO_GEOR_TRIG_UPD1 ';
     exception
       when object_not_found then NULL;
       when trigger_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')7]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate
     'drop view  MDSYS.USER_SDO_GEOR_SYSDATA CASCADE CONSTRAINTS  ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')8]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate
     'drop view  MDSYS.ALL_SDO_GEOR_SYSDATA CASCADE CONSTRAINTS  ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')9]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate
    ' alter table SDO_GEOR_SYSDATA_TABLE
      modify ( SDO_OWNER VARCHAR2(128),
               GEORASTER_TABLE_NAME VARCHAR2(128),
               RDT_TABLE_NAME VARCHAR2(128) ) ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')10]: ' || SQLERRM); RAISE;
   end;

   begin
     -- Cannot change element type same size of smaller: compilation error
     execute immediate
     'alter type SDO_STRING_ARRAY modify element type VARCHAR2(130) cascade  ';
     exception
       when compilation_error then NULL;
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')11]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate
     'alter type SDO_Topo_Geometry_Layer modify attribute (OWNER varchar2(130), Table_Name  varchar2(256), Column_Name varchar2(130)) cascade including table data ';
     exception
       when compilation_error then NULL;
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')12]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate
     ' alter type SDO_GEORASTER
   modify attribute ( rasterDataTable VARCHAR2(128) ) cascade including table data';
     exception
       when compilation_error then NULL;
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')13]: ' || SQLERRM); RAISE;
   end;

end;
/

declare
  object_not_found exception;
  pragma exception_init(object_not_found, -04043);
  compilation_error exception;
  pragma exception_init(compilation_error, -22324);
  trigger_not_found exception;
  pragma exception_init(trigger_not_found, -04048);
  object_does_not_exist exception;
  pragma exception_init(object_does_not_exist, -00942);
  sequence_does_not_exist exception;
  pragma exception_init(sequence_does_not_exist, -02289);
  dependent_objects exception;
  pragma exception_init(dependent_objects, -02303);
begin
   begin
     execute immediate 'drop package MDSYS.SDO_CSW_PROCESS ';
     exception
       when object_not_found then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')14]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_CapabilitiesInfo$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')15]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_DomainInfo$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')16]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_HarvestMetadata$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')17]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_PLUGIN_MAP$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')18]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RECORDDOMAINUPDATED$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')19]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RECORDTABLEMDUPDATED$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')20]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RECORDTABLEUPDATED$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')21]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RECORDVIEWMAP$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')22]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RECORD_TYPES$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')23]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_RTXSDINFO$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')24]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop table MDSYS.CSW_TRG_TABLE_TEMP$ ';
     exception
       when object_not_found then NULL;
       when object_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')25]: ' || SQLERRM); RAISE;
   end;

   begin
     execute immediate 'drop sequence MDSYS.RT_SQ$ ';
     exception
       when object_not_found then NULL;
       when sequence_does_not_exist then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')26]: ' || SQLERRM); RAISE;
   end;

end;
/

declare
  object_not_found exception;
  pragma exception_init(object_not_found, -04043);
  compilation_error exception;
  pragma exception_init(compilation_error, -22324);
  trigger_not_found exception;
  pragma exception_init(trigger_not_found, -04048);
  object_does_not_exist exception;
  pragma exception_init(object_does_not_exist, -00942);
  sequence_does_not_exist exception;
  pragma exception_init(sequence_does_not_exist, -02289);
  dependent_objects exception;
  pragma exception_init(dependent_objects, -02303);
begin

   -- drop object types for sdonetmemh.sql for package sdo_net_mem

   begin
    execute immediate 'drop type MDSYS.SDO_NETWORK_MANAGER_I FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')27]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_NETWORK_MANAGER_T FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')28]: ' || SQLERRM); RAISE;
   end;


   begin
    execute immediate 'drop type MDSYS.SDO_NETWORK_I FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')29]: ' || SQLERRM); RAISE;
   end;


   begin
    execute immediate 'drop type MDSYS.SDO_NETWORK_T FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')30]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_NODE_I FORCE';
  exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')31]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_NODE_T FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')32]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_LINK_I FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')33]: ' || SQLERRM); RAISE;
   end;


   begin
    execute immediate 'drop type MDSYS.SDO_LINK_T FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')34]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_PATH_I FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')35]: ' || SQLERRM); RAISE;
   end;

   begin
    execute immediate 'drop type MDSYS.SDO_PATH_T FORCE';
    exception
       when object_not_found then NULL;
       when dependent_objects then NULL;
       when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')36]: ' || SQLERRM); RAISE;
   end;

   -- end of drop object types for sdonetmemh.sql for package sdo_net_mem

end;
/

-- drop the CS staging tables if CDB/PDB or normal DB
-- 
declare
  object_does_not_exist exception;
  pragma exception_init(object_does_not_exist, -00942);
begin
    begin
       execute immediate 
        ' drop table mdsys.EXT_TAB_OP_PARAM_USE';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')37]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_AXES';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')38]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_AXIS_NAMES';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')39]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_COORD_OPS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')40]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_COORD_SYS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')41]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_CS_SRS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')42]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_DATUMS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')43]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_MEASURE';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')44]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_OP_METHODS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')45]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_OP_PARAMS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')46]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_OP_PARAM_USE';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')47]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_OP_PATHS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')48]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_PARAM_VALS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')49]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_PARAM_VALS_1';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')50]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_PREFERRED_OPS_SYSTEM';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')51]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_PRIME_MERIDIANS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')52]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_REF_SYS';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')53]: ' || SQLERRM); RAISE;
    end;

    begin
       execute immediate
        ' drop table mdsys.EXT_TAB_REF_SYS_1';
      exception 
        when object_does_not_exist then NULL;
        when others then
         SYS.DBMS_SYSTEM.KSDWRT(SYS.DBMS_SYSTEM.TRACE_FILE,
                                'EXCEPTION[sdoupgrdh.sql(' || $$PLSQL_LINE || ')54]: ' || SQLERRM); RAISE;
    end;

end;
/


prompt starting sdomigrt.sql
@@sdomigrt.sql
prompt sdomigrt.sql complete

REM perform RDF upgrade

Alter session set current_schema=MDSYS;

prompt start performing RDF migration

prompt starting semdbmigi.sql
@@semdbmigi.sql
prompt semdbmigi.sql complete

prompt done performing RDF migration

Alter session set current_schema=MDSYS;

Rem ********************************************************************
Rem #16473696: Indicate Oracle-Supplied object
@@?/rdbms/admin/sqlsessend.sql
Rem ********************************************************************



OHA YOOOO