0% found this document useful (0 votes)
123 views

Oracle 12c To 19c Manual Upgradation - 1 - 230911 - 140607

The document describes the steps to manually upgrade an Oracle database from version 12c to 19c. It involves setting up the 19c binaries, backing up the 12c database, running pre-upgrade tools, creating a restore point, copying configuration files to the 19c home, running the dbupgrade tool, and updating parameters and files to complete the upgrade. Key steps include running preupgrade diagnostics, upgrading the time zone files, validating component versions, and changing the compatible parameter after restart.

Uploaded by

Kassim Kassim
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)
123 views

Oracle 12c To 19c Manual Upgradation - 1 - 230911 - 140607

The document describes the steps to manually upgrade an Oracle database from version 12c to 19c. It involves setting up the 19c binaries, backing up the 12c database, running pre-upgrade tools, creating a restore point, copying configuration files to the 19c home, running the dbupgrade tool, and updating parameters and files to complete the upgrade. Key steps include running preupgrade diagnostics, upgrading the time zone files, validating component versions, and changing the compatible parameter after restart.

Uploaded by

Kassim Kassim
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/ 8

Oracle 12c to 19c Database Upgrade

ORACLE DATABASE UPGRADE FROM 12C TO 19C DATABASE USING MANUAL UPGRADE:

Step-1:
Set the oracle 19c home & base locations

Install the 19c binaries

Backup the 12c database & Home

Step-2:
create a new directory for backup and upgrade.

[oracle@oracle12c u01]$ mkdir backup

[oracle@oracle12c u01]$ mkdir preupgrade

[oracle@oracle12c u01]$ ls

app backup oradata preupgrade

Step 3:
Take backup of listener.ora, tnsnames.ora, sqlnet.ora, spfile & pfile, password file.

[oracle@oracle12c ~]$ cd $ORACLE_HOME/network/admin/

[oracle@oracle12c admin]$ cp -p listener.ora sqlnet.ora tnsnames.ora /u01/backup

[oracle@oracle12c admin]$ ls -ltr /u01/backup/*.ora

-rwxrwxr-x. 1 oracle oinstall 743 Feb 15 12:58 /u01/backup/listener.ora

-rwxrwxr-x. 1 oracle oinstall 202 Feb 15 12:59 /u01/backup/sqlnet.ora

-rwxrwxr-x. 1 oracle oinstall 816 Feb 15 13:02 /u01/backup/tnsnames.ora

[oracle@oracle12c dbs]$ pwd

/u01/app/oracle/product/12.2.0/dbhome_1/dbs

[oracle@oracle12c dbs]$ cp -p spfileoracle12c.ora orapworacle12c /u01/backup/

Step 4: Run preupgrade tool.


[oracle@oracle19c ~]$Oracle12c Home/db_1/jdk/bin/java -jar Oracle19c
Home/db_1/rdbms/admin/preupgrade.jar FILE DIR /u01/preupgrade
Step-5:
Gather Dictionary Stats.

SQL>SET ECHO ON;

SET SERVEROUTPUT ON;

EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

Step-6:
Purge Recyclebin

SQL> PURGE DBA_RECYCLEBIN;

Step-7:
Refresh materialized views

SQL> declare

list_failures integer(3) :=0;

begin

DBMS_MVIEW.REFRESH_ALL_MVIEWS(list_failures,'C','', TRUE, FALSE);

end;

Step-9:
Run preupgrade_fixups.sql

SQL> @/u01/preupgrade/preupgrade_fixups.sql

Step-10:
Verify archive log dest.

SQL> archive log list

Step-11:
Stop LISTENER

[oracle@oracle12c ~]$cd $ORACLE_HOME/network/admin

[oracle@oracle19c admin]$ lsnrctl status

[oracle@oracle19c admin]$ lsnrctl stop


Step-12:
Create Flashback Guaranteed Restore Point

SQL> select flashback_on from v$database;

FLASHBACK_ON

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

NO

SQL> select name,open_mode,log_mode from v$database;

NAME OPEN_MODE LOG_MODE

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

ORCL MOUNTED ARCHIVELOG

SQL> show parameter db_recovery_file_dest_size

NAME TYPE VALUE

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

db_recovery_file_dest_size big integer 8016M

SQL> alter system set db_recovery_file_dest_size=11g;

System altered.

SQL> create restore point pre_upgrade guarantee flashback database;

Restore point created.

Step-13:
Shutdown Database

SQL> shutdown immediate

Step-14:
Copy init and password files from 12c to 19c dbs home

[oracle@oracle19c dbs]$ ls

hc_oracle12c.dat init.ora orapworacle12c spfileoracle12c.ora

[oracle@oracle19c dbs]$ cp spfileoracle12c.ora init.ora orapworacle12c Oracle19c home/dbs/

Step-15:
Startup DB in Upgrade mode from 19c home

[oracle@oracle19c ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

[oracle@oracle19c ~]$ export ORACLE_SID=19c

[oracle@oracle19c ~]$ export PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:$PATH

[oracle@oracle19c ~]$ which sqlplus

/u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus

SQL> startup upgrade;

SQL> select name,open_mode,cdb,version,status from v$database,v$instance;

Step-16:
Run dbupgrade.

All things will be done automatically no manual intervention needed after running ./dbupgrade

[oracle@oracle19c ~]$ nohup $ORACLE_HOME/bin/dbupgrade &

Monitor upgrade log

LOG FILES:

(oracle19c home/cfgtoollogs/ <SID> /upgrade20210216080457/catupgrd*.log)

Upgrade Summary Report Located in:

(oracle19c home/cfgtoollogs/ <SID> /upgrade20210216080457/upg_summary.log)

Step-17:
Startup DB from 19c home.

Once Upgrade completes,Verify the Component,version and status from DBA_REGISTRY.

[oracle@oracle19c ~]$ sqlplus / as sysdba

SQL> startup

SQL> select name,open_mode,cdb,version,status from v$database,v$instance;

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;


SQL> show parameter COMPATIBLE

Step-18:
Run utlrp.sql

SQL> @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/utlrp.sql

Session altered.

TIMESTAMP

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

COMP_TIMESTAMP UTLRP_BGN 2021-02-16 08:47:13

TIMESTAMP

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

COMP_TIMESTAMP UTLRP_END 2021-02-16 08:52:01

SQL> select count(*) from dba_objects where status='INVALID';

COUNT(*)

----------

SQL> @/u01/preupgrade/postupgrade_fixups.sql

Step-19:
Upgrade Timezone

[oracle@oracle19c ~]$ cd /u01/app/oracle/product/19.0.0/db_1/rdbms/admin/

[oracle@oracle19c admin]$ ls -ltr utltz_countstats.sql utltz_countstar.sql utltz_upg_check.sql


utltz_upg_apply.sql

-rwxrwxr-x. 1 oracle oinstall 8317 Feb 25 2017 utltz_countstats.sql

-rwxrwxr-x. 1 oracle oinstall 7423 Feb 25 2017 utltz_countstar.sql

-rwxrwxr-x. 1 oracle oinstall 33684 Sep 9 2017 utltz_upg_check.sql

-rwxrwxr-x. 1 oracle oinstall 21526 Sep 9 2017 utltz_upg_apply.sql

[oracle@oracle19c admin]$ sqlplus / as sysdba

SQL> SELECT version FROM v$timezone_file;

VERSION
----------

26

SQL> @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/utltz_upg_check.sql

Session altered.

A prepare window has been successfully ended.

Session altered.

SQL> @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/utltz_upg_apply.sql

Session altered.

SQL> SELECT version FROM v$timezone_file;

VERSION
----------
32

Step-20:
Run utlusts.sql
SQL> @/u01/app/oracle/product/19.0.0/db_1/rdbms/admin/utlusts.sql TEXT

Step-21:
Once you have confirmed that upgrade is successful and there is no rollback, you can drop the restore
point
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;SQL> SQL> SQL> SQL>
NAME GUARANTEE_ TIME
------------- ---------- -----------------------
PRE_UPGRADE YES 16-FEB-21 07.47.48.000000000 AM
SQL> drop restore point PRE_UPGRADE;
Restore point dropped.

Step-22:
Update Compatible parameter value to 19.0.0
SQL> show parameter COMPATIBLE
NAME TYPE VALUE
----------------------------- ----------- ---------
compatible string 12.2.0
noncdb_compatible boolean FALSE
SQL> ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;
System altered.
SQL> shut immediate;
SQL> startup;
SQL> show parameter COMPATIBLE
NAME TYPE VALUE
--------------------------- ----------- -----------
compatible string 19.0.0
noncdb_compatible boolean FALSE

Step-22:
• Verify Component name and status from DBA_REGISTRY.
• Check Listener status.
• Verify PasswordFile.
[oracle@oracle19c dbs]$ ls -ltr
total 18332
-rwxrwxr-x. 1 oracle oinstall 3079 May 14 2015 init.ora
-rwxrwxr-x. 1 oracle oinstall 24 Feb 8 12:49 lkORACLE19C
-rwxrwxr-x. 1 oracle oinstall 24 Feb 8 12:52 lkORACLE19
-rwxrwxr-x. 1 oracle oinstall 2048 Feb 8 12:58 orapworacle19c
-rwxrwxr-x. 1 oracle oinstall 18726912 Feb 9 09:09 snapcf_oracle19c.f
-rwxrwxr-x. 1 oracle oinstall 24 Feb 11 07:39 lkORACLE12C
-rwxrwxr-x. 1 oracle oinstall 799 Feb 11 08:40 initoracle12c.ora
-rwxrwxr-x. 1 oracle oinstall 3584 Feb 12 07:12 spfileoracle19c.ora
-rwxrwxr-x. 1 oracle oinstall 1544 Feb 12 15:59 hc_oracle19c.dat
-rw-r-----. 1 oracle oinstall 3584 Feb 16 08:43 orapworacle12c
-rwxrwxr-x. 1 oracle oinstall 1544 Feb 16 09:20 hc_oracle12c.dat
-rw-r-----. 1 oracle oinstall 3584 Feb 16 09:20 spfileoracle12c.ora

Step-23:
Edit oratab to change the new version for Database.
[oracle@oracle19c dbs]$ vi /etc/oratab
[oracle@oracle19c dbs]$ cat /etc/oratab | grep -i oracle*
oracle19c:/u01/app/oracle/product/19.0.0/db_1:N
oracle12c:/u01/app/oracle/product/12.2.0/db_1:N

You might also like