2. Trivadis – Our mission.
Checklist: Database Upgrade + Migration
2 17.05.2022
Trivadis makes IT easier:
We provide significant support for our
customers in the smart use of data in
the digital age.
We reduce complexity for our
customers through outstanding
technological expertise.
We take over key tasks in the existing
and future IT of our customers.
3. Trivadis – What sets us apart.
Checklist: Database Upgrade + Migration
3 17.05.2022
We understand the business processes and economic challenges of our customers and
support them through IT consulting and in the development of comprehensive IT solutions.
Our proven products, developed by Trivadis, are based on in-depth expertise in the key
technologies offered by Microsoft, Oracle and Open Source.
That sets us apart from the competition.
A selection of awards we have received
OPEN SOURCE
4. Trivadis – Our key figures
Checklist: Database Upgrade + Migration
4 17.05.2022
Founded in 1994
15 Trivadis locations with
more than 650 employees
Sales of CHF 111 million (EUR 96
million)
Over 250 Service Level Agreements
More than 4000 training participants
Research and development budget: CHF
5.0 million
More than 1900 projects each year with
over 800 customers
Financially independent and sustainably
profitable
5. About me .. Markus Flechtner
Principal Consultant, Trivadis, Duesseldorf/Germany, since April 2008
Working with Oracle since the 1990’s
– Development (Forms, Reports, PL/SQL)
– Support
– Database Administration
Focus
– Oracle Real Application Clusters
– Database Upgrade and Migration Projects
Teacher
– O-RAC – Oracle Real Application Clusters
– O-NF-DBA – Oracle Database New Features for the DBA
– O-MT – Oracle Multitenant
– PG4ORA – PostgreSQL for Oracle DBAs
Blog:
https://markusdba.net/
@markusdba
17.05.2022 Checklist: Database Upgrade + Migration
5
6. 17.05.2022 Checklist: Database Upgrade + Migration
6
Technology on its own won't help you.
You need to know how to use it properly.
7. Agenda
Checklist: Database Upgrade + Migration
7 17.05.2022
1. Overview
2. Choose the right Upgrade & Migration Methods
3. .. What about DataPump?
4. Know your Clients
5. Cleanup your Database
6. Pre Upgrade & Migration Steps
7. Post Upgrade & Migration Steps
8. More to know ..
9. Some terms
Checklist: Database Upgrade + Migration
9 17.05.2022
Upgrade =
– “in place”
– Changing the version of an existing database (e.g. from 11.2.0.4 to 18c)
Migration =
– “out of place”
– Changing the hardware platform e.g. from Solaris Sparc to Linux
– Changing the server or hardware
– Changing from single instance to a RAC configuration
– Changing to Container Database Architecture (Multitenant Architecture)
10. Upgrade vs. Migration
Checklist: Database Upgrade + Migration
10 17.05.2022
Very often, both terms are mixed
A migration can include the change to a higher version of the Oracle RDBMS
Preparation, issues etc. are similar
13. Migration Methods - Overview
Checklist: Database Upgrade + Migration
13 17.05.2022
Logical Data Transfer
– Export/Import
– DataPump
Physical Data Transfer
– Transportable Tablespaces
– Full Transportable Export/Import
– RMAN cross-platform-backup/restore
Replication based Data Transfer
– Oracle Streams
– Transient Logical Standby
– Oracle Golden Gate
DataGuard (Windows Linux)
14. Migration & Upgrade - Criteria
Checklist: Database Upgrade + Migration
14 17.05.2022
Maximum allowed downtime of the applications?
Amount of data which has to be transfered?
Same platform (endianess)?
Additional objectives
– Change of database characterset?
– Reorganization required/desired?
Fallback solution
Partial data migration possible?
15. Migration & Upgrade – Additional Objectives
Checklist: Database Upgrade + Migration
15 17.05.2022
Other required or desired objectives can be
– Database Reorganization
– Change of characterset
– Partial Migration
– Removal of unused database options
16. Upgrade and Migration Methods – Comparison
Checklist: Database Upgrade + Migration
16 17.05.2022
Method Complexity Speed Change of
characterset
Reorganization Migration
to new
server
Platform
Change
Manual upgrade Medium Fast No No No No
DBUA Low Fast No No No No
Datapump
Export / Import
Medium Fast Possible Yes Possible Possible
Transportable Tablespace High Fast No No Possible Possible
Transport Database Medium Fast No No Possible Possible
RMAN cross-/platform High Fast No No Possible Possible
Replication based methods High Fast Possible Yes Possible Possible
18. DataPump
Checklist: Database Upgrade + Migration
18 17.05.2022
If possible (amount of data, maximum downtime, available diskspace) think about
DataPump as a method
1. Create a new database with the desired characterset and database options
2. Shut down your applications
3. (Consistent) export of the required schemas resp. tables
4. Import into the new database
19. DataPump – Pros and Cons (1)
Checklist: Database Upgrade + Migration
19 17.05.2022
Pros
– Old database as fallback solution
– Reorganization
– Change of characterset and platform possible
– "Removal" of unwanted database options or schemas resp. tables
– Simple and proven method
21. DataPump – Tuning Considerations
Checklist: Database Upgrade + Migration
21 17.05.2022
Enterprise Edition: run DataPump in Parallel
Exclude Statistics
Indexes
– Exclude indexes from import
– Generate SQL script from dump file, change parallel degree for index creation and run
index creation after the data import
23. Client Connectivity can be an issue
Checklist: Database Upgrade + Migration
23 17.05.2022
Migrations and Upgrades can fail due to client issues
– Client Version
– Network issues
– Firewall rules
– Password versions
Check your clients and the client infrastructure before starting a migration or an upgrade!
=> See presentation "Checklist: Database Connection Issues"
Even a single client can cause the fallback of an upgrade or migration!
25. Database Housekeeping
Checklist: Database Upgrade + Migration
25 17.05.2022
Remove unused schemas and users
– => the amount of data affects the time needed for a migration
Remove unused options and features
– => the number of installed options affects the duration of a database upgrade
Recompile invalid objects
– Remove remaining invalid objects afterwards if possible
– Make a list of the remaining invalid objects
27. Pre-Upgrade Checks
Checklist: Database Upgrade + Migration
27 17.05.2022
Oracle offers several tools for pre-upgrade-checks
– Preupgrade.jar
– OraChk
Check for desupported features which are used in your databases
– -> Database Upgrade Guide
– Examples:
• Oracle Streams (desupported with Oracle 19c),
• case-insensitive passwords,
28. Preparing an Uprade: preupgrade.jar
Checklist: Database Upgrade + Migration
28 17.05.2022
Oracle offers a "Pre-Upgrade Utility" - preupgrade.jar
preupgrade.jar is delivered with 12.2, but using the most current version from MOS note
884522.1 is recommended
Excerpt preupgrade.log:
$ORACLE_HOME/jdk/bin/java -jar preupgrade.jar TERMINAL TEXT DIR $HOME/upgrade
REQUIRED ACTIONS
================
+ Adjust TABLESPACE SIZES as needed.
Auto 12.2.0.1.0
Tablespace Size Extend Min Size Action
---------- ---------- -------- ---------- ------
SYSAUX 638 MB ENABLED 742 MB None
SYSTEM 640 MB ENABLED 1052 MB Extend
TEMP 50 MB ENABLED 150 MB None
UNDOTS 388 MB ENABLED 400 MB None
Note that 12.2.0.1.0 minimum sizes are estimates.
29. OraChk-Pre-Upgrade Assessment (1)
Checklist: Database Upgrade + Migration
29 17.05.2022
OraChk is a tool for
– Database Configuration Health Checks (against Oracle Best Practices)
– Pre-/Post-Upgrade-Check
– ..
Contains preupgrade.jar (but sometimes an old version)
It can be downloaded via MOS-Note 1268927.2
Example: check for a single database
Runs checks from preupgrade.jar and additional checks
Result:
– HTML-Report for CDB$ROOT and all PDBs
oracle@kereru:~/ [CDB6] ./orachk -preupgrade -dbnames CDB6
31. Make a plan .. (1)
Checklist: Database Upgrade + Migration
31 17.05.2022
Upgrading (and patching) is a recurring task
It pays to create a project plan
– Step, duration, involved persons, …
Not only for migration and upgrade, ..
.. But for fallback, too
Preparation Phase
– Run PreUpgrade Checks
– Define Acceptance Tests
– Gather Dictionary Statistics before upgrading
(DBMS_STATS.GATHER_DICTIONARY_STATS)
32. Make a plan .. (2)
Checklist: Database Upgrade + Migration
32 17.05.2022
Migration/Upgrade Phase
– Monitoring: Define blackouts
– Backups: disable regular backups (but run pre-upgrade backup )
– Shutdown Applications
– Migrate/Upgrade Database (depending on the chosen method)
33. Make a plan .. (3)
Checklist: Database Upgrade + Migration
33 17.05.2022
Post-Migration/Upgrade Phase
– Start Applications
– Run Acceptance Tests
– Monitoring: Disable blackouts
– Gather database Statistics
– Backups: re-enable regular backups
Review Phase
– Lessons learned
– Refine project plan
34. Testing, testing, testing ..
Checklist: Database Upgrade + Migration
34 17.05.2022
Decide on required application acceptance tests after the database upgrade/migration
Use Oracle Real Application Testing if you've got a RAT license
– Can be helpful o verify performance issues / changes in execution plans
– Run the replay on a copy of your production database before the upgrade/migration is
started
– Ask your Oracle Account Manager for a temporary license
35. Prepare your fallback solution
Checklist: Database Upgrade + Migration
35 17.05.2022
Do not forget to backup your database before starting your upgrade/migration
When running Enterprise Edition: Create a guaranteed restore point
– Do no forget to remove the restore point after the migration/upgrade was successful
Determine the point-of-no-return
SQL> CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE;
Restore point created.
37. Post Upgrade Checks
Checklist: Database Upgrade + Migration
37 17.05.2022
After running utlrp.sql all components should be valid
SQL> set linesize 100
SQL> set pagesize 30
SQL> set trimspool on
SQL> column comp_name format a40
SQL> column version format a20
SQL> column status format a20
SQL> select comp_name,version,status from dba_registry order by comp_name;
COMP_NAME VERSION STATUS
---------------------------------------- -------------------- --------------------
JServer JAVA Virtual Machine 19.0.0.0.0 VALID
OLAP Analytic Workspace 19.0.0.0.0 VALID
Oracle Database Catalog Views 19.0.0.0.0 VALID
Oracle Database Java Packages 19.0.0.0.0 VALID
Oracle Database Packages and Types 19.0.0.0.0 VALID
Oracle Multimedia 19.0.0.0.0 VALID
Oracle OLAP API 19.0.0.0.0 VALID
Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
Oracle Text 19.0.0.0.0 VALID
Oracle Workspace Manager 19.0.0.0.0 VALID
Oracle XDK 19.0.0.0.0 VALID
Oracle XML Database 19.0.0.0.0 VALID
Spatial 19.0.0.0.0 VALID
38. Post Upgrade Steps
Checklist: Database Upgrade + Migration
38 17.05.2022
Check Post-Upgrade-Status of the database
– Script utlu122s.sql or utlstus.sql
Statistics
– Gather new database statistics (and dictionary + system statistics)
• Gather fixed object statistics (after some time of operation)
Parameter COMPATIBLE
– Changing the parameter COMPATIBLE is a "point-of-no-return"
– With unchanged parameter, the script catdwgrd.sql can be used to downgrade a
database to an earlier version
39. Diagnosing Upgrade/Migration issues
Checklist: Database Upgrade + Migration
39 17.05.2022
Upgrade Results –Script $ORACLE_HOME/rdbms/admin/utlusts.sql
SQL> start utlusts.sql TEXT
Oracle Database Release 19 Post-Upgrade Status Tool 05-12-2019 22:48:2
Database Name: TVDNCDB
Component Current Full Elapsed Time
Name Status Version HH:MM:SS
Oracle Server VALID 19.2.0.0.0 00:16:38
JServer JAVA Virtual Machine VALID 19.2.0.0.0 00:01:29
Oracle XDK VALID 19.2.0.0.0 00:01:40
Oracle Database Java Packages VALID 19.2.0.0.0 00:00:07
OLAP Analytic Workspace VALID 19.2.0.0.0 00:00:10
Oracle Text VALID 19.2.0.0.0 00:00:21
Oracle Workspace Manager VALID 19.2.0.0.0 00:00:49
Oracle Real Application Clusters OPTION OFF 19.2.0.0.0 00:00:00
Oracle XML Database VALID 19.2.0.0.0 00:00:53
Oracle Multimedia VALID 19.2.0.0.0 00:01:26
Spatial VALID 19.2.0.0.0 00:04:45
Oracle OLAP API VALID 19.2.0.0.0 00:00:08
Datapatch 00:00:03
Final Actions 00:00:07
Post Upgrade 00:00:17
Post Compile 00:00:02
Total Upgrade Time: 00:29:05
Database time zone version is 32. It meets current release needs.
40. Diagnosing Upgrade/Migration issues
Checklist: Database Upgrade + Migration
40 17.05.2022
dbupgdiag.sql from MOS note 556610.1
Example output (excerpt):
[..]
======================================================
List of Invalid Database Objects Owned by SYS / SYSTEM
======================================================
Number of Invalid Objects
------------------------------------------------------------------
There are 2 Invalid objects
DOC>################################################################
DOC>
DOC> If there are no Invalid objects below will result in zero rows.
DOC>
DOC>################################################################
DOC>#
OWNER OBJECT_NAME OBJECT_TYPE
------------ ---------------------------------------- ----------------------------------------
SYS SDO_RDF_EXP_IMP PACKAGE BODY
SYS CDB_TAB_COLS_V$ VIEW
2 rows selected.
[..]
42. More to know … lots of MOS notes (1)
Checklist: Database Upgrade + Migration
42 17.05.2022
General
– FAQ : Database Upgrade And Migration (Doc ID 1352987.1)
– Different Upgrade Methods For Upgrading Your Database (Doc ID 419550.1)
– Master Note For Oracle Database Upgrades and Migrations (Doc ID 1152016.1)
– Get Proactive with Oracle Database - Install, Upgrade, and Patching(Doc ID 1627224.1)
Upgrade to Oracle 12c Release 2
– Complete checklist for Manual Upgrade for Multitenant Architecture Oracle Databases from
12.1.x.x to 12.2..x.x(Doc ID 2173144.1)
– Oracle Database Upgrade Known issues - 12.2 (Doc ID 2243613.1)
– Master Note For Oracle Database 12c Release 2 (12.2) Database/Client
Installation/Upgrade/Migration Standalone Environment (Non-RAC)(Doc ID 2195547.1)
43. More to know … lots of MOS notes (2)
Checklist: Database Upgrade + Migration
43 17.05.2022
Upgrade to Oracle Database 18c
– Oracle 18c - Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 18c(Doc
ID 2418045.1)
– Oracle 18c - Complete checklist for Manual Upgrade for Multitenant Architecture Oracle
Databases from 12.1.x.x to 18.x.x.x(Doc ID 2422161.1)
– Oracle 18c - Complete Checklist for upgrading Oracle 12.x Container Database (CDB) to
Oracle Database 18c (18.x) using DBUA(Doc ID 2421552.1)
– Oracle 18c - Complete Checklist for Upgrading to Oracle Database 18c (18.x) using
DBUA(Doc ID 2418576.1)
44. More to know … lots of MOS notes (3)
Checklist: Database Upgrade + Migration
44 17.05.2022
Migration and Upgrade Issues
– Avoiding and Resolving Database Performance Related Issues After Upgrade (Doc ID
1528847.1)
– Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql) (Doc ID
556610.1)
– Troubleshooting Assistant: Oracle Database/Client Upgrade - Downgrade (Doc ID 1561791.2)
– Information Center: Database Performance: Upgrade (Doc ID 1512994.2)
– Query Performance Degradation - Upgrade Related - Recommended Actions [Document
745216.1]
– Query with unchanged execution plan is slower after database upgrade [Document 223806.1]
– Server Upgrade Results in Slow Query Performance [Document 160089.1]
– Best Practices: Proactively Avoiding Database and Query Performance Issues [Document
1482811.1]
– Best Practices: Proactive Data Collection for Performance Issues [Document 1477599.1]
45. More to know … Links
Checklist: Database Upgrade + Migration
45 17.05.2022
Upgrade your Database – NOW! - https://mikedietrichde.com
Presentation "How do Diagnose Database Upgrade Issues"
https://apex.oracle.com/pls/apex/f?p=202202:2::APPLICATION_PROCESS=downloadFile:::F202
25_ID:2481
46. Questions and Answers
Markus Flechtner
Principal Consultant
Phone +49 211 5866 64725
Markus.Flechtner@Trivadis.com
@markusdba http://markusdba.de
Download the slides from https://www.slideshare.net/markusflechtner
Please don‘t forget the session evaluation – Thank you!
17.05.2022 Checklist: Database Upgrade + Migration
46