Upgrade Oracle 12c Database To 19c v1.4
Upgrade Oracle 12c Database To 19c v1.4
21/02/2020
Steve McDonald
Version 1.4
Revised
REMOVE ANY EXISTING 19C INIT OR SPFILES FOR DATABASE IF THEY EXIST AS IT BREAKS
THE UPGRADE.
Remove Case Sensitive Logon line from the init ora file.
Export the spfile to the initfile:
$ cd /u01/app/oracle/product/12.2.0.1/ee_1/dbs/
$ sqlplus / as sysdba
$ rm spfile<TARGET>.ora
Remove the following line from init file and start the database:
Edit: init<TARGET>.ora
*.sec_case_sensitive_logon=FALSE
SQL> startup;
$ .oraenv to the original 12c home and run from the 19.0.0.0 home
Run the pre upgrade fixes (Maybe not needed when using GUI)
@/u01/app/oracle/cfgtoollogs/IBMSUAT3/preupgrade/preupgrade_fixups.sql
Gather Dictionary Statistics, Purge Recycle Bin & Compile all Invalid Objects
Ensure the Database is started.
$ sqlplus / as sysdba
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
SQL> PURGE DBA_RECYCLEBIN;
SQL> @?/rdbms/admin/utlrp.sql;
Installation
As Oracle ensure the Database is started and run the Database Upgrade Assistant from a GUI via iLO.
$ . oraenv
$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/ee_1
$ export PATH=$ORACLE_HOME/bin:$PATH
$ dbua
Click “Next” (Read the warnings, get educated then click “Next”)
Click “Next”
Click “Next”
Click “Finish”
begin
DBMS_STATS.unlock_table_stats('RATINGS', 'DEMO_PRED_SUMMARY');
DBMS_STATS.gather_schema_stats(ownname => 'RATINGS');
DBMS_STATS.lock_table_stats('RATINGS', 'DEMO_PRED_SUMMARY');
end;
EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
EXEC DBMS_STATS.GATHER_TABLE_STATS(ownname=>'XDB',tabname=>'XDB$RESOURCE',estimate_percent=>NULL);
This next stats takes AGES
EXEC dbms_stats.gather_database_stats(DBMS_STATS.AUTO_SAMPLE_SIZE,degree=>8,cascade=>true);