Skip to content

Posts from the ‘18c’ Category

UTL_FILE_DIR in 18C

How do we do this in 18c as we did not saw this parameter?
Set UTL_FILE_DIR


Desupport of UTL_FILE_DIR Initialization Parameter:

================================

Starting in Oracle Database 18c, the UTL_FILE_DIR parameter is no longer supported. Instead, specify the name of a directory object.

The UTL_FILE_DIR initialization parameter is no longer listed in V$SYSTEM_PARAMETER and related views. If you attempt to set this parameter, then the attempt fails. If you attempt to specify an operating system file directly by using the LOCATION parameter of UTL_FILE.FOPEN, or by using the LOCATION parameter of FOPEN_NCHAR, then those attempts also fail. Specify the name of a directory object instead.

The security model for the use of a directory object for UTL_FILE and other Oracle Database subsystems is secure, because there is a clear privilege model. However, the use of an explicit operating system directory is insecure, because there is no associated privilege model. The notice of deprecation for the UTL_FILE_DIR initialization parameter was given in Oracle Database 12c Release 2 (12.2). With Oracle Database 18c, the parameter is now desupported.

Reference:
https://docs.oracle.com/en/database/oracle/oracle-database/18/upgrd/initialization-parameter-changes-oracle-database-18c.html#GUID-C03F4062-9AB6-4FFE-8CF8-28F8AF014783
 

SOLUTION


Desupport of UTL_FILE_DIR Initialization Parameter

Starting in Oracle Database 18c, the UTL_FILE_DIR parameter is no longer supported. Instead, specify the name of a directory object.

The UTL_FILE_DIR initialization parameter is no longer listed in V$SYSTEM_PARAMETER and related views. If you attempt to set this parameter, then the attempt fails. If you attempt to specify an operating system file directly by using the LOCATION parameter of UTL_FILE.FOPEN, or by using the LOCATION parameter of FOPEN_NCHAR, then those attempts also fail. Specify the name of a directory object instead.

The security model for the use of a directory object for UTL_FILE and other Oracle Database subsystems is secure, because there is a clear privilege model. However, the use of an explicit operating system directory is insecure, because there is no associated privilege model. The notice of deprecation for the UTL_FILE_DIR initialization parameter was given in Oracle Database 12c Release 2 (12.2). With Oracle Database 18c, the parameter is now desupported.

Reference:
https://docs.oracle.com/en/database/oracle/oracle-database/18/upgrd/initialization-parameter-changes-oracle-database-18c.html#GUID-C03F4062-9AB6-4FFE-8CF8-28F8AF014783
 

RMAN Cross-Platform Transport of PDB into Destination CDB

Example

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

Database names: SRC122, DEST122
Pluggable database name: PDB1
New container database name: DEST_DB

********



Using RMAN, Pluggable database (PDBs) can be transported and plugged in to a destination multitenant container database (CDB) which is on a different platform than the source CDB. In addition to backup of the PDB, RMAN also copies the metadata required to plug the PDB into the destination CDB. The source CDB and the destination CDB must use the same endian format.

Below steps show migration of closed PDB from source platform Solaris (Big Endian) to AIX (Big Endian)

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

Source:NAME      OPEN_MODE     PLATFORM_NAME
——— ————- ————————
SRC122    READ WRITE    Solaris[tm] OE (64-bit)

Destination:

NAME      OPEN_MODE    PLATFORM_NAME
——— ———— —————————
DEST122   READ WRITE   AIX-Based Systems (64-bit) 

SOLUTION

1. Close the source pdb:SQL> alter pluggable database PDB1 close immediate;

2. Backup the source PDB:RMAN> backup for transport
2> unplug into ‘/<path>/backup/PDB1_Metadata.xml’
3> format ‘/<path>/backup/PDB1_BKP_%U’
4> pluggable database PDB1;

3. SCP the backup-piece and PDB metadata files to destination

4. Check on destination whether the PDB can be plugged in using dbms_pdb.check_plug_compatibilityset serveroutput on
declare
c boolean;
begin
c:=dbms_pdb.check_plug_compatibility(‘/<path>/backup/PDB1_Metadata.xml’,’PDB1′);
if (c) then dbms_output.put_line(‘True’);
else dbms_output.put_line(‘False’);
end if;
end;
/

5. Restore the PDB on destination:RMAN> restore using ‘/<path>/backup/PDB1_Metadata.xml’
2> foreign pluggable database PDB1
3> format ‘/<path>/oradata/DEST_DB/%U’
4> from backupset ‘/<path>/backup/PDB1_BKP_02s9sj0u_1_1’;

6. Open the pluggable database PDB1 on destination:SQL> alter pluggable database PDB1 open;NOTE: This document covers PDB cross platform migration strategy using consistent backups i.e. the PDB is closed prior to backup. To reduce downtime, migration can also be achieved using inconsistent backups where, PDB level 0 backup is taken using clauses FOR TRANSPORT and ALLOW INCONSISTENT while the PDB is open in READ WRITE mode. Thereafter, PDB can be closed and a level 1 backup can be performed using FROM SCN clause and UNPLUG INTO (new in 12.2) clause to perform a final level 1 and also get the PDB metadata.

Add Single or Non RAC Database in SRVCTL or Cluster

srvctl add database -d singledbc -o /opt/oracle/ora12201 -dbtype single -node node1server.com
srvctl add service -d singledbc -pdb singledb -s singledbsvc
srvctl start service -d singledbc -s singledbsvc

srvctl stop database -d singledb -o immediate;
srvctl start database -d singledb

alter system set remote_listener=’scanlistener:1521′;

18c : Datapatch New Features And Changes from 12.1

PURPOSE

The purpose of this article is to help DBA’s / Support Teams to understand the new features of Datapatch

SCOPE

DBA/Support

DETAILS

 Overview:

  In 12.1  we have two different types of patches – Bundle patch /PSU patches and interim patches (non bundles) :

  The versioning scheme up until 12.2.0.1 splits the patch metadata into 2 places :

  1. The XML patch descriptor found under $ORACLE_HOME/sqlpatch/bug id/bug uid/bug id.xml  
  2. bundledata_<series>.xml found under $ORACLE_HOME/rdbms/admin.

datapatch uses the metadata from both locations to determine if a given SQL file should be run for a particular install

They have three important pieces of metadata as described below :

 Metadata Location in Patch Metadata Location in dba_registry_sqlpatch
Bundle Series (i.e. DBBP or DBPSU) bundleSeries  attribute of XML descriptor bundle_series column
Bundle ID (i.e. 170116 or 170416) bundleID  attribute of XML descriptor bundle_id column
Bundles in which a given file has been included bundle and file attributes of bundledata_<series>.xml NA

 

 

 

 

 

 

Bundle patches are marked with ‘B’ in the flags column of dba_registry_sqlpatch.

Change in 18c :

With the new model, there are still 2 main types of patches – release updates/release update revision and interim patches.

Patch Type  Description Update version in v$instance
Interim Patch One-off or MLR on top of a particular release No
Release Update(RU) Cumulative containing security and other fixes Yes,second digit(i.e 18.2.0.0.0)
Release Update Revision(RUR) Cumulative containing security and regressions on top of an RU or prior RUR Yes,third digit (i.e. 18.2.1.0.0)

 

 

 

 

To migrate to a new release update or revision, we will use the patching process (opatch for binary changes, datapatch for SQL changes).

This implies that, like our current bundle patches, a release update or revision must be RAC rolling, and can therefore be installed with zero down time.

The bundle series/bundle ID metadata which we have currently in 12.1.0.2 and 12.2.0.1 will not work for this new model. Hence we will have instead the following new metadata:

From the file : $ORACLE_HOME/sqlpatch/28090523/22329768/28090523.xml

Metadata Location in Patch Metadata Location in dba_registry_sqlpatch
Build timestamp buildTimestamp  attribute of XML  descriptor build_timestamp
Build description buildDescription  attribute  of  XML  descriptor Encoded in target_version
Patch type patchType  attribute of XML descriptor patch_type column
RUs and RURs in which a given file has been included ruData  element of XML descriptor N/A

 

 

 

 

 

 

 

The source_* and target_* columns of dba_registry_sqlpatch will encode the full version information .

bundledata.xml is no longer needed as the XML descriptor includes all the patch specific and RU metadata

 

Complete Version Description:

In order to completely describe a given release update, all 3 components of the version are needed:

  • 5 digit version string (i.e. 18.3.2.0.0). Although this string includes 5 digits, currently only the first 3 will be updated with this model.
  • Patch type (i.e. RU)
  • Release_Update_Revision

Collectively these 3 pieces of metadata are known as a version description.

The oraversion executable can be used to determine the current version description of the binaries in a given oracle home:

$ORACLE_HOME/bin/oraversion -baseVersion
18.0.0.0.0$ORACLE_HOME/bin/oraversion -buildDescription
Release_Update

$ORACLE_HOME/bin/oraversion -h
This program prints release version information.

These are its possible arguments:

-compositeVersion: Print the full version number: a.b.c.d.e.
-baseVersion: Print the base version number: a.0.0.0.0.
-majorVersion: Print the major version number: a.
-buildStamp: Print the date/time associated with the build.
-buildDescription: Print a description of the build.
-help: Print this message.

 

Binary patching can be accomplished with opatch inplace operations, or out of place patching between two homes/containers at different releases. SQL patching may require more than one operation to complete, depending on the binary and SQL versions when datapatch is invoked, as described below.

Scenario SQL Version Binary Version Datapatch Operations
1 18.1.0.0.0 18.3.0.0.0 RU Apply from binary to SQL using 18.3.0.0.0 RU apply script
2 18.2.2.0.0 RUR 18.3.0.0.0 RU Rollback from SQL to common version 18.2.0.0.0 RU using 18.2.2.0.0 RUR rollback script
Apply from common version 18.2.0.0.0 RU to binary using 18.3.0.0.0 RU apply script
3 18.3.2.0.0 RUR 18.2.1.0.0 RU Rollback from SQL to common version 18.2.0.0.0 RU using 18.3.2.0.0 RUR rollback script
Apply from common version 18.3.2.0.0 RUR to 18.2.1.0.0 RU using 18.2.1.0.0 RU apply script

 

 

 

 

 

 

The recommended action for customers is to stay on the RU branch unless they only want security and regression fixes.

SQL Registry Changes :

The structure of registry$sqlpatch and dba_registry_sqlpatch in 18c is as follows. Columns in bold are new in 18c.

Column Type Description
action VARCHAR2(15) APPLY, ROLLBACK
status VARCHAR2(25) BEGIN, END, SUCCESS, WITH ERRORS, WITH ERRORS (RETRYABLE)
target_build_description VARCHAR2(80) Build description after the patch is installed
source_build_description VARCHAR2(80) Build description on which the patch will be installed
target_build_timestamp TIMESTAMP Build timestamp after the patch is installed
source_build_timestamp TIMESTAMP Build timestamp on which the patch will be installed
target_version VARCHAR2(15) Five digit version after the patch is installed
source_version VARCHAR2(15) Five digit version on which the patch will be installed
logfile VARCHAR2(500) Full path to logfile
ru_logfile VARCHAR2(500) Full path to logfile for RU specific operations
patch_type VARCHAR2(10) INTERIM, RU, RUR
flags VARCHAR2(10) One or more of the following characters. Either N or U will always be present.N: Normal mode

U: Upgrade mode

J: Patch updates Java (and hence should be run first)

A: Application patch

R: Patch installation attempt retried

M: Patch installation was done at the same time as another installation

description VARCHAR2(100) Patch description (typically the same as the bug subject)
patch_id NUMBER Patch ID (typically the same as the bug ID)
patch_uid NUMBER Patch UID (universal patch identifier)
action_time TIMESTAMP Time of installation attempt
install_id NUMBER Unique ID per datapatch invocation
patch_descriptor XMLType XML descriptor for this patch
patch_directory BLOB Zipped contents of patch directory

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note the following about this table structure:

  • The bundle_series, bundle_id, and bundle_descriptor columns (present in 12.2) have been removed.
  • As in 12.2 and earlier, each row in the SQL registry represents one install attempt for one patch.
  • As in 12.2 and earlier, each PDB will have its own SQL registry.
  • The source_* and target_* columns, along with the patch_type column, encode the complete version information for the environment on which the patch is installed, as well as the environment after patch is (successfully) installed.
  • The build description may be empty. Since interim patches do not change the version information, source_* and target_* will both have the same value, namely the version on which the patch is applied

We introduce a second SQL registry table registry$sqlpatch_ru_info, with associated view dba_registry_sqlpatch_ru_info, with the following structure:

Column Type Description
ru_build_description VARCHAR2(80) Build description for this RU patch
ru_build_timestamp TIMESTAMP Build timestamp for this RU patch
ru_version VARCHAR2(15) Five digit version for this RU patch
patch_id NUMBER Patch ID (typically the same as the bug ID)
patch_uid NUMBER Patch UID (universal patch identifier)
patch_descriptor XMLType XML descriptor for this patch
patch_directory BLOB Zipped contents of patch directory

 

 

 

 

 

 

 

 

Each row in dba_registry_sqlpatch_ru_info will contain the metadata associated with an RU patch.

Following files used by Datapatch :

File or Directory Description
sqlpatch/sqlpatch Shell wrapper script for datapatch
sqlpatch/sqlpatch.bat Windows wrapper script for datapatch
sqlpatch/sqlpatch.pl Entry datapatch Perl script
sqlpatch/sqlpatch.pm Main datapatch Perl script
sqlpatch/sqlpatch_bootstrap.sql Datapatch bootstrap script
sqlpatch/lib Directory with datapatch Perl libraries
rdbms/admin/dbmssqlpatch.sql dbms_sqlpatch package header
rdbms/admin/prvtsqlpatch.plb dbms_sqlpatch package body
rdbms/admin/dbmsqopi.sql dbms_qopatch package header
rdbms/admin/prvtqopi.plb dbms_qopatch package body
rdbms/admin/catconst.pm Perl version constants
rdbms/admin/dbms_registry_basic.sql dbms_registry constants
rdbms/admin/preupgrade.jar pre upgrade utility

 

 

 

 

 

 

 

 

 

 

 

 

Simpler call to patch_initialize:

Currently the call to patch_initialize in the apply or rollback script looks as follows:

BEGIN
dbms_sqlpatch.patch_initialize(p_patch_id => patch ID,
p_patch_uid => patch UID,
p_flags => ‘&flags’,
p_description => ‘&description’,
p_action => ‘APPLY’,
p_logfile => ‘&full_logfile’,
p_bundle_series => ‘&bundle_series’);
END;
/

The flags, description, action, and bundle series parameters are no longer needed, so the call starting in 18.1 should look as follows:

BEGIN
dbms_sqlpatch.patch_initialize(p_patch_id => patch ID,
p_patch_uid => patch UID,
p_logfile => ‘&full_logfile’);
END;
/

 

Procedure Changes :

The following table summarizes the changes to each of the main routines within datapatch.

Routine Changes
initialize Removal of obsolete command line arguments such as -bundle_series
bootstrap No change
get_current_patches XML descriptor is required, read and store new metadata into the patch descriptors
add_to_queue Support new queue definition and perform logic to determine starting and ending RU version
install_patches Support new queue definition and new install script format
validate_logfiles No change

 

 

 

 

 

 

 

 

 

Addional Logfile :

sqlpatch_debug.log  === > Starting from 18c this logfile will be created for each invocation of datapatch .

Location : $ORACLE_BASE/cfgtoollogs/sqlpatch_pid_<timestamp>

Oracle 18c – DBUA In Silent Mode

GOAL

How to Run DBUA in Silent mode ?

SOLUTION

You can use DBUA with the -silent command line option to carry out noninteractive (“silent”) upgrades.

In silent mode, DBUA does not present a user interface. DBUA writes messages (including information, errors, and warnings) to a log file in ORACLE_HOME/cfgtools/dbua/upgradesession_timestamp, where session_timestamp represents the timestamp for the upgrade that DBUA has run.

 

All the features of the Interactive DBUA are available in non-interactive as well ,some of those

  • It is the recommended method for performing Database upgrade at Release and patch level.
  • DBUA performs major release upgrade of oracle database that are supported for direct upgrade.
  • It performs all the upgrade tasks automatically.
  • DBUA performs preupgrade check and lists the unsatisfied prerequisites.
  • DBUA has option to upgrade timezone information, make user tablespaces to read only, take RMAN backup before upgrade starts.
  • DBUA also provides opportunity to restore database backup to rollback DB upgrade.
  • It can upgrade existing Listener to 18c or create new listener in 18c during upgrade.
  • DBUA shows progress of Upgrade activity in an enhanced manner.

 

DBUA captures all the activities in logs located at

If Oracle Base is set then the log files will be generated under $ORACLE_BASE/cfgtoollogs/dbua/upgradesession_<timestamp>/<SID>/

If Oracle Base is not set then the log files will be generated under $ORACLE_HOME/cfgtoollogs/dbua/upgradesession_<timestamp>/<SID>/

If Oracle Home is Read Only then the log files will be generated under $ORACLE_BASE/cfgtoollogs/dbua/upgradesession_<timestamp>/<SID>/

Note:
-l flag can be used for custom log directory.

 

Supported Oracle Versions for 18c Upgrade

 

  • DBUA can upgrade only supported versions of direct upgrade.

    Direct Upgrade to 18.x:

    Source Database Target Database
    11.2.0.3 and Higher 18.x
    12.1.0.x (12.1.0.1 – 12.1.0.2) 18.x
    12.2.0.1 18.x

     

    Indirect Upgrade to 18.x:

     
    Source Database Intermediate upgrade path Target database
    11.2.0.1/11.2.0.2 –> 11.2.0.3/11.2.0.4 –> 18.x
    11.1.0.6/11.1.0.7 –> 11.2.0.3/11.2.0.4 –> 18.x
    10.2.0.2, 10.2.0.3, 10.2.0.4, 10.2.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.x
    10.1.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.x
    9.2.0.8 or earlier –> 11.2.0.3/11.2.0.4 –> 18.x

DBUA Silent Mode

Execution steps:

When you run DBUA by using the command-line option, you can specify all valid DBUA options in a script form. The script form enables you to avoid entering configuration information in a graphic user interface dialog.

dbua -silent [<command> [options]]

-silent

-sid | -dbName

-sid

-dbName

Following are the possible options:

[-asmsnmpPassword ]

[-backupLocation ]

[-changeUserTablespacesReadOnly – <true | false> ]

[-createGRP – <true | false> ]

[-createListener – <true | false> ]

[-dbName  ]

[-oracleHome ]

[-sysDBAUserName ]

[-sysDBAPassword ]

[-dbsnmpPassword ]

[-disableUpgradeScriptLogging – <true | false> ]

[-emConfiguration – <DBEXPRESS | CENTRAL | BOTH | NONE>]

[-dbsnmpPassword ]

[-emPassword ]

[-emUser ]

[-emExpressPort ]

[-omsHost ]

[-omsPort ]

[-asmsnmpPassword ]

[-ignorePreReqs – <true | false> ]

[-ignoreScriptErrors – <true | false> ]

[-initParam ]

[-initParamsEscapeChar ]

[-excludeInitParams ]

[-keepDeprecatedParams – <true | false> ]

[-localListenerWithoutAlias ]

[-listeners ]

[-localRacSid ]

[-logDir ]

[-newGlobalDbName ]

[-newSid ]

[-oracleHomeUserPassword ]

[-pdbs ]

-sid | -dbName

-sid

[-oracleHome ]

[-sysDBAUserName ]

[-sysDBAPassword ]

-dbName

[-oracleHome ]

[-sysDBAUserName ]

[-sysDBAPassword ]

[-pdbsWithPriority ]

-sid | -dbName

-sid

[-oracleHome ]

[-sysDBAUserName ]

[-sysDBAPassword ]

-dbName

[-oracleHome ]

[-sysDBAUserName ]

[-sysDBAPassword ]

[-performFixUp – <true | false> ]

[-postUpgradeScripts ]

[-preUpgradeScripts ]

[-recompile_invalid_objects – <true | false> ]

[-upgrade_parallelism ]

[-upgradeTimezone – <true | false> ]

[-upgradeXML ]

[-useExistingBackup – <true | false> ]

[-useGRP ]

Below is the description of options / flags :

[-asmsnmpPassword – <Specify ASMSNMP user password>]
[-backupLocation – <Specify directory to back-up your database before starting the upgrade>]
[-changeUserTablespacesReadOnly – <true | false> Change user tablespaces read only for the duration of the upgrade.]
[-createGRP – <true | false> To create a guaranteed restore point when database is in archive log and flashback mode.]
[-createListener – <true | false> To create a listener in newer release Oracle home specify listenrName:lsnrPort.]
[-dbName – <Specify Database Name>]
[-oracleHome – <Specify the Oracle home path of the database>]
[-sysDBAUserName – <User name with SYSDBA privileges>]
[-sysDBAPassword – <Password for sysDBAUserName user name>]
[-dbsnmpPassword – <Specify DBSNMP user password>]
[-disableUpgradeScriptLogging – <true | false> This command disables the detailed log generation for running SQL scripts during the upgrade process. By default this is enabled. To enable the log generation, don’t specify this command.]
[-emConfiguration – <DBEXPRESS | CENTRAL | BOTH | NONE>]
[-dbsnmpPassword – <Specify DBSNMP user password>]
[-emPassword – <Specify EM admin user password>]
[-emUser – <Specify EM admin username to add or modify targets>]
[-emExpressPort – <Specify the port where EM Express will be configured>]
[-omsHost – <Specify EM management server host name>]
[-omsPort – <Specify EM management server port number>]
[-asmsnmpPassword – <Specify ASMSNMP user password>]
[-ignorePreReqs – <true | false> Ignore error conditions in pre-upgrade checks.]
[-ignoreScriptErrors – <true | false> Specify this flag for ignoring ORA errors during custom scripts.]
[-initParam – <Specify a comma separated list of initialization parameter values of the format name=value,name=value>]
[-initParamsEscapeChar – <Specify escape character for comma when a specific initParam has multiple values. If the escape character is not specified backslash is the default escape character>]
[-excludeInitParams – <Specify a comma separated list of initialization parameters to be excluded.>]
[-keepDeprecatedParams – <true | false> To retain deprecated parameters during database upgrade.]
[-localListenerWithoutAlias – To set LOCAL_LISTENER without TNS Alias.]
[-listeners – <To register the database with existing listeners, specify listeners by comma separated listenerName:Oracle Home. Listeners from lower release home are migrated to newer release home. Specifying -listeners lsnrName1,lsnrName2 or -listeners lsnrName1:<Oracle home path>,-listeners lsnrName2:<Oracle home path>, DBUA searches specified listeners from GI home (if configured), target home and source home>]
[-localRacSid – <Specify the local System Identifier of the cluster database if the cluster database is not registered in OCR>]
[-logDir – <Specify the path to a custom log directory>]
[-newGlobalDbName – <Specify New Global Database Name. This option can only be used for Oracle Express Edition upgrade>]
[-newSid – <Specify New System Identifier. This option can only be used for Oracle Express Edition upgrades>]
[-oracleHomeUserPassword – <Specify Oracle Home user password>]
[-pdbs – <Specify a comma separated list with the names of the pluggable databases (PDB) that will be upgraded. Specify ALL to select all or NONE to select none of the pluggable databases for upgrade>]
-sid | -dbName
-sid – <Specify System Identifier>
[-oracleHome – <Specify the Oracle home path of the database>]
[-sysDBAUserName – <User name with SYSDBA privileges>]
[-sysDBAPassword – <Password for sysDBAUserName user name>]
-dbName – <Specify Database Name>
[-oracleHome – <Specify the Oracle home path of the database>]
[-sysDBAUserName – <User name with SYSDBA privileges>]
[-sysDBAPassword – <Password for sysDBAUserName user name>]
[-pdbsWithPriority – <Specify a comma separated list of pluggable databases (PDB) to be upgraded along with its corresponding priorities (being 1 the top priority) of the format <pdb name>:<upgrade priority>,<pdb name>:<upgrade priority> >]
-sid | -dbName
-sid – <Specify System Identifier>
[-oracleHome – <Specify the Oracle home path of the database>]
[-sysDBAUserName – <User name with SYSDBA privileges>]
[-sysDBAPassword – <Password for sysDBAUserName user name>]
-dbName – <Specify Database Name>
[-oracleHome – <Specify the Oracle home path of the database>]
[-sysDBAUserName – <User name with SYSDBA privileges>]
[-sysDBAPassword – <Password for sysDBAUserName user name>]
[-performFixUp – <true | false> Enable or disable fix ups for the silent upgrade mode.]
[-postUpgradeScripts – <Specify a comma separated list of SQL scripts with their complete pathnames. These scripts will be executed at the end of the upgrade>]
[-preUpgradeScripts – <Specify a comma separated list of SQL scripts with their complete pathnames. These scripts will be executed before the upgrade>]
[-recompile_invalid_objects – <true | false> Recompile invalid objects as part of the upgrade.]
[-upgrade_parallelism – <Specify number of CPU’s to be used for parallel upgrade>]
[-upgradeTimezone – <true | false> Upgrade the timezone files of the database.]
[-upgradeXML – <Specify the path to the existing pre-upgrade XML file> This option only applies to in-place database upgrades.]
[-useExistingBackup – <true | false> To restore database using existing RMAN backup.]
[-useGRP – <Specify the name of the existing guaranteed restore point> To restore the database using a specified guaranteed restore point.]

Example

The following command selects the database orcl for upgrade using the noninteractive (“silent”) option:

dbua -silent -sid orcl

 

Few more Cases for Running DBUA in Noninteractive (”Silent”) Mode

dbua -silent -sid sidb112 -backupLocation /u01/sidb1123/backup -sysDBAUserName sys -sysDBAPassword <password> -oracleHome /u01/app/product/11.2.0/dbhome_1 -upgradeTimezone true

dbua -silent -sid sidb1123 -backupLocation /u01/sidb1123/backup -sysDBAUserName sys -sysDBAPassword <password> -oracleHome /u01/app/product/11.2.0/dbhome_1 -upgrade_parallelism 1 -upgradeTimezone true

dbua -silent -sid db1124 -backupLocation /u01/sidb1123/backup -sysDBAUserName sys -sysDBAPassword <password> -performFixUp true -upgradeTimezone true

dbua -silent -dbName rdbcdb -oracleHome /u01/app/product/11.2.0/dbhome_1 -sysDBAUserName sys -sysDBAPassword <password> -backupLocation /u01/sidb1123/backup -recompile_invalid_objects true -upgradeTimezone true

dbua -silent -dbName amdb -oracleHome /u01/app/product/11.2.0/dbhome_1 -sysDBAUserName sys -sysDBAPassword <password> -recompile_invalid_objects true -useGRP GRP_20170620bfupgrade -upgradeTimezone true

dbua -silent -dbName rdb121 -oracleHome /u01/app/product/12.1.0/dbhome_2 -sysDBAUserName sys -sysDBAPassword <password> -backupLocation /u01/sidb1123/backup -recompile_invalid_objects true -upgradeTimezone true

dbua -silent -dbName ronedb -oracleHome /u01/app/product/12.1.0/dbhome_2 -sysDBAUserName sys -sysDBAPassword <password> -changeUserTablespacesReadOnly true -recompile_invalid_objects true -upgradeTimezone true -createGRP true

Oracle 18c – Complete Checklist for upgrading Oracle 12.x Container Database (CDB) to Oracle Database 18c (18.x) using DBUA

PURPOSE

The purpose of this article is to help DBA’s / Support Teams to perform the upgrade of a database using DBUA to 18.x.

SCOPE

DBA, Support

DETAILS

Database Upgrade Assistant (DBUA)

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

DBUA works for CDB and non-CDB database systems. It is the recommended method for performing a major release upgrade or patchset release upgrade.

You can use DBUA to upgrade multitenant architecture container databases (CDB), pluggable databases (PDBs), and non-CDB databases.
The procedures are the same, but the choices you must make and the behavior of DBUA are different, depending on the type of upgrade.

DBUA automates the upgrade process by performing all of the tasks.

DBUA provides support for Oracle Real Application Clusters (Oracle RAC) databases. In an Oracle RAC environment,
DBUA upgrades all the database and configuration files on all nodes in the cluster.

DBUA, graphical user interface must be invoked within the new Oracle home where the Oracle Database 18c software has been installed.
For windows, Only an Administrator or Installed owner should invoke DBUA for Windows systems.

DBUA runs the Pre-Upgrade Information Tool as part of the prerequisite checks it performs before starting the upgrade.
However, to reduce downtime, Oracle recommends that you run the Pre-Upgrade Information Tool as part of your upgrade planning, so that you can analyze the database,
and take proactive steps before your planned upgrade date.
Once, you address / fix the pre-upgrade recommendation / warnings /errors and continue with the upgrade, DBUA shows the progress of the upgrade for each component of source database.

As with previous releases of DBUA, 18c DBUA restricts the carry over of hidden parameters since Oracle recommends not to have hidden parameters other than those suggested
via support during the upgrade.
To view existing hidden parameters execute the following command while connected AS SYSDBA:

SELECT name,description from SYS.V$PARAMETER WHERE name LIKE ‘\_%’ ESCAPE ‘\’;

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. The default timezone vetrsion in 18.x is 26.

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

About Read-Only Oracle Homes

Starting with Oracle Database 18c, you can configure an Oracle home in read-only mode.
In a read-only Oracle home, all the configuration data and log files reside outside of the read-only Oracle home. This feature allows you to use the read-only Oracle home as a software image that can be distributed across multiple servers.

Upgrade Path / Compatibility Matrix for 18.x Oracle Database

DBUA can upgrade only supported versions of direct upgrade.

Direct Upgrade to 18.x:

Source Database Target Database
12.1.0.x (12.1.0.1 – 12.1.0.2) 18.x
12.2.0.1 18.x

 

Requirements and Recommendation for source database

 

– Ensure that all database components/objects provided by Oracle are VALID in the source database prior to starting the upgrade.

– Before you start an upgrade or downgrade process, Oracle strongly recommends that you update both your earlier release and your new release (18.x) Oracle Database to the latest Oracle bundle patch or patch set update (BP or PSU).

– Ensure that you do not have duplicate objects in the SYS and SYSTEM schema. For 1 and 2 refer to:
Doc Id 556610.1 – Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)
– dbupgdiag.sql script is a set of sql statements intended to provide a user friendly output to diagnose the status of the database either before (or) after upgrade. The script will create a output file called db_upg_diag_<sid>_<timestamp>.log

– IF APEX is installed then it is recommended to upgrade APEX in the source DB first before upgrading DB

– Timezone should less than or equal to target database timezone version.

– Make sure to have a valid backup of source database prior to upgrade.

– Disable any custom triggers that would get executed before / after DDL statements. Re-enable after the upgrade.

– Check the database server upgrade/downgrade compatibility matrix before upgrading the database.

– Set Archive Log ON during upgrade. Oracle recommends that you set Archive Log ON in order for DBUA to create and update the log file for the upgrade process.

– For Oracle RAC, if you upgrade a cluster database using DBUA, then you must leave the CLUSTER_DATABASE initialization parameter set to TRUE.

– Ensure to run the pre-upgrade utility prior to upgrading the database.

– Examine and follow the recommendation given in the preupgrade log file.

– Materialized views in source database should be stopped before upgrade

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

– Disable scheduled database custom jobs / cron jobs.

– Make sure you have COMPATIBLE parameter is set to 12.1.0 or greater

 

 

Requirements and Recommendations for Target database

– Verify whether your operating system / platform is certified for 18.x release.

– Download and Install Oracle 18c (18.x) in a new Oracle_Home and make sure there are no binary relinking errors.

– Download and Install the latest available RU or RUR from My Oracle Support (MOS).

– Make sure to set the ORACLE_HOME, PATH, LD_LIBRARY_PATH, LIBPATH etc. to 18.x target home.

– Review patch recommendations as given in the article “Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)”

– Apply patch 29213893 on target ORACLE_HOME to avoid ORA-01422 error – refer: Database Upgrade to 12.2, 18c, 19c fails with ORA-01422, ORA-06512 for SYS.DBMS_STATS (Doc ID 2525596.1)

 

Prerequisites for Preparing Oracle Home on Windows

 

Your system must meet these requirements before you can upgrade Oracle Database on Microsoft Windows platforms. For security reasons, different Microsoft Windows user accounts configured as Oracle
home users for different Oracle homes are not allowed to share the same Oracle Base.

– Database upgrade is supported when the same Windows user account is used as the Oracle home user in both the source and destination Oracle homes.

– Database upgrade is supported when the Oracle home from which the database is being upgraded uses the Windows Built-in Account. Releases earlier than Oracle Database 12c (release 11.2 and earlier) only supported the built-in account option for the Oracle home user on Windows.

– The Oracle home user may not have access to files outside its own Oracle Base and Oracle home. If that is the case, then if you choose a different Oracle Base during upgrade, it is possible that Oracle Database services cannot access files in the older Oracle Base. Using DBUA for database upgrade ensures that the Oracle home user has access to files outside of its own Oracle Base and its own Oracle home.

 

 

 

Pre Upgrade

 

$Earlier_release_Oracle_home/jdk/bin/java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar [FILE|TERMINAL] [TEXT|XML] [DIR output_dir]

 
FILE|TERMINAL – Use this option to direct script output to a file. Use TERMINAL to direct output to the terminal. If it is not specified then defaultr is FILE.
TEXT – Use this option to specify log should be in Text format. Use TEXT to specify text output. Use XML to specify XML output. If you do not specify an output type, then the default is text.
DIR – Logs will be created under <output_dir>. Directs the output to a specific directory. If you do not specify an output directory with the DIR option, then the output is directed to one of the default locations: If you define ORACLE_BASE environment variable then the generated scripts and log files will be created under $ORACLE_BASE/cfgtoollogs/<dbname>/preupgrade/ location else it will create under $ORACLE_HOME/cfgtoollogs/db_name/preupgrade/.

 

For example,

source Oracle Home : /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1

target Oracle Home : /refresh/home/oracle/ora_base/product/18.1

$ export ORACLE_SID=orcl
$ export ORACLE_BASE=/refresh/home/oracle/ora_base
$ export ORACLE_HOME=/refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1

$ $ORACLE_HOME/jdk/bin/java -jar /refresh/home/oracle/ora_base/product/18.1/rdbms/admin/preupgrade.jar FILE TEXT

==================
PREUPGRADE SUMMARY
==================
/refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade.log
/refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups.sql
/refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/postupgrade_fixups.sql

Execute fixup scripts across the entire CDB:

Before upgrade:

1. Execute preupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/ -b preup_ORCL /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups.sql

2. Review logs under /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/

After the upgrade:

1. Execute postupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/ -b postup_ORCL /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/postupgrade_fixups.sql

2. Review logs under /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/

You may find the below scripts :

$ ls -l /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/
-rw-r–r– 1 oracle oinstall 8237 Jul 10 05:37 postupgrade_fixups_CDB_ROOT.sql
-rw-r–r– 1 oracle oinstall 8221 Jul 10 05:38 postupgrade_fixups_PDB1.sql
-rw-r–r– 1 oracle oinstall 8221 Jul 10 05:38 postupgrade_fixups_PDB2.sql
-rw-r–r– 1 oracle oinstall 8221 Jul 10 05:38 postupgrade_fixups_PDB3.sql
-rw-r–r– 1 oracle oinstall 8237 Jul 10 05:37 postupgrade_fixups_PDB_SEED.sql
-rw-r–r– 1 oracle oinstall 28440 Jul 10 05:39 postupgrade_fixups.sql
-rw-r–r– 1 oracle oinstall 8778 Jul 10 05:37 preupgrade_fixups_CDB_ROOT.sql
-rw-r–r– 1 oracle oinstall 8693 Jul 10 05:38 preupgrade_fixups_PDB1.sql
-rw-r–r– 1 oracle oinstall 8693 Jul 10 05:38 preupgrade_fixups_PDB2.sql
-rw-r–r– 1 oracle oinstall 8693 Jul 10 05:38 preupgrade_fixups_PDB3.sql
-rw-r–r– 1 oracle oinstall 8709 Jul 10 05:37 preupgrade_fixups_PDB_SEED.sql
-rw-r–r– 1 oracle oinstall 36645 Jul 10 05:39 preupgrade_fixups.sql

 

 

Examine the preupgrade.log file and follow the recommendation. Execute the preupgrade_fixups_<pdb_name>.sql against all or respective pluggable database

 

cd $ORACLE_HOME/rdbms/admin/
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b /tmp/preupgrade_fixups /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups.sql

or

$ORACLE_HOME/perl/bin/perl catcon.pl -n 2 -e -b /tmp/preupgrade_fixups /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups.sql

 

 

Above command will run the preupgrade_fixups.sql against all the pluggable databases.

To run the preupgrade_fixups.sql against individual pluggable database, below command can be used:

cd $ORACLE_HOME/rdbms/admin/

$ORACLE_HOME/perl/bin/perl catcon.pl -c ‘CDB$ROOT’ -n 1 -e -b /tmp/preupgrade_fixups /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups_CDB_ROOT.sql

or

$ORACLE_HOME/perl/bin/perl catcon.pl -c ‘PDB1’ -n 1 -e -b /tmp/preupgrade_fixups /refresh/home/oracle/ora_base/product/12.1.0.2/dbhome_1/cfgtoollogs/ORCL/preupgrade/preupgrade_fixups_CDB_PDB1.sql

 

 

 

 

The latest preupgrade utility for 18.x can be found from :

How to Download and Run Oracle’s Database Pre-Upgrade Utility (Doc ID 884522.1)

 

 

Check for Invalid Objects / Components

 

set pagesize500
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name;

select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type from dba_objects where status=’INVALID’ order by owner,object_type;

select owner,object_type,count(*) from dba_objects where status=’INVALID’ group by owner,object_type order by owner,object_type ;

 

If you find invalid objects and/or database components then try to VALIDATE the invalid objects and/or database components by executing the following steps:

Run utlrp.sql to validate the invalid objects in the database. You can execute the utlrp.sql scripts multiple times to validate the invalid objects.

From 12.1 home,execute the utlrp.sql against the container and all the pluggable databases.

cd $ORACLE_HOME/rdbms/admin/
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d ”’.”’ utlrp.sql

$ sqlplus “/ as sysdba”
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

using -b utlrp, the log file utlrp0.log is generated as the script is run. The log file provides results of the recompile.

Gathering Optimizer Statistics to Decrease Oracle Database Downtime

 

Oracle strongly recommends that you use this procedure to gather statistics before performing Oracle Database upgrades.Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS   procedure to gather these statistics. For example, enter the following SQL statement:

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp -b gatherstats — –x”exec dbms_stats.gather_dictionary_stats”

Above command gather dictionary statistics for all PDBs in a container database.

you can use the below command to gather statistics against a particular PDB.

For PDB1 pluggable database :

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp -c ‘PDB1’ -b pdb1_gatherstats — –x”exec dbms_stats.gather_dictionary_stats”

For CDB$ROOT container:

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp -c ‘CDB$ROOT’ -b root_gatherstats — –x”exec dbms_stats.gather_dictionary_stats”

 

Verifying Materialized View Refreshes are Complete Before Upgrade

Use this procedure to query the system to determine if there are any materialized view refreshes still in progress. Before upgrading Oracle Database, you must wait until all materialized views have
completed refreshing.

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp -b mview_refresh — –x”SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8″

 It will verify against all the pluggable databases or below query can be used:

SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;

 

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

 

Check of TIMESTAMP WITH TIMEZONE Datatype

The time zone files that are supplied with Oracle Database 12c release 2 (18.x) is version 26.

Case 1 Timezone version of source database is lower or equal 26.

If the source database is using a timezone file lower than version 26 then there is no DST patch to apply in source oracle home or target 12cR2 home.

Case 2 Timezone version of source database is higher than 26.

If the source database uses a Timezone version higher than 26 then BEFORE the upgrade you MUST patch the target 12cR2 $ORACLE_HOME with a timezone data file of the SAME version as the one used in the source release database.

 

Ensuring That No Files Are in Backup Mode and no files need media recovery Before Upgrading

 

Execute below query to check for the status of the backup:

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

Ensure that no files require media recovery:

SQL> SELECT * FROM v$recover_file;

 

Purging Recycle Bin before upgrade

Below command can be used to purge from all the pdbs:

 $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -l /tmp -b purge_recyclebin — –x”PURGE DBA_RECYCLEBIN”

or

SQL> PURGE DBA_RECYCLEBIN;

we can purge the recycle bin via DBUA.

 

Databases That Use Oracle Label Security and Oracle Database Vault

Audit Table Preupgrade and Archive Requirements

For Oracle Database releases earlier than 12.1 using Oracle Label Security and Oracle Database Vault, you must run the OLS preprocess script before you upgrade.

If you are upgrading from a database earlier than Oracle Database release 12.1 that uses Oracle Label Security (OLS) and Oracle Database Vault, then you must first run the OLS preprocess script, olspreupgrade.sql, to process the aud$ table contents. The OLS upgrade moves the aud$ table from the SYSTEM schema to the SYS schema. The olspreupgrade.sql script is a preprocessing script required for this move.

Running the olspreupgrade.sql script before upgrading is mandatory for upgrading databases earlier than Oracle Database release 12.1 that use Oracle Label Security and Oracle Database Vault. Once you have upgraded to Oracle Database release 12.1, you do not have to perform the OLS preprocessing procedure going forward to patch or upgrade the database.

Granting the DV_PATCH_ADMIN Role to SYS for Oracle Database Vault
If Oracle Database Vault is enabled, then to perform checks for Oracle Data Vault, the upgrade process requires running three SQL scripts – olspreupgrade.sql, emremove.sql, catnoamd.sql

Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.

Run the following statement:

    SQL> GRANT DV_PATCH_ADMIN to SYS;

 

Copying Transparent Encryption Oracle Wallets

If you use Oracle wallet with Transparent Data Encryption (TDE), and you use Database Upgrade Assistant (DBUA) to upgrade the database, then copy the sqlnet.ora and wallet file to the new 18.x Oracle home.

You must copy the sqlnet.ora and the wallet file manually before starting the upgrade.
1. Log in as an authorized user.
2. Manually copy the sqlnet.ora file, and the wallet file, ewallet.p12, to the new release Oracle home.
3. Open the Oracle wallet in mount.

For example:
SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM SET ENCRYPTION WALLET OPEN;

 

Check the accounts use Case-Insensitive password version

Log in to SQL*Plus as an administrative user, and enter the following SQL query
SELECT USERNAME,PASSWORD_VERSIONS FROM DBA_USERS;

If there are any 10g versions, suggest you to refer Oracle documentation to fix 10g versions, failing to do so, user accounts with LOCKED after upgrade is completed.

 

About Password Case Sensitivity

Ensure that you do not have the deprecated parameter SEC_CASE_SENSITIVE_LOGON set to FALSE.

 

Invoke DBUA

 

Invoke DBUA

DBUA ( Step 1 of 10 )

Select the database to be upgrade , as there is only 1 database in example , it is auto selected — ORCL

DBUA_STEP_1

DBUA ( Step 2 of 10 )

We can prioritize the upgrade of the pluggable database. in the given screen, the ORCL container database is having three pdbs : pdb1, pdb2, pdb3. The priority of pdb1 is set to 1 whereas for pdb2,pdb3 it is 2. Based on this selection DBUA will upgrade pdb1 first followed by pdb2, pdb3.

 

DBUA Step 2

DBUA ( Step 3 of 10 )

Once the selection is done, DBUA will perform the pre-upgrade steps. It will execute the preupgrade scripts against all the pdbs and show errors / warnings. Choose “Show All Container” for the reported errors. If the errors are fixable than click on “Fix & Check Again”. If there are any errors which can not be fixed by DBUA then manually fix and verify that there are no errors in the prerequisite checks page.

DBUA_STEP_3a  DBUA_STEP_3b

DBUA ( Step 4 of 10 )

Once the preupgrade warnings / errors has been addressed, In step 4, we can choose options like Enable Parallel upgrade, Recompile Invalid Objects in post-upgrade, Timezone upgrade for all the pdbs (The timezone version on 18.x is 26), Gather statistics for all the pdbs.

DBUA_STEP_4

DBUA ( Step 5 of 10 )

In the given screen, there are recovery options available. you can choose to Create a Guaranteed Restore Point or RMAN backup in case of failure of upgrade.

DBUA_STEP_5

DBUA ( Step 6 of 10 )

We can configure new listener or upgrade the existing “LISTENER_ORCL” listener which is running from 12.1.0.2 home to Target 18.x home.

 

DBUA_STEP_6

 

 

DBUA ( Step 7 of 10 )

This screen is to configure EM express or register the upgraded database with EM Cloud control.

DBUA_STEP_7

 

DBUA ( Step 8 of 10 )

 

DBUA will show the summary of what actions it will perform

DBUA_STEP_8a DBUA_STEP_8b

 

DBUA ( Step 9 of 10 )

The DBUA will start the upgrade process of ORCL database. Once the upgrade starts, DBUA will first perform the upgrade of CDB$ROOT container. it will perform the pre-upgrade steps and then it will start upgrading Oracle Server,XML component followed by other components except Oracle APEX ( which is not upgraded as a part of Database Upgrade , you need to do it separately )

DBUA_STEP_9a

 

 

Once the upgrade completed for CDB$ROOT, database will be restarted and DBUA will perform the post upgrade steps like running catuppst.sql, configuring listener for 18.x home, recompile invalid objects and upgrading timezone,configuring EM Express.

 

DBUA_STEP_9b

 

 

Once the CDB$ROOT gets upgraded successfully, DBUA will use the priority list where the PDB1 will be upgraded first. The PDB1 priority is set to 1.So based on the priority, DBUA will consider priority list “P1” for pluggable database PDB$SEED and PDB1 to be upgraded first. In below screen, DBUA will parallely perform the upgrade for PDB$SEED and PDB1. It will perform the upgrade of components viz Oracle Server, XDB, Workspace Manager component for both PDB$SEED, PDB1 pdbs.

Note that the CDB$ROOT and PDB$SEED has highest priority.

DBUA_STEP_9g

 

 

DBUA_STEP_9c DBUA_STEP_9d

 

After completing the upgrade of PDB$SEED and PDB1, DBUA will start the post upgrade process for “P1” priority list for PDB$SEED and PDB1 pdbs. DBUA will bounce back both the pdbs PDB$SEED and PDB1 for post upgrade steps.

 

DBUA_STEP_9e DBUA_STEP_9f

 

 

Once the upgrade of P1 list gets completed, DBUA will start the upgrade of P2 priority list which contains PDB2 and PDB3. In the below screen we can see that the PDB2 and PDB3 pdbs are getting upgraded parallely.Followed by the post upgrade steps for both the PDB’s respectively.

 

DBUA_STEP_9h DBUA_STEP_9i

 

DBUA ( Step 10 of 10 )

The final screen will show the result of the container database upgraded to 18.x. It will show the list of pluggable databases upgraded. It will show the detailed summary for the time taken by DBUA to complete the upgrade of individual PDBs

DBUA_STEP_10a DBUA_STEP_10b

 

It will show the timezone upgrade details for CDB$ROOT and all the pluggable databases.

DBUA_STEP_10c DBUA_STEP_10d

 

 

Post Upgrade

Execute dbupgdiag.sql script against the CDB$ROOT container and all the pluggable databases PDB1, PDB2, PDB3 to verify the status of objects and components . If there are invalid objects then run utlrp.sql to recompile the invalid objects as follows:

cd $ORACLE_HOME/rdbms/admin/

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d ”’.”’ utlrp.sql                  ===> To run the utlrp.sql against all the PDBs.

or

$ORACLE_HOME/perl/bin/perl catcon.pl -l /tmp -n 2 -e -b utlrp -c ‘PDB1’ utlrp.sql         ===> To recompile invalid objects for PDB1 pluggable database.

 

sql> connect / as sysdba

sql> @?/rdbms/admin/utlrp.sql

Oracle 18c – Complete checklist for Manual Upgrade for Multitenant Architecture Oracle Databases from 12.1.x.x to 18.x.x.x

PURPOSE

This document is created for use as a guideline and checklist when upgrading 12cR1, 12cR2 multitenant database to higher version 18.x.x.x

SCOPE

Database Administrators, Support

DETAILS

Introduction

Multitenant architecture database can either be upgraded in parallel, or in sequence.

Starting with Oracle Database 12c release 1 (12.1), Oracle provides multitenant architecture, which enables the creation and administration of pluggable databases (PDBs) in a container database (CDB). You can upgrade multitenant architecture systems using either Oracle Database Upgrade Assistant (DBUA), or using the Parallel Upgrade Utility to carry out manual upgrades.

There are two techniques for upgrading Oracle Databases using the multitenant architecture:

  • In parallel. With this technique, you carry out one upgrade operation that upgrades the CDB, and then upgrades the PDBs in parallel.
  • Sequentially. With this technique, you install a new release CDB, prepare and unplug PDBs from the earlier release CDB, plug the PDBs into a later release CDB, and then complete the upgrade for each PDB.

Upgrading Oracle Multitenant In Parallel

With the In Parallel technique, you first upgrade CDB$ROOT using the Parallel Upgrade Utility (catctl.pl), using parameters to set the degree of parallel processing and availability:

The -n parameter defines how many parallel processes run the upgrade, up to 8.

The -M parameter determines if the CDB$ROOT stays in UPGRADE mode through the entire upgrade, or becomes available for access after the CDB upgrade is complete. If you do not run the upgrade with the -M parameter, then when the CDB$ROOT upgrade is complete, PDBs then become available for access as soon as each PDB completes its upgrade. If you run the upgrade with the -M parameter, then CDB$ROOT stays in UPGRADE mode, and PDBs do not become available until upgrade of all PDBs is complete.

Upgrading Oracle Multitenant In Sequence

With the In Sequence technique, you install the new release multitenant architecture CDB. Next, in the earlier release multitenant architecture CDB, you issue SQL commands to run preupgrade scripts to prepare one or more PDBs to upgrade, and shut them down. You then unplug PDBs, plug them into the new release multenant architecture CDB, and complete the upgrade sequentially for each PDB.

Manually Upgrading a Multitenant Container Oracle Database (CDB)

Step 1: Recommendations for source CDB / PDB database
  • Make sure there are no INVALID objects/components in the source database.  Verify the database health by executing dbupgdiag.sql (refer Note 556610.1 to download this script).
    • If there are any INVALID objects are found execute $ORACLE_HOME/rdbms/admin/utlrp.sql multiple times to validate them

$ cd $ORACLE_HOME/rdbms/admin

$ sqlplus “/ as sysdba”

SQL> alter session set container=<PDB_Name>

SQL> @utlrp.sql

  • Take a cold or hot backup of the source database
  • Disable any custom triggers that would get executed before / after DDL. You can enable it once upgrade is completed.

Check the status of PDB. It should be in open with Read write mode

These commands will also make sure the Multitenant Option is enabled.

Example:

 

SQL> select name, open_mode,cdb,i.con_id, version from V$database,v$instance i;

NAME OPEN_MODE CDB CON_ID VERSION
——— ——————– — ———- —————–
DB18C READ WRITE YES 0 18.0.0.0.0

SQL> select CON_ID, NAME, OPEN_MODE from V$PDBS;

CON_ID NAME OPEN_MODE

———- —————————— ———-

2 PDB$SEED READ ONLY

3 PDB1 READ WRITE

  • Execute Preupgrade scripts before upgrade and review the preupgrade log for any issues.
  • Check the status of all materialized views (MV), and refresh any materialized views that are not fresh.
  • Before upgrading Oracle Database, you must wait until all materialized views have completed refreshing.

Step2: Requirements and recommendations for target ORACLE_HOME
  • Verify the whether your operating system is certified for 18.1. Click here to launch certification portal
  • Install 18.1.0.0, verify there are no installation related issues.
  • Download and install latest RU / RUR if any
  • Copy spfile or pfile from source ORACLE_HOME (under $ORACLE_HOME/dbs) to target homeReview patch recommendations as given in the article “Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)”
    • Remove any _ (underscore) parameter, obsolete and deprecated parameters in pfile
    • Note min value of COMPATIBLE parameter to upgrade 18.1 is “11.2.0”, make sure you have COMPATIBLE parameter is set to 11.2.0 or greater
  • Review patch recommendations as given in the article “Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)”
  • Apply patch 29213893 on target ORACLE_HOME to avoid ORA-01422 error – refer: Database Upgrade to 12.2, 18c, 19c fails with ORA-01422, ORA-06512 for SYS.DBMS_STATS (Doc ID 2525596.1)

Step 3: Pre-Upgrade Steps

1. Open all PDBs

SQL> alter pluggable database all open;

2. Run the Pre-Upgrade Information Tool (preupgrade.jar), using the following syntax:

java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar [TERMINAL|FILE|DIR outputdir] [TEXT|XML] [-c InclusionListOfPDBs] [-C ExclusionListOfPDBs]

Use space-delimitation for lists. On Linux and UNIX, define the list by placing the list inside single quotes: ‘. On Windows systems, define the list by placing the list inside double quotes “.

Linux and UNIX:

java -jar $ORACLE_HOME_18.1/rdbms/admin/preupgrade.jar -c ‘pdb1 pdb2 pdb3 pdb4 pdb5 pdb6 pdb7 pdb8 pdb9 pdb10 pdb11 pdb12 pdb13 pdb14 pdb15 pdb16 pdb17 pdb18 pdb19 pdb20 pdb21 pdb22 pdb23 pdb24 pdb25’

Windows:

java -jar %ORACLE_HOME_18.1%/rdbms/admin/preupgrade.jar -c “pdb1 pdb2 pdb3 pdb4 pdb5 pdb6 pdb7 pdb8 pdb9 pdb10 pdb11 pdb12 pdb13 pdb14 pdb15 pdb16 pdb17 pdb18 pdb19 pdb20 pdb21 pdb22 pdb23 pdb24 pdb25”

Note: You must use Java 1.5 or later to run the Pre-Upgrade Information too.
If no parameters are passed to the preupgrade.jar , it is run against all the container databases ( CDB and PDB’s ).

3. Review any generated fixup scripts and log files.

If ORACLE_BASE is defined, then the fixup files are placed in

Linux and UNIX:

$ORACLE_BASE/cfgtoollogs/db_unique_name/preupgrade

Windows:

%ORACLE_BASE%\cfgtoollogs\db_unique_name\preupgrade

If ORACLE_BASE is not defined, then fixup files are placed in one of the following paths:

Linux and UNIX:

$ORACLE_HOME/cfgtoollogs/db_unique_name/preupgrade

Windows:

%ORACLE_HOME\cfgtoollogs\db_unique_name\preupgrade

4. Execute the preupgrade_fixups script, or individual PDB scripts.\

Note: fixup script for PDB$SEED is preupgrade_fixups_pdb_seed.sql

5. For Oracle RAC database set CLUSTER_DATABASE to false

ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;

6. Shut down the database in the old Oracle home.

For example, where db_unique_name is your database name:

$ srvctl stop database -d db_unique_name

7. Copy the PFILE or SPFILE from the old Oracle home to the new Oracle home

Step 4: Upgrade Steps

8. Connect with SQL*Plus:

sqlplus / as sysdba

Note: Make sure that you have set ORACLE_HOME, PATH which points to target version

9. Bring the CDB$ROOT instance into upgrade mode:

STARTUP UPGRADE

10. Bring all PDBs into upgrade mode:

ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE;

11. Check the status of PDBs to confirm that they are ready to upgrade:

SHOW PDBS

For all PDBs, ensure that the status is set to MIGRATE.
12. Exit from SQL*Plus, and change directory to the new Oracle home $ORACLE_HOME/rdbms/admin:

SQL> EXIT
$ ORACLE_HOME/bin

13. Start the upgrade using the Parallel Upgrade Utility (catctl.pl, using the shell command dbupgrade), where -d specifies the location of the directory:

dbupgrade -d $ORACLE_HOME/rdbms/admin

If you do not specify any parameters, then the Parallel Upgrade Utility runs the upgrade in parallel on the number of PDBs equivalent to the number of CPUs divided by 2. On a server with 64 CPUs, 64 divided by 2 equals 32 PDBs upgraded in parallel, carried out with two SQL processors for each PDB. CDB$ROOT remains in NORMAL mode for the duration of the upgrade.

14. Review the upg_summary.log to confirm that the upgrade was successful, and if necessary, review other logs.

Step 5: Post-Upgrade Steps

15. Open all PDBs, so that you can recompile the databases:

ALTER PLUGGABLE DATABASE ALL OPEN;

16. Exit from SQL*Plus, and change directory to the new Oracle home path $ORACLE_HOME/rdbms/admin:

SQL> EXIT
cd $ORACLE_HOME/rdbms/admin

17. Run the catcon.pl script and the postupgrade_fixups.sql script that is supplied with the new release Oracle Database.

The following example shows the command strings for running catcon.pl, using the -n parameter to specify one parallel processor for each PDB, using the -d parameter to specify the path where the preupgrade script that you want to run is located, using the -l parameter to specify the location where you want the scripts to place log files, and using the -b flag to specify the log file prefixes for the postupgrade_fixups.sql script:

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -d $ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade -l /home/oracle/upgrdDBA -b postupgrade_fixups postupgrade_fixups.sql

18. Run postupgrade_fixups.sql.

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b postupgradefixups -d ”’.”’ postupgradefixups.sql

19. Run utlu122s.sql to verify that there are no upgrade issues.

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlu122s -d ”’.”’ utlu122s.sql

log file utlu122s0.log is generated.

20. For Oracle RAC environments set the initialization parameter value for CLUSTER_DATABASE to TRUE, and to start the Oracle RAC database

ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE;
srvctl start database -db db_unique_name

Upgrading PDBs Using the Parallel Upgrade Utility with Priority Lists

Oracle Database 12.2 and later releases, you can upgrade PDBs using a priority list to upgrade a set of PDBs ahead of other PDBs, and we can modify that upgrade priority.  This list enables to group and upgrade PDBs based on the priority.  A priority list is a text file with comma-delimited lists defining the order of upgrade priority, and the PDBs in each numeric priority group. We can execute the Parallel Upgrade Utility (dbupgrade, dbupgrade.cmd, or catctl.pl) using the -L option to run the upgrade using a priority list, and to call that list as the upgrade runs.

Format for creating priority list

Number, Pdb
numeral,pdb1,pdb2,pdb3
numeral,pdb4
numeral,pdb5,pdb6,pdb7,pdb8
.
.
.

Note:

  • Create priority lists using a plain text editor, such as vi on Linux and UNIX, or Notepad on Windows.
  • Here numeral represents the priority for the PDB.
When you run the Parallel Upgrade Utility, the following processing rules apply:

CDB$ROOT and PDB$SEED are always processed first, even if they are not present in the priority list.
All PDBs that are in priority lists are processed in order of priority
Any PDBs that are not listed in priority lists are processed after the PDBs named in the priority list.

Syntax to run the Parallel Upgrade utility using a priority list:

dbupgrade -L priority_list_name

After upgrade is complete PDB priority states are maintained in the CDB.  If we upgrade the database to next release, it uses the same priority.  To change this we have to execute

SQL> alter session set container = CDB$ROOT
SQL> alter pluggable database PDBName upgrade priorityPDBPriorityNumber

PDB Upgrades Using Priority Lists, Inclusion Lists, and Exclusion Lists

The following terms designate types of upgrade list processing:

    Priority lists: Comma-delimited lists that designate the upgrade priority of PDBs in the list.
Inclusion lists: Comma-delimited lists that designate PDBs that you want to upgrade. PDBs in these lists are upgraded after the PDBs listed in priority lists.
Exclusion lists: Comma-delimited lists that designate PDBs that you do not want to be upgraded.

 

Example of Inclusion List

With following priority list

1,CDB$ROOT
1,PDB$SEED
1,CDB1_PDB2,CDB1_PDB4
2.CDB1_PDB5

catctl -L priority.lst -c ‘CDB1_PDB2 CDB1_PDB4 CDB1_PDB5’ catupgrd.sql

The upgrade order is carried out in the following sequence:

CDB1_PDB2, CDB1_PDB4
CDB1_PDB5

The Parallel Upgrade Utility processes only the PDBs that are in the inclusion list, and in the order of the priority list.

Example of Exclusion List

With following priority list

1,CDB$ROOT
1,PDB$SEED
1,CDB1_PDB1,CDB1_PDB2
2,CDB1_PDB3,CDB1_PDB4
3,CDB1_PDB5

catctl -L priority.lst -C ‘CDB$ROOT’ catupgrd.sql

Because CDB$ROOT is excluded, the priority processing shifts. The upgrade order is carried out in the following sequence:

PDB$SEED, CDB_PDB1
CDB_PDB2, CDB_PDB3
CDB1_PDB4, CDB1_PDB5

Exclusion List using CATCTL_LISTONLY

With following priority list

1,CDB$ROOT
1,PDB$SEED
1,CDB1_PDB1,CDB1_PDB2
2,CDB1_PDB3
3,CDB1_PDB5

catctl -L priority.lst -C ‘CATCTL_LISTONLY’ catupgrd.sql

With the CATCTL_LISTONLY option, PDBs that are not in the priority list are excluded from the upgrade.  Specifying the keyword CATCTL_LISTONLY in the exclusion list turns the priority list into an inclusion priority list. Only PDBs in the list are processed.

Upgrading Pluggable Databases (PDBs) In Parallel

Using the In-Parallel technique, you can upgrade the CDB, and then immediately upgrade PDBs using parallel SQL processors.

Container databases (CDBs) can contain zero, one, or more pluggable databases (PDBs). By default, the Parallel Upgrade Utility (catctl.pl) updates the CDB and all of its PDBs in the same upgrade window. The Parallel Upgrade Utility uses the number of computer processing units (CPUs) to determine the maximum number of PDBs that are upgraded simultaneously. The number of PDBs that are upgraded in parallel is determined by dividing the parallel SQL process count (-n option) by the parallel PDB SQL process count (-N option).

dbupgrade [-M] -n [-N]

-M Specifies if CDB$ROOT is kept in upgrade mode, or if it becomes available when it completes upgrade:

If you run the Parallel Upgrade Utility with the -M parameter, then the upgrade places CDB$ROOT and all of its PDBs in upgrade mode, which can reduce total upgrade time. However, you cannot bring up any of the PDBs until the CDB and all of its PDBs are upgraded.

If you do not run the Parallel Upgrade Utility with the -M parameter, then CDB$ROOT is upgraded and restarted in normal mode, and the normal background processes are started. After a successful upgrade, only CDB$ROOT is opened in read/write mode. All the PDBs remain in MOUNT mode. As each PDB is upgraded, you can bring each PDB online while other PDBs are still being upgraded.

-n Specifies the number of in-parallel PDB upgrade processors.

If you do not specify a value for -n, then the default for -n is the CPU_COUNT value.

If you do specify a value for -n, then that value is used to determine the number of parallel SQL processes. The maximum value is unlimited. The minimum value is 4.

-N Specifies the number of SQL processors to use when upgrading PDBs. The maximum value is 8. The minimum value is 1. If you do not specify a value for -N, then the default value is 2.

The maximum PDB upgrades running concurrently is the value of -n divided by the value of -N.

Steps to upgrade PDBs in parallel

1. Take necessary backup
2. Execute pre-upgrade tool, fix up any issues found, make sure there are no INVALID objects/components
3. un the Parallel Upgrade Utility. In sequence, the following upgrades are carried out:

a. Cycle 1: CDB$ROOT is upgraded to the new Oracle release
b. Cycle 2 to Cycle x: PDB$SEED and PDBs are upgraded in parallel, with the number of cycles of upgrades as determined by the parameter settings you specify with -n.
4. Complete post-upgrade steps.

Upgrading Multitenant Container Databases In Parallel

Use this technique to upgrade CDB$ROOT, PDB$SEED, and all PDBS in the CDB in one upgrade operation.
Oracle recommends that you use this approach if you can schedule downtime, because it provides a direct procedure for upgrades and simplicity of maintenance. Using this procedure upgrades in parallel all the PDBs in the multitenant architecture container database, depending on your server’s available processors (CPUs).

1. Ensure that you have a proper backup strategy in place.
2. Open all PDBs.
For example:

SQL> alter pluggable database all open;

3. Run the Pre-Upgrade Information Tool (preupgrade.jar), using the following syntax:

java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar [TERMINAL|FILE|DIR outputdir] [TEXT|XML] [-c InclusionListOfPDBs] [-C ExclusionListOfPDBs]

Linux and UNIX:

java -jar $ORACLE_HOME_18.1/rdbms/admin/preupgrade.jar -c ‘pdb1 pdb2 pdb3 pdb4 pdb5 pdb6 pdb7 pdb8 pdb9 pdb10 pdb11 pdb12 pdb13 pdb14 pdb15 pdb16 pdb17 pdb18 pdb19 pdb20 pdb21 pdb22 pdb23 pdb24 pdb25’

Windows:

java -jar %ORACLE_HOME_18.1%/rdbms/admin/preupgrade.jar -c “pdb1 pdb2 pdb3 pdb4 pdb5 pdb6 pdb7 pdb8 pdb9 pdb10 pdb11 pdb12 pdb13 pdb14 pdb15 pdb16 pdb17 pdb18 pdb19 pdb20 pdb21 pdb22 pdb23 pdb24 pdb25”

4. Review any generated fixup scripts and log files.

By default, if ORACLE_BASE is defined, then the fixup files are placed in one of the following paths:

Linux and UNIX:

$ORACLE_BASE/cfgtoollogs/db_unique_name/preupgrade

Windows

%ORACLE_BASE%\cfgtoollogs\db_unique_name\preupgrade

If ORACLE_BASE is not defined, then fixup files are placed in one of the following paths:

Linux and UNIX:

$ORACLE_HOME/cfgtoollogs/db_unique_name/preupgrade

Windows:

%ORACLE_HOME\cfgtoollogs\db_unique_name\preupgrade

5. Run the preupgrade_fixups script, or individual PDB scripts.

6. For Oracle RAC databases, set the cluster database initialization parameter to false:

For example;

ALTER SYSTEM SET cluster_database=FALSE SCOPE=spfile;

7. Shut down the database in the old Oracle home.

8. Copy the PFILE or SPFILE from the old Oracle home to the new Oracle home
9. Connect with SQL*Plus:

sqlplus / as sysdba

10. Bring the CDB$ROOT instance into upgrade mode:

STARTUP UPGRADE

11. Bring all PDBs into upgrade mode:

ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE;

12. Check the status of PDBs to confirm that they are ready to upgrade:

SHOW PDBS

For all PDBs, ensure that the status is set to MIGRATE.

13. Exit from SQL*Plus, and change directory to the new Oracle home $ORACLE_HOME/rdbms/admin:

SQL> EXIT
$ ORACLE_HOME/bin

14. Start the upgrade using the Parallel Upgrade Utility (catctl.pl, using the shell command dbupgrade), where -d specifies the location of the directory:

dbupgrade -d $ORACLE_HOME/rdbms/admin

15. Review the upg_summary.log to conf8irm that the upgrade was successful, and if necessary, review other logs.
16. Open all PDBs, so that you can recompile the databases:

ALTER PLUGGABLE DATABASE ALL OPEN;

17. Exit from SQL*Plus, and change directory to the new Oracle home path $ORACLE_HOME/rdbms/admin:

SQL> EXIT
cd $ORACLE_HOME/rdbms/admin

18. Run the catcon.pl script and the postupgrade_fixups.sql script that is supplied with the new release Oracle Database.

The following example shows the command strings for running catcon.pl, using the -n parameter to specify one parallel processor for each PDB, using the -d parameter to specify the path where the preupgrade script that you want to run is located, using the -l parameter to specify the location where you want the scripts to place log files, and using the -b flag to specify the log file prefixes for the postupgrade_fixups.sql script:

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -d \
$ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade -l /home/oracle/upgrdDBA -b \
postupgrade_fixups postupgrade_fixups.sql

19. Run postupgrade_fixups.sql.

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b postupgradefixups -d ”’.”’ postupgradefixups.sql

20. Run utlu122s.sql to verify that there are no upgrade issues.

$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlu122s -d ”’.”’ utlu122s.sql

When you use catcon.pl to run utlu122s.sql, the log file utlu122s0.log is generated.

21. For Oracle RAC environments only, enter the following commands to set the initialization parameter value for CLUSTER_DATABASE to TRUE, and to start the Oracle RAC database, where dbname is the name of the Oracle RAC database:

ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE;
srvctl start database -db db_unique_name

Oracle 18c – Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 18c

PURPOSE

This document is created for use as a guideline and checklist when manually upgrading from Oracle 11gR2 (11.2) or Oracle 12c Release 1 (12.1) or Oracle 12c Release 2 (12.2) to Oracle 18c Release

SCOPE

Database Administrators, Support

DETAILS

Step 1: Upgrade Path for 18.1 Oracle database

Minimum version of the database that can be directly upgraded to Oracle 18.1

Upgrade Matrix
Source Target
11.2.0.3/11.2.0.4 18.1
12.1.0.1/12.1.0.2 18.1
12.2.0.1 18.1

Intermediate upgrades needs to be carried for following releases

Indirect Upgrade Matrix
Source Database Intermediate upgrade path Target database
11.2.0.1/11.2.0.2 –> 11.2.0.3/11.2.0.4 –> 18.1
11.1.0.6/11.1.0.7 –> 11.2.0.3/11.2.0.4 –> 18.1
10.2.0.2, 10.2.0.3, 10.2.0.4, 10.2.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.1
10.1.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.1
9.2.0.8 or earlier –> 11.2.0.3/11.2.0.4 –> 18.1

For any multi-step upgrade, if you must carry out two upgrades to upgrade to the current release, then you must run the preupgrade script twice: First, for the intermediate upgrade release, and second, for the target upgrade target release.  For example, if the database from which you are upgrading is running Oracle Database 10g, then follow these steps:

  • Upgrade release 10.2.0.5 to release 12.1.0.2 using the instructions in Oracle Database Upgrade Guide 12c Release 1 (12.1), including running the pre-upgrade script for 12.1.0.2.
  • Upgrade Oracle Database 12c release 1 (12.1.0.2) directly to Oracle Database 18c. Use the instructions in this book, Oracle Database Upgrade Guide, including running the preupgrade script for 18.1.

Upgrade to an intermediate Oracle Database release that can be directly upgraded to the current release. Upgrade Oracle Database releases that are not supported for direct upgrade in this release to an intermediate Oracle Database release that is supported for direct upgrade.

This restriction does not apply if you use Oracle Data Pump export/import to migrate data to the new release.

For example:

  • If you are upgrading from release 11.2.0.2 or 11.1.0.7, then you must first upgrade to Oracle Database 11g release 2 (11.2.0.3).
  • If you are upgrading from release 10.2.0.2, 10.2.0.3, 10.2.0.4,10.2.0.5 or 10.1.0.5, then you must first upgrade to release 11.2. or 12.1
  • If you are upgrading from release 9.2.0.8, then you must first upgrade to a sequence of intermediate Oracle Database releases:
  • Upgrade from release 9.2.0.8 to release 11.2.0.3 or 11.2.0.4. Then upgrade from release 11.2 to 18c

Step 2: Requirements and recommendations for source database

  • Take a cold or hot back up of the source database.
  • Disable any custom triggers that would get executed before / after DDL. You can enable it once upgrade is completed.
  • Data security roles defined in a release 11g Oracle Database instance are not automatically converted to ORAS. Before you upgrade an 11g database to Oracle Database 12c, you must delete any data security roles that are defined in the 11g database. After the upgrade, you may use Analytic Workspace Manager 12c to define the data security roles again.
  • If you upgrade an 11g database to Oracle Database 12c without deleting the 11g data security roles, then any data security policies that include a data security role are invalid in the Oracle Database 12c database.
  • Timezone should less than or equal to target database timezone version.
  • IF APEX is installed then it is recommended to upgrade APEX in the source DB first before upgrading DB
  • No INVALID object / Components in Source
  • If you are installing 64-bit Oracle Database software, and your existing Oracle Database is a 32-bit Oracle Database installation, then your existing Oracle Database is automatically converted to 64-bit during the upgrade to the new Oracle Database release.
  • Execute Preupgrade scripts before upgrade and review the preupgrade log for any issues.
  • Execute dbupgdiag.sql (refer Note 556610.1 to download this script) and verify whether there are any INVALID components or objects owned by SYS/SYSTEM. If any, fix them before proceeding to upgrade the database. You can execute utlrp.sql multiple times to VALIDate them, if still objects are INVALID, create a service request with Oracle support.
  • Execute utlrp.sql multiple times and verify there are no INVALID objects.

Step3: Requirements and recommendations for target ORACLE_HOME

  • Verify the whether your operating system is certified for 18.1.  Click here to launch certification portal
  • Install 18.1.0.0, verify there are no installation related issues.
  • Download and install latest RU / RUR if any
  • Copy spfile or pfile from source ORACLE_HOME (under $ORACLE_HOME/dbs) to target home
    • Remove any _ (underscore) parameter, obsolete and deprecated parameters in pfile
    • Note min value of COMPATIBLE parameter to upgrade 18.1 is “11.2.0”, make sure you have COMPATIBLE parameter is set to 11.2.0 or greater
  • Review patch recommendations as given in the article “Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)”
  • Apply patch 29213893 on target ORACLE_HOME to avoid ORA-01422 error – refer: Database Upgrade to 12.2, 18c, 19c fails with ORA-01422, ORA-06512 for SYS.DBMS_STATS (Doc ID 2525596.1)

Step 4: Pre-upgrade checks

Clean up database

Empty the recycle bin
Check for INVALID objects in SYS and SYSTEM
Check for duplicate objects in SYS and SYSTEM
Check for INVALID, mandatory, obsolete components

Check materialized views

Check the status of all materialized views (MV), and refresh any materialized views that are not fresh.
Check the size of your materialized view logs. If any materialized view logs have non-zero rows, then refresh the base table materialized views.
Check the size of direct loader logs and PMOP logs (partition maintenance operation logs). If any direct loader logs or PMOP logs have non-zero rows, then refresh the MVs indicated by the logs
Before upgrading Oracle Database, you must wait until all materialized views have completed refreshing.

Run the following SQL query:

SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;

Copying Transparent Encryption Oracle Wallets

If Oracle wallet used with Transparent Data Encryption (TDE), then copy the sqlnet.ora and wallet file to the new Oracle home.  You must copy the sqlnet.ora and the wallet file manually before starting the upgrade.

  1. Log in as an authorized user.
  2. Manually copy the sqlnet.ora file, and the wallet file, ewallet.p12, to the new release Oracle home.

Open the Oracle wallet in mount.

For example:

      SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM SET ENCRYPTION WALLET OPEN

Understanding Password Case Sensitivity

Starting with Oracle Database 12c release 2 (12.2), the default password-based authentication protocol configuration excludes the use of the case-insensitive 10G password version. By default, the SQLNET.ORA parameter SQLNET.ALLOWED_LOGON_VERSION_SERVER is set to 12, which is an Exclusive Mode.

For greater security, Oracle recommends that you leave case-sensitive password-based authentication enabled. This setting is the default. However, you can temporarily disable case-sensitive authentication during the upgrade to new Oracle Database releases. After the upgrade, you can then decide if you want to enable the case-sensitive password-based authentication feature as part of your implementation plan to manage your password versions.

Before upgrading, Oracle recommends that you determine if this change to the default password-based authentication protocol configuration affects you. Perform the following checks:

  • Identify if you have accounts that use only 10G case-insensitive password authentication versions.
  • Identify if you have Oracle Database 11g release 2 (11.2.0.3) database or earlier clients that have not applied critical patch update CPUOct2012, or a later patch update, and have any account that does not have the case-insensitive 10G password version.
  • Ensure that you do not have the deprecated parameter SEC_CASE_SENSITIVE_LOGON set to FALSE. Setting this parameter to FALSE prevents the use of the case-sensitive password versions (the 11G and 12C password versions) for authentication.

For more information refer 18.1 Oracle database documentation

Running Upgrades with Read-Only Tablespaces

Use the Parallel Upgrade Utility with the -T option to take schema-based tablespaces offline during upgrade.  Oracle Database can read file headers created in earlier releases, so you are not required to do anything to them during the upgrade. The file headers of READ ONLY tablespaces are updated when they are changed to READ WRITE.  If the upgrade suffers a catastrophic error, so that the upgrade is unable to bring the tablespaces back online, then review the upgrade log files. The log files contain the actual SQL statements required to make the tablespaces available. To bring the tablespaces back online, you must run the SQL statements in the log files for the database, or run the log files for each PDB.

Viewing Tablespace Commands In Upgrade Log Files

If a catastrophic upgrade failure occurs, then you can navigate to the log directory (Oracle_base/cfgtoologs/dbua), and run commands in the log files manually to bring up tablespaces. You can view tablespace commands in the following log files:

Non-CDB Upgrades: catupgrd0.log
PDB databases: catupgrdpdbname0.log, where pdbname is the name of the PDB that you are upgrading.

At the beginning of each log file, you find SQL statements such as the following, which sets tables to READ ONLY:

SQL> ALTER TABLESPACE <Tablespace Name> READ ONLY;
Tablespace altered.

Near the end of each log file, you find SQL statements to reset tables to READ WRITE:

SQL> ALTER TABLESPACE <Tablespace Name> READ WRITE;
Tablespace altered.

Preparing the New Oracle Home for Upgrading

  • Copy configuration files from the Oracle home of the database being upgraded to the new release Oracle Database Oracle home.
  • If you have a password file that resides within the old environment Oracle home, then move or copy the password file to the new Oracle home.
  • Remove desupported initialization parameters and adjust deprecated initialization parameters. In new releases, some parameters are desupported, and other parameters are deprecated. Remove all desupported parameters from any parameter file that starts the new Oracle Database instance. Desupported parameters can cause errors in new Oracle Database releases. Also, alter any parameter whose syntax has changed in the new release.
  • If you are upgrading a cluster database, then you need to change CLUSTER_DATABASE=FALSE before starting upgrade

Prerequisites for Preparing Oracle Home on Windows

System must meet these requirements before starting Oracle Database upgrade on Microsoft Windows platforms.

For security reasons, different Microsoft Windows user accounts configured as Oracle home users for different Oracle homes are not allowed to share the same Oracle Base.

  • Database upgrade is supported when the same Windows user account is used as the Oracle home user in both the source and destination Oracle homes.
  • Database upgrade is supported when the Oracle home from which the database is being upgraded uses the Windows Built-in Account. Releases earlier than Oracle Database 12c (release 11.2 and earlier) only supported the built-in account option for the Oracle home user on Windows.
  • The Oracle home user may not have access to files outside its own Oracle Base and Oracle home. If that is the case, then if you choose a different Oracle Base during upgrade, it is possible that Oracle Database services cannot access files in the older Oracle Base. Using DBUA for database upgrade ensures that the Oracle home user has access to files outside of its own Oracle Base and its own Oracle home.
  • Before upgrading manually, or before using the custom files from the older Oracle Base (for example, wallets, configuration files and other custom files ), you must grant access to the Oracle home user for these outside files, or copy these files to the new Oracle Base.

Databases That Use Oracle Label Security and Oracle Database Vault

Audit Table Preupgrade and Archive Requirements

For Oracle Database releases earlier than 12.1 using Oracle Label Security and Oracle Database Vault, you must run the OLS preprocess script before you upgrade.

If you are upgrading from a database earlier than Oracle Database release 12.1 that uses Oracle Label Security (OLS) and Oracle Database Vault, then you must first run the OLS preprocess script, olspreupgrade.sql, to process the aud$ table contents. The OLS upgrade moves the aud$ table from the SYSTEM schema to the SYS schema. The olspreupgrade.sql script is a preprocessing script required for this move.

Running the olspreupgrade.sql script before upgrading is mandatory for upgrading databases earlier than Oracle Database release 12.1 that use Oracle Label Security and Oracle Database Vault. Once you have upgraded to Oracle Database release 12.1, you do not have to perform the OLS preprocessing procedure going forward to patch or upgrade the database.

Oracle Database Vault and Upgrades of Oracle Database Release 11.2

If Oracle Label Security is installed in the earlier release that you are upgrading, then grant the DV_PATCH_ADMIN role to SYS.

To run the OLS preprocess script on a release 11.2 database before upgrading:

1.    Copy the following scripts script from the newly installed Oracle home (18.1) to the Oracle home of the database that needs to be upgraded (11.2):

        ORACLE_HOME/rdbms/admin/olspreupgrade.sql
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql

2.    Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.

3.    Run the following statement:

    SQL> GRANT DV_PATCH_ADMIN to SYS;

4.    At the system prompt, connect SYS as SYSDBA:

    CONNECT SYS AS SYSDBA

5.    Run the preprocess scripts for Data Vault

    ORACLE_HOME/rdbms/admin/olspreupgrade.sql
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql

You may continue to run your applications on the database while the preprocess scripts are running.

6.    After the olspreupgrade.sql completes its run successfully, start SQL*Plus and connect to the database as DVOWNER.

7.    Run the following SQL statement:

    SQL> REVOKE DV_PATCH_ADMIN from SYS;

Granting the DV_PATCH_ADMIN Role to SYS for Oracle Database Vault

If Oracle Database Vault is enabled, then to perform checks for Oracle Data Vault, the upgrade process requires running three SQL scripts – olspreupgrade.sql, emremove.sql, catnoamd.sql

Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.

Run the following statement:

    SQL> GRANT DV_PATCH_ADMIN to SYS;

Backing Up Oracle Database for Upgrading

Suggested to backup Oracle database after you run the Pre-Upgrade Information Tool.  Take backup or create a guaranteed restore point or both.  Test your backup.  Ensure there is a proper fallback plan in case of any issues.

    rman “target / nocatalog”

RUN
{
ALLOCATE CHANNEL chan_name TYPE DISK;
BACKUP DATABASE FORMAT ‘some_backup_directory%U’ TAG before_upgrade;
BACKUP CURRENT CONTROLFILE FORMAT ‘controlfile location and name’;
}

Manually remove DB control with emremove.sql

Warning :
The below step should not be executed during the upgrade of Enterprise Manager Cloud Control Repository database. Doing so your EM Cloud Control Repository DB will become unusable.

 

Stop/shutdown DB control

emctl stop dbconsole

 
Login as sysdba

SQL>SET ECHO ON
SQL>SET SERVEROUTPUT ON
SQL>@emremove.sql >> Script located in new 12c ORACLE_HOME/rdbms/admin

Manually remove ORACLE_HOME/HOSTNAME_SID/ and ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_SID directory from the system
On windows delete DB Console service OracleDBConsoleSID

Ensure no files are in Back up mode before starting the upgrade

Run the following statement:

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

Purge Recycle bin

To empty the database recycle bin, run the following command:

SQL> PURGE DBA_RECYCLEBIN

Note: The database recycle bin must be empty during the upgrade process to avoid possible ORA-00600 errors, and to minimize the upgrade time.

Performance

Preserve performance statistics
Check network performance
Gather Optimizer statistics

To decrease the amount of downtime, gather statistics. Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS procedure to gather these statistics. For example, enter the following SQL statement:

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

Checking Time zone settings

Time zone should less than or equal to target database time zone version. If source is having higher time zone, then apply time zone patch on target ORACLE_HOME to match the source.

About Upgrading Oracle OLAP Data Security Policies

Data security roles defined in a release 11g Oracle Database instance are not automatically converted to ORAS. Before upgrading Oracle Database Release 11g to a current Oracle Database release, delete any data security roles that are defined in the 11g database. After the upgrade, you can use the new release Oracle Database Analytic Workspace Manager to define the data security roles again.

If DB us upgraded from an 11g database without deleting the 11g data security roles, then any data security policies that include a data security role are invalid in the later Oracle Database releases.

Step 5: Preupgrade step

Execute Preupgrade script from source home

$Earlier_release_Oracle_home/jdk/bin/java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar FILE TEXT DIR output_dir

FILE – Use this option to direct output to a file
TEXT – Use this option to specify log should be in Text format (other option is to have XML output)
DIR – Logs will be created under <output_dir>

It is recommended to execute pre-upgrade fixup script, if any, which are AUTO FIXABLE

Preupgrade fixup script

Execute Preupgrade fixup scripts preupgrade_fixups.sql

Dependencies on Network Utility Packages

Execute the following query

SQL> SELECT * FROM DBA_DEPENDENCIES WHERE referenced_name IN (‘UTL_TCP’,’UTL_SMTP’,’UTL_MAIL’,’UTL_HTTP’,’UTL_INADDR’,’DBMS_LDAP’) AND owner NOT IN (‘SYS’,’PUBLIC’,’ORDPLUGINS’);

To ensure that the new access controls are part of your upgrade testing, prepare a post-upgrade script to make the scripts available in your database environment.  After the upgrade, grant specific required privileges. Access is based on the usage in the original database.

Check Time zone version

Check if target database’s time zone version is lower than the source database time zone version.  If yes, before starting upgrade time zone should be upgrade without fail.  RDBMS DST patches are available in Note 412160.1

Step 6: Upgrade Database to 18c

Shut down the database.

SQL> SHUTDOWN IMMEDIATE

 

Steps specific to Windows :

If your operating system is Windows, then complete the following steps:

a. Stop the OracleServiceSID Oracle service of the database you are upgrading,where SID is the instance name. For example, if your SID is ORCL, then enter the following at a command prompt:

C:\> NET STOP OracleServiceORCL

b. Delete the Oracle service at a command prompt using ORADIM. Refer to your platform guide for a complete list of the ORADIM syntax and commands.
For example, if your SID is ORCL, then enter the following command.

C:\> ORADIM -DELETE -SID ORCL

c. Create the service for the new release Oracle Database at a command prompt using the ORADIM command of the new Oracle Database release.
For example:

C:\> ORADIM -NEW -SID SID -SYSPWD PASSWORD -MAXUSERS USERS  -STARTMODE AUTO -PFILE ORACLE_HOME\DATABASE\INITSID.ORA

 

For Unix/Linux

Set the environment variables to point to target ORACLE_HOME

export ORACLE_HOME=<path to Oracle 18c>
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=<path to Oracle_Base set during installation>

Copy the SPFILE.ORA or INIT.ORA file from the old Oracle home to the target Oracle home.

Start DB in upgrade mode from target ORACLE_HOME

CONNECT / AS SYSDBA
SQL> startup upgrade;
SQL> exit

On Linux/Unix

cd $ORACLE_HOME/bin
./dbupgrade 

On Windows

cd %ORACLE_HOME%\bin
dbupgrade

Execute Post-Upgrade Status Tool, utlu122s.sql and review the upgrade spool log file.  You run the Post-Upgrade Status Tool in the environment of the new release.

$ sqlplus “/as sysdba”
SQL> STARTUP
SQL> @utlu122s.sql

Verify the upgrade log whether catuppst.sql (under $ORACLE_HOME/cfgtoollogs/<SID>/upgrade<timestamp>/) has been executed or not.  If not, execute it manually from new ORACLE_HOME, located at $ORACLE_HOME/rdbms/admin directory.  If there are no errors during upgrade, then you can skip this step, since upgrade script will execute this by default.

SQL> @catuppst.sql

Run utlrp.sql to recompile any remaining stored PL/SQL and Java code in another session.

SQL> @utlrp.sql

Check the state of the Oracle Data Dictionary for diagnosing upgrades and migrations.  The dbupgdiag.sql script collects upgrade and migration diagnostic information about the current state of the data dictionary.  You can run the script in SQL*Plus on the upgraded database as the SYS user.  Refer Note 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)

If the dbupgdiag.sql script reports any invalid objects, run $ORACLE_HOME/rdbms/admin/utlrp.sql (multiple times) to validate the invalid objects in the database, until there is no change in the number of invalid objects.  After validating the invalid objects, re-run dbupgdiag.sql in the upgraded database once again and make sure that everything is fine.

If you are using Oracle Clusterware, then you must upgrade the Oracle Clusterware keys for the database.  Run srvctl for Oracle Database 18c to upgrade the database. For example:

ORACLE_HOME/bin/srvctl upgrade database -db name -o ORACLE_HOME

 

 

Step 7: Post-upgrade

Setting Environment variables on Linux and Unix

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

ORACLE_HOME
PATH

Update oratab entries

Modify the corresponding entry in the /etc/oratab file to point to the new ORACLE_HOME location.

Post-upgrade fixup script

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

 

SQL> @postupgrade_fixups.sql

Recovery Catalog Upgrade

If you use a version of the recovery catalog schema that is older than that required by the RMAN client, then you must upgrade it. You can upgrade the Recovery catalog by executing the UPGRADE CATALOG command

Please refer to Oracle documentation under “Upgrading the Recovery Catalog” for complete information and steps

Upgrade the Time Zone File Version After Upgrading Oracle Database

If the Pre-Upgrade Information Tool instructed you to upgrade the time zone files after completing the database upgrade,
then use the DBMS_DST PL/SQL package to update the RDBMS DST (timezone) version.

Follow the procedure in Oracle documentation under “Steps to Upgrade Time Zone File and Timestamp with Time Zone Data” and Note 1509653.1 “Updating the RDBMS DST version in 12c Release 1 (12.1.0.1 and up) using DBMS_DST”

Upgrading Statistics Tables

If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by running DBMS_STATS.UPGRADE_STAT_TABLE.  In the following example, SYS is the owner of the statistics table and ‘dictstattab’ is the name of the statistics table.

EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE(‘SYS’, ‘dictstattab’);

Perform this procedure for each statistics table.

Requirements for Installing Oracle Database 18c on OL7 or RHEL7 64-bit (x86-64)

PURPOSE

This note explains the requirements that need to be met for a successful installation of Oracle Database 18c release On Oracle Linux 7 (or higher 7.x version) or Red Hat Enterprise Linux 7 (or higher 7.x version) 64-bit (x86-64).

It is NOT the purpose of this NOTE to repeat every “how-to” step that is presented in the Oracle Database 18c Installation Guide. For example this NOTE does not include how to create the Linux OS account named “oracle”, nor does it cover how to set environment variables. Both are adequately covered in “Oracle® Database Installation Guide 18c for Linux”

SCOPE

This procedure is meant for those Planning / Installing Oracle Database 18c on Oracle Linux 7 (or higher 7.x version) or RHEL 7.0 (or higher 7.x version) on the 64-bit (x86-64) platform. Since it is the expressed goal to keep Oracle Linux (OL) functionally IDENTICAL to RHEL, this NOTE is also completely applicable to 64-bit (x86-64) OL 7.0

This procedure is not meant for those Planning / Installing Grid Infrastructure (GI) or any other Oracle products.

DETAILS

Requirements for installing Oracle Database 18c release 64-bit on OL7 64-bit or RHEL7 (x86_64)

Before you proceed with Installation, please take time to review every below requirement carefully to avoid any obvious issues during Installation of binaries.

– Download the Oracle Database 18c Software

-Download the Oracle Database 18c software from My Oracle Support

-After you download the Software, Verify the integrity of the Downloaded Software
Note 549617.1 How To Verify The Integrity Of A Patch/Software Download? [Video]

-If you have downloaded the Software on other Machine, please transfer the zip file on the Server being Installed using Binary Mode and unzip with the Oracle Software user.

Hardware

Minimum Hardware Requirements

a. Ensure that your system meets the following Physical Memory requirements:

Minimum:         1 GB of RAM
Recommended: 2 GB of RAM or more

b. Swap space allocation relative to RAM

        RAM       Swap Space
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB

 

NOTE: The above recommendations (from the Oracle® Database Installation Guide 18c for Linux) are MINIMUM recommendations for installations. Further RAM and swap space may be required to tune/improve RDBMS performance.

c. 1.0 GB (1024MB) of disk space (and less than 2TB of disk space) in the /tmp directory.

d. If the free space available in the /tmp directory is less than what is required, then complete one of the following steps:
– Delete unnecessary files from the /tmp directory to meet the disk space requirement.
– Set the TMP and TMPDIR environment variables when setting the oracle user’s environment.

e. Approximately 6.5 GB of local disk space for the Database Software Files.

f.  If you intend to create a preconfigured database during the installation, then the file system (or file systems) that you choose must have at least 2 GB of free disk space.
For production databases, you must estimate the disk space requirement depending on the use of the database.

2. Oracle Database is supported on ext2, ext3 and ext4 file systems (see Note:236826.1 for further information)

Software

Certified Operating System

Oracle Linux 7
Red Hat Enterprise Linux 7

a. For Minimal Linux Installation :
A minimal Linux installation option is either a custom installation where you select the Minimal option from Package Group Selection, or where you deselect all packages except for the Base pack. A minimal Linux installation lacks many RPMs required for database installation, so you must use an RPM package for your Oracle Linux release to install the required packages. The package you use depends on your Linux release

b. For a Default Linux Installation
Oracle recommends that you install your Linux operating system with the default software packages (RPMs).
A default Linux installation includes most of the required packages and helps you limit manual verification of package dependencies. Oracle recommends that you do not customize the RPMs during installation.

Kernel requirements

The following kernels are supported:

Oracle Linux 7 with the Unbreakable Enterprise Kernel 3: 3.8.13-35.3.1.el7uek.x86_64 or later
Oracle Linux 7.2 with the Unbreakable Enterprise Kernel 4: 4.1.12-32.2.3.el7uek.x86_64 or later
Oracle Linux 7 with the Red Hat Compatible kernel: 3.10.0-123.el7.x86_64  or later
Red Hat Enterprise Linux 7: 3.10.0-123.el7.x86_64 or later

It is observed there are hang issues in RHEL 7 with many CPU cores and more RAM, due NUMA was enabled. As a work around it is recommended to turn off NUMA.
Note 1508516.1 Is It Mandatory To Install UEK Kernel Under RHEL?

Oracle Universal Installer requires an X Window System (for example, libx)

The libx packages are part of a default Linux installation.
If you perform an install on a system with a reduced set of packages, then you must ensure that libx or a similar X Window System package is installed

At least 1 GB of space in the /tmp directory.

Runlevel : 3 or 5

Oracle User Environment Configuration Checklist :

For new installs, if you have not configured an oraInventory directory, then the installer creates an Oracle inventory that is one directory level up from the Oracle base for the Oracle Grid Infrastructure install, and designates the installation owner’s primary group as the Oracle Inventory group.
The oinstall group must be the primary group of all Oracle software installation owners on the server. It should be writable by any Oracle installation owner.
Oracle recommends that you create groups and user accounts required for your security plans before starting installation. Installation owners have resource limits settings and other requirements.

If you have an existing Oracle software installation, and you are using the same user to install this installation, then unset the following environment variables: $ORACLE_HOME,$ORA_NLS10, and $TNS_ADMIN, $ORACLE_BASE, $ORACLE_SID

By default, your operating system includes an entry in /etc/fstab to mount /dev/shm. However, if your Cluster Verification Utility (CVU) or Oracle Universal Installer (OUI) checks fail, ensure that the /dev/shm mount area is of type tmpfs and is mounted with the following options:
rw and exec permissions set on it
Without noexec or nosuid set on it

Set the default file mode creation mask (umask) to 022 in the shell startup file.

Storage Checklist for Oracle Database

At least 7.5 GB for Oracle Database Enterprise Edition.
At least 7.5 GB for Oracle Database Standard Edition 2.

Minimum Operating System Resource Parameter Settings

semmsl 250

semmns 32000

semopm 100

semmni 128

shmall Greater than or equal to the value of shmmax, in pages /proc/sys/kernel/shmall

shmmax Half the size of physical memory in bytes /proc/sys/kernel/shmmax

shmmni 4096

panic_on_oops 1

file-max 6815744

aio-max-nr 1048576

ip_local_port_range Minimum: 9000

ip_local_port_range Maximum: 65500

rmem_default 262144

rmem_max 4194304

wmem_default 262144

wmem_max 1048576

 

Verify the latest version of PAM is loaded, then add or edit the following line in the /etc/pam.d/login file, if it does not already exist:

session required pam_limits.so

Minimum Operating System Requirements

Oracle Linux 7 Minimum Operating System Requirements
Item Requirements
SSH Requirement Ensure that OpenSSH is installed on your servers. OpenSSH is the required SSH software.
Packages for Oracle Linux 7 with UEK3 bc
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
fontconfig-devel-2.10.95-7.el7.x86_64
ksh
libX11-1.6.0-2.1.el7.i686
libX11-1.6.0-2.1.el7.x86_64
libXau-1.0.8-2.1.el7.i686
libXau-1.0.8-2.1.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
libXrender-devel-0.9.10-1.el7.i686
libXrender-devel-0.9.10-1.el7.x86_64
libXrender-0.9.10-1.el7.i686
libXrender-0.9.10-1.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libxcb-1.9-5.el7.i686
libxcb-1.9-5.el7.x86_64
make-3.82-19.el7.x86_64 make-3.82-19.el7.x86_64
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware)
nfs-utils-1.3.0-0.21.el7.x86_64
python-2.7.5-34.0.1.el7 (x86_64) (for Oracle ACFS Remote)
python-configshell-1.1.fb18-1.el7.noarch (for Oracle ACFS Remote)
python-rtslib-2.1.fb57-3.el7.noarch (for Oracle ACFS Remote)
python-six-1.9.0-2.el7.noarch (for Oracle ACFS Remote)
smartmontools-6.2-4.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
targetcli-2.1.fb41-3.el7.noarch (for Oracle ACFS Remote)
Packages for Oracle Linux 7.2 with UEK 4 bc
binutils-2.23.52.0.1-55.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
elfutils-libelf-0.163-3.el7.i686
elfutils-libelf-0.163-3.el7.x86_64
elfutils-libelf-devel-0.163-3.el7.i686
elfutils-libelf-devel-0.163-3.el7.x86_64
fontconfig-devel-2.10.95-7.el7.x86_64
glibc-2.17-106.0.1.el7_2.6.i686
glibc-2.17-106.0.1.el7_2.6.x86_64
glibc-devel-2.17-106.0.1.el7_2.6.i686
glibc-devel-2.17-106.0.1.el7_2.6.x86_64
ksh
libaio-0.3.109-13.el7.i686
libaio-0.3.109-13.el7.x86_64
libaio-devel-0.3.109-13.el7.i686
libaio-devel-0.3.109-13.el7.x86_64
libX11-1.6.3-2.el7.i686
libX11-1.6.3-2.el7.x86_64
libXau-1.0.8-2.1.el7.i686
libXau-1.0.8-2.1.el7.x86_64
libXi-1.7.4-2.el7.i686
libXi-1.7.4-2.el7.x86_64
libXtst-1.2.2-2.1.el7.i686
libXtst-1.2.2-2.1.el7.x86_64
libXrender-devel-0.9.10-1.el7.i686
libXrender-devel-0.9.10-1.el7.x86_64
libXrender-0.9.10-1.el7.i686
libXrender-0.9.10-1.el7.x86_64
libgcc-4.8.5-4.el7.i686
libgcc-4.8.5-4.el7.x86_64
librdmacm-devel-1.0.21-1.el7.i686
librdmacm-devel-1.0.21-1.el7.x86_64
libstdc++-4.8.5-4.el7.i686
libstdc++-4.8.5-4.el7.x86_64
libstdc++-devel-4.8.5-4.el7.i686
libstdc++-devel-4.8.5-4.el7.x86_64
libxcb-1.11-4.el7.i686
libxcb-1.11-4.el7.x86_64
make-3.82-21.el7.x86_64
nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware)
python-2.7.5-34.0.1.el7 (x86_64) (for Oracle ACFS Remote)
python-configshell-1.1.fb18-1.el7.noarch (for Oracle ACFS Remote)
python-rtslib-2.1.fb57-3.el7.noarch (for Oracle ACFS Remote)
python-six-1.9.0-2.el7.noarch (for Oracle ACFS Remote)
smartmontools-6.2-4.el7.x86_64
sysstat-10.1.5-7.el7.x86_64
targetcli-2.1.fb41-3.el7.noarch (for Oracle ACFS Remote)
Packages for Oracle Linux 7.5 with UEK 5 bc
binutils
compat-libcap1
compat-libstdc++
elfutils-libelf
elfutils-libelf-devel
fontconfig-devel
glibc
glibc-devel
ksh
libaio
libaio-devel
libX11
libXau
libXi
libXtst
libXrender-devel
libXrender
libgcc
librdmacm-devel
libstdc++
libstdc++-devel
libxcb
make
nfs-utils (for Oracle ACFS)
net-tools (for Oracle RAC and Oracle Clusterware)
python (for Oracle ACFS Remote)
python-configshell (for Oracle ACFS Remote)
python-rtslib (for Oracle ACFS Remote)
python-six (for Oracle ACFS Remote)
smartmontools
sysstat
targetcli (for Oracle ACFS Remote)
Packages for Oracle Linux 7 with Red Hat Compatible kernel bc
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libX11-1.6.0-2.1.el7.i686
libX11-1.6.0-2.1.el7.x86_64
libXau-1.0.8-2.1.el7.i686
libXau-1.0.8-2.1.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
libXrender-devel-0.9.10-1.el7.i686
libXrender-devel-0.9.10-1.el7.x86_64
libXrender-0.9.10-1.el7.i686
libXrender-0.9.10-1.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libxcb-1.9-5.el7.i686
libxcb-1.9-5.el7.x86_64
make-3.82-19.el7.x86_64 make-3.82-19.el7.x86_64
nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware)
python-2.7.5-34.0.1.el7 (x86_64) (for Oracle ACFS Remote)
python-configshell-1.1.fb18-1.el7.noarch (for Oracle ACFS Remote)
python-rtslib-2.1.fb57-3.el7.noarch (for Oracle ACFS Remote)
python-six-1.9.0-2.el7.noarch (for Oracle ACFS Remote)
smartmontools-6.2-4.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
targetcli-2.1.fb41-3.el7.noarch (for Oracle ACFS Remote
Packages for Red Hat Enterprise Linux 7 bc
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libX11-1.6.0-2.1.el7.i686
libX11-1.6.0-2.1.el7.x86_64
libXau-1.0.8-2.1.el7.i686
libXau-1.0.8-2.1.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
libXrender-devel-0.9.10-1.el7.i686
libXrender-devel-0.9.10-1.el7.x86_64
libXrender-0.9.10-1.el7.i686
libXrender-0.9.10-1.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libxcb-1.9-5.el7.i686
libxcb-1.9-5.el7.x86_64
make-3.82-19.el7.x86_64 make-3.82-19.el7.x86_64
nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware)
python-2.7.5-34.0.1.el7 (x86_64) (for Oracle ACFS Remote)
python-configshell-1.1.fb18-1.el7.noarch (for Oracle ACFS Remote)
python-rtslib-2.1.fb57-3.el7.noarch (for Oracle ACFS Remote)
python-six-1.9.0-2.el7.noarch (for Oracle ACFS Remote)
smartmontools-6.2-4.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
targetcli-2.1.fb41-3.el7.noarch (for Oracle ACFS Remote)

 

The Oracle ORAchk utility provides system checks that can help to prevent issues before and after installation. These checks include kernel requirements, operating system resource allocations, and other system requirements.

Before you perform a fresh database installation:

./orachk -profile preinstall

Running Oracle Database Setup Wizard to Install Oracle Database

Log in as the Oracle installation owner user account (oracle) that you want to own the software binaries.

Download the Oracle Database installation image files (db_home.zip) to a directory of your choice. For example, you can download the image files to the /tmp directory.

Create the Oracle home directory and extract the image files that you have downloaded in to this Oracle home directory. For example:

$ mkdir -p /u01/app/oracle/product/18.0.0/dbhome_1

$ chgrp oinstall /u01/app/oracle/product/18.0.0/dbhome_1

$ cd /u01/app/oracle/product/18.0.0/dbhome_1

$ unzip -q /tmp/db_home.zip

From the Oracle home directory, run the runInstaller command to start the Oracle Database Setup Wizard.

$ cd /u01/app/oracle/product/18.0.0/dbhome_1

$ ./runInstaller

In the Select Configuration Option screen, select Create and configure a single instance database.

Select your installation type.

ADDITIONAL NOTES

1. Starting from Oracle Database 12.1 32-bit Oracle Database Software is not available.

2. Supported distributions of the 32-bit (x86) Oracle Database Client Linux OS can run on on AMD64/EM64T and Intel Processor Chips that adhere to the x86_64 architecture. Oracle 32-bit Database Client running on AMD64/EM64T with 64-bit OS is expected to be supported, but is NOT covered by this NOTE.

3. Asynchronous I/O on ext2 and ext3 file systems is supported if your scsi/fc driver supports that functionality.

Note : Asynchronous I/O on Ext4 file system is supported with Oracle 10g onwards on OEL5.6 and later.
Reference : Oracle Linux, Filesystem & I/O Type Supportability (Note 279069.1)[This section is not visible to customers.]

4. No extra patch is required for the DIRECTIO support for x86_64.

5. No LD_ASSUME_KERNEL value should be used with the Oracle Database 12.2 product.

6. The following rpm command can be used to distinguish between a 32-bit or 64-bit package.

# rpm -qa –queryformat “%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n” | grep glibc-devel
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (i686)

7. Oracle Universal Installer requires an X Window System (for example, libx). The libx packages are part of a default Linux installation. If you perform an install on a system with a reduced set of packages, then you must ensure that libx or a similar X Window System package is installed.

8. 32-bit packages (i686 rpm) in these requirements lists are needed only if you intend to use 32-bit client applications to access 64-bit servers.

9. Oracle Database 12c Release 2 (12.2) and later does not require the compiler packages gcc and gcc-c++ on Oracle Linux and Red Hat Enterprise Linux for Oracle Database or Oracle Grid Infrastructure installations.

Complete Checklist for Upgrading to Oracle Database 18c (18.x) using DBUA

PURPOSE

The purpose of this article is to help DBA’s / Support Teams to perform the upgrade of a database using DBUA to 18.x.

SCOPE

DBA, Support

DETAILS

Database Upgrade Assistant (DBUA)

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

DBUA works for CDB and non-CDB database systems. It is the recommended method for performing a major release upgrade or patchset release upgrade.

You can use DBUA to upgrade multitenant architecture container databases (CDB), pluggable databases (PDBs), and non-CDB databases.
The procedures are the same, but the choices you must make and the behavior of DBUA are different, depending on the type of upgrade.

DBUA automates the upgrade process by performing all of the tasks.

DBUA provides support for Oracle Real Application Clusters (Oracle RAC) databases. In an Oracle RAC environment,
DBUA upgrades all the database and configuration files on all nodes in the cluster.

DBUA, graphical user interface must be invoked within the new Oracle home where the Oracle Database 18c software has been installed.
For windows, Only an Administrator or Installed owner should invoke DBUA for Windows systems.

DBUA runs the Pre-Upgrade Information Tool as part of the prerequisite checks it performs before starting the upgrade.
However, to reduce downtime, Oracle recommends that you run the Pre-Upgrade Information Tool as part of your upgrade planning, so that you can analyze the database,
and take proactive steps before your planned upgrade date.
Once, you address / fix the pre-upgrade recommendation / warnings /errors and continue with the upgrade, DBUA shows the progress of the upgrade for each component of source database.

As with previous releases of DBUA, 18c DBUA restricts the carry over of hidden parameters since Oracle recommends not to have hidden parameters other than those suggested
via support during the upgrade.
To view existing hidden parameters execute the following command while connected AS SYSDBA:

SELECT name,description from SYS.V$PARAMETER WHERE name LIKE ‘\_%’ ESCAPE ‘\’;

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. The default timezone vetrsion in 18.x is 26.

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

About Read-Only Oracle Homes

Starting with Oracle Database 18c, you can configure an Oracle home in read-only mode.
In a read-only Oracle home, all the configuration data and log files reside outside of the read-only Oracle home. This feature allows you to use the read-only Oracle home as a software image that can be distributed across multiple servers.

Upgrade Path / Compatibility Matrix for 18.x Oracle Database

DBUA can upgrade only supported versions of direct upgrade.

Direct Upgrade to 18.x:

Source Database Target Database
11.2.0.3 and Higher 18.x
12.1.0.x (12.1.0.1 – 12.1.0.2) 18.x
12.2.0.1 18.x

 

Indirect Upgrade to 18.x:

 
Source Database Intermediate upgrade path Target database
11.2.0.1/11.2.0.2 –> 11.2.0.3/11.2.0.4 –> 18.x
11.1.0.6/11.1.0.7 –> 11.2.0.3/11.2.0.4 –> 18.x
10.2.0.2, 10.2.0.3, 10.2.0.4, 10.2.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.x
10.1.0.5 –> 11.2.0.3/11.2.0.4/12.1.0.1/12.1.0.2 –> 18.x
9.2.0.8 or earlier –> 11.2.0.3/11.2.0.4 –> 18.x

 

Requirements and Recommendation for source database

 

– Ensure that all database components/objects provided by Oracle are VALID in the source database prior to starting the upgrade.

– Before you start an upgrade or downgrade process, Oracle strongly recommends that you update both your earlier release and your new release (18.x) Oracle Database to the latest Oracle bundle patch or patch set update (BP or PSU).

– Ensure that you do not have duplicate objects in the SYS and SYSTEM schema. For 1 and 2 refer to:
Doc Id 556610.1 – Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)
– dbupgdiag.sql script is a set of sql statements intended to provide a user friendly output to diagnose the status of the database either before (or) after upgrade. The script will create a output file called db_upg_diag_<sid>_<timestamp>.log

– IF APEX is installed then it is recommended to upgrade APEX in the source DB first before upgrading DB

– Timezone should less than or equal to target database timezone version.

– Make sure to have a valid backup of source database prior to upgrade.

– Disable any custom triggers that would get executed before / after DDL statements. Re-enable after the upgrade.

– Check the database server upgrade/downgrade compatibility matrix before upgrading the database.

– Set Archive Log ON during upgrade. Oracle recommends that you set Archive Log ON in order for DBUA to create and update the log file for the upgrade process.

– For Oracle RAC, if you upgrade a cluster database using DBUA, then you must leave the CLUSTER_DATABASE initialization parameter set to TRUE.

– Ensure to run the pre-upgrade utility prior to upgrading the database.

– Examine and follow the recommendation given in the preupgrade log file.

– Materialized views in source database should be stopped before upgrade

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

– Disable scheduled database custom jobs / cron jobs.

– Min value of COMPATIBLE parameter to upgrade 18.1 is “11.2.0”, make sure you have COMPATIBLE parameter is set to 11.2.0 or greater

– Review patch recommendations as given in the article “Patches to apply before upgrading Oracle GI and DB to 18c (Doc ID 2414935.1)”

 

Requirements and Recommendations for Target database

– Verify whether your operating system / platform is certified for 18.x release.

– Download and Install Oracle 18c (18,x) in a new Oracle_Home and make sure there are no binary relinking errors.

– Download and Install the latest available RU or RUR from My Oracle Support (MOS).

– Make sure to set the ORACLE_HOME, PATH, LD_LIBRARY_PATH, LIBPATH etc. to 18.x target home.

– Apply patch 29213893 on target ORACLE_HOME to avoid ORA-01422 error – refer: Database Upgrade to 12.2, 18c, 19c fails with ORA-01422, ORA-06512 for SYS.DBMS_STATS (Doc ID 2525596.1)

 

Prerequisites for Preparing Oracle Home on Windows

 

Your system must meet these requirements before you can upgrade Oracle Database on Microsoft Windows platforms. For security reasons, different Microsoft Windows user accounts configured as Oracle
home users for different Oracle homes are not allowed to share the same Oracle Base.

– Database upgrade is supported when the same Windows user account is used as the Oracle home user in both the source and destination Oracle homes.

– Database upgrade is supported when the Oracle home from which the database is being upgraded uses the Windows Built-in Account. Releases earlier than Oracle Database 12c (release 11.2 and earlier) only supported the built-in account option for the Oracle home user on Windows.

– The Oracle home user may not have access to files outside its own Oracle Base and Oracle home. If that is the case, then if you choose a different Oracle Base during upgrade, it is possible that Oracle Database services cannot access files in the older Oracle Base. Using DBUA for database upgrade ensures that the Oracle home user has access to files outside of its own Oracle Base and its own Oracle home.

 

 

 

 

 

Pre Upgrade

 

 

 

$Earlier_release_Oracle_home/jdk/bin/java -jar $New_release_Oracle_home/rdbms/admin/preupgrade.jar [FILE|TERMINAL] [TEXT|XML] [DIR output_dir]

 
FILE|TERMINAL – Use this option to direct script output to a file. Use TERMINAL to direct output to the terminal. If it is not specified then defaultr is FILE.
TEXT – Use this option to specify log should be in Text format. Use TEXT to specify text output. Use XML to specify XML output. If you do not specify an output type, then the default is text.
DIR – Logs will be created under <output_dir>. Directs the output to a specific directory. If you do not specify an output directory with the DIR option, then the output is directed to one of the default locations: If you define ORACLE_BASE environment variable then the generated scripts and log files will be created under $ORACLE_BASE/cfgtoollogs/<dbname>/preupgrade/ location else it will create under $ORACLE_HOME/cfgtoollogs/db_name/preupgrade/.

 

For example,

source Oracle Home : /u01/app/oracle/product/12.1.0.1/dbgome_1

target Oracle Home : /u01/app/oracle/product/18.0.0.0/dbhome_1

$ export ORACLE_SID=orcl
$ export ORACLE_BASE=/u01/app/oracle
$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/dbhome_1

$ $ORACLE_HOME/jdk/bin/java -jar /u01/app/oracle/product/18.0.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE TEXT

Preupgrade generated files:
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade.log
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql

 

Examine the preupgrade.log file and follow the recommendation.

 

 

The latest preupgrade utility for 18.x can be found from :

How to Download and Run Oracle’s Database Pre-Upgrade Utility (Doc ID 884522.1)

 

 

Check for Invalid Objects / Components

 

set pagesize500
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name;

select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type from dba_objects where status=’INVALID’ order by owner,object_type;

select owner,object_type,count(*) from dba_objects where status=’INVALID’ group by owner,object_type order by owner,object_type ;

 

If you find invalid objects and/or database components then try to VALIDATE the invalid objects and/or database components by executing the following steps:

Run utlrp.sql to validate the invalid objects in the database. You can execute the utlrp.sql scripts multiple times to validate the invalid objects.

$ sqlplus “/ as sysdba”
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 

 

Gathering Optimizer Statistics to Decrease Oracle Database Downtime

 

Oracle strongly recommends that you use this procedure to gather statistics before performing Oracle Database upgrades.Oracle recommends that you use the DBMS_STATS.GATHER_DICTIONARY_STATS   procedure to gather these statistics. For example, enter the following SQL statement:

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

 

Verifying Materialized View Refreshes are Complete Before Upgrade

Use this procedure to query the system to determine if there are any materialized view refreshes still in progress. Before upgrading Oracle Database, you must wait until all materialized views have
completed refreshing.

SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;

 

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

 

Check of TIMESTAMP WITH TIMEZONE Datatype

The time zone files that are supplied with Oracle Database 12c release 2 (18.x) is version 26.

Case 1 Timezone version of source database is lower or equal 26.

If the source database is using a timezone file lower than version 26 then there is no DST patch to apply in source oracle home or target 12cR2 home.

Case 2 Timezone version of source database is higher than 26.

If the source database uses a Timezone version higher than 26 then BEFORE the upgrade you MUST patch the target 12cR2 $ORACLE_HOME with a timezone data file of the SAME version as the one used in the source release database.

 

Ensuring That No Files Are in Backup Mode and no files need media recovery Before Upgrading

 

Execute below query to check for the status of the backup:

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

Ensure that no files require media recovery:

SQL> SELECT * FROM v$recover_file;

 

Purging Recycle Bin before upgrade

 

 SQL> PURGE DBA_RECYCLEBIN;

we can purge the recycle bin via DBUA.

 

Databases That Use Oracle Label Security and Oracle Database Vault

Audit Table Preupgrade and Archive Requirements

For Oracle Database releases earlier than 12.1 using Oracle Label Security and Oracle Database Vault, you must run the OLS preprocess script before you upgrade.

If you are upgrading from a database earlier than Oracle Database release 12.1 that uses Oracle Label Security (OLS) and Oracle Database Vault, then you must first run the OLS preprocess script, olspreupgrade.sql, to process the aud$ table contents. The OLS upgrade moves the aud$ table from the SYSTEM schema to the SYS schema. The olspreupgrade.sql script is a preprocessing script required for this move.

Running the olspreupgrade.sql script before upgrading is mandatory for upgrading databases earlier than Oracle Database release 12.1 that use Oracle Label Security and Oracle Database Vault. Once you have upgraded to Oracle Database release 12.1, you do not have to perform the OLS preprocessing procedure going forward to patch or upgrade the database.

Oracle Database Vault and Upgrades of Oracle Database Release 11.2

If Oracle Label Security is installed in the earlier release that you are upgrading, then grant the DV_PATCH_ADMIN role to SYS.

To run the OLS preprocess script on a release 11.2 database before upgrading:

1.    Copy the following scripts script from the newly installed Oracle home (18.1) to the Oracle home of the database that needs to be upgraded (11.2):

        ORACLE_HOME/rdbms/admin/olspreupgrade.sql
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql

2.    Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.

3.    Run the following statement:

    SQL> GRANT DV_PATCH_ADMIN to SYS;

4.    At the system prompt, connect SYS as SYSDBA:

    CONNECT SYS AS SYSDBA

5.    Run the preprocess scripts for Data Vault

    ORACLE_HOME/rdbms/admin/olspreupgrade.sql
ORACLE_HOME/rdbms/admin/emremove.sql
ORACLE_HOME/rdbms/admin/catnoamd.sql

You may continue to run your applications on the database while the preprocess scripts are running.

6.    After the olspreupgrade.sql completes its run successfully, start SQL*Plus and connect to the database as DVOWNER.

7.    Run the following SQL statement:

    SQL> REVOKE DV_PATCH_ADMIN from SYS;

For 12.x Granting the DV_PATCH_ADMIN Role to SYS for Oracle Database Vault

If Oracle Database Vault is enabled, then to perform checks for Oracle Data Vault, the upgrade process requires running three SQL scripts – olspreupgrade.sql, emremove.sql, catnoamd.sql

Start SQL*Plus and connect as DVOWNER to the database that you want to upgrade.

Run the following statement:

    SQL> GRANT DV_PATCH_ADMIN to SYS;

 

 

Save OEM DB Control Configuration (For Oracle Database releases earlier than 12.1)

If you plan to downgrade database after upgrading to 18.x, then before starting the upgrade save the DB Control configuration and data using emdwgrd utility, so that you can restore the files after downgrading.

Steps to Save data:

1. Install the software for the new Oracle Database 12c release.
2. Set ORACLE_HOME to your old Oracle home.
3. Set ORACLE_SID to the SID of the database being upgraded.
4. Set PATH, LD_LIBRARY_PATH, and SHLIB_PATH to point to the upgraded Oracle Database Oracle home.
5. Change directory to the new Oracle Database release Oracle home.
6. Run emdwgrd

 

Single-instance databases:

emdwgrd[sh|bat] -save -sid old_SID -path save_directory

 

Oracle Real Application Clusters (Oracle RAC) databases:

Remote copy must be enabled across all cluster member nodes. Use EM_REMCP environment variable, to indicate which remote copy is configured, for example: export EM_REMCP /usr/bin/scp

emdwgrd -save -cluster -sid old_SID -path save_directory

 

7. Enter the SYS password for the database that you want to upgrade.

 

Removing DB Control with emremove.sql (For Oracle Database releases earlier than 12.1)

Warning :
The below step should not be executed during the upgrade of Enterprise Manager Cloud Control Repository database. Doing so your EM Cloud Control Repository DB will become unusable.

  

Starting with Oracle Database 12c release 1 (12.1), DB Control is removed as part of the upgrade process.

Stop DB Console:

emctl stop dbconsole

Execute emremove.sql script. The script willbe located in target 18.x OH/rdbms/admin/.

SQL>SET ECHO ON
SQL>SET SERVEROUTPUT ON
SQL>@emremove.sql >> Script located in new 12c ORACLE_HOME/rdbms/admin

After emremove.sql completes, you must manually remove ORACLE_HOME/HOSTNAME_SID and ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_HOSTNAME_SID directories from your file system.

 

Desupport of OLAP Catalog (OLAP AMD) (For Oracle Database releases earlier than 12.1)

Starting with Oracle Database 12c, the OLAP Catalog (OLAP AMD) is desupported and will be removed from the database during the database upgrade. This step can be manually performed before the upgrade to reduce downtime. It can be removed by running the SQL script $ORACLE_HOME/olap/admin/catnoamd.sql script. Do not run the script in UPGRADE mode.

 

Copying Transparent Encryption Oracle Wallets

If you use Oracle wallet with Transparent Data Encryption (TDE), and you use Database Upgrade Assistant (DBUA) to upgrade the database, then copy the sqlnet.ora and wallet file to the new 18.x Oracle home.

You must copy the sqlnet.ora and the wallet file manually before starting the upgrade.
1. Log in as an authorized user.
2. Manually copy the sqlnet.ora file, and the wallet file, ewallet.p12, to the new release Oracle home.
3. Open the Oracle wallet in mount.

For example:
SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM SET ENCRYPTION WALLET OPEN;

 

Check the accounts use Case-Insensitive password version

Log in to SQL*Plus as an administrative user, and enter the following SQL query
SELECT USERNAME,PASSWORD_VERSIONS FROM DBA_USERS;

If there are any 10g versions, suggest you to refer Oracle documentation to fix 10g versions, failing to do so, user accounts with LOCKED after upgrade is completed.

 

About Password Case Sensitivity

Ensure that you do not have the deprecated parameter SEC_CASE_SENSITIVE_LOGON set to FALSE.

 

Requirement for Upgrading Databases that Use Oracle Warehouse Builder (OWB)

OWB releases earlier than release 11.2.0.3 do not work with Oracle Database 12c. OWB is not installed as part of the software for Oracle Database 18c, and OWB components that may exist in earlier releases are not upgraded as part of the Oracle Database upgrade process.

Oracle Warehouse Builder is not supported on any version higher than 12.1.x.  ODI is the migration path to newer versions of the database.

Invoke DBUA

DBUA ( Step 1 of 9 )

Select the database to be upgrade , as there is only 1 database in example , it is auto selected — ORCL

DBUA Step 1

 

DBUA ( Step 2 of 9 )

DBUA will execute the preupgrade script (preupgrade.jar) and return warnings / errors.

 

DBUA Step 2

 

DBUA ( Step 3 of 9 )

After the pre-upgrade warnings has been addressed, DBUA shows various options like Enable Parallel Upgrade, Recompile invalid objects in post upgrade phase, upgrading timezone, gather statistics before the upgrade, setting the user tablespaces to read only during upgrade. Also, you can provide any custom SQL scripts before or after the upgrade.

 

DBUA Step 3

 

DBUA ( Step 4 of 9 )

This screen will show various Recovery options to choose from like creating a Guaranteed Restore Point, or Take an RMAN backup or if the backup is already taken outside DBUA then “I have my own backup and restore stratege ” option can be chosen.

 

DBUA Step 4

 

DBUA ( Step 5 of 9 )

in this screen, we can create a new listener or upgrade the existing listener to 18c.

 

DBUA Step 5

 

DBUA ( Step 6 of 9 )

This screen is for configure EM express or register the upgraded database with EM Cloud control.

 

DBUA Step 6

 

DBUA ( Step 7 of 9 )

This is the summary screen before the actual upgrade starts. Click on Finish to proceed with the upgrade.

 

DBUA Step 7

 

DBUA ( Step 8 of 9 )

The DBUA will start the upgrade process of orcl database. It will perform pre-upgrade, database upgrade and post upgrade steps.

 

DBUA Step 8a

 

DBUA will perform the upgrade of database components like Oracle server, XML etc.

 

DBUA Step 8b

 

DBUA ( Step 9 of 9 )

The final screen will show the result of upgrade.

DBUA Step 9a

 

It will show the log file location and the time taken by various steps of upgrade.

DBUA Step 9b

 

Post Upgrade

Execute dbupgdiag.sql script to verify status of objects and components. If there are invalid objects then run utlrp.sql to recompile the invalid objects as follows:

sql> connect / as sysdba

sql> @?/rdbms/admin/utlrp.sql