How to upgrade Oracle database to 19c (NON-CDB)

1)   Download 19C software from below:

 

https://www.oracle.com/database/technologies/oracle19c-solarisx86-downloads.html

2)   Certified Platforms (check certification matrix from oracle support site)

 

Oracle Solaris (SPARC systems, 64-bit)

  • Oracle Solaris 11.4 or later We are on same version

$ cat /etc/*release*

NAME="Oracle Solaris"

PRETTY_NAME="Oracle Solaris 11.4"

CPE_NAME="cpe:/o:oracle:solaris:11:4"

ID=solaris

VERSION=11.4

VERSION_ID=11.4

BUILD_ID=11.4.41.0.1.107.2

HOME_URL="https://www.oracle.com/solaris/"

SUPPORT_URL="https://support.oracle.com/"

VARIANT_ID=sru

VARIANT="Support Update"

Oracle Solaris 11.4 SPARC

Copyright (c) 1983, 2021, Oracle and/or its affiliates.

Assembled 15 December 2021

$

  • Oracle Solaris 11.3  or later

 

3)  Installing Oracle Database RPM Manually for other Platforms :

 

    1. Log in as root.
    2. Download and install the Oracle Database Preinstallation RPM:

 

Oracle Solaris (SPARC systems, 64-bit)

To install the oracle-database-preinstall-19c group packages, log in as root, and run the following command on Oracle Solaris 11.3 and later systems:

# pkg install oracle-database-preinstall-19c

Before you install oracle-database-preinstall-19c:

a. Use the -n option to check for errors:

# pkg install -n oracle-database-preinstall-19c

b. If you have the oracle user and other user groups already defined, and do not want to change them:

# pkg avoid oracle-database-os-configuration

 

On Oracle Linux

# yum -y install oracle-database-preinstall-19c

On Red Hat Enterprise Linux

# curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

After successful installation, you can delete the downloaded RPM file:

# rm oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

 

4)  Install Oracle Database 19c

Log in to the database server node as the owner of the Oracle RDBMS file system and database instance. Ensure that environment settings, such as ORACLE_HOME, are set for the new Oracle home you are about to create, and not for any existing Oracle homes on the database server node.

Download and unzip Oracke 19c database software and follow below screenshots to install 19C binaries: (recommended : use exiting 12c ORACLE_HOME for 19c and create directory 19.0.0

Suppose your existing 12c ORACLE_HOME /ORACLE_BASE/product/12.1.0.2 the

mkdir -p /ORACLE_BASE/product/19.0.0

unzip Oracke 19c database software to /ORACLE_BASE/product/19.0.0

 

cd /ORACLE_BASE/product/19.0.0

$ ./runInstaller

 

5)   Follow below screenshots:

 

A screenshot of a computer

AI-generated content may be incorrect.

 

 

Select ORACLE_BASE and software location according to your environment:

A screenshot of a computer

AI-generated content may be incorrect.

Check below details and select according to your environment if oracle user setup with different groups (usually oinstall/dba):

 

Check below details, username should be your OS oracle username which you used to login/configure database:

 

 

A screenshot of a computer

AI-generated content may be incorrect.

 

 

A screenshot of a software

AI-generated content may be incorrect.

 

 

6)  Run below to gather dianostic information:

cd <location of the script>
$ sqlplus / as sysdba
sql> alter session set nls_language='American';
sql> @dbupgdiag.sql
sql> exit

Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql) (Doc ID 556610.1)

How to Handle Materialized Views When You Upgrade or Clone a Database (Doc ID 1406586.1)

 

7)  Gather information of total objects count before upgrade:

SQL> select OBJECT_TYPE,count(*) from dba_objects group by OBJECT_TYPE;

 

OBJECT_TYPE COUNT(*)

----------------------- ----------

INDEX 14547

JOB CLASS 15

CONTEXT 9

TABLE SUBPARTITION 300

CUBE DIMENSION 2

TYPE BODY 281

INDEXTYPE 7

DESTINATION 2

PROCEDURE 531

RESOURCE PLAN 12

JAVA CLASS 32044

RULE 12

TABLE PARTITION 3991

JAVA RESOURCE 1074

SCHEDULE 4

WINDOW 9

INDEX SUBPARTITION 883

TABLE 8212

TYPE 3392

VIEW 12371

LIBRARY 218

FUNCTION 652

TRIGGER 250

MATERIALIZED VIEW 163

PROGRAM 9

JAVA SOURCE 2

DATABASE LINK 150

CLUSTER 14

SYNONYM 43338

PACKAGE BODY 3108

QUEUE 110

CONSUMER GROUP 19

EVALUATION CONTEXT 36

DIRECTORY 28

RULE SET 86

SCHEDULER GROUP 4

UNIFIED AUDIT POLICY 7

JAVA DATA 327

DIMENSION 156

OPERATOR 54

UNDEFINED 16

EDITION 2

SEQUENCE 710

LOB 1195

PACKAGE 3178

INDEX PARTITION 4134

XML SCHEMA 42

JOB 42

LOB PARTITION 126

LOB SUBPARTITION 48

 

50 rows selected.

 

SQL>

 

 

8)  Upgrade 12c database to 19c using DBUA

 

cd $ORACLE_HOME/bin (19c database OH /ORACLE_BASE/product/19.0.0)

./dbua

 

NOTE: If you have multiple databases running on the same server then choose correct Database which you are planning to upgrade.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Make sure you select all below fields including upgrade timezone data:

 

 

Choose if you want to use RMAN backup option which may take longer time.

In my case I have taken manual RMAN backup L0 before update so I have chosen “I have my one backup and restore strategy”

 

 

 

 

 

Crosscheck below details of source database & target database:

 

 

Check details, click finish and continue monitor progress and logfiles for any fialures:

 

 

 

 

 

 

 

 

 


Post upgrade check All Components UPGRADED, for INVALID you need to fix.

Example: For XDB showing invalid, I applied fix and its VALID.

 

col comp_name format a40

 

SELECT comp_name, version, status

FROM dba_registry;

 

 

 

9)  Post Upgrade Steps:

 

9.1 Check upgrade status

Execute dbupgdiag.sql and review the logs.  To download this script refer to Note 556610.1

9.2 Recompile INVALID Objects

Execute utlrp.sql multiple times till the number of INVALID objects becomes constant

$ sqlplus "/ AS SYSDBA"
SQL> @Oracle_home/rdbms/admin/utlrp.sql

 

9.3 Setting Environment variables on Linux and Unix

Confirm that the following environment variables point to the directories of the new Oracle home:

ORACLE_HOME
PATH

 

 

9.4 Check oratab entry contains 19c OH:

 

cat /var/opt/oracle/oratab

 

# This file is used by ORACLE utilities. It is created by root.sh

# and updated by either Database Configuration Assistant while creating

# a database or ASM Configuration Assistant while creating ASM instance.

 

# A colon, ':', is used as the field terminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

# $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively. The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

dwu1:/ORACLE_BASE/product/19.3.0:N

 

9.5 Compile invalid objects manually post upgrade:

 

Spool below scripts to .sql and execute them:

 

select 'alter package '||OWNER||'.'||OBJECT_NAME||' compile body;' from dba_objects where object_type like '%package%body%' and status='INVALID';

select 'alter procedure '||OWNER||'.'||OBJECT_NAME||' compile;' from dba_objects where object_type like '%PROCED%' and status='INVALID';

select 'alter view '||OWNER||'.'||OBJECT_NAME||' compile;' from dba_objects where object_type like '%VIEW%' and status='INVALID'

 

9.6 Post-upgrade fixup script

Execute post-upgrade fixup scripts generated by the pre-upgrade script.

SQL> @postupgrade_fixups.sql

 

 

 

 

 

9.7 Create or Migrate Your Password File with ORAPWD

 

 

SQL> show parameter REMOTE_LOGIN_PASSWORDFILE

 

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

remote_login_passwordfile string EXCLUSIVE

SQL>

 

 

9.8 Recovery Catalog Upgrade (optional)

 

RMAN> connect rcvcat <catlog_rman_user>/<password>@<RMAN_CATALOG_DB>;

 

connected to recovery catalog database

PL/SQL package RMAN.DBMS_RCVCAT version 12.01.00.02. in RCVCAT database is too old

 

RMAN> UPGRADE CATALOG;

 

recovery catalog owner is RMAN

enter UPGRADE CATALOG command again to confirm catalog upgrade

 

RMAN> UPGRADE CATALOG;

 

recovery catalog upgraded to version 19.03.00.00.00

DBMS_RCVMAN package upgraded to version 19.03.00.00

DBMS_RCVCAT package upgraded to version 19.03.00.00.

 

RMAN>

 

 

10 ISSUE/FIXES

 

Most of the upgrades, upgrade timezone steps fails, Execute below steps in sequence to fix.

10.1 Upgrade the Time Zone File Version After Upgrading Oracle Database

 

$ORACLE_HOME/rdbms/admin/utltz_countstats.sql

$ORACLE_HOME/rdbms/admin/utltz_countstar.sql

$ORACLE_HOME/rdbms/admin/utltz_upg_check.sql

?/rdbms/admin/utltz_upg_apply.sql

Post a Comment

0 Comments