Database Upgrade - Manual
Database Upgrade - Manual
======
https://www.br8dba.com/upgrade-oracle-database-manually-from-12-2-0-1-to-19c/
https://www.youtube.com/watch?v=F5lI0r_cRFY
--> Create a backup dir and back up important files like listener.ora, sqlnet.ora,
tnsnames.ora and spfile.
mkdir /u01/backup
cd $ORACLE_HOME/network/admin
cp -p listener.ora sqlnet.ora tnsnames.ora /u01/backup/
cd $ORACLE_HOME/dbs
cp -p spfiletest.ora orapwtest /u01/backup/
--> Copy 19c software into new db home and install Oracle 19c software.
mkdir -p /u02/app/oracle/product/19c/db_1
chown -R oracle:oinstall /u02/
unzip
./runInstaller (refer to patching note if you want to apply patches)
--> Make a dir for the pre-upgrade script, then run the script
mkdir -p /u02/preupgrade
/u01/app/oracle/product/12c/db_1/jdk/bin/java -jar
/u02/app/oracle/product/19c/db_1/rdbms/admin/preupgrade.jar FILE DIR
/u02/preupgrade
BEFORE UPGRADE
==============
REQUIRED ACTIONS
================
None
RECOMMENDED ACTIONS
===================
1. (AUTOFIXUP) Gather stale data dictionary statistics prior to database
upgrade in off-peak time using:
EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
INFORMATION ONLY
================
3. To help you keep track of your tablespace allocations, the following
AUTOEXTEND tablespaces are expected to successfully EXTEND during the
upgrade process.
Min Size
Tablespace Size For Upgrade
-
SYSAUX 470 MB 500 MB
SYSTEM 800 MB 912 MB
TEMP 32 MB 150 MB
UNDOTBS1 70 MB 439 MB
The above can be fixed by extending the tablespace files and executing the data
dict query.
For 1
=====
SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
For 3
======
Identify the data files associated with each tablsspace and resize accordingly.
Database altered.
Database altered.
Database altered.
UPGRADE STEPS
=============
--> Copy backed up files to their default locations in the new database home
[oracle@testone ~]$ cd /u01/backup/
[oracle@testone backup]$
[oracle@testone backup]$ cp spfiletest.ora orapwtest
/u02/app/oracle/product/19c/db_1/dbs
[oracle@testone backup]$ cp listener.ora tnsnames.ora
/u02/app/oracle/product/19c/db_1/network/admin/
--> Create an env variable for new database home. Set it once done.
[oracle@testone ~]$ cat 19c.env
export PATH
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u02/app/oracle
export DB_HOME=$ORACLE_BASE/product/19c/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=test
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
POST UPGRADE
=============
VERSION
----------
32
1 row selected.
Rerun postupgrade_fixups.sql
SQL> @/u02/preupgrade/postupgrade_fixups.sql
P.S: Restore files are kept in the recovery path as seen below
[oracle@testone u02]$ ls /u01/app/oracle/fast_recovery_area/test/TEST/flashback/
o1_mf_mg0ocnpo_.flb o1_mf_mg0ocvq0_.flb o1_mf_mg0sdbjo_.flb o1_mf_mg0v2t59_.flb
o1_mf_mg0vnk3j_.flb