12c NonCDB To 19c NonCDB Manual Upgrade-Article
12c NonCDB To 19c NonCDB Manual Upgrade-Article
com
In this article I have followed the steps to directly upgrade non-Container database from 12c to 19c
because direct upgrade to 19c is possible from database versions like 11.2.0.4/12.1.0.2/12.2.0.1/18c.
1. PRE-REQUISITES
a. Check Database Upgrade Certification Matrix
b. Check OS Certification Matrix
c. Oracle 19c Binaries Installation for Upgrade
d. Oracle 12c Database RMAN Backup
e. Check For Invalid Objects
f. Create Directory to keep Upgrade Logs
3. PRE-UPGRADE STEPS
a. Verify Tablespace Size
b. Gather Dictionary Stats
c. Purge Recycle Bin
d. Run Preupgrade Fixup Sql Script
e. Verify Archive Destination Size
f. Stop Database Listener
g. Create Flashback Guaranteed Restore Point
h. Shutdown 12cR2 Database
i. Copy [Spfile/Password] Files From 12c To 19c Oracle Home
j. Edit Oratab – Make 19c Oracle Home Active
The upgrade path depends on the current database version. Some upgrades are easy and direct, while
others require more time and effort. In direct upgrade we use the Database Upgrade Assistant (DBUA)
or command-line upgrade script to upgrade the database to Oracle Database 19c. Direct upgrade is
supported when the source database is running one of the releases shown in the following table.
OS CERTIFICATION MATRIX
In our testing environment we are running RHEL 7.9 Operating system, so we used the below
certification matrix to confirm that oracle database 19c is supported on RHEL 7.5+ / RHEL 8
We download the oracle database 19c software and uploaded zip file into our database server
(OMMAC1).
Create Oracle Home Location for 19c database using following command
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
unzip the 19c software file in 19c oracle home using following command
$ ./runInstaller
(We can install 19c before upgrade to save downtime and we will use different Oracle Home
location from existing Oracle 12c Home.)
In install step 1 we will choose the second option as it will just install the s/w and not create any DB
In install step 2 we choose first option as s/w installation will be for NON-RAC environment
In install step 3 we choose the first option as oracle s/w is enterprise edition (EE)
In install step 5 we will define the groups privileges (choose the defaults)
In install step 7 we do the prerequisite checks (fix the checks then only proceed to next step)
In install step 7 we do the prerequisite checks (here we can skip the check as it is just a warning)
In install step 8 we see the summary of all that we have chosen during the install wizard.
In install step 9 run the root.sh script as root user (don’t skip it)
We used the below shell script to take the RMAN backup of database (datafiles, controlfiles, spfile
and archive logs) files.
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME/u01/app/oracle/product/12.2.0.1/db_1
export ORACLE_SID=SHOAIBCDB
export BACKUP_LOCATION=/u02/oracle/backup/shoaibncdb12c
LOG_FILE=${BACKUP_LOCATION}/db_rman_backup.log
connect target /
run {
allocate channel d1 type disk;
backup database format ‘/u02/oracle/backup/shoaibncdb12c/db_%d_%u_%s.bkp’;
release channel d1;
}
sql 'alter system archive log current’;
run {
allocate channel a1 type disk;
backup archivelog all format ‘/u02/oracle/backup/shoaibncdb12c/arch_%d_%u_%s.bkp’;
release channel a1;
}
run {
allocate channel c1 type disk;
backup current controlfile for standby format
‘/u02/oracle/backup/shoaibncdb12c/Control_%d_%u_%s.bkp’;
release channel c1;
}
exit;
EOF
As a prerequisite it Is recommended to check for the invalid objects in the container database. In our
case there are no invalid objects.
As a prerequisite we will create a directory location to keep all the upgrade logs and files
PREUPGRADE
In below screenshot we have executed the preupgrade.jar from the 19c Oracle Home. The
preupgrade.jar output provides pre and post upgradation recommendation fixup sql script. The pre
and post upgradation fixup sql scripts can be located in the directory location as created above. In the
output we also get the command to run the pre and post fixup steps.
Before the upgrade process, gather stats. One of the recommendations is to export the stats as well.
Ensure you have enough free space in db_recovery_file_dest and make changes to the parameter
db_recovery_file_dest_size if needed.
SHUTDOWN DATABASE
UPGRADE TIMEZONE
$ORACLE_HOME/rdbms/admin/utltz_upg_ap
ply.sql
Time zone apply script.
Warning: This script will restart the
database and adjust time zone data.
RUN UTLUSTS.SQL
RUN CATUPPST.SQL