C.3.1.4 Removing the APEX Release Schema

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

C.3.1.4.1 Removing the APEX Release 23.1 Schema from a Non-CDB

Start SQLcl and connect to the database and execute DROP USER APEX_230100 CASCADE; command.

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

  1. Start SQLcl and connect to the database where APEX is installed as SYS specifying the SYSDBA role:
    • On Windows:

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

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

    Once you have removed the APEX 23.1 schema, you can now attempt the upgrade again.

C.3.1.4.2 Removing the APEX Release 23.1 Schema from a CDB

Create text files, start SQLcl and connect to the database execute @remove_apx231_usr.sql.

To remove the release 23.1 schema from a CDB:

  1. Create a new text file named remove_apx231_usr1.sql with the following contents:
    alter session set current_schema = SYS;
    drop user APEX_230100 cascade;
  2. Create a second new text file named remove_apx231_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_apx231_usr remove_apx231_usr.sql
  3. Start SQLcl and connect to the database where APEX is installed as SYS specifying the SYSDBA role:
    • On Windows:

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

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

    Once you have removed the APEX 23.1 schema, you can now attempt the upgrade again.