Oracle® Database: Unplugging, Plugging, and Upgrading A PDB Toanewcdb
Oracle® Database: Unplugging, Plugging, and Upgrading A PDB Toanewcdb
19c
F10901-02
May 2019
Oracle Database Unplugging, Plugging, and Upgrading a PDB to a New CDB, 19c
F10901-02
Copyright © 2018, 2019, Oracle and/or its affiliates. All rights reserved.
Contributing Authors: Lance Ashdown, Padmaja Potineni, Rajesh Bhatiya, Prakash Jashnani, Douglas
Williams, Mark Bauer
Contributors: Roy Swonger, Byron Motta, Hector Vieyra Farfan, Carol Tagliaferri, Mike Dietrich, Marcus
Doeringer, Umesh Aswathnarayana Rao, Rae Burns, Subrahmanyam Kodavaluru, Cindy Lim, Amar Mbaye,
Akash Pathak, Thomas Zhang, Zhihai Zhang
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify,
license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means.
Reverse engineering, disassembly, or decompilation of this software, unless required by law for
interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on
behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are
"commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-
specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the
programs, including any operating system, integrated software, any programs installed on the hardware,
and/or documentation, shall be subject to license terms and license restrictions applicable to the programs.
No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications.
It is not developed or intended for use in any inherently dangerous applications, including applications that
may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you
shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its
safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this
software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron,
the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro
Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise
set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be
responsible for any loss, costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth in an applicable agreement between you and Oracle.
Contents
Preface
Use Case Scenario for this Document iv
Documentation Accessibility iv
iii
Preface
Preface
This guide provides a compilation of topics from the Oracle Database user assistance
documentation that are collected to help you complete a specific use case scenario.
• Use Case Scenario for this Document
• Documentation Accessibility
Documentation Accessibility
iv
Preface
v
1
Upgrading Multitenant Architecture
Sequentially Using Unplug-Plug
To upgrade pluggable databases (PDBs) that are in an earlier release multitenant
container databases (CDBs), Oracle Database Release 12c (12.1.0.1) and later, you
can unplug the PDBs from the earlier release CDB, and plug the PDBs into the later
release CDB.
• About Upgrading Pluggable Databases (PDBs) Sequentially
You can upgrade PDBs by unplugging a PDB from an earlier release CDB,
plugging it into a later release CDB, and then upgrading that PDB to the later
release.
1-1
Chapter 1
About Upgrading Pluggable Databases (PDBs) Sequentially
Note:
A PDB cannot be recovered unless it is backed up. After upgrading using the
method of creating a CDB and plugging in a PDB, be sure to back up the
PDB.
Related Topics
• Oracle Database Backup and Recovery User’s Guide
• Oracle Database Administrator’s Guide
1-2
2
Upgrading Pluggable Databases
Sequentially
To upgrade PDBs after upgrading the Container Database (CDB), use the unplug-plug
technique.
• Unplugging the Earlier Release PDB from the Earlier Release CDB
To prepare for upgrading the PDB, use this procedure to unplug the PDB from the
earlier release CDB.
• Plugging in the Earlier Release PDB to the Later Release CDB
To Plug the PDB from the earlier release CDB to the later release CDB, use the
CREATE PLUGGABLE DATABASE command.
• Upgrading the Earlier Release PDB to the Later Release
Open PDBs in UPGRADE mode use the Parallel Upgrade Utility to carry out the
upgrade of the earlier-release PDB to the release level of the CDB.
• Use Inclusion or Exclusion Lists for PDB Upgrades
If you want to upgrade a subset of earlier release PDBs, then use inclusion or
exclusion lists to avoid reupgrading the CDB or PDBs that are at the new release
level.
$ORACLE_HOME_12.2/jdk/bin/java -jar
$ORACLE_HOME_19/rdbms/admin/preupgrade.jar dir /tmp -c salespdb
CONNECT / AS SYSDBA
SQL> ALTER SESSION SET CONTAINER=salespdb;
SQL> @/tmp/preupgrade_fixups_salespdb.sql
2-1
Chapter 2
Plugging in the Earlier Release PDB to the Later Release CDB
For example, use the following command to close the PDB salespdb:
CONNECT / AS SYSDBA
SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;
6. Unplug the earlier release PDB using the following SQL command syntax, where
pdb is the name of the PDB, and path is the location of the PDB XML file:
For example, where the pdb name is salespdb and path is /home/oracle/
salespdb.xml:
SQL> ALTER PLUGGABLE DATABASE salespdb UNPLUG INTO '/home/oracle/salespdb.xml';
Caution:
After you drop the PDB from its original CDB, you cannot revert to it
using previously taken backup, because the DROP command removes
backup files.
8. Exit.
2-2
Chapter 2
Upgrading the Earlier Release PDB to the Later Release
This procedure example shows how to plug in a PDB when you are using Oracle-
Managed Files. Refer to Oracle Database Administrator’s Guide for additional
information about plugging in PDBs.
1. Connect to the later release CDB.
2. Plug in the earlier release PDB using the following SQL command, where pdb is
the name of the PDB, and path is the path where the PDB XML file is located:
CREATE PLUGGABLE DATABASE pdb USING 'path/pdb.xml';
For example:
Note:
When you plug in an earlier release PDB, the PDB is in restricted mode. You
can only open the PDB for upgrade.
Related Topics
• Oracle Database Administrator’s Guide
3. Upgrade the PDB using the Parallel Upgrade Utility command (catctl.pl, or the
shell utility dbupgrade).
When you upgrade a PDB, you use the commands you normally use with the
Parallel Upgrade Utility. However, you also add the option -c PDBname to specify
2-3
Chapter 2
Use Inclusion or Exclusion Lists for PDB Upgrades
which PDB you are upgrading. Capitalize the name of your PDB as shown in the
following example using the PDB named salespdb:
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catctl.pl -d \
$ORACLE_HOME/rdbms/admin -c 'salespdb' -l $ORACLE_BASE catupgrd.sql
4. Review results.
The default file path for the logs is in the path Oracle_base/cfgtoollogs/
dbname/upgradedatetime, where Oracle_base is the Oracle base path,
dbname is the database name, and upgradedatetime is the date and time for the
upgrade. The date and time strings are in the character string format
YYYYMMDDHHMMSC, in which YYYY designates the year, MM designates the
month, DD designates the day, HH designates the hour, MM designates the
minute, and SC designates the second.
For example:
$ORACLE_BASE/cfgtoollogs/salespdb/upgrade20181015120001/upg_summary.log
5. Log in to SQL*Plus, and open the PDB to execute post-upgrade fixups, and to
recompile the INVALID objects in the database:
SQL> STARTUP;
SQL> ALTER SESSION SET CONTAINER=salespdb;
The script recompiles INVALID objects in the database, and places a log file in the
current directory with the name comp0.log.
2-4
Chapter 2
Use Inclusion or Exclusion Lists for PDB Upgrades
when the CDB was created, are part of the new release multitenant architecture. If you
upgraded a CDB, and at the same time upgraded a set of PDBs to the new release,
then you do not need to upgrade either the CDB containers or the upgraded PDBs
again.
In either case, when you plug in earlier release PDBs and then upgrade them, upgrade
the PDBs with either an exclusion list, or an inclusion list:
• Use an inclusion list to specify only the set of PDBs that you want to upgrade.
• Use an exclusion list to exclude the CDB and PDB containers that are already
upgraded.
If you do not use an inclusion list or an exclusion list to limit the upgrade scope, then
the Parallel Upgrade Utility (catctl.pl) attempts to upgrade the entire CDB, not just
the PDBs that require the upgrade. During that upgrade process, your system
undergoes needless downtime. The inclusion list and the exclusion list options are
mutually exclusive.
2-5
Index
E PDBs
upgrading individually, 1-1
exclusion lists
and PDB upgrades, 2-4
T
O troubleshooting
PDB upgrades, 2-4
Oracle Multitenant upgrades, 1-1
P
PDB upgrades after CDB upgrade, 2-4
Index-1