Oracle Database 12c Upgrade Tools and Best Practices from Oracle Support Roderick Manalac Architect Database Proactive Support Oracle Software Support October 29, 2015
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. 3
Program Agenda 1 2 3 4 Why Upgrade? Overview and Concepts Upgrade Tools and Best Practices Useful References for Upgrade 4
Why Upgrade to Database 12c Release 1? Many Benefits New Features MultiTenant, InMemory, JSON Improvements in Performance, Administration, Availability, Security, etc. Increased Support Length Premier Support until July 2018 * Extended Support until July 2021 See Doc ID 742060.1 for more details Premier Support Save Extended Support Fee ** Patchset, PSU, SPU and other Bug fixes are available * SE and SE1 Premier Support until August 2016 ** Database 11g Release 2 Extended Support Fee Waived until May 31, 2017 5
Terminology: Upgrade vs. Migration Upgrade Independent of DB size Migration Usually dependent on DB size 6
Upgrade Methods DBUA (Recommended) Manual Upgrade Expdb/Impdp 7
12c Upgrade Path Direct or Indirect Path 8
OTN Upgrade Page http://otn.oracle.com/goto/upgrade 9
Upgrade Documentation http://docs.oracle.com/database/121/upgrd/toc.html 10
Upgrade Companion Doc ID 1462240.1 - Oracle 12cR1 Upgrade Companion 11
Upgrade Blog https://blogs.oracle.com/upgrade/ 12
Certification 13
Software Download Locations https://edelivery.oracle.com http://www.oracle.com/downloads https://support.oracle.com 14
Install the Latest Patch Set: 12.1.0.2 Download patch set 12.1.0.2 from http://support.oracle.com 15
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 PSU contents: SPUs Fixes for Critical Issues Fixes Recertification Fixes Configuration PSU characteristics: RAC Rolling Standby First PSU schedule 4x/year: 20-OCT-2015 / 19-Jan-2016 / 19-Apr-2016 / 19-Jul-2016 16
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 Things to consider before upgrade to Oracle Database 11.2.0.4 to avoid Poor Performance or Wrong Results: Doc ID 1645862.1 Things to consider before upgrade to Oracle Database 11.2.0.3 to avoid Poor Performance or Wrong Results: Doc ID 1392633.1 17
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 Patches to Consider for 11.2.0.4 to Avoid Problems with SQL Plan Management (SPM): Doc ID 2034706.1 Patches to Consider for 11.2.0.3 to Avoid Problems with SQL Plan Management (SPM): Doc ID 1948958.1 18
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 For 11.2.0.3 /11.2.0.4: Doc ID 1680269.1 19
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 20
Patching Notes by Release Doc ID 161818.1» Click on the releases number «? Oracle 11.2.0 Doc ID 880782.1 Known Issues and Alerts in 11.2.0.x» Click on "Availability and Known Issues" for your patch releases «Doc ID 1562139.1 Availability and Known Issues in 11.2.0.4 Doc ID 756671.1 Check for: Recommended Patches Alerts Notable Fixes Issues Introduced Recommended Database Patches? Oracle 12.1.0 Doc ID 1565065.1 Known Issues and Alerts in 12.1.0.x» Click on "Availability and Known Issues" for your patch releases «Doc ID 1683799.1 Availability and Known Issues in 12.1.0.2 Doc ID 756671.1 Check for: Recommended Patches Alerts Notable Fixes Issues Introduced Recommended Database Patches 21
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 Infrastructure Home Oracle Database Server Home Doc ID 1579762.1 How to Upgrade to Oracle Grid Infrastructure 12c Release 1 and Known Issues 22
ORAchk Upgrade Readiness Assessment Download the newest version of ORAchk: Doc ID 1268927.1 23
Preparation Checklist In the SOURCE environment: Clean Up Empty the recycle bin Check for INVALID objects in SYS & SYSTEM Check for duplicate objects in SYS & SYSTEM Components Performance Optional Check for INVALID components Check for mandatory components Remove obsolete components Preserve performance statistics Check network performance Perform Integrity checks 24
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 25
Prepare Source Database Run Preupgrade Tool on the Source Database Location: $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade Execute preupgrd.sql Logs generated by preupgrd.sql Copy preupgrd.sql & Utluppkg.sql Source DB Target DB -preupgrade.log - preupgrade_fixups.sql - postupgrade_fixups.sql 26
Preupgrade Checks $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/preupgrade.log Compatible Parameter Check $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/preupgrade_fixups.sql OCM user existence check Gather dictionary statistics 27
Remove Obsolete Components Enterprise Manager DB Control Repository superceded 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 28
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 29
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 30
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 MUST Downgrade NOT possible Compatible remain to 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 31
Diagnostic Collection Script: dbupgdiag.sql Doc ID 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information 32
Upgrade Utility: catctl.pl Introduced with Database 12c Release 1 Loads / Updates data dictionary and components in PARALLEL Default parallelism: 4 Maximum parallism: 8 catctl.pl supported options: 33
12c Upgrade Start the Database in UPGRADE mode using the 12c binaries Exit sqlplus 34
12c Upgrade Parallelism Start the upgrade using catctl.pl with PARALLEL option 35
12c Upgrade Logs Default log location is current working directory Use -l parameter to specify the log location One log file for each thread Upgrade is running with 8 Parallel processes Total DB components upgrade time 36
Post-Upgrade Checklist In the DESTINATION environment: Execute $ORACLE_HOME/rdbms/admin/utlrp.sql $ORACLE_HOME/rdbms/admin/utlu121s.sql Update Time Zone / Daylight Savings Data Create SPFILE from PFILE Gather new CBO statistics Backup the Database 37
Post Upgrade Fixups $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/preupgrade.log $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade/postupgrade_fixups.sql Gather Fixed Objects Statistics 38
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 39
Verify Upgrade New successful upgrade status for CATALOG and CATPROC component Run the utlrp.sql to change the status to VALID 40
Upgrade Status Summary Tool: utlu121s.sql 41
Time Zone Version Pre or Post Upgrade Action Default time zone version for 12cR1 is V18 If Time Zone version at source database HIGHER than target database Apply the Time Zone patch on target to match the source database version If Time Zone version at source database LOWER than target database Time Zone conversion needed post upgrade. Time Zone defs in $OH/oracore/zoneinfo Oracle Database Release Default Time Zone Version 10.2.0.3, 10.2.0.4, 10.2.0.5 DST V4 11.1.0.6, 11.1.0.7 DST V4 11.2.0.1 DST V11 11.2.0.2, 11.2.0.3, 11.2.0.4 DST V14 12.1.0.1, 12.1.0.2 DST V18 Most recent interim patch: See Doc ID 412160.1 DST V25 Doc ID 1585343.1 Scripts to automatically update the RDBMS DST (timezone) version in an 11gR2 or 12cR1 database 42
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 / upgrading too many components at once 43
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) 44
Oracle 12c (12.1.0.2) Upgrade and Migration hands-on Lab Can be downloaded from OTN 45
Advanced Customer Support - Lifecycle Support Fast, Safe, Efficient; Delivered via Gateway or Onsite Consolidation Planning Service Identifies optimal scenario and lowers risk Analysis of key parameters and components Comprehensive consolidation plan Detailed projections and recommendations Load Testing & Analysis Service Evaluates impact of planned technology change Proactive risk identification Comprehensive testing solution SQL and Oracle database workload analysis Migration Service Fast and safe database migration, optimization Planning, validation, upgrade, migration Migration of huge, complex databases (also SAP environments) in a single weekend Compression of up to 70% for better performance Performance Tuning & Benchmark Service Maintains optimal performance over time Quarterly assessments and monitoring of KPIs Best practice recommendations Database tuning 46
Keep Learning with Oracle University Classroom Training Learning Subscription Live Virtual Class Training On Demand Cloud Technology Applications Industries education.oracle.com 47
Session Surveys Help us help you!! The organizing committee would like to invite you to take a moment to give us your session feedback. Your feedback will help us to improve your conference. Please be sure to add your feedback for your attended sessions by using the Mobile Survey or in Schedule Builder. 48
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 Oracle s products remains at the sole discretion of Oracle. 49
50