You are on page 1of 53

Oracle Database 12c

Upgrade
Tools and Best Practices from Oracle Support

Roderick Manalac
Architect Database Proactive Support

Sudhir Juyal
Principle Software Engineer

Oracle Software Support


September 21, 2016

Copyright 2016, 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 Oracles products remains at the sole discretion of Oracle.

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 3


Program Agenda

1 Why Upgrade?
2 Overview and Concepts
3 Upgrade Tools and Best Practices
4 Useful References for Upgrade

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 4


Why Upgrade to Database 12c Release 1?
Many Benefits
MultiTenant, InMemory, JSON
New
Improvements in Performance,
Features
Administration, Availability, Security, etc.

Increased Premier Support until July 2018 *


Support Extended Support until July 2021
Length See Doc ID 742060.1 for more details

Save Extended Support Fee **


Premier Patchset, PSU, SPU and other Bug fixes are
Support available

** Database 11g Release 2 Extended Support Fee Waived until May 31, 2017

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 5


Terminology: Upgrade vs. Migration
Upgrade Migration
Mostly independent of DB size Usually dependent on DB size

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 6


12c Upgrade Path
Direct or Indirect Path

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 7


OTN Upgrade Page
http://otn.oracle.com/goto/upgrade

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 8


Upgrade Documentation
http://docs.oracle.com/database/121/UPGRD/toc.html

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


Upgrade Companion
Doc ID 1462240.1 - Oracle 12cR1 Upgrade Companion

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 10


Upgrade Blog
https://blogs.oracle.com/UPGRADE/

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 11


Certification

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 12


Software Download
Locations
https://edelivery.oracle.com

http://www.oracle.com/downloads

https://support.oracle.com

How to Request Software Media when it is


Unavailable on the Oracle Software Delivery
Cloud site (Doc ID 1071023.1)

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 13


Upgrade Methods
DBUA (Recommended)

Manual Upgrade

Expdp/Impdp

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 14


Install the Latest Patch Set: 12.1.0.2
Download patch set 12.1.0.2 from http://support.oracle.com

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 15


Recommended OS patches Oracle Database 12c
Doc ID 1587357.1
Oracle Database 12.1 Installation
and Configuration Requirements
Quick Reference for AIX, HP-UX,
Linux, Solaris and MS Windows OS

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 16


Recommended Patches: PSUs
Always install the latest PSU as soon as possible.

Most important Notes: Doc ID 854428.1 Introduction to Database PSU


Doc ID 1227443.1 PSU Known Issues

SPUs Fixes Recertification


PSU contents:
Fixes for Critical Issues Fixes Configuration

PSU characteristics:

PSU schedule : Jan / Apr / Jul / Oct

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 17


Recommended Patches: OJVM PSU and DBBP
Every customer should at least install PSUs. Minimal testing required.
12.1.0.2 Customers wanting a more comprehensive set of fixes should
install the Database Proactive Bundle patch. This requires a bit more
testing than a Patch Set Update (PSU), but delivers a larger set of fixes.
Exadata Customers should apply latest Database Proactive Bundle patch
In all cases install the relevant OJVM PSU.
Refer: Oracle Database - Overview of Database Patch Delivery Methods
(Doc ID 1962125.1)

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


Quick Reference to install latest DB PSU
Quick Reference to Patch Numbers for Database PSU, SPU(CPU), Bundle Patches and
Patchsets (Doc ID 1454618.1)

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 19


Important Optimizer Issues and Fixes
Things to consider before upgrade to Oracle Database 12.1.0.2 to avoid Poor
Performance or Wrong Results: Doc ID 2034610.1

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 20


Important SQL Plan Management Issues and Fixes
Patches to Consider for 12.1.0.2 to Avoid Problems with SQL Plan Management (SPM):
Doc ID 2035898.1

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 21


Important Optimizer Issues and Fixes SPARC SOLARIS
Things to Consider to avoid RDBMS Performance problems on SPARC
For 12.1.0.2: Doc ID 1970525.1

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 22


Upgrade Grid Infrastructure
Upgrade Grid Infrastructure BEFORE upgrading the Oracle Database
Install the Grid Infrastructure in a NEW ORACLE_HOME (Out-of Place Upgrade)

Oracle Grid Oracle Database


Infrastructure Home Server Home

Doc ID 1579762.1 How to Upgrade to Oracle Grid Infrastructure 12c Release 1 and Known Issues

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 23


ORAchk Upgrade Readiness Assessment
Download the newest version of ORAchk: Doc ID 1268927.1

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 24


Preparation Checklist
In the SOURCE environment:

Empty the recycle bin


Clean Up Check for INVALID objects in SYS & SYSTEM
Check for duplicate objects in SYS & SYSTEM

Check for INVALID components


Components Check for mandatory components
Remove obsolete components

Performance Preserve performance statistics


Check network performance

Optional Perform Integrity checks

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 25


Pre-Upgrade Information Tool: preupgrd.sql
Upgrade SQL Automation

Introduced in 12cR1
Replaces utl<nnn>i.sql scripts
Run against the source DB
Generates fix-up scripts
preupgrade_fixups.sql
postupgrade_fixups.sql

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 26


Prepare Source Database
Run Preupgrade Tool on the Source Database
Execute
preupgrd.sql
Location:
$ORACLE_BASE/cfgtoollogs/<SID>/preupgrade

Logs generated Copy preupgrd.sql


by preupgrd.sql &
utluppkg.sql

Source DB Target DB

- preupgrade.log
- preupgrade_fixups.sql
- postupgrade_fixups.sql

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 27


Preupgrade Checks
$ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/preupgrade.log

Compatible Parameter Check

OCM user existence check

Gather dictionary statistics

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 28


Remove Obsolete Components
Enterprise Manager DB Control Repository superseded by DB Express
Remove EM Repository
Otherwise, automatically removed by catuppst.sql in the post-upgrade phase
$ emctl stop dbcontrol
SQL> @?/rdbms/admin/emremove.sql

Remove Oracle UltraSearch before the upgrade


Does not exist in Database 11.2 and later
For Database 10.2
SQL> @?/ultraserach/admin/wk0deinst.sql SYS password

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 29


Upgrade Oracle Label Security
Essential step if Oracle Label Security and/or Database Vault was already in
the database before 12c
Execute olspreupgrade.sql
SQL> @?/rdbms/admin/olspreupgrade.sql

Prepares the move of AUD$ table from SYSTEM to SYS


Processes the audit records to minimize downtime
Move records to an interim temporary table

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 30


Backup the Database
Backup the database and/or create a guarantee flashback restore point
Test your fallback strategies at least once
Make sure your fallback strategy covers during and after cases

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 31


Caveat: compatible Parameter
Minimum COMPATIBLE parameter for 12c is 11.0.0
Leave COMPATIBLE at original value for at least a week before changing to 12.0.0
No way back once COMPATIBLE is set to 12.0.0
Compatible 11.0.0 or higher is a MUST

Downgrade NOT possible

Compatible remains at 11.x.x

Downgrade possible

Database restart is required to change the COMPATIBLE parameter later


SQL> alter system set compatible = '12.0.0' scope=spfile;
SQL> shutdown immediate
SQL> conn / as sysdba
SQL> startup

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 32


Diagnostic Collection Script: dbupgdiag.sql
Doc ID 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 33


Upgrade Utility: catctl.pl (Manual Upgrade Method)
Introduced with Database 12c Release 1
Loads / Updates data dictionary and components in PARALLEL
Default parallelism: 4
Maximum parallelism: 8
catctl.pl supported options

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 34


12c Upgrade
Start the Database in UPGRADE mode using the 12c binaries

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 35


12c Upgrade Parallelism
Start the upgrade using catctl.pl with PARALLEL option

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 36


12c Upgrade Logs
Default log location is current working directory
Use -l switch to specify the log location
One log file for each thread

Upgrade is running with 8 Parallel processes

Total DB components upgrade time

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 37


Post-Upgrade Checklist
In the DESTINATION environment:

$ORACLE_HOME/rdbms/admin/utlrp.sql
Execute $ORACLE_HOME/rdbms/admin/utlu121s.sql

Update Time Zone / Daylight Savings Data

SPFILE from PFILE


Create Gather new CBO statistics
Backup the Database

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 38


Post Upgrade Fixups
$ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/preupgrade.log $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/postupgrade_fixups.sql

Gather Fixed Objects Statistics

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 39


Verify Upgrade Logs
Review upgrade logs and trace files
DBUA logs: $ORACLE_BASE/cfgtoollogs/DBUA/<SID>/upgrade<n>
Under $ORACLE_HOME if $ORACLE_BASE is NOT set
Manual upgrade: Location specified using the -l option of catctl.pl
Check alert_<SID>.log
Check utlu121s.sql output

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 40


Verify Upgrade Logs
New successful upgrade status for CATALOG and CATPROC component

Run the utlrp.sql to change the status to VALID

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 41


Upgrade Status Summary Tool: utlu121s.sql

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 42


Time Zone Version
Default
Pre or Post Upgrade Action Oracle Database
Time Zone
Default time zone version for 12cR1 Release Version
is V18 10.2.0.3, 10.2.0.4, 10.2.0.5 DST V4
If Time Zone version at source database 11.1.0.6 , 11.1.0.7 DST V4
HIGHER than target database
11.2.0.1 DST V11
Apply the Time Zone patch on target to match
the source database version 11.2.0.2 , 11.2.0.3, 11.2.0.4 DST V14
If Time Zone version at source database 12.1.0.1, 12.1.0.2 DST V18
LOWER than target database
Most recent interim patch: DST V26
Time Zone conversion needed post upgrade. See Doc ID 412160.1
Time Zone defs in $OH/oracore/zoneinfo

Doc ID 1585343.1 Scripts to automatically update the RDBMS DST (timezone) version in an 11gR2 or 12cR1
database

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 43


12c Upgrade Known Issues
Doc ID 2047990.1 DBUA 12c and datapatch.pl Things to Know
The post install steps of a PSU/SPU/BP are not run automatically post-upgrade
Doc ID 1985225.1 Database Upgrade failed with Errors ORA-02290: check
constraint (SYS.JAVA_DEV_DISABLED) violated & ORA-04045: SYS.
If OJVM mitigation patch has been applied against source DB, then enable JVM before
upgrading the DB
Doc ID 2009405.1 ORA-01722: invalid number while upgrading to 12c
TO_NUMBER(INVALID_TABLEDATA) can fail with ORA-01722
Most common challenge: inadequate testing or Invalid SYS/SYSTEM
objects/components before upgrade

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 44


Additional Useful References for Upgrade
Doc ID 1462240.1 Oracle 12c Upgrade Companion
Doc ID 1515747.1 Oracle Database 12c Release 1 (12.1) Upgrade New Features
Doc ID 1493645.1 Oracle Database 12c Release 1 (12.1) DBUA : Understanding New Changes With All New 12.1 DBUA
Doc ID 1516557.1 Complete Checklist for Upgrading to Oracle Database 12c Release 1 (12.1) using DBUA
Doc ID 1503653.1 Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1)
Doc ID 1516616.1 Oracle Database 12c Release 1 (12.1) DBUA in Silent mode
Doc ID 1933011.1 Complete Checklist for DBUA Upgrade from 12.1.0.1 to 12.1.0.N
Doc ID 1932762.1 Complete Checklist for Manual Upgrade from 12.1.0.1 to 12.1.0.N (Full CDB Upgrade)
Doc ID 1933391.1 Complete Checklist for 12c R1 PDB upgrade (Upgrade single/multiple PDBs)
Doc ID 1932340.1 How to execute sql scripts in Multitenant environment (catcon.pl)

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 45


Oracle 12c (12.1.0.2) Upgrade and Migration HOL
Can be downloaded from OTN

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 46


MOS Database Install/Upgrade/Opatch Community

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 47


Raising SR with support: Guided Resolution

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | Confidential Oracle Internal/Restricted/Highly Restricted 48
Oracle Modernization and Upgrade Roadmap
Your Personal Roadmap
Examples of Comprehensive Services for Your Database Modernization Strategy

Database Upgrade Oracle 12c Upgrade Assurance

Supporting ACS Services


Paths to Oracle Database 12c

Database Migration Oracle Upgrade Support


Database Cloud Oracle Consolidation Planning
Service
Oracle Migration Service Plan & Build &
Design Deploy
Private Cloud Provisioning and
Readiness
Oracle Go-Live Support
Oracle Advanced Database
Support Optimize & Support &
Modernize Maintain
Oracle Solution Support
Center Connected
Oracle Advanced Monitoring
and Resolution

Copyright 2016, Oracle and/or its affiliates. All rights reserved. |


Oracle Modernization and Upgrade Roadmap
Your Personal Roadmap
Examples of Comprehensive Services for Your Database Modernization Strategy

Database Upgrade Oracle 12c Upgrade Assurance

Supporting ACS Services


Paths to Oracle Database 12c

Database Migration Oracle Upgrade Support


Database Cloud Oracle Consolidation Planning
Service
Oracle Migration Service Plan & Build &
Design Deploy
Private Cloud Provisioning and
Readiness
Oracle Go-Live Support
Oracle Advanced Database
Support Optimize & Support &
Modernize Maintain
Oracle Solution Support
Center Connected
Oracle Advanced Monitoring
and Resolution

Copyright 2016, Oracle and/or its affiliates. All rights reserved. |


Safe Harbor Statement
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, and timing of any features or
functionality described for Oracles products remains at the sole discretion of Oracle.

Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 51


Copyright 2016, Oracle and/or its affiliates. All rights reserved. | 52