Actualice a 26ai sin sorpresas
¿Todavía usas Oracle Database 19c y la arquitectura multitenant te parece un salto demasiado grande? No eres el único, pero con las novedades de Oracle 26ai, seguro que ya te ronda la idea de actualizar, aunque es normal que surjan dudas sobre lo que implica este cambio.
Pero tranquilo, aquí te voy a mostrar lo sencillo que puede ser migrar de non-CDB a CDB y, de paso, actualizar a 26ai, todo con la ayuda de AutoUpgrade.
Situación inicial
Partimos con la base de datos Oracle RAC orcl1, que está en pleno funcionamiento, y ya preparamos el container orcl3, que será nuestro destino final tras el upgrade.
Reutilizaremos los datafiles existentes y, para introducir algo de complejidad, tenemos TDE (Transparent Data Encryption) configurado.
| origen | destino | |
|---|---|---|
| db_name | orcl | orcl |
| db_unique_name | orcl1 | orcl2 |
| instance_name | orcl1_1, orcl1_2 | orcl3_1, orcl3_2 |
| servicios | orcl_rw, orcl_ro | |
| version | 19.31 | 23.26.2 |
| TDE keystore password | RigyoTasEnuhyu5# | TarojoxobOv#n4Wo |
Empezamos con los preparativos
# Created by AutoUpgrade Composer
# Upgrade, UpgType: noncdb2cdb, FileNameConvert: nocopy
global.global_log_dir=/home/oracle/autoupgrade/log
global.keystore=/home/oracle/autoupgrade/keystore
upg1.sid=orcl1_1
upg1.log_dir=/home/oracle/autoupgrade/log/orcl1_Upgrade
upg1.source_home=/u01/app/oracle/19.0.0/db_1
upg1.target_home=/u01/app/oracle/23.0.0/db_1
upg1.target_cdb=orcl3_1
upg1.target_pdb_name=orcl
Como las bases de datos usan TDE, debemos empezar por registrar los keystore password en el wallet de AutoUpgrade, primero para la base de datos orcl1 (instancia orcl1_1) y luego para la base de datos orcl3 (instancia orcl3_1).
Si en tu instalación no usan TDE, puedes ignorar este paso e ir directamente al siguiente.
java -jar autoupgrade.jar \
-config upg.cfg \
-load_password
Processing config file ...
Starting AutoUpgrade Password Loader - Type help for available options
Creating new AutoUpgrade keystore - Password required
Enter password: *************
Enter password again: *************
AutoUpgrade keystore was successfully created
TDE> save
Convert the AutoUpgrade keystore to auto-login [YES|NO] ? YES
TDE>
TDE> add orcl1_1
Enter your secret/Password: *************
Re-enter your secret/Password: *************
TDE> add orcl3_1
Enter your secret/Password: *************
Re-enter your secret/Password: *************
TDE> save
TDE> exit
AutoUpgrade Password Loader finished - Exiting AutoUpgrade
Primero hay que validar
Ya listos para el upgrade, le pedimos a AutoUpgrade que revise nuestra configuración y nos confirme que todo esté en orden.
java -jar autoupgrade.jar \
-config upg.cfg \
-mode analyze
AutoUpgrade 26.3.260401 launched with default internal options
Processing config file ...
Loading AutoUpgrade keystore
AutoUpgrade keystore is loaded
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be analyzed
Type 'help' to list console commands
upg> Job 101 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Please check the summary report at:
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Fri Jun 26 18:34:15 PET 2026
[Number of Jobs] 1
==========================================
[Job ID] 101
==========================================
[DB Name] orcl1
[Version Before Upgrade] 19.31.0.0.0
[Version After Upgrade] 23.26.2.0.0
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2026-06-26 18:33:52
[Duration] 0:00:22
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl11/101/prechecks
[Detail] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl11/101/prechecks/orcl1_preupgrade.log
Check passed and no manual intervention needed
------------------------------------------
Es hora del upgrade
Llegó el momento clave: ejecutamos AutoUpgrade con -mode deploy y solo nos queda esperar con paciencia a que termine.
java -jar autoupgrade.jar \
-config upg.cfg \
-mode deploy
AutoUpgrade 26.3.260401 launched with default internal options
Processing config file ...
Loading AutoUpgrade keystore
AutoUpgrade keystore is loaded
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
upg>
Lo primero que ocurre es la suspensión del servicio de la base de datos.
A continuación, se ejecutan el upgrade y la conversión de non-CDB a CDB.
.
.
.
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
upg> Job 102 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Jobs restored [0]
Jobs pending [0]
The following PDB(s) were created with standbys=none option. Refer to the postcheck result orcl1_postupgrade.log for more details on manual actions needed.
ORCL1_1
Please check the summary report at:
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.log
status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Fri Jun 26 19:01:01 PET 2026
[Number of Jobs] 1
==========================================
[Job ID] 102
==========================================
[DB Name] orcl1
[Version Before Upgrade] 19.31.0.0.0
[Version After Upgrade] 23.26.2.0.0
------------------------------------------
[Stage Name] GRP
[Status] SUCCESS
[Start Time] 2026-06-26 18:37:00
[Duration] 0:00:06
[Detail] Please drop the following GRPs after Autoupgrade completes:
AUTOUPGRADE_9212_ORCL11931000
------------------------------------------
[Stage Name] PREUPGRADE
[Status] SUCCESS
[Start Time] 2026-06-26 18:37:07
[Duration] 0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/preupgrade
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2026-06-26 18:37:07
[Duration] 0:00:23
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/prechecks
[Detail] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/prechecks/orcl1_preupgrade.log
Check passed and no manual intervention needed
------------------------------------------
[Stage Name] PREFIXUPS
[Status] SUCCESS
[Start Time] 2026-06-26 18:37:31
[Duration] 0:00:16
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/prefixups
[Detail] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/prefixups/prefixups.html
------------------------------------------
[Stage Name] DRAIN
[Status] SUCCESS
[Start Time] 2026-06-26 18:37:47
[Duration] 0:04:08
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/drain
------------------------------------------
[Stage Name] DBUPGRADE
[Status] SUCCESS
[Start Time] 2026-06-26 18:41:56
[Duration] 0:13:02
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/dbupgrade
------------------------------------------
[Stage Name] NONCDBTOPDB
[Status] SUCCESS
[Start Time] 2026-06-26 18:59:32
[Duration] 0:00:02
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/noncdbtopdb
------------------------------------------
[Stage Name] POSTCHECKS
[Status] SUCCESS
[Start Time] 2026-06-26 18:59:34
[Duration] 0:00:01
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postchecks
[Detail] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postchecks/orcl1_postupgrade.log
Check passed and no manual intervention needed
The following PDB(s) were created with standbys=none option. Refer to the postcheck result /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postchecks/orcl1_postupgrade.log for more details on manual actions needed.
ORCL11
------------------------------------------
[Stage Name] POSTFIXUPS
[Status] SUCCESS
[Start Time] 2026-06-26 18:59:35
[Duration] 0:01:09
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postfixups
[Detail] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postfixups/postfixups.html
------------------------------------------
[Stage Name] POSTUPGRADE
[Status] SUCCESS
[Start Time] 2026-06-26 19:00:45
[Duration] 0:00:15
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/postupgrade
------------------------------------------
[Stage Name] SYSUPDATES
[Status] SUCCESS
[Start Time] 2026-06-26 19:01:00
[Duration] 0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/sysupdates
------------------------------------------
Summary:/home/oracle/autoupgrade/log/orcl11_Upgrade/orcl1_1/102/dbupgrade/upg_summary.log
orcl1_postupgrade.log
[dbname] [orcl1]
==========================================
[container] [ORCL]
==========================================
[checkname] TIMESTAMP_MISMATCH
[stage] POSTCHECKS
[fixup_available] YES
[runfix] YES
[severity] WARNING
[action] Recompile the objects with timestamp mismatch. Refer to MOS note 781959.1 for more details.
[broken rule] There are objects whose timestamp are mismatched with its parent objects.
[rule] Timestamp of dependent objects must coincide with the timestamp of parent objects.
----------------------------------------------------
[checkname] PDB_CREATED_STANDBYS_NONE
[stage] POSTCHECKS
[fixup_available] NO
[runfix] N/A
[severity] WARNING
[action] Manual steps need to be performed after upgrade to copy the files to the standby database and enable recovery of the PDB from PRIMARY to STANDBY. Refer to MOS document Doc ID 1916648.1 for detailed steps.
[broken rule] The following PDB(s) [ORCL1_11] were created with standbys=none option.
[rule] On a Data Guard configuration, the CREATE PLUGGABLE DATABASE statement needs to be executed with clause STANDBYS=NONE to avoid impacting redo apply. That clause allows for deferral of file instantiation on the standby and the physical standby database to continue to protect existing pluggable databases. The clause allows the general structure of the PDB to be created on all physical standbys but all files belonging to the PDB are marked as OFFLINE/RECOVER at the standby.
----------------------------------------------------
[checkname] POST_DICTIONARY
[stage] POSTCHECKS
[fixup_available] YES
[runfix] YES
[severity] RECOMMEND
[action] Gather dictionary statistics after the upgrade using the command: EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
[broken rule] Oracle recommends gathering dictionary statistics after upgrade.
[rule] Dictionary statistics provide essential information to the Oracle optimizer to help it find efficient SQL execution plans. After a database upgrade, statistics need to be re-gathered as there can now be tables that have significantly changed during the upgrade or new tables that do not have statistics gathered yet.
----------------------------------------------------
[checkname] POST_FIXED_OBJECTS
[stage] POSTCHECKS
[fixup_available] NO
[runfix] N/A
[severity] RECOMMEND
[action] Gather statistics on fixed objects after the upgrade and when there is a representative workload on the system using the command: EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
[broken rule] Oracle recommends gathering fixed object statistics after upgrade. This recommendation is given for all preupgrade runs.
[rule] Fixed object statistics provide essential information to the Oracle optimizer to help it find efficient SQL execution plans. Those statistics are specific to the Oracle Database release that generates them, and can be stale upon database upgrade. For information on managing optimizer statistics, refer to the 19.0.0.0 Oracle Database Upgrade Guide.
----------------------------------------------------
Pasos finales
execute DBMS_STATS.GATHER_DICTIONARY_STATS;
execute DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
Por supuesto, toca revisar si quedan problemas pendientes tras el plugin de la base de datos y, si todo está resuelto, podemos limpiar la tabla.
SELECT message, type, status
FROM pdb_plug_in_violations
WHERE name = 'ORCL'
ORDER BY time DESC;
exec DBMS_PDB.CLEAR_PLUGIN_VIOLATIONS;
Finalmente, si bien los servicios de la base de datos orcl1 están registrados en el flamante PDB orcl, los servicios a nivel de clusterware no se han creado, por lo que hay que registrarlos manualmente con srvctl.
column name format a20
column network_name format a20
SELECT con_id, name, network_name
FROM v$services
ORDER by con_id, name;
CON_ID NAME NETWORK_NAME
---------- -------------------- --------------------
1 SYS$BACKGROUND
1 SYS$USERS
1 orcl3 orcl3
1 orcl3XDB orcl3XDB
3 orcl orcl
3 orcl1 orcl1
3 orcl1XDB orcl1XDB
3 orcl_ro orcl_ro
3 orcl_rw orcl_rw
$ srvctl config service -db orcl3
$ srvctl add service -db orcl3 -service orcl_rw -pdb orcl -role primary -preferred orcl3_1,orcl3_2
$ srvctl add service -db orcl3 -service orcl_ro -pdb orcl -role physical_standby -preferred orcl3_1,orcl3_2
$ srvctl start service -db orcl3 -service orcl_rw
$ srvctl start service -db orcl3 -service orcl_ro
$ srvctl stop service -db orcl3 -service orcl_ro
$ srvctl status service -db orcl3
Service orcl_ro is not running.
Service orcl_rw is running on instances orcl3_1,orcl3_2
Conclusiones
Si te has tomado la molestia de revisar la documentación oficial, habrás notado que hay muchas tareas manuales por ejecutar en nuestro escenario, empezando por la conversión a multitenant, siguiendo con la migración de las TDE keys y el upgrade a 26ai en sí, ¡a que no da un poco de miedito!
Pero ya viste lo fácil que es con AutoUpgrade: solo creas el archivo de configuración, lo ejecutas un par de veces y listo, todo se hace solo y sin errores. Así que no hay excusas: haz tus pruebas y ¡anímate a ponerle fecha a tu upgrade a Oracle 26ai!