Yu 12cR2 Upgrade
Yu 12cR2 Upgrade
Oracle databases to
12cR2: tools, methods
and paths
WWW.NEOOUG.ORG/GLOC
Kai Yu
• Technical Staff, Dell EMC Database Engineering
• 25+ years experience in IT Industry
• Specializing in Database, Cloud, Virtualization and IT Infrastructure
• Author and Speaker (150+ sessions)
• IOUG Cloud Computing SIG Co-founder &Vice President
• Oracle ACE Director since 2010,
• OAUG Innovator of Year (2011)
• Oracle Excellence Award-Technologist of the Year: Cloud
Architect by Oracle Magazine (2012)
• My Blog: http://kyuoracleblog.wordpress.com/
Agenda
• Upgrade tools
‒ Database Upgrade Assistance(DBUA)
GUI tool automates the upgrade process
launch during with Oracle installer or as a standalone tool any time later
Work with the direct upgrade path
GUI tool automates the upgrade
‒ Pre-upgrade information tool : 12.2 introduced a java script preupgeade.jar
a single .jar file to replace preupgrd.sql and utluppkg.sql
Invoked from command line:
java -jar /tmp/preupgrade.jar TERMINAL TEXT
script location: $ORACLE_HOME/rdbms/admin/preupgrade.jar
Advised to run this tool to check it the database is ready for upgrade
Output: preupgrade.log, pre-upgrade fixup scripts, post-upgrade fixups in text/XML
The fixup scripts help DBAs to trace, resolve the issues before upgrade.
Can run the fixup scripts many times.
Tools for Oracle Database 12c Upgrade
‒ Pre-upgrade information tool : preupgeade.jar
MOS note: 884522.1: preupgrade_12201_cbuild_003.zip from upgrade from
12.0.1,12.0.2, 11.2.0.3, 11.2.0.4 to 12cR2 (12.2.0.1)
$java –jar $ORACLE_HOME/rdbms/admin/preupgrade.jar TEXT
Show: the current DB status information
Tools for Oracle Database 12c Upgrade
• Recommended Actions:
Tools for Oracle Database 12c Upgrade
‒ Three options:
Non-CDB to PDB
Everything at once
Unplug/Plug
‒ Upgrade and Plugin as PDB
12cR1 non CDB PDB in 12cR2
Steps:
. Start 12cR1 database read-only
. Create XML description file: exec
. Shutdown Database
exec DBMS_PDB.DESCRIBE('PDB1.xml');
. Plugin database :
create pluggable database PDB1
using ('PDB1.xml') nocopy tempfile reuse;
. Sanity Operations:
start ?/rdbms/admin/noncdb_to_pdb.sql
Upgrade Multitenant Database to 12cR2
(Refer to Carol Tagliaferri’s Database Upgrade presentation at Oracle Database 12.2 Beta User Group Test
Event )
Upgrade Multitenant Database to 12cR2
• Everything at Once
• Run preupgrade.jar
Ensure all PDBs are open
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
java –jar $<12.2_ORACLE_HOME>/rdbms/admin/preupgrade.jar TERMINAL TEXT
• Perform pre-upgrade fixups
Repeat the following steps for each PDB:
alter session set container PDB1;
@$ORACLE_BASE/cfgtoollogs/CDB1/preupgrade/preupgrade_fixups_pdb1.sql
• preupgrade.jar runs in every container: CDB$ROOTPDB$SEE, All PDBs
• Results get logged to consolidated preupgrade.log
– $ORACLE_BASE/cfgtoollogs/CDB/preupgrade/preupgrade.log
• Specific changes for each container in preupgrade_<PDB>.log
Upgrade Multitenant Database to 12cR2
In CDB – Oracle 12.2.0.1:
SQL> STARTUP UPGRADE
SQL> ALTER PLUGGABLE DATABASE ALL OPEN UPGRADE;
cd $ORACLE_HOME/rdbms/admin
$ORACLE_HOME/perl/bin/perl catctl.pl -d $ORACLE_HOME/rdbms/admin -n 16 –M -l
/home/oracle/upgrade catupgrd.sql
See $ORACLE_HOME/cfgtoollogs/<SID>/upgrade/upg_summary.log
SQL> STARTUP
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1
-d $ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade
-l /home/oracle/upgrade
-b postupgrade_fixups postupgrade_fixups.sql
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
Upgrade Multitenant Database to 12cR2
Upgrade one at a time:
In CDB1:
Copy new preupgrade.jar into CBD1's
$ORACLE_HOME/rdbms/admin
SQL> alter pluggable database PDB1 open;
java –jar /
$ORACLE_HOME/rdbms/admin/preupgrade.jar TERMINAL TEXT –c PDB1
SQL> alter session set container=PDB1;
SQL> @/u01/app/oracle/cfgtoollogs/CDB1/
preupgrade/preupgrade_fixups_pdb1.sql
SQL> alter sesstion set container=CDB$ROOT;
SQL> alter pluggable database PDB1 close;
SQL> alter pluggable database PDB1 unplug
into '/stage/pdb1.xml';
SQL> exit
Upgrade Multitenant Database to 12cR2
…………………..
Upgrade Oracle RAC Database to 12cR2