Professional Documents
Culture Documents
Deep Dive Into: Parallel Database Upgrades
Deep Dive Into: Parallel Database Upgrades
Mike Dietrich
Master Product Manager
Database Upgrade
Oracle Corporation
Updated: 8-DEC-2015
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 2
$> whoami
6 years
RDBMS Core & Mission Critical Support
5.5 years
Technology Presales for DataGuard, Upgrades
>7.5 years
Mike Dietrich ST Upgrade Development Team
Master Product Manager
Database Upgrades & Migrations
MikeDietrichDE
50% 50% + x%
Reference Workshops Development
http://blogs.oracle.com/UPGRADE Projects Worldwide Work
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Why you need to upgrade NOW to Oracle Database 3
12c!
Download Slides from the Database Upgrade Blog
http://blogs.oracle.com/UPGRADE
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Why you need to upgrade NOW to Oracle Database 12c! 4
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 5
Upgrade SQL Automation
preupgrd.sql
Executes pre-upgrade checks
Runs in source environment
Generates fixup scripts
Get the newest version:
MOS Note:884522.1
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 6
preupgrd.sql: MOS Note:884522.1
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 7
preupgrd.sql
preupgrd.sql => utluppkg.sql
TEXT
upgrade.xml
preupgrade.log
preupgrade_fixups.sql
postupgrade_fixups.sql
DBUA
$ORACLE_BASE/cfgtoollogs/sid/preupgrade
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 8
40%
Faster Upgrades in
Oracle Database 12c
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 9
Faster Upgrade – Less Downtime
catctl.pl
script1.sql script2.sql script3.sql
Runs database upgrade in parallel
– Only for ORACLE SERVER
script4.sql script7.sql script9.sql
– Telco billing
script6.sql script11.sql
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 10
“The new parallel upgrade script promises to drastically
reduce downtime due to planned maintenance. We saw a
37% improvement over the previous upgrade process in our
environment.”
Harald Stefan
Leiter Datenbanken
Payback GmbH
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 11
Faster Upgrade – Less Downtime
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 12
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 13
Three possible database deployments in Oracle 12c
Stand Alone Single Tenant Multitenant
– Same as in previous releases – No extra license required – Requires Multitenant license
– Possible with SE and EE – Requires Enterprise Edition
PDB$
SEED
PDB1
PDB$
SEED
PDB1 PDB1 ...
DB CDB$ROOT CDB$ROOT
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 14
Why you will have to play with Oracle Single/Multitenant
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 15
Oracle Multitenant – Concepts
PDB$
SEED
PDB1 PDB2 PDB3
CDB1_MUL
PDB$
SEED
PDB1 PDB2
CDB2_MUL
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 16
Oracle Multitenant – Sharing Resources
PDB$
SEED
PDB1 PDB2 PDB3
CDB
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 17
CDB-PDB: Who's who?
Data dictionary and objects
CDB$ROOT
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 18
Why does a PDB require an upgrade?
Each PDB has its own Data Dictionary
– The documentation states:
versus PDB
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 19
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 20
Upgrade: Everything at once vs Unplug/Plug
PDB2 PDB3
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 21
Upgrade: Everything at once
PDB$
SEED
PDB1 PDB2 PDB3 PDB4
preupgrd.sql
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 22
Upgrade: Everything at once – Step by Step – 1/2
Preupgrade.sql: PDB$
SEED
PDB1 PDB2 PDB3 PDB4
Copy new preupgrd.sql and utluppkg.sql preupgrd.sql
preupgrade_fixups.sql
into CBD1's $ORACLE_HOME/rdbms/admin
SQL> ALTER PLUGGABLE DATABASE ALL OPEN; CDB – Oracle 12.1.0.1
$ORACLE_HOME/perl/bin/perl
$ORACLE_HOME/rdbms/admin/catcon.pl -n 1
-d $ORACLE_HOME/rdbms/admin
-l /home/oracle/mike -b preupgrd preupgrd.sql
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 23
preupgrd.sql in Everything at Once
preupgrd.sql runs in every container PDB$
PDB1 PDB2 PDB3 PDB4
– CDB$ROOT SEED
preupgrd.sql
– PDB$SEED
– All PDBs CDB – Oracle 12.1.0.1
Executed with catcon.pl
– catcon.pl –n 1 –e –b preupgrade –d '''.''' preupgrd.sql
Results get logged to preupgrade0.log
Specific changes for each container
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 24
Upgrade: Everything at once – Step by Step – 2/2
In CDB – Oracle 12.1.0.2:
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/mike catupgrd.sql
See $ORACLE_HOME/cfgtoollogs/<SID>/upgrade/upg_summary.log
UPGRADE PDB$ UPGRADE
PDB2 PDB3 PDB4 UPGRADE
PDB1
SQL> STARTUP UPGRADE SEED
UPGRADE
SQL> ALTER PLUGGABLE DATABASE ALL OPEN; postupgrade_fixups.sql
$ORACLE_HOME/perl/bin/perl
$ORACLE_HOME/rdbms/admin/catcon.pl -n 1
UPGRADE Oracle 12.1.0.2 CDB –
-d $ORACLE_HOME/cfgtoollogs/cdbupgr/preupgrade
-l /home/oracle/mike
-b postupgrade_fixups postupgrade_fixups.sql
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 25
Upgrade: One (or many) at a time
PDB$
preupgrd.sql
SEED
PDB1 PDB2 PDB3
PDB1
xml
PDB$
UPGRADE PDB1
SEED
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 26
Upgrade: One (or many) at a time – Step by Step – 1/2
In CDB1:
Copy new preupgrd.sql and utluppkg.sql into preupgrade_fixups.sql
preupgrd.sql
PDB$
PDB1 PDB2 PDB3
SEED
CBD1's $ORACLE_HOME/rdbms/admin
SQL> alter session set container=PDB1;
SQL> @?/rdbms/admin/preupgrd.sql CDB1 – Oracle 12.1.0.1
SQL> @/u01/app/oracle/cfgtoollogs/CDB1/
preupgrade/preupgrade_fixups.sql
SQL> alter sesstion set container=CDB$ROOT; PDB1
SQL> alter pluggable database PDB1 close; xml
SQL> alter pluggable database PDB1 unplug
into '/stage/pdb1.xml';
SQL> exit
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 27
Plugin Compatibility Check
Not always as helpful as intended
– COMPATIBLE NO ?!?
SET SERVEROUTPUT ON
PDB1 DECLARE
compatible CONSTANT VARCHAR2(3) :=
CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
PDB1
pdb_descr_file => '/data/pdb1.xml',
xml pdb_name => PDB1')
WHEN TRUE THEN 'YES' ELSE 'NO'
PDB$ END;
SEED
PDB1
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
CDB END;
/
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 28
Upgrade: One (or many) at a time – Step by Step – 2/2
In CDB2:
In SQL*Plus:
– SQL> alter session set container=CDB$ROOT;
– SQL> create pluggable database PDB1 using
'/stage/pdb1.xml' file_name_convert=(
'/oradata/CDB1/pdb1', '/oradata/CDB2/pdb1');
– SQL> alter pluggable database PDB1 open upgrade; PDB1
– SQL> exit PDB1
On the command prompt: xml
– $> cd $ORACLE_HOME/rdbms/admin
PDB$
– $> $ORACLE_HOME/perl/bin/perl catctl.pl UPGRADE
SEED
PDB1
–c "PDB1" catupgrd.sql
Back in SQL*Plus:
– SQL> alter session set container=PDB1; Oracle 12.1.0.2 CDB2 –
– SQL> startup
– SQL> @/u01/app/oracle/cfgtoollogs/CDB1/preupgrade/postupgrade_fixups.sql
– SQL> @?/rdbms/admin/utlrp.sql
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 29
PDB_PLUG_IN_VIOLATIONS
If you plug in and don't upgrade your PDB can be opened RESTRICTED only
Check PDB_PLUG_IN_VIOLATIONS for required actions
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 30
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 31
Faster Upgrade – Less Downtime
catctl.pl
Performed in phases
Determined at run time by
parsing catctl tags within the SQL files
Each phase builds dependencies for the
next phase
Each phase must complete before moving
onto the next phase
Run in serial or in parallel
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 32
One Interface Used By All
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 33
How Upgrade Works in a Multitenant Database
UPGRADE UPGRADE
PDB1 PDB2
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 34
How Upgrade Works in a Multitenant Database
PDB1 PDB2
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 35
Multiple PDB Upgrade
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 36
Parallel Processing Within PDB Upgrades
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 37
Putting It All Together
CATCTL.PL
catctl.pl –n 8 CATCON.PM
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 38
Default: Switch CDB$ROOT to Normal Mode
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 39
Option: Keep CDB$ROOT in Upgrade Mode
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 40
Logging, Prefixing and Directories
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 41
Logs and Verification
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 42
Example upg_summary.log
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 43
Upgrade Success/Failure?
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 44
Container Inclusion/Exclusion
catctl.pl –c
–
–
Include container
Define order of upgrades
CDB$ROOT
Upgrade
– Example:
-c 'CDB$ROOT PDB$SEED PDB3 PDB2 PDB1'
catctl.pl –C PDB$SEED
Upgrade
PDB3
Upgrade
– Exclude container
– Example:
-C 'PDB7 PDB21'
PDB2
Upgrade
PDB1
Upgrade
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 45
Postpone and Restart Phases
catctl.pl –x
– Postpone datapatch/catuppst.sql
– Not recommended
catctl.pl –p
– Begin phase
catctl.pl –P
End phase
–
Example: -c 'PDB7' –p 68 -P 73
o Upgrade log file identified each phase:
PHASE_TIME___START 68
PHASE_TIME___END 73
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 46
Debugging and Tracing
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 47
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 48
Performance Example 1: Exadata V1 25 PDBs: -n 26
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 49
Performance Example 2: Linux Server 252 PDBs: -n 24
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 50
Performance Example 3: Linux Server 252 PDBs -n 32
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 54
Deep Dive into Parallel Database Upgrades
1 Database Upgrade News
2 Oracle Multitenant Overview
3 Multitenant Upgrade
4 Inside catctl.pl – and Options
5 Performance Figures
6 Wrap Up
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 55
Slides and More
MikeDietrichDE
http://blogs.oracle.com/UPGRADE
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 56
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Deep Dive into Parallel Database Upgrades 57