I. Introduction
For one of my banking client, i have developped a shell script to upgrade databases from 12c to 19c, including dataguards & TDE.
The script helped my collegues to upgrade a hundred of production databases, and more in developpment environnement.
The script is based on autougrade.jar oracle binary ....
I also provided a documentation to learn how to use this script ....
Always download the last version of :
AutoUpgrade Tool (Doc ID 2485457.1)
II. Upgrade Mode
I relied on the two modes of autoupgrade.jar : ANALYZE & DEPLOY.
So my script uses also these two modes ...
III. ANALYZE Mode
On the Primary database:
o Ask the DBA if he has a Full backup, with a minimum verification of a Full backup less than 7 days old o Primary Instance: All PDBs must be in OPEN and NOT RESTRICTED state: it outputs an error otherwise o Check the status of the broker if Dataguard: it outputs an error if the broker is not valid o Check that at least 75% of the FRA is not used : it outputs an error otherwise o If Dataguard, ask the DBA to launch this script in ANALYZE mode on the Standby o Analyze the database: preCheck and PostCheck recommendations o A table will summarize the number of errors, warnings and Recommendations On the Standby bases: o Check the status of the broker if Dataguard: it outputs an error if the broker is not valid o Check that at least 75% of the FRA is not used (in case of ARCHIVELOG): it outputs an error otherwise o Others checks .... |
The script checks this status ...
the script must be lauched : - First on the database server - Next on the standby server (if exists) |
upgrade.sh -s MYDATABASE -m ANALYZE
The output is :
some outputs :
autoupgrade.jar version ... .... 2022/05/25 11:57:29 - INFO - Check_dba_registry ... : OH ==> /home/.../ora12102_2001 2022/05/25 11:58:13 - INFO - Brocker status .... 2022/05/25 11:58:18 - INFO - User choices: MODE : ANALYZE INSTANCE : MYDATABASE DB_UNIQUE_NAME : MYDATABASE_PRIMARY ARCHIVELOG MODE : YES FLASHBACK : YES DB_ROLE : PRIMARY MULTITENANT : YES FRA : .98 % PRIMARY DATABASE : MYDATABASE_PRIMARY STANDBY DATABASE : MYDATABASE_STANDBY DATAGUARD : OK VERSION : 12.1.0.2.0 ORACLE_HOME_SOURCE : /home/xxxx/ora12102_2001 ORACLE_HOME_CIBLE : /home/xxxx/ora191000_2101 VERSION SCRIPT : 1.38 VERSION AUTOUPGRADE : build.date 2021/11/15 11:57:54 ORACLE NATIVE ENCRYPTION : NO TDE : YES TDE_WALLET_LOCATION : /…/MYDATABASE/wallets PFILE AVANT MIGRATION : /…/initMYDATABASE_avant_upgrade.ora CONFIG FILE : /…/config_file_analyse_20220525_1155.cfg LOG DU SCRIPT : /…/ANALYZE/upgrade_ANALYZE_20220525_1155.upg LOG AUTOUPGRADE.JAR : /ANALYZE/Log_20220525_1155/upgr/MYDATABASE/[1-9]**/prechecks/ 2022/05/25 11:58:18 - INFO - Validation to continue
: (y/n) ?
2022/05/25 11:58:31 - INFO - Once autoupgrade.jar is launched, you can check the log : /home/.../log/upgrade_19c/MYDATABASE/ANALYZE/Log_20220525_1155/upgr/MYDATABASE/[1-9]**/prechecks/ ...
|
At the end, status of the ANALYZE mode : 2 cases :
Case 1 : Failed status 2022/05/25 11:59:51 - INFO - Summarize ANALYZE Mode : MODE : ANALYZE ERRORS : 2 WARNINGS : 18 RECOMMEND : 14
Case 2 : Success status 2022/05/25 11:59:51 - INFO - Bilan ANALYZE Mode : MODE : ANALYZE ERRORS : 0 WARNINGS : 18 RECOMMEND : 14 |
IV. DEPLOY Mode
First : the ANALYZE mode must be in Success status.
The script checks this status ...
the script must be lauched : - First on the database server - Next on the standby server (if exists) |
upgrade.sh -s MYDATABASE -m DEPLOY
The output is :
some outputs :
Minimum version of the database that can be directly upgraded to Oracle 19c. .... 2022/05/25 11:57:29 - INFO - Check_dba_registry ... : OH ==> /home/.../ora12102_2001 2022/05/25 12:14:49 - INFO - Check Rman Backup ... 2022/05/25 11:58:13 - INFO - Brocker status .... 2022/05/25 11:58:18 - INFO - User choices:
MODE : DEPLOY INSTANCE : MYDATABASE DB_UNIQUE_NAME : MYDATABASE_PRIMARY ARCHIVELOG MODE : YES FLASHBACK : YES DB_ROLE : PRIMARY MULTITENANT : YES FRA : .98 % PRIMARY DATABASE : MYDATABASE_PRIMARY STANDBY DATABASE : MYDATABASE_STANDBY DATAGUARD : OK VERSION : 12.1.0.2.0 ORACLE_HOME_SOURCE : /home/xxxx/ora12102_2001 ORACLE_HOME_CIBLE : /home/xxxx/ora191000_2101 VERSION SCRIPT : 1.38 VERSION AUTOUPGRADE : build.date 2021/11/15 11:57:54 ORACLE NATIVE ENCRYPTION : NO Timezone upg by Autoupgrade : NO TDE : YES TDE_WALLET_LOCATION : /…/MYDATABASE/wallets PFILE AVANT MIGRATION : /…/initMYDATABASE_avant_upgrade.ora CONFIG FILE : /…/config_file_deploy_20220525_1155.cfg LOG DU SCRIPT : /…/ DEPLOY/upgrade_ANALYZE_20220525_1155.upg LOG AUTOUPGRADE.JAR : / DEPLOY/Log_20220525_1155/upgr/MYDATABASE/[1-9]**/prechecks/ 2022/05/25 11:58:18 - INFO - Validation to continue
: (y/n) ? ...
2022/05/25 12:20:53 - INFO - Résultat : Execution of the script @/home/.../ora12102_2001/rdbms/admin/utlrp.sql 2022/05/25 12:25:14 - INFO - Disable Dataguard : Primary = MYDATABASE_PRIMARY , Standby = MYDATABASE_STANDBY .... Oracle_Home : /home/.../ora12102_2001
... 2022/05/25 12:25:39 - INFO - Once autoupgrade.jar is launched, you can check the log : /home/.../log/upgrade_19c/MYDATABASE/DEPLOY/Log_20220525_1155/upgr/MYDATABASE/[1-9]**/autoupgrade_20220525.log
... End of the deploy Postupgrade tasks 2022/05/25 15:37:41 - INFO - Enable_triggers : OH ==> /home/.../ora191000_2101 2022/05/25 15:37:42 - INFO - Enable_Unified_Audit : OH ==> /home/.../ora191000_2101 2022/05/25 15:37:45 - INFO - Restore Point was created by autoupgrade.jar ...
2022/05/25 15:37:46 - INFO - TDE is configured: the parameters wallet_root and tde_configuration will be modified to /home/logiciel/oracle/…/MYDATABASE/wallets and KEYSTORE_CONFIGURATION=FILE, OH ==> /home/logiciel/oracle/ora19600_2001
Stop-Start Instance ... 2022/05/25 15:37:47 - INFO - Update Time Zone Root-Seed and all PDBs Oracle Application
Express
4.2.5.00.08
VALID
|