Upgrade 12.1 to 12.2
set ORACLE_SID=xxx
set ORACLE_HOME=D:\oracle\product\12.1.0\dbhome_1
set PATH=%ORACLE_HOME%\bin;%PATH%

cd /d %ORACLE_HOME%\bin

sqlplus / as sysdba

SET LINESIZE 400

COLUMN action_time FORMAT A20
COLUMN action FORMAT A10
COLUMN status FORMAT A10
COLUMN description FORMAT A40
COLUMN version FORMAT A10
COLUMN bundle_series FORMAT A10

SELECT TO_CHAR(action_time, 'DD-MON-YYYY HH24:MI:SS') AS action_time,
       action,
       status,
       description,
       version,
       patch_id,
       bundle_series
FROM   sys.dba_registry_sqlpatch
ORDER by action_time;


 Display the installed components with version:
set pagesize 50
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name;

	Run the 12.2 preupgrade script in the 12.1 pdb
set ORACLE_HOME122=D:\oracle\product\12.2.0\dbhome_1
%ORACLE_HOME%/jdk/bin/java -jar %ORACLE_HOME122%/rdbms/admin/preupgrade.jar dir C:\Temp 
Preupgrade generated files:
    C:\TEMP\preupgrade.log
    C:\TEMP\preupgrade_fixups.sql
    C:\TEMP\postupgrade_fixups.sql