Upgrade PDB 12.1 to 12.2 PDB(Pluggable database)
Source Version - 12.1.0.2.0
Upgrade Version - 12.2.0.1.0
Pluggable Database Name - PDB
Upgrade Version - 12.2.0.1.0
Pluggable Database Name - PDB
Steps:
1.Check the version of the pluggable database
2.Check pdb name using show pdbs command
3.Run pre-upgrade script
[oracle@localhost ~]$ /u01/oracle/product/12.1.0/db_1/jdk/bin/java -jar /u01/oracle/product/12.2.0/db_1/rdbms/admin/preupgrade.jar FILE DIR /u01/upgrade
Preupgrade generated files:
/u01/upgrade/preupgrade.log
/u01/upgrade/preupgrade_fixups.sql
/u01/upgrade/postupgrade_fixups.sql
[oracle@localhost ~]$
4.Login to pdb and run the preupgrade_fixup script
SQL> @/u01/upgrade/preupgrade_fixups_PDB.sql
Executing Oracle PRE-Upgrade Fixup Script
Auto-Generated by: Oracle Preupgrade Script
Version: 12.2.0.1.0 Build: 1
Generated on: 2018-08-29 07:33:31
For Source Database: CDB1
Source Database Version: 12.1.0.2.0
For Upgrade to Version: 12.2.0.1.0
Executing in container: PDB
Fixup
Check Name Status Further DBA Action
---------- ------ ------------------
dictionary_stats Passed None
apex_upgrade_msg Failed Manual fixup recommended.
PL/SQL procedure successfully completed.
5.run preupgrade_fixups_PDB.sql
SQL> @/u01/upgrade/preupgrade_fixups_PDB.sql
Executing Oracle PRE-Upgrade Fixup Script
Auto-Generated by: Oracle Preupgrade Script
Version: 12.2.0.1.0 Build: 1
Generated on: 2018-08-29 07:33:31
For Source Database: CDB1
Source Database Version: 12.1.0.2.0
For Upgrade to Version: 12.2.0.1.0
Executing in container: PDB
Fixup
Check Name Status Further DBA Action
---------- ------ ------------------
dictionary_stats Passed None
apex_upgrade_msg Failed Manual fixup recommended.
Note: As I am upgrading pdb using migrating pdb to empty container I need to remove apex from Source pdb.
6.Remove apex
cd $ORACLE_HOME/apex
SQL> spool apexremove
SQL> @apxremov_con.sql
7.Check after removing apex is there any invalid component exists
SQL> select COMP_ID, STATUS from DBA_REGISTRY where COMP_ID='APEX';
Compile them using utlrp.sql
SQL> @?/rdbms/admin/utlrp.sql
8.Close pdb
SQL> alter pluggable database pdb close immediate;
9.Unplug pdb
SQL> alter pluggable database pdb unplug into '/u02/pdb_121.xml';
10.Connect to an empty container of 12.2 and create pdb using xml file
SQL> CREATE PLUGGABLE DATABASE PDB USING '/u02/pdb_121.xml';
11.Check the pluggable database
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB MOUNTED
12.Open pdb in upgrade mode
SQL>alter pluggable database pdb open upgrade;
13.Run catupgrd.sql
[oracle@localhost admin]$ $ORACLE_HOME/perl/bin/perl catctl.pl -c 'PDB' catupgrd.sql
14.Monitor catupgrd.sql
15.Open pdb in normal mode and Check pdb state
SQL> alter pluggable database pdb open;
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO