You are on page 1of 96

Upgrade and Migrate to

Oracle Database 19c and the Cloud


Workshop for Samsung SDS

Roy Swonger
Vice President Development

Mike Dietrich
Senior Director Product Management

1
Copyright © 2022, Oracle and/or its affiliates
ROY SWONGER
Vice President
Database Upgrade, Utilities & Patching

royfswonger

@royfswonger

2 Copyright © 2022, Oracle and/or its affiliates


MIKE DIETRICH
Senior Director Product Management
Database Upgrade, Migrations and Patching

mikedietrich

@mikedietrichde

https://mikedietrichde.com

3 Copyright © 2022, Oracle and/or its affiliates


Modernize
Upgrade to Oracle Database 19c

Photo by SpaceX on Unsplash


4 Copyright © 2022 Oracle and/or its affiliates.
your road to
AutoUpgrade

The ONLY recommended way to upgrade


databases
Photo by Joshua Sortino on Unsplash
AutoUpgrade | Overview

11.2.0.4 1. 2. 3.
12.2.0.1
12.1.0.2
18c
12.2.0.1
18c ONE BUTTON APPROACH 19c
21c
19c But giving you all the control you want
CONFIG FILE ANALYZE UPGRADE

Optionally,
convert to PDB

7 Copyright © 2022 Oracle and/or its affiliates


SAP Migration into Cloud

Photo by Rhys Moult on Unsplash


9 Copyright © 2021, Oracle and/or its affiliates
SAP in AWS Cloud Environments

Requirement: SAP Application & Database tiers must be in same cloud environment
• No hybrid deployment

Oracle Database for SAP Netweaver is supported on Amazon EC2 only


• NOTE: RDS is not supported!
• Single instance only, no RAC
• Unicode deployment of Netweaver is required
• See SAP technical note for details:
• 2358420 - Oracle Database Support for Amazon Web Services EC2

10 Copyright © 2022, Oracle and/or its affiliates


SAP Oracle Database Migration to Cloud

Five migration methods for SAP database to Oracle cloud:

1. RMAN backup/restore
• Or same method by using BR*Tools brbackup command
• Requires compatible source/target platform

2. RMAN duplicate from active database


• Optionally, using Oracle Data Guard to minimize downtime
• Requires compatible source/target platform

3. Cross-platform Transportable Tablespace


• Method to use for AIX->Linux migration

11 Copyright © 2022, Oracle and/or its affiliates


MIGRATION
methods

DATA TRANS- DATA PUMP


ZDM GUARD PORTABLE GOLDENGATE

12 Copyright © 2021, Oracle and/or its affiliates


Redo
apply

Primary
database
Standby
database
Hybrid Data Guard to Exadata Cloud Services
Production Database on Premises and Disaster Recovery
with Oracle Cloud Infrastructure Exadata Cloud Service
MIGRATION
methods

DATA TRANS- DATA PUMP


ZDM GUARD PORTABLE GOLDENGATE

15 Copyright © 2021, Oracle and/or its affiliates


SQL> SELECT platform_name, endian_format
FROM v$transportable_platform
WHERE endian_format!='Little';

PLATFORM_NAME ENDIAN_FORMAT
____________________________________ ________________
AIX-Based Systems (64-bit) Big
Apple Mac OS Big
HP-UX (64-bit) Big
HP-UX IA (64-bit) Big
IBM Power Based Linux Big
IBM zSeries Based Linux Big
Linux OS (S64) Big
Solaris[tm] OE (32-bit) Big
Solaris[tm] OE (64-bit) Big
Endianness Migration | Transport

Big Endianness platforms


• HP-UX (64-bit)
• HP-UX IA (64-bit)
• AIX-Based Systems (64-bit)
• IBM zSeries Based Linux
• IBM Power Based Linux
• Solaris[tm] OE (32-bit)
Convert
• Solaris[tm] OE (64-bit)

Pro Tip: You can use Transportable


Tablespace even for little Endian
migrations

17 Copyright © 2021, Oracle and/or its affiliates



Transport

Methods

Photo by Fahrul Azmi on Unsplash

Copyright © 2021 Oracle and/or its affiliates.


Data Pump
Full Transportable
Export/Import
New, empty
Tablespace
Meta plug-in
data transfer 19c PDB
Source database (users, tables, indexes, triggers, PL/SQL ...)

12.1.0.2

Final
Level
Level10incremental
imagefile backup
backup
Tablespaces
Convert
Different data file
Set read-only on restore
endian format
Data Pump
Full Transportable
Export/Import

Source Target
Primary
Tablespace plug-in
via redo apply
Tablespaces Target
Restore Standby
Transport

Checklist

Photo by Sebastian Herrmann on Unsplash

Copyright © 2021 Oracle and/or its affiliates.


Transportable | Starter Checklist

Database Creation Target database requirements


Backup / Recovery • COMPATIBLE must be the same or higher
TDE
PERL Scripts Target database requirements with workarounds
• Identical character set
• Identical national character set
• Identical time zone (only with TIMESTAMP WITH LOCAL TIME ZONE)
• Identical time zone file version (only with TIMESTAMP WITH TIME ZONE)

25 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation OCI databases are AL32UTF8


Backup / Recovery • Change in Advanced Options
TDE
PERL Scripts Database 12.2 and higher
• PDB can use different character set

Recommendation
• Keep production CDB on AL32UTF8
• Provision temporary CDB with desired character set
• Create new empty PDB in temporary CDB
• Clone custom PDB to production CDB

26 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation OCI DB Systems are in UTC time zone


Backup / Recovery • Change in Advanced Options
TDE
PERL Scripts Sets the OS time zone, which affects:
• SYSDATE
• SYSTIMESTAMP

How to change the Time Zone in Oracle Database Hosted in


OCI with an Example (Doc ID 2459830.1)

27 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation OCI database time zone defaults to UTC


Backup / Recovery
TDE Change for CDB:
PERL Scripts SQL> alter database cdb1 set time_zone = '+02:00';

PDBs can have different DB Time Zone:


SQL> alter pluggable database pdb1 set time_zone = '+04:00';

Only relevant for


• TSLTZ
• CURRENT_DATE
• CURRENT_TIMESTAMP
• LOCALTIMESTAMP

28 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation Enable Block Change Tracking on source for incremental


Backup / Recovery backups
SQL> SELECT status, filename FROM V$BLOCK_CHANGE_TRACKING;
TDE SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
PERL Scripts

• Conversion on destination is usually faster than on source

• PERL scripts will do the conversion

• Requires
• Enterprise Edition (on-prem)
• Enterprise Edition Extreme Performance (DBCS)
• Exadata

29 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation TDE Encryption


Backup / Recovery • Not supported
TDE • Only for same-Endianness migration
PERL Scripts

30 Copyright © 2021, Oracle and/or its affiliates


Transportable | Starter Checklist

Database Creation RMAN Incremental Backups


Backup / Recovery • MOS Note: 2471245.1
TDE V4 PERL Scripts to reduce Transportable Tablespace Downtime
using Cross Platform Incremental Backup
PERL Scripts

• Source: 10.2.0.3 or newer

• Target: 11.2.0.4 or newer

31 Copyright © 2021, Oracle and/or its affiliates










Mitigate risks
Performance Stability

Photo by Loic Leray on Unsplash


33 Copyright © 2022 Oracle and/or its affiliates.
your road to
“ Help me - I have an upgrade problem”…

In

95%
of all cases, "upgrade problem" in reality is a performance
issue
after upgrade. Or not database related.

Photo by nikko macaspac on Unsplash


There is exactly one way to mitigate the risk.

TESTING!
Only proper testing can mitigate the risk and

" avoid potential performance regressions


Database Cloud Service | Exadata

World's best database machine, provision with GI

Restrictions:
• As many databases as you want
• Non-CDB are supported only for 12.1.0.2 and 19c
• Supports RAC
• Max. storage up to 598 TB
• Depend on Exadata version and configuration
• Additional storage can be allocated via additional storage servers

To create non-CDB
• It is not possible to create a non-CDB via the console - use dbaasapi
• Creating non-CDB databases on the Service in OCI (Doc ID 2528257.1)

38 Copyright © 2021, Oracle and/or its affiliates


Performance Stability Prescription

1. 3. 5.
Collect Analyze Manage

2. 4. 6.
Compare Tune Test

39 Copyright © 2021, Oracle and/or its affiliates


Performance Stability Prescription | Toolbox

AWR
Cursor Cache
SQL Tuning Set
Staging Tables
SQL Plan Management
SQL Tuning Advisor
SQL Performance Analyzer
Database Capture and Replay

Photo by jesse orrico on Unsplash


40 Copyright © 2021, Oracle and/or its affiliates
On-Prem Database
Test Database
Workload | Objective

Collect workload information on source database

SQL Tuning Set


1. Create SQL Tuning Set (STS)
2. Capture workload from
a) AWR
b) Cursor cache

42 Copyright © 2021, Oracle and/or its affiliates


On-Prem Database
Test Database
Workload | Objective

Transport SQL Tuning Set

SQL Tuning Set + Data Pump


1. Pack SQL Tuning Set into staging table
2. Export staging table
3. Upload to object storage
4. Import into test database in the cloud

45 Copyright © 2021, Oracle and/or its affiliates


On-Prem Database
Test Database
Comparison | Objective

Compare workload data

AWR snapshots and diff report


1. Identify two snapshots for a representative workload
2. Export AWR
3. Upload to object storage
4. Import AWR into test database in the cloud
5. Run representative workload in the cloud
6. Compare AWR snapshots

Due to completely different specs and load scenarios, the result may be misleading or not
useful

48 Copyright © 2021, Oracle and/or its affiliates


awrddrpi.sql

On-Prem Database
Test Database

awrextr.sql awrload.sql
Instances in this Workload Repository schema
awrddrpi.sql ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ ---------- --------- ---------- ------
72245725 1 UPGR UPGR hol.localdom
* 753780962 1 CDB2 CDB2 hol.localdom

Database Id and Instance Number for the First Pair of Snapshots


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for dbid:
On-Prem Database
Test Database
Comparison | Objective

Find bad plans by simulating SQL execution

SQL Performance Analyzer


1. Build ANALYSIS task
2. Simulate SQL statements captured on production
a) AWR
b) Cursor Cache
3. Compare results
4. Remedy issues
5. Repeat analysis

53 Copyright © 2021, Oracle and/or its affiliates


SQL Tuning Set
Production
workload SQL,
schema,
binds,
... Elapsed, CPU time,
buffer gets, disk reads ...

Upgrade /
Plans
Migrate SPA
Test execution
Before upgrade After upgrade
From production
workload From test
execution
Implement
change SPA
Test execution
On-Prem Database
Test Database
Test
system
Workload
capture

Replay
analysis Preprocess

Capture files
Replay files
On-Prem Database
Test Database
SQL Tuning Advisor | Findings

Types of findings:

1. Collection of object statistics


2. Creation of indexes
3. Rewriting SQL statements
4. Creation of SQL profiles
.... and more

Pro tip: SQL Developer has a


good interface to SQL Tuning
Advisor

62 Copyright © 2021, Oracle and/or its affiliates


SQL Profiles | Facts

1. Part of Tuning Pack


• Included in some cloud offerings

2. Stores a set of hints that causes the optimizer to select a plan

3. Affects one statement only

63 Copyright © 2021, Oracle and/or its affiliates


SQL Profiles | Facts

4. You can enable/disable a profile

5. Transparent to application
• Does not require application changes

6. Persistent and transportable


• Documentation

7. Useful with literals using FORCE_MATCH=TRUE

64 Copyright © 2021, Oracle and/or its affiliates


On-Prem Database
Test Database
Next execution
Repeatable SQL

• OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
OPTIMIZER_USE_SQL_PLAN_BASELINES=TRUE

No plans A
Plan B Plan history

in baseline Filter - Dedicated part of SQL plan baseline

Plan A is used
SQL Tuning set Plan C

SQL> DECLARE
cnt number;
BEGIN
cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET('UPG_STS_1');
END;
/

Automatically
accepted
SPM | What if ... literals

SQL Plan Management in a system with literals is not a good fit

• Many distinct statements

• CURSOR_SHARING = FORCE? No!

• SQL profiles can do force matching

Optimal solution: Change your application to use bind variables

68 Copyright © 2021, Oracle and/or its affiliates


SPM | Use Case

Upgrade
Analyze
Import workload
Capture workload
Upgrade Tune

11.2.0.4

Plan baseline
Import plansplans
Export

Automatically
accepted

69 Copyright © 2021, Oracle and/or its affiliates


On-Prem Database
Test Database
Performance Stability Prescription

1. 3. 5.
Collect Analyze Manage

2. 4. 6.
Compare Tune Test

71 Copyright © 2021, Oracle and/or its affiliates


Secrets,
Surprises,

Photo by Jan Szwagrzyk on Unsplash


Underscores

72 Copyright © 2021, Oracle and/or its affiliates


Underscores | optimizer_adaptive_*

Parameter optimizer_adaptive_plans

• Default: TRUE
• Adjust join methods, bitmap pruning and parallel distribution methods during runtime after
parsing

Parameter optimizer_adaptive_statistics

• Default: FALSE
• Create dynamic statistics, SQL Plan Directives and do automatic reoptimization

Recommendation

• Leave the defaults


• For Oracle 12.2.0.1 and newer

73 Copyright © 2021, Oracle and/or its affiliates


Underscores | _sql_plan_directive_mgmt_control

Parameter _sql_plan_directive_mgmt_control

• SQL Plan Directives get collected in the background


• Even when optimizer_adaptive_statistics=false (default)
• But SPDs won't be used
• MOS Note: 2209560.1 - How To Disable SQL Plan Directive (SPD)

Recommendation

• Set _sql_plan_directive_mgmt_control=0 always everywhere


• For Oracle 12.2.0.1 and newer

74 Copyright © 2021, Oracle and/or its affiliates


Underscores | _cursor_obsolete_threshold

Parameter _cursor_obsolete_threshold

• Parent cursors not getting obsoleted


• Thus, the child cursors under the parent are getting extended beyond 1024 (default in 12.1)
• Massive concurrency issues with cursor mutexes
• MOS Note: 2431353.1
High Version Counts For SQL (>1024) Post Upgrade To 12.2 and Above Causing Slow
Performance

Recommendation

• Set _cursor_obsolete_threshold=1024 always everywhere


• For Oracle 12.2.0.1 and newer

75 Copyright © 2021, Oracle and/or its affiliates


Underscores | deferred_segment_creation

Parameter deferred_segment_creation

• Table/index created but no row inserted? No space used


• But performance penalty when first row gets inserted
• Only useful in environments where objects get created and dropped massively
• Several corruption bugs, contention issues and more
• See: MOS Note 1216282.1 - Parameter "DEFERRED_SEGMENT_CREATION"

Recommendation

• Set deferred_segment_creation=false unless you really need this feature


• For Oracle 11.2 and newer

76 Copyright © 2021, Oracle and/or its affiliates


Now RELAX ...

And open an SR with

Photo by Simon Migaj on Unsplash


Oracle Support in case
of real trouble

77 Copyright © 2021, Oracle and/or its affiliates


ExaCC migration

PUSHING THE LIMITS


1500 databases with an ZDLRA

Photo by Patrick Hendry on Unsplash


Copyright © 2021 Oracle and/or its affiliates.
Copyright © 2021 Oracle and/or its affiliates.
Copyright © 2021 Oracle and/or its affiliates.
Migration Details

Part 1: The ZDLRA

Copyright © 2021 Oracle and/or its affiliates.


dbmigusera.pl

Copyright © 2021 Oracle and/or its affiliates.


libra.so

Copyright © 2021 Oracle and/or its affiliates.


dbmigusera.pl xtt.properties

Copyright © 2021 Oracle and/or its affiliates.


xtt.properties
# SBT parameter configuration to be used for restore and recover operations
sbtlibparms="SBT_LIBRARY=/u01/app/oracle/product/12.2.0.1/dbhome_1/lib/libra.so, …')"

# The number of datafiles that will be restored / recovered in parallel.


resparallel=16

# The list of tablespaces to be migrated


ttsnames=T14_1,T14_2,T14_3,T14_4,T14_5,T14_6,T14_7,T14_8,T14_9,T14_10,T14_11

# The directory to which the datafiles will be restored


storageondest=+DATAC1/dbmig/datafile

sourceplatid=2
dbid=4173218531
retrycount=2

Copyright © 2021 Oracle and/or its affiliates.


$ perl dbmigusera.pl --restore …

Copyright © 2021 Oracle and/or its affiliates.


$ perl dbmigusera.pl --recover …

Copyright © 2021 Oracle and/or its affiliates.


ExaCC Migration | Transportable Tablespaces

Custom TTS
Customized
Restore/Recove Transportable
r
Tablespaces Scripts
Inc Backup Transport

Rebuild Meta

Copyright © 2021 Oracle and/or its affiliates.


Photo by Eric Nopanen on Unsplash
90 Copyright © 2021, Oracle and/or its affiliates
SUMMARY and QA

91 Copyright © 2021, Oracle and/or its affiliates


Recorded Web Seminars

https://MikeDietrichDE.com/videos

92 Copyright © 2022, Oracle and/or its affiliates


93 Copyright © 2021, Oracle and/or its affiliates


THANK
YOU

Visit our blogs:

https://MikeDietrichDE.com

https://DOHdatabase.com

https://www.dbarj.com.br/en
THANK
YOU

Webinars:

https://MikeDietrichDE.com/videos

YouTube channel:

OracleDatabaseUpgradesandMigrations
THANK
YOU

You might also like