Hello,
I got the following error of APEX while upgrading the PDB database from lower version to upper by unplug and plug method.
Error:
ERROR at line 1: ORA-65346: The PDB version is lower and components (APEX) are missing in CDB.
1- Check the APEX detail with following
select COMP_ID, VERSION, STATUS from CDB_REGISTRY where COMP_ID='APEX' order by CON_ID;
select r.COMP_NAME, r.VERSION, c.NAME, c.CON_ID from CDB_REGISTRY r, V$CONTAINERS c where r.CON_ID=c.CON_ID and r.COMP_ID='APEX' order by CON_ID;
2- Remove the Apex from CDB
Go to the Oracle home apex directorycd %ORACLE_HOME%\apex
3- Connect with CDB$ROOT and check all pdb is open state.
sqlplus sys as sysdba
alter pluggable database open all;
4-Remove APEX from the CDB$ROOT and all pluggable database.
sqlplus "sys/syspass as sysdba" @apxremov_con
5- Recompile all invalid objects
@?\rdbms\admin\utlrp.sql
select object_name, status from dba_objects where status='INVALID';
6- Check registry for APEX entry.
select COMP_ID, STATUS from DBA_REGISTRY where COMP_ID='APEX';
No row selected.
7- Go to the Oracle home apex directory
cd %ORACLE_HOME%\apex
8- Connect with CDB$ROOT and check all pdb is open state.
sqlplus sys as sysdba
alter pluggable database open all;
9- Install apex in PDB1 database
Syntex:
@apexins.sql tablespace_apex tablespace_files tablespace_temp images
Example:
alter session set container=PDB1;
@apexins.sql SYSAUX SYSAUX TEMP /i/
10- You can also change password for apex.
SQL> @apxchpwd.sql
11- Create the APEX_LISTENER and APEX_REST_PUBLIC_USER users
SQL> @apex_rest_config.sql
12- Unlock the apex user.
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY Password ACCOUNT UNLOCK;