Skip to main content

Upgrade Oracle Database 12c to 19c by DBUA Method

 

Introduction

Upgrade Oracle Database is a crucial step to ensure you're benefiting from the latest features, performance enhancements, and security updates. In this guide, we'll walk you through the process of upgrading your Oracle Database 12c to the latest version, 19c.

Follow these steps to ensure a smooth and successful upgrade

Environment

Hostname: prod.infoinflux.com
Database Name: PROD
DB VERSION : 12.2.0.1.0
ORACLE_BASE: /u01/app/oracle
DB Home Path: /u01/app/oracle/product/12.2.0.1/db_1
Datafile Location: /u01/app/oracle/oradata/PROD
Target DB VERSION: 19.0.0.0
Target DB Path: /u01/app/oracle/product/19c/db_1
Upgrade Method: Database Upgrade Assistant

Steps For upgrade using Database Upgrade Assistant (DBUA):

  1. Take Latest Database backup
  2. Make Directory for 19c Home
  3. Download and Unzip Software to 19c Home Directory
  4. Install 19c Binary or Software
  5. Create Pre and Post Upgrade Scripts
  6. Run Pre-Upgrade Script
  7. Pre-Upgrade Prerequisites & create guarantee restore Point
  8. Upgrade Database with Database Upgrade Assistant(DBUA)
  9. Validate Upgrade & Run Post-upgrade Script
  10. Drop Restore Point & Change Compatible Parameter

1. Take Latest Database backup

Create Directory for Keeping backup Files: mkdir -p /u01/db_backup/PROD/Other_Files
RMAN BACKUP Location: /u01/db_backup/PROD/

RMAN Backup Taken through Below Script
========================================

run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup database format '/u01/db_backup/PROD/PROD_%d_%U_DB.bkp';
sql 'alter system archive log current';
backup archivelog all format '/u01/db_backup/PROD/PROD_%d_%U_ArchiveLog.bkp';
backup current controlfile format '/u01/db_backup/PROD/PROD_%d_ControlFile.bkp';
release channel ch1;
release channel ch2;
}

Copy below files to separate backup folder:
** tnsnames.ora
** listener.ora
** sqlnet.ora
** pfile and spfile
** orapw file

Above Files Copy Location: /u01/db_backup/PROD/Other_Files

Create PFile and Current Control File on the same location:

##PFile##
=============

SQL> create pfile='/u01/db_backup/PROD/Other_Files/initPROD.ora' from spfile;

File created.



##Control File##
=================

SQL> alter database backup controlfile to trace as '/u01/db_backup/PROD/Other_Files/controlfile.txt';

Database altered.

2. Make Directory for 19c Home

##Make Directories and Give Permissions from Root User##
=================================================

mkdir -p /u01/app/oracle/product/19c/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

3. Download and Unzip Software to 19c Home Directory

Download or copy the 19c Database software from oracle user to any location as per your requirement. In this case it is /u01

Unzip it to 19c home location: /u01/app/oracle/product/19c/db_1

[oracle@prod u01]$ unzip DB_19C.zip -d /u01/app/oracle/product/19c/db_1

Note: If you copied or downloaded it from root user then you have need provide chmod 775 DB_19C.zip file and then unzip it from oracle user

4. Install 19c Binary or Software

Run the Installer:
[oracle@prod db_1]$
cd /u01/app/oracle/product/19c/db_1
Then
[oracle@prod db_1]$
./runInstaller
Launching Oracle Database Setup Wizard...

Follow the Screens below in Slides:

[metaslider id="1611"]

Run script from Root user : /u01/app/oracle/product/19c/db_1/root.sh

[root@prod ~]# /u01/app/oracle/product/19c/db_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19c/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA - Standalone Mode) is available at :
    /u01/app/oracle/product/19c/db_1/bin/tfactl

Note :
1. tfactl will use TFA Service if that service is running and user has been granted access
2. tfactl will configure TFA Standalone Mode only if user has no access to TFA Service or TFA is not installed
upgrade oracle database from 12c to 19c

Oracle Database 19c Binary installation completed successfully.

5. Create Pre and Post Upgrade Scripts

Generate Scripts:

Make Directory for Scripts
========================
[oracle@prod ~]$ mkdir -p /home/oracle/preupgrade



Set Environment
==================
[oracle@prod ~]$ . oraenv
ORACLE_SID = [PROD] ? PROD
The Oracle base remains unchanged with value /u01/app/oracle


Create Pre and Post Upgrade Scripts
================================
[oracle@prod ~]$ /u01/app/oracle/product/12.2.0.1/db_1/jdk/bin/java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/preupgrade.jar FILE DIR /home/oracle/preupgrade
==================
PREUPGRADE SUMMARY
==================
  /home/oracle/preupgrade/preupgrade.log
  /home/oracle/preupgrade/preupgrade_fixups.sql
  /home/oracle/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

Log into the database and execute the preupgrade fixups
@/home/oracle/preupgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups
@/home/oracle/preupgrade/postupgrade_fixups.sql

Preupgrade complete: 2023-08-22T20:24:48

View preupgrade.log:

[oracle@prod ~]$ cat /home/oracle/preupgrade/preupgrade.log
Report generated by Oracle Database Pre-Upgrade Information Tool Version
19.0.0.0.0 Build: 1 on 2023-08-22T20:24:47

Upgrade-To version: 19.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  PROD
     Container Name:  PROD
       Container ID:  0
            Version:  12.2.0.1.0
     DB Patch Level:  No Patch Bundle applied
         Compatible:  12.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  26
  Database log mode:  ARCHIVELOG
           Readonly:  FALSE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID
  JServer JAVA Virtual Machine           [to be upgraded]  VALID
  Oracle XDK for Java                    [to be upgraded]  VALID
  Real Application Clusters              [to be upgraded]  OPTION OFF
  Oracle Workspace Manager               [to be upgraded]  VALID
  OLAP Analytic Workspace                [to be upgraded]  VALID
  Oracle Label Security                  [to be upgraded]  VALID
  Oracle Database Vault                  [to be upgraded]  VALID
  Oracle Text                            [to be upgraded]  VALID
  Oracle XML Database                    [to be upgraded]  VALID
  Oracle Java Packages                   [to be upgraded]  VALID
  Oracle Multimedia                      [to be upgraded]  VALID
  Oracle Spatial                         [to be upgraded]  VALID
  Oracle OLAP API                        [to be upgraded]  VALID

==============
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;

      Dictionary statistics do not exist or are stale (not up-to-date).

      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  2.  (AUTOFIXUP) Gather statistics on fixed objects prior the upgrade.

      None of the fixed object tables have had stats collected.

      Gathering statistics on fixed objects, if none have been gathered yet, is
      recommended prior to upgrading.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  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                             460 MB       500 MB
      SYSTEM                             800 MB       912 MB
      TEMP                                32 MB       150 MB
      UNDOTBS1                            70 MB       439 MB

      Minimum tablespace sizes for upgrade are estimates.

  4.  Check the Oracle Backup and Recovery User's Guide for information on how
      to manage an RMAN recovery catalog schema.

      If you are using a version of the recovery catalog schema that is older
      than that required by the RMAN client version, then you must upgrade the
      catalog schema.

      It is good practice to have the catalog schema the same or higher version
      than the RMAN client version you are using.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PROD
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/home/oracle/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  5.  Upgrade the database time zone file using the DBMS_DST package.

      The database is using time zone file version 26 and the target 19 release
      ships with time zone file version 32.

      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 19 Oracle Database
      Globalization Support Guide.

  6.  To identify directory objects with symbolic links in the path name, run
      $ORACLE_HOME/rdbms/admin/utldirsymlink.sql AS SYSDBA after upgrade.
      Recreate any directory objects listed, using path names that contain no
      symbolic links.

      Some directory object path names may currently contain symbolic links.

      Starting in Release 18c, symbolic links are not allowed in directory
      object path names used with BFILE data types, the UTL_FILE package, or
      external tables.

  7.  (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Oracle recommends gathering dictionary statistics after upgrade.

      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  8.  Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      This recommendation is given for all preupgrade runs.

      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PROD
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/home/oracle/preupgrade/postupgrade_fixups.sql

6. Run Pre-Upgrade Script

Prerequisites before running preupgrade_fixups.sql:

Verify Tablespaces Size For Upgrade through below query
==================================================
SQL>set line 1000
set pages 5000
col tablespace_name for a30
col file_name for a80
col free_space for 9999999
compute sum of total_space on report
compute sum of free_space on report
compute sum of MAX_SPACE on report
break on tablespace_name on report nodup

select c.tablespace_name,a.autoextensible,a.file_name,a.total_space,b.free_space, round(b.free_space/a.total_space *100,2) "Free%",a.max_space from (select file_id,file_name,sum(bytes)/1024/1024 total_space,sum(MAXBYTES)/1024/1024/1024 max_space,autoextensible from dba_data_files group by file_id,file_name,autoextensible) a,(select file_id,nvl(sum(bytes)/1024/1024,0) free_space from dba_free_space group by file_id) b, (select tablespace_name,file_id from dba_data_files) c where a.file_id=b.file_id(+) and a.file_id=c.file_id order by tablespace_name;




Check Invalid Object Count
===========================
SQL> select count(*) from dba_objects where status='INVALID';

  COUNT(*)
----------
         0



Gather Dictionary Stats
========================
SQL> SET ECHO ON;
SQL> SET SERVEROUTPUT ON;
SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.




Purge Recyclebin
===================
SQL> PURGE DBA_RECYCLEBIN;

DBA Recyclebin purged.




Refresh Materialized Views
=========================
SQL> declare
list_failures integer(3) :=0;
begin
DBMS_MVIEW.REFRESH_ALL_MVIEWS(list_failures,'C','', TRUE, FALSE);
end;
/

PL/SQL procedure successfully completed.

Login in Database and run preupgrade_fixups.sql:

[oracle@prod ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Aug 22 20:27:05 2023

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> SET ECHO ON;
SQL> SET SERVEROUTPUT ON;
SQL> @/home/oracle/preupgrade/preupgrade_fixups.sql
SQL> REM
SQL> REM    Oracle PRE-Upgrade Fixup Script
SQL> REM
SQL> REM    Auto-Generated by:       Oracle Preupgrade Script
SQL> REM                             Version: 19.0.0.0.0 Build: 1
SQL> REM    Generated on:            2023-08-22 20:24:44
SQL> REM
SQL> REM    Source Database:         PROD
SQL> REM    Source Database Version: 12.2.0.1.0
SQL> REM    For Upgrade to Version:  19.0.0.0.0
SQL> REM
SQL>
SQL> REM
SQL> REM    Setup Environment
SQL> REM
SQL> SET ECHO OFF SERVEROUTPUT ON FORMAT WRAPPED TAB OFF LINESIZE 200;
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 1
Generated on:            2023-08-22 20:24:44

For Source Database:     PROD
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    1.  dictionary_stats          YES         None.
    2.  pre_fixed_objects         YES         None.
    3.  tablespaces_info          NO          Informational only.
                                              Further action is optional.
    4.  rman_recovery_version     NO          Informational only.
                                              Further action is optional.

The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database is not ready
for upgrade.  To resolve the outstanding issues, start by reviewing
the preupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.

PL/SQL procedure successfully completed.

7. Pre-Upgrade Prerequisites & create guranteed restore Point

Pre-Upgrade prerequisites

Note:
1. Archive Destination must have enough Space.

Validate Archivelog Mode
===========================
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     41
Next log sequence to archive   43
Current log sequence           43



Check db_recovery_file_dest_size & Increase it if required
===============================================
SQL> show parameter recovery;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/fast_recovery_
                                                 area/PROD
db_recovery_file_dest_size           big integer 8016M
recovery_parallelism                 integer     0
remote_recovery_file_dest            string




Increase the size of db_recovery_file_dest_size
=========================================
SQL> alter system set db_recovery_file_dest_size=15G scope=both;

System altered.



Check db_recovery_file_dest_size
================================
SQL> show parameter recovery;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /u01/app/oracle/fast_recovery_
                                                 area/PROD
db_recovery_file_dest_size           big integer 15G
recovery_parallelism                 integer     0
remote_recovery_file_dest            string

Create Flashback Guaranteed Restore Point

Note:
1. NO need to Enable Flashback Database from 11.2.1.0.1 onwards
2. Archive Log mode should be On

3. Compatible Parameter should be of current version

Flashback On Status
=====================
SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO




Archive Log Mode Check
========================
SQL> select name,open_mode,log_mode from v$database;

NAME      OPEN_MODE            LOG_MODE
--------- -------------------- ------------
PROD      READ WRITE           ARCHIVELOG




Compatible Parameter of Current version
====================================
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE




Check for any previous restore Point
=================================
SQL> select * from V$restore_point;

no rows selected




Create FlashBack Guarantee Restore Point
====================================
SQL> create restore point pre_upgrade guarantee flashback database;

Restore point created.




Check Restore Point Details
==========================
SQL> col name for a20
col GUARANTEE_FLASHBACK_DATABASE for a10
col TIME for a60
set lines 190
select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;

NAME                                GUARANTEE                                      TIME
-------------------- ---------- ------------------------------------------------------------
PRE_UPGRADE                         YES                      22-AUG-23 11.55.27.000000000 PM

8. Upgrade Database with Database Upgrade Assistant(DBUA)

Run dbua from 19c Home:
[oracle@prod ~]$ /u01/app/oracle/product/19c/db_1/bin/dbua

[metaslider id="1648"]

Database upgrade has been completed successfully, and the database is ready to use.

9.Validate Upgrade & Run Post-upgrade Script

Validate Upgrade

Verify /etc/oratab
===================
[oracle@prod ~]$ cat /etc/oratab | grep -i PROD

PROD:/u01/app/oracle/product/19c/db_1:N




Verify Time Zone
==================
SQL> SELECT version FROM v$timezone_file;

   VERSION
----------
        32
        
        
        
        
Check Invalid Objects
================        
SQL> select count(1) from dba_objects where status='INVALID';

  COUNT(1)
----------
         0
 
 
 

Verify DB Version
====================
SQL> select name,open_mode,version from v$database,v$instance;

NAME      OPEN_MODE            VERSION
--------- -------------------- -----------------
PROD      READ WRITE           19.0.0.0.0




Verify DBA_REGISTRY
====================
SQL> col COMP_ID for a10
col COMP_NAME for a40
col VERSION for a15
set lines 180
set pages 999
select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;

COMP_ID    COMP_NAME                                VERSION         STATUS
---------- ---------------------------------------- --------------- --------------------------------------------
CATALOG    Oracle Database Catalog Views            19.0.0.0.0      VALID
CATPROC    Oracle Database Packages and Types       19.0.0.0.0      VALID
JAVAVM     JServer JAVA Virtual Machine             19.0.0.0.0      VALID
XML        Oracle XDK                               19.0.0.0.0      VALID
CATJAVA    Oracle Database Java Packages            19.0.0.0.0      VALID
APS        OLAP Analytic Workspace                  19.0.0.0.0      VALID
RAC        Oracle Real Application Clusters         19.0.0.0.0      OPTION OFF
XDB        Oracle XML Database                      19.0.0.0.0      VALID
OWM        Oracle Workspace Manager                 19.0.0.0.0      VALID
CONTEXT    Oracle Text                              19.0.0.0.0      VALID
ORDIM      Oracle Multimedia                        19.0.0.0.0      VALID
SDO        Spatial                                  19.0.0.0.0      VALID
XOQ        Oracle OLAP API                          19.0.0.0.0      VALID
OLS        Oracle Label Security                    19.0.0.0.0      VALID
DV         Oracle Database Vault                    19.0.0.0.0      VALID

15 rows selected.

Run Post-Upgrade Script

Login in SQL & run: @/home/oracle/preupgrade/postupgrade_fixups.sql

SQL> @/home/oracle/preupgrade/postupgrade_fixups.sql

Session altered.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Package created.

No errors.

Package body created.


PL/SQL procedure successfully completed.

No errors.

Package created.

No errors.

Package body created.

No errors.
Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 1
Generated on:            2023-08-22 23:58:37

For Source Database:     PROD
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    3.  old_time_zones_exist      YES         None.
    4.  dir_symlinks              YES         None.
    5.  post_dictionary           YES         None.
    6.  post_fixed_objects        NO          Informational only.
                                              Further action is optional.

The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database upgrade is not
fully complete.  To resolve the outstanding issues, start by reviewing
the postupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.

PL/SQL procedure successfully completed.


Session altered.

10. Drop Restore Point & Change Compatible Parameter

Drop Restore Point

You Must drop restore point before changing the Compatible Parameter. As you cannot revert back once parameter is changed.

Check restore point name & details
===============================
SQL> col name for a20
col GUARANTEE_FLASHBACK_DATABASE for a10
col TIME for a60
set lines 190
select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;

NAME                 GUARANTEE_ TIME
-------------------- ---------- ------------------------------------------------------------
PRE_UPGRADE          YES        22-AUG-23 11.55.27.000000000 PM



Drop Restore Point
==================
SQL> drop restore point PRE_UPGRADE;

Restore point dropped.




Validate
=============
SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;

no rows selected

Change Compatible Parameter

Important: If the value of the COMPATIBLE parameter is changed to 19.0.0 then if for some reasons database needs to be downgraded to 12.2.0 we would not have any option other than export/import to downgrade the database. We can easily downgrade the database if for some reason it has to be downgraded to lower version before changing the COMPATIBLE parameter. That’s why it is recommended to change COMPATIBLE parameter once you are fully sure Upgraded database is performing well.

Check Current Compatible value
=================================
SQL> show parameter COMPATIBLE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE




Change Compatible value to upgrade version
========================================
SQL> ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;

System altered.



Restart Database
==============
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


SQL> startup
ORACLE instance started.
Total System Global Area 2516581464 bytes
Fixed Size                  8899672 bytes
Variable Size             536870912 bytes
Database Buffers         1962934272 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.



Validate Compatible Parameter value
==================================
SQL> show parameter COMPATIBLE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      19.0.0
noncdb_compatible                    boolean     FALSE




Validate Database version
=========================
SQL> select name,open_mode,version from v$database,v$instance;

NAME                 OPEN_MODE            VERSION
-------------------- -------------------- ---------------
PROD                 READ WRITE           19.0.0.0.0

Take Fresh Backup of Upgraded Database

Conclusion

Upgrading Oracle Database 12c to 19c is a vital task to stay up-to-date with the latest features and security enhancements. By following these steps and carefully preparing and executing the upgrade, you can ensure a smooth transition and reap the benefits of improved performance and functionality in Oracle Database 19c. Always refer to the official Oracle documentation and seek professional assistance if needed to ensure a successful upgrade process.

Comments

Popular posts from this blog

Install Oracle Linux 6 or any version in VM Virtual Box

 1. Download & Install Oracle Linux from the Link: https://www.oracle.com/in/virtualization/technologies/vm/downloads/virtualbox-downloads.html 2. Download any ISO file from the link: https://yum.oracle.com/oracle-linux-isos.html I have downloaded 6.8 version iso 3. Let’s create the Linux machine using the same ISO. Click on New for creating new virtual machine. 4. Now Put Name and create a folder naming PROD or any other name as per your requirement. In my case my system D drive has enough of space, so I created a folder naming PROD and download the ISO image in same drive. I have Selected ISO image which I downloaded. Note: Make sure you select Skip Unattended Installation. Click Next. 5. I have 16 GB ram in my system so I am giving 4 GB(4096 MB), you can gives as per your system resources. Click Next 6. Now give Hard disk size you want to assign to your machine. Select pre-allocate Full Size. Click Next. 7. It wi...

Create Local Yum Repository In Linux From ISO Image

 A local YUM repository in Linux is a collection of RPM (Red Hat Package Manager) packages stored on a local server or file system. YUM (Yellowdog Updater, Modified) is a package management tool commonly used in Red Hat-based Linux distributions like CentOS, Fedora, and Red Hat Enterprise Linux. It simplifies the process of installing, updating, and managing software packages on a Linux system. In this we'll try to create one. Steps to follow: Mount the iso image in virtual machine. Install vsftpd rpm from the iso Packages. Copy the packages from iso to /var/ftp/pub/Packages/ Install createrepo .rpm  from packages and Create repo in location /var/ftp/pub/ Create new repo file in location /etc/yum.repos.d/{any_name.repo} and add entry Check and start the vsftpd and Clean & update the yum. 1. Mount the iso image in virtual machine. In the virtual machine select iso image file option in devices. It will be mounted and you can see the ico...

Install Oracle Database 12.2(12c) on Linux

  Introduction Installing Oracle Database 12.2 on Linux system might seem daunting at first, but with the right guidance, it can be a smooth process. In this guide, we'll take you through the step-by-step procedure to install Oracle Database on a Linux environment. By the end of this tutorial, you'll have a functional Oracle Database instance up and running. Steps for Installation: 1. Prerequisites Automatic Setup 2. Prerequisites Manual Setup 3. Install Oracle Database Binary (Software only) 4. Create Database by DBCA 1. Prerequisites Automatic Setup To perform all your prerequisite setup automatically, issue the following command or you can proceed with manual setup explained in 2nd point. [ root @ prod ] # yum install oracle - database - server - 12cR2 - preinstall - y 2. Prerequisites Manual Setup a) Download and Unzip the oracle 12.2 Setup Download or copy the oracle setup file to any location as per your requirement. In...

Primary & Standby Database SYNC Check in Oracle Database

 In Oracle Data Guard , you can check whether the standby database is in sync with the primary database by monitoring the apply lag. The apply lag represents the time delay between when a redo log is generated on the primary database and when it is applied on the standby database. A zero or low apply lag indicates that the standby is relatively up-to-date with the primary, while a high apply lag suggests a potential synchronization delay. Here are some methods to check whether the standby database is in sync with the primary: 1. Data Guard Broker If you are using the Data Guard Broker, you can use the DGMGRL command-line interface or Enterprise Manager (Grid Control) to check the status of the Data Guard configuration and monitor the apply lag. For example, using DGMGRL: DGMGRL> SHOW DATABASE 'standby_database_name' APPLY_LAG; DGMGRL > SHOW DATABASE 'standby_database_name' APPLY_LAG ; 2. V$DATAGUARD_STATS View On the primary datab...

ORA-12012: error on auto execute of job SYS.ORA$AT_OS_OPT_SY_**

  Introduction ORA-12012 error is related to Oracle Database and is part of the Oracle Job Scheduler (DBMS_SCHEDULER) . It usually occurs when an automatic task or job execution encounters an issue. The error message you're seeing, " ORA$AT_OS_OPT_SY_<number> ," is specific to the job causing the problem. During the 12c database creation process, you can see ORA-12012 error in the alert log file when the “ SYS.ORA$AT_OS_OPT_SY_ ” auto job runs. To fix the error, it is necessary to drop the job and recreate it. Errors will be as follows. Errors in file /u01/app/oracle/diag/rdbms/prod/PROD/trace/PROD_j000_14524.trc: ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_767" ORA-20001: Statistics Advisor: Invalid task name for the current user ORA-06512: at "SYS.DBMS_STATS", line 47207 ORA-06512: at "SYS.DBMS_STATS_ADVISOR", line 882 ORA-06512: at "SYS.DBMS_STATS_INTERNAL", line 20059 ORA-065...

Install Oracle 19c Database on Linux

  Introduction Installing Oracle Database 19c on a Linux system might sound complex, but with a well-structured approach, it can be a smooth process. In this guide, we'll break down the installation steps into simple and easy-to-follow instructions, ensuring you set up or install Oracle 19c successfully on your Linux machine. Steps for Installation: 1. Download 19c Software & Copy it to Location 2. Prerequisites Automatic Setup 3. Prerequisites Manual Setup 4. Install 19c Oracle Database Binary (Software only) 5. Create Database by DBCA 1. Download 19c Software & Copy it to Location a) Download 19c Software on local system: Click here b) Transfer or copy Setup file using WinSCP or Mobaxterm on Linux Machine at any location as preferred. In my case I have copied to /u01 mount. c) Give chmod 775 permission to the setup file. [root@prod u01]# ls 19C_DB.zip [root@prod u01]# chmod 775 19C_DB.zip [ root @ prod u01 ]# ls 19 C_D...

RAC Database Shutdown Procedure

  Introduction When it comes to managing an Oracle Real Application Clusters (RAC) database, proper shutdown procedures are crucial to maintain data integrity and prevent potential issues. In this short blog post, we'll guide you through the step-by-step process of shutting down an Oracle RAC DB in sequence using commands, ensuring a smooth and safe shutdown. How to Shutdown Oracle Real Application Clusters Database ? Shutdown Oracle Listener. Shutdown RAC Database Instances on all nodes. Shutdown ASM instances from all nodes. Shutdown Node applications on all nodes. Shut down Oracle Clusterware / CRS. 1. Shutdown Oracle Listener ## To stop listener from all nodes ## [ grid @ node1 ~ ] $ srvctl stop listener ## To Check Status of listener ## [ grid @ node1 ~ ] $ srvctl status listener Listener LISTENER is enabled Listener LISTENER is not running on node ( s ): node1 , node2 ## OTHER COMMANDS ## ## To...

RMAN Backup using ShellScript

 In a real time, we will not take Oracle database backup manually everyday. Some of the tasks can be automated like RMAN backups. In this post, we will see how to automate RMAN backup using shellscript and I personally use shellscript for import/export, rman backup and for monitoring alerts. • Create Backup directory • Create RMAN backup script file .sh • Schedule Backup Under Crontab # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed # Example of job definition: # . ---------------- minute ( 0 - 59 ) # | . ------------- hour ( 0 - 23 ) # | | . ---------- day of month ( 1 - 31 ) # | | | . ------- month ( 1 - 12 ) OR jan , feb , mar , apr .....

ASM Disks Migration from Old storage to New storage on RAC

 Check Number of Disk Groups SQL> select name,path, total_mb, state, mount_status, header_status from v$asm_disk; NAME                      PATH                            TOTAL_MB   STATE   MOUNT_STATUS HEADER_STATUS --------------   ------------------------------      ----------     --------      --------------         ------------ DATA_0000      /dev/oracleasm/disks/DATA      225264    NORMAL      CACHED                MEMBER FRA_0000        /dev/oracleasm/disks/FRA          92160    NORMAL      CACHED                MEMBER CRS_0000      ...