52
1 Best Practices for Upgrading to Oracle Database 19c Mike Dietrich Master Product Manager Database Upgrade and Migrations @MikeDietrichDE Roy F. Swonger Vice President Database Upgrade and Utilities @RoyFSwonger

Best Practices for Upgrading to Oracle Database 19c

  • Upload
    others

  • View
    33

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Best Practices for Upgrading to Oracle Database 19c

1

Best Practices for Upgrading to Oracle Database 19c

Mike Dietrich

Master Product ManagerDatabase Upgrade and Migrations@MikeDietrichDE

Roy F. Swonger

Vice PresidentDatabase Upgrade and Utilities@RoyFSwonger

Page 2: Best Practices for Upgrading to Oracle Database 19c

Mike Dietrich

Master Product ManagerDatabase Upgrade and Migrations

Copyright © 2019 Oracle and/or its affiliates.

https://MikeDietrichDE.com

@MikeDietrichDE

Page 3: Best Practices for Upgrading to Oracle Database 19c

Roy F. Swonger

Vice PresidentDatabase Upgrade and Utilities

Copyright © 2019 Oracle and/or its affiliates.

@RoyFSwonger

Page 5: Best Practices for Upgrading to Oracle Database 19c

Lifetime Support Policy

Copyright © 2019 Oracle and/or its affiliates.

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

2027

Oracle 18

EXTENDED

EXTENDED

EXTENDED

Waived EXTENDEDOracle 11.2

Oracle 12.1

Oracle 12.2.0.1

Oracle 19

Paid Extended SupportPremier Support Waived Extended Support

Page 6: Best Practices for Upgrading to Oracle Database 19c

Oracle 12.2 Release Family?

• Includes:• Oracle 12.2.0.1• Oracle 18c (12.2.0.2)• Oracle 19c (12.2.0.3)

• MOS Note:742060.1 - The Single Source of TruthCopyright © 2019 Oracle and/or its affiliates.

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

2027

Oracle 18

EXTENDED

12.2.0.1

Oracle 19

Page 8: Best Practices for Upgrading to Oracle Database 19c

Security | What happens if you don't patch

Copyright © 2019 Oracle and/or its affiliates.

Page 9: Best Practices for Upgrading to Oracle Database 19c

Security | What happens if you don't upgrade

Copyright © 2019 Oracle and/or its affiliates.

Page 10: Best Practices for Upgrading to Oracle Database 19c

Security | Oracle Security Alerts - July 19

Copyright © 2019 Oracle and/or its affiliates.

Page 12: Best Practices for Upgrading to Oracle Database 19c

Don't do this | Outdated Versions

Copyright © 2019 Oracle and/or its affiliates.

Page 13: Best Practices for Upgrading to Oracle Database 19c

Don't do this | Outdated Versions

Copyright © 2019 Oracle and/or its affiliates.

GA: 29-NOV-2006

Page 15: Best Practices for Upgrading to Oracle Database 19c

Supportability | OS Certification

Copyright © 2019 Oracle and/or its affiliates.

Page 16: Best Practices for Upgrading to Oracle Database 19c

Supportability | OS Certification

Copyright © 2019 Oracle and/or its affiliates.

Page 17: Best Practices for Upgrading to Oracle Database 19c

Supportability | Application Certification

Copyright © 2019 Oracle and/or its affiliates.

Page 18: Best Practices for Upgrading to Oracle Database 19c

Database Upgrade | Supported Releases

Copyright © 2019 Oracle and/or its affiliates.

11.2.0.4

12.1.0.2

12.2.0.119c

18c

https://mikedietrichde.com/2019/02/14/oracle-database-19c-requires-ol7-rhel7-or-sles12-or-newer/

Page 19: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | Installation

• Gold Image• Create ORACLE_HOME directory• Download image• Unpack into ORACLE_HOME• ./runInstaller• root.sh

Copyright © 2019 Oracle and/or its affiliates.

Page 20: Best Practices for Upgrading to Oracle Database 19c

Exadata Upgrade | OL7 and Oracle 19c

• MOS Note: 2542082.119c Grid Infrastructure and Database Upgrade steps for Exadata

Copyright © 2019 Oracle and/or its affiliates.

Page 21: Best Practices for Upgrading to Oracle Database 19c

Download | Apply Release Updates (RU)

Copyright © 2019 Oracle and/or its affiliates.

Page 22: Best Practices for Upgrading to Oracle Database 19c

Recommendation

Copyright © 2019 Oracle and/or its affiliates.

What is the recommended way to upgrade databases?

Ph

oto

byJo

shu

a So

rtin

oon

Un

spla

sh

Page 23: Best Practices for Upgrading to Oracle Database 19c

Download | Get the latest autoupgrade.jar

• MOS Note: 2485457.1

Copyright © 2019 Oracle and/or its affiliates.

Page 24: Best Practices for Upgrading to Oracle Database 19c

Upgrade | AutoUpgrade

Copyright © 2019 Oracle and/or its affiliates.

upg>

Job Console

11.2.0.412.1.0.2

12.2.0.1

18c

autoupgrade.jarMOS Note: 2485457.1

4MB

config.cfgautoupgrade.jar

12.2.0.118.5.0

19c

19c

Page 25: Best Practices for Upgrading to Oracle Database 19c

And by the way …

• With Oracle 19c you can have 3 user-created PDBs without need for a Multitenant license!!!

• https://mikedietrichde.com/2019/09/17/3-pdbs-included-with-oracle-19c-and-desupport-of-non-cdbs-with-20c/

Copyright © 2019 Oracle and/or its affiliates.

Page 26: Best Practices for Upgrading to Oracle Database 19c

Upgrade | AutoUpgrade - non-CDB to PDB

Copyright © 2019 Oracle and/or its affiliates.

autoupgrade.jarMOS Note: 2485457.1

4MB

config.cfg

upg>

Job Console

Oracle 19c

autoupgrade.jar

CDB

PDB$SEED

11.2.0.412.1.0.2

12.2.0.1

18c

Page 27: Best Practices for Upgrading to Oracle Database 19c

Upgrade | Prefer doing it all by yourself?

• Download preupgrade.jar from MOS Note: 884522.1• Fixup scripts

• Run dbupgrade -l /tmp/logs• Resumable:� dbupgrade -R -l /tmp/logs

Copyright © 2019 Oracle and/or its affiliates.

Page 28: Best Practices for Upgrading to Oracle Database 19c

Upgrade 19c | Speed it up

• Check when dictionary stats have been gathered the last time

• Refresh stats a day before the upgrade

Copyright © 2019 Oracle and/or its affiliates.

column OPERATION format a40set linesize 200

select to_char(max(END_TIME),'DD-MON-YY hh24:mi') LATEST, OPERATIONfrom DBA_OPTSTAT_OPERATIONSwhere OPERATION in ('gather_dictionary_stats', 'gather_fixed_objects_stats')group by operation;

Page 29: Best Practices for Upgrading to Oracle Database 19c

Upgrade 19c | Make it run faster …

• Stats not gathered on several clustered indexes (bug 25286819)

• Wait … autoupgrade.jar does this for you already!

Copyright © 2019 Oracle and/or its affiliates.

exec dbms_stats.gather_schema_stats('SYS');exec dbms_stats.gather_index_stats('SYS','I_OBJ#');exec dbms_stats.gather_index_stats('SYS','I_FILE#_BLOCK#');exec dbms_stats.gather_index_stats('SYS','I_TS#');exec dbms_stats.gather_index_stats('SYS','I_USER#');exec dbms_stats.gather_index_stats('SYS','I_TOID_VERSION#');exec dbms_stats.gather_index_stats('SYS','I_MLOG#');exec dbms_stats.gather_index_stats('SYS','I_RG#');

Page 30: Best Practices for Upgrading to Oracle Database 19c

Upgrade 19c | Effect of having good stats

• The larger the dictionary, the bigger the effect

• This example has been done with one of the tiny Hands-On Lab databases

Copyright © 2019 Oracle and/or its affiliates.

Duration ReductionNo dictionary and fixed objects stats 15 min 55 sec

Gathered dictionary and fixed objects stats 14 min 10 sec 11 %

Gathered schema and cluster index stats 13 min 41 sec 3.4 % to previous

Total downtime saved 2 min 14 sec 14 % overall

Page 31: Best Practices for Upgrading to Oracle Database 19c

APEX | Upgrade APEX upfront

• APEX upgrade• Not part of the database upgrade• MOS Note: 1088970.1 - Master Note APEX Upgrades

• APEX certification• Minimum APEX Version for Oracle 19c: APEX 18.2• MOS Note: 1344948.1 - APEX Database and Web Server Certification

Copyright © 2019 Oracle and/or its affiliates.

Page 32: Best Practices for Upgrading to Oracle Database 19c

Things to know

Best Practices and things to take care on

Copyright © 2019 Oracle and/or its affiliates.

Page 33: Best Practices for Upgrading to Oracle Database 19c

Testing | Typical Mistakes• Only 10% of real data used• Data sets artificially created • Tests done on a laptop• No testing tools used• Data from 6 months ago• No statistics refreshed

• Testing?? Waste of time!• Real experts fix it after go-live …

Copyright © 2019 Oracle and/or its affiliates.

Phot

oby

Elija

h O

'Don

nell

on U

nspl

ash

Page 34: Best Practices for Upgrading to Oracle Database 19c

Best Practice | COMPATIBLE Parameter

• When should you change COMPATIBLE?• 7-10 days after the upgrade

• Which value?• 11.2.0• 12.1.0• 12.2.0• 18.0.0• 19.0.0

• Change COMPATIBLE for RUs?• NEVER!

Copyright © 2019 Oracle and/or its affiliates.

• Flashback to GRP• Downgrade

Page 35: Best Practices for Upgrading to Oracle Database 19c

Multitenant | Silent Compatible Change

• Be aware when youunplug/plug betweendifferent environments• Default COMPATIBLE=19.0.0

Copyright © 2019 Oracle and/or its affiliates.

Automatically

COMPATIBLE=12.2.0

COMPATIBLE=19.0.0

COMPATIBLE=19.0.0

CDB1

PDB$SEED

CDB2

PDB$SEED

Page 36: Best Practices for Upgrading to Oracle Database 19c

Fallback | Guaranteed Restore Point

• COMPATIBLE must not be changed!

Copyright © 2019 Oracle and/or its affiliates.

Pre Upgrade Environment Post Upgrade EnvironmentCREATE RESTORE POINT grptGUARANTEE FLASHBACK DATABASE;

SHUTDOWN IMMEDIATE

STARTUP MOUNT;

FLASHBACK DATABASE TO RESTORE POINT grpt;

SHUTDOWN IMMEDIATE

STARTUP MOUNT;

ALTER DATABASE OPEN RESETLOGS;

DROP RESTORE POINT grpt;

UPGRADE

Page 37: Best Practices for Upgrading to Oracle Database 19c

Fallback | Guaranteed Restore Point

Copyright © 2019 Oracle and/or its affiliates.

Page 38: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | Multimedia Removal• The Oracle Multimedia API gets removed during upgrade

• The Locator still exists and works• ORDIM component remains VALID in DBA_REGISTRY

• Recommendation• Check, if you use Oracle Multimedia• If not, you can remove it before upgrade

• More information• https://mikedietrichde.com/2019/02/18/oracle-multimedia-will-be-removed-in-oracle-database-19c/• MOS Note: 2347372.1 – Oracle Multimedia Statement of Direction• MOS Note: 2375644.1 – How To Migrate Data From Oracle Multimedia Data Types to BLOB columns

Copyright © 2019 Oracle and/or its affiliates.

Page 39: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | Streams Removal

• The Oracle Streams API gets removed during upgrade

• See:• https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/behavior-changes-deprecated-

desupport-oracle-database.html#GUID-7E90C2D3-853A-45B2-AC6D-C9326798E82B

Copyright © 2019 Oracle and/or its affiliates.

Page 40: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | DBMS_JOB

• DBMS_JOB package is still supported• Grant the CREATE JOB privilege• During upgrade, for each job in DBMS_JOB a corresponding entry will be created with

DBMS_SCHEDULER• DBMS_JOB interface still works - but always creates a corresponding entry in the scheduler• The check in preupgrade.jar is only checking for inconsistencies or any issues

Copyright © 2019 Oracle and/or its affiliates.

MOS Note: 2380601.1 - Database Preupgrade tool check list

Page 41: Best Practices for Upgrading to Oracle Database 19c

Behavior Change 19c | Automatic SPM

• SQL Plan Management is "automatic" and enabled by default

• If you'd like to revert to 12.1 or 12.2/18c behavior:• https://mikedietrichde.com/2019/06/03/automatic-sql-plan-

management-in-oracle-database-19c/

Copyright © 2019 Oracle and/or its affiliates.

Page 42: Best Practices for Upgrading to Oracle Database 19c

Health Check | hcheck.sql

• If your database is highly important, do a health check• hcheck.sql - Script to Check for Known Problems (MOS Note: 136697.1)

Copyright © 2019 Oracle and/or its affiliates.

Page 43: Best Practices for Upgrading to Oracle Database 19c

More Recommendations

The Underscore Section

Copyright © 2019 Oracle and/or its affiliates.

Page 44: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | Symbolic links for directories

• UTL_FILE package symbolic link not supported in directory paths

• This affects DATA_PUMP_DIR as well - flagged in preupgrade.jar

• Revert to old behavior only if REALLY needed:• https://mikedietrichde.com/2019/07/15/behavior-change-in-oracle-18c-19c-no-symbolic-links-for-data-pump-directories/

Copyright © 2019 Oracle and/or its affiliates.

Page 45: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | _cursor_obsolete_threshold

• MOS Note: 2431353.1High Version Counts for SQL statements (>1024) post upgrade To 12.2 and above causing database slow performance• Since Oracle 12.2.0.1, the old default of 1024 has been raised to 8192• This may lead to various drastic performance issues• Recommendation:

• Especially for non-CDBs, set it to the old default to avoid mutex concurrency issues:

_cursor_obsolete_threshold=1024

Copyright © 2019 Oracle and/or its affiliates.

Page 46: Best Practices for Upgrading to Oracle Database 19c

Oracle 19c | _exclude_seed_cdb_view

• Default is TRUE• This hides all objects in PDB$SEED• Can be very problematic after patching - you need to see everything!

• Recommendation: MOS Note 1940806.1• _exclude_seed_cdb_view=FALSE

Copyright © 2019 Oracle and/or its affiliates.

Page 47: Best Practices for Upgrading to Oracle Database 19c

Further Information

Finally …

Copyright © 2019 Oracle and/or its affiliates.

Page 48: Best Practices for Upgrading to Oracle Database 19c

Checklist

1. Check all certifications

2. Download 19c and apply the most recent Release Update

3. Download the most recent autoupgrade.jar

4. Upgrade your databases with AutoUpgrade

5. Browse the slides for more recommendations J

Copyright © 2019 Oracle and/or its affiliates.

Page 49: Best Practices for Upgrading to Oracle Database 19c

https://MikeDietrichDE.com

Copyright © 2019 Oracle and/or its affiliates.

Page 50: Best Practices for Upgrading to Oracle Database 19c

https://MikeDietrichDE.com

Copyright © 2019 Oracle and/or its affiliates.

Page 51: Best Practices for Upgrading to Oracle Database 19c

Questions?

Thank you for your attention!

Copyright © 2019 Oracle and/or its affiliates.

Page 52: Best Practices for Upgrading to Oracle Database 19c

The preceding 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, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation.

Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events.

Safe Harbor

Copyright © 2019 Oracle and/or its affiliates.