Upgrade Scenarios for Non-CDB Oracle Databases
Review these topics to understand the upgrade scenarios and procedures for non-CDB Oracle Databases
Note:
Starting with Oracle Database 12c, release 1 (12.1), non-CDB architecture is deprecated. It can be desupported in a future release. Oracle Database deployed with the multitenant architecture is the default configuration option. All Oracle Database releases earlier than Oracle Database 12c release 1 (12.1.0.1) use non-CDB architecture.
Caution:
You cannot downgrade a database after you have set the compatible initialization parameter to 12.1.0.2. A pluggable database (PDB) downgrade is possible only if the compatibility is set to 12.1.0.1. There can be additional restrictions on downgrading.
Before starting an upgrade or a downgrade, Oracle strongly recommends that you upgrade your source and target databases to the most recent Quarterly Release Update (Update), Release Update Revision (Revision), bundle patch, or patch set update (BP or PSU).
- About Upgrading Non-CDB Oracle Databases
You can upgrade non-CDB Oracle Databases using either Oracle Database Upgrade Assistant (DBUA), or using a manual upgrade procedure. - Manually Upgrading Non-CDB Architecture Oracle Databases
This procedure provides steps for upgrading non-CDB architecture Oracle Databases. - Upgrading a Non-CDB Oracle Database To a PDB on a CDB
Use this procedure to upgrade an earlier release non-CDB architecture Oracle Database, making it a Pluggable Database (PDB) and plugging the PDB into a container database (CDB). - Upgrading Oracle Database Using Fleet Patching and Provisioning
In Oracle Database 12c release 2 (12.2) and later releases, you can use Fleet Patching and Provisioning to upgrade an earlier release Oracle Database. - Variables for Using ORADIM When Upgrading Oracle Database on Windows
Review these variables if you want to use the ORADIM utility for upgrading Oracle Database on Windows systems.
Parent topic: Upgrading Oracle Database
About Upgrading Non-CDB Oracle Databases
You can upgrade non-CDB Oracle Databases using either Oracle Database Upgrade Assistant (DBUA), or using a manual upgrade procedure.
A non-CDB architecture Oracle Database cannot use the multitenant architecture, and does not contain pluggable databases (PDBs). You can upgrade the database either by using Oracle Database Upgrade Assistant (DBUA), or by performing a manual upgrade.
Manually Upgrading Non-CDB Architecture Oracle Databases
This procedure provides steps for upgrading non-CDB architecture Oracle Databases.
Note:
Starting with Oracle Database 12c Release 1 (12.1), non-CDB architecture is deprecated. It can be desupported in a future release.
Before using this procedure, complete the following steps:
-
Install the Oracle Database software
-
Prepare the new Oracle home
-
Run the Pre-Upgrade Information Tool
Steps:
-
If you have not done so, run the Pre-Upgrade Information Tool. Review the Pre-Upgrade Information Tool output and correct all issues noted in the output before proceeding.
For example, on Linux or Unix systems:
$ORACLE_HOME/jdk/bin/java -jar /opt/oracle/product/19.0.0/rdbms/admin/preupgrade.jar FILE TEXT
-
Ensure that you have a proper backup strategy in place.
-
If you have not done so, prepare the new Oracle home.
-
(Conditional) For Oracle RAC environments only, enter the following commands to set the initialization parameter value for CLUSTER_DATABASE to FALSE:
ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=SPFILE;
-
Shut down the database. For example:
SQL> SHUTDOWN IMMEDIATE
-
If your operating system is Windows, then complete the following steps:
-
Stop the
OracleServiceSID
Oracle service of the database you are upgrading, whereSID
is the instance name. For example, if yourSID
isORCL
, then enter the following at a command prompt:C:\> NET STOP OracleServiceORCL
-
Delete the Oracle service at a command prompt using
ORADIM
. Refer to your platform guide for a complete list of theORADIM
syntax and commands.For example, if your
SID
isORCL
, then enter the following command.C:\> ORADIM -DELETE -SID ORCL
-
Create the service for the new release Oracle Database at a command prompt using the
ORADIM
command of the new Oracle Database release.Use the following syntax, where
SID
is your database SID,PASSWORD
is your system password,USERS
is the value you want to set for maximum number of users, andORACLE_HOME
is your Oracle home:C:\> ORADIM -NEW -SID SID -SYSPWD PASSWORD -MAXUSERS USERS -STARTMODE AUTO -PFILE ORACLE_HOME\DATABASE\INITSID.ORA
Most Oracle Database services log on to the system using the privileges of the Oracle software installation owner. The service runs with the privileges of this user. The
ORADIM
command prompts you to provide the password to this user account. You can specify other options usingORADIM
.In the following example, if your
SID
isORCL
, yourpassword
(SYSPWD
) isTWxy5791
, the maximum number of users (MAXUSERS
) is 10, and the Oracle home path isC:\ORACLE\PRODUCT\19.0.0\DB
, then enter the following command:C:\> ORADIM -NEW -SID ORCL -SYSPWD TWxy5791 -MAXUSERS 10 -STARTMODE AUTO -PFILE C:\ORACLE\PRODUCT\19.0.0\DB\DATABASE\INITORCL.ORA
ORADIM
writes a log file to theORACLE_HOME\database
directory.Note:
If you use an Oracle Home User account to own the Oracle home, then the ORADIM command prompts you for that user name and password.
-
-
If your operating system is Linux or UNIX, then perform the following checks:
-
Your
ORACLE_SID
is set correctly -
The
oratab
file points to the new Oracle home -
The following environment variables point to the new Oracle Database directories:
-
ORACLE_HOME
-
PATH
-
-
Any scripts that clients use to set the
$ORACLE_HOME
environment variable must point to the new Oracle home.
Note:
If you are upgrading an Oracle Real Application Clusters database, then perform these checks on all Oracle Grid Infrastructure nodes where the Oracle Real Application Clusters database has instances configured.
-
-
Log in to the system as the Oracle installation owner for the new Oracle Database release.
-
Start SQL*Plus in the new Oracle home from the admin directory in the new Oracle home directory.
For example:
$ cd $ORACLE_HOME/rdbms/admin $ pwd /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin $ sqlplus
-
Copy the SPFILE.ORA or INIT.ORA file from the old Oracle home to the new Oracle home.
-
Connect to the database that you want to upgrade using an account with SYSDBA privileges:
SQL> connect / as sysdba
-
Start the non-CDB Oracle Database in upgrade mode:
SQL> startup upgrade
If errors appear listing desupported initialization parameters, then make a note of the desupported initialization parameters and continue with the upgrade. Remove the desupported initialization parameters the next time you shut down the database.
Note:
Starting up the database in
UPGRADE
mode enables you to open a database based on an earlier Oracle Database release. It also restricts log-ins toAS SYSDBA
sessions, disables system triggers, and performs additional operations that prepare the environment for the upgrade. -
Exit SQL*Plus.
For example:
SQL> EXIT
-
Run the Parallel Upgrade Utility (
catctl.pl
) script, using the upgrade options that you require for your upgrade.You can run the Parallel Upgrade Utility as a command-line shell command by using the
dbupgrade
shell command, which is located inOracle_home/bin
. If you set the PATH environment variable to includeOracle_home/bin
, then you can run the command directly from your command line. For example:$ dbupgrade -d /u01/app/oracle/19.1.0/dbhome_1
Note:
-
When you run the Parallel Upgrade Utility command, use the
-d
option to specify the filepath for the target Oracle home. Use the-l
option to specify the directory that you want to use for spool log files.
-
-
The database is shut down after a successful upgrade. Restart the instance so that you reinitialize the system parameters for normal operation. For example:
SQL> STARTUP
This restart, following the database shutdown, flushes all caches, clears buffers, and performs other housekeeping activities. These measures are an important final step to ensure the integrity and consistency of the upgraded Oracle Database software.
Note:
If you encountered a message listing desupported initialization parameters when you started the database, then remove the desupported initialization parameters from the parameter file before restarting it. If necessary, convert the
SPFILE
to aPFILE
, so that you can edit the file to delete parameters. -
Run
catcon.pl
to startutlrp.sql
, and to recompile any remaining invalid objects.For example:
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
Because you run the command using
-b utlrp
, the log fileutlrp0.log
is generated as the script is run. The log file provides results of the recompile. -
Run
postupgrade_fixups.sql
. For example:SQL> @postupgrade_fixups.sql
Note:
If you did not specify to place the script in a different location, then it is in the default path
Oracle_base/cfgtoollogs/SID/preupgrade
, whereOracle_base
is your Oracle base home path, andSID
is your unique database name. -
Run
utlusts.sql
. The script verifies that all issues are fixed.For example:
SQL> @$ORACLE_HOME/rdbms/admin/utlusts.sql
The log file
utlrp0.log
is generated as the script is run, which provides the upgrade results. You can also review the upgrade report inupg_summary.log
.To see information about the state of the database, run
utlusts.sql
as many times as you want, at any time after the upgrade is completed. If theutlusts.sql
script returns errors, or shows components that do not have the statusVALID
, or if the version listed for the component is not the most recent release, then refer to the troubleshooting section in this guide. -
Ensure that the time zone data files are current by using the
DBMS_DST PL/SQL
package to upgrade the time zone file. You can also adjust the time zone data files after the upgrade. -
Exit from SQL*Plus
For example:
SQL> EXIT
-
(Conditional) If you are upgrading an Oracle Real Application Clusters database, then use the following command syntax to upgrade the database configuration in Oracle Clusterware:
srvctl upgrade database -db db-unique-name -oraclehome oraclehome
In this syntax example,
db-unique-name
is the database name (not the instance name), andoraclehome
is the Oracle home location in which the database is being upgraded. TheSRVCTL
utility supports long GNU-style options, in addition to short command-line interface (CLI) options used in earlier releases. -
(Conditional) For Oracle RAC environments only, after you have upgraded all nodes, enter the following commands to set the initialization parameter value for CLUSTER_DATABASE to TRUE, and start the database, where
db_unique_name
is the name of the Oracle RAC database:ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=SPFILE; srvctl start database -db db_unique_name
Your database is now upgraded. You are ready to complete post-upgrade procedures.
Caution:
If you retain the old Oracle software, then never start the upgraded database with the old software. Only start Oracle Database using the start command in the new Oracle Database home.
Before you remove the old Oracle environment, relocate any data files in that environment to the new Oracle Database environment.
See Also:
Oracle Database Administrator’s Guide for information about relocating data files
Parent topic: Upgrade Scenarios for Non-CDB Oracle Databases
Upgrading a Non-CDB Oracle Database To a PDB on a CDB
Use this procedure to upgrade an earlier release non-CDB architecture Oracle Database, making it a Pluggable Database (PDB) and plugging the PDB into a container database (CDB).
You can upgrade earlier releases of Oracle Database using either DBUA or the Parallel Upgrade Utility, and then make the upgraded database a Pluggable Database (PDB). You can then plug the upgraded database into a multitenant container database (CDB).
The following procedure assumes the following conditions:
-
You have completed all pre-upgrade procedures described in Oracle Database documentation for your operating system.
-
The earlier database and the upgraded database are located on the same system.
-
The data files remain in the same location before and after upgrade.
If the data files have been copied to a different location (for example, stored with Oracle ASM), then you must specify the parameter
SOURCE_FILE_NAME_CONVERT
in step 8.
-
Install the new Oracle Database 19c software.
-
Upgrade the database as described in this guide.
-
Set the COMPATIBLE parameter to 19.0.0, if you have not already done so as part of the upgrade process.
-
Use the following SQL command to ensure that the database is in read-only mode:
SQL> startup mount SQL> alter database open read only;
-
Ensure that the prerequisites for plugging an unplugged PDB are met.
-
Create the XML file for the PDB. The root name for the XML file matches the name of the PDB. In the following syntax example, the value for path is the location where the XML is saved, and myPDB.xml is the name of the pluggable database file. You can choose where you want to place the file.
SQL> exec DBMS_PDB.DESCRIBE('path/myPDB.xml');
For example, where path is
/home/oracle
, and myPDB issalespdb
:SQL> exec DBMS_PDB.DESCRIBE('/home/oracle/salespdb.xml');
-
Use the following command to shut down the database in the old (source) Oracle home:
SQL> SHUTDOWN IMMEDIATE
-
Change directory to the new Oracle home, and run the DBMS_PDB.CHECK_PLUG_COMPATIBILITY function.
When you run the function, set the following parameters:
-
pdb_descr_file
Set this parameter to the full path to the XML file. -
pdb_name
Specify the name of the new PDB. If this parameter is omitted, then the PDB name in the XML file is used.
For example, to determine if a PDB described by the file
/disk1/usr/salespdb.xml
is compatible with the current CDB, run the following PL/SQL block from the new Oracle home:sqlplus / as sysdba SQL> set serveroutput on SQL> r 1 DECLARE 2 compatible CONSTANT VARCHAR2(3) := 3 CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( 4 pdb_descr_file => '/home/oracle/ORAOP2.xml', 5 pdb_name => 'SALESPDB') 6 WHEN TRUE THEN 'YES' 7 ELSE 'NO' 8 END; 9 BEGIN 10 DBMS_OUTPUT.PUT_LINE(compatible); 11* END; YES PL/SQL procedure successfully completed.
If the output is YES, then the PDB is compatible, and you can continue with the next step.
If the output is NO, then the PDB is not compatible, and you can check the PDB_PLUG_IN_VIOLATIONS view to see why it is not compatible.
-
-
Use the following command syntax to create the pluggable database, and to plug the database into the CDB:
SQL> CREATE PLUGGABLE DATABASE SALESPDB USING 'pathmyPDB.xml' NOCOPY TEMPFILE REUSE;
The following example shows the command to create the pluggable database
salespdb
:SQL> CREATE PLUGGABLE DATABASE salespdb USING '/home/oracle/salespdb.xml' NOCOPY TEMPFILE REUSE;
You can use any name for your PDB, but the name you use must be unique within this CDB.
TEMPFILE REUSE
specifies that the existingTEMP
tablespaces can be reused.When this SQL command completes, the following message should appear:
Pluggable database created.
The upgraded database is now a PDB, and it is ready for you to place in a CDB.
Caution:
Oracle strongly recommends that you have a valid backup in place before you use the NOCOPY option. If this command fails, for whatever reason, then your database can become damaged and unrecoverable.
-
Connect to the PDB using the following command:
SQL> ALTER SESSION set container=salespdb;
-
Convert the dictionary to the PDB type. From the
admin
directory, run thenoncdb_to_pdb.sql
script. You must run this script before you can open the PDB for the first time.For example:
@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
Note:
Be aware that the runtime of this script can vary from several minutes to over an hour, depending on the number and type of objects in the new PDB dictionary that must be converted.
-
Start up and open the new PDB in read/write mode. You must open the new PDB in read/write mode for Oracle Database to complete the integration of the new PDB into the CDB.
For example, because you have already set the PDB container to
salespdb
, enter the following command to start the PDB:SQL> STARTUP
-
Back up the PDB with RMAN (Recovery Manager).
Oracle strongly recommends that you perform a backup of the PDB using RMAN, because you can no longer use the ARCHIVELOG and backups that you took from the database before converting it to a PDB.
Caution:
You must perform an immediate backup to ensure recoverability.
Upgrading Oracle Database Using Fleet Patching and Provisioning
In Oracle Database 12c release 2 (12.2) and later releases, you can use Fleet Patching and Provisioning to upgrade an earlier release Oracle Database.
You upgrade a database with Fleet Patching and Provisioning by creating a copy of the new Oracle Database release, and using the command rhpctl upgrade database
to upgrade the earlier release Oracle Database. The upgrade is an out-of-place upgrade. After the upgrade is complete, listeners and other initialization variables are set to point to the new Oracle home. Refer to Oracle Clusterware Administration and Deployment Guide for more information about how to create Fleet Patching and Provisioning images.
Use this overview of the steps to understand how to upgrade an Oracle Database 11g release 2 (11.2.0.3) by using Rapid Home Provisioning:
-
Install a new Oracle Database release.
-
Patch, test, and configure the database to your specifications for a standard operating environment (SOE).
-
Create a Fleet Patching and Provisioning Gold Image from the SOE release Oracle Database home.
-
Complete an upgrade to a new Oracle Grid Infrastructure release on the servers where the databases you want to upgrade are located. You can complete this upgrade by using Fleet Patching and Provisioning. (Note: Your Oracle Grid Infrastraucture software must always be the same or a more recent release than Oracle Database software.)
-
Deploy a copy of the new release Oracle Database Fleet Patching and Provisioning gold image to the servers with earlier release Oracle Databases that you want to upgrade.
-
Run the Fleet Patching and Provisioning command
rhpctl upgrade database
. This command use the new release Fleet Patching and Provisioning gold image to upgrade the earlier release databases. You can upgrade one, many or all of the earlier release Oracle Database instances on the servers provisioned with the new release Oracle Database gold image.
Related Topics
Parent topic: Upgrade Scenarios for Non-CDB Oracle Databases
Variables for Using ORADIM When Upgrading Oracle Database on Windows
Review these variables if you want to use the ORADIM utility for upgrading Oracle Database on Windows systems.
On Windows platforms, ORADIM
provides a command-line interface to manually perform administrative tasks for Windows databases and services. Database Configuration Assistant (DBCA) provides a graphical user interface to perform the same tasks. The variables for ORADIM that you must know about when upgrading Oracle Database include the SID of the database you are upgrading, the new Oracle home location, and the password for the new database instance. Also, ORADIM
writes a log file to the ORACLE_HOME\database
directory.
The following table describes the variables for using ORADIM
when upgrading:
Table 4-3 ORADIM Variables and Functions
ORADIM Variable | Description |
---|---|
SID | The same SID name as the SID for the database that you are upgrading |
PASSWORD |
The password for the new Oracle Database 12c database instance. This is the password for the user connected with The default Oracle Database 12c security settings require that passwords must be at least eight characters. You are not permitted to use passwords such as |
USERS |
The password for the new Oracle Database 12c database instance. This is the password for the user connected with The default Oracle Database 12c security settings require that passwords must be at least eight characters. You are not permitted to use passwords such as |
ORACLE_HOME |
The Oracle home location for Oracle Database 12c. Ensure that you specify the full path name with the |
See Also:
Oracle Database Platform Guide for Microsoft Windows for complete information about using ORADIM to administer a database instance
Oracle Database Security Guide for more information about security settings.
Oracle Database Administrator’s Guide for information about specifying initialization parameters at startup and the initialization parameter file
Parent topic: Upgrade Scenarios for Non-CDB Oracle Databases