How An Oracle Database 12c Upgrade Works in A Multitenant Environment
How An Oracle Database 12c Upgrade Works in A Multitenant Environment
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment
Introduction & Overview
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment 2
Joe Errede from Boston Mass.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment 3
Introduction & Overview
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment 4
Upgrade SQL Automation
Generates postupgrade_fixups.sql
Executed in target home after the upgrade
• catctl.pl
script1.sql script2.sql script3.sql
• Runs database upgrade in parallel
• Up to 40% faster upgrade script4.sql script7.sql script9.sql
– Telco billing
script6.sql script11.sql
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment 9
One Interface Used By All
catctl.pl
catctl.pl catcon.pl
sqlpatch.pl
• In 12.1.0.2.0 we broke out catctl.pl into a
common shared library called catcon.pm
• catcon.pm is used in upgrade, datapatch
and with catcon.pl catcon.pm
• catctl.pl calls packages within
catcon.pm to perform the upgrade.
• catctl.pl works with DBUA, MASS, RAC
and STANDBY upgrades.
DATABASE
catctl.pl CATCTL.PL
• Upgrade the CDB$ROOT first
• EXIT if there is any error in the upgrade and
abort the upgrade UPGRADE EXIT IF
• Upgrade the PDB’s next CDB$ROOT ERROR
UPGRADE UPGRADE
PDB1 PDB2
MAIN PROCESS
catctl.pl CATCTL.PL
• Each PDB upgrade is run as a child catctl.pl process
• Each child process is started by the main catctl
process
• Each child process run independently from main
CHILD CHILD
process PROCESS 1 PROCESS 2
• The main process waits for child processes to CATCTL.PL CATCTL.PL
complete
• The main process dispatches more child processes if
more PDB’s are in need of upgrading
• Upgrade processing is ordered by con_id’s
PDB1 PDB2
• Parallel processing is controlled by -N SQL PROC 1 SQL PROC 3 SQL PROC 5 SQL PROC N
parameter SQL PROC 2 SQL PROC 4 SQL PROC 6 SQL PROC N+1
• -N tells catctl .pl how many SQL processes are
used to upgrade the PDB database dictionary
• -N defaults to 2 for example:
– cpu_count equal to 24 equates to 12 -N PDB1 PDB2 PDB3 TO PDBn
pdb upgrades. Each pdb upgrade runs
2 SQL processes.
• Maximum value is 8 minimum value is 1
catctl.pl CATCON.PM
CATCON.PM
catctl.pl catconInit: base for log and spool file names
= catupgrd
• Catcon.pm debugging. running catconInit(User = 0,
InternalUser = ,
– Catctl.pl -z catupgrd.sql SrcDir = 0,
• Catctl.pl tracing. This is done using perl to generate LogDir = 0,
trace files. Trace files are generated in the format LogBase = catupgrd,
catctl_YYYYMMDDHHMNSC_pid_trace.log CATCTL.PL
– Catctl.pl –Z 1 catupgrd.sql Package catctl.pl.
269: my @gArgs;
– All code is log along with entry and exit 270: foreach $argnum (0 .. $#ARGV)
function values. 271: {
272: push (@gArgs, $ARGV[$argnum]);
• By default catctl.pl will generate a stack trace 272: push (@gArgs, $ARGV[$argnum]);
should some catastrophic event occurs.
272: push (@gArgs, $ARGV[$argnum]);
catctl.pl o -l /tmp
o All log files will be placed in the /tmp directory.
• -l directory to use for spool log files o -I orcl
o All log files will be created with a prefix of
• -i identifier to use when creating catupgrdorcl
spool log files
o -d $ORACLE_HOME/rdbms/admin
• -d directory containing the files to o Tells catctl.pl where the upgrade files live.
be run
o -x
• -x Postpone running the post o Not advised postpones post upgrade
upgrade procedure procedures (datapatch and catuppst.sql).
o Must be done manually after upgrade the
completes.
catctl.pl
RUN UPGRADE
• Advantages to default behavior RESTART IN NORMAL MODE CDB$ROOT
– As PDB’s become available they can be
brought online while other PDB’s are still RUN POST UPGRADE
being upgraded
• Disadvantages to default behavior
– More background processes are running
while upgrade is in progress RUN UPGRADE
– Online PDB’s will experience slow down RESTART IN NORMAL RESTRICTED MODE
while other PDB’s are being upgraded PDB1 PDB2
RUN POST UPGRADE
– Upgrades of the PDB’s tend to be slower
SHUTDOWN
catctl.pl
• Can I have a show of hands on which
method you prefer?
• Upgrade Mode (“Total Time”)
– Faster upgrades but waiting until all the
upgrades have completed before you
can bring online
• Normal Mode (“Fast First”)
– Slower upgrades but able to bring your
PDB online as soon as the PDB upgrade
completes
catctl.pl
• Upgraded 252 Pdb’s + CDB$ROOT+ PDB$SEED
• Linux Machine with 12 cores (Hyperthreading turn
on for 24 CPUs)
• 20 Gig Redo Log size with autoextend turn on
• 30 Gig sga_target
• Defaults were used when running catctl.pl
– 24/2 = 12 PDBS upgraded at a time
– 2 Sql processes per PDB
– Upgrade Mode Verses Normal Mode
• Upgrade mode was twice as fast
catctl.pl
• Upgraded 25 Pdb’s + CDB$ROOT+ PDB$SEED
• Linux Exadata machine V1 with 2 physical CPU’s
(8 Hyperthreading cores)
• 20 Gig Redo Log size
• catctl.pl –n 18
– 18/2 = 9 PDBS upgraded at a time gave best
performance
– 2 Sql processes per PDB
– Upgrade Mode Verses Normal Mode
• Upgrade Mode 3-5% faster
catctl.pl
• The more PDB’s you have the better performance
you will get from upgrade mode (catctl –M)
• Different machines perform better with different
parameters
• Before you upgrade see what works best for your
system
– catctl.pl –n –N –M
• In most cases just taking the defaults maybe good
enough
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database
Upgrade, Upgrade
Migrate works intoa Oracle
& Consolidate Multitenant Environment
Database 12c |• 29
Demo Booth Presence
• Discuss your upgrade at our demo booth
–Moscone South – SD-183
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database
Upgrade, Upgrade
Migrate works intoa Oracle
& Consolidate Multitenant Environment
Database 12c |• 30
Recommended Upgrade Related Talks September 28 –
October 2, 2014
San Francisco
• Oracle Database 12c Upgrade: Tools and Best Practices from Oracle Support
– Tuesday, Sep 30, 5:00 PM - Moscone South - 310
• How and Why to Migrate from Schema Consolidation to Pluggable Databases
– Wednesday, Oct 1, 11:30 AM - Moscone South – 306
• Trouble Free Upgrade to Oracle Database 12c with Oracle Real Application Testing
– Wednesday, Oct 1, 2:00 PM - Moscone South – 303
• Database Patching Best Practices II CON7748
– Wednesday, Oct 1, 5:00 PM - Moscone South 104
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database
Upgrade, Upgrade
Migrate works intoa Oracle
& Consolidate Multitenant Environment
Database 12c |• 31
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How Database Upgrade works in a Multitenant Environment 32