0% found this document useful (0 votes)
31 views37 pages

12c NonCDB To 19c NonCDB Manual Upgrade-Article

The document describes the steps to upgrade an Oracle database from version 12c to 19c using the command line DBUPGRADE utility. It outlines pre-requisites like checking certification matrices, taking an RMAN backup, validating object structures. The key steps involve running the preupgrade tool, completing pre-upgrade tasks like resizing tablespaces, gathering stats and dropping the recycle bin. The actual upgrade is run from the 19c Oracle home followed by post upgrade tasks like running fixup scripts, upgrading timezones and validating the database registry.

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views37 pages

12c NonCDB To 19c NonCDB Manual Upgrade-Article

The document describes the steps to upgrade an Oracle database from version 12c to 19c using the command line DBUPGRADE utility. It outlines pre-requisites like checking certification matrices, taking an RMAN backup, validating object structures. The key steps involve running the preupgrade tool, completing pre-upgrade tasks like resizing tablespaces, gathering stats and dropping the recycle bin. The actual upgrade is run from the 19c Oracle home followed by post upgrade tasks like running fixup scripts, upgrading timezones and validating the database registry.

Uploaded by

mnsamysuresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

www.ktexperts.

com

UPGRADE ORACLE DATABASE (12c TO 19c)


Manual Command-Line Upgrade (DBUPGRADE)

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.

OUR TESTING ENVIRONMENT


For this upgrade I have prepared a virtual machine using (oracle virtual box) and Installed RedHat
Enterprise Linux 7.9 on which Oracle 12cR2 non-container database is running.

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 1 of 37
www.ktexperts.com

Oracle database upgrade steps can be summarised as follows

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

2. RUN PREUPGRADE.JAR UTILITY


a. Review Pre-Upgrade Logfiles

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

4. UPGRADE DATABASE STEPS


a. Start Database in Upgrade Mode From 19c Home
b. Run Dbupgrade From 19c Home
c. After Upgrade Simply Start the Database From 19c Home
d. After Upgrade Check the Registry

5. POST UPGRADE STEPS


a. Post Upgrade Run Utlrp.Sql
b. Run Post Upgrade Fixup Sql Script
c. Upgrade Timezone
d. Run Utlusts.Sql
e. Run Catuppst.Sql
f. Rerun Post Upgrade Fixup Sql Script
g. Check Invalid Counts
h. Drop Restore Point
i. Set 19c Compatible Parameter
j. Verify Dbregistry – Final Check

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 2 of 37
www.ktexperts.com

UPGRADE ORACLE DATABASE (12c TO 19c)


Manual Command-Line Upgrade (DBUPGRADE)

DATABASE UPGRADE CERTIFICATION MATRIX

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

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 3 of 37
www.ktexperts.com

ORACLE 19c BINARIES INSTALLATION FOR UPGRADE

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

unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.0.0/dbhome_1

Install the Oracle 19c Database software

$ ./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

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 4 of 37
www.ktexperts.com

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)

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 5 of 37
www.ktexperts.com

In install step 4 we will specify the ORACLE BASE location

In install step 5 we will define the groups privileges (choose the defaults)

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 6 of 37
www.ktexperts.com

In install step 6 we will not choose anything

In install step 7 we do the prerequisite checks (fix the checks then only proceed to next step)

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 7 of 37
www.ktexperts.com

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.

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 8 of 37
www.ktexperts.com

In install step 9 we can see the installation progress

In install step 9 run the root.sh script as root user (don’t skip it)

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 9 of 37
www.ktexperts.com

In install step 10 we can see database software installation was successful.

DATABASE RMAN BACKUP

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 10 of 37
www.ktexperts.com

DATABASE RMAN BACKUP

As a prerequisite it Is recommended to take the full backup of the database.

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

$ORACLE_HOME/bin/rman msglog=${LOG_FILE} << EOF

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

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 11 of 37
www.ktexperts.com

LOOK FOR INVALID OBJECTS

As a prerequisite it Is recommended to check for the invalid objects in the container database. In our
case there are no invalid objects.

CREATE THE REQUIRED DIRECTORY

As a prerequisite we will create a directory location to keep all the upgrade logs and files

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 12 of 37
www.ktexperts.com

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.

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 13 of 37
www.ktexperts.com

VIEW PRE UPGRADE LOG

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 14 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 15 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 16 of 37
www.ktexperts.com

VERIFY TABLESPACE SIZE

GATHER DICTIONARY STATS

Before the upgrade process, gather stats. One of the recommendations is to export the stats as well.

PURGE RECYCLE BIN

Before the upgrade process, empty the recycle bin.

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 17 of 37
www.ktexperts.com

RUN PREUPGRADE FIXUP SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 18 of 37
www.ktexperts.com

VERIFY ARCHIVE DEST SIZE

Ensure you have enough free space in db_recovery_file_dest and make changes to the parameter
db_recovery_file_dest_size if needed.

STOP DATABASE LISTENER

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 19 of 37
www.ktexperts.com

CREATE FLASHBACK GUARANTEED RESTORE POINT

From 11.2.0.1 onwards we Don’t change the


The Database need to be in
don’t require to enable the compatible parameter to
Archive Log mod
Flashback Database higher version

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 20 of 37
www.ktexperts.com

SHUTDOWN DATABASE

COPY [SPFILE/PASSWORD] FILES FROM 12C TO 19C ORACLE HOME

EDIT ORATAB – MAKE 19C ORACLE HOME ACTIVE

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 21 of 37
www.ktexperts.com

START DATABASE IN UPGRADE FROM 19C HOME

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 22 of 37
www.ktexperts.com

RUN DBUPGRADE FROM 19C HOME

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 23 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 24 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 25 of 37
www.ktexperts.com

AFTER UPGRADE SIMPLY START THE DATABASE FROM 19C HOME

AFTER UPGRADE CHECK THE REGISTRY

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 26 of 37
www.ktexperts.com

POST UPGRADE RUN UTLRP.SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 27 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 28 of 37
www.ktexperts.com

RUN POST UPGRADE FIXUP SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 29 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 30 of 37
www.ktexperts.com

UPGRADE TIMEZONE

In 18c and 19c release, the $ORACLE_HOME/rdbms/admin/u


timezone upgrade scripts are tltz_upg_check.sql
included in the target Time zone upgrade check
ORACLE_HOME under
rdbms/admin directory. script

$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.

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 31 of 37
www.ktexperts.com

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 32 of 37
www.ktexperts.com

RUN UTLUSTS.SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 33 of 37
www.ktexperts.com

RUN CATUPPST.SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 34 of 37
www.ktexperts.com

RERUN POST UPGRADE FIXUP SQL

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 35 of 37
www.ktexperts.com

CHECK INVALID COUNTS

DROP RESTORE POINT

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 36 of 37
www.ktexperts.com

SET COMPATIBLE PARAMETER

VERIFY DBREGISTRY – FINAL CHECK

ORACLE DATABASE UPGRADE MOHAMMAD SHOAIB ANSARI


Page 37 of 37

You might also like