On this activity we are going to migrate a 19c NON-CDB into a 26ai PDB and do the upgrade.
Since in 26ai is manadatory to have PDB’s, and YES we could migrade 19c NON-CDB into a 19C CBD reusing the datafiles and do the upgrade inplace, but that would make a rollback more complicated. For that reason best option would be using the refreshable clone PDB method, which pulls the data into the PDB via dblink, and if you need to rollback, just start 19c DB.
Enviroment is a single server running GRID, previouly upgraded to 26ai using this guide.
| DB NAME | PDB | ORACLE_HOME | |
| source 19c Non-CDB DB | DBTEST | N/A | /u01/app/oracle/product/19c/db_1 |
| target 26ai CDB DB | DBTESTCDB | TESTPDB | /u01/app/oracle/product/26ai/db_home1 |
1:- Install 26ai software using this guide and create a 26ai DB with just the PDB$SEED:
[oracle@oraclelinux8 ~]$ cd /u01/app/oracle/product/26ai/db_home1/bin
[oracle@oraclelinux8 bin]$ ./dbca \
-ignorePreReqs \
-ignorePrereqFailure \
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-sid DBTESTCDB \
-gdbName DBTEST \
-SysPassword syspassword \
-SystemPassword systempassword \
-storageType ASM \
-datafileDestination +DATA \
-archiveLogDest +FRA \
-enableArchive true \
-numberOfPDBs 0 \
-pdbAdminPassword pdbadmin \
-initParams db_unique_name=DBTESTCDB,sga_max_size=2G,sga_target=2G,pga_aggregate_target=2048M,pga_aggregate_limit=4096M
...
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/DBTESTCDB.
Database Information:
Global Database Name:DBTESTCDB
System Identifier(SID):DBTESTCDB
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/DBTESTCDB/DBTESTCDB3.log" for further details.
[oracle@oraclelinux8 bin]$
SYS/DBTESTCDB> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
SYS/DBTESTCDB>
2:- Create DB LINK on SOURCE DB:
create user dblinkuser identified by SuperSECRETPASSWORD ;
grant create session,
create pluggable database,
select_catalog_role to dblinkuser;
grant read on sys.enc$ to dblinkuser;
3:- Create DB LINK on TARGET DB:
SYS/DBTESTCDB> create database link clonepdb
connect to dblinkuser identified by SuperSECRETPASSWORD
using 'DBTEST';
Database link created.
SYS/DBTESTCDB>
**** make sure your 26ai tnsnames.ora has the SOURCE DB and test with tnsping.
4:- Download AUTOUPGRADE
Download autoupgrade from HERE and review parameters needed for the config file.
5:- Create autoupgrade config file:
[oracle@oraclelinux8 upgrade26ai]$ pwd
/home/oracle/upgrade26ai
[oracle@oraclelinux8 upgrade26ai]$ cat upgrade26ai.cfg
global.global_log_dir=/home/oracle/upgrade26ai/log
upg1.source_home=/u01/app/oracle/product/19c/db_1
upg1.target_home=/u01/app/oracle/product/26ai/db_home1
upg1.sid=DBTEST
upg1.target_cdb=DBTESTCDB
upg1.source_dblink.DBTEST=CLONEPDB 1800
upg1.target_pdb_name.DBTEST=TESTPDB
upg1.parallel_pdb_creation_clause.DBTEST=2
upg1.target_pdb_copy_option.DBTEST=file_name_convert=NONE
upg1.raise_compatible=no
upg1.manage_network_files=ignore_read_only
upg1.drop_dblink=yes
[oracle@oraclelinux8 upgrade26ai]$
** upg1.sid=DBTEST <- SOURCE DB
** upg1.target_cdb=DBTESTCDB <- TARGET DB
** upg1.source_dblink.DBTEST=CLONEPDB 1800 <- dblink to use and refresh rate
** upg1.target_pdb_name.DBTEST=TESTPDB <- PDB to be created and import the data.
6:- RUN AUTOUPGRADE ANALYZE:
[oracle@oraclelinux8 upgrade26ai]$ java -jar autoupgrade.jar -config upgrade26ai.cfg -mode analyze
AutoUpgrade 26.5.260807 launched with default internal options
Processing config file ...
upg> status
Config
User configuration file [/home/oracle/upgrade26ai/upgrade26ai.cfg]
General logs location [/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto]
Mode [ANALYZE]
Jobs Summary
Total databases in configuration file [1]
Total Non-CDB being processed [1]
Total Containers being processed [0]
Jobs finished successfully [0]
Jobs finished/stopped [0]
Jobs in progress [1]
Progress
+---+---------------------------------------------------------+
|Job| Progress|
+---+---------------------------------------------------------+
|100|[||||||||||||||||| ] 33 %|
+---+---------------------------------------------------------+
upg>
Check status of JOB 100 and refresh every 30seconds:
upg> status -job 100 -a 30
Details
Job No 100
Oracle SID DBTEST
Start Time 26/09/24 10:15:50
Elapsed (min): 1
End time: N/A
Logfiles
Logs Base: /home/oracle/upgrade26ai/log/DBTEST
Job logs: /home/oracle/upgrade26ai/log/DBTEST/100
Stage logs: /home/oracle/upgrade26ai/log/DBTEST/100/prechecks
TimeZone: /home/oracle/upgrade26ai/log/DBTEST/temp
Remote Dirs:
Stages
SETUP <1 min
PRECHECKS ~1 min (RUNNING)
Stage-Progress Per Container
+--------+---------+
|Database|PRECHECKS|
+--------+---------+
| DBTEST| 99 % |
+--------+---------+
The command status is running every 30 seconds. PRESS ENTER TO EXIT
Job 100 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Please check the summary report at:
/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto/status/status.log
[oracle@oraclelinux8 upgrade26ai]$
[oracle@oraclelinux8 upgrade26ai]$
If ANALYZE finds something, it will report and you would need to fix.
If no issues found. DB is ready for the upgrade.
7:- RUN AUTOUPGRADE DEPLOY:
[oracle@oraclelinux8 upgrade26ai]$ java -jar autoupgrade.jar -config upgrade26ai.cfg -mode deploy
AutoUpgrade 26.5.260807 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be processed
Type 'help' to list console commands
upg> status
Config
User configuration file [/home/oracle/upgrade26ai/upgrade26ai.cfg]
General logs location [/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto]
Mode [DEPLOY]
Jobs Summary
Total databases in configuration file [1]
Total Non-CDB being processed [1]
Total Containers being processed [0]
Jobs finished successfully [0]
Jobs finished/stopped [0]
Jobs in progress [1]
Progress
+---+---------------------------------------------------------+
|Job| Progress|
+---+---------------------------------------------------------+
|101|[|||||||||||| ] 23 %|
+---+---------------------------------------------------------+
upg> Copying remote database 'DBTEST' as 'TESTPDB' for job 101
Monitor progress with:
upg> status -a 30
or
upg> status -job 101 -a 30
After a while, if all goes ok:
upg> status -job 101 -a 30
....
Details
Job No 101
Oracle SID DBTEST
Start Time 26/09/24 10:24:40
Elapsed (min): 389
End time: N/A
Logfiles
Logs Base: /home/oracle/upgrade26ai/log/DBTEST
Job logs: /home/oracle/upgrade26ai/log/DBTEST/101
Stage logs: /home/oracle/upgrade26ai/log/DBTEST/101/postfixups
TimeZone: /home/oracle/upgrade26ai/log/DBTEST/temp
Remote Dirs:
Stages
SETUP <1 min
PREUPGRADE <1 min
DRAIN <1 min
CLONEPDB 1 min
REFRESHPDB <1 min
DISPATCH <1 min
DISPATCH 3 min
DBUPGRADE 351 min
NONCDBTOPDB 22 min
POSTCHECKS <1 min
POSTFIXUPS ~10 min (RUNNING)
POSTUPGRADE
SYSUPDATES
Stage-Progress Per Container
+--------+----------+
|Database|POSTFIXUPS|
+--------+----------+
| TESTPDB| 46 % |
+--------+----------+
The command status is running every 30 seconds. PRESS ENTER TO EXIT
Job 101 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Jobs restored [0]
Jobs pending [0]
Please check the summary report at:
/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/upgrade26ai/log/cfgtoollogs/upgrade/auto/status/status.log
[oracle@oraclelinux8 upgrade26ai]$
At this point, SOURCE DB is no longer running and disabled (done automatically by the AUTOUPGRADE) and Upgrade completed at this point so lets do few checks:
SYS/DBTESTCDB> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TESTPDB READ WRITE NO
SYS/DBTESTCDB>
CONNECT TO THE PDB WE JUST MIGRATED/UPGRADED:
SYS/DBTESTCDB> alter session set container=TESTPDB;
Session altered.
set lines 190
set pagesize 99
col comp_name format a45
col version format a15
col status format a12
select comp_id, comp_name, version, status
from dba_registry
order by comp_id;
COMP_ID COMP_NAME VERSION STATUS
------------------------------ --------------------------------------------- --------------- ------------
APS OLAP Analytic Workspace 23.0.0.0.0 VALID
CATALOG Oracle Database Catalog Views 23.0.0.0.0 VALID
CATJAVA Oracle Database Java Packages 23.0.0.0.0 VALID
CATPROC Oracle Database Packages and Types 23.0.0.0.0 VALID
CONTEXT Oracle Text 23.0.0.0.0 VALID
DV Oracle Database Vault 23.0.0.0.0 VALID
JAVAVM JServer JAVA Virtual Machine 23.0.0.0.0 VALID
OLS Oracle Label Security 23.0.0.0.0 VALID
OWM Oracle Workspace Manager 23.0.0.0.0 VALID
RAC Oracle Real Application Clusters 23.0.0.0.0 OPTION OFF
SDO Spatial 23.0.0.0.0 VALID
XDB Oracle XML Database 23.0.0.0.0 VALID
XML Oracle XDK 23.0.0.0.0 VALID
XOQ Oracle OLAP API 23.0.0.0.0 VALID
14 rows selected.
SYS/DBTESTCDB>
SYS/DBTESTCDB> select owner, object_type, count(*) invalid_count
from dba_objects
where status = 'INVALID'
group by owner, object_type
order by owner, object_type;
no rows selected
SYS/DBTESTCDB>
col action_time format a30
col DESCRIPTION format a60
select patch_id,
patch_type,
action,
status,
action_time,
description
from dba_registry_sqlpatch
order by action_time;
PATCH_ID PATCH_TYPE ACTION STATUS ACTION_TIME DESCRIPTION
---------- ---------- --------------- ------------ ------------------------------ ------------------------------------------------------------
38743669 RU APPLY SUCCESS 24-SEP-26 16.19.43.587118 Database Release Update : 23.26.1.0.0 (38743669) Gold Image
set linesize 220
col action_time format a30
col action format a15
col namespace format a24
col version format a22
col comments format a80
select action_time,
action,
namespace,
version,
id,
comments
from dba_registry_history
order by action_time;
ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS
------------------------------ --------------- ------------------------ ---------------------- ---------- --------------------------------------------------------------------------------
02-SEP-26 22.17.53.568748 RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Update - 190410122720
03-SEP-26 12.29.19.280965 jvmpsu.sql SERVER 19.32.0.0.260721OJVMRU 0 RAN jvmpsu.sql
03-SEP-26 12.29.19.324395 APPLY SERVER 19.32.0.0.260721OJVMRU 0 OJVM RU post-install
03-SEP-26 12.46.16.811449 RU_ROLLBACK SERVER 19.0.0.0.0 Patch rolled back from 19.3.0.0.0 to 19.1.0.0.0: Feature Release -
03-SEP-26 15.17.10.370433 jvmpsu.sql SERVER 19.32.0.0.260721OJVMRU 0 RAN jvmpsu.sql
03-SEP-26 15.17.10.397382 APPLY SERVER 19.32.0.0.260721OJVMRU 0 OJVM RU post-install
03-SEP-26 15.21.58.019284 jvmpsu.sql SERVER 19.32.0.0.260721OJVMRU 0 RAN jvmpsu.sql
03-SEP-26 15.21.58.031594 APPLY SERVER 19.32.0.0.260721OJVMRU 0 OJVM RU post-install
03-SEP-26 16.11.59.246936 RU_APPLY SERVER 19.0.0.0.0 Patch applied from 19.1.0.0.0 to 19.32.0.0.0: Release_Update - 260705220710
24-SEP-26 16.17.57.511406 UPGRADE SERVER 23.0.0.0.0 Upgraded from 19.32.0.0.0 to 23.26.1.0.0
24-SEP-26 16.19.43.651993 RU_INSTALL SERVER 23.26.1.0.0 Installed RU 23.26.1.0.0
24-SEP-26 16.43.06.403184 NONCDB_TO_PDB SERVER 23.0.0.0.0 Converted non-CDB to PDB in release 23.26.1.0.0
BOOTSTRAP DATAPATCH_PRVTQOPI 23 e0b85a0176a706b50918f5ba985f7bde|40E31CE3CE567D947FFFBE286C3BA439
BOOTSTRAP DATAPATCH_DBMSQOPI 23 cc33d7b58f7f4efa82f56bcd4e4cc655|CFE1C0F9D24EFBEAA05917AD4A3957B9
BOOTSTRAP DATAPATCH_PRVTSQLPATCH 23 abc11351967a0830b78c2a3ffc32a256|1D4E7F5CAB7BBEB1D9D78409E05253D7
BOOTSTRAP DATAPATCH 19 RDBMS_19.32.0.0.0DBRU_LINUX.X64_260705
BOOTSTRAP DATAPATCH 23 RDBMS_23.26.1.0.0DBRU_LINUX.X64_260116.1
BOOTSTRAP DATAPATCH_DBMSSQLPATCH 23 922a4c202e49dbaf5baecbe11c8372f1|42ECEA23B571E15BD852875F674AA82A
18 rows selected.
SYS/DBTESTCDB>
One of the last few things to do is to review any TNSMAMES and make sure they are correct, and also create any matching service that connects to the desired PDB:
**** IF YOU NEED TO RESTART THE OLD DB, BE CAREFULL SINCE SERVICE NAMES ARE THE SAME
OLD SERVICE:
[oracle@oraclelinux8 ~]$ srvctl config service -d DBTEST
Service name: PROD_SERVICE
Cardinality: SINGLETON
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name:
Hub service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Service uses Java: false
[oracle@oraclelinux8 ~]$
NEW 26ai to connect to PDB TESTPDB:
[oracle@oraclelinux8 ~]$ srvctl add service -db DBTESTCDB -service PROD_SERVICE -pdb TESTPDB -role PRIMARY
[oracle@oraclelinux8 ~]$ srvctl start service -db DBTESTCDB
[oracle@oraclelinux8 ~]$ srvctl status service -db DBTESTCDB
Service PROD_SERVICE is running
[oracle@oraclelinux8 ~]$ srvctl config service -db DBTESTCDB
Service name: PROD_SERVICE
Cardinality: SINGLETON
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: FALSE
AQ HA notifications: FALSE
Global: FALSE
Commit Outcome: FALSE
Commit Outcome Fastpath: FALSE
Reset State: NONE
Failover type: NONE
Failover method: NONE
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: NONE
Edition:
Pluggable database name: TESTPDB
True Cache service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Failback : no
Replay Initiation Time: 300 seconds
Drain timeout:
Template timeout: 86400 seconds
Stop option:
Session State Consistency:
Auto Connection Rebalance: DEFAULT
GSM Flags: 0
Service is enabled
Comments