autoupgrade - nyougnyoug.org/wp-content/uploads/2019/12/oow2019_autoupgrade19c.… · dbupgrade-r-l...
TRANSCRIPT
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgradeHundreds of Databases to Oracle 19c
AutoUpgrade Hundreds of Database to Oracle 19c
Mike DietrichMaster Product ManagerDatabase Upgrade and MigrationsOracle Corporation
17-SEP-2019
Ludovico CaldaraDatabase Engineer, Oracle ACE DirectorIT DepartmentCERN
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | AutoUpgrade Hundreds of Database to Oracle 19c 2
Germany
https://MikeDietrichDE.com
MikeDietrichDE
Mike DietrichMaster Product ManagerOracle Database Upgrade and Migrations
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Slides and more | https://MikeDietrichDE.com
AutoUpgrade Hundreds of Database to Oracle 19c 3
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Lifetime Support Commitments and Plans
4AutoUpgrade Hundreds of Database to Oracle 19c 4
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
Oracle 18
EXTENDED
EXTENDED
EXTENDED
Oracle 11.2
Oracle 12.1
12.2.0.1
Oracle 19
Paid Extended SupportPremier Support Waived Extended Support
▼
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Clarification | Oracle 12.2 Release Family• The 18c and 19c releases are part of the Database 12.2 "Family" for
Lifetime Support as if they were the 12.2.0.2 and 12.2.0.3 patch sets
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
Oracle 18aka: 12.2.0.2
EXTENDED
12.2.0.1
Oracle 19aka: 12.2.0.3
5AutoUpgrade Hundreds of Database to Oracle 19c
See MOS 742060.1 for announcements and details
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
UpgradingDirectly to Oracle Database 19c
AutoUpgrade Hundreds of Database to Oracle 19c 6
19c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Database Upgrade | Releases for Upgrade/Downgrade
AutoUpgrade Hundreds of Database to Oracle 19c 7
11.2.0.4
12.1.0.2
12.2.0.119c
18c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• preupgrade.jar� java -jar preupgrade.jar TEXT TERMINAL
• Checks source environment
• Detailed recommendations
• Fixup scripts
• Rerunnable and dynamic
• Always download from:MOS Note: 884522.1
Database Upgrade | Preupgrade Tool
AutoUpgrade Hundreds of Database to Oracle 19c 8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• dbupgrade -l /tmp/logs• Non-CDBs and CDB$ROOT:– 4 (default) - maximum: 8 workers
• PDBs:– Limited only by computing power
• Resumable:�dbupgrade -R -l /tmp/logs
• Wrapper for:catctl.pl� perl catctl.pl -n 4 -l /tmp/logs catupgrd.sql
Upgrade to Oracle 18c - Real World Customer Cases 9Upgrade & Migrate to Oracle Database 18c - Live and Uncensored 9
Parallel Phase #:19 [UPGR] Files:33 Time: 72sRestart Phase #:20 [UPGR] Files:1 Time: 0sSerial Phase #:21 [UPGR] Files:3 Time: 19sRestart Phase #:22 [UPGR] Files:1 Time: 0sParallel Phase #:23 [UPGR] Files:24 Time: 171sRestart Phase #:24 [UPGR] Files:1 Time: 0s[..]Restart Phase #:30 [UPGR] Files:1 Time: 0s*************** Catproc CDB Views **************[..]***************** Catproc PLBs *****************[..]*************** Catproc DataPump ***************[..]****************** Catproc SQL *****************[..]************* Final Catproc scripts ************Serial Phase #:48 [UPGR] Files:1 Time: 8sRestart Phase #:49 [UPGR] Files:1 Time: 0s************** Final RDBMS scripts *************Serial Phase #:50 [UPGR] Files:1 Time: 32s************ Upgrade Component Start ***********Serial Phase #:51 [UPGR] Files:1 Time: 1sRestart Phase #:52 [UPGR] Files:1 Time: 0s**************** Upgrading Java ****************Serial Phase #:53 [UPGR] Files:1 Time: 0sRestart Phase #:54 [UPGR] Files:1 Time: 1s***************** Upgrading XDK ****************Serial Phase #:55 [UPGR] Files:1 Time: 0sRestart Phase #:56 [UPGR] Files:1 Time: 0s********* Upgrading APS,OLS,DV,CONTEXT *********Serial Phase #:57 [UPGR] Files:1 Time: 14s***************** Upgrading XDB ****************Restart Phase #:58 [UPGR] Files:1 Time: 0sSerial Phase #:60 [UPGR] Files:3 Time: 21sSerial Phase #:61 [UPGR] Files:3 Time: 9sParallel Phase #:62 [UPGR] Files:9 Time: 4sParallel Phase #:63 [UPGR] Files:24 Time: 3sSerial Phase #:64 [UPGR] Files:4 Time: 12s[..]Serial Phase #:70 [UPGR] Files:3 Time: 72sRestart Phase #:71 [UPGR] Files:1 Time: 0s********* Upgrading CATJAVA,OWM,MGW,RAC ********Serial Phase #:72 [UPGR] Files:1 Time: 92s**************** Upgrading ORDIM ***************[..]***************** Upgrading SDO ****************
Database Upgrade | dbupgrade
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgradeHands-Free Upgrades to Oracle Database 19c
AutoUpgrade Hundreds of Database to Oracle 19c
Phot
oby
sam
som
mer
on U
nspl
ash
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Architecture
11
Database Post-UpgradeStats Refresh Time Zone Adjustment /etc/oratab
Database UpgradeCommand Line
Database Pre-Checkspreupgrade.jar Automatic Fix-Ups
System ChecksSpace Check Requirements
UpgradeJob Manager
UpgradeDispatcher
config.cfg
AutoUpgrade Hundreds of Database to Oracle 19c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What do you need?• Java 8 or newer–Default in your $ORACLE_HOME since 12.1.0.2– Check: $ORACLE_HOME/jdk/bin/java -version
• Oracle source database version–Minimum database version is 11.2.0.4
• The AutoUpgrade package– A jar file of <5 MB in size
AutoUpgrade Hundreds of Database to Oracle 19c 12
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | ALWAYS download the newest version• MOS Note: 2485457.1
AutoUpgrade Hundreds of Database to Oracle 19c 13
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What we support
• Non-CDB and CDB upgrades
• All operating systems running Oracle Database servers
• Standard Edition 2 and Enterprise Edition
• Upgrades to version:– 12.2.0.1 with Jan 2019 Update or newer– 18.5.0 (includes Jan 2019 Update) or newer– 19.3.0 or newer
AutoUpgrade Hundreds of Database to Oracle 19c 14
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What do you need to do?
AutoUpgrade Hundreds of Database to Oracle 19c 15
11.2.0.4
12.1.0.2
12.2.0.1 / 18c
autoupgrade.jar
12.2.0.118c19c
upg>
Job Console
config.cfg
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What you don't need?• Agents• EM Cloud Control• DBUA• Extra license
AutoUpgrade Hundreds of Database to Oracle 19c 16
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What we can't do … yet• RAC
–SRVCTL upgrade part
– Shutdown all instances and services
• Data Guard
–Disable DG Broker and defer log transport
• Migration from non-CDB to PDB
–Well … we can … but it is not flexible enough yet J
• Unplug/plug/upgrade from one CDB to another
AutoUpgrade Hundreds of Database to Oracle 19c 17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Blog Post Series• https://mikedietrichde.com/2019/04/29/the-new-autoupgrade-utility-in-oracle-19c/
AutoUpgrade Hundreds of Database to Oracle 19c 18
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Create a configuration file$ java –jar autoupgrade.jar -create_sample_file config
Created sample configuration file /home/oracle/sample_config.cfg
AutoUpgrade Hundreds of Database to Oracle 19c 19
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Configuration fileglobal.autoupg_log_dir=/home/oracle/logs
upg1.dbname=DB12upg1.start_time=NOWupg1.source_home=/u01/app/oracle/product/12.2.0.1upg1.target_home=/u01/app/oracle/product/19upg1.sid=DB12upg1.log_dir=/home/oracle/aux/DB12upg1.upgrade_node=localhostupg1.target_version=19
upg2.dbname=UPGRupg2.start_time=NOWupg2.source_home=/u01/app/oracle/product/11.2.0.4...
AutoUpgrade Hundreds of Database to Oracle 19c 20
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | But there are more options …## Example global pfile configuration entries#global.del_during_upgrade_pfile=/database/pfiles/global_during_delinit.oraglobal.add_during_upgrade_pfile=/database/pfiles/global_during_addinit.oraglobal.del_after_upgrade_pfile=/database/pfiles/global_after_delinit.oraglobal.add_after_upgrade_pfile=/database/pfiles/global_after_addinit.ora
# # Example local pfile configuration entries#upg2.del_during_upgrade_pfile=/database/pfiles/hr_during_delinit.oraupg2.add_during_upgrade_pfile=/database/pfiles/hr_during_addinit.oraupg2.del_after_upgrade_pfile=/database/pfiles/hr_after_delinit.oraupg2.add_after_upgrade_pfile=/database/pfiles/hr_after_addinit.ora
AutoUpgrade Hundreds of Database to Oracle 19c 21
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Even more options …## Example global script execution#global.before_action=/database/scripts/run_this_before.shglobal.after_action=/database/scripts/run_this_after.sh
# # Example local script execution#upg2.before_action=/database/scripts/run_this_on_UPG2_before.shupg2.after_action=/database/scripts/run_this_on_UPG2_after.sh
• Permitted extension options: – Unix shell (.sh) – Microsoft Windows batch (.bat, .cmd) – Microsoft Windows PowerShell (.ps1)
AutoUpgrade Hundreds of Database to Oracle 19c 22
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Ok, there's still more …
## By default a GRP will be created. Default for EE: Yes#upg2.restoration=no
## By default a GRP will be kept. This option overwrites the default.#upg2.drop_grp_after_upgrade=yes
AutoUpgrade Hundreds of Database to Oracle 19c 23
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | And more …## Example global directive - Default: Underscores stay as before#global.remove_underscore_parameters
## If unset, utlrp.sql won't be run - Default: YES#upgr2.run_utlrp=no
## If unset, time zone upgrade won't be performed - Default: YES#upgr2.timezone_upg=no
AutoUpgrade Hundreds of Database to Oracle 19c 24
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
• VALID values–NOW [default]–30/12/2018 15:30:00–01/11/2019 01:30:15–2/5/2019 3:30:50
• INVALID values
–30-12-2018 15:30:00–01/11/2019 3:30:15pm–2019/06/01 01:30:15
AutoUpgrade Tool | START_TIME
AutoUpgrade Hundreds of Database to Oracle 19c 25
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | AutoUpgrade - 4 modes
AutoUpgrade Hundreds of Database to Oracle 19c 26
autoupgrade.jar
-deploy
-analyze -fixups -upgrade
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Recommendation
AutoUpgrade Hundreds of Database to Oracle 19c 27
autoupgrade.jar-deploy-analyze
$ java -jar autoupgrade.jar -config config.cfg -mode analyze
$ java -jar autoupgrade.jar -config config.cfg -mode deploy
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | When you move to new hardware
AutoUpgrade Hundreds of Database to Oracle 19c 28
autoupgrade.jar
-analyze -fixups
autoupgrade.jar
-upgrade
Source System Target System$ java -jar autoupgrade.jar -config config.cfg -mode analyze
$ java -jar autoupgrade.jar -config config.cfg -mode fixups
$ java -jar autoupgrade.jar -config config.cfg -mode upgrade
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Job Control - Most Important Commands
29
upg>lsj // List jobsresume -job <number> // Restarts a job status [-job <number>] // Show job statusrestore -job <number> // Restores database from GRPabort -job <number> // Aborts the specified job
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | Logging• Text and JSON format• Directory structure
AutoUpgrade Hundreds of Database to Oracle 19c 30
/cfgtoollogs/upgrade/auto/status
/<database_1>/jobno /preupgrade
/drain/dbupgrade/postupgrade
/temp
/<database_2> /jobno /preupgrade
/drain/dbupgrade/postupgrade
/temp
ç Upgrade Logs
ç Status Logs
ç HTML Report
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 31AutoUpgrade Hundreds of Database to Oracle 19c
2
https://youtu.be/kr3aZrqA9Go
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
AutoUpgrade Tool | What if …• What if you need to reset AutoUpgrade?– java -jar autoupgrade.jar -config abd.cfg -mode analyze -clear_recovery_dataor:– Remove or rename directory global.autoupg_log_dir
• What if you need Support?1. Open an SR2. Upload the entire global.autoupg_log_dir to MOS
AutoUpgrade Hundreds of Database to Oracle 19c 32
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 33AutoUpgrade Hundreds of Database to Oracle 19c
"After qualifying the new AutoUpgrade tool on a representative portion of our database landscape we found that tool was doing a great job and is production-ready. In our automation tool we have removed a lot of “home-grown” code, and replaced it with AutoUpgrade functionality.
Since August 2019 all upgrades at SimCorphave been executed using the AutoUpgrade tool."
doh-database
Daniel Overby HansenLead DeveloperSimCorp A/S Denmark
Oracle Autoupgrade experience at CERN,the European Organization for Nuclear Research
Ludovico Caldara - Computing Engineer, Oracle ACE Director
■ Two decades of DBA experience (Not Only Oracle)
■ ITOUG co-founder
■ OCP (11g, 12c, MySQL) & OCE
■ Italian living in Switzerland■ http://www.ludovicocaldara.net
■ @ludodba
■ ludovicocaldara
Ludovico Caldara
36
The Large Hadron Collider (LHC)
Largest machine in the world27km, 6000+ superconducting magnets
Emptiest place in the solar system High vacuum inside the magnets
Hottest spot in the galaxy During Lead ion collisions create temperatures 100 000x hotter than the heart of the sun
Fastest racetrack on EarthProtons circulate 11245 times/s (99.9999991% the speed of light)
SQL> select sum(bytes/power(1024,5)) as "PetaBytes" > from dba_data_files;
PetaBytes--------------1.045261270388
Large databases
Or complex ones
Many Legacy Databases
• Some software built decades ago
• Databases for researchers, a big mess!
• Uncommon development cycles
• Still many 11g in 2019
• Heterogeneous technologies, connection methods
• DB links everywhere! L
Timing constraints for upgrades
The big upgrade challenge
11g
12c
INITIAL SITUATION
11g
12c
19c
CURRENT SITUATION
Release11g 10612c 619c 0
Release11g 8812c 419c 20
Plan (Jul 2019 – Jul 2020)
RMAN EM12cEASYNON-
CRITICAL
COMPLEXNON-
CRITICAL
EASYCRITICAL
COMPLEXCRITICAL
Automation and simplicity are the key
• Install new servers with OL7 (PXE, TFTP, Puppet)
• Install Grid Infrastructure 19c (Silent install via Rundeck)
• Move databases (Data Guard, NFS umount/mount via Rundeck)
• Upgrade databases (Autoupgrade)
The right tool for most cases
DB
CO
MPL
EXIT
Y
NUMBER OF DATABASES
MAN
UAL AUTOUPGRADE
DBUA
Steps used at CERN• Latest AutoUpgrade kit from MOS Document 2485457.1 (autoupgrade.jar)
• Script:
• Config:
setoh rdbms1930JAVA=$OH/jdk/jre/bin/java$JAVA -jar autoupgrade.jar -config ./DB.cfg -mode analyze|fixups|deploy
global.autoupg_log_dir=/ORA/dbs01/oracle/autoupgrade_cerndb/logsDB.dbname=DB_UNIQUE_NAMEDB.source_home=/ORA/dbs01/oracle/product/rdbms11204_171017_cern9DB.target_home=/ORA/dbs01/oracle/product/rdbms1930DB.sid=DB1DB.start_time=nowDB.log_dir=/ORA/dbs01/oracle/autoupgrade_cerndb/DB_logsDB.upgrade_node=server1.cern.chDB.run_utlrp=yesDB.timezone_upg=yesDB.target_version=19.3
analyze / fixups
Batch execution on all databases
Test, test, test!
PROD CLONE
Clone
Test, test, test!
PROD CLONE
Upgrade
Test, test, test!
PROD CLONE
Repeat!
Before autoupgrade -deploy
• Increase SGA >=17G and shared_pool >=7G
• Blackout in EM
• Dump Network ACLs
• Set cluster_database=false
After autoupgrade -deploy
• Cluster_database=true and srvctl update database
• Test
• Remove restore point
• Increase compatible parameter
• Various cosmetics (move passwordfile, etc.)
Log structure$ ls -ltotal 16drwxr-xr-x. 3 oracle ci 4096 Aug 21 10:43 DB_logs-rwxr-xr-x. 1 oracle ci 386 May 7 15:03 DB.sh-rw-r--r--. 1 oracle ci 493 May 7 13:21 DB.txtdrwx------. 3 oracle ci 4096 May 7 13:19 logs
$ ls -l logs/cfgtoollogs/upgrade/auto/total 9248-rwx------. 1 oracle ci 31531 May 7 16:56 autoupgrade_err.log-rwx------. 1 oracle ci 9387210 May 7 16:59 autoupgrade.log-rwx------. 1 oracle ci 8421 May 7 16:56 autoupgrade_user.logdrwx------. 2 oracle ci 4096 May 7 15:05 config_filesdrwx------. 2 oracle ci 4096 May 7 15:03 lock-rwx------. 1 oracle ci 12718 May 7 16:45 state.htmldrwx------. 2 oracle ci 4096 May 7 16:21 status
Log structure$ ls -l DB_logs/DB1/*DB_logs/DB1/101:total 84-rwx------. 1 oracle ci 77166 May 7 14:16 autoupgrade_20190507.log-rwx------. 1 oracle ci 96 May 7 14:16 autoupgrade_20190507_user.log-rwx------. 1 oracle ci 0 May 7 14:16 autoupgrade_err.logdrwx------. 2 oracle ci 4096 May 7 14:20 prechecksDB_logs/DB1/102:total 208-rwx------. 1 oracle ci 177770 May 7 14:38 autoupgrade_20190507.log-rwx------. 1 oracle ci 2865 May 7 14:38 autoupgrade_20190507_user.log-rwx------. 1 oracle ci 17209 May 7 14:38 autoupgrade_err.logdrwx------. 2 oracle ci 4096 May 7 14:38 prechecksdrwx------. 2 oracle ci 4096 May 9 11:54 prefixupsDB_logs/DB1/103:total 1072-rwx------. 1 oracle ci 997979 May 7 16:45 autoupgrade_20190507.log-rwx------. 1 oracle ci 15237 May 7 16:21 autoupgrade_20190507_user.log-rwx------. 1 oracle ci 44713 May 7 16:18 autoupgrade_err.logdrwx------. 2 oracle ci 4096 May 7 16:19 dbupgradedrwx------. 7 oracle ci 4096 May 7 16:14 dbupgradecfgtoollogsdrwx------. 2 oracle ci 4096 May 7 15:05 draindrwx------. 2 oracle ci 4096 May 7 16:21 postchecksdrwx------. 2 oracle ci 4096 May 9 12:03 postfixupsdrwx------. 2 oracle ci 4096 May 7 15:04 prechecksdrwx------. 2 oracle ci 4096 May 7 15:05 prefixupsdrwx------. 2 oracle ci 4096 May 7 15:03 preupgrade
CONTINUE…
Log structureDB_logs/DB1/temp:total 92-rwx------. 1 oracle ci 1923 May 7 16:13 after_upgrade_pfile_DB1.oradrwx------. 3 oracle ci 4096 May 7 16:45 DB_UNIQUE_NAME-rwx------. 1 oracle ci 2252 May 7 16:16 DB_UNIQUE_NAME_autocompile.sql-rwx------. 1 oracle ci 883 May 7 16:16 DB_UNIQUE_NAME_objcompare.sql-rwx------. 1 oracle ci 0 May 7 15:14 DB_UNIQUE_NAME.restart-rwx------. 1 oracle ci 21499 May 7 16:45 DB_UNIQUE_NAME_utltz_upg_apply.sql-rwx------. 1 oracle ci 33657 May 7 16:45 DB_UNIQUE_NAME_utltz_upg_check.sql-rwx------. 1 oracle ci 1923 May 7 16:13 before_upgrade_pfile_DB1.ora-rwx------. 1 oracle ci 1953 May 7 16:10 during_upgrade_pfile_DB1.ora-rwx------. 1 oracle ci 964 May 7 16:45 sqlsessend.sql-rwx------. 1 oracle ci 971 May 7 16:45 sqlsessstart.sql
Conclusions
• CERN beta tester: usable since the very beginning
• Few minor problems fixed quickly by the development
• Great usability
• Awesome logging, ideal for troubleshooting
• Our recommended way to upgrade!
Thanks!Ludovico Caldara - Computing Engineer, Oracle ACE Director
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Slides and more | https://MikeDietrichDE.com
AutoUpgrade Hundreds of Database to Oracle 19c 57
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | AutoUpgrade Hundreds of Database to Oracle 19c 58