Oracle 19c Database Upgrade From 11.2.0.4 to 19.2.0.0 Using DBUA

Description:-

There are different ways of upgrading to the latest release of Oracle database and Oracle provides multiple methods to upgrade. Few are listed below:

  • Database Upgrade Assistant (DBUA)
  • Manual Upgrade
  • Transportable Tablespaces
  • Datapump export/import
  • Oracle Streams
  • Oracle GoldenGate

Here I am going to choose DBUA to upgrade my database,

DBUA provides a graphical user interface to guide you through the upgrade of Oracle Database.

Oracle Database Releases That Support Direct Upgrade

Review the supported options for direct upgrades to the latest Oracle Database release.
You can perform a direct upgrade to the new release from the following releases:
• 11.2.0.4
• 12.1.0.1 and 12.1.0.2
• 12.2.0.1

Steps for upgrade from 11.2.0.4 to 19.2.0.0 using DBUA :-

Presteps for db upgrade :-

Take RMAN full backups before upgrade.

rman target / 

run {
allocate channel test_backup_disk1 type disk format '/u01/backup/%d_%U';
backup incremental level 0 tag 'ORCL_BEFORE_UPG'  database;
backup format  tag 'ORCL_CONTROL_FILE' current controlfile;
release channel test_backup_disk1;
}

Ensure backup is complete before upgrade.

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected

Empty Recycle bin.

SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

Run Gather statistics to finish upgrade soon.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

Remove EM Database Control :-

Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target 19.2.0.0.0 ORACLE_HOME into the source 11.2.0.4.0 ORACLE_HOME.

[oracle@19c ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Mar 14 20:56:29 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> @emremove.sql
old 70: IF (upper('&LOGGING') = 'VERBOSE')
new 70: IF (upper('VERBOSE') = 'VERBOSE')

PL/SQL procedure successfully completed.

Remove OLAP Catalog :-

[oracle@19c ~]$ cd $ORACLE_HOME/olap/admin/

SQL> @catnoamd.sql

Purge Recyclebin :-

SQL> purge recyclebin;

Recyclebin purged.

Run the preupgrade tool.

The preupgrade.jar Pre-Upgrade Information Tool is supplied with Oracle Database 19c.
This tool has reside in new oracle home.
/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar

oracle@19c ~]$ /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE DIR /u01/preupgrade/
==================
PREUPGRADE SUMMARY
==================
/u01/preupgrade/preupgrade.log
/u01/preupgrade/preupgrade_fixups.sql
/u01/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

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

After the upgrade:

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

Preupgrade complete: 2019-03-14T21:28:55

Run preupgrade fixups.sql

SQL> @/u01/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 19.0.0.0.0 Build: 1
Generated on: 2019-03-14 21:28:51

For Source Database: UPG19C
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 19.0.0.0.0

Preup Preupgrade
Action Issue Is
Number Preupgrade Check Name Remedied Further DBA Action
------ ------------------------ ---------- --------------------------------
1. parameter_min_val NO Manual fixup recommended.
2. em_present NO Manual fixup recommended.
3. amd_exists NO Manual fixup recommended.
4. apex_manual_upgrade NO Manual fixup recommended.
5. dictionary_stats YES None.
6. trgowner_no_admndbtrg YES None.
7. mv_refresh NO Informational only.
Further action is optional.
8. pre_fixed_objects YES None.
9. tablespaces_info NO Informational only.
Further action is optional.
10. exf_rul_exists NO Informational only.
Further action is optional.
11. 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.

Run DBUA upgrade Utility :

Now run the dbua utility from 19c oracle_home location.

[oracle@19c ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@19c ~]$ export ORACLE_SID=upg19c
[oracle@19c ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
[oracle@19c ~]$ dbua
  • select the Upgrade Oracle Database option, then click the “Next” button.

  • If the prerequisite checks highlight any issues, take the appropriate action to fix the issues. If all the prerequisite checks are passed, click the “Next” button.

  • Amend the upgrade options if necessary, then click the “Next” button.

  • Select the recovery options for use in the event of an upgrade failure, then click the “Next” button.

  •  If the database is using the 11g listener and you need to upgraded, use existing listener or create new 19c listener

  • If you want configure EM database express enable it and provide port number or uncheck it.

Now the database upgrade is complete and the database is ready for normal use.

SQL> select VERSION,name,open_mode from v$instance,v$database;

VERSION    NAME   OPEN_MODE
---------  ------ ----------
19.0.0.0.0 UPG19C READ WRITE

SQL> SELECT * FROM v$timezone_file;

FILENAME             VERSION    CON_ID
-------------------- ---------- ----------
timezlrg_32.dat      32         0

SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
32
Catch Me On:- Hariprasath Rajaram  Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                       FB Group:https://www.facebook.com/groups/894402327369506/              FB Page: https://www.facebook.com/dbahariprasath/?                 Twitter: https://twitter.com/hariprasathdba

oracle Gather stats for a table

BEGIN
DBMS_STATS.GATHER_TABLE_STATS (
ownname => ‘HR’,
tabname => ‘EMP’,
cascade => true, —- For collecting stats for respective indexes
method_opt=>’for all indexed columns size 1′,
granularity => ‘ALL’,
estimate_percent =>dbms_stats.auto_sample_size,
degree => 4);
END;
/

— For a single table partition
BEGIN
DBMS_STATS.GATHER_TABLE_STATS (
ownname => ‘HR’,
tabname => ‘EMP’, — TABLE NAME
partname => ‘EMP_P1’ — PARTITOIN NAME
method_opt=>’for all indexed columns size 1′,
GRANULARITY => ‘APPROX_GLOBAL AND PARTITION’,
degree => 8);
END;
/

Oracle 19c Database Upgrade From 11.2.0.4 to 19.2.0.0 Using Manual Method

Description:- 

A manual upgrade consists of running SQL scripts and utilities from a command line to upgrade a database to the new Oracle Database release.

Oracle Database Releases That Support Direct Upgrade
Review the supported options for direct upgrades to the latest Oracle Database release.
You can perform a direct upgrade to the new release from the following releases:
• 11.2.0.4
• 12.1.0.1 and 12.1.0.2
• 12.2.0.1

Presteps for db upgrade :-

Take RMAN full backups before upgrade.

rman target / 

run {
allocate channel test_backup_disk1 type disk format '/u01/backup/%d_%U';
backup incremental level 0 tag 'ORCL_BEFORE_UPG'  database;
backup format  tag 'ORCL_CONTROL_FILE' current controlfile;
release channel test_backup_disk1;
}

Ensure backup is complete before upgrade.

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected

Empty Recycle bin.

SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

Run Gather statistics to finish upgrade soon.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

Run the preupgrade tool:

The preupgrade.jar Pre-Upgrade Information Tool is supplied with Oracle Database 18c.This tool has reside in new oracle home.

/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar

[oracle@19c ~]$ /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE DIR /u01/preupgrade/

==================
PREUPGRADE SUMMARY
==================
/u01/preupgrade/preupgrade.log
/u01/preupgrade/preupgrade_fixups.sql
/u01/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

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

After the upgrade:

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

Preupgrade complete: 2019-03-21T21:12:31

Run preupgrade fixups.sql

SQL> @/u01/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 19.0.0.0.0 Build: 1
Generated on: 2019-03-21 21:12:27

For Source Database: MIG19C
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 19.0.0.0.0

Preup Preupgrade
Action Issue Is
Number Preupgrade Check Name Remedied Further DBA Action
------ ------------------------ ---------- --------------------------------
1. parameter_min_val NO Manual fixup recommended.
2. em_present NO Manual fixup recommended.
3. amd_exists NO Manual fixup recommended.
4. apex_manual_upgrade NO Manual fixup recommended.
5. dictionary_stats YES None.
6. trgowner_no_admndbtrg YES None.
7. pre_fixed_objects YES None.
8. tablespaces_info NO Informational only.
Further action is optional.
9. exf_rul_exists NO Informational only.
Further action is optional.
10. 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.

Check Timezone version :

Check if target database’s time zone version is lower than the source database time zone version.

SQL> SELECT version FROM v$timezone_file;

VERSION
-------
14

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME; 2 3 4

PROPERTY_NAME            VALUE
------------------------ -----
DST_PRIMARY_TT_VERSION   14
DST_SECONDARY_TT_VERSION 0
DST_UPGRADE_STATE        NONE

Upgrade Database from 11.2.0.4 to 19c :-

Shutdown the 11g database:

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

Copy the parameter and password file from the 11g home to the new 19c home.

[oracle@19c ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileMIG19C.ora /u01/app/oracle/product/19.0.0/dbhome_1
[oracle@19c ~]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwMIG19C /u01/app/oracle/product/19.0.0/dbhome_1

Set new ORACLE_HOME for 19c location and startup database in upgrade mode :

[oracle@19c ~]$ export ORACLE_SID=MIG19C
[oracle@19c ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
[oracle@19c ~]$ export PATH=/u01/app/oracle/product/19.0.0/dbhome_1:$PATH
[oracle@19c ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Mar 21 21:33:54 2019

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1543500136 bytes
Fixed Size 8896872 bytes
Variable Size 939524096 bytes
Database Buffers 587202560 bytes
Redo Buffers 7876608 bytes
Database mounted.
Database opened.

Run the dbupgrade utility :

[oracle@19c bin]$ export ORACLE_SID=MIG19C

[oracle@19c bin]$ ./dbupgrade

Argument list for [/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in c = 0
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = 0
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 0
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
RO User Tablespaces T = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

catctl.pl VERSION: [19.0.0.0.0]
STATUS: [Production]
BUILD: [RDBMS_19.2.0.0.0_LINUX.X64_190204]

/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/orahome = [/u01/app/oracle/product/19.0.0/dbhome_1]
/u01/app/oracle/product/19.0.0/dbhome_1/bin/orabasehome = [/u01/app/oracle/product/19.0.0/dbhome_1]
catctlGetOraBaseLogDir = [/u01/app/oracle/product/19.0.0/dbhome_1]

Analyzing file /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catupgrd.sql

Log file directory = [/tmp/cfgtoollogs/upgrade20190321214707]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd_catcon_9390.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd_*.lst] files for spool files, if any

Number of Cpus = 1
Database Name = MIG19C
DataBase Version = 11.2.0.4.0
catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd_catcon_9390.lst]

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd_*.lst] files for spool files, if any

Log file directory = [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709]

Components in [MIG19C]
Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT EM JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV MGW ODM OLS RAC WK]
Parallel SQL Process Count = 4

------------------------------------------------------
Phases [0-107] Start Time:[2019_03_21 21:47:10]
------------------------------------------------------
*********** Executing Change Scripts ***********
Serial Phase #:0 [MIG19C] Files:1 [oracle@19c bin]$ export ORACLE_SID=MIG19C
[oracle@19c bin]$ ./dbupgrade

Argument list for [/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in c = 0
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = 0
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 0
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
RO User Tablespaces T = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

catctl.pl VERSION: [19.0.0.0.0]
STATUS: [Production]
BUILD: [RDBMS_19.2.0.0.0_LINUX.X64_190204]

/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/orahome = [/u01/app/oracle/product/19.0.0/dbhome_1]
/u01/app/oracle/product/19.0.0/dbhome_1/bin/orabasehome = [/u01/app/oracle/product/19.0.0/dbhome_1]
catctlGetOraBaseLogDir = [/u01/app/oracle/product/19.0.0/dbhome_1]

Analyzing file /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catupgrd.sql

Log file directory = [/tmp/cfgtoollogs/upgrade20190321214707]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd_catcon_9390.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190321214707/catupgrd_*.lst] files for spool files, if any

Number of Cpus = 1
Database Name = MIG19C
DataBase Version = 11.2.0.4.0
catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd_catcon_9390.lst]

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd_*.lst] files for spool files, if any

Log file directory = [/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709]

Components in [MIG19C]
Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT EM JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV MGW ODM OLS RAC WK]
Parallel SQL Process Count = 4

------------------------------------------------------
Phases [0-107] Start Time:[2019_03_21 21:47:10]
------------------------------------------------------
*********** Executing Change Scripts ***********
Serial Phase #:0 [MIG19C] Files:1
Time: 68s
*************** Catalog Core SQL ***************
Serial Phase #:1 [MIG19C] Files:5 Time: 48s
Restart Phase #:2 [MIG19C] Files:1 Time: 1s
*********** Catalog Tables and Views ***********
Parallel Phase #:3 [MIG19C] Files:19 Time: 25s
Restart Phase #:4 [MIG19C] Files:1 Time: 1s
************* Catalog Final Scripts ************
Serial Phase #:5 [MIG19C] Files:7 Time: 24s
***************** Catproc Start ****************
Serial Phase #:6 [MIG19C] Files:1 Time: 12s
***************** Catproc Types ****************
Serial Phase #:7 [MIG19C] Files:2 Time: 10s
Restart Phase #:8 [MIG19C] Files:1 Time: 0s
**************** Catproc Tables ****************
Parallel Phase #:9 [MIG19C] Files:67 Time: 42s
Restart Phase #:10 [MIG19C] Files:1 Time: 1s
************* Catproc Package Specs ************
Serial Phase #:11 [MIG19C] Files:1 Time: 63s
Restart Phase #:12 [MIG19C] Files:1 Time: 0s
************** Catproc Procedures **************
Parallel Phase #:13 [MIG19C] Files:94 Time: 12s
Restart Phase #:14 [MIG19C] Files:1 Time: 1s
Parallel Phase #:15 [MIG19C] Files:120 Time: 21s
Restart Phase #:16 [MIG19C] Files:1 Time: 0s
Serial Phase #:17 [MIG19C] Files:22 Time: 3s
Restart Phase #:18 [MIG19C] Files:1 Time: 1s
***************** Catproc Views ****************
Parallel Phase #:19 [MIG19C] Files:32 Time: 28s
Restart Phase #:20 [MIG19C] Files:1 Time: 1s
Serial Phase #:21 [MIG19C] Files:3 Time: 11s
Restart Phase #:22 [MIG19C] Files:1 Time: 0s
Parallel Phase #:23 [MIG19C] Files:25 Time: 197s
Restart Phase #:24 [MIG19C] Files:1 Time: 1s
Parallel Phase #:25 [MIG19C] Files:12 Time: 106s
Restart Phase #:26 [MIG19C] Files:1 Time: 0s
Serial Phase #:27 [MIG19C] Files:1 Time: 0s
Serial Phase #:28 [MIG19C] Files:3 Time: 4s
Serial Phase #:29 [MIG19C] Files:1 Time: 0s
Restart Phase #:30 [MIG19C] Files:1 Time: 0s
*************** Catproc CDB Views **************
Serial Phase #:31 [MIG19C] Files:1 Time: 1s
Restart Phase #:32 [MIG19C] Files:1 Time: 1s
Serial Phase #:34 [MIG19C] Files:1 Time: 0s
***************** Catproc PLBs *****************
Serial Phase #:35 [MIG19C] Files:293 Time: 22s
Serial Phase #:36 [MIG19C] Files:1 Time: 0s
Restart Phase #:37 [MIG19C] Files:1 Time: 0s
Serial Phase #:38 [MIG19C] Files:6 Time: 5s
Restart Phase #:39 [MIG19C] Files:1 Time: 0s
*************** Catproc DataPump ***************
Serial Phase #:40 [MIG19C] Files:3 Time: 51s
Restart Phase #:41 [MIG19C] Files:1 Time: 1s
****************** Catproc SQL *****************
Parallel Phase #:42 [MIG19C] Files:13 Time: 117s
Restart Phase #:43 [MIG19C] Files:1 Time: 1s
Parallel Phase #:44 [MIG19C] Files:11 Time: 17s
Restart Phase #:45 [MIG19C] Files:1 Time: 0s
Parallel Phase #:46 [MIG19C] Files:3 Time: 2s
Restart Phase #:47 [MIG19C] Files:1 Time: 0s
************* Final Catproc scripts ************
Serial Phase #:48 [MIG19C] Files:1 Time: 9s
Restart Phase #:49 [MIG19C] Files:1 Time: 1s
************** Final RDBMS scripts *************
Serial Phase #:50 [MIG19C] Files:1 Time: 20s
************ Upgrade Component Start ***********
Serial Phase #:51 [MIG19C] Files:1 Time: 1s
Restart Phase #:52 [MIG19C] Files:1 Time: 0s
********** Upgrading Java and non-Java *********
Serial Phase #:53 [MIG19C] Files:2 Time: 587s
***************** Upgrading XDB ****************
Restart Phase #:54 [MIG19C] Files:1 Time: 1s
Serial Phase #:56 [MIG19C] Files:3 Time: 28s
Serial Phase #:57 [MIG19C] Files:3 Time: 4s
Parallel Phase #:58 [MIG19C] Files:10 Time: 3s
Parallel Phase #:59 [MIG19C] Files:25 Time: 4s
Serial Phase #:60 [MIG19C] Files:4 Time: 7s
Serial Phase #:61 [MIG19C] Files:1 Time: 0s
Serial Phase #:62 [MIG19C] Files:32 Time: 4s
Serial Phase #:63 [MIG19C] Files:1 Time: 0s
Parallel Phase #:64 [MIG19C] Files:6 Time: 6s
Serial Phase #:65 [MIG19C] Files:2 Time: 22s
Serial Phase #:66 [MIG19C] Files:3 Time: 80s
**************** Upgrading ORDIM ***************
Restart Phase #:67 [MIG19C] Files:1 Time: 1s
Serial Phase #:69 [MIG19C] Files:1 Time: 1s
Parallel Phase #:70 [MIG19C] Files:2 Time: 56s
Restart Phase #:71 [MIG19C] Files:1 Time: 0s
Parallel Phase #:72 [MIG19C] Files:2 Time: 1s
Serial Phase #:73 [MIG19C] Files:2 Time: 1s
***************** Upgrading SDO ****************
Restart Phase #:74 [MIG19C] Files:1 Time: 0s
Serial Phase #:76 [MIG19C] Files:1 Time: 85s
Serial Phase #:77 [MIG19C] Files:2 Time: 2s
Restart Phase #:78 [MIG19C] Files:1 Time: 1s
Serial Phase #:79 [MIG19C] Files:1 Time: 19s
Restart Phase #:80 [MIG19C] Files:1 Time: 0s
Parallel Phase #:81 [MIG19C] Files:3 Time: 82s
Restart Phase #:82 [MIG19C] Files:1 Time: 1s
Serial Phase #:83 [MIG19C] Files:1 Time: 5s
Restart Phase #:84 [MIG19C] Files:1 Time: 0s
Serial Phase #:85 [MIG19C] Files:1 Time: 11s
Restart Phase #:86 [MIG19C] Files:1 Time: 0s
Parallel Phase #:87 [MIG19C] Files:4 Time: 142s
Restart Phase #:88 [MIG19C] Files:1 Time: 1s
Serial Phase #:89 [MIG19C] Files:1 Time: 1s
Restart Phase #:90 [MIG19C] Files:1 Time: 0s
Serial Phase #:91 [MIG19C] Files:2 Time: 9s
Restart Phase #:92 [MIG19C] Files:1 Time: 0s
Serial Phase #:93 [MIG19C] Files:1 Time: 1s
Restart Phase #:94 [MIG19C] Files:1 Time: 1s
******* Upgrading ODM, WK, EXF, RUL, XOQ *******
Serial Phase #:95 [MIG19C] Files:1 Time: 31s
Restart Phase #:96 [MIG19C] Files:1 Time: 0s
*********** Final Component scripts ***********
Serial Phase #:97 [MIG19C] Files:1 Time: 2s
************* Final Upgrade scripts ************
Serial Phase #:98 [MIG19C] Files:1 Time: 24s
******************* Migration ******************
Serial Phase #:99 [MIG19C] Files:1 Time: 48s
*** End PDB Application Upgrade Pre-Shutdown ***
Serial Phase #:100 [MIG19C] Files:1 Time: 1s
Serial Phase #:101 [MIG19C] Files:1 Time: 0s
Serial Phase #:102 [MIG19C] Files:1 Time: 44s
***************** Post Upgrade *****************
Serial Phase #:103 [MIG19C] Files:1 Time: 38s
**************** Summary report ****************
Serial Phase #:104 [MIG19C] Files:1 Time: 2s
*** End PDB Application Upgrade Post-Shutdown **
Serial Phase #:105 [MIG19C] Files:1 Time: 0s
Serial Phase #:106 [MIG19C] Files:1 Time: 0s
Serial Phase #:107 [MIG19C] Files:1 Time: 32s

------------------------------------------------------
Phases [0-107] End Time:[2019_03_21 22:25:49]
------------------------------------------------------

Grand Total Time: 2320s

LOG FILES: (/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/catupgrd*.log)

Upgrade Summary Report Located in:
/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/MIG19C/upgrade20190321214709/upg_summary.log

Grand Total Upgrade Time: [0d:0h:38m:40s]

Startup database after upgrade completed.

SQL> startup
ORACLE instance started.

Total System Global Area 1543500136 bytes
Fixed Size                  8896872 bytes
Variable Size             939524096 bytes
Database Buffers          587202560 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> @catuppst.sql

Session altered.


Session altered.


Session altered.


PL/SQL procedure successfully completed.


Session altered.


System altered.


PL/SQL procedure successfully completed.


Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP DBRESTART 2019-03-21 23:05:38
DBUA_TIMESTAMP DBRESTART FINISHED 2019-03-21 23:05:38
DBUA_TIMESTAMP DBRESTART NONE 2019-03-21 23:05:38

TIMESTAMP
--------------------------------------------------------------------------------
DBUA_TIMESTAMP CATUPPST STARTED 2019-03-21 23:05:38


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP POSTUP_BGN 2019-03-21 23:05:38
DBUA_TIMESTAMP POSTUP_BGN FINISHED 2019-03-21 23:05:38
DBUA_TIMESTAMP POSTUP_BGN NONE 2019-03-21 23:05:38

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATREQ_BGN 2019-03-21 23:05:38
DBUA_TIMESTAMP CATREQ_BGN FINISHED 2019-03-21 23:05:38
DBUA_TIMESTAMP CATREQ_BGN NONE 2019-03-21 23:05:38

PL/SQL procedure successfully completed.

catrequtlmg: b_StatEvt = TRUE
catrequtlmg: b_SelProps = FALSE
catrequtlmg: b_UpgradeMode = FALSE
catrequtlmg: b_InUtlMig = FALSE

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATREQ_END 2019-03-21 23:05:39
DBUA_TIMESTAMP CATREQ_END FINISHED 2019-03-21 23:05:39
DBUA_TIMESTAMP CATREQ_END NONE 2019-03-21 23:05:39


catuppst: Dropping library DBMS_DDL_INTERNAL_LIB

PL/SQL procedure successfully completed.

catuppst: Dropping view _CURRENT_EDITION_OBJ_MIG

PL/SQL procedure successfully completed.

catuppst: Dropping view _ACTUAL_EDITION_OBJ_MIG

PL/SQL procedure successfully completed.

catuppst: Dropping view DBA_PART_KEY_COLUMNS_V$_MIG

PL/SQL procedure successfully completed.

catuppst: Dropping view DBA_SUBPART_KEY_COLUMNS_V$_MIG

PL/SQL procedure successfully completed.

catuppst: Dropping table OBJ$MIG
catuppst: Dropping table USER$MIG
catuppst: Dropping table COL$MIG
catuppst: Dropping table CLU$MIG
catuppst: Dropping table CON$MIG
catuppst: Dropping table BOOTSTRAP$MIG
catuppst: Dropping table TAB$MIG
catuppst: Dropping table TS$MIG
catuppst: Dropping table IND$MIG
catuppst: Dropping table ICOL$MIG
catuppst: Dropping table LOB$MIG
catuppst: Dropping table COLTYPE$MIG
catuppst: Dropping table SUBCOLTYPE$MIG
catuppst: Dropping table NTAB$MIG
catuppst: Dropping table REFCON$MIG
catuppst: Dropping table OPQTYPE$MIG
catuppst: Dropping table ICOLDEP$MIG
catuppst: Dropping table VIEWTRCOL$MIG
catuppst: Dropping table ATTRCOL$MIG
catuppst: Dropping table TYPE_MISC$MIG
catuppst: Dropping table LIBRARY$MIG
catuppst: Dropping table ASSEMBLY$MIG
catuppst: Dropping table TSQ$MIG
catuppst: Dropping table FET$MIG

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP POSTUP_END 2019-03-21 23:05:39
DBUA_TIMESTAMP POSTUP_END FINISHED 2019-03-21 23:05:39
DBUA_TIMESTAMP POSTUP_END NONE 2019-03-21 23:05:39

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATUPPST 2019-03-21 23:05:39
DBUA_TIMESTAMP CATUPPST FINISHED 2019-03-21 23:05:39
DBUA_TIMESTAMP CATUPPST NONE 2019-03-21 23:05:39

Session altered.

Compile Invalid objects :

SQL> @utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2019-03-21 23:07:30

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2019-03-21 23:18:13

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.
SQL> select count(*) from dba_objects where status='INVALID';

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

Set COMPATIBLE parameter :

SQL> show parameter compatible;

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


SQL> ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;

System altered.

Restart the database :

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2516580184 bytes
Fixed Size 8660824 bytes
Variable Size 671088640 bytes
Database Buffers 1828716544 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.
SQL> show parameter compatible;

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

Compile Fixed objects stats :

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed.

Post-Upgrade Steps :-

Upgrade Time Zone version :

Startup database in Upgrade mode.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1543500136 bytes
Fixed Size 8896872 bytes
Variable Size 1040187392 bytes
Database Buffers 486539264 bytes
Redo Buffers 7876608 bytes
Database mounted.
Database opened.

SQL> SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;

DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;
/SQL> 2 3 4 5 6 7 8 9
l_tz_version=32
An upgrade window has been successfully started.

PL/SQL procedure successfully completed.

Shutdown and startup in normal mode :

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.


SQL> startup
ORACLE instance started.

Total System Global Area 1543500136 bytes
Fixed Size 8896872 bytes
Variable Size 1040187392 bytes
Database Buffers 486539264 bytes
Redo Buffers 7876608 bytes
Database mounted.
Database opened.


SQL> SET SERVEROUTPUT ON
DECLARE
l_failures PLS_INTEGER;
BEGIN
DBMS_DST.upgrade_database(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
DBMS_DST.end_upgrade(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/SQL> 2 3 4 5 6 7 8 9
Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
DBMS_DST.upgrade_database : l_failures=0
An upgrade window has been successfully ended.
DBMS_DST.end_upgrade : l_failures=0

PL/SQL procedure successfully completed.

Check Time zone version :

SQL> SELECT * FROM v$timezone_file;

FILENAME             VERSION    CON_ID
-------------------- ---------- ----------
timezlrg_32.dat      32         0

SQL>COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20

SELECT property_name, property_value
FROM database_properties
WHERE property_name LIKE 'DST_%'
ORDER BY property_name;SQL> SQL> SQL> SQL> 2 3 4

PROPERTY_NAME              PROPERTY_VALUE
-------------------------- ---------------
DST_PRIMARY_TT_VERSION     32
DST_SECONDARY_TT_VERSION   0
DST_UPGRADE_STATE          NONE

Run postupgrade fixups :

SQL> @/u01/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: 2019-03-21 21:12:30

For Source Database: MIG19C
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 19.0.0.0.0

Preup                        Preupgrade
Action                       Issue Is 
Number Preupgrade Check Name Remedied      Further DBA Action
------ ------------------------ ---------- ----------------------------
11. old_time_zones_exist YES None.
12. dir_symlinks YES None.
13. post_dictionary YES None.
14. post_fixed_objects NO Informational only.
Further action is optional.
15. upg_by_std_upgrd 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.

Check database name and version :

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

NAME      VERSION           OPEN_MODE
--------- ----------------- ----------
MIG19C    19.0.0.0.0        READ WRITE
Catch Me On:- Hariprasath Rajaram

LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba

Oracle 18c Database Upgrade From 11.2.0.4 to 18.3.0.0 Using DBUA

Description:-

There are different ways of upgrading to the latest release of Oracle database and Oracle provides multiple methods to upgrade. Few are listed below:

  • Database Upgrade Assistant (DBUA)
  • Manual Upgrade
  • Transportable Tablespaces
  • Datapump export/import
  • Oracle Streams
  • Oracle GoldenGate

Here I am going to choose DBUA to upgrade my database,

Backup 11g database using RMAN

rman target /

run
{
backup database plus archivelog;
backup current controlfile;
backup spfile;
}

Ensure backup is complete before upgrade.
SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected
Empty Recycle bin.
SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.
Run Gather statistics to finish upgrade soon.
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.
Stop the running 11g listener

lsnrctl stop LISTENER_NAME

Run preupgrade tool and fixups

Oracle strongly recommends that you run the Pre-Upgrade Information Tool before starting the upgrade with DBUA. Although DBUA runs the Pre-Upgrade Information Tool as part of the pre-requisite checks, it is good practice to run the tool ahead of time in order to analyze the database and take actions that can decrease downtime for upgrading.

Connect to 11.2.0.4 database environment as SYS,

 Pre-upgrade checks :
Run the preupgrade tool .
[oracle@ram ~]$ export ORACLE_SID=orcldb
[oracle@ram ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
[oracle@ram ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Feb 12 19:49:03 2019

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 4893769728 bytes
Fixed Size 2261568 bytes
Variable Size 2717912512 bytes
Database Buffers 2164260864 bytes
Redo Buffers 9334784 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ram ~]$ java -jar /u01/app/oracle/product/18.3/rdbms/admin/preupgrade.jar TEXT TERMINAL
Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 on 2019-02-12T19:49:51

Upgrade-To version: 18.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
Database Name:        ORCLDB
Container Name:       Not Applicable in Pre-12.1 database
Container ID:         Not Applicable in Pre-12.1 database
Version:              11.2.0.4.0
Compatible:           11.2.0.4.0
Blocksize:            8192
Platform:             Linux x86 64-bit
Timezone File:        14
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 
Oracle Workspace Manager             [to be upgraded]     VALID 
OLAP Analytic Workspace              [to be upgraded]     VALID 
Oracle Enterprise Manager Repository [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 
Expression Filter                    [to be upgraded]     VALID 
Rule Manager                         [to be upgraded]     VALID 
Oracle OLAP API                      [to be upgraded]     VALID

==============
BEFORE UPGRADE
==============

REQUIRED ACTIONS
================
1. Set DB_RECOVERY_FILE_DEST_SIZE initialization parameter to at least 5082
MB. Check alert log during the upgrade to ensure there is remaining free
space available in the recovery area.

DB_RECOVERY_FILE_DEST_SIZE is set at 4182 MB. There is currently 4050 MB
of free space remaining, which may not be adequate for the upgrade.

Currently:
Fast recovery area : /u01/app/oracle 
Limit :              4182 MB 
Used :               132 MB 
Available :          4050 MB 

The database has archivelog mode enabled, and the upgrade process will
need free space to generate archived logs to the recovery area specified
by initialization parameter DB_RECOVERY_FILE_DEST. The logs generated
must not overflow the limit set by DB_RECOVERY_FILE_DEST_SIZE, as that
can cause the upgrade to not proceed.

RECOMMENDED ACTIONS
===================
2. Remove the EM repository.

- Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target
18.0.0.0.0 ORACLE_HOME into the source 11.2.0.4.0 ORACLE_HOME.

Step 1: If database control is configured, stop EM Database Control,
using the following command

$> emctl stop dbconsole

Step 2: Connect to the database using the SYS account AS SYSDBA

SET ECHO ON;
SET SERVEROUTPUT ON;
@emremove.sql

Without the set echo and serveroutput commands, you will not be able to
follow the progress of the script.

The database has an Enterprise Manager Database Control repository.

Starting with Oracle Database 12c, the local Enterprise Manager Database
Control does not exist anymore. The repository will be removed from your
database during the upgrade. This step can be manually performed before
the upgrade to reduce downtime.

3. Remove OLAP Catalog by running the 11.2.0.4.0 SQL script
$ORACLE_HOME/olap/admin/catnoamd.sql script.

The OLAP Catalog component, AMD, exists in the database.

Starting with Oracle Database 12c, the OLAP Catalog (OLAP AMD) is
desupported and will be automatically marked as OPTION OFF during the
database upgrade if present. Oracle recommends removing OLAP Catalog
(OLAP AMD) before database upgrade. This step can be manually performed
before the upgrade to reduce downtime.

4. Upgrade Oracle Application Express (APEX) manually before the database
upgrade.

The database contains APEX version 3.2.1.00.12. Upgrade APEX to at least
version 5.1.3.00.05.

Starting with Oracle Database Release 18, APEX is not upgraded
automatically as part of the database upgrade. Refer to My Oracle Support
Note 1088970.1 for information about APEX installation and upgrades.

5. Directly grant ADMINISTER DATABASE TRIGGER privilege to the owner of the
trigger or drop and re-create the trigger with a user that was granted
directly with such. You can list those triggers using "SELECT OWNER,
TRIGGER_NAME FROM DBA_TRIGGERS WHERE BASE_OBJECT_TYPE=''DATABASE'' AND
OWNER NOT IN (SELECT GRANTEE FROM DBA_SYS_PRIVS WHERE
PRIVILEGE=''ADMINISTER DATABASE TRIGGER'')"

There is one or more database triggers whose owner does not have the
right privilege on the database.

The creation of database triggers must be done by users granted with
ADMINISTER DATABASE TRIGGER privilege. Privilege must have been granted
directly.

6. (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 11.2.0.4
Oracle Database Performance Tuning Guide.

INFORMATION ONLY
================
7. 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                  510 MB          723 MB
SYSTEM                  740 MB          1180 MB
TEMP                    20 MB           150 MB
UNDOTBS1                30 MB           446 MB

Minimum tablespace sizes for upgrade are estimates.

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

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql

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

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

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

The database is using time zone file version 14 and the target 18.0.0.0.0
release ships with time zone file version 31.

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 18.0.0.0.0 Oracle Database
Globalization Support Guide.

9. (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.

10. 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 11.2.0.4
Oracle Database Performance Tuning Guide.

INFORMATION ONLY
================
11. Check the Oracle documentation for the identified components for their
specific upgrade procedure.

The database upgrade script will not upgrade the following Oracle
components: OLAP Catalog,OWB

The Oracle database upgrade script upgrades most, but not all Oracle
Database components that may be installed. Some components that are not
upgraded may have their own upgrade scripts, or they may be deprecated or
obsolete.

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

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql


==================
PREUPGRADE SUMMARY
==================
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade.log
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql

Preupgrade complete: 2019-02-12T19:49:51
Run the preupgrade_fixup.sql
SQL> @/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 18.0.0.0.0 Build: 1
Generated on: 2019-02-12 19:49:43

For Source Database: ORCLDB
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 18.0.0.0.0

Preup                              Preupgrade
Action                             Issue Is
Number    Preupgrade Check Name    Remedied   Further DBA Action
------   ---------------------    ----------  -----------------------
1.       trgowner_no_admndbtrg      NO        Informational only.
                                            Further action is optional.
2.       pre_fixed_objects          YES       None.
3.       tablespaces_info           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.
UPGRADE:

At this stage, we are still connected to 11g database which is up and running.

Now run the dbua utility from 18c oracle_home location.

[oracle@ram ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@ram ~]$ export ORACLE_SID=orcldb
[oracle@ram ~]$ export ORACLE_HOME=/u01/app/oracle/product/18.0/db_1
[oracle@ram ~]$ cd /u01/app/oracle/product/18.3/db_1/bin
[oracle@ram bin]$ ./dbua

DBUA performs some of the checks before actually starting the database upgrade. Some of the checks can be done manually to reduce downtime for the upgrade.

DBUA provides below options:

– Upgrade timezone.

– Gather dictionary statistics before upgrade.

– Make user tablespaces read only.

– Take RMAN backup before upgrade.

– Create Restore Point for Database Flashback

– Restore database backup to rollback upgrade

– Option to execute Custom scripts before and after upgrade

– show the location of DBUA logs and Alert log files.

– Option to upgrade existing listener to 18.x home or create a new listener in 18.x target home.

select the Upgrade Oracle Database option, then click the “Next” button.

If the prerequisite checks highlight any issues, take the appropriate action to fix the issues. If all the prerequisite checks are passed, click the “Next” button.

Amend the upgrade options if necessary, then click the “Next” button.

Select the recovery options for use in the event of an upgrade failure, then click the “Next” button.

 If the database is using the 11g listener, accept the defaults, so the listener will be upgraded.

Select the desired management options, then click the “Next” button.

 

 

 

Post-upgrade checks:

Run “postupgrade_fixups.sql” to check post upgrade status.

SQL> @/u01/app/oracle/cfgtoollogs/orcldb/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: 18.0.0.0.0 Build: 1
Generated on: 2019-02-12 19:49:51

For Source Database: ORCLDB
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 18.0.0.0.0

Preup                              Preupgrade
Action                             Issue Is
Number   Preupgrade Check Name     Remedied      Further DBA Action
------   ---------------------     ----------    -------------------
8.      old_time_zones_exist       YES           None.
9.      post_dictionary            YES           None.
10.     post_fixed_objects         NO            Informational only.
                                          Further action is optional.
11.     upg_by_std_upgrd           NO            Informational only.
                                          Further action is optional.

The fixup scripts have been run and resovled 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.

Now the database upgrade is complete and the database is ready for normal use.

SQL> select VERSION,name,open_mode from v$instance,v$database;

VERSION            NAME         OPEN_MODE
------------      --------     -----------
18.0.0.0.0         ORCLDB       READ WRITE
SQL> SELECT * FROM v$timezone_file;

FILENAME              VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_31.dat        31           0

SQL> select TZ_VERSION from registry$database;

  TZ_VERSION
  ----------
      31

 

 

 

Catch Me On:- Hariprasath Rajaram 

Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                      FB Group:https://www.facebook.com/groups/894402327369506/             FB Page: https://www.facebook.com/dbahariprasath/?               Twitter: https://twitter.com/hariprasathdba

 

 

Oracle 18c Database Upgrade From 11.2.0.3 to 18.3.0.0 Using DBUA

 

 

 

 

 

Description:-

There are different ways of upgrading to the latest release of Oracle database and Oracle provides multiple methods to upgrade. Few are listed below:

  • Database Upgrade Assistant (DBUA)
  • Manual Upgrade
  • Transportable Tablespaces
  • Datapump export/import
  • Oracle Streams
  • Oracle GoldenGate

Here I am going to choose DBUA to upgrade my database,

DBUA provides a graphical user interface to guide you through the upgrade of Oracle Database.

Oracle Database Releases That Support Direct Upgrade

Review the supported options for direct upgrades to the latest Oracle Database release.
You can perform a direct upgrade to the new release from the following releases:
• 11.2.0.3 and 11.2.0.4
• 12.1.0.1 and 12.1.0.2
• 12.2.0.1

Steps for upgrade from 11.2.0.3 to 18.3.0.0 using DBUA :-

Presteps for db upgrade :-

Take RMAN full backups before upgrade.

rman target / 

run {
allocate channel test_backup_disk1 type disk format '/u01/backup/%d_%U';
backup incremental level 0 tag 'ORCL_BEFORE_UPG'  database;
backup format  tag 'ORCL_CONTROL_FILE' current controlfile;
release channel test_backup_disk1;
}

Ensure backup is complete before upgrade.

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected

Empty Recycle bin.

SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

Run Gather statistics to finish upgrade soon.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

Remove EM Database Control :-

Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target 18.0.0.0.0 ORACLE_HOME into the source 11.2.0.3.0 ORACLE_HOME.

[oracle@test admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Feb 12 08:38:14 2019

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @emremove.sql
old 70: IF (upper('&LOGGING') = 'VERBOSE')
new 70: IF (upper('VERBOSE') = 'VERBOSE')

PL/SQL procedure successfully completed.

Remove OLAP Catalog :-

[oracle@test admin]$ cd $ORACLE_HOME/olap/admin/

SQL> @catnoamd.sql

Start the 18c listener for dbupgrade :

[oracle@test preupgrade]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 
[oracle@test preupgrade]$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:$PATH

[oracle@test ]$ lsnrctl start

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 12-FEB-2019 17:42:09

Copyright (c) 1991, 2018, Oracle. All rights reserved.

Starting /u02/app/oracle/product/18.3.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 18.0.0.0.0 - Production
System parameter file is /u02/app/oracle/product/18.3.0/db_1/network/admin/listener.ora
Log messages written to /u02/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.localdomain.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test.localdomain.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 12-FEB-2019 17:42:09
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u02/app/oracle/product/18.3.0/db_1/network/admin/listener.ora
Listener Log File /u02/app/oracle/diag/tnslsnr/test/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.localdomain.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

 Pre-upgrade checks :

Run the preupgrade tool.

The preupgrade.jar Pre-Upgrade Information Tool is supplied with Oracle Database 18c.
This tool has reside in new oracle home.
/u02/app/oracle/product/18.3.0/db_1/rdbms/admin/preupgrade.jar

[oracle@test ~]$ /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/java -jar /u02/app/oracle/product/18.3.0/db_1/rdbms/admin/preupgrade.jar FILE DIR /u01/preupgrade/

==================
PREUPGRADE SUMMARY
==================
/u01/preupgrade/preupgrade.log
/u01/preupgrade/preupgrade_fixups.sql
/u01/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade log into the database and execute the preupgrade fixups
@/u01/preupgrade/preupgrade_fixups.sql

After the upgrade:

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

Preupgrade complete: 2019-02-08T19:42:18

After run the above tool we will get below sql files.

[oracle@test ~]$ cd /u01/preupgrade/
[oracle@test preupgrade]$ ls -lrt
total 648
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:38  
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:42 oracle
-rw-r--r-- 1 oracle oinstall 7963 Feb 8 19:42 preupgrade_driver.sql
-rw-r--r-- 1 oracle oinstall 14846 Feb 8 19:42 dbms_registry_extended.sql
-rw-r--r-- 1 oracle oinstall 422048 Feb 8 19:42 preupgrade_package.sql
-rw-r--r-- 1 oracle oinstall 83854 Feb 8 19:42 preupgrade_messages.properties
-rw-r--r-- 1 oracle oinstall 14383 Feb 8 19:42 parameters.properties
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:42 upgrade
-rw-r--r-- 1 oracle oinstall 50172 Feb 8 19:42 components.properties
-rw-r--r-- 1 oracle oinstall 1 Feb 8 19:42 checksBuffer.tmp
-rw-r--r-- 1 oracle oinstall 14521 Feb 8 19:42 preupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall 9914 Feb 8 19:42 postupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall 11816 Feb 8 19:42 preupgrade.log

 Run the preupgrade_fixup.sql

[oracle@test preupgrade]$ export ORACLE_SID=dbwr18c

[oracle@test preupgrade]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

[oracle@test preupgrade]$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:$PATH

[oracle@test ]$ cd /u01/preupgrade 

[oracle@test ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 8 19:48:36 2019

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @/u01/preupgrade/preupgrade_fixups.sql

Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 18.0.0.0.0 Build: 1
Generated on: 2019-02-08 19:42:16

For Source Database: DBWR18C
Source Database Version: 11.2.0.3.0
For Upgrade to Version: 18.0.0.0.0

Preup Preupgrade
Action Issue Is
Number Preupgrade Check Name Remedied Further DBA Action
------ ------------------------ ---------- --------------------------------
1. parameter_min_val NO Manual fixup recommended.
2. em_present NO Manual fixup recommended.
3. amd_exists NO Manual fixup recommended.
4. apex_manual_upgrade NO Manual fixup recommended.
5. dictionary_stats YES None.
6. trgowner_no_admndbtrg NO Informational only.
Further action is optional.
7. mv_refresh NO Informational only.
Further action is optional.
8. pre_fixed_objects YES None.
9. tablespaces_info 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.

Check INVALID objects count before upgrade :

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

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

Upgrade Database from 11.2.0.3 to 18c  using DBCA :-

DBUA performs some of the checks before actually starting the database upgrade. Some of the checks can be done manually to reduce downtime for the upgrade.

DBUA provides below options:

– Upgrade timezone.

– Gather dictionary statistics before upgrade.

– Make user tablespaces read only.

– Take RMAN backup before upgrade.

– Create Restore Point for Database Flashback

– Restore database backup to rollback upgrade

– Option to execute Custom scripts before and after upgrade

– show the location of DBUA logs and Alert log files.

– Option to upgrade existing listener to 18.x home or create a new listener in 18.x target home.

[oracle@test ~]$ export ORACLE_SID=dbwr18c
[oracle@test~]$ export ORACLE_HOME=/u02/app/oracle/product/18.3.0/db_1/ 
[oracle@test ~]$ export PATH=/u02/app/oracle/product/18.3.0/db_1/bin/:$PATH
[oracle@test ~]$ dbua

Select database name to upgrade to 18c version.

Preupgrade checks :

If you want to upgrade APEX version to 18.2,download APEX software 18.2 and run apexins.sql and upgrade it.

@apexins.sql APEX APEX TEMP /i/

After preupgrade warnings are resolved,select upgrade options to upgrade the database.

Select Recovery options to recover the database in case of issues.

Create listener or use existing listener which is running.

Select option if you want to configure EM express and port number.

Post Upgrade checks :

SQL> @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.
WARNING - This script was generated for database DBWR18C.
Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 18.0.0.0.0 Build: 1
Generated on: 2019-02-08 19:42:17

For Source Database: DBWR18C
Source Database Version: 11.2.0.3.0
For Upgrade to Version: 18.0.0.0.0

Preup Preupgrade
Action Issue Is
Number Preupgrade Check Name   Remedied Further DBA Action
------ ----------------------- --------- ---------------------------
10. depend_usr_tables          YES       None.
11. old_time_zones_exist       YES       None.
12. post_dictionary            YES       None.
13. post_fixed_objects         NO        Informational only.Further action is optional.
14. upg_by_std_upgrd           YES       None.

The fixup scripts have been run and resovled 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.

Now the database upgrade is complete and the database is ready for normal use.

SQL> select VERSION,name,open_mode from v$instance,v$database;

VERSION          NAME           OPEN_MODE
-----------      -------        ----------
18.0.0.0.0       DBWR18C        READ WRITE
SQL> SELECT * FROM v$timezone_file;

FILENAME              VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_31.dat         31          0

SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
    31
Catch Me On:- Hariprasath Rajaram

Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                       FB Group:https://www.facebook.com/groups/894402327369506/              FB Page: https://www.facebook.com/dbahariprasath/?               Twitter: https://twitter.com/hariprasathdba

 

Oracle 18c Database Upgrade From 11.2.0.3 to 18.3.0.0 Using Manual Method

Oracle 18c Database Manual Upgrade From 11.2.0.3 to 18.3.0.0.0 :-

Description:- 

A manual upgrade consists of running SQL scripts and utilities from a command line to upgrade a database to the new Oracle Database release.

Oracle Database Releases That Support Direct Upgrade
Review the supported options for direct upgrades to the latest Oracle Database release.
You can perform a direct upgrade to the new release from the following releases:
• 11.2.0.3 and 11.2.0.4
• 12.1.0.1 and 12.1.0.2
• 12.2.0.1

Presteps for db upgrade :-

Take RMAN full backups before upgrade.

rman target / 

run {
allocate channel test_backup_disk1 type disk format '/u01/backup/%d_%U';
backup incremental level 0 tag 'ORCL_BEFORE_UPG'  database;
backup format  tag 'ORCL_CONTROL_FILE' current controlfile;
release channel test_backup_disk1;
}

Ensure backup is complete before upgrade.

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected

Empty Recycle bin.

SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

Run Gather statistics to finish upgrade soon.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

 Pre-upgrade checks :

Run the preupgrade tool.

The preupgrade.jar Pre-Upgrade Information Tool is supplied with Oracle Database 18c.
This tool has reside in new oracle home.
/u02/app/oracle/product/18.3.0/db_1/rdbms/admin/preupgrade.jar

[oracle@test ~]$ /u01/app/oracle/product/11.2.0/dbhome_1/jdk/bin/java -jar /u02/app/oracle/product/18.3.0/db_1/rdbms/admin/preupgrade.jar FILE DIR /u01/preupgrade/

==================
PREUPGRADE SUMMARY
==================
/u01/preupgrade/preupgrade.log
/u01/preupgrade/preupgrade_fixups.sql
/u01/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade log into the database and execute the preupgrade fixups
@/u01/preupgrade/preupgrade_fixups.sql

After the upgrade:

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

Preupgrade complete: 2019-02-08T19:42:18

After run the above tool we will get below sql files.

[oracle@test ~]$ cd /u01/preupgrade/
[oracle@test preupgrade]$ ls -lrt
total 648
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:38  
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:42 oracle
-rw-r--r-- 1 oracle oinstall 7963 Feb 8 19:42 preupgrade_driver.sql
-rw-r--r-- 1 oracle oinstall 14846 Feb 8 19:42 dbms_registry_extended.sql
-rw-r--r-- 1 oracle oinstall 422048 Feb 8 19:42 preupgrade_package.sql
-rw-r--r-- 1 oracle oinstall 83854 Feb 8 19:42 preupgrade_messages.properties
-rw-r--r-- 1 oracle oinstall 14383 Feb 8 19:42 parameters.properties
drwxr-xr-x 3 oracle oinstall 4096 Feb 8 19:42 upgrade
-rw-r--r-- 1 oracle oinstall 50172 Feb 8 19:42 components.properties
-rw-r--r-- 1 oracle oinstall 1 Feb 8 19:42 checksBuffer.tmp
-rw-r--r-- 1 oracle oinstall 14521 Feb 8 19:42 preupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall 9914 Feb 8 19:42 postupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall 11816 Feb 8 19:42 preupgrade.log

 Run the preupgrade_fixup.sql

[oracle@test preupgrade]$ export ORACLE_SID=orcl18c

[oracle@test preupgrade]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

[oracle@test preupgrade]$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:$PATH

[oracle@test ]$ cd /u01/preupgrade 

[oracle@test ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 8 19:48:36 2019

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @/u01/preupgrade/preupgrade_fixups.sql

Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 18.0.0.0.0 Build: 1
Generated on: 2019-02-08 19:42:16

For Source Database: ORCL18C
Source Database Version: 11.2.0.3.0
For Upgrade to Version: 18.0.0.0.0

Preup Preupgrade
Action Issue Is
Number Preupgrade Check Name Remedied Further DBA Action
------ ------------------------ ---------- --------------------------------
1. parameter_min_val NO Manual fixup recommended.
2. em_present NO Manual fixup recommended.
3. amd_exists NO Manual fixup recommended.
4. apex_manual_upgrade NO Manual fixup recommended.
5. dictionary_stats YES None.
6. trgowner_no_admndbtrg NO Informational only.
Further action is optional.
7. mv_refresh NO Informational only.
Further action is optional.
8. pre_fixed_objects YES None.
9. tablespaces_info 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.

Check Timezone version :

Check if target database’s time zone version is lower than the source database time zone version.

SQL> SELECT version FROM v$timezone_file;

VERSION
-------
14

SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME; 2 3 4

PROPERTY_NAME            VALUE
------------------------ -----
DST_PRIMARY_TT_VERSION   14
DST_SECONDARY_TT_VERSION 0
DST_UPGRADE_STATE        NONE

Upgrade Database from 11.2.0.3 to 18c :-

Shutdown the 11g database:

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

Copy the parameter and password file from the 11g home to the new 18c home.

[oracle@test ]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl18c.ora /u02/app/oracle/product/18.3.0/db_1/dbs
[oracle@test ]$ cp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapworcl18c /u02/app/oracle/product/18.3.0/db_1/dbs

Set new ORACLE_HOME for 18c location and startup database in upgrade mode :

[oracle@test ~]$ export ORACLE_SID=orcl18c

[oracle@test~]$ export ORACLE_HOME=/u02/app/oracle/product/18.3.0/db_1/

[oracle@test ~]$ export PATH=/u02/app/oracle/product/18.3.0/db_1/bin/:$PATH
[oracle@test ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Fri Feb 8 20:00:42 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 2365584808 bytes
Fixed Size 8660392 bytes
Variable Size 587202560 bytes
Database Buffers 1761607680 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.

Run the dbupgrade utility :

[oracle@test ~]$ $ORACLE_HOME/bin/dbupgrade -n 2 -l /u01/

-n - number of channels
-l - log file directory

Argument list for [/u02/app/oracle/product/18.3.0/db_1//rdbms/admin/catctl.pl]
Run in c = 0
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = 0
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 0
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
RO User Tablespaces T = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

catctl.pl VERSION: [18.0.0.0.0]
STATUS: [Production]
BUILD: [RDBMS_18.3.0.0.0DBRU_LINUX.X64_180627]


/u02/app/oracle/product/18.3.0/db_1/rdbms/admin/orahome = [/u02/app/oracle/product/18.3.0/db_1/]
/u02/app/oracle/product/18.3.0/db_1//bin/orabasehome = [/u02/app/oracle/product/18.3.0/db_1/]
catctlGetOrabase = [/u02/app/oracle/product/18.3.0/db_1/]

Analyzing file /u02/app/oracle/product/18.3.0/db_1//rdbms/admin/catupgrd.sql

Log file directory = [/u01/]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/cfgtoollogs/upgrade20190208200240/catupgrd_catcon_34323.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190208200240/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/cfgtoollogs/upgrade20190208200240/catupgrd_*.lst] files for spool files, if any


Number of Cpus = 1
Database Name = orcl18c
DataBase Version = 11.2.0.3.0
catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/catupgrd_catcon_34323.lst]

catcon::set_log_file_base_path: catcon: See [/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/catupgrd_*.lst] files for spool files, if any


Log file directory = [/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243]

Parallel SQL Process Count = 4
Components in [orcl18c]
Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT EM JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV MGW ODM OLS RAC WK]

------------------------------------------------------
Phases [0-108] Start Time:[2019_02_08 20:02:44]
------------------------------------------------------*********** Executing Change Scripts ***********
Serial Phase #:0 [orcl18c] Files:1 Time: 69s
*************** Catalog Core SQL ***************
Serial Phase #:1 [orcl18c] Files:5 Time: 37s
Restart Phase #:2 [orcl18c] Files:1 Time: 0s
*********** Catalog Tables and Views ***********
Parallel Phase #:3 [orcl18c] Files:19 Time: 17s
Restart Phase #:4 [orcl18c] Files:1 Time: 0s
************* Catalog Final Scripts ************
Serial Phase #:5 [orcl18c] Files:7 Time: 13s
***************** Catproc Start ****************
Serial Phase #:6 [orcl18c] Files:1 Time: 10s
***************** Catproc Types ****************
Serial Phase #:7 [orcl18c] Files:2 Time: 11s
Restart Phase #:8 [orcl18c] Files:1 Time: 0s
**************** Catproc Tables ****************
Parallel Phase #:9 [orcl18c] Files:66 Time: 38s
Restart Phase #:10 [orcl18c] Files:1 Time: 1s
************* Catproc Package Specs ************
Serial Phase #:11 [orcl18c] Files:1 Time: 50s
Restart Phase #:12 [orcl18c] Files:1 Time: 1s
************** Catproc Procedures **************
Parallel Phase #:13 [orcl18c] Files:94 Time: 12s
Restart Phase #:14 [orcl18c] Files:1 Time: 1s
Parallel Phase #:15 [orcl18c] Files:117 Time: 20s
Restart Phase #:16 [orcl18c] Files:1 Time: 0s
Serial Phase #:17 [orcl18c] Files:17 Time: 3s
Restart Phase #:18 [orcl18c] Files:1 Time: 0s
***************** Catproc Views ****************
Parallel Phase #:19 [orcl18c] Files:32 Time: 21s
Restart Phase #:20 [orcl18c] Files:1 Time: 1s
Serial Phase #:21 [orcl18c] Files:3 Time: 6s
Restart Phase #:22 [orcl18c] Files:1 Time: 0s
Parallel Phase #:23 [orcl18c] Files:24 Time: 134s
Restart Phase #:24 [orcl18c] Files:1 Time: 0s
Parallel Phase #:25 [orcl18c] Files:12 Time: 75s
Restart Phase #:26 [orcl18c] Files:1 Time: 0s
Serial Phase #:27 [orcl18c] Files:1 Time: 0s
Serial Phase #:28 [orcl18c] Files:3 Time: 4s
Serial Phase #:29 [orcl18c] Files:1 Time: 0s
Restart Phase #:30 [orcl18c] Files:1 Time: 0s
*************** Catproc CDB Views **************
Serial Phase #:31 [orcl18c] Files:1 Time: 0s
Restart Phase #:32 [orcl18c] Files:1 Time: 1s
Serial Phase #:34 [orcl18c] Files:1 Time: 0s
***************** Catproc PLBs *****************
Serial Phase #:35 [orcl18c] Files:288 Time: 17s
Serial Phase #:36 [orcl18c] Files:1 Time: 0s
Restart Phase #:37 [orcl18c] Files:1 Time: 0s
Serial Phase #:38 [orcl18c] Files:2 Time: 4s
Restart Phase #:39 [orcl18c] Files:1 Time: 0s
*************** Catproc DataPump ***************
Serial Phase #:40 [orcl18c] Files:3 Time: 44s
Restart Phase #:41 [orcl18c] Files:1 Time: 0s
****************** Catproc SQL *****************
Parallel Phase #:42 [orcl18c] Files:13 Time: 88s
Restart Phase #:43 [orcl18c] Files:1 Time: 0s
Parallel Phase #:44 [orcl18c] Files:11 Time: 15s
Restart Phase #:45 [orcl18c] Files:1 Time: 0s
Parallel Phase #:46 [orcl18c] Files:3 Time: 1s
Restart Phase #:47 [orcl18c] Files:1 Time: 0s
************* Final Catproc scripts ************
Serial Phase #:48 [orcl18c] Files:1 Time: 4s
Restart Phase #:49 [orcl18c] Files:1 Time: 1s
************** Final RDBMS scripts *************
Serial Phase #:50 [orcl18c] Files:1 Time: 18s
************ Upgrade Component Start ***********
Serial Phase #:51 [orcl18c] Files:1 Time: 0s
Restart Phase #:52 [orcl18c] Files:1 Time: 1s
********** Upgrading Java and non-Java *********
Serial Phase #:53 [orcl18c] Files:2 Time: 338s
***************** Upgrading XDB ****************
Restart Phase #:54 [orcl18c] Files:1 Time: 1s
Serial Phase #:56 [orcl18c] Files:3 Time: 25s
Serial Phase #:57 [orcl18c] Files:3 Time: 4s
Parallel Phase #:58 [orcl18c] Files:9 Time: 3s
Parallel Phase #:59 [orcl18c] Files:25 Time: 4s
Serial Phase #:60 [orcl18c] Files:4 Time: 5s
Serial Phase #:61 [orcl18c] Files:1 Time: 0s
Serial Phase #:62 [orcl18c] Files:31 Time: 2s
Serial Phase #:63 [orcl18c] Files:1 Time: 0s
Parallel Phase #:64 [orcl18c] Files:6 Time: 3s
Serial Phase #:65 [orcl18c] Files:2 Time: 14s
Serial Phase #:66 [orcl18c] Files:3 Time: 57s
**************** Upgrading ORDIM ***************
Restart Phase #:67 [orcl18c] Files:1 Time: 0s
Serial Phase #:69 [orcl18c] Files:1 Time: 1s
Parallel Phase #:70 [orcl18c] Files:2 Time: 39s
Serial Phase #:71 [orcl18c] Files:1 Time: 42s
Restart Phase #:72 [orcl18c] Files:1 Time: 0s
Parallel Phase #:73 [orcl18c] Files:2 Time: 7s
Serial Phase #:74 [orcl18c] Files:2 Time: 0s
***************** Upgrading SDO ****************
Restart Phase #:75 [orcl18c] Files:1 Time: 0s
Serial Phase #:77 [orcl18c] Files:1 Time: 23s
Serial Phase #:78 [orcl18c] Files:1 Time: 1s
Restart Phase #:79 [orcl18c] Files:1 Time: 1s
Serial Phase #:80 [orcl18c] Files:1 Time: 14s
Restart Phase #:81 [orcl18c] Files:1 Time: 0s
Parallel Phase #:82 [orcl18c] Files:3 Time: 55s
Restart Phase #:83 [orcl18c] Files:1 Time: 0s
Serial Phase #:84 [orcl18c] Files:1 Time: 3s
Restart Phase #:85 [orcl18c] Files:1 Time: 1s
Serial Phase #:86 [orcl18c] Files:1 Time: 4s
Restart Phase #:87 [orcl18c] Files:1 Time: 0s
Parallel Phase #:88 [orcl18c] Files:4 Time: 59s
Restart Phase #:89 [orcl18c] Files:1 Time: 0s
Serial Phase #:90 [orcl18c] Files:1 Time: 1s
Restart Phase #:91 [orcl18c] Files:1 Time: 0s
Serial Phase #:92 [orcl18c] Files:2 Time: 5s
Restart Phase #:93 [orcl18c] Files:1 Time: 1s
Serial Phase #:94 [orcl18c] Files:1 Time: 0s
Restart Phase #:95 [orcl18c] Files:1 Time: 0s
******* Upgrading ODM, WK, EXF, RUL, XOQ *******
Serial Phase #:96 [orcl18c] Files:1 Time: 21s
Restart Phase #:97 [orcl18c] Files:1 Time: 0s
*********** Final Component scripts ***********
Serial Phase #:98 [orcl18c] Files:1 Time: 1s
************* Final Upgrade scripts ************
Serial Phase #:99 [orcl18c] Files:1 Time: 150s
******************* Migration ******************
Serial Phase #:100 [orcl18c] Files:1 Time: 37s
*** End PDB Application Upgrade Pre-Shutdown ***
Serial Phase #:101 [orcl18c] Files:1 Time: 1s
Serial Phase #:102 [orcl18c] Files:1 Time: 0s
Serial Phase #:103 [orcl18c] Files:1 Time: 67s
***************** Post Upgrade *****************
Serial Phase #:104 [orcl18c] Files:1 Time: 100s
**************** Summary report ****************
Serial Phase #:105 [orcl18c] Files:1 Time: 0s
*** End PDB Application Upgrade Post-Shutdown **
Serial Phase #:106 [orcl18c] Files:1 Time: 0s
Serial Phase #:107 [orcl18c] Files:1 Time: 0s
Serial Phase #:108 [orcl18c] Files:1 Time: 33s

------------------------------------------------------
Phases [0-108] End Time:[2019_02_08 20:33:25]
------------------------------------------------------

Grand Total Time: 1843s

LOG FILES: (/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/catupgrd*.log)

Upgrade Summary Report Located in:
/u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/upg_summary.log

Grand Total Upgrade Time: [0d:0h:30m:43s]

Execute Post-Upgrade Status Tool, utlu122s.sql.

SQL> @utlu122s.sql


Oracle Database Release 18 Post-Upgrade Status Tool 02-08-2019 20:44:3

Component Current Full Elapsed Time
Name Status Version HH:MM:SS

Oracle Server UPGRADED 18.3.0.0.0 00:11:54
JServer JAVA Virtual Machine VALID 18.3.0.0.0 00:03:27
Oracle XDK UPGRADED 18.3.0.0.0 00:00:25
Oracle Database Java Packages UPGRADED 18.3.0.0.0 00:00:10
OLAP Analytic Workspace UPGRADED 18.3.0.0.0 00:00:12
OLAP Catalog OPTION OFF 11.2.0.3.0 00:00:00
Oracle Text UPGRADED 18.3.0.0.0 00:00:35
Oracle Workspace Manager UPGRADED 18.3.0.0.0 00:00:46
Oracle Real Application Clusters OPTION OFF 18.3.0.0.0 00:00:00
Oracle XML Database UPGRADED 18.3.0.0.0 00:01:56
Oracle Multimedia UPGRADED 18.3.0.0.0 00:01:28
Spatial UPGRADED 18.3.0.0.0 00:02:46
Oracle OLAP API UPGRADED 18.3.0.0.0 00:00:13
Upgrade Datapatch 00:01:09
Final Actions 00:03:06
Post Upgrade 00:01:38
Post Upgrade Datapatch 00:00:15

Total Upgrade Time: 00:29:11

Database time zone version is 14. It is older than current release time
zone version 31. Time zone upgrade is needed using the DBMS_DST package.

Summary Report File = /u02/app/oracle/product/18.3.0/db_1/cfgtoollogs/orcl18c/upgrade20190208200243/upg_summary.log

 

20:44:37 SQL> @catuppst.sql
20:45:08 SQL> Rem
20:45:08 SQL> Rem $Header: rdbms/admin/catuppst.sql /main/60 2017/08/03 17:44:03 wesmith Exp $
20:45:08 SQL> Rem
20:45:08 SQL> Rem catuppst.sql
20:45:08 SQL> Rem
20:45:08 SQL> Rem Copyright (c) 2006, 2017, Oracle and/or its affiliates.
20:45:08 SQL> Rem All rights reserved.
20:45:08 SQL> Rem
20:45:08 SQL> Rem NAME
20:45:08 SQL> Rem catuppst.sql - CATalog UPgrade PoST-upgrade actions
20:45:08 SQL> Rem
20:45:08 SQL> Rem DESCRIPTION
20:45:08 SQL> Rem This post-upgrade script performs remaining upgrade actions that
20:45:08 SQL> Rem do not require that the database be open in UPGRADE mode.
20:45:08 SQL> Rem Automatically apply the latest PSU.
20:45:08 SQL> Rem
20:45:08 SQL> Rem NOTES
20:45:08 SQL> Rem You must be connected AS SYSDBA to run this script.
20:45:08 SQL> Rem
20:45:08 SQL> Rem BEGIN SQL_FILE_METADATA
20:45:08 SQL> Rem SQL_SOURCE_FILE: rdbms/admin/catuppst.sql
20:45:08 SQL> Rem SQL_SHIPPED_FILE: rdbms/admin/catuppst.sql
20:45:08 SQL> Rem SQL_PHASE: UPGRADE
20:45:08 SQL> Rem SQL_STARTUP_MODE: UPGRADE
20:45:08 SQL> Rem SQL_IGNORABLE_ERRORS: NONE
20:45:08 SQL> Rem SQL_CALLING_FILE: rdbms/admin/catupgrd.sql
20:45:08 SQL> Rem END SQL_FILE_METADATA
.
.
.
.

Elapsed: 00:00:00.00
20:45:09 SQL>
20:45:09 SQL> Rem Set errorlogging off
20:45:09 SQL> SET ERRORLOGGING OFF;
20:45:09 SQL>
20:45:09 SQL> Rem
20:45:09 SQL> Rem Set _ORACLE_SCRIPT to false
20:45:09 SQL> Rem
20:45:09 SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=false;

Session altered.

Elapsed: 00:00:00.00
20:45:09 SQL>
20:45:09 SQL> Rem *********************************************************************
20:45:09 SQL> Rem END catuppst.sql
20:45:09 SQL> Rem *********************************************************************

Execute utlrp.sql script to compile  invalid objects.

SQL> @utlrp.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/utlrp.sql /main/23 2017/03/20 12:21:12 raeburns Exp $
SQL> Rem
SQL> Rem utlrp.sql
SQL> Rem
SQL> Rem Copyright (c) 1998, 2017, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem NAME
SQL> Rem utlrp.sql - Recompile invalid objects
SQL> Rem
SQL> Rem DESCRIPTION
SQL> Rem This script recompiles invalid objects in the database.
SQL> Rem
SQL> Rem When run as one of the last steps during upgrade or downgrade,
SQL> Rem this script will validate all remaining invalid objects. It will
SQL> Rem also run a component validation procedure for each component in
SQL> Rem the database. See the README notes for your current release and
SQL> Rem the Oracle Database Upgrade book for more information about
SQL> Rem using utlrp.sql
SQL> Rem
SQL> Rem Although invalid objects are automatically re-validated when used,
SQL> Rem it is useful to run this script after an upgrade or downgrade and
SQL> Rem after applying a patch. This minimizes latencies caused by
SQL> Rem on-demand recompilation. Oracle strongly recommends running this
SQL> Rem script after upgrades, downgrades and patches.
SQL> Rem
SQL> Rem NOTES
SQL> Rem * This script must be run using SQL*PLUS.
SQL> Rem * You must be connected AS SYSDBA to run this script.
SQL> Rem * There should be no other DDL on the database while running the
SQL> Rem script. Not following this recommendation may lead to deadlocks.
SQL> Rem
SQL> Rem BEGIN SQL_FILE_METADATA
SQL> Rem SQL_SOURCE_FILE: rdbms/admin/utlrp.sql
SQL> Rem SQL_SHIPPED_FILE: rdbms/admin/utlrp.sql
SQL> Rem SQL_PHASE: UTILITY
SQL> Rem SQL_STARTUP_MODE: NORMAL
SQL> Rem SQL_IGNORABLE_ERRORS: NONE
SQL> Rem SQL_CALLING_FILE: NONE
SQL> Rem END SQL_FILE_METADATA
SQL> Rem
SQL> Rem MODIFIED (MM/DD/YY)
SQL> Rem raeburns 03/09/17 - Bug 25616909: Use UTILITY for SQL_PHASE
SQL> Rem gviswana 06/26/03 - Switch default to parallel if appropriate
SQL> Rem gviswana 06/12/03 - Switch default back to serial
SQL> Rem gviswana 05/20/03 - 2814808: Automatic parallelism tuning
SQL> Rem rburns 04/28/03 - timestamps and serveroutput for diagnostics
SQL> Rem gviswana 04/13/03 - utlrcmp.sql load -> catproc
SQL> Rem gviswana 06/25/02 - Add documentation
SQL> Rem gviswana 11/12/01 - Use utl_recomp.recomp_serial
SQL> Rem rdecker 11/09/01 - ADD ALTER library support FOR bug 1952368
SQL> Rem rburns 11/12/01 - validate all components after compiles
SQL> Rem rburns 11/06/01 - fix invalid CATPROC call
SQL> Rem rburns 09/29/01 - use 9.2.0
SQL> Rem rburns 09/20/01 - add check for CATPROC valid
SQL> Rem rburns 07/06/01 - get version from instance view
SQL> Rem rburns 05/09/01 - fix for use with 8.1.x
SQL> Rem arithikr 04/17/01 - 1703753: recompile object type# 29,32,33
SQL> Rem skabraha 09/25/00 - validate is now a keyword
SQL> Rem kosinski 06/14/00 - Persistent parameters
SQL> Rem skabraha 06/05/00 - validate tables also
SQL> Rem jdavison 04/11/00 - Modify usage notes for 8.2 changes.
SQL> Rem rshaikh 09/22/99 - quote name for recompile
SQL> Rem ncramesh 08/04/98 - change for sqlplus
SQL> Rem usundara 06/03/98 - merge from 8.0.5
SQL> Rem usundara 04/29/98 - creation (split from utlirp.sql).
SQL> Rem Mark Ramacher (mramache) was the original
SQL> Rem author of this script.
SQL> Rem
SQL>
SQL> Rem ===========================================================================
SQL> Rem BEGIN utlrp.sql
SQL> Rem ===========================================================================
SQL>
SQL> @@utlprp.sql 0
SQL> Rem Copyright (c) 2003, 2017, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem NAME
SQL> Rem utlprp.sql - Recompile invalid objects in the database
SQL> Rem
SQL> Rem DESCRIPTION
SQL> Rem This script recompiles invalid objects in the database.
SQL> Rem
SQL> Rem This script is typically used to recompile invalid objects
SQL> Rem remaining at the end of a database upgrade or downgrade.
SQL> Rem
SQL> Rem Although invalid objects are automatically recompiled on demand,
SQL> Rem running this script ahead of time will reduce or eliminate
SQL> Rem latencies due to automatic recompilation.
SQL> Rem
SQL> Rem This script is a wrapper based on the UTL_RECOMP package.
SQL> Rem UTL_RECOMP provides a more general recompilation interface,
SQL> Rem including options to recompile objects in a single schema. Please
SQL> Rem see the documentation for package UTL_RECOMP for more details.
SQL> Rem
SQL> Rem INPUTS
SQL> Rem The degree of parallelism for recompilation can be controlled by
SQL> Rem providing a parameter to this script. If this parameter is 0 or
SQL> Rem NULL, UTL_RECOMP will automatically determine the appropriate
SQL> Rem level of parallelism based on Oracle parameters cpu_count and
SQL> Rem parallel_threads_per_cpu. If the parameter is 1, sequential
SQL> Rem recompilation is used. Please see the documentation for package
SQL> Rem UTL_RECOMP for more details.
SQL> Rem
SQL> Rem NOTES
SQL> Rem * You must be connected AS SYSDBA to run this script.
SQL> Rem * There should be no other DDL on the database while running the
SQL> Rem script. Not following this recommendation may lead to deadlocks.
SQL> Rem
SQL> Rem BEGIN SQL_FILE_METADATA
SQL> Rem SQL_SOURCE_FILE: rdbms/admin/utlprp.sql
SQL> Rem SQL_SHIPPED_FILE: rdbms/admin/utlprp.sql
SQL> Rem SQL_PHASE: UTILITY
SQL> Rem SQL_STARTUP_MODE: NORMAL
SQL> Rem SQL_IGNORABLE_ERRORS: NONE
SQL> Rem SQL_CALLING_FILE: utlrp.sql
SQL> Rem END SQL_FILE_METADATA
SQL> Rem
SQL> Rem MODIFIED (MM/DD/YY)
SQL> Rem thbaby 05/11/17 - Bug 26046188: disable redirection in Proxy PDB
SQL> Rem raeburns 04/15/17 - Bug 25790192: Add SQL_METADATA
SQL> Rem jmuller 12/09/14 - Fix bug 19728696 (sort of): clarify comments
SQL> Rem pyam 04/08/14 - 18478064: factor out to reenable_indexes.sql
SQL> Rem kquinn 11/01/11 - 13059165: amend 'OBJECTS WITH ERRORS' SQL
SQL> Rem cdilling 05/15/10 - fix bug 9712478 - call local enquote_name
SQL> Rem anighosh 02/19/09 - #(8264899): re-enabling of function based indexes
SQL> Rem not needed.
SQL> Rem cdilling 07/21/08 - check bitand for functional index - bug 7243270
SQL> Rem cdilling 01/21/08 - add support for ORA-30552
SQL> Rem cdilling 08/27/07 - check disabled indexes only
SQL> Rem cdilling 05/22/07 - add support for ORA-38301
SQL> Rem cdilling 02/19/07 - 5530085 - renable invalid indexes
SQL> Rem rburns 03/17/05 - use dbms_registry_sys
SQL> Rem gviswana 02/07/05 - Post-compilation diagnostics
SQL> Rem gviswana 09/09/04 - Auto tuning and diagnosability
SQL> Rem rburns 09/20/04 - fix validate_components
SQL> Rem gviswana 12/09/03 - Move functional-index re-enable here
SQL> Rem gviswana 06/04/03 - gviswana_bug-2814808
SQL> Rem gviswana 05/28/03 - Created
SQL> Rem
SQL>
SQL> SET VERIFY OFF;
SQL>
SQL> Rem Bug 26046188: In a Proxy PDB, all top-level statements are redirected to
SQL> Rem the target (PDB) of the Proxy PDB. Set underscore parameter so that
SQL> Rem automatic redirection is turned off. This is needed so that utlrp/utlprp
SQL> Rem can be used to recompile objects in Proxy PDB.
SQL> Rem
SQL> alter session set "_enable_view_pdb"=false;

ltered.

00:00:00.00
SQL>
SQL> SELECT dbms_registry_sys.time_stamp('utlrp_bgn') as timestamp from dual;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2019-02-08 20:48:04

1 row selected.

Elapsed: 00:00:00.02
SQL>
SQL> DOC
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
SQL>
SQL> DECLARE
2 threads pls_integer := &&1;
3 BEGIN
4 utl_recomp.recomp_parallel(threads);
5 END;
6 /

PL/SQL procedure successfully completed.

Elapsed: 00:06:46.46
SQL>
SQL> SELECT dbms_registry_sys.time_stamp('utlrp_end') as timestamp from dual;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2019-02-08 20:54:51

1 row selected.

Elapsed: 00:00:00.02
SQL>
SQL> Rem #(8264899): The code to Re-enable functional indexes, which used to exist
SQL> Rem here, is no longer needed.
SQL>
SQL> DOC
DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
SQL> select COUNT(*) "OBJECTS WITH ERRORS" from obj$ where status in (3,4,5,6);

OBJECTS WITH ERRORS
-------------------
0

1 row selected.

Elapsed: 00:00:00.01
SQL>
SQL>
SQL> DOC
DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#
SQL> select COUNT(*) "ERRORS DURING RECOMPILATION" from utl_recomp_errors;

ERRORS DURING RECOMPILATION
---------------------------
0

1 row selected.

Elapsed: 00:00:00.00
SQL>
SQL> Rem =====================================================================
SQL> Rem Reenable indexes that may have been disabled, based on the
SQL> Rem table SYS.ENABLED$INDEXES
SQL> Rem =====================================================================
SQL>
SQL> @@?/rdbms/admin/reenable_indexes.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/reenable_indexes.sql /main/3 2015/02/04 13:57:27 sylin Exp $
SQL> Rem
SQL> Rem reenable_indexes.sql
SQL> Rem
SQL> Rem Copyright (c) 2014, 2015, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem NAME
SQL> Rem reenable_indexes.sql - <one-line expansion of the name>
SQL> Rem
SQL> Rem DESCRIPTION
SQL> Rem <short description of component this file declares/defines>
SQL> Rem
SQL> Rem NOTES
SQL> Rem <other useful comments, qualifications, etc.>
SQL> Rem
SQL> Rem BEGIN SQL_FILE_METADATA
SQL> Rem SQL_SOURCE_FILE: rdbms/admin/reenable_indexes.sql
SQL> Rem SQL_SHIPPED_FILE: rdbms/admin/reenable_indexes.sql
SQL> Rem SQL_PHASE: REENABLE_INDEXES
SQL> Rem SQL_STARTUP_MODE: NORMAL
SQL> Rem SQL_IGNORABLE_ERRORS: NONE
SQL> Rem SQL_CALLING_FILE: rdbms/admin/noncdb_to_pdb.sql
SQL> Rem END SQL_FILE_METADATA
SQL> Rem
SQL> Rem MODIFIED (MM/DD/YY)
SQL> Rem sylin 01/30/15 - bug20422151 - longer identifier
SQL> Rem surman 01/08/15 - 19475031: Update SQL metadata
SQL> Rem pyam 04/03/14 - Reenable indexes based on sys.enabled$indexes
SQL> Rem (formerly in utlprp.sql)
SQL> Rem pyam 04/03/14 - Created
SQL> Rem
SQL>
SQL> Rem
SQL> Rem Declare function local_enquote_name to pass FALSE
SQL> Rem into underlying dbms_assert.enquote_name function
SQL> Rem
SQL> CREATE OR REPLACE FUNCTION local_enquote_name (str varchar2)
2 return varchar2 is
3 begin
4 return dbms_assert.enquote_name(str, FALSE);
5 end local_enquote_name;
6 /

Function created.

Elapsed: 00:00:00.01
QL> Rem
QL> Rem If sys.enabled$index table exists, then re-enable
QL> Rem list of functional indexes that were enabled prior to upgrade
QL> Rem The table sys.enabled$index table is created in catupstr.sql
QL> Rem
QL> SET serveroutput on
QL> DECLARE
2 TYPE tab_char IS TABLE OF VARCHAR2(32767) INDEX BY BINARY_INTEGER;
3 commands tab_char;
4 p_null CHAR(1);
5 p_schemaname dbms_id;
6 p_indexname dbms_id;
7 rebuild_idx_msg BOOLEAN := FALSE;
8 non_existent_index exception;
9 recycle_bin_objs exception;
10 cannot_change_obj exception;
11 no_such_table exception;
12 pragma exception_init(non_existent_index, -1418);
13 pragma exception_init(recycle_bin_objs, -38301);
14 pragma exception_init(cannot_change_obj, -30552);
15 pragma exception_init(no_such_table, -942);
16 type cursor_t IS REF CURSOR;
17 reg_cursor cursor_t;
18
19 BEGIN
20 -- Check for existence of the table marking disabled functional indices
21
22 SELECT NULL INTO p_null FROM DBA_OBJECTS
23 WHERE owner = 'SYS' and object_name = 'ENABLED$INDEXES' and
24 object_type = 'TABLE' and rownum <=1;
25
26 -- Select indices to be re-enabled
27 EXECUTE IMMEDIATE q'+
28 SELECT 'ALTER INDEX ' ||
29 local_enquote_name(e.schemaname) || '.' ||
30 local_enquote_name(e.indexname) || ' ENABLE'
31 FROM enabled$indexes e, ind$ i
32 WHERE e.objnum = i.obj# AND bitand(i.flags, 1024) != 0 AND
33 bitand(i.property, 16) != 0+'
34 BULK COLLECT INTO commands;
35
36 IF (commands.count() > 0) THEN
37 FOR i IN 1 .. commands.count() LOOP
38 BEGIN
39 EXECUTE IMMEDIATE commands(i);
40 EXCEPTION
41 WHEN NON_EXISTENT_INDEX THEN NULL;
42 WHEN RECYCLE_BIN_OBJS THEN NULL;
43 WHEN CANNOT_CHANGE_OBJ THEN rebuild_idx_msg := TRUE;
44 END;
45 END LOOP;
46 END IF;
47
48 -- Output any indexes in the table that could not be re-enabled
49 -- due to ORA-30552 during ALTER INDEX...ENBLE command
50
51 IF rebuild_idx_msg THEN
52 BEGIN
53 DBMS_OUTPUT.PUT_LINE
54 ('The following indexes could not be re-enabled and may need to be rebuilt:');
55
56 OPEN reg_cursor FOR
57 'SELECT e.schemaname, e.indexname
58 FROM enabled$indexes e, ind$ i
59 WHERE e.objnum = i.obj# AND bitand(i.flags, 1024) != 0';
60
61 LOOP
62 FETCH reg_cursor INTO p_schemaname, p_indexname;
63 EXIT WHEN reg_cursor%NOTFOUND;
64 DBMS_OUTPUT.PUT_LINE
65 ('.... INDEX ' || p_schemaname || '.' || p_indexname);
66 END LOOP;
67 CLOSE reg_cursor;
68
69 EXCEPTION
70 WHEN NO_DATA_FOUND THEN CLOSE reg_cursor;
71 WHEN NO_SUCH_TABLE THEN CLOSE reg_cursor;
72 WHEN OTHERS THEN CLOSE reg_cursor; raise;
73 END;
74
75 END IF;
76
77 EXECUTE IMMEDIATE 'DROP TABLE sys.enabled$indexes';
78
79 EXCEPTION
80 WHEN NO_DATA_FOUND THEN NULL;
81
82 END;
83 /

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.09
SQL>
SQL> DROP function local_enquote_name;

Function dropped.

Elapsed: 00:00:00.01
SQL> SET serveroutput off
SQL>
SQL>
SQL> Rem =========================================================
SQL> Rem Run component validation procedure
SQL> Rem =========================================================
SQL>
SQL> SET serveroutput on
SQL> EXECUTE dbms_registry_sys.validate_components;

PL/SQL procedure successfully completed.

Elapsed: 00:00:04.23
SQL> SET serveroutput off
SQL>
SQL>
SQL> Rem =========================================================
SQL> Rem END utlrp.sql
SQL> Rem =========================================================
SQL> select count(*) from dba_objects where status='INVALID';

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

Set COMPATIBLE parameter :

SQL> show parameter compatible;

NAME       TYPE   VALUE
---------  ----   -----------
compatible  string 11.2.0.0.0

SQL> ALTER SYSTEM SET COMPATIBLE = '18.0.0' SCOPE=SPFILE;

System altered.

Restart the database :

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2365584808 bytes
Fixed Size 8660392 bytes
Variable Size 587202560 bytes
Database Buffers 1761607680 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.
SQL> show parameter compatible;

NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------
compatible                           string      18.0.0

Compile Fixed objects stats :

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed.

Upgrade Time Zone version :

SQL> DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;

DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_prepare(l_tz_version);
END;
/ 2 3 4 5 6 7 8 9
l_tz_version=31
A prepare window has been successfully started.

PL/SQL procedure successfully completed.

Now check the upgrade timezone version,we are going to upgrade DST_SECONDARY_TT_VERSION  is 31

SQL> COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20
SELECT property_name, property_value
FROM database_properties
WHERE property_name LIKE 'DST_%'
ORDER BY property_name;

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ --------------------
DST_PRIMARY_TT_VERSION         14
DST_SECONDARY_TT_VERSION       31
DST_UPGRADE_STATE              PREPARE

Shutdown and startup database in normal mode.

SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP;
ORACLE instance started.

Total System Global Area 2365584808 bytes
Fixed Size 8660392 bytes
Variable Size 587202560 bytes
Database Buffers 1761607680 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.

Upgrade the database zone file.

SQL> SET SERVEROUTPUT ON
DECLARE
l_failures PLS_INTEGER;
BEGIN
DBMS_DST.upgrade_database(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
DBMS_DST.end_upgrade(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/SQL> 
Table list: "IX"."AQ$_ORDERS_QUEUETABLE_S"
Number of failures: 0
Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_S"
Number of failures: 0
Table list: "IX"."AQ$_ORDERS_QUEUETABLE_L"
Number of failures: 0
Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_L"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
DBMS_DST.upgrade_database : l_failures=0
An upgrade window has been successfully ended.
DBMS_DST.end_upgrade : l_failures=0

PL/SQL procedure successfully completed.

dba_tstz_tables view displays the tables that are processed by the time zone file upgrade, and their current upgrade status.

SQL> SELECT owner,table_name,upgrade_in_progress FROM   dba_tstz_tables
ORDER BY 1,2;

Once the upgrade is complete, check the time zone file version.

SQL> SELECT * FROM v$timezone_file;

FILENAME             VERSION    CON_ID
-------------------- ---------- -------
timezlrg_31.dat      31         0

SQL> COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20

SELECT property_name, property_value
FROM database_properties
WHERE property_name LIKE 'DST_%'
ORDER BY property_name; 

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ --------------
DST_PRIMARY_TT_VERSION         31
DST_SECONDARY_TT_VERSION       0
DST_UPGRADE_STATE              NONE

Reference: Steps to Upgrade Time Zone File and Timestamp with Time Zone Data

Post-upgrade checks:

Run “postupgrade_fixups.sql” to check post upgrade status.

SQL> @/u01/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: 18.0.0.0.0 Build: 1
Generated on: 2019-02-08 19:42:17

For Source Database: ORCL18C
Source Database Version: 11.2.0.3.0
For Upgrade to Version: 18.0.0.0.0

Preup                        Preupgrade 
Action                       Issue Is 
Number Preupgrade Check Name Remedied Further DBA Action 
------ --------------------- -------- --------------------------------
10. depend_usr_tables        YES       None.
11. old_time_zones_exist     YES       None.
12. post_dictionary          YES       None.
13. post_fixed_objects       NO        Informational only.
                                       Further action is optional.
14. upg_by_std_upgrd         NO        Informational only.
                                       Further action is optional.

The fixup scripts have been run and resovled 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.

Check Database version and status.

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

NAME      VERSION           OPEN_MODE
--------- ----------------- -----------
ORCL18C   18.0.0.0.0        READ WRITE

Reference : Oracle DB 18c – Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 18c (Doc ID 2418045.1)

Catch Me On:- Hariprasath Rajaram

Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                        FB Group:https://www.facebook.com/groups/894402327369506/              FB Page:https://www.facebook.com/dbahariprasath/?                      Twitter:https://twitter.com/hariprasathdba

Oracle Database Upgrade 11.2.0.4 to 18.3.0.0 Using Manual Method

Description:- 

A manual upgrade consists of running SQL scripts and utilities from a command line to upgrade a database to the new Oracle Database release.

Oracle Database Releases That Support Direct Upgrade
Review the supported options for direct upgrades to the latest Oracle Database release.
You can perform a direct upgrade to the new release from the following releases:
• 11.2.0.3 and 11.2.0.4
• 12.1.0.1 and 12.1.0.2
• 12.2.0.1

Presteps for db upgrade :-

Take RMAN full backups before upgrade.

rman target / 

run {
allocate channel test_backup_disk1 type disk format '/u01/backup/%d_%U';
backup incremental level 0 tag 'ORCL_BEFORE_UPG'  database;
backup format  tag 'ORCL_CONTROL_FILE' current controlfile;
release channel test_backup_disk1;
}

Ensure backup is complete before upgrade.

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

no rows selected

Empty Recycle bin.

SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

Run Gather statistics to finish upgrade soon.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

1. Run the preupgrade tool:

The preupgrade.jar Pre-Upgrade Information Tool is supplied with Oracle Database 18c.
This tool has reside in new oracle home.
/u01/app/oracle/product/18.3/rdbms/admin/preupgrade.jar

SYNTAX:
java -jar /u01/app/oracle/product/18.3/rdbms/admin/preupgrade.jar

After run the above tool we will get below sql files.

-rw-r--r--. 1 root root 416K Dec 10 14:05 preupgrade_package.sql
-rw-r--r--. 1 root root 83K Dec 10 14:05 preupgrade_messages.properties
-rw-r--r--. 1 root root 7.8K Dec 10 14:05 preupgrade_driver.sql
-rw-r--r--. 1 root root 15K Dec 10 14:05 parameters.properties
-rw-r--r--. 1 root root 15K Dec 10 14:05 dbms_registry_extended.sql
-rw-r--r--. 1 root root 49K Dec 10 14:05 components.properties
-rw-r--r--. 1 root root 671K Dec 10 14:19 preupgrade.jar
-rwxrwxr-x. 1 oracle oinstall 95 Feb 5 02:00 initmeta.sql
-rwxr--r--. 1 root root 289K Feb 6 00:16 preupgrade_181_cbuild_6_lf.zip

 

[oracle@ram ~]$ export ORACLE_SID=orcldb
[oracle@ram ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 6 00:20:57 2019

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance from v$thread;

INSTANCE
----------------
orcldb 
[oracle@ram ~]$ java -jar /u01/app/oracle/product/18.3/rdbms/admin/preupgrade.jar TEXT TERMINAL
Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 Build: 6 on 2019-02-06T00:28:41

Upgrade-To version: 18.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
Database Name:     ORCLDB
Container Name:    Not Applicable in Pre-12.1 database
Container ID:      Not Applicable in Pre-12.1 database
Version:           11.2.0.4.0
Compatible:        11.2.0.4.0
Blocksize:         8192
Platform:          Linux x86 64-bit
Timezone File:     14
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 
Oracle Workspace Manager     [to be upgraded]         VALID 
OLAP Analytic Workspace      [to be upgraded]         VALID 
Oracle Enterprise Manager Repository [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 
Expression Filter            [to be upgraded]         VALID 
Rule Manager                 [to be upgraded]         VALID 
Oracle OLAP API              [to be upgraded]         VALID

==============
BEFORE UPGRADE
==============

REQUIRED ACTIONS
================
1. (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

The database contains 5 objects in the recycle bin.

The recycle bin must be completely empty before database upgrade.

RECOMMENDED ACTIONS
===================
2. Update NUMERIC INITIALIZATION PARAMETERS to meet estimated minimums. 
This action may be done now or when starting the database in upgrade mode
using the 18.0.0.0.0 ORACLE HOME.

Parameter     Currently    18.0.0.0.0 minimum
---------     ---------    ------------------
processes       150               300

The database upgrade process requires certain initialization parameters
to meet minimum values. The Oracle upgrade process itself has minimum
values which may be higher and are marked with an asterisk. After
upgrading, those asterisked parameter values may be reset if needed.

3. Remove the EM repository.

- Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target
18.0.0.0.0 ORACLE_HOME into the source 11.2.0.4.0 ORACLE_HOME.

Step 1: If database control is configured, stop EM Database Control,
using the following command

$> emctl stop dbconsole

Step 2: Connect to the database using the SYS account AS SYSDBA

SET ECHO ON;
SET SERVEROUTPUT ON;
@emremove.sql

Without the set echo and serveroutput commands, you will not be able to
follow the progress of the script.

The database has an Enterprise Manager Database Control repository.

Starting with Oracle Database 12c, the local Enterprise Manager Database
Control does not exist anymore. The repository will be removed from your
database during the upgrade. This step can be manually performed before
the upgrade to reduce downtime.

4. Remove OLAP Catalog by running the 11.2.0.4.0 SQL script
$ORACLE_HOME/olap/admin/catnoamd.sql script.

The OLAP Catalog component, AMD, exists in the database.

Starting with Oracle Database 12c, the OLAP Catalog (OLAP AMD) is
desupported and will be automatically marked as OPTION OFF during the
database upgrade if present. Oracle recommends removing OLAP Catalog
(OLAP AMD) before database upgrade. This step can be manually performed
before the upgrade to reduce downtime.

5. Upgrade Oracle Application Express (APEX) manually before the database
upgrade.

The database contains APEX version 3.2.1.00.12. Upgrade APEX to at least
version 5.1.3.00.05.

Starting with Oracle Database Release 18, APEX is not upgraded
automatically as part of the database upgrade. Refer to My Oracle Support
Note 1088970.1 for information about APEX installation and upgrades.

6. Directly grant ADMINISTER DATABASE TRIGGER privilege to the owner of the
trigger or drop and re-create the trigger with a user that was granted
directly with such. You can list those triggers using "SELECT OWNER,
TRIGGER_NAME FROM DBA_TRIGGERS WHERE TRIM(BASE_OBJECT_TYPE)='DATABASE'
AND OWNER NOT IN (SELECT GRANTEE FROM DBA_SYS_PRIVS WHERE
PRIVILEGE='ADMINISTER DATABASE TRIGGER')"

There is one or more database triggers whose owner does not have the
right privilege on the database.

The creation of database triggers must be done by users granted with
ADMINISTER DATABASE TRIGGER privilege. Privilege must have been granted
directly.

7. (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 11.2.0.4
Oracle Database Performance Tuning Guide.

INFORMATION ONLY
================
8. 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      600 MB      710 MB
SYSTEM      740 MB      1180 MB
TEMP        59 MB       150 MB

Minimum tablespace sizes for upgrade are estimates.

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

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql

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

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

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

The database is using time zone file version 14 and the target 18.0.0.0.0
release ships with time zone file version 31.

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 18.0.0.0.0 Oracle Database
Globalization Support Guide.

10. (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.

11. 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 11.2.0.4
Oracle Database Performance Tuning Guide.

INFORMATION ONLY
================
12. Check the Oracle documentation for the identified components for their
specific upgrade procedure.

The database upgrade script will not upgrade the following Oracle
components: OLAP Catalog,OWB

The Oracle database upgrade script upgrades most, but not all Oracle
Database components that may be installed. Some components that are not
upgraded may have their own upgrade scripts, or they may be deprecated or
obsolete.

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

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql


==================
PREUPGRADE SUMMARY
==================
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade.log
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql
/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/postupgrade_fixups.sql

Preupgrade complete: 2019-02-06T00:28:41


Change process parameter and reflect in spfile.

SQL> alter system set processes=300 scope=spfile;

System altered.

SQL> create pfile from spfile;

File created.

Remove OLAP Catalog by running the 11.2.0.4.0 SQL script $ORACLE_HOME/olap/admin/catnoamd.sql script

If you have Apex do the Upgrade Oracle Application Express (APEX) manually before the database upgrade.

SQL> @catnoamd.sql

Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
Synonym dropped.
.............
.............
.............
.............
View dropped.
View dropped.
Type dropped.
Type dropped.
View dropped.
Type dropped.
Type dropped.
Type dropped.
Type dropped.
PL/SQL procedure successfully completed.
Role dropped.
PL/SQL procedure successfully completed.
1 row deleted.

Run the preupgrade_fixup.sql

Shutdown the database:

Take full database backup. we should  turn on the flashback database and create a Guaranteed Restore Point which can be used to rollback if upgrade process fails.

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by: Oracle Preupgrade Script
Version: 18.0.0.0.0 Build: 6
Generated on: 2019-02-06 00:28:36

For Source Database: ORCLDB
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 18.0.0.0.0

Preup                            Preupgrade
Action                           Issue Is
Number   Preupgrade Check Name   Remedied        Further DBA Action
------   ---------------------   --------    --------------------------
1.        purge_recyclebin         YES               None.
2.        parameter_min_val        NO         Manual fixup recommended.
3.        em_present               NO         Manual fixup recommended.
4.        amd_exists               YES               None.
5.        apex_manual_upgrade      NO         Manual fixup recommended.
6.        trgowner_no_admndbtrg    NO         Informational only.
                                            Further action is optional.
7.        pre_fixed_objects        YES                None.
8.        tablespaces_info         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.

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

Copy the parameter and password file from the 11g home to the new 18c home.

[oracle@ram ~]$ . .bash_profile 
[oracle@ram ~]$ cd /u01/app/oracle/product/11.2.0/db_1/dbs/
[oracle@ram dbs]$ ls -lrth
total 24K
-rwxrwxr-x. 1 oracle oinstall 2.8K May 15  2009 init.ora
-rwxrwxr-x. 1 oracle oinstall 1.5K Feb  5 00:51 orapworcldb
-rwxrwxr-x. 1 oracle oinstall   24 Feb  5 00:51 lkORCLDB
-rwxrwxr-x. 1 oracle oinstall 2.5K Feb  6 00:52 spfileorcldb.ora
-rwxrwxr-x. 1 oracle oinstall 1.6K Feb  6 02:02 hc_orcldb.dat
-rwxrwxr-x. 1 oracle oinstall  961 Feb  6 02:05 initorcldb.ora
[oracle@ram dbs]$ cp initorcldb.ora /u01/app/oracle/product/18.3/db_1/dbs/
[oracle@ram dbs]$ cp spfileorcldb.ora /u01/app/oracle/product/18.3/db_1/dbs/
[oracle@ram dbs]$ cd /u01/app/oracle/product/18.3/db_1/dbs/

[oracle@ram dbs]$ export ORACLE_HOME=/u01/app/oracle/product/18.3/db_1/dbs
[oracle@ram dbs]$ echo $ORACLE_HOME
/u01/app/oracle/product/18.3/db_1
[oracle@ram dbs]$ orapwd file=orapwupgr password=oracle format=12
[oracle@ram dbs]$ ls -lrth
total 16K
-rwxrwxr-x. 1 oracle oinstall 3.1K May 14 2015 init.ora
-rw-r--r--. 1 oracle oinstall 961 Feb 6 02:07 initorcldb.ora
-rwxr-xr-x. 1 oracle oinstall 2.5K Feb 6 02:07 spfileorcldb.ora
-rw-r-----. 1 oracle oinstall 1.5K Feb 6 02:16 orapwUPGR
[oracle@ram dbs]$

Set new ORACLE HOME of 18c location:

export ORACLE_HOME=/u01/app/oracle/product/18.3/db_1/

start the database in upgrade mode.

[oracle@ram dbs]$ echo $ORACLE_HOME
/u01/app/oracle/product/18.3/db_1
[oracle@ram dbs]$ echo $PATH
/u01/app/oracle/product/18.3/db_1/bin:/u01/app/oracle/product/18.3/db_1/bin:/usr/sbin:/usr/local/bin:/u01/app/oracle/product/11.2.0/db_1/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin:/home/oracle/bin
[oracle@ram dbs]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Feb 6 03:14:07 2019
Version 18.3.0.0.0

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 3305107504 bytes
Fixed Size 8663088 bytes
Variable Size 1912602624 bytes
Database Buffers 1375731712 bytes
Redo Buffers 8110080 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
Run catctl.pl

catctl.pl is introduce in Oracle Database 12c, Parallel Upgrade Utility replaces the SQL Upgrade Utility catupgrd.sql. With Parallel Upgrade Utility, we can run upgrade scripts and processes in parallel. Using this script will increase our server CPU capacity and reduce the upgrade time.

-n is used for parallelism (new feature on oracle 12c)

$ORACLE_HOME/perl/bin/perl                                $ORACLE_HOME/rdbms/admin/catctl.pl -d $ORACLE_HOME/rdbms/admin -l /home/oracle/ -n 4 catupgrd.sql

/u01/app/oracle/product/18.3/db_1/perl/bin/perl catctl.pl -n 4 -l /home/oracle/UPGR catupgrd.sql

 

[oracle@ram admin]$ /u01/app/oracle/product/18.3/db_1/perl/bin/perl catctl.pl -n 4 -l /home/oracle/UPGR catupgrd.sql

Argument list for [catctl.pl]
Run in c = 0
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = /home/oracle/UPGR
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 4
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
RO User Tablespaces T = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

catctl.pl VERSION: [18.0.0.0.0]
STATUS: [Production]
BUILD: [RDBMS_18.3.0.0.0DBRU_LINUX.X64_180627]


/u01/app/oracle/product/18.3/db_1/rdbms/admin/orahome = [/u01/app/oracle/product/18.3/db_1]
/u01/app/oracle/product/18.3/db_1/bin/orabasehome = [/u01/app/oracle/product/18.3/db_1]
catctlGetOrabase = [/u01/app/oracle/product/18.3/db_1]

Analyzing file /u01/app/oracle/product/18.3/db_1/rdbms/admin/catupgrd.sql

Log file directory = [/home/oracle/UPGR]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/home/oracle/UPGR/catupgrd_catcon_22121.lst]

catcon::set_log_file_base_path: catcon: See [/home/oracle/UPGR/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/home/oracle/UPGR/catupgrd_*.lst] files for spool files, if any


Number of Cpus = 1
Database Name = orcldb
DataBase Version = 18.0.0.0.0
Parallel SQL Process Count = 4
Components in [orcldb]
Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT EM JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV MGW ODM OLS RAC WK]

------------------------------------------------------
Phases [0-108] Start Time:[2019_02_06 03:50:33]
------------------------------------------------------
*********** Executing Change Scripts ***********
Serial Phase #:0 [orcldb] Files:1 Time: 55s
*************** Catalog Core SQL ***************
Serial Phase #:1 [orcldb] Files:5 Time: 26s
Restart Phase #:2 [orcldb] Files:1 Time: 0s
*********** Catalog Tables and Views ***********
Parallel Phase #:3 [orcldb] Files:19 Time: 20s
Restart Phase #:4 [orcldb] Files:1 Time: 0s
************* Catalog Final Scripts ************
Serial Phase #:5 [orcldb] Files:7 Time: 15s
***************** Catproc Start ****************
Serial Phase #:6 [orcldb] Files:1 Time: 12s
***************** Catproc Types ****************
Serial Phase #:7 [orcldb] Files:2 Time: 11s
Restart Phase #:8 [orcldb] Files:1 Time: 0s
**************** Catproc Tables ****************
Parallel Phase #:9 [orcldb] Files:66 Time: 26s
Restart Phase #:10 [orcldb] Files:1 Time: 0s
************* Catproc Package Specs ************
Serial Phase #:11 [orcldb] Files:1 Time: 71s
Restart Phase #:12 [orcldb] Files:1 Time: 1s
************** Catproc Procedures **************
Parallel Phase #:13 [orcldb] Files:94 Time: 15s
Restart Phase #:14 [orcldb] Files:1 Time: 1s
Parallel Phase #:15 [orcldb] Files:117 Time: 26s
Restart Phase #:16 [orcldb] Files:1 Time: 1s
Serial Phase #:17 [orcldb] Files:17 Time: 2s
Restart Phase #:18 [orcldb] Files:1 Time: 0s
***************** Catproc Views ****************
Parallel Phase #:19 [orcldb] Files:32 Time: 24s
Restart Phase #:20 [orcldb] Files:1 Time: 0s
Serial Phase #:21 [orcldb] Files:3 Time: 7s
Restart Phase #:22 [orcldb] Files:1 Time: 0s
Parallel Phase #:23 [orcldb] Files:24 Time: 132s
Restart Phase #:24 [orcldb] Files:1 Time: 0s
Parallel Phase #:25 [orcldb] Files:12 Time: 78s
Restart Phase #:26 [orcldb] Files:1 Time: 1s
Serial Phase #:27 [orcldb] Files:1 Time: 0s
Serial Phase #:28 [orcldb] Files:3 Time: 1s
Serial Phase #:29 [orcldb] Files:1 Time: 0s
Restart Phase #:30 [orcldb] Files:1 Time: 1s
*************** Catproc CDB Views **************
Serial Phase #:31 [orcldb] Files:1 Time: 0s
Restart Phase #:32 [orcldb] Files:1 Time: 0s
Serial Phase #:34 [orcldb] Files:1 Time: 0s
***************** Catproc PLBs *****************
Serial Phase #:35 [orcldb] Files:288 Time: 81s
Serial Phase #:36 [orcldb] Files:1 Time: 0s
Restart Phase #:37 [orcldb] Files:1 Time: 0s
Serial Phase #:38 [orcldb] Files:2 Time: 4s
Restart Phase #:39 [orcldb] Files:1 Time: 0s
*************** Catproc DataPump ***************
Serial Phase #:40 [orcldb] Files:3 Time: 38s
Restart Phase #:41 [orcldb] Files:1 Time: 0s
****************** Catproc SQL *****************
Parallel Phase #:42 [orcldb] Files:13 Time: 82s
Restart Phase #:43 [orcldb] Files:1 Time: 0s
Parallel Phase #:44 [orcldb] Files:11 Time: 8s
Restart Phase #:45 [orcldb] Files:1 Time: 1s
Parallel Phase #:46 [orcldb] Files:3 Time: 0s
Restart Phase #:47 [orcldb] Files:1 Time: 1s
************* Final Catproc scripts ************
Serial Phase #:48 [orcldb] Files:1 Time: 2s
Restart Phase #:49 [orcldb] Files:1 Time: 0s
************** Final RDBMS scripts *************
Serial Phase #:50 [orcldb] Files:1 Time: 10s
************ Upgrade Component Start ***********
Serial Phase #:51 [orcldb] Files:1 Time: 0s
Restart Phase #:52 [orcldb] Files:1 Time: 0s
********** Upgrading Java and non-Java *********
Serial Phase #:53 [orcldb] Files:2 Time: 1s
***************** Upgrading XDB ****************
Restart Phase #:54 [orcldb] Files:1 Time: 0s
Serial Phase #:56 [orcldb] Files:3 Time: 15s
Serial Phase #:57 [orcldb] Files:3 Time: 4s
Parallel Phase #:58 [orcldb] Files:9 Time: 3s
Parallel Phase #:59 [orcldb] Files:25 Time: 5s
Serial Phase #:60 [orcldb] Files:4 Time: 4s
Serial Phase #:61 [orcldb] Files:1 Time: 0s
Serial Phase #:62 [orcldb] Files:31 Time: 2s
Serial Phase #:63 [orcldb] Files:1 Time: 0s
Parallel Phase #:64 [orcldb] Files:6 Time: 3s
Serial Phase #:65 [orcldb] Files:2 Time: 25s
Serial Phase #:66 [orcldb] Files:3 Time: 56s
**************** Upgrading ORDIM ***************
Restart Phase #:67 [orcldb] Files:1 Time: 0s
Serial Phase #:69 [orcldb] Files:1 Time: 2s
Parallel Phase #:70 [orcldb] Files:2 Time: 42s
Serial Phase #:71 [orcldb] Files:1 Time: 41s
Restart Phase #:72 [orcldb] Files:1 Time: 0s
Parallel Phase #:73 [orcldb] Files:2 Time: 8s
Serial Phase #:74 [orcldb] Files:2 Time: 1s
***************** Upgrading SDO ****************
Restart Phase #:75 [orcldb] Files:1 Time: 0s
Serial Phase #:77 [orcldb] Files:1 Time: 27s
Serial Phase #:78 [orcldb] Files:1 Time: 2s
Restart Phase #:79 [orcldb] Files:1 Time: 0s
Serial Phase #:80 [orcldb] Files:1 Time: 14s
Restart Phase #:81 [orcldb] Files:1 Time: 0s
Parallel Phase #:82 [orcldb] Files:3 Time: 56s
Restart Phase #:83 [orcldb] Files:1 Time: 0s
Serial Phase #:84 [orcldb] Files:1 Time: 4s
Restart Phase #:85 [orcldb] Files:1 Time: 0s
Serial Phase #:86 [orcldb] Files:1 Time: 4s
Restart Phase #:87 [orcldb] Files:1 Time: 1s
Parallel Phase #:88 [orcldb] Files:4 Time: 80s
Restart Phase #:89 [orcldb] Files:1 Time: 0s
Serial Phase #:90 [orcldb] Files:1 Time: 1s
Restart Phase #:91 [orcldb] Files:1 Time: 0s
Serial Phase #:92 [orcldb] Files:2 Time: 6s
Restart Phase #:93 [orcldb] Files:1 Time: 0s
Serial Phase #:94 [orcldb] Files:1 Time: 0s
Restart Phase #:95 [orcldb] Files:1 Time: 0s
******* Upgrading ODM, WK, EXF, RUL, XOQ *******
Serial Phase #:96 [orcldb] Files:1 Time: 16s
Restart Phase #:97 [orcldb] Files:1 Time: 1s
*********** Final Component scripts ***********
Serial Phase #:98 [orcldb] Files:1 Time: 1s
************* Final Upgrade scripts ************
Serial Phase #:99 [orcldb] Files:1 Time: 157s
******************* Migration ******************
Serial Phase #:100 [orcldb] Files:1 Time: 41s
*** End PDB Application Upgrade Pre-Shutdown ***
Serial Phase #:101 [orcldb] Files:1 Time: 0s
Serial Phase #:102 [orcldb] Files:1 Time: 0s
Serial Phase #:103 [orcldb] Files:1 Time: 60s
***************** Post Upgrade *****************
Serial Phase #:104 [orcldb] Files:1 Time: 94s
**************** Summary report ****************
Serial Phase #:105 [orcldb] Files:1 Time: 0s
*** End PDB Application Upgrade Post-Shutdown **
Serial Phase #:106 [orcldb] Files:1 Time: 0s
Serial Phase #:107 [orcldb] Files:1 Time: 0s
Serial Phase #:108 [orcldb] Files:1 Time: 34s

------------------------------------------------------
Phases [0-108] End Time:[2019_02_06 04:16:37]
------------------------------------------------------

Grand Total Time: 1565s

LOG FILES: (/home/oracle/UPGR/catupgrd*.log)

Upgrade Summary Report Located in:
/home/oracle/UPGR/upg_summary.log

Grand Total Upgrade Time: [0d:0h:26m:5s]

Execute Post-Upgrade Status Tool, utlu112s.sql

[oracle@test ]$ cd $ORACLE_HOME/rdbms/admin

SQL> @utlu112s.sql

Oracle Database Release 18 Post-Upgrade Status Tool 02-06-2019 23:16:2

Component Current Full Elapsed Time
Name Status Version HH:MM:SS

Oracle Server UPGRADED 18.3.0.0.0 00:11:38
JServer JAVA Virtual Machine VALID 18.3.0.0.0 00:04:25
Oracle XDK UPGRADED 18.3.0.0.0 00:00:59
Oracle Database Java Packages UPGRADED 18.3.0.0.0 00:00:10
OLAP Analytic Workspace UPGRADED 18.3.0.0.0 00:00:14
Oracle Label Security UPGRADED 18.3.0.0.0 00:00:06
Oracle Database Vault UPGRADED 18.3.0.0.0 00:00:16
Oracle Text UPGRADED 18.3.0.0.0 00:00:33
Oracle Workspace Manager UPGRADED 18.3.0.0.0 00:00:31
Oracle Real Application Clusters UPGRADED 18.3.0.0.0 00:00:00
Oracle XML Database UPGRADED 18.3.0.0.0 00:01:13
Oracle Multimedia UPGRADED 18.3.0.0.0 00:01:36
Spatial UPGRADED 18.3.0.0.0 00:02:52
Oracle OLAP API UPGRADED 18.3.0.0.0 00:00:10
Upgrade Datapatch 00:01:10
Final Actions 00:03:46
Post Upgrade 00:00:13
Post Upgrade Datapatch 00:00:15

Total Upgrade Time: 00:29:10

Database time zone version is 18. It is older than current release time
zone version 31. Time zone upgrade is needed using the DBMS_DST package.

Summary Report File = /home/oracle//upg_summary.log
SQL> @catuppst.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/catuppst.sql /main/60 2017/08/03 17:44:03 wesmith Exp $
SQL> Rem
SQL> Rem catuppst.sql
SQL> Rem
SQL> Rem Copyright (c) 2006, 2017, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem        catuppst.sql - CATalog UPgrade PoST-upgrade actions
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem        This post-upgrade script performs remaining upgrade actions that
SQL> Rem        do not require that the database be open in UPGRADE mode.
SQL> Rem        Automatically apply the latest PSU.
SQL> Rem
SQL> Rem    NOTES
SQL> Rem        You must be connected AS SYSDBA to run this script.
SQL> Rem
SQL> Rem    BEGIN SQL_FILE_METADATA
SQL> Rem    SQL_SOURCE_FILE: rdbms/admin/catuppst.sql
SQL> Rem    SQL_SHIPPED_FILE: rdbms/admin/catuppst.sql
SQL> Rem    SQL_PHASE: UPGRADE
SQL> Rem    SQL_STARTUP_MODE: UPGRADE
SQL> Rem    SQL_IGNORABLE_ERRORS: NONE
SQL> Rem    SQL_CALLING_FILE: rdbms/admin/catupgrd.sql
SQL> Rem    END SQL_FILE_METADATA
SQL> Rem

Execute utlrp.sql script to compile  invalid objects.

SQL> @utlrp.sql

Session altered.

TIMESTAMP
-----------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2019-02-06 23:24:56

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.

TIMESTAMP
-----------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2019-02-06 20:31:50

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
0

Function created.

PL/SQL procedure successfully completed.

Function dropped.

PL/SQL procedure successfully completed.


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

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

Set COMPATIBLE parameter :

SQL> show parameter compatible;

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


SQL> ALTER SYSTEM SET COMPATIBLE = '18.0.0' SCOPE=SPFILE;

System altered.

Restart the database :

SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2516580184 bytes
Fixed Size 8660824 bytes
Variable Size 671088640 bytes
Database Buffers 1828716544 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.
SQL> show parameter compatible;

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

Compile Fixed objects stats :

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed.

Upgrade Time Zone version :

Startup database in Upgrade mode.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 2516580184 bytes
Fixed Size 8660824 bytes
Variable Size 671088640 bytes
Database Buffers 1828716544 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.

Start the upgrade window

SQL> SET SERVEROUTPUT ON
DECLARE
l_tz_version PLS_INTEGER;
BEGIN
l_tz_version := DBMS_DST.get_latest_timezone_version;

DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
DBMS_DST.begin_upgrade(l_tz_version);
END;
/
SQL> 
l_tz_version=31
An upgrade window has been successfully started.

PL/SQL procedure successfully completed.

Shutdown the database and startup in normal mode.

SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP;
ORACLE instance started.

Total System Global Area 2516580184 bytes
Fixed Size 8660824 bytes
Variable Size 671088640 bytes
Database Buffers 1828716544 bytes
Redo Buffers 8114176 bytes
Database mounted.
Database opened.

Upgrade Timezone version :

SQL> SET SERVEROUTPUT ON
DECLARE
l_failures PLS_INTEGER;
BEGIN
DBMS_DST.upgrade_database(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
DBMS_DST.end_upgrade(l_failures);
DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/SQL> 2 3 4 5 6 7 8 9
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
Number of failures: 0
Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
Number of failures: 0
Table list: "DVSYS"."SIMULATION_LOG$"
Number of failures: 0
Table list: "DVSYS"."AUDIT_TRAIL$"
Number of failures: 0
Table list: "APEX_040200"."WWV_FLOW_FEEDBACK"
Number of failures: 0
Table list: "APEX_040200"."WWV_FLOW_FEEDBACK_FOLLOWUP"
Number of failures: 0
Table list: "APEX_040200"."WWV_FLOW_DEBUG_MESSAGES"
Number of failures: 0
Table list: "APEX_040200"."WWV_FLOW_DEBUG_MESSAGES2"
Number of failures: 0
Table list: "APEX_040200"."WWV_FLOW_WORKSHEET_NOTIFY"
Number of failures: 0
Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_S"
Number of failures: 0
Table list: "IX"."AQ$_ORDERS_QUEUETABLE_S"
Number of failures: 0
Table list: "IX"."AQ$_STREAMS_QUEUE_TABLE_L"
Number of failures: 0
Table list: "IX"."AQ$_ORDERS_QUEUETABLE_L"
Number of failures: 0
DBMS_DST.upgrade_database : l_failures=0
An upgrade window has been successfully ended.
DBMS_DST.end_upgrade : l_failures=0

PL/SQL procedure successfully completed.

Check time zone file version :

SQL> SELECT * FROM v$timezone_file;

FILENAME             VERSION    CON_ID
-------------------- ---------- -------
timezlrg_14.dat      14         0


SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
        14

If they differ after an upgrade then updating registry$database can be done by

SQL> update registry$database set TZ_VERSION = (select version FROM v$timezone_file);

1 row updated.

SQL> commit;

Commit complete.

SQL> select TZ_VERSION from registry$database;

TZ_VERSION
----------
31

Run “postupgrade_fixups.sql” to check post upgrade status.

SQL>@/u01/app/oracle/cfgtoollogs/orcldb/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: 18.0.0.0.0 Build: 1
Generated on: 2019-02-06 21:36:48

For Source Database: ORCLDB
Source Database Version: 11.2.0.4.0
For Upgrade to Version: 18.0.0.0.0

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

The fixup scripts have been run and resovled 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.

Check Database version and status.

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

NAME      VERSION           OPEN_MODE
--------- ----------------- --------------------
ORCLDB      18.0.0.0.0        READ WRITE

ReferenceOracle DB 18c – Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 18c (Doc ID 2418045.1)

 

Catch Me On:- Hariprasath Rajaram 

Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                      FB Group:https://www.facebook.com/groups/894402327369506/             FB Page: https://www.facebook.com/dbahariprasath/?               Twitter: https://twitter.com/hariprasathdba

 

 

Duplicate a Database Using RMAN in Oracle Database 12c Release 1

Cloning Oracle 12c Database Using Active database Duplication :-

To create a Physical Standby database using RMAN DUPLICATE FROM ACTIVE DATABASE feature which is now available in 11g Release 1 onwards. This enables us to create a physical standby database without having to take a backup of the primary database as a prerequisite step.

Steps for creating database using Active database Duplication :-

  1. Change the archive log mode :

If it is noarchivelog mode, switch  to archivelog mode.

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP MOUNT
SQL> alter database archivelog

Database altered.

SQL> alter database open

Database altered.

SQL> archive log list
Database log mode                  Archive Mode
Automatic archival                 Enabled
Archive destination                +DG01
Oldest online log sequence         299300
Next log sequence to archive       299305
Current log sequence               299305

2. Enable force logging mode:

SQL> select force_logging from v$database;

FORCE_LOGGING
---------------------------------------
NO

SQL> alter database force logging;

Database altered.

SQL> select force_logging from v$database;

FORCE_LOGGING
---------------------------------------
YES

3. Initialization Parameters :

Check the DB_NAME and DB_UNIQUE_NAME parameters. In this case they are both set to “prod” on the primary database.

The DB_NAME of the standby database will be the same as that of the primary, but it must have a different DB_UNIQUE_NAME value.

SQL> show parameter db_name;

NAME     TYPE   VALUE
-------- -----  ------
db_name  string prod

SQL> show parameter db_unique;

NAME           TYPE   VALUE
-------------- -----  ------
db_unique_name string prod
SQL> alter system set log_archive_config='DG_CONFIG=(prod,clone)' SCOPE=both sid='*';

System altered.

SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/prod/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=prod' SCOPE=both sid='*';

System altered.

SQL> alter system set log_archive_dest_2='SERVICE=clone LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=clone' SCOPE=both sid='*';
SQL> alter system set fal_server=prod SCOPE=both sid='*';

System altered.

SQL> alter system set fal_client=clone SCOPE=both sid='*';

System altered.

SQL> alter system set standby_file_management=auto SCOPE=both sid='*';

System altered.

SQL> alter system set REMOTE_LOGIN_PASSWORDFILE=exclusive scope=spfile;

System altered.

4. Listener Configuration in Target database :

[oracle@devserver ]$ export ORACLE_SID=clone
[oracle@devserver ]$ export ORACLE_HOME=/oracle/app/oracle/product/12.1.0/dbhome_1
[oracle@devserver admin]$ cd $ORACLE_HOME/network/admin
[oracle@devserver admin]$ cat listener.ora

# listener.ora Network Configuration File: /oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)

      (SID_NAME = clone )

    )

  )

LISTENER_CLONE =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = devserver.localdomain.com)(PORT = 1521))

    )

  )

ADR_BASE_LISTENER = /u01/app/oracle

5. TNS Service Name Registration in Target database :

CLONE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = devserver.localdomain.com)(PORT = 1521))
)
(CONNECT_DATA =
(SID = CLONE)
)
)

6. Create respective directories in Target Server:

[oracle@devserver admin]$ mkdir /oracle/app/oracle/oradata/clone/ctrl
[oracle@devserver admin]$ mkdir /oracle/app/oracle/oradata/clone/data
[oracle@devserver admin]$ mkdir /oracle/app/oracle/oradata/clone/logs
[oracle@devserver admin]$ mkdir /oracle/app/oracle/oradata/clone/arch
[oracle@devserver admin]$ mkdir /oracle/app/oracle/admin/clone/adump

7. Start listener in Target side:

[oracle@proddr01 admin] $lsnrctl start LISTENER_CLONE

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-JAN-2019 14:05:49

Copyright (c) 1991, 2014, Oracle. All rights reserved.

Starting listener to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=devserver.localdomain.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER_CLONE
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 03-DEC-2018 14:09:08
Uptime 55 days 23 hr. 56 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/devserver/listener_clone/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devserver.localdomain.com)(PORT=1521)))
Services Summary...
Service "clone" has 1 instance(s).
Instance "clone", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

8. Copying password & parameter file to standby server:

  • After copying pfile,only keep the parameter entry in PFILE:

db_name

[oracle@devserver ]$ cd $ORACLE_HOME/dbs
[oracle@devserver dbs]$ scp initprod.ora orapwprod
oracle@devserver:/oracle/app/oracle/product/12.1.0/dbhome_1/dbs oracle@devserver's password: 
initprod.ora  100% 1536     1.5KB/s   00:00
orapwprod     100% 1536     1.5KB/s   00:00                                 
[oracle@proddr01 dbs]$ mv orapwprod orapwclone

[oracle@proddr01 dbs]$ cat initprod.ora
db_name='clone'

9. Check connectivity between primary and standby side :

[oracle@devserver ]$ tnsping prod  [In boths the nodes]

[oracle@devserver ]$ tnsping clone [In boths the nodes]

10. Clone Database Creation :-

Startup in nomount stage :

[oracle@proddr01 ]$ export ORACLE_SID=clone
[oracle@proddr01 ]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Jan 29 01:12:25 2019

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

Connected to an idle instance.

SQL> startup nomount

ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2211928 bytes
Variable Size             159387560 bytes
Database Buffers           50331648 bytes
Redo Buffers                5226496 bytes

11. Connect RMAN to create target  database,

[oracle@proddr01 ]$ rman target sys/****@prod auxiliary sys/****@clone
Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jan 30 20:15:10 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

connected to target database: PROD (DBID=1459429229)
connected to auxiliary database: PROD (not mounted)

RMAN> run
{
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'prod','proddr'
set db_file_name_convert='+DG01/prod/datafile','/oradata1/clone/data' 
set db_unique_name='clone'
set cluster_database='false'
set log_file_name_convert='+DG01/prod/onlinelog','/oradata1/clone/logs' 
set control_files='/oracle/app/oracle/oradata/clone/ctrl/control.ctl'
set fal_client='clone'
set fal_server='prod'
set audit_file_dest='/oracle/app/oracle/admin/proddr/adump'
set log_archive_config='dg_config=(clone,prod)'
set log_archive_dest_1='location=location=/oradata1/prod/arch'
set log_archive_dest_2='service=prod async valid_for=(online_logfiles,primary_role) db_unique_name=prod'
set sga_target='50GB'
set sga_max_size='50GB'
set undo_tablespace='UNDOTBS1'
nofilenamecheck;
}

using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: SID=42 device type=DISK
 
allocated channel: prmy2
channel prmy2: SID=36 device type=DISK
 
allocated channel: prmy3 
channel prmy3 : SID=45 device type=DISK

allocated channel: prmy4 
channel prmy4 : SID=45 device type=DISK
 
allocated channel: stby
channel stby: SID=20 device type=DISK
 
Starting Duplicate Db at 30-JAN-19
.
.
.
.
.
Finished Duplicate Db at 30-JAN-19
released channel: prmy1
released channel: prmy2
released channel: prmy3
released channel: prmy4
released channel: stby
RMAN>

12. Disable Archivelog mode in Target database :

SQL> shut immediate

SQL> startup mount

SQL> alter database noarchivelog

Database altered.
SQL> alter database open

Database altered.

 

Catch Me On:- Hariprasath Rajaram 

Telegram:https://t.me/joinchat/I_f4DkeGfZuxgMIoJSpQZg LinkedIn:https://www.linkedin.com/in/hariprasathdba Facebook:https://www.facebook.com/HariPrasathdba                       FB Group:https://www.facebook.com/groups/894402327369506/              FB Page: https://www.facebook.com/dbahariprasath/?               Twitter: https://twitter.com/hariprasathdba