• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Upgrade and migrate_to_12c
 

Upgrade and migrate_to_12c

on

  • 4,683 views

Oracle 12c Database Migration

Oracle 12c Database Migration

Statistics

Views

Total Views
4,683
Views on SlideShare
4,219
Embed Views
464

Actions

Likes
3
Downloads
260
Comments
8

33 Embeds 464

http://drsalbertspijkers.blogspot.com 194
http://feed.askmaclean.com 50
http://drsalbertspijkers.blogspot.in 44
http://drsalbertspijkers.blogspot.fr 24
http://drsalbertspijkers.blogspot.co.uk 22
http://drsalbertspijkers.blogspot.nl 18
http://drsalbertspijkers.blogspot.ca 17
http://drsalbertspijkers.blogspot.de 15
http://drsalbertspijkers.blogspot.ch 12
http://drsalbertspijkers.blogspot.com.au 6
http://drsalbertspijkers.blogspot.ru 5
http://drsalbertspijkers.blogspot.ie 4
http://drsalbertspijkers.blogspot.com.es 4
http://drsalbertspijkers.blogspot.it 4
http://drsalbertspijkers.blogspot.be 4
http://drsalbertspijkers.blogspot.pt 4
http://translate.googleusercontent.com 4
http://drsalbertspijkers.blogspot.com.tr 3
https://twitter.com 3
http://drsalbertspijkers.blogspot.co.il 3
http://drsalbertspijkers.blogspot.ro 3
http://drsalbertspijkers.blogspot.gr 3
http://drsalbertspijkers.blogspot.mx 2
http://drsalbertspijkers.blogspot.dk 2
http://drsalbertspijkers.blogspot.hu 2
http://drsalbertspijkers.blogspot.kr 2
http://webcache.googleusercontent.com 2
http://drsalbertspijkers.blogspot.jp 2
http://drsalbertspijkers.blogspot.cz 2
http://drsalbertspijkers.blogspot.sg 1
http://drsalbertspijkers.blogspot.no 1
http://drsalbertspijkers.blogspot.com.br 1
http://drsalbertspijkers.blogspot.tw 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

18 of 8 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Thank you i can download the document ....
    Are you sure you want to
    Your message goes here
    Processing…
  • I have set it to allow download!
    Are you sure you want to
    Your message goes here
    Processing…
  • Please let us download this , reading on net not always possible as it has 519 slides
    Are you sure you want to
    Your message goes here
    Processing…
  • Great Document .... it would have been excellent if u have allowed us to save the same :) ... Thank you for sharing
    Are you sure you want to
    Your message goes here
    Processing…
  • Done!
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Upgrade and migrate_to_12c Upgrade and migrate_to_12c Presentation Transcript

    • Upgrade, Migrate & Consolidate to Oracle Database 12c Roy Swonger & Mike Dietrich Database Upgrade and Utilities Oracle Corporation Updated: 17-JUL-2013
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 2
    • Database Upgrade Development Group Roy Swonger Senior Director Software Dev. & Product Management Carol Tagliaferri Senior Manager Software Dev. Cindy Lim Principal Member Technical Staff Joseph Errede Principal Member Technical Staff Mike Dietrich Senior Principal Technologist Eric Wittenberg Principal Software Engineer Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 3
    • Some MAGIC Questions Question? Answer Change to new hardware? Change to new operating system architecture? Change the characterset? Consolidation (schema/database/...) planned? Number of database to upgrade/migrate? Size of database(s) getting upgraded/migrated? Exact source and target Oracle version(s)? Max allowed downtime? Fallback requirements? Test environment and testing tools? Does a performance baseline exist? Change required to enable New Features? Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 4
    • Terminology  Database Upgrade – A database upgrade is called "Upgrade" because the data dictionary will get upgraded to a later version – This will include Oracle components, options such as JAVAVM, SDO – No data will be touched, changed or moved  Migration – A database migration will happen when the database will move to new: Hardware, operating system platform, character set  Software Upgrade – In-Place:  The new software will be installed into an existing SW location – Out-Of-Place  The new software will be installed into a new software location Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 5
    • Lifetime Support Policy today 2025 2024 2023 2022 2021 2020 2019 2018 2017 2016 2015 2014 2013 2012 (GA: Jul 2005) 2011 Oracle 10.2 2010 (GA: Jan 2004) 2009 JUL 2010 JAN 2007 Oracle 10.1 2008 2007 2006 2005 2004 (GA: Jul 2002) 2003 2002 Oracle 9.2 JAN 2012 JAN 2009 JUL 2010 Oracle 11.1 JUL 2013 AUG 2012 (GA: Aug 2007) Oracle 11.2 JUL 2015 AUG 2015 JAN 2018 JAN 2015 (GA: Sep 2009) Oracle 12.1 JUN 2018 (GA: Jun 2013) JUN 2021 today Premier Support Waived Extended Support Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Extended Support Upgrade, Migrate and Consolidate to Oracle Database 12c Limited ES Sustaining Support 6
    • Lifetime Support Policy  http://www.oracle.com/us/support/lifetime-support/index.html and Note: 209768.1 for Support Policy Explanation and details Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 7
    • Database Patch Set Roadmap  Release Schedule of Current Database Releases Note.742060.1 – Note.742060.1 contains also information about platform desupport and patching end dates Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 8
    • Upgrade Companion  Note:1462240.1 Upgrade Companion 12c (coming soon) − Note:785351.1 Upgrade Companion 11.2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 9
    • Upgrade OTN Page  http://otn.oracle.com/goto/upgrade  http://www.oracle.com/technetwork/database/upgrade/index.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 10
    • Maximum Availability Architecture OTN  http://otn.oracle.com/goto/maa  http://www.oracle.com/technetwork/database/features/availability/maa-090890.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 11
    • Upgrade Blog: blogs.oracle.com/UPGRADE Scroll down to go to the slides Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 12
    • INTERNAL PPT DOWNLOAD ONLY http://database.us.oracle.com ‘click’ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 13
    • Is It Time To Upgrade? Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 14
    • Upgrade and Migration Paths UPGRADE/MIGRATION exp/imp, expdp/impdp CTAS, COPY, SQL Loader N Stay on same OS? Y N SQL Apply & Transient Standby Transportable Tablespaces Y DBUA Full Transportable Export/Import CLI $> catctl.pl Oracle Golden Gate Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Downtime >30min? Upgrade, Migrate and Consolidate to Oracle Database 12c 15
    • Strategies?  Step-by-Step vs Big Bang – Upgrade/migration in pieces over a period of time  Considered as risk mitigating – Everything in one downtime window  Sometimes necessary due to dependencies  Least critical systems first vs most critical system first – Learn more with every step vs: – Learn about almost all from the beginning Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 16
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 17
    • Make sure everything is in good shape ...  So that you don’t go off the rails! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 18
    • 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 Remove outdated parameters Components  Check for INVALID components  Check for necessary components  Remove obsolete components Performance  Preserve performance statistics  Check network performance Optional Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Perform Integrity checks Upgrade, Migrate and Consolidate to Oracle Database 12c 19
    • Clean Up: Recycle Bin  Especially before patch or release upgrade purge the recycle bin: – SQL> purge DBA_RECYCLEBIN;  General recommendation: – Empty the recycle bin at least once per week with an automatic job during off-peak times Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 20
    • Clean Up: Invalid Objects  Always check for INVALID objects  SQL> select unique OBJECT_NAME, OBJECT_TYPE, OWNER from DBA_OBJECTS where STATUS='INVALID' order by OWNER;  There should be no invalid objects owned by SYS or SYSTEM – Recompile invalid objects with ?/rdbms/admin/utlrp.sql before upgrade/migration Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 21
    • Clean Up: Duplicate Objects  Always check for DUPLICATE objects in SYS/SYSTEM  SQL> select OBJECT_NAME, OBJECT_TYPE from DBA_OBJECTS where OBJECT_NAME||OBJECT_TYPE in (select OBJECT_NAME||OBJECT_TYPE from DBA_OBJECTS where OWNER='SYS') and OWNER='SYSTEM' and OBJECT_NAME not in ('AQ$_SCHEDULES_PRIMARY', 'AQ$_SCHEDULES', 'DBMS_REPCAT_AUTH'); – Clean up using MOS Note:1030426.6 How to Clean Up Duplicate Objects Owned by SYS and SYSTEM Schema Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 22
    • Clean Up: Parameters  Remove outdated parameters, underscores and events from your init.ora/spfile – Example: _always_semi_join=off _unnest_subquery=false optimizer_features_enable=10.2.0.4 event="10061 trace name context forever, level 10" – Important: Also follow the application's upgrade instructions, such as EBS interoperability notes – these supersede any general removal recommendation Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 23
    • Clean Up: Parameters Real World Crosscheck  Internal Oracle production database – Multimedia (ORDIM) component took very long to upgrade _complex_view_merging = FALSE _multi_join_key_table_lookup = FALSE _library_cache_advice = FALSE _index_join_enabled = FALSE Upgrade time Remove all for ORDIM: _push_join_union_view = FALSE underscores _push_join_predicate = FALSE minutes and events 49 _always_semi_join = OFF _pred_move_around = FALSE _unnest_subquery = FALSE _predicate_elimination_enabled = FALSE _eliminate_common_subexpr = FALSE _no_or_expansion = FALSE event = '10195 trace name context forever, level 1' event = '10778 trace name context forever, level 1‘ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c Upgrade time for ORDIM: 7 minutes Factor x7 24
    • Components: Validation Check  Make sure all components are VALID before upgrade – SQL> select substr(COMP_ID, 1,10) compid, substr(COMP_NAME,1,24) compname, STATUS, VERSION from DBA_REGISTRY where STATUS<>'VALID'; – In case components are INVALID recompile with utlrp.sql – If that does not correct component status, further diagnosis might be required:  Note:472937.1 Information On Installed Database Components  Note:753041.1 How to diagnose Components with NON VALID status Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 25
    • Components: Necessary Components  General recommendation: – Standardize the set of installed database components throughout your environment  XDB component is mandatory in Oracle Database 12c  Consolidation: – All components must be installed in a CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 26
    • Components: Removal  3 potential reasons to remove components: – A component does not exist anymore in Oracle Database 12c  EM Database Control Repository  Oracle UltraSearch  Rules Manager and Expression Filter  OLAP AMD – Speed up the upgrade process  Fewer components mean faster database upgrades – A component is obsolete  Typical example: In 11g, EM DB Control Repository exists you migrate to EM Cloud Control with its own dedicated repository – Further information  “Database Components Cleanup” presentation on our Blog – http://apex.oracle.com/pls/apex/f?p=202202:2:::::P2_SUCHWORT:components Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 27
    • Performance: Preserve Statistics  Gather accurate performance statistics from production – Accurate means: Starting at least 1 month before the upgrade – This is of vital importance!!! – Use Automatic Workload Repository (AWR)  Snapshots interval 30-60 minutes and retention >31 days  Extract AWR: SQL> @?/rdbms/admin/awrextr.sql  Performance snapshot comparison using AWR DIFF reports: SQL> select * from table( DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_HTML( <DBID>, 1, 101, 121, <DBID>, 1, 201, 221)); – Please note: AWR usage requires a Diagnostic Pack license – Alternative: STATSPACK MOS Note:466350.1 – Time important queries, reports, and batch jobs  See also: MOS Note:1477599.1 Best Practices Around Data Collection For Performance Issues Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 28
    • Performance: Network Bandwidth  Theoretical vs Real World network transfer rates: Interface Data Volumne Theoretical Transfer Speed Real World Transfer Speed 100 Mbit Ethernet 11MB/sec 40 GB/hour <30 GB/hour 1 Gbit Ethernet 110MB/sec 400 GB/hour <300 GB/hour 10 Gbit Ethernet 1.1GB/sec 4 TB/hour <3 TB/hour Infiniband IB 4xQDR 4GB/sec 14 .4TB/hour <11 TB/hour  Typical issues: – Transfer protocols: ftp, scp, NFS all work single threaded by default – Different network segments: Repeaters/switches cause slow down – Security settings: Firewalls can kill all performance efforts – External network provider, long distances, etc… Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 29
    • Performance: Network Strategies    Move archived data in advance If data files include lots of free space, export/import to avoid copying large numbers of empty blocks Transfer protocols: –  Slow hardware: –   Start parallel copy operations Install parallel network cards, replace outdated switches/repeaters Use features such as Data Guard or GoldenGate “Sneakernet”: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 30
    • Optional: Integrity Checks  Health Check (hcheck.sql) – Download hcheck.sql from MOS Note:136697.1 – This script will check for known problems in Oracle8i, Oracle9i, Oracle10g and Oracle 11g. – Requires hOut Helper Package (hout.sql) from MOS Note:101468.1  RMAN Validation Check: – RMAN> backup check logical validate database;  See MOS Note:836658.1 for further details  Can be run in multiple parallel channels for speed up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 31
    • Preparation Check List  In the TARGET environment: Checks  Software Certification Information  Installation Requirements Download  Software and Patch Sets  CPUs, PSUs and Bundle Patches  Single Patches Settings Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Parameter Recommendations Upgrade, Migrate and Consolidate to Oracle Database 12c 32
    • Certification Check  Verify platform certification in My Oracle Support – Please see Note: 964664.1 and Note:431578.1 for explanations of Middleware and Application Server product group assignments Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 33
    • Software Download  How to access the software? – Get the latest patch set (if there's one available)!  http://support.oracle.com is the only source for patches and patch sets  Patch sets cannot be downloaded from eDelivery or OTN – Base release can be downloaded from:  http://edelivery.oracle.com/ – Software Delivery Cloud (formerly know as eDelivery) is the recommended source for downloading – If software is reissued, customers will be automatically informed via email – Or, download from OTN: http://otn.oracle.com/indexes/downloads/index.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 34
    • Installation of the new Software Patch Set / Base Release  Install newest PATCH SET (full install release since Oracle Database 11.2) or  Install base release into a new Oracle home (if there's no patch set available yet) PSU/BP Patches Upgrade  Apply newest available Patch Set Update (PSU) or  Apply recommended (bundled) patches (BP)  Apply Interim Patches for known issues  Now: Start the database upgrade/migration!!! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 35
    • Example: Patch Set 11.2.0.3  Download patch set 11.2.0.3 from support.oracle.com: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 36
    • Patch Set Installation 11.2.0.3  Default: out-of-place patch upgrade!!! It’s a full release!!! – If you specify an in-place patch upgrade: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 37
    • Patch Set Installation 11.2.0.3  Patch set 11.2.0.3 is a full release – Therefore no need anymore to install 11.2.0.1 first!!!  Only way to do an in-place patch set installation – Backup your /dbs and /network/admin files – ./runInstaller –detachHome ORACLE_HOME=<11.2.0.1-home> $ ./runInstaller -detachHome ORACLE_HOME=/u01/orahomes/11.2.0 Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 10047 MB Passed The inventory pointer is located at /etc/oraInst.loc The inventory is located at /u01/orabase 'DetachHome' was successful. – Remove your 11.2.0.1 home contents – Install 11.2.0.3 into the previous 11.2.0.1 home – Restore /dbs and /network/admin files – Upgrade your database with DBUA or catupgrd.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 38
    • Unattended Installation/Configuration  Oracle 11.2 – see Note:885643.1 – SAVE RESPONSEFILE option in OUI available – Or: Start OUI “silent” with all required parameters  Will work on Windows platform as well  Home Cloning (script or Lifecycle Management Pack) – Prepare a fully patched Oracle Home – Create an archive consisting of all files  Exclude *log, *dbf, tnsnames/listener/sqlnet.ora – Unpack archive and then $ORACLE_HOME/clone/bin/clone.pl...  See your installation guide for more information on cloning an Oracle Home  For further information (also OS related) see the Oracle Database Server Installation Master Note:1156586.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 39
    • Unattended Installation/Configuration  Oracle Database 12c:   Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 40
    • Patching Notes Flow in MOS Check for: MOS Note:161818.1 » Click on the releases number « MOS Note:880782.1 Known Issues and Alerts in 11.2.0.x ? Oracle 11.2.0 MOS Note:1565065.1 Known Issues and Alerts in 12.1.0.x ? Oracle 12.1.0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. » Click on "Availability and Known Issues" for your patch releases « » Click on "Availability and Known Issues" for your patch releases « Upgrade, Migrate and Consolidate to Oracle Database 12c MOS Note:1348336.1 Availability and Known Issues in 11.2.0.3 Recommended Patches Alerts Notable Fixes Issues Introduced MOS Note:756671.1 Recommended Database Patches MOS Note:1565082.1 Availability and Known Issues in 12.1.0.1 Check for: Recommended Patches Alerts Notable Fixes Issues Introduced MOS Note:756671.1 Recommended Database Patches 41
    • Important Alerts and One-Off-Patches?  Check for important alerts: Note:161818.1 ‘click’ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 42
    • Upgrade Information / Alerts  Known issues in 11.2.0.x? See Note:880782.1 ‘click’ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 43
    • Upgrade Information / Alerts  Recommended Patches for 11.2.0.3? Note:1348336.1 − See also Recommended Database Patches Note:756671.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 44
    • Recommended Patches: PSUs  Install the latest PSU as well – Note:854428.1: Introduction to Database Patch Set Updates – Note:1227443.1: Patch Set Updates Known Issues – Database PSUs include:  Fixes for critical issues that may affect a large number of customers and that are already proven in the field  Critical Patch Update fixes – Database PSUs do not include:  Changes that require re-certification  Fixes that require configuration changes – Typically 25-100 new bug fixes per PSU – Guaranteed to be RAC rolling installable – Released 4x per year - same schedule for PSUs and CPUs  16-APR-2013, 16-JUL-2013, 15-OCT-2013 & 14-JAN-2014 – PSU check: opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU' Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 45
    • Upgrade Information / Alerts  Alerts and new issues with 11.2.0.3? Note:1348336.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 46
    • Upgrade Information / Alerts  Alerts and new issues with 11.2.0.3? Note:1348336.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 47
    • Important Optimizer Issues and Fixes  Things to consider before upgrade to Oracle Database 11.2.0.3 to avoid Poor Performance or Wrong Results: MOS Note:1392633.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 48
    • Recommended OS patches  MOS Note:169706.1: OS Installation and Configuration Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 49
    • Standby-First-Patching  Oracle Data Guard Standby-First Patch Apply – MOS Note:1265700.1 - Data Guard Standby-First Patch Apply – Apply a patch first on the physical standby site – Different software releases allowed between primary and standby  Role transitions allowed for rolling upgrades – Supported for:  Patch Set Update (PSU), Critical Patch Update (CPU) and PSE  Oracle Grid Infrastructure Patches or Software Updates  One-off patches  Oracle Exadata Database Machine bundled patches (BP), Quarter Database Patches, Storage Server Software patches (Cell), hardware/network changes  Operating System software changes that do not have any dependencies on Oracle database software – Available beginning with Oracle Database 11.2.0.1  RDBMS COMPATIBLE must remain the same  ASM COMPATIBLE can be different Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 50
    • Parameter Recommendations  General guidelines: – The fewer parameters you have in your spfile, the better – Remove outdated parameters, underscores, events ...  Unless directed by applications (e.g. E-Business Suite, Siebel, SAP etc.) to set them – Try to adjust certain parameters based on testing, documentation and white papers  Don't trust statements such as ..."THE tuning guru said ..." Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 51
    • Parameter Recommendations - Info  June 6, 2012 https://www.pcworld.com/article/257045/6_5m_linkedin_passwords_posted_online_after_apparent_hack.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 52
    • Parameter Recommendations - Info  March 3, 2013: http://www.huffingtonpost.com/2013/03/03/evernote-hacked-50-million-passwords-reset_n_2801108.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 53
    • Parameter Recommendations  SEC_CASE_SENSITIVE_LOGON=TRUE – Enables or disables password case sensitivity – Default TRUE since Oracle Database 11g – Deprecated since Oracle Database 12c – Recommendation:  Age out passwords having PASSWORD_VERSIONS<11G  When recreated, passwords will get salted – This is a MUST – no discussion, please!!  Check if passwords have been adjusted: – SQL> select USERNAME, PASSWORD_VERSIONS from DBA_USERS; USERNAME PASSWORD_VERSIONS ---------- ----------------APP_USER 10G 11G 12C HR_USER 10G 11G 12C BOSS 10G Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 54
    • Parameter Recommendations sqlnet.ora  SQLNET.ALLOWED_LOGON_VERSION_SERVER – Determines minimum authentication protocol allowed by server – Default: 11 – Values:  12a for Oracle Database 12c authentication protocols (strongest protection)  12 for the critical patch updates CPUOct2012 and later Oracle Database 11g authentication protocols (recommended)  11 for Oracle Database 11g authentication protocols (default)  10 for Oracle Database 10g authentication protocols 8 for Oracle9i authentication protocol – If you connect with pre-11g clients to Oracle Database 12c you will have to adjust the setting in your sqlnet.ora file(s) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 55
    • Parameter Recommendations  AUDIT_TRAIL – Enables or disables database auditing – Attention: New Unified Auditing can be linked into the kernel  Unified Auditing is not enabled by default – Recommendation:  Migrate to Unified Auditing  Check if option is present : – SQL> select VALUE from V$OPTION where PARAMETER='Unified Auditing';  Switch Unified Auditing on – make -f ins_rdbms.mk uniaud_on ioracle ORACLE_HOME=$ORACLE_HOME  Set AUDIT_TRAIL=NONE – Note: Auditing table AUD$ will be moved into SYS schema if Label Security (OLS) is installed Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 56
    • Parameter Recommendations  DEFERRED_SEGMENT_CREATION – Newly created tables will just allocate segments when a first row gets inserted  Tablespace must be locally manages  COMPATIBLE ≥ 11.2.0 – Default is TRUE since Oracle Database 11.2 – Recommendation:  Set it to FALSE except for cases where an application creates a large number of empty tables with may never get used  Please note: – Small performance penalty when the first row is inserted, because the new segment must be created at that time – May cause contention issues using many Data Pump workers  See MOS Note 1216282.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 57
    • Parameter Recommendations  _OPTIMIZER_COST_BASED_TRANSFORMATION – See MOS Note: 1082127.1 for more details on CBQT  CBQT can add a high overhead at parse time but can yield considerable benefits by way of a better plan for the statement – Recommendation:  Due to limited gain and some open issues you may set it OFF  See MOS Note: 567354.1 about open issues and fixes: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 58
    • Parameter Recommendations  SESSION_CACHED_CURSORS – Default: 50 – Cursor caching mechanism was changed in Oracle 10.2.0.4 – Recommendation:  Explicitly adjust SESSION_CACHED_CURSORS as the default value of 50 may be too low, especially when PL/SQL is used – Too high values may lead to fragmentation in shared pool  Use MOS SCRIPT: 208857.1 to adjust parameters SESSION_CACHED_CURSORS and OPEN_CURSORS usage based  More information in MOS Note: 30804.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 59
    • Parameter Recommendations  _DATAFILE_WRITE_ERRORS_CRASH_INSTANCE=TRUE – Default: TRUE – For write errors to ANY data file, the default behavior has changed since patch set 11.2.0.2  An I/O write error to ANY data file will crash the instance  Setting it to FALSE would revert to the "old" behavior: – Write error will OFFLINE the data file if:  Database is in archivelog mode  Data file does not belong to the SYSTEM tablespace  In that case it would initiate a SHUTDOWN ABORT  See Bug 7691270 and MOS Note: 7691270.8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 60
    • Parameter Recommendations  MAX_STRING_SIZE – Values: STANDARD, EXTENDED – Controls the maximum size of VARCHAR2, NVARCHAR2, and RAW data types in SQL – STANDARD [DEFAULT]  Length limits prior to Oracle Database 12c apply – VARCHAR2/NVARCHAR2: 4000 bytes – RAW: 2000 bytes – EXTENDED  New 32767 byte limit applies  Requires COMPATIBLE ≥ 12.0.0 – Change from STANDARD  EXTENDED is allowed, but no way back – Database in UPGRADE mode: @?/rdbms/admin/utl32k.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 61
    • New Parameters in Oracle Database 12c                     CELL_OFFLOADGROUP_NAME CONNECTION_BROKERS DB_BIG_TABLE_CACHE_PERCENT_TARGET DB_INDEX_COMPRESSION_INHERITANCE DNFS_BATCH_SIZE ENABLE_PLUGGABLE_DATABASE HEAT_MAP MAX_STRING_SIZE NONCDB_COMPATIBLE OPTIMIZER_ADAPTIVE_FEATURES OPTIMIZER_ADAPTIVE_REPORTING_ONLY PARALLEL_DEGREE_LEVEL PARALLEL_FAULT_TOLERANCE_ENABLED PDB_FILE_NAME_CONVERT PGA_AGGREGATE_LIMIT SPATIAL_VECTOR_ACCELERATION TEMP_UNDO_ENABLED THREADED_EXECUTION UNIFIED_AUDIT_SGA_QUEUE_SIZE USE_DEDICATED_BROKER Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 62
    • Deprecated and Obsolete Parameters  Deprecated in Oracle Database 12c: – sec_case_sensitive_logon  Obsolete in Oracle Database 12c: – _app_ctx_vers – _log_io_size Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 63
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Upgrade 32/64bit Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 64
    • Case 1: Upgrade to Oracle Database 12c  Database upgrade including migration to a new server Example Facts & Description 1. Hardware migration 2. Database upgrade from Oracle 10.2.0.5 Linux 32bit to Oracle 12.1 Linux 64bit 3. Maximum tolerated downtime: 24 hours 4. Database size: 1TB 1TB 1TB 24 hrs Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 65
    • Case 1: Upgrade to Oracle Database 12c  Database upgrade including migration to a new server Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database 1TB Upgrade Database Post Upgrade Actions 1TB 24 hrs Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 66
    • Upgrade to Oracle Database 12c Oracle 7.3.4 Oracle 7.3 (GA: 1996) Oracle 8.0 (GA: 1997 Oracle 8.1 (GA: 1998) Oracle 8.0.6 Oracle 8.1.7.4 Oracle 9.0.1.4 Oracle 9.2.0.8 Oracle 101.0.5 Oracle 10.2.0.5 Oracle 11.10.7 Oracle 11.2.0.2 9.2.0.8 8.0.6 11.2.0.2 9.2.0.8 7.3.4 11.2.0.2 8.1.7.4 Oracle 9.0 (GA: 2001) Oracle 9.2 (GA: Jul 2002) Oracle 10.1 (GA: Jan 2004) Oracle 10.2 (GA: Jul 2005) Oracle 12.1.0.1 10.2.0.5 9.0.1.4 10.2.0.5 11.2.0.2 9.2.0.8 11.2.0.2 10.1.0.5 10.2.0.5 Oracle 11.1 DIRECT 11.1.0.7 (GA: Aug 2007) Oracle 11.2 DIRECT 11.2.0.2 (GA: Sep 2009) DIRECT Oracle 12.1 (GA: Jun 2013) Please note: This graph will apply to database upgrades only! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 67
    • What's new in upgrades to Oracle 12c?  New SQL Automation FixUp Scripts – Fixing issues before and after upgrade  Detailed recommendations  Parallel Upgrade – Saving up to 40% upgrade duration – Upgrade driven by catctl.pl, not catupgrd.sql anymore catctl.pl script1.sql script2.sql script3.sql script4.sql script7.sql script9.sql script5.sql script8.sql script10.sql script6.sql script11.sql script6.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 68
    • Information  Please note: – All of the following actions will apply to database upgrades without changing to new hardware as well – just skip the steps to copy files from one system to another – Some of the following steps can be executed in parallel or in a different order, especially during preparation phase – for simplification these steps are kept in a strongly sequential order for the slides only Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 69
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Installation of Oracle Database 12c 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 70
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Patch the new Oracle Database 12c home Apply the newest available Patch Set Update (PSU) or Apply recommended (bundled) patches (BP) Apply Interim Patches for known issues 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 71
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  New preupgrade scripts – preupgrd.sql and utluppkg.sql supersede utlu112i.sql  Copy ?/rdbms/admin/preupgrd.sql and ?/rdbms/admin/utluppkg.sql from your new Oracle 12c home to your "old" source $ORACLE_HOME/rdbms/admin  Start preupgrd.sql in your source database – You may start preupgrd.sql in source environment's SQL*Plus directly from the Oracle 12c home avoiding the copy operation 1TB Copy preupgrd.sql and utluppkg.sql Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 72
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  preupgrd.sql generates 1 log file and 2 scripts SQL> @?/rdbms/admin/preupgrd.sql generates its output in directory: $ORACLE_BASE/cfgtoollogs/V102/preupgrade preupgrade.log has detailed information about any findings, suggestions, warnings, corrections and errors in your source database preupgrade_fixups.sql is the script you will need run in your source database – it will fix some issues or direct to fixes the DBA has to implement postupgrade_fixups.sql 1TB is meant to run shortly after the upgrade and will fix open issues – and it will contain directions for manual interaction as well (eg time zone change) Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 73
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Run the new preupgrade script preupgrd.sql 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 74
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  If JAVAVM is not present or invalid or option off preupgrd.sql won't create output files – Workaround: $ $ $ $ cd $ORACLE_BASE/cfgtoollogs mkdir <DB_UNIQUE_NAME> cd <DB_UNIQUE_NAME> mkdir preupgrade Tracked as Bug14614756 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 75
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Output log: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 76
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Run preupgrade_fixups.sql: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 77
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Manual actions required: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 78
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Further manual actions may be recommended: – Remove Enterprise Manager Database Control Repository:  $> emctl stop dbconsole SQL> @?/rdbms/admin/emremove.sql  EM DB Control is superseded in 12c by EM Express – Therefore no repository is needed anymore – If the EM repository is not removed up front, it will be automatically removed during the catuppst.sql post-upgrade phase 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 79
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Further manual actions may be recommended: – Essential step if OLS (Label Security) and/or DV (Database Vault) was already in the database prior to the upgrade  SQL> @?/rdbms/admin/olspreupgrade.sql  Prepares the move of AUD$ table from SYSTEM to SYS  Processes the audit records to minimize downtime – Moves records to an interim temporary table  May require DV actions as well (see the documentation) 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 80
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Edit new init.ora: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 81
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Create a new password file: $> cd $ORACLE_HOME/dbs $> orapwd file=orapwV102 password=<string> entries=15 format=12 force=yes 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 82
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Enviroment: Set the 12.1 environment Set ORACLE_BASE, ORACLE_HOME, ORACLE_SID, TNS_ADMIN, TMP and TMPDIR Windows only: Create a new Service: oradim –NEW -SID ORASID -SYSPWD passwrd -STARTMODE a -PFILE initfile 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 83
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Listener configuration: Be aware if clients <11g connect – then you must set: SQLNET.ALLOWED_LOGON_VERSION_SERVER=10 1TB in $ORACLE_HOME/network/admin/sqlnet.ora Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 84
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Either restore and recover an RMAN Online Backup RMAN> run { SET ARCHIVELOG DESTINATION TO '/tmp/tmprest'; RESTORE DATABASE; RECOVER DATABASE; } – Create a fresh TEMP tablespace  Or copy all relevant files to the new server – Data files, redo logs, control files.  Network throughput is important! 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 85
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Changing to the same OS platform, but from 32bit  64bit – Change will be handled automatically as part of the upgrade – Special case: Keep the database version (not an upgrade!)  In the source environment: startup upgrade; @?/rdbms/admin/utlirp.sql shutdown immediate In the destination environment: startup upgrade @?/rdbms/admin/utlrp.sql  OLAP must be reloaded with xumuts.plb – see MOS Note:352306.1 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 86
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Start the database in STARTUP UPGRADE mode: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 87
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  What happens during STARTUP UPGRADE mode? – Suppresses more than 20 expected error messages such as ORA-942 Snippet taken from the alert.log during STARTUP UPGRADE: ALTER SYSTEM enable restricted session; ALTER SYSTEM SET _system_trig_enabled=FALSE SCOPE=MEMORY; Autotune of undo retention is turned off. ALTER SYSTEM SET _undo_autotune=FALSE SCOPE=MEMORY; ALTER SYSTEM SET undo_retention=900 SCOPE=MEMORY; ALTER SYSTEM SET aq_tm_processes=0 SCOPE=MEMORY; ALTER SYSTEM SET enable_ddl_logging=FALSE SCOPE=MEMORY; Resource Manager disabled during database migration: plan '' not set ALTER SYSTEM SET resource_manager_plan= SCOPE=MEMORY; ALTER SYSTEM SET recyclebin='OFF' DEFERRED SCOPE=MEMORY; Resource Manager disabled during database migration replication_dependency_tracking turned off (no async multimaster replication found) 1TB AQ Processes can not start in restrict mode Completed: ALTER DATABASE OPEN MIGRATE Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 88
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  New parallel upgrade script – Default feature in Oracle Database – SERVER component upgrade scripts get executed in parallel, where possible – Other non-dependent components are run in parallel – Overall time to upgrade is reduced between 20% and 40% catctl.pl – Parallel upgrade is driven by a PERL script script1.sql script2.sql script3.sql script4.sql script7.sql script9.sql script5.sql script8.sql script10.sql script6.sql script11.sql script6.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 89
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions Parallel Upgrade – Customer Examples  Telco System, Japan Test upgrade from Oracle 9.2.0.8 to Oracle 11.2.0.3 Serial/Default Parallel 1046 ORACLE SERVER Component Upgrade 669 0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 500 36% faster 1000 1500 seconds Upgrade, Migrate and Consolidate to Oracle Database 12c 90
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions Parallel Upgrade – Customer Examples  Payback GmbH, Germany Upgrade from Oracle 11.1.0.7 to Oracle 11.2.0.3 on Exadata X2-2 Serial/Default 539 ORACLE SERVER Component Upgrade 37% faster 338 0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 200 Parallel 400 Upgrade, Migrate and Consolidate to Oracle Database 12c seconds 600 seconds 91
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Upgrade duration to Oracle 12c mainly depends on: – Number of installed components and database options – Number of objects in the database due to high amount of new dictionary tables, and restructuring of some base system tables – CPU Speed Component HH:MM:SS Oracle Server 00:16:17 JServer JAVA Virtual Machine 00:05:19 Component HH:MM:SS Oracle Workspace Manager 00:01:01 Oracle Server 00:16:17 Oracle Enterprise Manager 00:10:13 JServer JAVA Virtual Machine 00:05:19 Oracle XDK 00:00:48 Oracle XDK 00:00:48 Oracle Text 00:00:58 Oracle Text 00:00:58 Oracle XML Database 00:04:09 Oracle XML Database 00:04:09 Oracle Database Java Packages 00:00:33 Oracle Database Java Packages 00:00:33 Oracle Multimedia 00:07:43 Gathering Statistics 00:02:43 Oracle Expression Filter 00:00:18 Oracle Rule Manager 00:00:12 Gathering Statistics 00:04:53 Total Upgrade Time: 00:30:47 Total Upgrade Time: 00:52:31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 92
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Speed up the upgrade – Create fresh dictionary statistics the night before the upgrade  SQL> exec DBMS_STATS.GATHER_DICTIONARY_STATS; – Create statistics for a specific XDB table if XDB is in use  SQL> exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'XDB', tabname=>'XDB$RESOURCE', estimate_percent=>NULL); – Preprocess missing entries in AUD$ if auditing was/is on  MOS Note: 1329590.1 offers a script to populate missing entries  If auditing was/is on by accident: – SQL> truncate table SYS.AUD$ | SYSTEM.AUD$; – If Oracle APEX is used consider to upgrade it separately  See MOS Note:1088970.1: Master Note for Oracle APEX Upgrades Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 93
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Start the upgrade on the Shell with catctl.pl in parallel: • catctl.pl is the PERL driver • Will execute the upgrade scripts in parallel where possible • Executes catuppst.sql and catbundle.sql as well • -n y determines the parallel degree • Maximum of 8 parallel threads 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 94
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Progress monitoring while catctl.pl is running: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 95
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Default location for catctl.pl log files: • Current working directory • Hint: use –l parameter to specify location • One log file for each parallel thread 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 96
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Restart the database in normal mode – Create an spfile from the startup init.ora now 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 97
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Recompilation with utlrp.sql – SQL> @utlprp n can be called directly to customize CPU usage  Most efficient value for n is 2x number of CPU cores – Gathering fixed objects stats may speed up recompilation  SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS; 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 98
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Monitoring while utlrp.sql is running: 1. Objects requiring compilation: SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6); 2. Objects compiled already: SELECT COUNT(*) FROM UTL_RECOMP_COMPILED; 3. Parallel jobs created by UTL_RECOMP: SELECT job_name FROM dba_scheduler_jobs WHERE job_name like 'UTL_RECOMP_SLAVE_%'; 4. Parallel jobs still running: SELECT job_name FROM dba_scheduler_running_jobs WHERE job_name like 'UTL_RECOMP_SLAVE_%'; 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 99
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  New status in DBA_REGISTRY for the SERVER component in case of any error before recompilation: COMP_ID COMP_NAME VERSION STATUS -------- ----------------------------------- ----------- ---------CATALOG Oracle Database Catalog Views 12.1.0.1.0 INVALID CATPROC JAVAVM CATJAVA ... Oracle Database Packages and Types JServer JAVA Virtual Machine Oracle Database Java Packages 12.1.0.1.0 12.1.0.1.0 12.1.0.1.0 INVALID VALID VALID – Check REGISTRY$ERROR for error details – After recompiliation the status remains the same compared to previous releases Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 100
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Execute postupgrade_fixups.sql: 1509653.1 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 101
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Run upgrade status check: utlu121s.sql: 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 102
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Run invalid objects check: utluiobj.sql – Check also DBA_INVALID_OBJECTS SQL> select OWNER, OBJECT_NAME, OBJECT_TYPE from DBA_INVALID_OBJECTS 1TB order by 1,2; Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 103
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Time zone adjustment – Time zone conversion should be done post upgrade – Required if datatype TIMESTAMP WITH TIME ZONE is used – Rule: TZDestination ≥ TZSource – Time zone definitions in: $ORACLE_HOME/oracore/zoneinfo Oracle Database Release Default Time Zone Vers. 10.2.0.3 – 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 DST V14 12.1.0.1 DST V18 Most recent interim patch: See MOS Note:412160.1 DST V20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 104
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Time zone adjustment – Why is this important? – Real World Example from 2012:  Why is the flight 1 hour shorter on Saturday? – Neither a faster jet nor better winds are the reason ... it's DST!!! » The USA moves to daylight savings time at 2:00 on 11-MAR-2012 » Germany does not change until 25-MAR-2012 » In 2013 it works better  Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 105
    • Install and patch Oracle 12c Preupgrade Checks Prepare Environment Restore Entire Database Upgrade Database Post Upgrade Actions  Time zone adjustment: Use the scripts from MOS Note:1509653.1 (or MOS Note:977512.1: Updating the RDBMS DST version in 11.2) Database will be restarted! 1TB Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 106
    • Case 1: Alternative without HW migration  If the database would have been upgraded on the existing hardware the Database Upgrade Assistant (DBUA) would have been an alternative Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 107
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 108
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 109
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 110
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 111
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 112
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 113
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 114
    • Case 1: Alternative without HW migration  DBUA: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 115
    • Case 1: Summary  Database upgrade including migration to a new server 1TB 1TB 24 hrs Oracle 10.2.0.5 Oracle 12.1.0.1 RHEL4 – 32bit OEL6– 64bit Install and patch Oracle 12c Preupgrade Checks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Prepare Environment Restore Entire Database Upgrade, Migrate and Consolidate to Oracle Database 12c Upgrade Database Post Upgrade Actions 116
    • Hands-On-Lab – Part 1 Upgrade a database to Oracle Database 12c Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 117
    • Hands-On-Lab – Part 1 Your first task will be: Upgrade a database to Oracle Database 12c – You will upgrade an Oracle 10.2.0.5 database – On command line – Do all the pre- and post-upgrade fixes  Please ask if you have questions … anytime!!!  Precaution: This is not a scripted demo lab – you'll have to type  Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 118
    • Hands-On-Lab – Part 1  Your environment: – Oracle Virtual Box image – OS user:  oracle – password: oracle  root – password: oracle – Database user:  sys – password: oracle  system – password: oracle – Listener: /u01/app/oracle/product/12.1.0/network/admin Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 119
    • Hands-On-Lab – Part 1  Switching between environments for V102: Oracle 10.2.0 environment Database SID: V102 $ORACLE_HOME for Oracle 10.2.0.5  /u01/app/oracle/product/10.2.0 $> . db10 Type in an xterm: <DOT><BLANK>db10 Oracle 12.1.0 environment Database SID: V102 $ORACLE_HOME for Oracle 12.1.0.1  /u01/app/oracle/product/12.1.0 $> . db10c Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Type in an xterm: <DOT><BLANK>db10c Upgrade, Migrate and Consolidate to Oracle Database 12c 120
    • Hands-On-Lab – Part 1  Make sure CPU virtualization is turned on in the BIOS: – E.g. Lenovo – Change both settings to ENABLED: – Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 121
    • Hands-On-Lab – Part 1  Make sure CPU virtualization is turned on in the BIOS: – E.g. DELL – Change setting(s) to ENABLED: – Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 122
    • Hands-On-Lab – Part 1  Getting started: – Copy the image from the USB drive to e.g. C:VMHOL – Double-click on: – The startup will take a few minutes – 4 GB RAM and two cores will be allocated. If your laptop has <8 GB RAM, you may need to reduce the RAM in the VM. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 123
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases RAC Upgrade + ASM Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 124
    • Case 2: Upgrade RAC and move to ASM  RAC Database migration to a new cluster including upgrade Example Facts & Description 1. Hardware migration to a new cluster 2. Database upgrade from Oracle 10.2.0.5 Linux 32bit to Oracle 11.2.0.3 Linux 64bit 3. Migration from OCFS into Oracle ASM 4. Maximum tolerated downtime: 4 hours 5. Database size: 5TB 5TB 5TB 4 hrs Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 125
    • Case 2: Upgrade RAC and move to ASM  RAC Database migration to a new cluster including upgrade Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Restore Online Backup for Standby Prepare Environment and ASM 5TB Activate and Upgrade Post Upgrade Actions 5TB 4 hrs Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 126
    • Physical Standby Migration  Using a physical standby database to move to new hardware with minimal downtime – Fast and simple to setup and maintain – The entire process can be tested over and over again  With minimal impact on production – It would even work cross platform in some cases:  For supported combinations see: Note:413484.1 – HP-PA 11.23  HP-IA64 in Oracle ≥10.2.0.2 » See: Note:395982.1 – MS Windows  Linux from Oracle ≥ 11g – Solaris x86  Linux x86 from Oracle ≥ 11g  But currently no cross-Endianness combinations possible Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 127
    • RMAN Mixed Platform Support  RMAN duplicate/restore/recovery Mixed Platform Support – Note:1079563.1 – Mixed platforms are only supported for:    Active Database DUPLICATE Backup-based DUPLICATE using image copies or backup sets RESTORE and RECOVER using image copies or backup sets  The following platform combinations are supported (in both directions): – Oracle 10.2 and above:  Solaris x64  Linux x64  HP PA RISC  HP Itanium  Windows IA64  Windows 64-bit for AMD / Windows (x86-64) – Oracle 11.1 and above (COMPATIBLE ≥ 11.1):  Linux  Windows – If there's a bit change involved (3264) then utlirp.sql has to be run to invalidate all PL/SQL and stored code Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 128
    • Migration to ASM  Option with downtime: – Restore database with RMAN into Oracle ASM  Option with less than 1 minute downtime: – Restore database for Standby with RMAN into Oracle ASM – If no database upgrade is required:  Simple role exchange: Switchover – If a subsequent database upgrade is required:  Activate the standby database  Upgrade the activated database  In case of failure the source database remains unchanged Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 129
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Always install (or later: upgrade) Oracle Clusterware first! – Install it into a new Grid Infrastructure home – The grid infrastructure version must be greater than or equal to the version of the resources it manages e.g. ASM, RDBMS – Parts of Grid Infrastructure home are owned by 'root‘ – Make sure to check Note:948456.1 for known issues 5TB Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 130
    • Grid Infrastructure Installation  Oracle Home/Base – ORACLE_BASE for GI should be different than the ORACLE_BASE for Oracle Database – Each installation user should have its own Oracle Base Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 131
    • GI Upgrade Planning, Prep and Prereqs  RAC Best Practice and Starter Kit – The goal of the Oracle Real Application Clusters (RAC) Best Practice and Starter Kit is to provide you with the latest information on generic and platform specific best practices for implementing an Oracle RAC cluster – Always start with the Generic note, and then refer to platform specific notes – MOS Note: 810394.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Generic) – MOS Note: 811306.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Linux) – MOS Note: 811271.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Windows) – MOS Note: 811293.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (AIX) – MOS Note: 811303.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (HP-UX) – MOS Note: 811280.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Solaris)  Plus additional VERY useful notes: – MOS Note: 1096952.1 - Master Note for RAC, Clusterware and Grid Infrastructure – MOS Note: 1053147.1 - 11.2 Clusterware and Grid Home – What you need to know! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 132
    • RAC Check  RACcheck 2.2.2 has been released June 18, 2013 – RACcheck is a RAC configuration audit tool for RAC, CRS, ASM,GI – Checks for:  OS kernel parameters, OS packages, OS settings etc  CRS/Grid Infrastructure, RDBMS, ASM, Database parameters  11.2.0.3 Upgrade Readiness assessment – RACcheck 11.2.0.3 Upgrade Readiness Assessment MOS Note:1457357.1 – RACcheck Users Guide https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1268927.1:RACCHECKUSERSGUIDE&clickstream=no  Available for download via MOS Note:1268927.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 133
    • GI Home: Planning, Prep and Prereqs  11.2 Grid Infrastructure Home cannot reside on a shared cluster file system e.g. ocfs2, Veritas CFS – NFS based shared storage is supported – Installer will allow move from 10.2 on CFS to 11.2 on non-CFS  All cluster nodes must be up and running – Remove any down nodes, or start them if possible  Unset environment variables ORACLE_HOME, ORACLE_BASE and ORA_CRS_HOME for the installing user - the install scripts handle these  Avoid OUI AttachHome issues – Set the following parameter in the SSH daemon configuration file /etc/ssh/sshd_config on all cluster nodes before running OUI  LoginGraceTime 0 – Restart sshd  Provision network resources for Single Client Access Name (SCAN) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 134
    • SCAN: Planning, Prep and Prereqs  Oracle Database 11.2 Clients connect to the database using SCAN VIPs  The SCAN is associated with the entire cluster rather than an individual node  Resolves to up to 3 IP Addresses in DNS or GNS – IP addresses returned in a round-robin manner  SCAN listeners run under the Grid Infrastructure Home  Provides load balancing and failover for client connections  Check this white paper for more details: – Oracle Real Application Clusters 11g Release 2 Overview of SCAN (PDF) http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 135
    • SCAN: Planning, Prep and Prereqs  SCAN VIPs - Network Requirement – A single client access name (SCAN) configured in DNS [root@cluster1 oracle]# nslookup mycluster-scan1 Server: 120.20.190.70 Address: 120.20.190.70#53 Name: mycluster -scan1.mydomain.com Address: 10.148.46. 79 Name: mycluster -scan1.mydomain.com Address: 10.148.46. 77 Name: mycluster -scan1.mydomain.com Address: 10.148.46. 78 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 136
    • Completing the Upgrade  Top Level Flow: – Verify the hardware/software environment – Install the software – Configure the software – Finalize the upgrade Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 137
    • Completing the Upgrade  Top Level Flow: – Verify the hardware/software environment  Secure Shell – We recommend using OUI to set up ssh » Old ssh setup not always considered valid by 11.2 OUI, due to tighter restrictions, but OUI will correct it – OUI will validate ssh before allowing you to continue » Watch out for stty commands or profile messages that may cause the automatic setup of ssh to fail  Cluster Verification Utility – Integrated into OUI but recommended to run before an install/upgrade – Has “fixup scripts” to correct certain failures (e.g. kernel parameters) – The most recent version is available from OTN » http://www.oracle.com/technetwork/products/clustering/overview/index.html – Install the software – Configure the software – Finalize the upgrade Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 138
    • Completing the Upgrade  Top Level Flow: – Verify the hardware/software environment – Install the software  Oracle Universal Installer – ./runInstaller – Should find existing Oracle Clusterware and suggest upgrade to Grid Infrastructure – Must run installer as the previous version's software owner – If you need to collect debug tracing (request from support) » ./runInstaller -debug » Output is written to stdout by default » Use script command to capture the output – Configure the software – Finalize the upgrade Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 139
    • Grid Infrastructure 11.2  Additional information: Pinning nodes [from documentation] In order to change the node pin behavior the appropriate command is the /crsctl pin/unpin css/ command, to pin or unpin any specific node. Pinning a node means that the association of a node name with a node number is fixed. If a node is not pinned, its node number may change if the lease expires while it is down. The lease of a pinned node never expires. Deleting a node with the /crsctl delete node/ command implicitly unpins the node. – During upgrade of Oracle Clusterware, all servers are pinned, whereas after a fresh installation of Oracle Clusterware 11/g /release 2 (11.2), all servers you add to the cluster are unpinned. – You cannot unpin a server that has an instance of Oracle RAC that is older than Oracle Clusterware 11/g/ release 2 (11.2) if you installed Oracle Clusterware 11/g/ release 2 (11.2) on that server. Pinning a node is required for rolling upgrade to Oracle Clusterware 11.2 and will be done automatically. We have seen cases where customer perform a manual upgrade and this would fail due to unpinned nodes. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 140
    • Grid Infrastructure Installation 11.2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 141
    • Grid Infrastructure Installation 11.2 Node Selection and SSH Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 142
    • Grid Infrastructure Installation 11.2 Grid Home Make sure that BASE and SW location are different subdirectories – the slide has it the wrong way!!! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 143
    • Grid Infrastructure Installation 11.2 Setup ASM Roles Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 144
    • Grid Infrastructure Installation 11.2 Cluster Verification Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 145
    • Grid Infrastructure Installation 11.2 Cluster Verification Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 146
    • Grid Infrastructure Installation 11.2 Cluster Verification root> /tmp/CVU_11.2.0.1.0_grid/runfixup.sh Response file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.response Enable file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.enable Log file location: /tmp/CVU_11.2.0.1.0_grid/orarun.log Setting Kernel Parameters... fs.file-max = 327679 fs.file-max = 6815744 net.ipv4.ip_local_port_range = 9000 65500 net.core.wmem_max = 262144 net.core.wmem_max = 1048576 uid=501(grid)gid=502(oinstall)groups=502(oinstall), 503(asmadmin),504(asmdba) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 147
    • Grid Infrastructure Installation 11.2 Cluster Verification Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 148
    • Grid Infrastructure Installation 12c Management Repository Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 149
    • Grid Infrastructure Installation 12c Management Repository Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 150
    • Clusterware - ASM - DB Compatibility Note: 337737.1 a) The Matrix is valid after the (rolling) upgrade has been completed. During the upgrade you may use an older ASM version. b) The ASM version needs to be at least 10.1.0.3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 151
    • Oracle Clusterware & ASM Upgrade  Documentation: – Oracle Clusterware Administration and Deployment Guide 11g http://download.oracle.com/docs/cd/E11882_01/rac.112/e16794/toc.htm  Grid Infrastructure Upgrade Known Issues: –  Oracle Clusterware rolling upgrade: –  Note: 948456.1: Pre 11.2 Database Issues in 11gR2 Grid Infrastructure Note: 338706.1: Oracle Clusterware Rolling Upgrades RAC Best Practices Starter Kit: – –  Note:810394.1: RAC Assurance Support Team: RAC and Oracle Clusterware Starter Kit and Best Practices (Generic) Also see platform-specific notes linked from the generic starter kit Upgrading an ASM instance with OUI within Oracle Clusterware upgrade: OUI or asmca –upgrade – http://docs.oracle.com/cd/E11882_01/server.112/e16102/asminst.htm#CHDGFHDC Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 152
    • Oracle Grid Infrastructure Patch Sets  Oracle Grid Infrastructure Patch Set 11.2.0.3: Patch set is a bit misleading: it’s a full release! – Installation is out-of-place only into a separate home – To upgrade from GI 11.2.0.1 to GI 11.2.0.2 or later: –  Apply PSU 11.2.0.1.2 (or newer) in-place – – – Rolling upgrade ASM issue for 11.2.0.1=>11.2.0.2 (bug 9329767) Rolling upgrade ASM issue for 11.2.0.2=>11.2.0.3 (bug12539000) RAC/Grid Infrastructure Upgrade Note:   – Note:810394.1: RAC Assurance Support Team: RAC and Oracle Clusterware Starter Kit and Best Practices (Generic) Also see platform-specific notes linked from the generic starter kit VERY IMPORTANT:  Follow all instructions in Note:1212703.1 – –  Make sure MULTICAST is setup correctly Note:1054902.1 – section D Make sure to check Oracle Database Readme 11g Release 2 Section 1.37 - "Open Bugs“ Then upgrade GI within OUI Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 153
    • Oracle EXADATA 11.2.0.3 Patching  11.2.0.1/11.2.0.2 to 11.2.0.3 Database Upgrade on Exadata Database Machine in Note:1373255.1 – MULTICAST is already setup correctly on a Database Machine V2  For certification, recommendations, issues, current patches etc. see Note:888828.1 Database Machine and Exadata Storage Server 11.2 Supported Versions Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 154
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Database software installation: – Oracle Database 11.2.0.3 – Oracle Database 10.2.0.1 plus patch set 10.2.0.5 5TB Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 155
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Download preupgrade check script utlu112i.sql – See MOS Note:884522.1  Run utlu112i.sql in the source database – Without script execution the upgrade won't proceed 5TB Copy utlu112i.sql or download it 884522.1 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 156
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Note 452924.1 - How to Prepare Storage for ASM – Raw disk – Logical unit numbers (LUNs) – Raw logical volumes (LVM)  LVM configurations are not recommended – NFS files  Suitable for testing only 5TB Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 157
    • Configuring ASM with ASMCA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 158
    • Configuring ASM with ASMCA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 159
    • Configuring ASM with ASMCA DB0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 160
    • Configuring ASM with ASMCA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 161
    • Case 2: Upgrade RAC and move to ASM  RAC Database migration to a new cluster including upgrade Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Restore Online Backup for Standby Prepare Environment and ASM Activate and Upgrade Post Upgrade Actions 5TB 4 hrs Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 162
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Source Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions Destination Make sure archive logging is on Switch on Force Logging Create identical trace file structure Copy Online Backup to DESTINATION Create a password file with identical PW Adjust init.ora Adjust init.ora Adjust tnsnames.ora Adjust listener.ora and tnsnames.ora Restore backup into ASM Adjust controlfile names Switch on log transport 5TB Switch on managed recovery mode Restore backup 5TB Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 163
    • Restore Backup into ASM  Make sure the backup is available on DESTINATION – rman target / connected to target database (not started) – RMAN> startup nomount – RMAN> restore spfile to pfile "$ORACLE_HOME/dbs/initSTY.ora" from "$ORACLE_BKD/my.spfile";  Modify init.ora: – *.db_create_file_dest=’+DG1′ – *.db_recovery_file_dest=’+FRA1′  Connect again with RMAN to restore the backup into ASM – rman target sys/password@source auxiliary / – RMAN> startup auxiliary nomount; – RMAN> duplicate target database for standby dorecover;  Move OCR and Voting Disk from ASM to raw  Rename controlfiles and switch on log transport and recovery Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 164
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Stop on production  Final synchronisation and activate standby  Upgrade – SQL> @?/rdbms/admin/catupgrd.sql – SQL> @?/rdbms/admin/catuppst.sql – SQL> @?/rdbms/admin/utlrp.sql 5TB 5TB Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 165
    • Synch and Activate Standby  Stop the application on SOURCE  Get the last changes written into logfiles on all nodes – SQL> alter system archive log current;  Stop the production database on SOURCE – $> srvctl stop database -d PROD  Check if logfile got shipped and applied  Stop managed recovery for the standby on DESTINATION – SQL> alter database recover managed standby database cancel; – SQL> shutdown immediate;  Bring the standby back in mount and initiate the activation: – SQL> alter database recover managed standby database finish skip standby logfile; – SQL> alter database commit to switchover to primary:  Create temporary tablespaces Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 166
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Prepare Environment and ASM Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Register the database and its instances to Clusterware – $> srvctl add database -d PROD -o /oracle/base/product/11.2.0/dbhome -p '+DG1/prodspfile.ora' – $> srvctl add instance -d PROD -i PROD1 -n mynode1 – If you upgrade without moving to new hardware you'll execute:  $> srvctl upgrade database –d <SID> -o <new$OH> 5TB 5TB Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 167
    • Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Prepare Environment and ASM Preupgrade Checks Restore Online Backup for Standby Activate and Upgrade Post Upgrade Actions  Advance ASM diskgroup compatibility – ASMCA> alter diskgroup data set attribute 'compatible.asm'='11.2'; – ASMCA> alter diskgroup data set attribute 'compatible.rdbms'='11.2';  Move OCR and Voting into ASM – $> ocrconfig -add +data – $> ocrconfig -delete /dev/raw/raw1 – $> crsctl replace votedisk +VOTING  Set CLUSTER_DATABASE to TRUE and start the instances on all nodes 5TB 5TB Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 168
    • Important Notes and White Papers  TWP: Migration to Oracle ASM http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2asmmigrationwithdg-133513.pdf  Note 452924.1 - How to Prepare Storage for ASM  Note 265633.1 - ASM Technical Best Practices  Note 249992.1 - New Feature on ASM (Automatic Storage Manager)  Note 345180.1 - How to duplicate a controlfile when ASM is involved  Note 252219.1 - Steps To Migrate/Move a Database From Non-ASM to ASM And Vice- Versa  Note: 787793.1 - Creating a physical standby from ASM primary – Note:1079563.1 - RMAN duplicate support for mixed platform – Note: 430278.1 - Can you restore RMAN backups taken on 32-bit Oracle with 64-bit Oracle? Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 169
    • Case 2: Summary  RAC Database migration to a new cluster including upgrade 5TB 5TB 4 hrs Oracle 10.2.0.5 Oracle 10.2.0.5 Oracle 11.2.0.3 RHEL4 – 32bit PHYSICAL STANDBY OEL5.8 64bit Install and patch: GI and DB 11.2.0.3 DB 10.2.0.5 Preupgrade Checks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Prepare Environment and ASM Restore Online Backup for Standby Upgrade, Migrate and Consolidate to Oracle Database 12c Activate and Upgrade Post Upgrade Actions 170
    • Real World Checkpoint Customer Project  The Customer: Interhyp AG – HQ in Munich, Germany – Bank for residential and Constraints Preparation development financing – Offering banking service to other German key banks as well – 100% subsidiary of Dutch ING Bank Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 171
    • Real World Checkpoint Customer  Project scope: – Upgrade 6x 2-node-RAC systems all on Project Constraints Preparation Oracle 10.1.0.5 on RH Linux 32bit – Target:  Oracle RAC 11.2.0.2 with ASM  RH Linux 64bit – Hardware exchange for key systems  4-node cluster Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 172
    • Real World Checkpoint Customer  Constraints: – Downtime window limited to 4 hrs per database  Migrations to be done serially, not in parallel Project – Not the fastest network connection Constraints – LOBs in the source database  First tests with Data Pump on NETWORK_LINK Preparation didn't fit into the downtime requirements Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 173
    • Real World Checkpoint Customer  Prepare new cluster – Install Oracle Grid Infrastructure 11.2 and patch it Project – Decrease upgrade duration to ~30 minutes  Remove unused components from production Constraints database Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 174
    • Real World Checkpoint Customer Project Constraints Preparation  Build up a physical standby database on the new cluster – Oracle 10.1.0.5  Oracle 10.1.0.5 within 11.2 ASM Note: This is officially not supported but will work – Goal: Activate and upgrade the standby database  Advantage: This can be tested many times without impacting the production system Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 175
    • Real World Checkpoint Customer  Upgrade – Activate standby and start in STARTUP UPGRADE Project Constraints  Invalidate and compile all packages/code (32bit  64bit!) – Register database to Clusterware and move OCR/Voting to ASM Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 176
    • Real World Checkpoint Customer  Live? And alive? – Yes!!! Go Live: 27-NOV-2010 Project – Total downtime: ~2 hours – Database upgrade time: Constraints 24 minutes + 5 minutes recompilation – Very robust using the entire Oracle software stack Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 177
    • Real World Checkpoint Customer  Well ... the optimizer ... – We found some optimizer issues Project  Reports were affected  Remedy: Hints, rewrite and patches plus SQL Constraints Profiles Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 178
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Endianness Migration Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 179
    • Case 3: Cross Endianness Migration  Migration of a single instance database to Exadata Example Facts & Description 1. Hardware migration to an Exadata Database Machine 2. Cross Endianness database migration from Oracle 9.2.0.8 to Oracle 11.2.0.3 3. Maximum tolerated downtime: 24 hours 4. Database size: 8TB 8TB 8TB 24 hrs Oracle 9.2.0.8 Oracle 11.2.0.3 HP-UX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 180
    • Case 3: Cross Endianness Migration  Options with Oracle 9i: – exp and imp  Import of all versions  Oracle V5 possible – exp is not supported for general use since Oracle 11g » But the utility is still there and can be used – imp is still supported for importing older dumpfiles  Neither fast nor reliable nor comfortable 8TB 8TB 24 hrs Oracle 9.2.0.8 Oracle 11.2.0.3 HP-UX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 181
    • Case 3: Cross Endianness Migration  Options since Oracle 10g: – Data Pump expdp and impdp  Usally the first option as it is easy and powerful – Cross platform Transportable Tablespaces (TTS)  More complicated, more manual steps than Data Pump SWING 8TB 8TB 8TB 24 hrs Oracle 9.2.0.8 Oracle 11.2.0.3 Oracle 11.2.0.3 HP-UX HP-UX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 182
    • Case 3: Cross Endianness Migration  Migration of a single instance database to Exadata Prepare a new database on EXADATA Restore online backup to SWING Upgrade database on SWING Full database import via NETWORK_LINK Post Migration Actions SWING 8TB 8TB 8TB 24 hrs Oracle 9.2.0.8 Oracle 11.2.0.3 Oracle 11.2.0.3 HP-UX HP-UX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 183
    • Data Pump Overview  The “new” faster export-import – Available starting with Oracle 10.1 – Powerful concept:  Restartable via job interface  Command line and API (DBMS_DATAPUMP)  PARALLEL export and import of data (single-threaded for metadata)  EXCLUDE & INCLUDE (For examples see MOS Note:341733.1)  COMPRESS=ALL starting in Oracle 11.1 (requires Advanced Compression Option)  NETWORK_LINK for direct import via a database link  Master Note for Data Pump: MOS Note:1264715.1  For Compatibility and version changes: MOS Note:553337.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 184
    • Data Pump Overview  Limitations – Not compatible with "old" exp/imp  "Old" par files can be used since Oracle 11.2 with the legacy interface, but will not take advantage of new features such as parallelism  “Old” exp dump files cannot be imported by Data Pump – Restrictions:  For Oracle 10.2, handles everything except for XMLSCHEMA types  As of Oracle 11.1, handles all data types  Known Issues: Master Note for Data Pump: MOS Note:1264715.1 – LONG and LOB data  Generally slow because of the data type implementation  STRONG RECOMMENDATION to migrate to SecureFiles – Data Pump can work in parallel on SecureFiles type – New in Oracle 12c: TRANSFORM=LOB_STORAGE:SECURE_FILE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 185
    • Data Pump Best Practices  For full exports the role EXP_FULL_DATABASE is required  For export consistency use: – FLASHBACK_TIME=SYSTIMESTAMP  This will increase UNDO requirements for the duration of the export  Always set parameters: – EXCLUDE=STATISTICS – METRICS=YES  Speed up Data Pump: – PARALLEL=n  Typically n = 2x <number of CPU cores> – EXCLUDE=INDEXES on import 1. Initial impdp with EXCLUDE=INDEXES 2. Second impdp with INCLUDE=INDEXES SQLFILE=indexes.sql 3. Split indexes.sql into multiple SQL files and run in multiple sessions Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 186
    • Data Pump Best Practices  Direct import from source to target over a database link – Parameter: NETWORK_LINK – Run only impdp on the target system - no expdp necessary – No dump file written, no disk I/O, no file transfer needed  Restrictions of database links apply: – Does not work with LONG/LONG RAW and certain object types  Performance depends on network bandwidth and target system's CPU capacity $ expdp ... Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 187
    • Data Pump Best Practices NETWORK_LINK – Customer Example from OOW 2011  Kaiser Permanente, Medicare (USA) – impdp on NETWORK_LINK with 8 vs 16 CPU cores  A 10GBit connection could be leveraged up to 8 Gbit  Copied a Terabyte table in 15+ minutes  4 TB/hour Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 188
    • Data Pump Filtering  Filtering is very powerful – If using EXCLUDE parameter, everything else is included – If using INCLUDE parameter, everything else is excluded – Can’t use exclude and include in the same Data Pump job – Specify complete path or partial path  Objects matching the specified path will be excluded/included  Query to find exclude/include object types: – select unique seq_num, full_path from sys.datapump_paths where het_type = 'DATABASE_EXPORT' order by seq_num; – Job_type: FULL SCHEMA TABLE TRANSPORTABLE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. het_type: DATABASE_EXPORT SCHEMA_EXPORT TABLE_EXPORT TRANSPORTABLE_EXPORT Upgrade, Migrate and Consolidate to Oracle Database 12c 189
    • Data Pump Filtering  EXCLUDE example expdp system/manager schema=hr exclude=statistics … vs expdp system/manager schema=hr exclude=SCHEMA_EXPORT/TABLE/STATISTICS select unique SEQ_NUM, FULL_PATH from SYS.DATAPUMP_PATHS where HET_TYPE = 'SCHEMA_EXPORT' AND FULL_PATH like '%STATISTICS%‘ order by SEQ_NUM; 77 78 221 222 223 225 226 227 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS SCHEMA_EXPORT/TABLE/INDEX/STATISTICS SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS SCHEMA_EXPORT/TABLE/STATISTICS SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS SCHEMA_EXPORT/TABLE/STATISTICS/USER_PREF_STATISTICS Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 190
    • Data Pump Filtering  INCLUDE example impdp system/manager tables=hr.employees vs impdp system/manager schemas=hr include=table:"= 'EMPLOYEES'" – Same results – Includes all objects that have table in the path vs impdp system/manager schemas=hr include=table/table:"= 'EMPLOYEES'“ – Only includes the table definition – Some of the TABLE object paths SCHEMA_EXPORT/TABLE/TABLE SCHEMA_EXPORT/TABLE/TABLE_DATA SCHEMA_EXPORT/TABLE/GRANT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 191
    • Data Pump News in Oracle 12c  Full transportable export/import for an entire database  Support for multitenant container databases and pluggable databases  New VIEWS_AS_TABLES parameter – Lets you export the contents of a view as a table  New TRANSFORM options – TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y  Will disable archive logging during import for tables and/or indexes – TRANSFORM=LOB_STORAGE:SECURE_FILE – TRANSFORM=STORAGE:N – TRANSFORM=TABLE_COMPRESSION:<compression_clause>  New LOGTIME=[ NONE | STATUS | LOGFILE | ALL ] option – Will write timestamps on status and/or logfile messages Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 192
    • Data Pump News in Oracle 12c  TRANSFORM option to enable Advanced/HCC Compression – Example:  TRANSFORM=TABLE_COMPRESSION:"compress for query high" – But: Granularity only on the entire import  Workarounds: – Precreate objects » Downside: Will slow down import!!! or: – Precreate the tablespace with COMPRESS option » create tablespace ARCHIGH datafile 'archigh.ora' size 100G default compress for archive high; – Then run Data Pump with TRANSFORM=TABLE_COMPRESSION:N » This will drop all embedded compression attributes associated with the tables » Now tablespace compression option will be used for all newly created tables Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 193
    • Real World Checkpoint Customer  The Customer: Payback GmbH Project Constraints Preparation Upgrade – Belongs to Loyalty Partner GmbH which belongs to American Express – HQ in Munich, Germany – Develops and operates professional customer loyalty programs based on customized IT solutions – Provider for Payback, Europe's largest bonus program Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 194
    • Real World Checkpoint Customer  Project scope: – Migrate 7 TB and 1.5 TB from HP-UX to Exadata Project V1  Cross platform, cross Endianness, cross version Constraints – Oracle 9.2.0.7 on HP-UX to Oracle 11.1.0.7 on OEL Preparation  4 months planning and migration phase – August to November 2009 Upgrade  Proposed go-live date – 15-NOV-2009 Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 195
    • Real World Checkpoint Customer  Constraints: – Move everything in less than 24 hrs Project – Network bottleneck  Customer installed InfiniBand hardware into source Constraints system  ~ 3GB/sec throughput! Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 196
    • Real World Checkpoint Customer Project  Setup: PROD Constraints Restore + Upgrade Preparation Upgrade SWING HP-UX PA-RISC HP-UX PA-RISC OEL 64bit Success? Remarks Prod Load Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 197
    • Real World Checkpoint Customer Project  3x test migrations: PROD SWING HP-UX PA-RISC Data Pump on NETWORK_LINK HP-UX PA-RISC Constraints Preparation Upgrade OEL 64bit INSERT APPEND on database links for tables >100 GB Success? Remarks Prod Load Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 198
    • Real World Checkpoint Customer Project  Parallel live loads: Performance tests PROD SWING HP-UX PA-RISC HP-UX PA-RISC Constraints Preparation Upgrade OEL 64bit Success? Remarks Redirect the production load by apps servers Prod Load Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 199
    • Real World Checkpoint Customer Project  Live upgrade/migration PROD SWING HP-UX PA-RISC HP-UX PA-RISC Constraints Preparation Upgrade OEL 64bit Success? Remarks Prod Load Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 200
    • Real World Checkpoint Customer  Live? And alive? – Yes! Go-live in early November 2009  Two weeks earlier than proposed Project – Total upgrade and migration time: ~20 hours  ~ 8 hours: Restore and recovery Constraints  ~ 1 hour: Database upgrade to Oracle 11.1.0.7  ~10 hours: Data migration to Exadata V1 Preparation  ~ 1 hour: Smoke testing and final verification Upgrade – Dramatic performance improvements  Job runtimes decreased by 80% Success?  User complaints about too fast performance … really!! Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 201
    • Real World Checkpoint Customer  Example: Job runtime from 30 hrs to < 2hrs – And not a single piece of SQL changed!!! Project Constraints Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 202
    • Real World Checkpoint Customer  Same customer again … Payback GmbH Project Constraints Preparation Upgrade And the story continues as Payback ordered a new Exadata X2-2 in May 2012 Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 203
    • Real World Checkpoint Customer  Project scope: – Migrate 14TB from Exadata V1 to Exadata X2-2  2 months planning and migration phase Project – June to July 2012  Proposed go-live date Constraints – 22-JUL-2012 Preparation – MOS Note: 1055938.1 Upgrade Success? Migrating from HP Oracle Database Machine to Sun Oracle Database Machine 11.2 using Data Guard Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 204
    • Real World Checkpoint Customer  New Constraints: – Database has grown from 7TB to 14TB Project – Move everything in less than 8 hrs – Network "bottleneck" Constraints  Customer installed extra IB cables to connect V1 and X2-2 Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 205
    • Real World Checkpoint Customer  Restoring 14TB with RMAN – For STANDBY from ACTIVE DATABASE – 64x parallel Project – Removed unused components from the database Constraints RMAN Restore 64 parallel channels Preparation Upgrade Oracle 11.1.0.7 Oracle 11.1.0.7 Success? Remarks InfiniBand cabled connection between V1 and X2-2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 206
    • Real World Checkpoint Customer  Live migration – RMAN Restore and Recovery: <3 hours Project  64 parallel RMAN channels allocated: >4TB/hour Constraints RMAN Restore 64 parallel channels Preparation Upgrade Oracle 11.1.0.7 Oracle 11.1.0.7 Success? Remarks InfiniBand cabled connection between V1 and X2-2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 207
    • Real World Checkpoint Customer  Subsequent database upgrade – Using the new PARALLEL UPGRADE* scripts  25% speedup for the Oracle Server upgrade Project  Total database upgrade time including recompilation and time zone change: 20 mins Constraints catupgrd.sql PARALLEL=8 Preparation Upgrade Success? Oracle 11.1.0.7 Remarks Oracle 11.2.0.3 * The Parallel Upgrade Feature is only available for Oracle Database 11.2.0.3 upgrades under supervision of Oracle's Upgrade Development Team for selected reference customers. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 208
    • Real World Checkpoint Customer  Live? And alive? – Yes! Go-live on 3-JUL-2012  Almost three weeks earlier than proposed Project – Total migration and upgrade time: ~4 hours  < 3 hours: Restore for Standby and recovery Constraints  < 20 mins: Database upgrade to Oracle 11.2.0.3  ~ 40 mins: Extra tasks (crsctl etc.) Preparation – Significant performance improvements Upgrade  Job runtimes decreased again by 30-60%  The Database Team did a great job and went live Success? earlier again with half of the proposed downtime!!! Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 209
    • Real World Checkpoint Customer Project  A few plans did change – but we were prepared  – Had captured all plans from AWR into an SQL Tuning Set – Remedied failing plans with SQL Plan Management Constraints Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 210
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases xTTS to Exadata Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 211
    • Case 4: Cross Endianness Migration xTTS  Migration cross platform with Transportable Tablespaces Example Facts & Description 1. Hardware migration to an Exadata Database Machine 2. Cross Endianness database migration from Oracle 10.2.0.4 to Oracle 11.2.0.3 3. Maximum tolerated downtime: 48 hours 4. Database size: 75TB 75TB 75TB 48 hrs Oracle 10.2.0.4 Oracle 11.2.0.3 IBM AIX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 212
    • Case 4: Cross Endianness Migration xTTS  Migration cross platform with Transportable Tablespaces Set all data tablespaces Read-Only Export Meta Information Generate Recreation Scripts Restore and Convert Datafile Backups Precreate Users in a new Database Import Meta Information Plug in Datafiles 75TB Recreate Source Objects with Recreation Scripts Set all data tablespaces Read-Write 75TB 48 hrs Oracle 10.2.0.4 Oracle 11.2.0.3 IBM AIX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 213
    • Concept Transportable Tablespaces Plug all tablespaces into a new database on target platform 75TB 75TB Oracle 10.2.0.4 Oracle 11.2.0.3 IBM AIX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 214
    • Transportable Tablespaces  Simple Concept: – Create an "empty" database in the new environment – Plug in all data tablespaces from source to target database – Works cross-platform and cross-Endianness since Oracle Database 10g  Performance Potential – "Possibly" very fast upgrade – Physical file copy can be much faster than exporting/importing data  Complexity could be constraining – SYSTEM+SYSAUX tablespaces can't be transported – Additional steps necessary to move views, synonyms etc. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 215
    • Concept Transportable Tablespaces impdp sysdba"'"… expdp "'"sys/sys as sysdba"'" … TRANSPORT_DATAFILES=… TRANSPORT_TABLESPACES=TS1,TS2 …  TTS feature available since Oracle 8i  Cross platform support since Oracle 10g Self Contained? Read Only Read Write Oracle 10.2.0.4 Oracle 11.2.0.3 IBM AIX OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 216
    • Concept Transportable Tablespaces xTTS  Cross platform support – V$TRANSPORTABLE_PLATFORM LITTLE ENDIAN PLATFORMS HP IA Open VMS HP Open VMS HP Tru64 UNIX Linux IA (32-bit) Linux IA (64-bit) Linux x86 64-bit BIG ENDIAN PLATFORMS FILE COPY Microsoft Windows IA (64-bit) Microsoft Windows x86 64-bit Microsoft Windows IA (32-bit) FILE RMAN Apple Mac OS COPY HP-UX (64-bit) HP-UX IA (64-bit) CONVERT Solaris[tm] OE (32-bit) Solaris[tm] OE (64-bit) Solaris Operating System (x86) Solaris Operating System (x86-64) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. AIX-Based Systems (64-bit) IBM zSeries Based Linux IBM Power Based Linux Upgrade, Migrate and Consolidate to Oracle Database 12c 217
    • Concept Transportable Tablespaces xTTS  TTS cross platform – RMAN creates a file copy – Can be done on source or target system  Use the faster storage – Takes approximately the same amount of time as a backup – Multiple channels can be used – Example: RMAN> CONVERT TABLESPACE users,example TO PLATFORM 'Linux IA (32-bit)' FORMAT='/tmp/transport_linux/%U'; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 218
    • Example Transportable Tablespaces Move meta information (views, synonyms, trigger, roles etc) SOURCE Database 10.2.0.4 DESTINATION Database 11.2.0.3 VIEWS VIEWS USERS SYSTEM APP HUGO SYSAUX UNDO TEMP SYSTEM CODE APP PRIVS Copyright © 2013, Oracle and/or its affiliates. All rights reserved. HUGO Upgrade, Migrate and Consolidate to Oracle Database 12c SYSAUX UNDO TEMP CODE PRIVS 219
    • Possible options  Moving meta information - 3 possible options – The "brutal" approach  expdp/impdp CONTENT=METADATA_ONLY – The "smart" approach  Generate scripts – String concatenation with || ... – DBMS_METADATA – The "very smart" way  RMAN clone (DUPLICATE) with SKIP TABLESPACES option  But: Does not work for platform changes – In any case: Take extra care on sequence's start values!! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 220
    • Transportable Tablespaces  TTS might not be a good solution if ... – Too many meta objects have to be rebuilt  Simple is better for fast TTS!!! – Too many objects in the tablespaces slow down the meta export and import  Partitions and subpartitions  Avoid physical file copies when possible – Use a physical standby as transport system  Reuse the existing files without moving them  Tablespaces can be mounted read-only from two databases – With read-write it will exist in the destination only  Time zone versions must be equal prior to transport – Otherwise Data Pump will block the meta import Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 221
    • Speed Up Transportable Tablespaces  Usually the biggest pain points with TTS – Downtime ranges from tablespace read-only on source to tablespace read-write on destination  Duration to copy a very large amount of data  Duration to convert many tablespaces cross Endianness  New technique: Avoid the copy & convert phase – RMAN has learned to convert backups cross platform  Incremental backups will be used to bring source and destination into close sync  Available since Oracle 11.2.0.3 for Exadata only  Available generally with Oracle 11.2.0.4 and Oracle 12c – See MOS Note:1389592.1 for a detailed description Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 222
    • New Turbo xTTS Conventional xTTS Turbo xTTS Tablespaces read-only Copy datafiles with RMAN Generate scripts for nonsegmented objects Convert datafiles Export meta information Create, copy, convert & apply incremental backups Tablespaces read-only Copy datafiles Create, copy, convert & apply final incremental backup Convert datafiles Down time Generate scripts for nonsegmented objects Export meta information Create user Create user Import Meta Information Import Meta Information Execute scripts for nonsegmented objects Execute scripts for nonsegmented objects Tablespaces read-write Tablespaces read-write Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 223
    • Documentation and Information  Transportable Tablespaces – Information – MOS Note:1166564.1 Master Note for Transportable Tablespaces Common Questions and Issues – MOS Note:1454872.1 Transportable Tablespace Restrictions and Limitations: Details, Reference, and Version Where Applicable – For TTS White Papers see the MAA webpage: http://www.oracle.com/technetwork/database/features/availability/oracle-databasemaa-best-practices-155386.html – Database Upgrades using TTS: http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gupgradetts-132620.pdf – Platform Migration using Transportable Database (RMAN): http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2platformmigrationtdb-131164.pdf – Customer example: Amadeus Customer Case http://www.oracle.com/technetwork/database/features/availability/s281209 -amadeus-130978.pdf Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 224
    • Real World Checkpoint Customer  The Customer: – One of the largest financial institutions in North Project Constraints Preparation Migration America – Businesses include consumer banking, credit cards, asset management, business finance, investment banking… – Over $2 trillion in assets, more than $100 Billion in annual revenue – 240,000 employees in 60 countries Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 225
    • Real World Checkpoint Customer  Project scope: 70+ TB to migrate + upgrade Current Configuration New Configuration CPUs 16 single-core 4 x 8-core Operating System Endian Big Little File System Veritas CFS, SFRAC 4.1 Veritas CFS, SFRAC 5.1 Disk Group 1 per DB 3-4 per DB Database size 70+ TB 70+TB Database Version Oracle 10.2.0.4 Oracle 11.2.0.2 Project Constraints Preparation Migration Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 226
    • Real World Checkpoint Customer  Constraints: – Endian conversion  Both OS- and Database-level endian conversions Project needed Constraints – Data synchronization  Up to the minute before conversion Preparation – Conversion Window  Migration and smoke testing must be completed within 48 hours Migration – Size & Scale of data Success?  70+ TB, millions of sub-partitions, extremely active system Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 227
    • Real World Checkpoint Customer  Explore Data Movement Options  Copying 70TB over the 10Gb network = ~20 hours  And it doesn’t include DB cross-endian conversion! Project – Customer decision:  Use already licensed Veritas Portable Data Containers Constraints  Explore Database Conversion Options Preparation – Many options evaluated – Customer decision: Migration Success?  Cross-Platform Transportable Tablespaces  Works cross-platform, cross-endian Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 228
    • Real World Checkpoint Customer  Migration Weekend: Met plan almost exactly! Duration Action 3 hours Graceful application shutdown, backup Project 6 hours Instantiate and validate DB on swing server Constraints 6 hours Data Pump metadata export 1 hours OS-level endian conversion Preparation 20 hours RMAN CONVERT processing 8 hours Data Pump metadata import Migration 5 hours Post-migration tasks (TNSNAMES, re-create dblinks, etc.) 2 hours Post-migration validation & smoke testing Success? 35 hours Migrate 70+ TB cross-endian!!! Remarks 51 hours Total time Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 229
    • Real World Checkpoint Customer  YES ...just a couple of post-upgrade tweaks: – Wrong job_queue_processes setting blocked Project parallel recompilation  Remedy: Set it to a value greater than 0 starting in 11.2 Constraints – High MUTEX contention after upgrade  Remedy: Apply newest PSU – it had all the fixes!!! Preparation Migration Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 230
    • Real World Checkpoint Customer Project Constraints Preparation  Expect the unexpected -- especially things you don‘t control! In this case... – Windows security group decided to roll out new security profiles on migration weekend – Upgrade weekend delayed by US debt ceiling negotiations – …what will happen during your big migration?  Does it really need to be said? Test!!! Migration Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 231
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Zero Downtime? Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 232
    • Case 5: Near-Zero Downtime  Platform migration with near-zero downtime Example Facts & Description 1. Hardware migration to an Exadata Database Machine 2. Cross Endianness database migration from Oracle 10.2.0.3 to Oracle 11.2.0.3 3. Maximum tolerated downtime: 5 minutes 4. Database size: 10TB 5. High redo generation rate 10TB 10TB 5 mins Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 233
    • Introduction  True ZERO Downtime is very hard to achieve – Only Oracle TimesTen In-Memory Database can do that  Replication technologies are easier to handle and setup – A limited downtime will occur to switch clients/application  Active/active scenarios are possible but will require extra work  Concept: 1. 2. 3. 4. Start capturing changes on source Create an upgraded copy on target Start applying changes to target Once in sync switch clients/application  Technologies: – Oracle Golden Gate – (NOTE: Oracle Streams was deprecated as of Oracle Database 12c) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 234
    • Oracle Golden Gate  Paid option of the database – Migratable license for 1 year which includes Active Data Guard  Works with many Oracle database versions – Golden Gate 11.2 supports Oracle 10.2.0.4+, 11.1+, 11.2+  For earlier database versions (8i (DML only), 9i-11.1) use Golden Gate 10.4  Compared to Oracle Streams – Generally faster – Generally easier to setup and use – Fewer data type restrictions  Oracle GoldenGate Installation and Setup Guide  Also works with non-Oracle databases (DB2, Teradata …)  GoldenGate OTN page: http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 235
    • Difference Conventional vs GG Migration  Eliminate the "migration" downtime – Conventional Migration Database Migration / Database Upgrade Tasks Downtime – Near-Zero Downtime Migration Database Migration / Database Upgrade Tasks Synch Downtime Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 236
    • Case 5: Near-Zero Downtime  Platform migration with near-zero downtime Start Capture Mechanism Build Up Database Copy with Data Pump or TTS 10TB Start Apply Mechanism 10TB 5 mins Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 237
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Capture: committed transactions are captured (and can be filtered) as they occur by reading the transaction logs Capture 10TB 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 238
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Trail: stages and queues data for routing Capture Trail 10TB 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 239
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Build up the target database using: - Transportable Tablespaces x-Platform - Export/Import with Data Pump Capture Trail 10TB 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 240
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Pump: distributes data for routing to target(s) Capture Trail Pump 10TB 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 241
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Route: data is compressed, encrypted for routing to target(s) Capture Trail Pump 10TB Trail 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 242
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Delivery: applies data with transaction integrity, transforming the data as required Capture Trail Pump 10TB Trail Delivery 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 243
    • Start Capture Mechanism Build Up Database Copy with Data Pump or TTS Start Apply Mechanism Golden Gate works bidirectionally from higher to lower release as well! Capture Trail Trail Pump Delivery Bi-directional 10TB 10TB Oracle 10.2.0.3 Oracle 11.2.0.3 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 244
    • Minimal Downtime Migration with Oracle Golden Gate Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 245
    • Real World Checkpoint Customer  Amadeus is a leading transaction processor for the global travel and tourism industry Project Constraints DISTRIBUTION BUSINESS IT SOLUTIONS Preparation Migration Success? 711 airlines 110,000+ hotel properties 30 car rental companies 50+ cruise and ferry lines 207 tour operators 24 insurance companies 95 railways Inventory Departure Control e-Commerce Airlines Airports Hotels Rail Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 20,000+ tx/sec (peak) < 0.3 sec response time 10 Petabytes of storage 3+ million net bookings/day > 1 billion tx/day 246
    • Real World Checkpoint Customer  Migrate Oracle 10g production databases to Oracle 11g on new HW and/or OS platform. Project Source Target Constraints Preparation Oracle 10.2.0.3 RAC HP-UX v2 Migration Success? Remarks Oracle 10.2.0.3 Single Instance HP-UX v2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle 11.2.0.2/3 RAC HPUX v3 Oracle 11.2.0.2/3 RAC RHE Linux Oracle 11.2.0.2/3 RAC One RHE Linux Upgrade, Migrate and Consolidate to Oracle Database 12c 247
    • Real World Checkpoint Customer  Fixed quarterly outage windows  Maximum of 5 minutes database downtime Project Constraints  No service impact outside the outage window  Endian change: HP-UX  Linux (biglittle endian)  Possibility of fallback during and after the outage Preparation  High volume of DB changes – Redo of up to 20MB/sec Migration Success? Remarks  Large database sizes (up to 14TB)  Possibility for physical re-organization - Fresh data dictionary - Tablespace and partitioning redesign Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 248
    • Real World Checkpoint Customer  In-depth proof of concept (supported by Oracle) – Focusing on functional aspects Project – Focusing on data volume  Standardized migration process model with Constraints Preparation Migration timeline  Home-made scripts and procedures to support setup, monitoring, tuning and switch over  Training of in-house specialist supporting the DBAs Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 249
    • Real World Checkpoint Customer  Instantiation of new 11g database – Physical Standby and Data Pump Project  Installation, configuration, tuning of GG replication Constraints Preparation Migration Success?  Comparison of source/target DB content (Veridata)  Rehearsals of switch over and fallback Remarks  Switch over: Stop replication / Start reverse-replication Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 250
    • Real World Checkpoint Customer  Databases successfully migrated – Switchover duration: 2 - 6 minutes Project Constraints Preparation – No fallback performed Source Target Oracle 10.2.0.3 RAC HP-UX v2 Migration Success? Remarks Oracle 10.2.0.3 Single Instance HP-UX v2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Migrated Oracle 11.2.0.2/3 RAC HPUX v3 6 Oracle 11.2.0.2/3 RAC RHE Linux 3 Oracle 11.2.0.2/3 RAC One RHE Linux 6 Upgrade, Migrate and Consolidate to Oracle Database 12c 251
    • Real World Checkpoint Customer Project  The concept proved to handle a smooth and secure migration across different DB versions and HW/OS platforms. Constraints Preparation Migration Success?  To be considered … − Instantiation of target database (incl. Plan Stability) − Customized GG setup per database − Handling of unsupported data types (e.g. ANYDATA) − Impact of supplemental logging on source DB − Effort of tuning GG for DBs with high DML rate (e.g. parallel replicate processes) Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 252
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Real Rolling Upgrade Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 253
    • Case 7: Real Rolling Upgrade  Rolling database upgrade with less than 5 min downtime Example Facts & Description 1. Neither HW nor OS migration involved 2. Database rolling upgrade from Oracle 11.1.0.7 to Oracle 11.2.0.3 3. Maximum tolerated downtime: 5 minutes 4. Database size: 5TB 5TB 5TB 5 mins Oracle 11.1.0.7 Oracle 11.2.0.3 OEL4 64bit OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 254
    • Case 7: Real Rolling Upgrade  Rolling database upgrade with less than 5 min downtime Create a Physical Standby Convert  Logical Standby Upgrade Logical Standby Switchover PROD Logical Flashback Logical Convert  Physical Upgrade via Redo Apply Switchover PROD  Physical 5TB 5TB 5 mins Oracle 11.1.0.7 Oracle 11.1.0.7 Oracle 11.2.0.3 OEL4 64bit PHYSICAL STANDBY OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 255
    • Basic Facts and Information  Physical standby database (redo apply): – Block identical copy of the production database – Build up with RMAN  Since Oracle 11.1 semi-automatic via network – Switchover in less than 1 minute  Logical standby database (sql apply): – Logical copy of the production database – Build up via CONVERT from a physical standby – Switchover in seconds possible  Transient Logical Standby: – Convert a physical into a logical standby – Rolling upgrade – Convert back into a physical standby Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 256
    • Transient Logical Standby  Concept: – Build up a Physical Standby database – Convert the Physical Standby into a Logical Standby – Upgrade the Logical Standby database – Switchover – Standby will be production system now – Then: Flashback the former production database – Convert it into a Physical Standby – Upgrade just by log apply – Eventually: Switchover to the original setup  Works pretty straight forward with Oracle Database 11g – Will work with Oracle Database 10g as well but requires more steps Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 257
    • 1 Transient Logical Standby - Workflow PROD t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c PSTBY t 258
    • 2 Transient Logical Standby - Workflow Guaranteed Restore Point  PROD t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c PSTBY t 259
    • 3 Transient Logical Standby - Workflow Guaranteed Restore Point PROD  Logminer Build PSTBY  KEEP IDENTITY LSTBY synchronize t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c t 260
    • 4 Transient Logical Standby - Workflow Guaranteed Restore Point PROD PROD Logminer Build PSTBY KEEP IDENTITY LSTBY synchronize New $OracleHome  t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c Upgrade t 261
    • 5 Transient Logical Standby - Workflow Guaranteed Restore Point PROD PSTBY KEEP IDENTITY Logminer Build LSTBY synchronize New $OracleHome  LSTBY Upgrade synchronize  SWITCHOVER t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c PROD t 262
    • 6 Transient Logical Standby - Workflow Guaranteed Restore Point PROD Logminer Build PSTBY KEEP IDENTITY LSTBY synchronize New $OracleHome Upgrade synchronize  FLASHBACK DATABASE TO: Guaranteed Restore Point LSTBY SWITCHOVER t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c PROD t 263
    • 7 Transient Logical Standby - Workflow Guaranteed Restore Point PROD Logminer Build PSTBY KEEP IDENTITY LSTBY synchronize New $OracleHome Upgrade FLASHBACK DATABASE TO: Guaranteed Restore Point synchronize LSTBY SWITCHOVER PROD Switch to new $OracleHome  CONVERT TO PHYSICAL PSTBY t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c t 264
    • 8 Transient Logical Standby - Workflow Guaranteed Restore Point PROD Logminer Build PSTBY KEEP IDENTITY LSTBY synchronize New $OracleHome Upgrade FLASHBACK DATABASE TO: Guaranteed Restore Point synchronize LSTBY SWITCHOVER PROD Switch to new $OracleHome CONVERT TO PHYSICAL PSTBY Automatic Upgrade during redo apply synchronize t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c  t 265
    • 9 Transient Logical Standby - Workflow Guaranteed Restore Point PROD Logminer Build PSTBY KEEP IDENTITY LSTBY synchronize New $OracleHome Upgrade FLASHBACK DATABASE TO: Guaranteed Restore Point synchronize SWITCHOVER LSTBY PROD Switch to new $OracleHome CONVERT TO PHYSICAL PSTBY Automatic Upgrade during redo apply PROD synchronize  SWITCHOVER t Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c PSTBY t 266
    • Transient Logical Standby – White Paper  Transient Upgrade Concept: http://www.oracle.com/technetwork/database/features/availability/ maa-wp-11g-transientlogicalrollingu-1-131927.pdf  Shell scripts in Note:949322.1 for automation: http://www.oracle.com/technetwork/database/features/availability/ maa-wp-11g-upgrades-made-easy-131972.pdf Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 267
    • DBMS_ROLLING  Data Guard Simple Rolling Upgrade – Semi-automation of Transient Logical Standby Rolling Upgrade – Works with Data Guard Broker – Procedure DBMS_ROLLING  INIT_PLAN  DESTROY_PLAN  BUILD_PLAN  SET_PARAMETER  START_PLAN  SWITCHOVER  FINISH_PLAN  ROLLBACK_PLAN – Usable for maintenance tasks beginning with Oracle 12.1.0.1 – Usable for upgrades beginning with the first patch set of Oracle 12c  DBMS_ROLLING usage will require a license for Active Data Guard Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 268
    • DBMS_ROLLING - Planning & Setup Phase  Generate an upgrade plan – Call DBMS_ROLLING.INIT_PLAN  Generates an upgrade plan with a configuration specific set of instructions to guide the administrator through the upgrade process – Call DBMS_ROLLING.SET_PARAMETER  Modify parameters of the rolling upgrade  Prepare your changes to the database Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 269
    • DBMS_ROLLING – Execution Phase  Start the Execution Phase – Call DBMS_ROLLING.START_PLAN  Configures primary and standby databases participating in the upgrade  Make changes to the standby database – Upgrade time  Role exchange – Call DBMS_ROLLING.SWITCHOVER  Swaps roles between current primary and new primary with the changes, switchover is only downtime required  Finish the Rolling Upgrade – Call DBMS_ROLLING.FINISH_PLAN  Completes upgrade of the old primary and bystanders and resynchronizes with the new primary Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 270
    • Real World Checkpoint Customer  Bielefeld University, Germany – Mid size university in Germany (founded 1969) Project  18,000 students  1,600 employees Constraints  Interdisciplinary  Initiative of Excellence Preparation  Lead university for 33 German universities Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 271
    • Real World Checkpoint Customer  Project scope: – Upgrade or migrate 10 key systems from Oracle Project 9.2 to Oracle 11g – Move from Single Instance to:  Oracle Real Application Clusters Constraints  Oracle ASM  Oracle Data Guard Preparation – Use Transient Logical Standby for patch upgrades Upgrade to decrease downtime from 60 minutes to less than 5 minutes Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 272
    • Real World Checkpoint Customer  Constraints: – Character set conversions Project – Outdated 3rd party software Constraints Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 273
    • Real World Checkpoint Customer  Test migrations and upgrades  Setup Oracle Grid Control Project Constraints  Performance monitoring and tuning with SQL Tuning/Access Advisor and SQL Performance Analyzer (SPA) Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 274
    • Real World Checkpoint Customer  Upgrade and migrations: – Completed in Sept/Oct 2008 Project  Transient Standby Rolling Upgrade: Oracle. 11.1.0.6 to Oracle 11.1.0.7 Constraints – Friday February 13th, 2009 Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 275
    • Real World Checkpoint Customer  YES!!!  OOW 2009 presentation Project Constraints Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 276
    • Real World Checkpoint Customer Project  During upgrade/migration: – One issue found with "Exceeding column length" conversion  Solution: Convert to CLOB and change app Constraints Preparation  Transient Standby upgrade had some issues due to INVALID components in DBA_REGISTRY – Solution: Fix the component status Upgrade Success?  Lessons learned: – Never go onsite again on a Friday 13th!!! Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 277
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Plug in a database Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 278
    • Case 8: Upgrade and Plug into a CDB  Consolidate an upgraded 12c database into a CDB Example Facts & Description 1. Source database must already be upgraded to Oracle Database 12c 2. Plug in the source database as new PDB into an existing CDB 3. Maximum tolerated downtime: 15 minutes 4. Database size: 1TB 1TB 1TB 15 mins Oracle 12.1.0.1 Oracle 12.1.0.1 Non-CDB PDB in a CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 279
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 280
    • Multitenant Environment – The Concept!  Consolidation  Reduced maintenance load  Simplified and fast provisioning, cloning and migration  Option is called Oracle Multitenant Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 281
    • Look Before You Leap!   Some well-known concepts will change – Around 150 pages new documentation in the Administrator’s Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 282
    • The earth is still a sphere   You don't have to use pluggable databases ... yet  Oracle Database 12c non-CDB works as expected – But you can also use the new features – and this will require changing old habits Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 283
    • Implementation  Multitenant container database => CDB – DBA administers on the CDB level  A CDB can contain zero, one, or many pluggable databases (PDBs) – Applications will connect to the PDBs – Up to 253 PDBs in one CDB PDB$S EED PDB PDB PDB PDB CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 284
    • Components  What's in a CDB? PDB$SEED – PDBs PDB  Pluggable databases PDB PDB PDB CDB$ROOT  Contain data and code – CDB$ROOT  Schemas, objects etc. available to all PDBs  Information about all PDBs in the CDB's data dictionary  There can be only ONE  – PDB$SEED  Template from which to create PDBs  PDB, CDB$ROOT and PDB$SEED all are called containers Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 285
    • Behind the scenes  One SGA, one set of background processes, and one spfile – Benefit due to resource sharing  Applications connect to a PDB Redo Control Flashback PDB$SEED PDB PDB PDB PDB spfile CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 286
    • Prerequisites to work with CDBs/PDBs  COMPATIBLE ≥ 12.0.0 – Note: There's no difference between 12.0.0 and 12.1.0  ENABLE_PLUGGABLE_DATABASE=TRUE – Default: FALSE – It can only be set during creation of a container database – setting it afterwards inside an Oracle 12c database won't work  During creation with DBCA it will be set TRUE once the option CREATE CONTAINER DATABASE is chosen Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 287
    • Creation of a CDB  Two options: – DBCA  Highly recommended – Command line CREATE DATABASE  Not recommend as all options will have to be created CREATE DATABASE cdb12 [...] ENABLE PLUGGABLE DATABASE SEED FILE_NAME_CONVERT=('/oradata/cdb12/','/oradata/pdbseed/') SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE […] Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 288
    • Command Line Creation of a CDB  Scripts have to be started via catcon.pl: $> perl catcon.pl -u SYS -d $ORACLE_HOME/rdbms/admin -e -s -b catalog catdb.sql – catdb.sql will run all scripts for all options – Most useful catcon.pl options:  -u Username and optionally password  -d Directory containing the script to execute (default: current directory)  -e Echo on  -s Spools the output of every script  -l Directory to write logfiles into (default: current directory)  -b Base name for logfiles (mandatory option) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 289
    • Parameters of catcon.pl Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 290
    • catcon.pl  Things to know when using catcon.pl – catcon.pl doesn't open MOUNTed PDBs – Recommendation:  Open all PDBs before executing scripts with catcon.pl – ALTER PLUGGABLE DATABASE ALL OPEN; – When PERL is not in your PATH then execute:  $> $ORACLE_HOME/perl/bin/perl catcon.pl ... Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 291
    • Creation of a CDB with DBCA (recommended) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 292
    • Creation of a CDB with DBCA (recommended) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 293
    • CDB-PDB Limitations  Characterset of the CDB is mandatory for all PDBs  Up to 252 PDBs plus PDB$SEED can exist in a CDB: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 294
    • CDB-PDB: Who's who?  After CDB creation: – Data dictionary – Common user – By default there's no user data in the root PDB$SEED OBJ$ TAB$ SOURCE$ CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 295
    • CDB-PDB: Who's who?  After plugging a PDB into a CDB: – Data resides in the PDB – References will get created in the CDB – In exchange access to dictionary objects from within the PDB OBJ$ TAB$ SOURCE$ PDB EMP DEPT PDB$SEED OBJ$ TAB$ SOURCE$ CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 296
    • CDB-PDB: Who's who?  Common user – Exists in the CDB and every current and future PDBs – All Oracle supplied users are common users – User to plug/unplug/clone  CDB1> create user c##adm1 identified by a1;  CDB1> create user c##adm2 identified by a2 container=all;  Local user – Exists in one PDB only PDB$SEED APP HUGO CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. C##ADM SYS SYS Upgrade, Migrate and Consolidate to Oracle Database 12c PDB C##BOSS C##ADM C##BOSS 297
    • Switching between CDB and PDBs  Switch to a PDB – SQL> ALTER SESSION SET CONTAINER=PDB1;  Switch to the CDB – SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;  Where am I? – SQL> SHOW CON_ID – SQL> SHOW CON_NAME – SQL> SHOW PDBS  This will tell you either to which PDB you are connected or list all PDBs including the PDB$SEED if your are connected to the CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 298
    • CDB/PDB User Creation: Details  Example – Create a user inside a PDB: Local User PDB1> create user T1 identified by T1; PDB1> create user U2 identified by U2 container=current; PDB1> create user V3 identified by V3 container=all; ORA-65096: invalid common user name or role  Example – Create a new Common User in a CDB: CDB1> create user T1 identified by T1; ORA-65096: invalid common user name or role CDB1> create user T1 identified by T1 container=all; ORA-65096: invalid common user name or role CDB1> create user T1 identified by T1 container=current; ORA-65049: creation of local user or role is not allowed in CDB$ROOT Common User CDB1> create user c##T1 identified by T1 container=all; CDB1> create user c##U2 identified by U2; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 299
    • CDB-PDB: Who's who?  Tablespaces – Global UNDO and TEMP in CDB$ROOT – PDBs can have their own TEMP – All PDBs will share CDB's UNDO SYSTEM SYSTEM SYSAUX SYSAUX PDB$SEED SYSTEM TEMP SYSAUX UNDO Copyright © 2013, Oracle and/or its affiliates. All rights reserved. PDB TEMP_PDB DATA1 DATA2 CDB$ROOT Upgrade, Migrate and Consolidate to Oracle Database 12c 300
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Creation of a new PDB  Cloning a PDB  Upgrade and plugin as PDB  Full transportable export/import  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 301
    • Creation of a PDB  Fast provisioning with the seed: – Login to the CDB – Provisioning with the seed create pluggable database PDB128 admin user PDB128adm identified by mypasswd roles = (DBA)  Parameter PDB_FILE_NAME_CONVERT is used to create the files in the new location: PDB_FILE_NAME_CONVERT='strg1','strg2' – Import data from the source database if desired  Data Pump import for 10g and later releases (dumpfile or over a NETWORK_LINK)  Original import for 9i and earlier releases  Transportable Tablespaces Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 302
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Creation of a new PDB  Cloning a PDB  Upgrade and plugin as PDB  Full transportable export/import  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 303
    • Cloning of a PDB  Fast cloning within a CDB or remote cloning  Source PDB can remain online in READ ONLY mode  Locally: create pluggable database PDB7 from PDB4; – Parameter PDB_FILE_NAME_CONVERT is used to create the files in the new location » Can be set in the spfile (alter system) or in a session (alter session)  Remote: create pluggable database PDB8 from PDB3@de.acme.cdb1; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 304
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Creation of a new PDB  Cloning a PDB  Upgrade and plugin as PDB  Full transportable export/import  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 305
    • Upgrade first, then plug in  To plug in a database into a multitenant environment it has to be upgraded to Oracle Database 12c first – The upgrade steps are independent from the multitenant concept  Once upgraded: 1. Open the database read-only 2. Generate an XML description file 3. Plug the database into the destination CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 306
    • Upgrade and Plugin into a CDB  Step1: – Database Upgrade to Oracle 12c Oracle 10.2.0.5 V102 Database Upgrade Oracle 12.1.0.1 V102 PDB$SEED CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 307
    • Upgrade and Plugin into a CDB  Step 2: – Database in read-only mode – Create XML file XML Oracle 12.1.0.1 V102 PDB$SEED CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 308
    • Upgrade and Plugin into a CDB  Step 3: – Stop database and plug it into the CDB TEMPFILE REUSE; XML Oracle 12.1.0.1 V102 Oracle 12.1.0.1 PDB1 PDB$SEED CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 309
    • Upgrade and Plugin into a CDB  Step 4: – Define TNS alias and connect to the PDB via TNS:  sqlplus "sys/oracle@PDB1 as sysdba" – Start PDB:  – Sanity with ?/rdbms/admin/noncdb_to_pdb.sql Oracle 12.1.0.1 PDB1 PDB$SEED CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 310
    • Upgrade and Plugin into a CDB  Summary: 1. Database upgrade to Oracle 12c 2. Set database read-only 3. Generate XML description file  SQL> exec DBMS_PDB.DESCRIBE('/tmp/pdb1.xml'); 4. Stop database 5. Plugin database as a new PDB into the CDB according to the information in the XML description file  SQL> create pluggable database PDB1 using '/tmp/pdb1.xml' nocopy tempfile reuse; 6. Connect to and start the new PDB  sqlplus "sys/oracle@PDB12 as sysdba"  SQL> startup 7. Sanity operations  SQL> @?/rdbms/admin/noncdb_to_pdb.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 311
    • Hands-On-Lab – Part 2: Plug your upgraded database into a CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 312
    • Hands-On-Lab – Part 2  Switching between environments: Database SID: V102 Oracle 12.1.0 environment To switch to the database V102: $ORACLE_HOME for Oracle 12.1.0  /u01/app/oracle/product/12.1.0 $> . db10c Type in an xterm: <DOT><BLANK>db10c Database SID: CBD12 Oracle 12.1.0 environment To switch to the database CDB12: $ORACLE_HOME for Oracle 12.1.0  /u01/app/oracle/product/12.1.0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. $> . db12c Type in an xterm: <DOT><BLANK>db12c Upgrade, Migrate and Consolidate to Oracle Database 12c 313
    • HOL – Part 2 - 1/2  Your task: – Plug in the V102 database you have upgraded in HOL – PART 1 into the existing CDB12 container database 1. Switch to the Oracle 12c V102 environment: $> . db10c 2. Start the upgraded V102 database in read-only mode 3. Generate the XML description file – SQL> exec DBMS_PDB.DESCRIBE('/tmp/pdb1.xml'); 4. Shutdown the database 5. Switch to the Oracle 12c CBD12 environment : $> . db12 6. Plugin the database as new PDB1 – Please use this name as the TNS setup has been already done – Use the NOCOPY option for the lab – other options may be possible but you'll deal with extending VBox image files – SQL> create pluggable database PDB1 using '/tmp/pdb1.xml' nocopy tempfile reuse; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 314
    • HOL – Part 2 - 2/2  Your task: – Plug in the V102 database you have upgraded in HOL – PART 1 into the existing CDB12 container database 7. Connect to the PDB1 and start it – sqlplus "sys/oracle@PDB1 as sysdba" – SQL> startup 8. Run the noncdb_to_pdp.sql script in the PDB1 – Set timing on and spool into a file – SQL> set timing on – SQL> spool /tmp/sanity.log – SQL> @?/rdbms/admin/noncdb_to_pdb.sql – SQL> spool off – Check the logfile /tmp/sanity.log Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 315
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Creation of a new PDB  Cloning a PDB  Upgrade and plugin as PDB SKIP:  Full Transportable Export/Import  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 316
    • Full Transportable  Transport of an entire database cross version and cross platform  Export since Oracle 11.2.0.3, import since Oracle 12c  3 phases: – Datafile migration with RMAN incremental backups – online! – Transport via network import – downtime! – Sanity work – online! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 317
    • Example: 11.2.0.3 12c PDB  Phase 1: Prep work DB Link Oracle 11.2.0.3 V112 RMAN Level 1 PDB$SEED RMAN Level 1 RMAN Level 0 Oracle 12.1.0.1 PDB - Clone CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 318
    • Example: 11.2.0.3 12c PDB  Phase 2: Transport – Downtime! Tablespaes Read-Only Oracle 11.2.0.3 V112 DB Link impdp oow/passwd@PDB12 NETWORK_LINK=db11 VERSION=12 FULL=Y TRANSPORTABLE=ALWAYS METRICS=Y LOGFILE=oow_dir:src112fullimp.log TRANSPORT_DATAFILE='/fra/d/ts1.dbf' … PDB$SEED Oracle 12.1.0.1 PDB12 RMAN Level 1 RMAN Level 1 RMAN Level 1 RMAN Level 0 Backup must be accessible CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 319
    • Example: 11.2.0.3 12c PDB Tablespaes Read-Write  Phase 3: Clean up DB Link PDB$SEED Oracle 11.2.0.3 V112 Oracle 12.1.0.1 PDB12 CDB$ROOT Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 320
    • Overview of Multitenant Environments  Introduction to Multitenant Environments  Roads to Pluggable Databases  Working with Pluggable Databases  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 321
    • PDB Management with DBCA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 322
    • PDB Management with DBCA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 323
    • Hirarchies OBJ$ TAB$ SOURCE$ PDB EMP PDB$SEED OBJ$ TAB$ SOURCE$ CDB$ROOT  Common User can access information from the CDB and all PDBs  Dependency shown via column CON_ID in DBA_ views: CON_ID: Object belongs to: 0 Entire CDB 1 Root 2 Seed 3 - 254 PDB 1 - 252 – In a non-CDB CON_ID is always 0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 324 DEPT
    • Change init Parameters  List init parameters which can be changed on PDB level: – select NAME from V$PARAMETER where ISPDB_MODIFIABLE = 'TRUE' order by NAME;  List parameters set in a particular PDB: – select NAME from V$SYSTEM_PARAMETER where CON_ID = 3 order by NAME; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 325
    • Dictionary Views  New dictionary view family: {USER|ALL|DBA|CDB}_VIEWS  The most important changes in an overview: View Meaning {CDB|DBA}_PDBS Information and status of PDBs being plugged into the current CDB CDB_PROPERTIES Permamnent properties of containers in a CDB {CDB|DBA}_PDP_HISTORY "History" of a PDB – OPERATION column is important {CDB|DBA}_OBJECTS New SHARING columns displays if objects are linked {CDB|DBA}_TABLES New CONTAINER_DATA columns shows if it is a container object {CDB|DBA}_USERS New COMMON columns shows if a user is COMMON or LOCAL V$CONTAINERS Infos about containers associated with this CDB V$PDBS Information about all associated PDBs– incl. Open Status V$DATABASE New column CDB – either YES or NO PDB_PLUG_IN_VIOLATIONS Shows the plugin violations during plugin as PDB into a CDB Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 326
    • Important Queries  PDBs in my CDB? – show pdbs CON_ID -----2 3 CON_NAME -------------------------PDB$SEED PDB1 OPEN MODE ---------READ ONLY READ WRITE RESTRICTED --------NO NO  Open Mode of the PDBs? – select NAME, OPEN_MODE, RESTRICTED, OPEN_TIME from V$PDBS; NAME --------------PDB$SEED HRPDB SALESPDB OPEN_MODE ---------READ ONLY READ WRITE MOUNTED Copyright © 2013, Oracle and/or its affiliates. All rights reserved. RESTRICTED ---------NO NO NO OPEN_TIME -----------------------------21-MAY-12 12.19.54.465 PM 21-MAY-12 12.34.05.078 PM 22-MAY-12 10.37.20.534 AM Upgrade, Migrate and Consolidate to Oracle Database 12c 327
    • Backup and Recovery  Recovery of a single PDB? – Yes, possible without affecting the other PDBs and the CDB – Commands:  ALTER PLUGGABLE DATABASE ... CLOSE IMMEDIATE;  RESTORE PLUGGABLE DATABASE; – Done in RMAN connected as common user to the CDB  RECOVER PLUGGABLE DATABASE; – Done in RMAN connected as common user to the CDB – Annotation: Each PDB has its own datafiles!  ALTER PLUGGABLE DATABASE ... OPEN; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 328
    • Resource Manager and CDBs/PDBs  Set resource consumption for: – CPU – Session – Parallel servers  Policy definition for shares and limits – Example: PDB Shares Guaranteed CPU A 2 2/4 = 50% B 1 1/4 = 25% C 1 1/4 = 25% Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Limit Maximum CPU 100% 50% Upgrade, Migrate and Consolidate to Oracle Database 12c 50% 100% 329
    • Overview of Multitenant Environments  Introduction to Pluggable Database  Roads to Pluggable Database  Working with Pluggable Database  Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 330
    • Possible Questions ...  Can I move from a 12c PDB back to a non-CDB? – Data Pump export/import, transportable tablespaces, or full transportable export/import will work from a PDB – Original Export (exp) will not work!  How will upgrade work for PDBs and CDB? – Upgrade a CDB and all its PDBs in one operation – Plug a version n PDB into a version n+1 CDB and upgrade  Unplug and plugin with different patches installed?  Does it work with RAC as well? – $> srvctl add service -s pasrvpdb -r orcl1,orcl2 -a orcl3,orcl4 -d orcl -pdb pdb1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 331
    • CDB References  Anything not yet supported? Check the README! – Continuous Query Notification (CQN) – Client Side Cache – Flashback Data Archive (FDA) – Flashback Transaction Query – Flashback Transaction Backout – Heat map – Automatic Data Optimization – Oracle Streams – Database Migration Assistant for Unicode (DMU)  White paper: – http://www.oracle.com/technetwork/database/multitenant-wp-12c-1949736.pdf Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 332
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Full Transportable Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 333
    • Full Transportable Export/Import  Transport an entire database in a single operation – Cross version and cross platform – Can include the database upgrade – Combination of TTS for data tablespaces and Data Pump for administrative tablespaces (SYSTEM, SYSAUX ...) – Supports information from database components such as Spatial, Text, Multimedia, OLAP, etc.  Full transportable export supported since Oracle 11.2.0.3  Full transportable import supported since Oracle 12.1.0.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 334
    • Full Transportable Export/Import  Parameters: – FULL=Y and TRANSPORTABLE=ALWAYS – VERSION=12 for full transportable export in Oracle 11.2.0.3/4  Restrictions: – Target character set must be same as, or binary super-set of source character set (eg WE8DEC  AL32UTF8 does not work)  See Oracle® Database Globalization Support Guide for list of binary subset/supersets – XDB and AWR repositories are currently not supported  Use awrextr.sql and awrload.sql to migrate AWR – In network mode, tables with LONG or LONG RAW in administrative tablespaces (SYSTEM etc) are not supported Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 335
    • Full Transportable Export/Import Set data tablespaces READ ONLY and copy to destination SOURCE Database 11.2.0.3 DESTINATION Database 12.1.0.1 VIEWS VIEWS USERS APP HUGO SYSTEM SYSAUX UNDO TEMP CODE Data Pump APP PRIVS Copyright © 2013, Oracle and/or its affiliates. All rights reserved. HUGO Upgrade, Migrate and Consolidate to Oracle Database 12c SYSTEM SYSAUX UNDO TEMP CODE PRIVS 336
    • 3 Phases 1. Pre-transport data file migration – Easiest: copy datafiles after setting tablespaces READ ONLY OR: – Less Downtime: apply incrementally-updated RMAN level 0 and level 1 backups 2. Transport using network import – Data Pump over database link to migrate all the metadata  Downtime here because tablespaces have to be read-only 3. Post-transport cleanup Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 337
    • Case 8: Full Transportable Exp/Imp  Migration with full transportable export/import Example Facts & Description 1. Hardware migration 2. Cross Endianness database migration from Oracle 11.2.0.3 to Oracle 12.1.0.1 3. Maximum tolerated downtime: 8 hours 4. Database size: 15TB 15TB 15TB 8 hrs Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 338
    • Case 8: Full Transportable Exp/Imp  Migration with full transportable export/import Phase 1A: Backups and datafile migration Phase 1B: Preparation on target host Phase 2A: Tablespaces R/O + Final Bck 15TB Phase 2B: Transportable import Phase 3: Final Actions 15TB 8 hrs Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 339
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1A: – Archivelog mode – Fast Recovery Area ALTER ALTER ALTER ALTER DATABASE ARCHIVELOG; DATABASE OPEN; SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=4G; SYSTEM SET DB_RECOVERY_FILE=DEST='/tmp/fra'; 15TB Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 340
    • Phase 1B: Prep on on target host Phase 1A: Backups & datafile migration Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1A: – Block Change Tracking  This will speed up RMAN level 1 backups ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '<name>' REUSE; 15TB Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 341
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1A: – Make Fast Recovery Area accessible to target system  E.g. via NFS Mount  This will avoid the need to copy all backups to target host 15TB NFS MOUNT Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 342
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1A: – Incremental level 0+1 backups  First run will create a level 0 copy of all datafiles  Subsequent runs will backup and merge only changed blocks RMAN TAGRET / RMAN> RECOVER COPY OF DATABASE WITH TAG 'ftei'; RMAN> BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'ftei' DATABASE; 15TB NFS MOUNT Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 343
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1A optional: OS change – Backup conversion: RMAN TARGET / RMAN> CONVERT DATAFILE '/fra/data/tbs1.f', '/fra/data/tbs2.f', '/fra/data/tbs3.f' TO PLATFORM="Linux x86 (64-bit)" FROM PLATFORM="HP-UX IA (64-bit)" Optional in file system DB_FILE_NAME_CONVERT='/fra/data/', '/fra/x/' PARALLELISM=4; 15TB NFS MOUNT Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 344
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1B: – Create a fresh empty database or – Provide a fresh empty PDB  Create a new (or use an existing) container database  Clone an empty PDB using the PDB_FILE_NAME_CONVERT parameter – CREATE PLUGGABLE DATABASE pdb1 ADMIN USER adm IDENTIFIED BY <password>; 15TB NFS MOUNT Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 345
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 1B: – Prepare database link and directory – Make sure user who will run target import exists on source with role DATAPUMP_EXP_FULL_DATABASE CREATE PUBLIC DATABASE LINK sourcedb USING 'V112'; CREATE DIRECTORY mydir AS '/tmp/dp'; GRANT READ, WRITE ON DIRECTORY mydir TO system; 15TB NFS MOUNT Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 346
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 2A: – All data tablespaces have to be in read-only mode – Final incremental backup and merge ALTER TABLESPACE tbs1 read only; RMAN TARGET / RMAN> BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'ftei' DATABASE; 15TB NFS MOUNT Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 347
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 2A alternative: – All data files belonging to data tablespaces need to be copied to the target destination  This would work with NOARCHIVELOG databases as well ALTER TABLESPACE tbs1 read only; $ cp <all datafiles for tbs1> 15TB NFS MOUNT Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 348
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 2B: – Run full import from target with the user having the role DATAPUMP_EXP_FULL_DATABASE impdp system/<pwd>@PDB1 NETWORK_LINK=sourcedb VERSION=12 FULL=Y TRANSPORTABLE=ALWAYS METRICS=Y EXCLUDE=STATISTICS LOGFILE=mydir:impdp_pdb1.log TRANSPORT_DATAFILES='/fra/data/tbs1.f' TRANSPORT_DATAFILES='/fra/data/tbs2.f' TRANSPORT_DATAFILES='/fra/data/tbs3.f' NFS MOUNT 15TB 15TB Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 349
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 2B ALTERNATIVE: Dump File Based Commands – On source (V112):  expdp system/<pwd>@V112 DIRECTORY=mydir DUMPFILE=V112full.dmp VERSION=12 FULL=Y TRANSPORTABLE=ALWAYS METRICS=Y LOGFILE=fullexp.log – On target (PDB1):  impdp system/<pwd>@PDB1 DIRECTORY=mydir DUMPFILE=V112full.dmp METRICS=Y LOGFILE=fi.lo EXCLUDE=STATISTICS TRANSPORT_DATAFILES='/fra/data/tbs1.f' … 15TB NFS MOUNT 15TB Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 350
    • Phase 1A: Backups & datafile migration Phase 1B: Prep on on target host Phase 2A: Tablespaces r/o & Final Bck Phase 2B: Transportable import Phase 3: Final Actions  Phase 3: – Review import log  Resolve any issues – Validate contents of target against source – Optionally bring back all tablespaces on source into read-write  Tablespaces in target are automatically read-write after import  Done! 15TB NFS MOUNT 15TB Database Link Oracle 11.2.0.3 Oracle 12.1.0.1 HP-UX Itanium OEL5.8 64bit Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 351
    • Hands-On-Lab – Part 3: Migrate an 11.2.0.3 database into a CDB using Full Transportable Export/Import Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 352
    • Hands-On-Lab – Part 3  Switching between environments: Database SID: V112 Oracle 11.2.0 environment To switch to the database V112: $ORACLE_HOME for Oracle 11.2.0.3  /u01/app/oracle/product/11.2.0 $> . db11 Type in an xterm: <DOT><BLANK>db11 Database SID: CBD12 Oracle 12.1.0 environment To switch to the database CDB12: $ORACLE_HOME for Oracle 12.1.0.1  /u01/app/oracle/product/12.1.0 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. $> . db12c Type in an xterm: <DOT><BLANK>db12c Upgrade, Migrate and Consolidate to Oracle Database 12c 353
    • HOL – Part 3  Your task: – Migrate the V112 database using full transportable export/import into the existing CDB12 container database  Recommendations: – Use the user SYSTEM for the transport part – Use plain data file copies as this would be the easier way » No CONVERT required  Create a fresh PDB2 in /oradata/CDB12/pdb2 – Please keep PDB2 as name as the TNS setup is done already using it – Use parameter PDB_FILE_NAME_CONVERT to define the new location  Create directory and db-link for user SYSTEM in the PDB2  Switch source database V112 into read-only mode  Copy the datafile(s) to the target location  Start the impdp on database link SOURCEDB using user SYSTEM (pw: oracle)  Check the logfiles Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 354
    • What Is Your Solution? Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 355
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 356
    • Fallback Strategy – Strategy  Never start an upgrade or migration without evaluating and testing your options for going back ...  Complete RMAN Online Backup is always a must  Clarify: – Fallback requirements in minutes/hours/days – How to deal with issues happening during the upgrade – How to deal with issues hours/days after the upgrade – Will you get additional downtime to change COMPATIBLE? Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 357
    • Parameter COMPATIBLE  Minimum COMPATIBLE in Oracle Database 12c: 11.0.0 – 11.0.0 and 11.1.0 are equivalent – Recommendation:  Change COMPATIBLE 7-10 days after upgrade  But: Changing COMPATIBLE will require a database restart – SQL> alter system set compatible='12.1.0' scope=spfile; – COMPATIBLE can't be turned back COMPATIBLE must be increased to ≥11.0.0 COMPATIBLE can remain on 11.x.y Downgrade possible Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 358
    • Fallback Strategy - Issues during upgrade ALWAYS take a complete ONLINE backup with RMAN ≥ 11.0 Set all data tablespaces into READ ONLY mode and take an OFFLINE backup of SYSTEM, SYSAUX, UNDO, TEMP, redologs + controlfiles Create a guaranteed restore point for Flashback Database Change COMPATIBLE parameter? Yes Yes No Restore and recover online backup Shutdown, restore the offline backup files and startup in source environment Flashback to the guaranteed restore point Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 359
    • Fallback: Online Backup  Restore a backup – 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 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 360
    • Fallback: Offline Backup  Restore a partial offline backup – Put all data tablespaces in read-only mode  That's downtime! – Shutdown the database IMMEDIATE – Copy SYSTEM, UNDO, TOOLS, SYSAUX, XDB, DRSYS and ODM data files plus control files and redologs  Be aware of potentially existing AQ objects in user tablespaces – In case of failure:  Shutdown and copy all partial backup files back  Startup in the old environment and recreate TEMP – Advantages:  Fast and simple, even COMPATIBLE can be changed  Recommendation: Use this technique for very large databases or when you don't have enough space for a complete backup Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 361
    • Fallback: Restore Point  Flashback to a guaranteed restore point – COMPATIBLE can't 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 © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 362
    • Fallback Strategy – Issues after upgrade AGAIN take a complete ONLINE backup with RMAN after the upgrade ≥ 10.2 Change COMPATIBLE parameter? Yes Yes No Use Data Pump to import data back into an empty database in source env Use Oracle Golden Gate for a capture/apply of data changes back to the source release Downgrade with the catdwgrd.sql and the catrelod.sql scripts back to the source release Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 363
    • Fallback: Data Pump  Downgrade with expdp/impdp to 10.x – MOS Note:553337.1 – Prepare an empty database for the import just in case you'll have to step back  Then: – Run expdp from the 12.1 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 – Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 364
    • Fallback: Golden Gate  Downgrade with Oracle Golden Gate – Version independent Source Upgraded destination database 2 “Downgrade” Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Upgrade, Migrate and Consolidate to Oracle Database 12c 365
    • Fallback: Downgrade  Downgrade with catdwgrd.sql – MOS Note:883335.1 and MOS Note:443890.1 – Downgrade possible to:  Oracle 11.1.0.7  Oracle 11.2.0.x – Do not change COMPATIBLE – Some notes:  In a RAC/ASM environment Grid Infrastructure must not necessarily be downgraded depending on certification  If XML Database was not present before upgrade it will be removed during downgrade  EM Database Control repository is removed during upgrade, and so cannot be downgraded  If Label Security and/or Database Vault is present olspredowngrade.sql must be executed before starting the downgrade  Time zone cannot be downgraded – therefore the higher TZ version must be installed into the source database environment prior to the downgrade  For further steps please see the Upgrade Guide, Chapter 6.4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 366
    • Fallback: Downgrade  Downgrade with catdwgrd.sql – In Oracle Database 12c environment: SQL> SQL> SQL> SQL> SPOOL /tmp/downgrade.log STARTUP DOWNGRADE @catdwgrd.sql SPOOL OFF – In Oracle Database 11g environment: SQL> STARTUP UPGRADE SQL> SPOOL /tmp/reload.log SQL> @catrelod.sql -- The catrelod.sql script reloads the appropriate version of -- all of the database components in the downgraded database. SQL> SPOOL OFF Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 367
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 368
    • Oracle Database 12c  Development Effort  Over 5 years in development  Over 500 new features  Over 2,500 person years of development  Over 3,000 systems used in testing  Over 1 million feature tests run daily  Over 1.2 million hours of stress tests Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 369
    • Plug into the Cloud Application Development Big Data Consolidation Data Optimization Data Warehousing High Availability In-Memory Performance & Scalability Security & Compliance Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 370
    •  ILM & Compression New Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Extreme Availability  Hundreds of Enhancements Upgrade, Migrate and Consolidate to Oracle Database 12c 371
    • ILM: Hot/Cold Data Classification Enhanced Insight into Data Usage: “heat map” ACTIVE FREQUENT ACCESS Recently inserted, actively updated Infrequently updated, Frequently Queried  Row and Segment level statistics on last Read and last Update Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c DORMANT Retained for long term analytics and compliance with corporate policies and regulations 372
    • Heat Map What it tracks • A “Heat Map” of the Database • Database level Heat Map Active Frequent Access shows which tables and partitions are being used • Block level Heat Map shows last modification at the block level • Comprehensive • Segment level shows both reads and writes • Distinguishes index lookups from full scans Occasional Access • Automatically excludes stats gathering, DDLs or table redefinitions SQL> alter system set parameter heat_map='ON'; Dormant Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 373
    • Heat Map for Tables/Partitions or Blocks  “segment” level tracking OR  “row” level tracking S ER D Copyright © 2013, Oracle and/or its affiliates. All rights reserved. OR S ER D Upgrade, Migrate and Consolidate to Oracle Database 12c 374
    • Heat Map Future Enterprise Manager screens - WIP Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 375
    • ILM: Automatic Compression & Tiering  Usage based and custom compression and tiering ALTER TABLE orders ILM ADD CompressionPolicy COMPRESS Partitions for Query AFTER 90 days from creation; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. ALTER TABLE sales ILM ADD MovePolicy TIER Partitions TO ‘Archive_TBS’ ON OrdersClosedPolicy; Upgrade, Migrate and Consolidate to Oracle Database 12c 376
    •  ILM & Compression New Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Extreme Availability  Hundreds of Enhancements Upgrade, Migrate and Consolidate to Oracle Database 12c 377
    • Extreme Availability  Active Data Guard Far Sync  Other Data Guard Enhancements  RMAN Enhancements  ASM and RAC Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 378
    • Zero Data Loss Challenge  Trade-off between Zero Data Loss and Performance Commit Ack Network Ack Network Send Commit Primary Standby The longer the distance, the larger the performance impact Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 379
    • Active Data Guard Far Sync  Complete Data Protection Without Compromise Far Sync Remote Standby Primary  Far Sync is very light-weight – Standby control file, redo log files, archived redo log files – No user data files, no media recovery, no Oracle Database license required  Deployed at a distance that SLAs can tolerate “synchronous” replication  To the primary, a Far Sync Instance looks like any other Data Guard destination Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 380
    • Active Data Guard Far Sync  How Does Redo Transport Work? Far Sync SYNC ASYNC Remote Standby Primary  Far Sync receives redo synchronously from primary  Far Sync forwards redo asynchronously to a remote standby – Supports up to 29 remote destinations – Can also perform network compression (Advanced Compression Option)  Several options to implement HA for Far Sync – Far Sync instance can be Oracle RAC, or a second Far Sync instance can be alternate destination, or the remote standby can be alternate destination (not shown) Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 381
    • Active Data Guard Far Sync  What Happens Should the Primary Fail? Far Sync ASYNC Remote Standby Primary  Far Sync has redo for all committed transactions  Remote standby database receives all redo from the Far Sync instance Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 382
    • Active Data Guard 12c Far Sync  How Do Role Transitions Work? Far Sync Single-Step Role Transition Primary New Primary  Single-step, zero data loss failover to remote standby – Far Sync confirms that the configuration is in zero data loss state – Remote Standby becomes primary - manual or automatic using Fast-Start Failover – Same failover command as for any Data Guard configuration  Switchover is also transparent - same command used for any configuration Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 383
    • ADG Far Sync Creation  Simple and Lightweight  Create a control file using an at least mounted primary  Copy the server parameter file (SPFILE) used by the primary – Several initialization parameters must also modified for Far Sync  Copy the control file to the Far Sync instance – Create standby redo log files  Start Far Sync Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 384
    • ADG Far Sync Example, New York  London ASYNC (compressed) Standby London SYNC Far Sync Instance Zero data loss failover Primary New York Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 385
    • ADG Far Sync – Post Failover Example, London  New York Far Sync Instance SYNC ASYNC Primary London (compressed) Standby New York Zero data loss failover Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 386
    • Extreme Availability  Data Guard Far Sync  Other Data Guard Enhancements  RMAN Enhancements  ASM and RAC Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 387
    • Data Guard Real-Time Cascading  Purpose: Eliminating propagation delay  In Oracle 11.2  Standby 1 waits until log switch before forwarding redo from archived logs to Standby 2 Primary SYNC or ASYNC Standby 1 ASYNC Standby 2  In Oracle 12.1  Standby 1 forwards redo to Standby 2 in real-time, as it is received: no propagation delay for a log switch  Standby 2 is up-to-date for offloading read-only queries/reports Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 388
    • Data Guard Fast Sync  Reduced impact on production for Maximum Availability Primary Standby Commit Commit Acknowledge Redo Logs Standby Redo Logs  For SYNC Mode: remote site acknowledges received redo before writing it to standby redo logs  Reduces latency of commit on primary Acknowledge returned on receipt Primary Standby LOG_ARCHIVE_DEST_3='SERVICE= stby1 SYNC NOAFFIRM' Commit Commit Acknowledge Redo Logs Standby Redo Logs Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 389
    • Extreme Availability  Data Guard Far Sync  Other Data Guard Enhancements  RMAN Enhancements  ASM and RAC Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 390
    • Fine-grained Table Recovery From Backup  Simple RECOVER TABLE command to recover one or more tables (most recent or older version) from an RMAN backup  Eliminates time and complexity 101 01 010 1 1 101001 1 011011110 0 0 1 0 1 00 0 0 1001101 1010 RMAN 01 Backups Copyright © 2013, Oracle and/or its affiliates. All rights reserved. associated with manual restore, recover & export – Enables fine-grained point-in-time recovery of individual tables instead of the contents of the entire tablespace – Restores the recovered table to an Oracle Data Pump dump file – Optionally imports the dump file and renames the table in the target database Upgrade, Migrate and Consolidate to Oracle Database 12c 391
    • Cross-Platform Backup & Restore  Simplified Platform Migration – Uses Data Pump for metadata, backup sets for data files Source Database (AIX) 1 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 1 0 0 1 0 0 1 Backup to Disk/Tape (data files, optional endian conversion, metadata export) Destination Database (Linux) Restore Backup (optional endian conversion, metadata import)  Simplifies procedure for platform migration  Minimize read-only impact with multiple incremental backups Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 392
    • Extreme Availability  Data Guard Far Sync  Other Data Guard Enhancements  RMAN Enhancements  ASM and RAC Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 393
    • ASM Overview  Oracle Database 11.2 or earlier RAC Cluster Database Instance One to One Mapping of ASM Instances to Servers DBA DBA DBB DBB DBB DBC ASM Instance ASM Node1 Node2 ASM ASM ASM Node3 Node4 Node5 ASM ASM Cluster Pool of Storage Shared Disk Groups Disk Group A Disk Group B ASM Disk Wide File Striping Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 394
    • Oracle ASM 12c – Overview  Oracle ASM 12c Standard Deployment RAC Cluster Database Instance One to One Mapping of ASM Instances to Servers ASM Instance DBA DBA DBB DBB DBB DBC ASM Instance Node1 ASM Node2 ASM Node3 ASM ASM Node4 Node5 ASM ASM Cluster Pool of Storage Shared Disk Groups Disk Group A Disk Group B ASM Disk Wide File Striping Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 395
    • Introducing Oracle Flex ASM  Removal of One to One Mapping and HA RAC Cluster Database Instance Databases share ASM instances ASM Instance DBA DBA DBB DBB DBB DBC ASM Instance Node1 Node1 runs as ASM Client to Node4 Node2 Node2 ASM Node3 ASM ASM Node4 Node2 runs as ASM Client to Node3 Node5 Node5 runs as ASM Client to Node4 ASM Cluster Pool of Storage Shared Disk Groups Disk Group A Disk Group B ASM Disk Wide File Striping Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 396
    • Flex ASM  Remote Access – In previous versions, ASM clients use OS-authentication to connect to ASM  This works because ASM clients and servers are always on the same server – With Oracle Database 12c:  ASM clients and ASM servers can be on different servers – A default configuration is created when the ASM cluster is configured Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 397
    • Supporting Pre-Oracle 12c Databases  Pre-Oracle 12c Databases require a local ASM instance RAC Cluster Database Instance Databases share ASM instances ASM Instance DBA Node1 11g DB ASM DBA Node2 DBB ASM DBB Node3 ASM DBB 11g DB ASM Node4 Node5 DBC ASM ASM Cluster Pool of Storage Shared Disk Groups Disk Group A Disk Group B ASM Disk Wide File Striping Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 398
    • Flex ASM  Other Flex ASM features – Increase maximum number of Disk Groups to 511 (previous: 63) – Command for renaming ASM Disk – ASM instance Patch-level verification  Patch level verification is disabled during rolling patches Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 399
    • Oracle Flex Cluster Better HA clustering for any application  Oracle Flex Cluster  A new Oracle Clusterware based High Availability clustering topology  Rim Nodes Utilizing two types of cluster nodes:  Hub nodes  Traditional nodes, tightly coupled via network and storage, used for running IO intensive workload  Rim nodes Hub Nodes  A new type of node that runs a lighter weight stack  Maintain their own failure and heartbeat settings  Do not require direct shared storage connectivity  Used for processing oriented (application) workload Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 400
    •  ILM & Compression New Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Extreme Availability  Hundreds of Enhancements Upgrade, Migrate and Consolidate to Oracle Database 12c 401
    • Hundreds of Enhancements Major New Features in Many Areas  32K Varchar, NVARCHAR, RAW types  IDENTITY Columns  Cross-platform RMAN Backup and Restore  Data Redaction  Move Data File Online  Invisible Columns  Application Continuity  Database Entitlement Analytics  Transaction Guard  Database Vault Persistent Protections  Oracle Spatial and Graph 3D Streaming  Flex Clusters  Data Pump Export View as Table  Clonedb Thin Provisioning  Advanced Index Compression  Real-Time Database Operations Monitoring  Query Filter Cache  Concurrent Statistics Gathering  In-Database MapReduce  Global Data Services  Adaptive Execution Plans  Temporal Database Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 402
    • Online Move of Datafiles  Rename or relocate datafiles online – Move from one type of storage to another, or into ASM – Examples:  Rename: ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO '/data/user001.dbf';  Relocate: ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO '/test/user1.dbf';  Copy: ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO '/test/user1.dbf' KEEP;  Move into ASM: ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO '+DATA/data/datafile/user1.dbf'; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 403
    • New Roles - Least Privileges  SYSDBA still keeps all privileges – New roles depending on tasks  RMAN – SYSBACKUP  Data Guard – SYSDG  Wallet administration for TDE – SYSKM Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 404
    • IDENTITY  Example: Create a table where the id column is always populated by Oracle CREATE TABLE t1 (id NUMBER GENERATED AS IDENTITY, first_name varchar2(30)); INSERT INTO t1(first_name) values ('Hugo'); ID FIRST_NAME ----- -----------1 Hugo Create a table where the id column is populated by Oracle when not provided CREATE TABLE t2 (id NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 100 INCREMENT BY 10), first_name varchar2(30)); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 405
    • Row Limit  Example: Select only the first 5 rows SELECT employee_id, last_name FROM employees ORDER BY employee_id FETCH FIRST 5 ROWS ONLY; Select the first 5% of rows and those whose salary “ties” with the lowest of the 5% SELECT employee_id, last_name, salary FROM employees ORDER BY salary FETCH FIRST 5 PERCENT ROWS WITH TIES; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 406
    • 32K VARCHAR2 / NVARCHAR2  Example: Enable 32k support in the Oracle Database 12c ALTER SYSTEM set MAX_STRING_SIZE=EXTENDED scope=SPFILE; SHUTDOWN IMMEDIATE STARTUP UPGRADE @?/rdbms/admin/utl32k.sql Create table with 32k varchar2 CREATE TABLE Applicants (id NUMBER GENERATED AS IDENTITY, first_name varchar2(30), last_name varchar2(30), application date, CV varchar2(32767) ); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 407
    • Enterprise Manager Express Menus  This tab requires Diagnostic & Tuning Pack licenses Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 408
    • Enterprise Manager Express  Manual configuration of the HTTP port for EM Express – In init.ora/spfile (default setting):  dispatchers=(PROTOCOL=TCP)(SERVICE=sample XDB) – Check on which port EM Express is configured:  SQL> select DBMS_XDB_CONFIG.getHTTPport() from dual; – SQL> select DBMS_XDB_CONFIG.getHTTPSport() from dual; – Set a new port:  SQL> exec DBMS_XDB.setHTTPport(5500); – SQL> exec DBMS_XDB.setHTTPSport(8080); – Now access the EM Express homepage in the browser:  http://database-hostname:port/em – http://localhost:5500/em – The configuration will have to be done for the CDB and every single PDB on different ports Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 409
    • Enterprise Manager Cloud Control 12c  Plug-in "Enterprise Manager For Oracle Database (DB) 12.1.0.3" already released via EM Self-Update – Supports Oracle Database 12.1.0.1 – Discovers CDBs and PDBs Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 410
    • Enterprise Manager Cloud Control 12c  Discovered Oracle Database 12c targets: Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 411
    • Redacting Sensitive Data  Mask Application Data Dynamically Call Center Operator Policy enforced redaction of sensitive data Soc. Sec. # DOB PIN Payroll Processing 115-69-3428 11/06/71 5623 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 412
    • Redaction Supported Transformations Stored Data Redacted Results 10/09/1992 01/01/2001 052-51-2147 XXX-XX-2147 RegExp tim.lee@acme.com [hidden]@acme.com Random 4451-2172-9841-4368 4943-6344-0547-0110 Full Partial Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 413
    • Redaction Policy based with conditional enforcement DBMS_REDACT.ADD_POLICY( policy_name => 'Redact Customer PII', object_schema => 'CALLCENTER', object_name => 'CUSTOMERS', column_name => 'DOB', expression => 'SYS_CONTEXT(''USERENV'',''CLIENT_IDENTIFIER'') !=''SUPERVISOR04''', function_type => DBMS_REDACT.FULL); Redaction decisions can be based on runtime conditions  Database environment – User, role, session, client IP, auth type…  Context from applications – App user, app role, app identifier, APEX V() and NV() functions  Context from Label Security – User session label Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 414
    • Redaction Application transparency  Supports commonly used Oracle Database data types  Maintains the data type and optionally the formatting  Does not alter the data in database caches, buffers, or storage – Redacts only for display  Works with views and does not alter the query plan  Typically requires zero application code or configuration changes Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 415
    • Hands-On-Lab – Part 4: Tweak your database Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 416
    • HOL – Part 4  Your task: – Switch PDB1 only to have MAX_STRING_SIZE=EXTENDED  Verify that by checking V$SYSTEM_PARAMETER – Switch the entire database CDB12 including all PDBs to MAX_STRING_SIZE=EXTENDED  Verify that by creating a table in PDB2 with a VARCHAR2 column larger than 4000 bytes – Configure and start the new EM Express – Rename the SYSTEM's tablespace datafile of PDB2 – Drop Pluggable Database PDB2 afterwards Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 417
    • Now, You Be The Expert! Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 418
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 419
    • Performance Checklist Prepare Plan Stability Test Performance Optimize Performance Enable Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.      Adjust maintenance windows Configure statistics retention Configure incremental statistics Adjust memory and optimizer parameters Configure AWR, ASH and ADDM  Preserve and transport execution plans  General test guidelines  Real Application Testing  System Statistics  Automatic Tuning Advisor  Performance New Features Upgrade, Migrate and Consolidate to Oracle Database 12c 420
    • Things to do right after upgrade  Adjust default maintenance windows – SQL> select CLIENT_NAME, STATUS from DBA_AUTOTASK_CLIENT;  Default weekday windows run from 10pm to 2am (4 hours)  Default weekend windows run from 6am to 2am (20 hours)  Resource Manager is active  Adjust windows to fit your business needs SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE( 'MONDAY_WINDOW','REPEAT_INTERVAL', 'freq=daily;byday=MON;byhour=05;byminute=0; bysecond=0'); SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE( 'MONDAY_WINDOW','DURATION',numtodsinterval(2,'hour')); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 421
    • Things to do right after upgrade  Configure statistics retention period – By default object statistics will be kept for 31 days – Data gets stored in SYSAUX tablespace – Check the current space consumption:  SQL> select SPACE_USAGE_KBYTES/1024 MB from V$SYSAUX_OCCUPANTS where OCCUPANT_NAME='SM/OPTSTAT'; – Check the current setting:  SQL> select DBMS_STATS.GET_STATS_HISTORY_RETENTION from DUAL; – Adjust the current setting (here: 10 days):  SQL> exec DBMS_STATS.ALTER_STATS_HISTORY_RETENTION(10); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 422
    • Things to do right after upgrade  Configure incremental statistics collection – Valid and useful for selected partitioned tables – Set it for selected tables only: SQL> exec DBMS_STATS. SET_TABLE_PREFS('SH','SALES','INCREMENTAL','TRUE');  Gather statistics for touched partition(s) ONLY – Stats for that table must be gathered with GRANULARITY parameter set to AUTO  Result: Faster runtime for stats collection on partitioned tables – Global setting: SQL> exec DBMS_STATS.SET_GLOBAL_PREFS('INCREMENTAL','TRUE'); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 423
    • Things to do right after upgrade  Incremental stats  Partition level stats are gathered & synopsis created Sales Table May 18th 2008 May 19th 2008 May 20th 2008  Global stats generated by aggregating the original partition synopsis with the new oneby Global stats generated aggregating partition level statistics and synopsis  May 21st 2008 May 22nd 2008 May 23rd 2008 May 24th 2008  each of  Retrieve synopsis forSYSAUXthe other partitions from  Gather partition statistics for new partition A new partition is added to the table & data is Loaded Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Sysaux Tablespace Upgrade, Migrate and Consolidate to Oracle Database 12c 424
    • Things to do right after upgrade  Configure Automatic Shared Memory Management – Especially important if Pluggable Database will be used – SGA_TARGET  In addition DB_CACHE_SIZE, SHARED_POOL_SIZE etc will define minimum values which won't be underrun – If resize operations (done by MMAN) happen to frequent "_MEMORY_BROKER_STAT_INTERVAL"=900 should be set – default is 30 (seconds) – PGA_AGGREGATE_TARGET – MEMORY_TARGET should only be used only for ASM and in smaller environments with very constant load Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 425
    • Parameter Information Oracle 12c  PGA_AGGREGATE_LIMIT – Values: integer [ K | M | G ] – Default: >2GB and 200% of PGA_AGGREGATE_TARGET and 3MB x PROCESSES – it will not exceed 120% of physical memory – SGA size. Setting it to 0 will mean "no limit" – Example:  SGA_TARGET=20G  PGA_AGGREGATE_TARGET=20G  PROCESSES=1200  Physical memory: 64G – Verification/calculation: » Min Limit: >2GB? Yes » 3MB x PROCESSES = 3.6G » 200% of PGA_AGGREGATE_TARGET = 40G » g 120% of physical memory – SGA size = 76.8G – 20G = 56.8G? Yes Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 426
    • Parameter Information Oracle 11.2/12c  _MEMORY_IMM_MODE_WITHOUT_AUTOSGA – Values: TRUE | FALSE – Purpose: Switching this parameter to FALSE will prevent the SGA from doing resize operations even though neither SGA_TARGET nor MEMORY_TARGET are set.  Explanation: A generic enhancement in 11.2.0.1 was made to allow IMMEDIATE mode requests even when SGA_TARGET (or MEMORY_TARGET) is not set. This enhancement has been introduced to prevent ORA-4031 errors due to shared pool pressure.  Feature can be turned off: alter system set "_memory_imm_mode_without_autosga"=FALSE;  Further information: Note:1269139.1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 427
    • Parameter Information Oracle 11.2/12c  OPTIMIZER_MODE – Values: ALL_ROWS | FIRST_ROWS | FIRST_ROWS_[1|10|100|1000] – Note:  Obsolete settings (will be ignored): – optimizer_mode=choose – optimizer_mode=rule » Only the /*+RULE */ hint will still work Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 428
    • Parameter Information Oracle 11.2/12c  OPTIMIZER_DYNAMIC_SAMPLING – If statistics are not available it controls whether dynamic stats will be gathered, and the sample size – Default: 2 – Values: 0-11  0: Switches off dynamic sampling  2: Check at max the first 64 blocks to generate stats on the fly  11: NEW SETTING – Use dynamic statistics automatically when the Optimizer deems it – Verifies cardinality and implements a time limit for the estimate – Results persist as Shareable Statistics Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 429
    • Parameter Information Oracle 11.2/12c Page 248 – SQL Tuning Guide – Oracle Database 12c  OPTIMIZER_DYNAMIC_SAMPLING Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 430
    • Parameter Information Oracle 11.2/12c  OPTIMIZER_USE_PENDING_STATISTICS – Values: FALSE | TRUE – Mitigate the risk of newly created object statistics  Object statistics persist through an upgrade  Temporarily switch on Pending Statistics: – SQL> exec DBMS_STATS.SET_GLOBAL_PREFS('PENDING','TRUE');  Afterwards gather new Oracle 12c statistics as "pending": – SQL> DBMS_STATS.GATHER_SCHEMA_STATS('SH');  Verify your critical statements with pending statistics: – SQL> alter session set optimizer_use_pending_statistics=TRUE;  Once everything is good publish them: – SQL> exec DBMS_STATS.PUBLISH_PENDING_STATS(); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 431
    • Parameter Information Oracle 11.2/12c  STATISTICS_LEVEL – Values: TYPICAL | ALL | BASIC – Note:  TYPICAL (recommended setting) will enable: – Automatic SGA Tuning (SGA_TARGET) – Automatic Statistics Collection – Active Session History (ASH) – DML Monitoring  This parameter is the basis for most diagnostics features Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 432
    • Parameter Information Oracle 11.2/12c  CONTROL_MANAGEMENT_PACK_ACCESS – Values: DIAGNOSTIC+TUNING | DIAGNOSTIC | NONE – Note:  NONE will switch off statistics collection for AWR, ASH etc – Should be set when Diagnostic Pack is not licensed for an instance – STATSPACK can still be used but has very limited functionality  STATSPACK Guide : MOS Note:394937.1  Turn of AWR/ASH in case you'll use STATSPACK Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 433
    • Configure AWR, ASH & ADDM SGA In-memory statistics MMON AWR Snapshots Alerts ADDM Proactive ADDM results DBA Reactive Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 434
    • Configure AWR, ASH & ADDM  Automatic Workload Repository (AWR) – Data collected by MMON  Default: Snapshot every 60 minutes kept for 8 days  Recommendation: SQL> exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(44640,30) -- 31 days (=4460min), every 30 minutes – Data stored in SYSAUX tablespace – purged automatically – Important scripts:  Size and trend: SQL> @?/rdbms/admin/awrinfo.sql  AWR report SI: SQL> @?/rdbms/admin/awrrpt.sql  AWR report RAC: SQL> @?/rdbms/admin/awrrpti.sql  AWR report SQLID: SQL> @?/rdbms/admin/awrsqrpt.sql  AWR diff report: SQL> @?/rdbms/admin/awrgrrpt.sql  AWR extract: SQL> @?/rdbms/admin/awrextr.sql  AWR load: SQL> @?/rdbms/admin/awrload.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 435
    • Configure AWR, ASH & ADDM  Active Session History (ASH) – Key to database diagnostics – Data collected by MMNL – View: V$ACTIVE_SESSION_HISTORY – Space and time usage:  Fixed size, circular buffer: 2MB x #CPUs (max. 5% SGA or <30MB)  Designed to hold ~1 hour of statistics, but may flush or fill sooner  Further info: Note:243132.1 – Important scripts:  ASH report SI: SQL> @?/rdbms/admin/ashrpt.sql  ASH report RAC: SQL> @?/rdbms/admin/ashrpti.sql Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 436
    • Configure AWR, ASH & ADDM  Real-Time ADDM – MMON obtains performance stats every 3 sec without lock/latch – MMON triggers a real-time ADDM analysis when: – MMON slave process creates report and stores it in AWR  See the DBA_HIST_REPORTS view Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 437
    • Performance Checklist Prepare Plan Stability Test Performance Optimize Performance Enable Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.      Adjust maintenance windows Configure statistics retention Configure incremental statistics Adjust memory and optimizer parameters Configure AWR, ASH and ADDM  Preserve and transport execution plans  General Test Guidelines  Real Application Testing  System Statistics  Automatic Tuning Advisor  Performance New Features Upgrade, Migrate and Consolidate to Oracle Database 12c 438
    • Typical situation after a change  Challenging to "freeze" execution plans and statistics  Difficulty: – Statement has been parsed and a plan got created Verification happens during execution: GB Parse Execute HJ Plan acceptable HJ – Now some conditions get changed (statistics, upgrade, parameters)  A new plan will be created - is it better or worse??? GB Parse Execute NL Plan possibly not acceptable NL Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 439
    • Strategies to enforce Plan Stability  Rule Based Optimizer? – Desupported since ages! If you don't believe it, see Note:189702.1  Stored Outlines? – Deprecated since Oracle 11g  Rewrite statements, reparameterization, hints ...? – Plenty of work – and neither predictable nor stable  Use SQL Plan Management – Free EE feature to ensure plan stability – Stores verified plans in a SQL Plan Baseline for reuse – Package: DBMS_SPM Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 440
    • SQL Plan Management  Phase 1 – Baseline Capture – Schematically - OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE • GB Parse If OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE then all found plans will be put into the baseline Execute Plan acceptable HJ HJ Initial plan will be accepted if repeated and will be added to the SQL Plan Baseline SQL MANAGEMENT BASE Plan History Plan Baseline Residing in SYSAUX TS. Will occupy max. 10% of SYSAUX. Weekly job will delete plans not used since 53 weeks [default]. GB SQL Profiles HJ HJ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 441
    • SQL Plan Management  Phase 2 - Selection – Same statement parsed again but a different plan will be created » OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=FALSE is set to its default » Annotation: If OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE then this plan would have been added to the baseline GB Parse NL NL New plan will be added to the Plan History but it won't be used unless it has been verified Plan History GB Plan Baseline NL NL GB HJ HJ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 442
    • SQL Plan Management  Phase 3 - Evolution – Schematically: Plan History GB GB Plan Baseline NL NL NL Plan History Worse plan will be kept in the Plan History GB NL Plan Baseline NL GB NL HJ GB NL GB HJ NL HJ HJ Equal or better plans can be added to the SQL Plan Baseline DBA schedules verification DBA DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE Optimizer Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 443
    • Configure SQL Plan Management  Change the retention period for plans in the SQL Management Base in SYSAUX tablespace – SQL> exec DBMS_SPM.CONFIGURE('plan_retention_weeks',5); – The default is 53 weeks  But: plans will be stored in LOB segments and can't shrink  Sources for SQL Plan Management can be: Load plans from a SQL Tuning Set Load plans from the Cursor Cache Load plans from Stored Outlines Cursor Cache Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c Load plans from a staging table Stage table 444
    • SQL Plan Management – Upgrade/OFE  Upgrade scenario 1   STS Repeatable plans will be added to the Plan Baseline upon 2nd execution Now: Different plans created with OFE=11 will be added to the Plan History for later verification Plan History GB NL Plan Baseline NL GB GB GB NL HJ NL NL NL HJ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 445
    • SQL Plan Management – Upgrade/OFE  Upgrade scenario 1 – Even though this scenario might look promising in the real world it won't generate purely Oracle 10g plans. Setting OFE to a different value as the actual database release will only parameterize the optimizer according to OFE setting – but it will already use the Oracle 12c code paths and therefore generate different plans than in Oracle 10g – This approach is not recommended Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 446
    • SQL Plan Management – Upgrade/Outlines  Upgrade scenario 2 Exp/imp outlines to New system SS STS exp imp ... Transfer query plans into the Plan Baseline with   DBMS_SPM.MIGRATE_STORED_OUTLINE Capture query outlines on the production system Plan History Plan Baseline GB GB GB NL HJ NL NL NL HJ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 447
    • SQL Plan Management – Upgrade/Outlines  Upgrade scenario 2 – In Oracle 9i/10g:  GRANT CREATE ANY OUTLINE TO APPUSER;  ALTER SYSTEM set CREATE_STORED_OUTLINES=MYPLANS;  Now run the statements you'd like to capture  ALTER SYSTEM set CREATE_STORED_OUTLINES=false;  Check the category (should be MYPLANS): SELECT name, sql_text, category FROM user_outlines; – Upgrade to Oracle 12c  variable repo clob; exec :repo:=DBMS_SPM.MIGRATE_STORED_OUTLINE( attribute_name=>'CATEGORY', attribute_value=>'MYPLANS'); Copyright © 2013, © 202 Oracle Corporation Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 448 448
    • SQL Plan Management - Upgrade  Upgrade scenario 3   Staging STS STS Table 1 Staging exp imp expdp impdp DB-Link ... DBMS_SPM.LOAD_PLANS_FROM_SQLSET Table 2 SQL Profiles Plan History 10.2 plans will be added to the SQL Plan Baseline GB NL Plan Baseline NL GB GB GB NL HJ NL NL NL HJ Every new and better plan will be stored in the Plan History Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 449
    • SQL Plan Management - Upgrade  Upgrade scenario 3: Capturing from Cursor Cache BEGIN – SYS.DBMS_SQLTUNE.CREATE_SQLSET( sqlset_name=>'SPM_STS',description=>'10.2 plans'); END; / DECLARE stscur dbms_sqltune.sqlset_cursor; BEGIN OPEN stscur FOR SELECT VALUE(P) FROM TABLE(dbms_sqltune.select_cursor_cache( 'parsing_schema_name<>''SYS''',null,null,null,null,1,null,'ALL')) P; -->> Populate the SQL Tuning Set dbms_sqltune.load_sqlset(sqlset_name=>'SPM_STS',populate_cursor=>stscur); END; / SQL> variable cnt number SQL> exec :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(sqlset_name=>'SPM_STS'); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 450
    • SQL Plan Management - New Application  New application (module) gets delivered  @Vendor  @Customer DBMS_SPM.CREATE_STGTAB_BASELINE Staging Staging exp imp expdp impdp Table Table DBMS_SPM.UNPACK_STGTAB_BASELINE DBMS_SPM.PACK_STGTAB_BASELINE Plan Baseline Plan Baseline GB GB GB GB GB GB NL HJ NL NL HJ NL NL NL HJ Copyright © 2013, Oracle and/or its affiliates. All rights reserved. NL NL HJ Upgrade, Migrate and Consolidate to Oracle Database 12c 451
    • SQL Plan Management - Transport  Transporting SQL Plan Management baselines between test and production databases – @Test System:    – Create a staging table using DBMS_SPM.CREATE_STGTAB_BASELINE Pack the required baselines into the staging table using DBMS_SPM.PACK_STGTAB_BASELINE Export the staging table into a dump file using Data Pump Export and transport it to the destination system @Production System:  Import the dump file into the destination database  Unpack the SQL Plan Baselines from the staging table into the SQL Management Base of the target system – DBMS_SPM.UNPACK_STGTAB_BASELINE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 452
    • SQL Plan Management  White Paper: – http://www.oracle.com/technetwork/database/focus-areas/bi- datawarehousing/twp-sql-plan-management-11gr2-133099.pdf  MOS Notes: – Note:456518.1 SQL Plan Management – Example – Note:789888.1 How to load plans from AWR into SPM – Note:801033.1 How to move 10.2 plans into 11g SPM Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 453
    • Performance Checklist Prepare Plan Stability Test Performance Optimize Performance Enable Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.      Adjust maintenance windows Configure statistics retention Configure incremental statistics Adjust memory and optimizer parameters Configure AWR, ASH and ADDM  Preserve and transport execution plans  General Test Guidelines  Real Application Testing  System Statistics  Automatic Tuning Advisor  Performance New Features Upgrade, Migrate and Consolidate to Oracle Database 12c 454
    • General Test Guidelines 1. Test the Upgrade – Is it successful? – How long does it take? 2. Test Post-Upgrade Functionality – Will your applications run correctly? 3. Test Post-Upgrade Performance – Time important queries, reports, and batch jobs  Managing Optimizer/CBO stats during upgrade: Note:465787.1 – Tune your init.ora parameters, OS parameters  Use real life loads! – Real Application Testing  SQL Performance Analyzer  Database Replay Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 455
    • Real Application Testing  Goal: – Record and replay a real workload to see how a system performs  Platform independent – Find regressions and changing plans before the upgrade – Do consistent performance evaluations upon application changes  Licensable database pack "Real Application Testing"  Available since Oracle Database 11.1.0.6  Available also with patch sets Oracle Database 10.2.0.4/5  Consists of: – Database Replay  DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY – SQL Performance Analyzer  DBMS_SPA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 456
    • Database Replay  Replay actual production database workload in test environment  Identify, analyze and fix potential instabilities before making changes to production  Capture Workload in Production – Capture full production workload with real load, timing & concurrency characteristics – Move the captured workload to test system  Replay Workload in Test – Make the desired changes in test system – Replay workload with full production characteristics – Honor commit ordering  Analyze & Report – Errors – Data divergence – Performance divergence Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 457
    • Database Replay: Supported Changes Client Client … Client Changes Unsupported •Use a tool such as Oracle Application Testing Suite Middle Tier Changes Supported •Database Upgrades, Patches •Schema, Parameters •RAC nodes, Interconnect •OS Platforms, OS Upgrades •CPU, Memory •Storage •Etc. Recording of External Client Requests Storage †Shared Server support from Oracle Database Release 11.2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 458
    • Step 1: Workload Capture Production System  All external client requests captured in binary files Client Client  System background and internal … Client activity excluded File System  Minimal overhead – Avoids function call when possible Middle Tier – Buffered I/O File 1  Independent of client protocol File 2  Can capture on 9.2.0.8 and replay … on 11g File n  Capture load for interesting time period, e.g., peak workload, month-end processing, etc. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Storage Upgrade, Migrate and Consolidate to Oracle Database 12c 459
    • Step 2: Process Workload Files  Setup test system – Application data should be same as production system as of capture start time – Use RMAN, Snapshot Standby, imp/exp, Data Pump, etc. to create test system – Make change: upgrade db and/or OS, change storage, migrate platforms, etc.  Processing transforms captured data into replayable format  Once processed, workload can be replayed many times  For RAC copy all capture files to single location for processing Test System File 1 File 1 File 2 File 2 … File n File n Metadata Capture Files Copyright © 2013, Oracle and/or its affiliates. All rights reserved. … Upgrade, Migrate and Consolidate to Oracle Database 12c Replay Files 460
    • Step 3: Replay Workload  Replay captured workload – Replayed operations see the same data and perform the same work – Preserve timing and concurrency characteristics – Same number of user connections  Replay Client – Multithreaded OCI Client – Drives multiple captured processes – Scalable Architecture – Interprets capture into sequence of OCI calls – Functional replay Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Replay Clients … File 1 Timing Preservation Re-mapping File 2 Server Server … … Server Commit Order Synchronization Sequence Replay Background File N Metadata Replay Files Upgrade, Migrate and Consolidate to Oracle Database 12c 461
    • Step 4: Analysis & Reporting  Error Divergence: For each call error divergence is reported – – Not Found: Error encountered during capture not seen during replay –  New: Error encountered during replay not seen during capture Mutated: Different error produced in replay than during capture Data Divergence – –  Replay: Number of rows returned by each call are compared and divergences reported User: Application level validation scripts Performance Reporting – Capture and Replay Report: Provides high-level performance information – ADDM Report: Provides in-depth performance analysis – AWR, ASH Report: Facilitates comparative or skew analysis Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 462
    • Consolidated Database Replays Validating consolidation strategies • Allows workload captured on different databases to be consolidated for replay SALES HR • Works for manually consolidated databases or Pluggable Databases ERP CRM Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 463
    • SQL Performance Analyzer - Overview Test Production No clients/middle tier necessary Clients/ Middle Tier SQL Performance Analyzer Oracle Database Capture SQLs Re-execute SQLs Transport SQLs Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 464
    • SPA in Enterprise Manager 12c Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 465
    • SPA for upgrades from 10g/11g  Setup 11.2.0.3 10.2.0.3 Upgrade STS R2 Evaluate, compare and tune – over and over again! Capture SQLs into a STS Load STS SQL Performance Analyzer STS Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 466
    • Resulting Reports  Example: Report showing regressed statements and plans Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 467
    • Performance Checklist Prepare Plan Stability Test Performance Optimize Performance Enable Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.      Adjust maintenance windows Configure statistics retention Configure incremental statistics Adjust memory and optimizer parameters Configure AWR, ASH and ADDM  Preserve and transport execution plans  SQL Performance Analyzer  Database Replay  System Statistics  Automatic Tuning Advisor  Performance New Features Upgrade, Migrate and Consolidate to Oracle Database 12c 468
    • Gather Workload Statistics ° ° Best Practice ° °  Gather system statistics during a regular workload period – otherwise inappropriate values for the CBO will be used: SQL> EXECUTE dbms_stats.gather_system_stats('start'); << Run it for several hours on a workload – does not generate overhead!!! >> SQL> EXECUTE dbms_stats.gather_system_stats('stop'); SQL> select pname NAME, pval1 VALUE, pval2 INFO from aux_stats$; NAME VALUE INFO -------------------- ---------- -----------------------------STATUS COMPLETED DSTART 04-03-2011 12:30 DSTOP 05-03-2011 12:30 FLAGS 1 CPUSPEEDNW 2498,65 IOSEEKTIM 11,405 IOTFRSPEED 25595,605 ... Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 469
    • Gather Workload Statistics ° ° ° INFO °  Calibrate I/O (Orion): Example SET SERVEROUTPUT ON DECLARE lat INTEGER; iops INTEGER; mbps INTEGER; BEGIN DBMS_RESOURCE_MANAGER.CALIBRATE_IO (28, 10, iops, mbps, lat); DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops); DBMS_OUTPUT.PUT_LINE ('latency = ' || lat); DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps); end; / – This is a requirement for AUTODOP (automatic degree of parallelism in 11.2.0.2) – in addition PARALLEL_DEGREE_POLICY must be set to AUTO  Delete system stats and revert to the default values: SQL> EXECUTE dbms_stats.delete_system_stats; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 470
    • Workload Stats: Further Information  See the Performance Tuning Guide for all stats: – http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/stats.htm#PFGRF94743 – See also: – 13.4.1.2 Multiblock Read Count If you gather workload statistics, then the mbrc value gathered as part of the workload statistics is used to estimate the cost of a full table scan. However, during the gathering process of workload statistics, Oracle Database may not gather the mbrc and mreadtim values if no table scans are performed during serial workloads, as is often the case with OLTP systems. However, full table scans occur frequently on DSS systems but may run parallel and bypass the buffer cache. In such cases, Oracle Database still gathers the sreadtim value because the database performs index lookup using the buffer cache. – If Oracle Database cannot gather or validate gathered mbrc or mreadtim values, but has gathered sreadtim and cpuspeed values, then the database uses only the sreadtim and cpuspeed values for costing. In this case, the optimizer uses the value of the initialization parameter DB_FILE_MULTIBLOCK_READ_COUNT to cost a full table scan. However, if DB_FILE_MULTIBLOCK_READ_COUNT is not set or is set to 0 (zero), then the optimizer uses a value of 8 for costing. Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 471
    • Post Upgrade: Fixed Table Stats ° ° Best Practice ° °  Create fixed table statistics some days after the upgrade has been completed: SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS; – Fixed objects (X$ tables) are usually undocumented and they are not tagged by the Automatic Statistics Gathering job  Findings: – MMON may cause too much CPU load if fixed objects stats haven't been generated – Internal recursive queries perform better  Guidelines – Create fixed table statistics a week after upgrade – Gather fixed table statistics during a representative workload period – This task should be done only a few times per year Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 472
    • Parameter Information  OPTIMIZER_IGNORE_HINTS – Values: TRUE | FALSE – SQL hints that worked in one release may not work in another – Test all SQL statements with hints on the new release using the parameter  Chances are high that SQL statements will perform better without any hints Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 473
    • Parameter Information  OPTIMIZER_USE_INVISIBLE_INDEXES – Values: TRUE | FALSE – Background: With modern IO systems full table scans might be more efficient than index lookups – but dropping and recreating an index is expensive. By making an index invisible to the optimizer the effect on query performance can be detected before it affects production users. This is extremely beneficial in an Exadata environment. – Example: ALTER INDEX idx_ename ON emp(ename) INVISIBLE; ALTER SESSION SET OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 474
    • Parameter Information  CELL_OFFLOAD_PLAN_DISPLAY – Values: TRUE | FALSE – Background: Will display you potential savings with a cell storage – STORAGE indicates which parts of the query could be offloaded to the storage cells using smart scan – Example: ------------------------------------------| Id | Operation | Name | ------------------------------------------| 0 | SELECT STATEMENT | | | *1 | HASH JOIN | | | *2 | HASH JOIN | | | *3 | TABLE ACCESS STORAGE FULL | SALES | | *4 | TABLE ACCESS STORAGE FULL | SALES | | *5 | TABLE ACCESS STORAGE FULL | SALES | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 475
    • SQL Real-Time Monitoring  Dedicated statistics collected for a single execution of a SQL statement when its execution becomes high-load – Target:  Parallel queries, parallel DML or parallel DDL  Execution that exceeds 5 sec of CPU or I/O time – Global SQL level statistics are collected: V$SQL_MONITOR – Plan level statistics are collected (#rows, memory, temp space, start/end date): V$SQL_PLAN_MONITOR – Statistics are updated quasi real-time while the query executes – Statistics for completed executions are retained for at least 5 minutes – Feature switched on by default  Part of Tuning Pack  Note:1229904.1: Real-Time SQL Monitoring in 11g Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 476
    • SQL Real-Time Monitoring Report  DBMS_SQLTUNE.REPORT_SQL_MONITOR() allows to display monitoring information – Format: xml, text and html – Join with ASH data  SQL Real-time monitoring with GUI integrated since 11.1.0.7    Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 477
    • SQL Real-Time Monitoring – Example • DB Time signals a possible performance issue Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 478
    • SQL Real-Time Monitoring – Example  TOP ACTIVITY page confirms a problem with highly skewed DB Time by SQLID Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 479
    • SQL Real-Time Monitoring – Example  SQLID shows parallel execution Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 480
    • SQL Real-Time Monitoring – Example Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 481
    • Manual SQL Tuning Challenges  Complex - requires expertise in several domains – SQL optimization: adjust the execution plan – Access design: provide fast data access – SQL design: use appropriate SQL constructs – Application design: what is the application trying to do?  Time consuming – Each SQL statement is unique – Potentially large number of statements to tune  Never ending task – SQL workload always evolving – Plan changes due to data changes, system changes, … Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 482
    • Manual vs Automatic SQL Tuning  Manual SQL Tuning is complex, time consuming and a neverending task  SQL Tuning Advisor and SQL Access Advisor act like tuning experts  Automatic SQL Tuning advisor even selects tuning candidates Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 483
    • SQL Access and SQL Tuning Advisors  SQL Access Advisor: – Requires a workload (many statements) – Potential recommendations:  Indexes  Materialized Views  Indexes on Materialized Views  Partitioning Advisor  SQL Tuning Advisor – Can operate on a single SQL statement – Optimizer in Comprehensive Tuning Mode – Potential recommendations:  SQL Profiles  Indexes Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 484
    • SQL Tuning Advisor  Can be used in EM or on CLI (via DBMS_SQLTUNE) – Part of Tuning Pack since Oracle 10g – SQL Profiles contain information that lead to improved execution plans without changing the application code  Use different optimizer settings  Correct wrong/missing statistics and wrong estimates  SQL Profiles don’t change the original SQL statement  SQL Profiles are persistent  SQL Profiles can be transported within SQL Tuning Sets (STS) – See Note:751068.1 for an example  SQL Profiles can be tested and verified without any risk Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 485
    • SQL Tuning  Example: Results of SQL Tuning Advisor  SQL Profile  Copyright © 2013, Oracle and/or its affiliates. All rights reserved.  Upgrade, Migrate and Consolidate to Oracle Database 12c 486
    • SQL Tuning  Example: Compare original to new explain plan   Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 487
    • SQL Tuning with DBMS_SQLTUNE  4 steps to get an SQL Profile – DBMS_SQLTUNE.CREATE_TUNING_TASK – DBMS_SQLTUNE.EXECUTE_TUNING_TASK – DBMS_SQLTUNE.REPORT_TUNING_TASK – DBMS_SQLTUNE.ACCEPT_SQL_PROFILE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 488
    • SQL Tuning - DBMS_SQLTUNE Tuning Task Management SQL Profile Management o o o o o o o o o o o o o o o CANCEL_TUNING_TASK CREATE_TUNING_TASK DROP_TUNING_TASK EXECUTE_TUNING_TASK IMPLEMENT_TUNING_TASK INTERRUPT_TUNING_TASK REPORT_AUTO_TUNING_TASK REPORT_TUNING_TASK RESUME_TUNING_TASK SCRIPT_TUNING_TASK RESET_TUNING_TASK SET_TUNING_TASK_PARAMETER Staging Table Management o o o o o o o o CREATE_STGTAB_SQLPROF CREATE_STGTAB_SQLSET PACK_STGTAB_SQLPROF PACK_STGTAB_SQLSET REMAP_STGTAB_SQLPROF REMAP_STGTAB_SQLSET UNPACK_STGTAB_SQLPROF UNPACK_STGTAB_SQLSET Copyright © 2013, Oracle and/or its affiliates. All rights reserved. ACCEPT_SQL_PROFILE ALTER_SQL_PROFILE DROP_SQL_PROFILE Select SQL Statements o o o o o CAPTURE_CURSOR_CACHE_SQLSET SELECT_CURSOR_CACHE REPORT_SQL_MONITOR SELECT_WORKLOAD_REPOSITORY SQLTEXT_TO_SIGNATURE SQL Tuning Set Management o o o o o o o o ADD_SQLSET_REFERENCE CREATE_SQLSET DELETE_SQLSET DROP_SQLSET LOAD_SQLSET REMOVE_SQLSET_REFERENCE SELECT_SQLSET UPDATE_SQLSET Upgrade, Migrate and Consolidate to Oracle Database 12c 489
    • SQL Tuning Task Command Line Example exec DBMS_SQLTUNE.DROP_TUNING_TASK('my_tuning_task'); DECLARE my_task_name VARCHAR2(30); my_sqltext CLOB; BEGIN my_sqltext := q'!<your SQL - concatenate lines with ||>!'; my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_text => my_sqltext, user_name => XY,scope => 'COMPREHENSIVE',time_limit => 60, task_name => 'my_tuning_task', description => 'test'); END; / exec DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_tuning_task' ); SELECT sofar, totalwork FROM V$ADVISOR_PROGRESS WHERE task_id = (SELECT task_id FROM USER_ADVISOR_TASKS WHERE task_name='my_tuning_task'); SET LONG 100000 SET LONGCHUNKSIZE 100000 SET LINESIZE 10000 SET PAGESIZE 10000 SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_tuning_task') FROM DUAL; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 490
    • SQL Profile containing literals - not binds  SQL Profiles can handle statements containing literals (instead of binds) as well: – Since 11.1.0.6 possible in EM: – In 10.2 only possible on command line: exec :p_name:=dbms_sqltune.accept_sql_profile (task_name=>'XT',name=>'XT_PROFILE', FORCE_MATCH=>TRUE); SQL> select name, status, force_matching, sql_text from dba_sql_profiles; NAME STATUS FOR SQL_TEXT ------- -------- ---- -------------------------------------------- MY_PROF ENABLED YES select /*+ use_nl(c) ordered */ count(*) from sh.sales s, sh.customers c where c.cust_id = s.cust_id and CUST_FIRST_NAME = 'Mike' Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 491
    • SQL Profile - evaluation  SQL Profiles should be evaluated before making them available to every user: exec :p_name:=dbms_sqltune.accept_sql_profile task_name=>'XT',name=>'XT_PROFILE', category=>'TEST_ENV', FORCE_MATCH=>TRUE) alter session set SQLTUNE_CATEGORY=' TEST_ENV'; – Now evaluate the statement's profile in a limited user context – If verification went fine, make it accessible to everybody exec dbms_sqltune.alter_sql_profile (name=>'XT_PROFILE', attribute_name=>'CATEGORY',value=>'DEFAULT') Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 492
    • SQL Tuning Automation in 11g  Fully automatic SQL Tuning task – Runs automatically in the Maintenance Window – Identifies, ranks and tunes candidate SQL – Leverages SQL Tuning Advisor  Candidate high-load SQL automatically chosen by ADDM – Excluded: parallel queries, DML/DDL, recursive, ad-hoc (infrequent)  Tests and (optionally) implements SQL profiles – Only implements significantly improved plans (3x) – Time budgeted to avoid run-away plans  New PL/SQL Package: DBMS_AUTO_SQLTUNE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 493
    • SQL Tuning Automation in 11g  Configure Automatic SQL Tuning Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 494
    • SQL Tuning Automation in 11g Implement SQL Profiles Test SQL Profiles Workload Generate Recommendations Choose Candidate SQL SQL Tuning Candidates one week AWR DBA Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c It’s Automatic! View Reports / Control Process 495
    • Real World Checkpoint Customer  The Customer: Deutsche Messe AG Project – HQ in Hannover, Germany – Largest trade fair worldwide Constraints – Key trade fairs:  CeBIT  Hannover Messe Preparation – ~1,000,000 m² exhibition space Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 496
    • Deutsche Messe Customer  Project scope: – Upgrade of a 3-node Oracle 10.2.0.3 RAC Cluster Project to Oracle 11.1.0.7  Move from raw devices to ASM  Use Snapshot Standby instead of RMAN to refresh Constraints development databases  Tune third-party application with Automatic SQL Preparation Upgrade Tuning  Sun Solaris 10 – Initially 2 databases to upgrade (each ~350GB): Success?  CeBIT system  Online ordering web application Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 497
    • Deutsche Messe Customer  Constraints: – Keep the old hardware Project – The "worst" application ever ... Constraints Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 498
    • Deutsche Messe Customer  Performance: – AWR snapshots Project – Automatic SQL Tuning showed excellent results – Real Application Testing (Database Replay) done Constraints during high-load phase during CeBIT 2009 Preparation Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 499
    • Deutsche Messe Customer  Upgrade – Data Pump used for upgrade, consolidation and Project reorganization – Everything went well ... until ... Constraints  Right at the end of impdp run the cluster node went down and was restarted Preparation Upgrade  Reason: EM Agent was going amok and requested all available RAM and swap until Clusterware cleaned up the situation by a restart – Remedy: Upgrade the agents to the version matching your Grid Control !!! Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 500
    • Deutsche Messe Customer  Live? And alive? – Yes! Go-live in September and October 2009  But highest load to be expected in March 2010 Project (CeBIT!!) Constraints – Overall downtime: 4 hrs – Application is faster than ever Preparation – Customer kept 3 year old hardware – All SAP systems recently upgraded to 11.2.0.2 Upgrade  More information: OOW 2010 presentation and Success Story Success? – http://apex.oracle.com/pls/apex/f?p=202202:2:::::P2_SUCHWORT:messe – http://www.oracle.com/us/corporate/customers/deutsche-messe-1-dbsnapshot-367194.pdf Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 501
    • Deutsche Messe Customer  "Heal" a terrible application Project Constraints Preparation Improvement factor: ~250,000x !!! Upgrade Success? Remarks Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 502
    • Performance Checklist Prepare Plan Stability Test Performance Optimize Performance Enable Features Copyright © 2013, Oracle and/or its affiliates. All rights reserved.      Adjust maintenance windows Configure statistics retention Configure incremental statistics Adjust memory and optimizer parameters Configure AWR, ASH and ADDM  Preserve and transport execution plans  SQL Performance Analyzer  Database Replay  System Statistics  Automatic Tuning Advisor  Performance New Features Upgrade, Migrate and Consolidate to Oracle Database 12c 503
    • AUTODOP – Degree of Parallelism  Feature Automatic Degree of Parallelism was introduced in Oracle 11.2.0.2  Requires I/O calibration (Orion): SET SERVEROUTPUT ON DECLARE lat INTEGER; iops INTEGER; mbps INTEGER; BEGIN DBMS_RESOURCE_MANAGER.CALIBRATE_IO (84, 10, iops, mbps, lat); DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops); DBMS_OUTPUT.PUT_LINE ('latency = ' || lat); DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps); end; / SELECT * FROM DBA_RSRC_IO_CALIBRATE;  Enabled by setting init parameter: SQL> ALTER SESSION SET PARALLEL_DEGREE_POLICY=AUTO; Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 504
    • Automated Degree of Parallelism How it works SQL statement Statement is hard parsed And optimizer determines the execution plan If estimated time less than threshold If estimated time greater than threshold Optimizer determines ideal DOP Actual DOP = MIN(default DOP, ideal DOP) PARALLEL_MIN_TIME_THRESHOLD Statement executes in parallel Statement executes serially Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 505
    • Adaptive Cursor Sharing  Adaptive cursor sharing introduced in 11g  Common problem: – When bind variables are used, the initial plan can be suboptimal due to the fact that   – Future values used in future executions share the initial plan The first set of binds used may not be representative of the majority of executions For explanation and examples see Note:740052.1 and Note:836256.1  This feature monitors the execution statistics for candidates queries and makes it possible for the same query to generate and use different execution plans for different set of binds values  Parameter: _optimizer_adaptive_cursor_sharing=FALSE|TRUE Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 506
    • PL/SQL Native Compilation  Previous versions of Oracle required a directory object, an external compiler license for each deployment system, and many parameters to use PL/SQL native compilation  Since Oracle 11g: Easier, Cheaper, Faster – No directory object needed: compiled library resides in database – No external compiler required – no extra license costs! – Can speed up PL/SQL performance (results may vary) – Just two PL/SQL native compilation parameters to set:  plsql_code_type=native  plsql_optimize_level=3 – Then recompile the schemas:  SQL> exec DBMS_UTILITY.COMPILE_SCHEMA('<username>');  Conclusion: – Native compilation lead to a slightly better overall completion timing Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 507
    • SecureFiles  SecureFiles = new LOB storage technology – Better performance – Additional features: deduplication, encryption  Examples: CREATE TABLE t1 (a CLOB) LOB(a) STORE AS SECUREFILE; CREATE TABLE t2 (a CLOB) LOB(a) STORE AS SECUREFILE (DEDUPLICATE); CREATE TABLE t3 (a CLOB ENCRYPT USING 'AES128') LOB(a) STORE AS SECUREFILE (CACHE); – Tablespace must be ASSM managed – Initialization parameter: DB_SECUREFILE = [NEVER | PERMITTED | PREFERRED | ALWAYS | IGNORE]  CREATE TABLE t1 (a CLOB); Copyright © 2013, Oracle and/or its affiliates. All rights reserved. -- this will be a Securefile!!! Upgrade, Migrate and Consolidate to Oracle Database 12c 508
    • LONG/LOB  SecureFile Conversion  LONG and BasicFiles LOB data types are still supported – But they have many limitations (size, performance, operations)  Recommendation: Move to SecureFiles – Data Pump Import with TRANSFORM=LOB_STORAGE:SECUREFILE – Use Online Redefinition with DBMS_REDEFINITION  For conversion examples see: Note:728758.1 How to online convert from BasicFiles to SecureFiles  Advantage: Source table is available during the whole process  SecureFiles are fully transparent to applications! – Data type still a BLOB/CLOB – No functional differences – API access via PL/SQL (DBMS_LOB), JDBC, .NET, PHP …  Reference: – Wellcome Trust Sanger Institute - >1000 TB Database Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 509
    • Compression  Index compression available since 8i  Table compression available since 9.2 – Designated for DWH – Direct path and bulk INSERTs, CREATE TABLE .. AS SELECT – Didn't work for INSERT/UPDATE/DELETE  Before 11g syntax: CREATE TABLE sales_history… COMPRESS  New 11g syntax: CREATE TABLE sales_history… COMPRESS BASIC – BASIC has superseded the clause FOR DIRECT_LOAD OPERATIONS in 11.2  In 12c, change compression while migrating – Data Pump import TRANSFORM=TABLE_COMPRESSION_CLAUSE:<clause> Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 510
    • Advanced Compression  Advanced Compression since Oracle 11g works for: – All types of data – Backup  New RMAN compression algorithm – Data Pump exports – Data Guard gap resolution and LGWR ASYNC transport  Reduces resource requirements and costs!!! – Storage – Performance  Typically 2x to 4x compression possible DML uncompressed PCTFREE reached: Compression! Further DML uncompressed PCTFREE reached: Compression! Overhead Free Space uncompressed compressed Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 511
    • Advanced Compression  http://www.oracle.com/technetwork/database/focus- areas/storage/advanced-compression-whitepaper-130502.pdf Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 512
    • Advanced Compression  Compression Advisor – DBMS_COMPRESSION since Oracle 11.2 – Download for earlier releases: http://www.oracle.com/technetwork/database/options/compression/index.html Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 513
    • Hybrid Columnar Compression (HCC)  Available only on Exadata, ZFS and Pillar Axiom 600 Storage – WP: http://www.oracle.com/technetwork/middleware/bi-foundation/ehcc-twp-131254.pdf – No extra license required – For historical data getting VERY LITTLE changes – Compression ratio is very high – How it works:  Tables are organized into Compression Units (CUs) – CUs are larger than database blocks  Within Compression Units, data is organized by column instead of by row – Column organization brings similar values close together, enhancing compression Compression Unit 10x to 15x Reduction Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 514
    • Hybrid Columnar Compression (HCC)  Compression Units – Logical structure spanning multiple database blocks – Data organized by column during data load – Each column is compressed separately – All column data for a set of rows stored in compression unit Logical Compression Unit BLOCK HEADER CU HEADER BLOCK HEADER C3 C1 C2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. BLOCK HEADER C7 C4 C5 C6 Upgrade, Migrate and Consolidate to Oracle Database 12c BLOCK HEADER C8 C8 515
    • Introduction & Overview General Preparation Steps Upgrade & Migration Cases Fallback Strategies New Features in Oracle 12c Performance Management Wrap Up Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 516
    • Slides Download: blogs.oracle.com/UPGRADE Scroll down to go to the slides Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 517
    • Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 518
    • Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 519