C.4.1.4 Removing the Oracle Application Express Release Schema

After you revert to the prior release, remove the Oracle Application Express schema.

C.4.1.4.1 Removing the Oracle Application Express Release 20.2 Schema from a Non-CDB

Start SQL*Plus and connect to the database and execute DROP USER APEX_200200 CASCADE; .

To remove the release 20.2 schema from a non-CDB:

  1. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:
    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Execute the following command:
    DROP USER APEX_200200 CASCADE;
    

    Once you have removed the Oracle Application Express 20.2 schema, you can now attempt the upgrade again.

C.4.1.4.2 Removing the Oracle Application Express Release 20.2 Schema from a CDB

Create text files, start SQL*Plus and connect to the database execute @remove_apx202_usr.sql.

To remove the release 20.2 schema from a CDB:

  1. Create a new text file named remove_apx202_usr1.sql with the following contents:
    alter session set current_schema = SYS;
    drop user APEX_200200 cascade;
    
  2. Create a second new text file named remove_apx202_usr.sql with the following contents:
    set define '^'
    whenever sqlerror exit
    column :xe_home new_value OH_HOME NOPRINT
    variable xe_home varchar2(255)
     
    set serverout on
    begin
    -- get oracle_home
        sys.dbms_system.get_env('ORACLE_HOME',:xe_home);
        if length(:xe_home) = 0 then
            sys.dbms_output.put_line(lpad('-',80,'-'));
            raise_application_error (
                -20001,
                'Oracle Home environment variable not set' );
        end if;
    end;
    /
    whenever sqlerror continue
     
    set termout off
    select :xe_home from sys.dual;
    set termout on
     
    host ^OH_HOME/perl/bin/perl -I ^OH_HOME/rdbms/admin ^OH_HOME/rdbms/admin/catcon.pl -b remove_apx201_usr remove_apx201_usr1.sql
    
  3. Start SQL*Plus and connect to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:
    • On Windows:

      SYSTEM_DRIVE:\ sqlplus /nolog
      SQL> SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
    • On UNIX and Linux:

      $ sqlplus /nolog
      SQL> SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  4. Execute the following command:
    @remove_apx202_usr.sql
    

    Once you have removed the Oracle Application Express 20.2 schema, you can now attempt the upgrade again.