A Oracle Application Express Troubleshooting

This appendix contains information on troubleshooting.

Topics:

A.1 Reviewing a Log of an Installation Session

The apexins.sql script creates a log file in the apex directory using the naming convention installYYYY-MM-DD_HH24-MI-SS.log. In a successful installation, the log file contains the following text:

Thank you for installing Oracle Application Express.
Oracle Application Express is installed in the APEX_040200 schema.

If the log file contains a few errors, it does not mean that your installation failed. Note that acceptable errors are noted as such in the log file.

A.2 Verifying the Validity of an Oracle Application Express Installation

You can verify the validity of an Oracle Application Express installation by running the following query:

SELECT STATUS FROM DBA_REGISTRY
WHERE COMP_ID = 'APEX';

If the result is VALID, you can assume the installation was successful.

A.3 Cleaning Up After a Failed Installation

In a successful installation the following banner displays near the end of the installation:

Thank you for installing Oracle Application Express.
Oracle Application Express is installed in the APEX_040200 schema.

To reinstall, you must either drop the Oracle Application Express database schemas, or run a script to completely remove Application Express from the database, depending upon the installation type.

Topics:

A.3.1 Reverting to a Previous Release After a Failed Upgrade Installation

In the case of a failed upgrade installation, you may want to revert Oracle Application Express to a previous release and then remove the schemas associated with the current release.

Topics:

A.3.1.1 Verifying If You Have a Previous Release of Oracle Application Express

To verify whether you have a previous release of Application Express:

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

    • On Windows:

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

      $ sqlplus /nolog
      SQL> CONNECT SYS as SYSDBA
      Enter password: SYS_password
      
  2. Execute the following command in SQL*Plus:

    select username from dba_users
        where regexp_like(username,'(FLOWS|APEX)_\d{6}')
            and username <> (select table_owner from all_synonyms
            where synonym_name = 'WWV_FLOW'
            and owner = 'PUBLIC')
    

    If the query above returns any rows, the database contains a previous release of Oracle Application Express.

A.3.1.2 Reverting to a Previous Release

To revert to a previous Oracle Application Express release:

  1. If you altered your images directory, you must point the text alias /i/ back to images directory for the release you wish to revert to. See "Copying the Images Directory After an Upgrade".

  2. 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
      
  3. Depending upon the release you are reverting to, execute the appropriate command in SQL*Plus:

    1. To revert to Oracle Application Express Release 1.5, execute the following:

      ALTER SESSION SET CURRENT_SCHEMA = FLOWS_010500;
      exec flows_010500.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_010500');
      
    2. To revert to Oracle Application Express Release 1.6, execute the following:

      ALTER SESSION SET CURRENT_SCHEMA = FLOWS_010600;
      exec flows_010600.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_010600');
      
    3. To revert to Oracle Application Express Release 2.0, execute the following:

      ALTER SESSION SET CURRENT_SCHEMA = FLOWS_020000;
      exec flows_020000.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_020000');
      
    4. To revert to Oracle Application Express Release 2.2, execute the following:

      ALTER SESSION SET CURRENT_SCHEMA = FLOWS_020200;
      exec flows_020200.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_020200');
      
    5. To revert to Oracle Application Express Release 3.0, execute the following:

      • Change your working directory to apex in the 3.0 source.

      • 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
        
      • Execute the following:

        set define '^'
         
        @apexvalidate x x FLOWS_030000
        ALTER SESSION SET CURRENT_SCHEMA = FLOWS_030000;
        exec flows_030000.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_030000');
        ALTER SESSION SET CURRENT_SCHEMA = SYS;
        exec validate_apex;
        
    6. To revert to Oracle Application Express Release 3.1:

      • Change your working directory to apex/core in the 3.1 source.

      • 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
        
      • Execute the following commands:

        @wwv_flow_val.plb
        @wwv_dbms_sql.sql
        @wwv_dbms_sql.plb
        
      • Change your working directory to apex in the 3.1 source.

      • 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
        
      • Execute the following:

        set define '^'
         
        @apexvalidate x x FLOWS_030100
        ALTER SESSION SET CURRENT_SCHEMA = FLOWS_030100;
        exec flows_030100.wwv_flow_upgrade.switch_schemas('APEX_040200','FLOWS_030100');
        ALTER SESSION SET CURRENT_SCHEMA = SYS;
        exec validate_apex;
        
        
    7. To revert to Oracle Application Express Release 3.2:

      • Change your working directory to apex/core in the 3.2 source.

      • 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
        
      • Execute the following commands:

        @wwv_flow_val.plb
        @wwv_dbms_sql.sql
        @wwv_dbms_sql.plb
        
      • Change your working directory to apex in the 3.2 source.

      • 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
        
      • Execute the following:

        set define '^'
         
        @apexvalidate x x APEX_030200
        ALTER SESSION SET CURRENT_SCHEMA = APEX_030200;
        exec apex_030200.wwv_flow_upgrade.switch_schemas('APEX_040200','APEX_030200');
        ALTER SESSION SET CURRENT_SCHEMA = SYS;
        exec validate_apex;
        
    8. To revert to Oracle Application Express Release 4.0:

      • Change your working directory to apex/core in the 4.0 source.

      • 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
        
      • Execute the following commands:

        @wwv_flow_val.plb
        @wwv_dbms_sql.sql
        @wwv_dbms_sql.plb
        
      • Change your working directory to apex in the 4.0 source.

      • 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
        
      • Execute the following:

        set define '^'
         
        @apexvalidate x x APEX_040000
        ALTER SESSION SET CURRENT_SCHEMA = APEX_040000;
        exec apex_040000.wwv_flow_upgrade.switch_schemas('APEX_040200','APEX_040000');
        ALTER SESSION SET CURRENT_SCHEMA = SYS;
        exec validate_apex;
        
    9. To revert to Oracle Application Express Release 4.1:

      • Change your working directory to apex/core in the 4.1 source.

      • 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
        
      • Execute the following commands:

        @wwv_flow_val.plb
        @wwv_dbms_sql.sql
        @wwv_dbms_sql.plb
        
      • Change your working directory to apex in the 4.1 source.

      • 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
        
      • Execute the following:

        set define '^'
         
        @apexvalidate x x APEX_040100
        ALTER SESSION SET CURRENT_SCHEMA = APEX_040100;
        exec apex_040100.wwv_flow_upgrade.switch_schemas('APEX_040200','APEX_040100');
        ALTER SESSION SET CURRENT_SCHEMA = SYS;
        exec validate_apex;
        
  4. See the next section, "Removing the Oracle Application Express Release 4.2 Schema".

A.3.1.3 Removing the Oracle Application Express Release 4.2 Schema

After you have reverted to the prior release you can remove the Oracle Application Express 4.2 schema.

To remove the release 4.2 schema:

  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_040200 CASCADE;
    

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

A.3.2 Removing Oracle Application Express from the Database

This section describes how to remove the Oracle Application Express schema, synonyms, and users from the database without deleting the database. If you are going to delete the database, then you must complete these steps.

Note:

Do not follow these steps if you have upgraded your database from a prior release, and still want to use the prior release of Oracle Application Express. For information about reverting to a prior release, see "Reverting to a Previous Release". If you are not sure whether you have completed a new installation or an upgrade installation, follow the steps in "Cleaning Up After a Failed Installation" to verify if a previous release of Application Express exists in the database

To remove Oracle Application Express from the database:

  1. Change your working directory to the apex directory where you unzipped the Oracle Application Express software.

  2. 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
      
  3. Execute the following command:

    SQL> @apxremov.sql
    
  4. After successfully removing Application Express using apxremov.sql, you must exit your current SQL*Plus session and reconnect prior to attempting another install using apexins.sql.

A.4 Images Displaying Incorrectly in Oracle Application Express

If images in Oracle Application Express do not display correctly, you may have more than one definition of the /i/ alias. To address this issue:

  • If possible, rename the first instance of /i/ to a different alias name.

  • Alternatively, copy the images from the ORACLE_HOME\apex\images directory to the directory defined by the first /i/ alias.

A.5 Page Protection Violation

This may be caused by manual alteration of protected page items. If this error occurs after installation when trying to log into Application Express, then stop and start the APEX Listener. If you are unsure of what caused this error, please contact the application administrator for assistance.

To learn more about stopping and starting the Oracle Application Express Listener server, see Oracle Application Express Listener Installation and Developer Guide.