You are on page 1of 31

Upgrade / Migrate / Consolidate

to Oracle Database 19c

Mike Dietrich
Master Product Manager
Database Upgrade and Migrations
Oracle Corporation
Updated: 22-MAY-2019

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades
a n y
G e rm

Mike Dietrich https://MikeDietrichDE.com


Master Product Manager
Oracle Database Upgrade and Migrations MikeDietrichDE

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 2
Slides and more | https://MikeDietrichDE.com

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 3
Fallback Strategies

Photo by Hermes Rivera on Unsplash


Live in Action

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 4
Considerations

Photo by asoggetti on Unsplash


Fallback Introduction

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 5
Considerations
• Service Level Agreements • COMPATIBLE Change?

COMPATIBLE
?

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 6
Fallback Strategy | COMPATIBLE
• Recommendation:
COMPATIBLE
?
– Update COMPATIBLE 7-10 days after upgrade
• Why wait?
– Allows fallback options: downgrade, flashback
• Why change?
– Enable new features (e.g. online datafile move, sharding etc)
– Minimum COMPATIBLE for 19c is 11.0.0
– COMPATIBLE is independent of OPTIMIZER_FEATURES_ENABLE
• How?
n
– alter system set compatible='19.0.0' scope=spfile; D ow
T im e

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 7
Fallback Strategy | COMPATIBLE
• When should you change COMPATIBLE?
– 7-10 days after the upgrade
• Change COMPATIBLE for RUs?
– NEVER!
• Which value?
– 11.2.0
– 12.1.0
– 12.2.0
– 18.0.0
– 19.0.0

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 8
Fallback Strategy | COMPATIBLE
• When should you change COMPATIBLE? • Change COMPATIBLE when you apply RUs?
– https://mikedietrichde.com/2019/04/17/when – https://mikedietrichde.com/2019/04/10/should-
-and-how-should-you-change-compatible/ you-change-compatible-when-you-apply-an-ru/

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 9
Fallback Strategy | Install and Patching
Update in Place Clone, Update and Switch Deploy Gold Image, Switch

1 2 3 1 2 3 1 2
• Complex • Complex • Build gold image once,
• Error prone • Shorter down-time and use everywhere
• Longest down-time and maintenance window • Fewest steps, simplest
maintenance window • Built-in Fallback process
• No fallback • No standardization • Shorter down-time and
maintenance window
• No standardization
• Built-in Fallback
• Built-in standardization

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 10
Database Upgrade Blog | Fallback Exercises
• https://MikeDietrichDE.com/hands-on-lab/hol-18c-fallback-strategies/

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 11
Protection
• Issues during upgrade • Issues after upgrade

During Upgrade After Upgrade

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 12
Fallback Strategy | Issues during upgrade During Upgrade

• Online Backup • Partial Offline Backup • Guaranteed Restore Point


– Solution: – Solution: – Solution:
• Restore online backup • Restore partial offline Backup • Flashback to GRP
– Recommendation: – Recommendation: – Recommendation:
• Mandatory strategy • Only for VLDBs and • Very fast, simply - but EE only
databases in NOARCHIVELOG
mode
• For Standard Edition DBs

COMPATIBLE COMPATIBLE COMPATIBLE

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 13
Fallback | Online Backup
• Strategy: Restore a backup and recover
– Complete online backup (RMAN)
– Please verify:
• Where is your backup located? Tapes, HD, off site...
• Does the restore work?
• How long will the restore take?
• How long will the recovery take?
– Recommendation:
• Have a valid online backup in any case
– Test the restore/recovery!!!

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 14
Fallback | Offline Backup
• Restore a partial offline backup

TOOLS TOOLS
SYSTEM SYSTEM
SHUTDOWN IMMEDIATE
XDB USERS ----- XDB
ReadCOPY
Only ALL FILES
SYSAUX SYSAUX
DRSYS DATA DRSYS
Read Only

UNDO ODM UNDO ODM


SHUTDOWN IMMEDIATE
-----
CONTROL COPY ALL FILES CONTROL
FILES REDO FILES REDO
REDO REDO
REDO
REDO REDO

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 15
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fallback | Guaranteed Restore Point
• COMPATIBLE must not be changed
Pre Upgrade Environment Post Upgrade Environment
CREATE RESTORE POINT grpt
GUARANTEE FLASHBACK DATABASE;
UPGRADE
SHUTDOWN IMMEDIATE
STARTUP MOUNT;
FLASHBACK DATABASE TO RESTORE POINT grpt;
SHUTDOWN IMMEDIATE
STARTUP MOUNT;
ALTER DATABASE OPEN RESETLOGS;
DROP RESTORE POINT grpt;

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fallback Strategy | Issues after upgrade After Upgrade

• Data Pump • Oracle GoldenGate • Downgrade


– Solution: – Solution: – COMPATIBLE change: No
• Reimport data • Apply changes to previous – Solution:
system
– Recommendation: • Run the downgrade scripts
• Simple but potentially slow – Recommendation:
– Recommendation:
• Fastest and best solution
• Fast and easy

COMPATIBLE COMPATIBLE
COMPATIBLE

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 19
Fallback | Data Pump
• Downgrade with expdp/impdp
• MOS Note:553337.1
– Prepare an empty database for the import “just in case”
– Then:
– Run expdp from the 19c database home with the VERSION parameter equal to the target database
COMPATIBLE setting
– Import using impdp from the target
database home
– NETWORK_LINK can be used
for downgrades as well
– Beware of Time Zone differences
• Time zone can't be downgraded!

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 20
Fallback | Data Pump

11.2.0.4 19c
impdp expdp …
VERSION=11.2.0.4

DUMP FILE DUMP FILE

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 21
Fallback | GoldenGate
• Downgrade with Oracle GoldenGate
– Version/platform independent

Source
Upgraded
2 destination
database

“Downgrade”
1

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 22
Fallback | Database Downgrade
• Downgrade with catdwgrd.sql
• Resources:
– Upgrade Guide – Downgrading a database to an earlier release:
https://docs.oracle.com/en/database/oracle/oracle-database/18/upgrd/downgrading-oracle-db-after-
upgrade.html
– MOS Notes about downgrade:
• Oracle DB 18c - How to Downgrade a 18c Non CDB Database to Previous Release (Doc ID 2416661.1)
• Oracle 18c - How to Downgrade a Single Pluggable Oracle Database ( PDB ) from 18c Database to
previous release (Doc ID 2421060.1)

• Downgrade possible to:


• Oracle 11.2.0.4 and up (for non-CDB) and Oracle 12.1.0.2 and up (CDB/PDB)

• Do not change COMPATIBLE


Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 23
Fallback | Database Downgrade
• Basic steps to downgrade with catdwgrd.sql
– In Oracle Database 19c environment:
SQL> SPOOL /tmp/downgrade.log
SQL> STARTUP DOWNGRADE
SQL> @catdwgrd.sql
SQL> SHUTDOWN IMMEDIATE
SQL> SPOOL OFF

– In Oracle Database 11.2.0.4 - 18c environment:


SQL> STARTUP UPGRADE
SQL> SPOOL /tmp/reload.log
SQL> @catrelod.sql
SQL> SPOOL OFF

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 24
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Fallback | Grid Infrastructure Downgrade
• For details see:
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwlin/downgrading-oracle-grid-infrastructure-
using-oui.html#GUID-2ED50A65-202C-48FA-9BAF-8E84ECEBCC58

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 26
Fallback is important
Never approach an upgrade or migration
without testing your fallback options!

Photo by Asa Rodger on Unsplash


Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades
Slides and more | https://MikeDietrichDE.com

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 28
More Information | www.oracle.com/goto/upgrade

Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 29
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Fallback Strategies for Database Upgrades 30

You might also like