Вы находитесь на странице: 1из 53

The new AutoUpgrade

For the Oracle Database

Daniel Overby Hansen


Lead Developer
SimCorp

Mike Dietrich

Photo by Osman Rana on Unsplash


Master Product Manager
Database Upgrades & Migrations
Oracle Corporation

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database
a n y
G e rm

Mike Dietrich https://MikeDietrichDE.com


Master Product Manager
Oracle Database Upgrades and Migrations MikeDietrichDE

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 2
Slides download and other resources
• https://MikeDietrichDE.com/slides

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 3
Upgrade Videos and Presentations
• https://MikeDietrichDE.com/videos

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 4
Yesterday …

Photo by Sashank Saye on Unsplash


Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database
Database Upgrade until 2018
• Command Line: dbupgrade • Graphical Tool: DBUA

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 6
Tomorrow …

Photo by Wayne Lee-Sing on Unsplash


Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database
Auto
Upgrade Demo

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 8
The New AutoUpgrade - Architecture
System Checks
Space Check Requirements

config.cfg
Database Pre-Checks
preupgrade.jar Automatic Fix-Ups
Upgrade
Job Manager
Database Upgrade
Command Line
Upgrade
Dispatcher Database Post-Upgrade
Stats Refresh Time Zone Adjustment /etc/oratab

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 9


What do you need?
• Java 8 or newer
– Default in your $ORACLE_HOME since 12.1.0.2
• Oracle databases to upgrade
– Minimum database version is 11.2.0.4
• The AutoUpgrade package
– A jar file and some libs - 5 MB in size
• ARCHIVELOG mode ON

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 10
What do you need to do?

upg>
Job Console

11.2.0.4

autoupgrade.jar
config.cfg
12.1.0.2
19c

12.2.0.1 / 18c

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 11
What do you don't need?
• Agents
• EM Cloud Control
• Extra license

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 12
Create a configuration file
upg1.dbname=DB12
upg1.start_time=NOW
upg1.source_home=/u01/app/oracle/product/12.1.0.2
upg1.target_home=/u01/app/oracle/product/18.3.0
upg1.sid=DB12
upg1.log_dir=/home/oracle/aux/DB12
upg1.upgrade_node=localhost
upg1.target_version=18.3

upg2.dbname=UPGR
upg2.start_time=NOW
upg2.source_home=/u01/app/oracle/product/11.2.0.4
upg2.target_home=/u01/app/oracle/product/18.3.0
upg2.sid=UPGR
upg2.log_dir=/home/oracle/aux/UPGR
upg2.upgrade_node=localhost …

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 13
But there are more options …
#
# Example global pfile configuration entries
#
global.del_during_upgrade_pfile=/database/pfiles/global_during_delinit.ora
global.add_during_upgrade_pfile=/database/pfiles/global_during_addinit.ora
global.del_after_upgrade_pfile=/database/pfiles/global_after_delinit.ora
global.add_after_upgrade_pfile=/database/pfiles/global_after_addinit.ora

#
# Example local pfile configuration entries
#
upg2.del_during_upgrade_pfile=/database/pfiles/hr_during_delinit.ora
upg2.add_during_upgrade_pfile=/database/pfiles/hr_during_addinit.ora
upg2.del_after_upgrade_pfile=/database/pfiles/hr_after_delinit.ora
upg2.add_after_upgrade_pfile=/database/pfiles/hr_after_addinit.ora

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 14
AutoUpgrade - 4 modes

autoupgrade.jar
-analyze -fixups -upgrade
-deploy

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 15
AutoUpgrade - Recommendation

autoupgrade.jar
-analyze -deploy

$ java -jar autoupgrade.jar -config config.cfg -mode analyze


$ java -jar autoupgrade.jar -config config.cfg -mode deploy

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 16
AutoUpgrade - When you move to new hardware

autoupgrade.jar autoupgrade.jar

-analyze -fixups -upgrade


Source System Target System
$ java -jar autoupgrade.jar -config config.cfg -mode analyze
$ java -jar autoupgrade.jar -config config.cfg -mode fixups
$ java -jar autoupgrade.jar -config config.cfg -mode upgrade

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 17
Job Control Interface - Most Important Commands

upg>
lsj // List jobs
resume -jobno <number> // Restarts a job
status [-jobno <number>] // Show job status
restore -jobno <number> // Restores database from GRP
abort -jobno <number> // Aborts the specified job

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18


Logging
• Text and JSON format
• Directory structure
/cfgtoollogs
/upgrade/auto/status ç Status Logs

/<database_1>
/jobno /preupgrade ç HTML Report
/drain
/dbupgrade ç Upgrade Logs
/postupgrade
/temp

/<database_2> /preupgrade
/jobno
/drain
/dbupgrade
/postupgrade
/temp

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 19
2
Auto
Upgrade Demo

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 20
Preupgrade HTML Report

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 21
Sounds too good
to be true?

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database
Today …
Real World Checkpoint

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database
AUTO-UPGRADE
FIRST IMPRESSION

DANIEL OVERBY HANSEN, LEAD DEVELOPER

© 2018
THE WORLD’S LEADING PROVIDER
BRINGING INTEGRATED SOLUTIONS TO INVESTMENT MANAGERS

• Global provider of software and services to financial industry

• Established in 1971

• Headquartered in Copenhagen, Denmark

• Offices across Europe, North America and Asia-Pacific

• Flagship product, SimCorp Dimension®, built on-top of Oracle Database

• More than USD 20 trillion managed on SimCorp Dimension®

25 © 2018
WHO AM I
DANIEL OVERBY HANSEN

• Born and raised in SimCorp by DBA-old-timers

• Firm believer in the awe-ness of Oracle Database (it pwns MS SQL Server)

• Love/hate-relationship with vi

• 10 years as operational DBA, now in database research

• Love automation: automate it!

• Spend my time exploring how SimCorp can utilise database features at our advantage

Tag: doh-database

26 © 2018
WHY AM I HERE
WE DO A LOT OF UPGRADING

REFERENCE CUSTOMER EARLY ADOPTER


- For Oracle Database Upgrades
- Adopt every release and every patchset

YEARLY UPGRADE CYCLE


150 PRODUCTION DATABASES
- 150 production upgrades plus at least 150 test
- On Linux, Windows, and AIX
upgrades

27 © 2018
IS MIKE TELLING THE TRUTH
THE BIG QUESTION

• Does it really work? Does it work other places than Mike’s laptop?

YES IT WORKS
28 © 2018
REAL-WORLD EXAMPLE
18.3 REGULAR UPGRADE

PRODUCTION FASTEST STABLE

Our first production Fastest out of: No major issues so far


upgrade on Oracle Linux
11.2.0.3 - 12.1.0.1 Some annoyances from
Completely automated 12.1.0.1 - 12.1.0.2 12.2.0.1 are gone
process: DBA enters one 12.1.0.2 - 12.2.0.1
command 12.2.0.1 - 18.3.0.0 Preupgrade.jar
better than ever
Total down time:
26 minutes

29 © 2018
REAL-WORLD EXAMPLE
SAME UPGRADE – NOW USING AUTOUPGRADE

30 © 2018
AUTO-UPGRADE
NO MORE HOME-COOKING

31 © 2018
AUTO-UPGRADE FEATURES
YOU CAN STILL TAIL IT

32 © 2018
AUTO-UPGRADE FEATURES
DO YOU READ JSON?

33 © 2018
INTRODUCING
DBA-FREE UPGRADES

34 © 2018
YEARLY RELEASES
NUMBERS DON’T ADD UP

150 300 3
New upgrade
Production databases Counting the test Our OPS team every 2nd day
in various flavours upgrades we have to currently have three
and platforms schedule at least 300 DBAs
upgrades a year

35 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

PROJECT MANAGER enters database details into orchestration engine

• Database SID
• Host Name
• New Oracle Home

36 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE ensure prerequisites are in place

• Basic checks
• Update preupgrade.jar from central repository
• Clone new Oracle Home on to database host, if needed (clone.pl)

37 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE analyzes database

• Recompile invalid objects (utlrp)


• Execute preupgrade.jar, no fixups

On Error GoTo :DBA

38 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE duplicates source database on to test system

• RMAN duplicate from active database, or backup

39 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE upgrades database

• Execute preupgrade.jar including fixups


• Fix what preupgrade.jar won’t
• Remove underscore parameters
• Purge DBA_RECYCLEBIN
• Unattended database upgrade (home-cooked scripts, to be replace with auto-upgrade)

On Error GoTo :DBA

40 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

DATABASE OWNER is notified of upcoming upgrade

• Future upgrade time slot already assigned


• Database owner may adjust upgrade time slot, but not beyond initial time slot
• Tests can be conducted in the test database

41 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE prepares production database for upgrade

• Enterprise Manager blackout (emcli)


• Notify operations team
• Temporarily suspend backups
• No backups taken before upgrade – fallback method is Flashback Database

42 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE upgrades database

• Execute preupgrade.jar including fixups


• Fix what preupgrade.jar won’t
• Remove underscore parameters
• Purge DBA_RECYCLEBIN
• Unattended database upgrade (home-cooked scripts, to be replace with auto-upgrade)

On Error GoTo :FLASHBACK_DATABASE

43 © 2018
DBA-FREE UPGRADE
DESIGN

UPGRADE PREREQ PREUPG CLONE UPGRADE PREPARE POST


WAIT UPGRADE
REQUEST CHECK ANALYZE TEST TEST UPGRADE UPGRADE

ORCHESTRATION ENGINE finishes the upgrade

• Add underscore parameters that were removed prior to upgrade


• Remove Enterprise Manager blackout (emcli)
• Start level 0 backup
• Update database profiles
• Schedule DBMS_STATS.GATHER_FIXED_OBJECTS_STATS in 7 days via DBMS_SCHEDULER
• ….

44 © 2018
DBA-FREE UPGRADE
BENEFITS

150 PRODUCTION 80 % UPGRADED REDUCE RISK OF SUPPORT AGILE


UPGRADES IN LESS WITHOUT DBA HUMAN ERRORS ORGANISATION
THAN A MONTH

45 © 2018
FAMOUS
LAST WORDS

46 © 2018
FAMOUS LAST WORD
A FEW TIPS AND TRICKS

Always get the latest preupgrade.jar


1 MOS Doc ID 884522.1

Explanation of the preupgrade checks


2 MOS Doc ID 2380601.1

Execute DBMS_STATS.GATHER_DICTIONARY_STATS
3 in advance to save time in analyze mode (preupgrade_fixups)

47 © 2018
© 2018
LEGAL
DISCLAIMER

The contents of this presentation are for general The views and opinions expressed in this publication are
information and illustrative purposes only and are used at not necessarily those of SimCorp.
the reader’s own risk. SimCorp uses all reasonable
endeavours to ensure the accuracy of the information. © 2018 SimCorp A/S. All rights reserved. Without limiting
rights under copyright, no part of this document may be
However, SimCorp does not guarantee or warrant the reproduced, stored in, or introduced into a retrieval system,
accuracy, completeness, factual correctness, or reliability or transmitted in any form, by any means (electronic,
of any information in this publication and does not accept mechanical, photocopying, recording, or otherwise), or
liability for errors, omissions, inaccuracies, or typographical for any purpose without the express written permission
errors. of SimCorp A/S.

49 © 2018
Slides download and other resources
• https://MikeDietrichDE.com/slides

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 50
Sessions you may visit as well
• Tuesday, Oct 23 – 11:15 a.m.
Upgrade to Oracle 18c – Live and Uncensored
with Kamran Agayev, Azercell

• Tuesday, Oct 23 – 5:45 p.m.


How to Migrate to Oracle Autonomous Database Cloud
with Julian Dontcheff, Accenture Oy

• Thursday, Oct 25 – 9:00 a.m.


Cloud Migration from AIX to ExaCC – for DBAs and Managers
with Soner Toraman, METRO-NOM GmbH

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Ensure Performance Stability When Upgrading Databases 51
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | The new AutoUpgrade for the Oracle Database 52