Professional Documents
Culture Documents
Tech Summit 2021 Autoupgrade Deep Dive
Tech Summit 2021 Autoupgrade Deep Dive
Tech Summit 2021 Autoupgrade Deep Dive
1 Copyright © 2021, Oracle and/or its affiliates Photo by Karl Moran on Unsplash
Mike Dietrich
https://dohdatabase.com
@dohdatabase
dohdatabase
AutoUpgrade
Essentials
Upgrade
Download
Configure
Analyze
Check
Upgrade
Download Upgrade
Configure $ java -jar autoupgrade.jar -config CDB1.cfg -mode deploy
Analyze
Check
Upgrade
Download Monitor
Configure upg> lsj
Analyze
+----+-------+---------+---------+-------+--------------+--------+---------------+
Check |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+---------------+
Upgrade | 101| CDB1|PREFIXUPS|EXECUTING|RUNNING|20/11/24 13:38|13:39:26|Remaining 12/13|
+----+-------+---------+---------+-------+--------------+--------+---------------+
Analyze Progress
-----------------------------------
Check Start time: 20/11/24 13:38
Elapsed (min): 13
Upgrade Last update:
Stage:
2020-11-24T13:48:52.139
DBUPGRADE
Operation: EXECUTING
Status: RUNNING
Stage summary:
SETUP <1 min
GRP <1 min
PREUPGRADE <1 min
PRECHECKS <1 min
PREFIXUPS 8 min
DRAIN <1 min
DBUPGRADE 3 min (IN PROGRESS)
Error Details:
None
Download Success
Configure upg> Job 101 completed
------------------- Final Summary --------------------
Analyze Number of databases [ 1 ]
---- Drop GRP at your convenience once you consider it is no longer needed ----
Drop GRP from CDB1: drop restore point AUTOUPGRADE_9212_CDB1122010
And it includes:
• Recompilation (utlrp.sql)
• Time zone file upgrade
• Postupgrade fixups
• ... and so much more
Download
Configure
Analyze
Check
Upgrade
Watch on YouTube
• Faster
• More flexible
upg1.sid=CDB12102
upg1.target_cdb=CDB19
upg1.pdbs=pdb1
upg1.source_home=/u01/app/oracle/product/12102
upg1.target_home=/u01/app/oracle/product/19
Watch on YouTube
Rename a PDB
upg1.pdbs=pdb1
upg1.target_pdb_name.pdb1=sales
Current limitations:
https://dohdatabase.com/how-to-upgrade-a-single-pdb
Command
java -jar autoupgrade.jar -config DB19.cfg -mode deploy
Command
Java -jar autoupgrade.jar -config DB19.cfg -mode deploy
Command
java -jar autoupgrade.jar -config DB19.cfg -mode deploy
Watch on YouTube
Primary database
Watch on YouTube
https://dohdatabase.com/how-to-upgrade-with-autoupgrade-and-data-guard
https://www.youtube.com/watch?v=JcIMlEQLWd0
• STARTUP UPGRADE
upg1.source_home=/tmp
upg1.target_home=/u01/app/oracle/product/19
upg1.sid=DB12
Pro tip: Find more details in blog post • -mode upgrade
Oracle AutoUpgrade between two servers
Watch on YouTube
BREAKING NEWS
Watch on YouTube
If you revert or restore in any other way, you must tell AutoUpgrade
• Default behavior:
• AutoUpgrade creates GRP except for
- Standard Edition 2
- restoration=no
• GRP will be kept
• GRP needs to be removed manually except for
- drop_grp_after_upgrade=yes will only remove it when upgrade completed successfully
Watch on YouTube
If you revert or restore in any other way, you must tell AutoUpgrade
rm -rf /u01/app/oracle/cfgtoollogs/autoupgrade
rm -rf /u01/app/oracle/admin/DB1/upglogs
https://dohdatabase.com/is-autoupgrade-resumable/
You can:
• Add or remove parameters
• Before, during or after upgrade
• For a single or every database
# Example: global_del_during.ora
optimizer_features_enable
# Example: global_add_after.ora
deferred_segment_creation=false
_cursor_obsolete_threshold=1024
_sql_plan_directive_mgmt_control=0
_use_single_log_writer=true
Watch on YouTube
You can:
• Before and after upgrade
• Halt or continue on error
• For a single or every database
Ideas:
• Enterprise Manager configuration
• Backup configuration
• Interact with apps using the database
global.before_action=/database/scripts/set_blackout.sh
upg1.source_home=/u01/app/oracle/product/12.2.0.1
upg1.target_home=/u01/app/oracle/product/19
upg1.sid=CDB1
upg1.after_action=/database/scripts/start_level0.sh
"
recommends that you regather fixed object statistics after you have run
representative workloads on Oracle Database.
Database 19c Upgrade Guide, chapter 7
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => '"SYS"."GATHER_FIXED_OBJECTS_STATS_ONE_TIME"',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN DBMS_STATS.GATHER_FIXED_OBJECTS_STATS; END;',
start_date => SYSDATE+7,
auto_drop => TRUE,
comments => 'Gather fixed objects stats after upgrade - one time'
);
DBMS_SCHEDULER.ENABLE (
name => '"SYS"."GATHER_FIXED_OBJECTS_STATS_ONE_TIME"'
);
END;
/
$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl \
-n 4 -e \
-C 'PDB$SEED' \
-b sched_gfos -d /home/oracle/sched_gfos/ sched_gfos.sql
upg1.after_action=/home/oracle/sched_gfos/sched_gfos.sh
Watch on YouTube
20
0
40
70
10
30
50
100
60
90
00:00:00
00:05:00
00:10:00
00:15:00
00:20:00
00:25:00
00:30:00
00:35:00
00:40:00
00:45:00
00:50:00
00:55:00
01:00:00
01:05:00
01:10:00
01:15:00
01:20:00
01:25:00
01:30:00
01:35:00
01:40:00
Catctl Options | Faster Upgrades
01:45:00
01:50:00
01:55:00
02:00:00
02:05:00
Ideal utilization
02:10:00
02:15:00
02:20:00
02:25:00
02:30:00
02:35:00
02:40:00
02:45:00
02:50:00
02:55:00
03:00:00
03:05:00
Total upgrade time: 4 hours 8 minutes
03:10:00
03:15:00
03:20:00
03:25:00
03:30:00
03:35:00
03:40:00
03:45:00
03:50:00
03:55:00
04:00:00
04:05:00
04:10:00
80
20
0
40
60
100
00:00:00
00:06:10
00:12:20
00:18:30
00:24:40
00:30:50
00:37:00
00:43:10
00:49:20
00:55:30
01:01:40
01:07:50
01:14:00
01:20:10
01:26:20
02:15:40
02:21:50
• Keep parallel processes per PDB at default (2)
02:28:00
02:34:10
02:40:20
02:46:30
02:52:40
02:58:50
03:05:00
03:11:10
03:17:20
03:23:30
03:29:40
03:35:50
03:42:00
03:48:10
03:54:20
04:00:30
04:06:40
80
20
0
40
60
100
20
80
40
0
60
100
00:00:10 00:00:00
00:06:20 00:06:10
00:12:30 00:12:20
00:18:40 00:18:30
00:24:50 00:24:40
00:31:00 00:30:50
00:37:10 00:37:00
00:43:20 00:43:10
00:49:30 00:49:20
00:55:40 00:55:30
01:01:50 01:01:40
01:08:00 01:07:50
01:14:10 01:14:00
01:20:20 01:20:10
01:26:30 01:26:20
01:32:40 01:32:30
01:38:50 01:38:40
01:45:00 01:44:50
01:51:10 01:51:00
01:57:20 01:57:10
02:03:30 02:03:20
02:09:40 02:09:30
Catctl Options | Faster Upgrades
02:15:50 02:15:40
02:22:00 02:21:50
02:28:10 02:28:00
02:34:20 02:34:10
02:40:30 02:40:20
02:46:40 02:46:30
02:52:50 02:52:40
02:59:00 02:58:50
03:05:10 03:05:00
03:11:20 03:11:10
03:17:30 03:17:20
03:23:40 03:23:30
03:29:50 03:29:40
03:36:00 03:35:50
03:42:10 03:42:00
03:48:10
03:54:20
04:00:30
04:06:40
26 minutes faster
32 parallel processes
54 parallel processes
upg1.catctl_options=-n 54
PROCESSES dramatically
Pro tip: Remember to increase
Zip Options
Watch on YouTube
Error Codes
ERROR1400.ERROR = UPG-1400
ERROR1400.CAUSE = Database upgrade failed with errors
Omit the error code and get a list of all error codes
$ java -jar autoupgrade.jar -error_code
ERROR1000.ERROR = UPG-1000
ERROR1000.CAUSE = It was not possible to create the data file where the jobsTable is being written or there was a
problem during the writing, it might be thrown due to a permission error or a busy resource scenario
ERROR1001.ERROR = UPG-1001
ERROR1001.CAUSE = There was a problem reading the state file perhaps there was corruption writing the file and in
the next write it might be fixed
.
.
Error Codes | Demo
Watch on YouTube
Enjoy 18 hours of high-quality tech
https://dohdatabase.com/webinars/
•
Cool Features – Not only for DBAs
byJustin
•
• Database Upgrade Internals – and so much more
Photoby
YouTube Channel