Migrating a Database to Oracle Database 23ai with XTTS (Cross-Platform Transportable Tablespaces) — Runbook
Updated: Oct 24
Environment used in this runbook:
Source: PDB SRCPDB in CDB SRCCDB (Oracle Database 23ai on a big-endian platform such as AIX or Solaris SPARC)
Target: PDB PDB1 in CDB CDB23 (Oracle Database 23ai on Linux x86-64)
Same-endian moves: the same steps work (for example old Linux storage → new Linux host); only the conversion step becomes a no-op
Reference notes (My Oracle Support): 2471245.1 — V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (the xttdriver.pl procedure used here) and 2999157.1 — M5 Cross Endian Platform Migration using Full Transportable Data Pump Export/Import and RMAN Incremental Backups (Oracle's newer, Perl-free variant; same principle).
How XTTS keeps the downtime short
Take a level-0 RMAN backup of the application tablespaces while the source stays online, copy it to the target and restore/convert it (endian conversion happens on the target).
Repeat incremental backups and roll the target datafiles forward as often as you like — still no downtime.
Cutover: source tablespaces READ ONLY → last tiny incremental → Data Pump metadata export/import → tablespaces READ WRITE on the target.
Downtime = final incremental + metadata import, typically minutes even for multi-terabyte databases.
Phase 0 — Planning and prerequisites
Step 0.1 — Confirm endianness and platform IDs
SQL |
-- run on both source and target SELECT d.platform_id, d.platform_name, tp.endian_format FROM v$database d JOIN v$transportable_platform tp ON tp.platform_id = d.platform_id; |
Why: the driver needs the source PLATFORM_ID (e.g. AIX = 6, Solaris SPARC = 2, Linux x86-64 = 13). Different endian → conversion; same endian → plain restore.
Step 0.2 — Decide what to transport
SQL |
SELECT tablespace_name, contents, status FROM dba_tablespaces ORDER BY 1; |
Transport all application tablespaces (e.g. USERS, APP_DATA, APP_IDX, APP_LOB). SYSTEM, SYSAUX, UNDO and TEMP are never transported; their content (users, roles, PL/SQL, sequences, views, synonyms, grants) is moved by Data Pump metadata export.
Step 0.3 — Check the set is self-contained
SQL |
EXEC DBMS_TTS.TRANSPORT_SET_CHECK('USERS,APP_DATA,APP_IDX,APP_LOB', incl_constraints => TRUE, full_check => TRUE); SELECT * FROM transport_set_violations; -- must return no rows |
Why: an index in APP_IDX on a table in SYSTEM, or a partition in a non-transported tablespace, breaks the transport. Fix violations (move objects) before you start.
Step 0.4 — Source checks
ARCHIVELOG mode on (incrementals rely on it): SELECT log_mode FROM v$database;
Block change tracking recommended: ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
Character set, national character set, time-zone file and COMPATIBLE of the target must be equal to or a superset of the source:
Encrypted (TDE) tablespaces: export the keys before cutover (see the TDE runbook) and check the 23ai Limitations on Transportable Tablespaces for cross-endian encrypted transport; decrypting before transport is the safe option.
Objects in the transported tablespaces owned by SYS/SYSTEM are not transported — move them.
SQL |
SELECT * FROM nls_database_parameters WHERE parameter IN ('NLS_CHARACTERSET','NLS_NCHAR_CHARACTERSET'); SELECT * FROM v$timezone_file; |
Step 0.5 — Target preparation
SQL |
-- target CDB23 CREATE PLUGGABLE DATABASE pdb1 ADMIN USER pdbadmin IDENTIFIED BY "Pdb#Admin2026"; ALTER PLUGGABLE DATABASE pdb1 OPEN; ALTER PLUGGABLE DATABASE pdb1 SAVE STATE;
ALTER SESSION SET CONTAINER = pdb1; CREATE DIRECTORY dp_dir AS '/u01/xtt/dp'; |
Why: the tablespaces being transported must not exist yet in PDB1 (the import plugs them in; drop the default USERS tablespace if it clashes). Users, roles and profiles that own objects must pre-exist if you use classic TTS import (Option B in Phase 4); with full transportable import (Option A) Data Pump creates them for you.
Step 0.6 — Install the driver on both hosts
Shell |
# both hosts, as oracle mkdir -p /home/oracle/xtt && cd /home/oracle/xtt unzip rman_xttconvert_VER4.3.zip # from MOS 2471245.1 export TMPDIR=/home/oracle/xtt # the driver keeps its state files here |
Why: TMPDIR is where xttdriver.pl writes res.txt, the file that carries backup metadata (SCNs, file lists) between source and target. Always copy it after every backup.
Phase 1 — Configure xtt.properties
Create /home/oracle/xtt/xtt.properties on the source and copy the identical file to the target:
SQL |
tablespaces=USERS,APP_DATA,APP_IDX,APP_LOB platformid=6 # SOURCE platform id from V$DATABASE.PLATFORM_ID src_scratch_location=/u01/xtt/src_backups # backups written here on the source dest_datafile_location=+DATA # or /u02/oradata/CDB23/PDB1 on the target dest_scratch_location=/u01/xtt/dest_backups # backups copied here on the target parallel=8 rollparallel=4 getfileparallel=4 usermantransport=1 # RMAN native cross-platform backup sets (12c+ source) |
Why: usermantransport=1 uses RMAN's own cross-platform backup sets, so the target converts endianness while restoring — no separate CONVERT step and no DBMS_FILE_TRANSFER. For an ASM target simply point dest_datafile_location at the disk group.
Phase 2 — Initial backup, transfer, restore (no downtime)
Step 2.1 — Level-0 backup on the source
Shell |
# source host export ORACLE_SID=SRCCDB export ORACLE_PDB_SID=SRCPDB # 23ai source is always a PDB: make SQL*Plus/RMAN sessions land in it export TMPDIR=/home/oracle/xtt cd $TMPDIR $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup |
Why: the driver records the checkpoint SCN of each datafile in res.txt and writes backup pieces to src_scratch_location. Tablespaces remain read-write; users notice nothing.
Step 2.2 — Transfer to the target
Shell |
rsync -av /u01/xtt/src_backups/ oracle@target:/u01/xtt/dest_backups/ scp /home/oracle/xtt/res.txt oracle@target:/home/oracle/xtt/ |
Why: both the pieces and res.txt must travel together; a stale res.txt makes the next restore fail with a checkpoint mismatch.
Step 2.3 — Restore (and convert) on the target
Shell |
# target host export ORACLE_SID=CDB23 export ORACLE_PDB_SID=PDB1 export TMPDIR=/home/oracle/xtt cd $TMPDIR $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore |
Why: datafiles are created under dest_datafile_location as foreign datafiles, already in little-endian format. They are not yet part of PDB1.
Phase 3 — Roll forward as often as needed (no downtime)
Repeat this loop until the incremental takes only a few minutes:
Shell |
# source $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup # incremental since last SCN rsync -av /u01/xtt/src_backups/ oracle@target:/u01/xtt/dest_backups/ scp /home/oracle/xtt/res.txt oracle@target:/home/oracle/xtt/
# target $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore # applies the incremental to the foreign datafiles |
Why: each cycle ships only changed blocks. Clean src_scratch_location/dest_scratch_location of pieces that were already applied to save space. Run the loop daily during the test phase and every hour on migration day.
Phase 4 — Cutover (downtime window starts)
Step 4.1 — Stop the application and freeze the source tablespaces
SQL |
-- in SRCPDB BEGIN FOR t IN (SELECT tablespace_name FROM dba_tablespaces WHERE tablespace_name IN ('USERS','APP_DATA','APP_IDX','APP_LOB')) LOOP EXECUTE IMMEDIATE 'ALTER TABLESPACE ' || t.tablespace_name || ' READ ONLY'; END LOOP; END; / |
Why: read-only guarantees no more changes; the last incremental captures everything up to this SCN.
Step 4.2 — Final incremental → transfer → restore
Shell |
# source $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup rsync -av /u01/xtt/src_backups/ oracle@target:/u01/xtt/dest_backups/ scp /home/oracle/xtt/res.txt oracle@target:/home/oracle/xtt/ # target $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore |
After this restore the driver writes an impdp template (xttplugin.txt) in $TMPDIR with the exact target datafile names — keep it for Step 4.4.
Step 4.3 — Export the metadata from the source
Option A — full transportable export (recommended: brings users, roles, PL/SQL, sequences, synonyms, DB links in one go):
Shell |
expdp system@srcpdb FULL=Y TRANSPORTABLE=ALWAYS \ DIRECTORY=dp_dir DUMPFILE=xtts_full.dmp LOGFILE=xtts_full_exp.log \ EXCLUDE=TABLE_STATISTICS,INDEX_STATISTICS |
Option B — classic tablespace metadata export (users must pre-exist on the target):
Shell |
expdp system@srcpdb DIRECTORY=dp_dir DUMPFILE=xtts_tts.dmp LOGFILE=xtts_tts_exp.log \ TRANSPORT_TABLESPACES=USERS,APP_DATA,APP_IDX,APP_LOB TRANSPORT_FULL_CHECK=Y |
Why: the dump contains only metadata; the data is already in the restored datafiles. Excluding statistics makes the import faster — you regather or import stats afterwards.
Shell |
scp /u01/xtt/dp/xtts_full.dmp oracle@target:/u01/xtt/dp/ |
Step 4.4 — Plug the tablespaces into the target PDB
Shell |
# target — datafile names come from xttplugin.txt impdp system@pdb1 FULL=Y DIRECTORY=dp_dir DUMPFILE=xtts_full.dmp LOGFILE=xtts_full_imp.log \ TRANSPORT_DATAFILES='+DATA/CDB23/PDB1/DATAFILE/users_01.dbf', \ '+DATA/CDB23/PDB1/DATAFILE/app_data_01.dbf', \ '+DATA/CDB23/PDB1/DATAFILE/app_idx_01.dbf', \ '+DATA/CDB23/PDB1/DATAFILE/app_lob_01.dbf' |
(With Option B use TRANSPORT_DATAFILES= without FULL=Y.)
Why: Data Pump registers the foreign datafiles as the tablespaces of PDB1 and recreates tables, indexes, constraints and triggers pointing at them. Expect and review ORA-39082/ORA-39083 for objects with unresolved dependencies; fix and recompile afterwards.
Step 4.5 — Open the tablespaces for writing and finish the metadata
SQL |
-- in PDB1 ALTER TABLESPACE users READ WRITE; ALTER TABLESPACE app_data READ WRITE; ALTER TABLESPACE app_idx READ WRITE; ALTER TABLESPACE app_lob READ WRITE; |
If you used Option B, now import the remaining schema objects (sequences, views, PL/SQL, synonyms, grants):
Shell |
expdp system@srcpdb SCHEMAS=app_owner,app_read CONTENT=METADATA_ONLY DIRECTORY=dp_dir DUMPFILE=schema_meta.dmp impdp system@pdb1 DIRECTORY=dp_dir DUMPFILE=schema_meta.dmp TABLE_EXISTS_ACTION=SKIP |
Phase 5 — Validation and post-migration
SQL |
-- in PDB1 @?/rdbms/admin/utlrp.sql SELECT owner, object_type, COUNT(*) FROM dba_objects WHERE status = 'INVALID' GROUP BY owner, object_type;
-- object counts vs. source (run the same query on SRCPDB and diff) SELECT owner, object_type, COUNT(*) FROM dba_objects WHERE owner IN ('APP_OWNER','APP_READ') GROUP BY owner, object_type ORDER BY 1,2;
-- tablespace state SELECT tablespace_name, status, plugged_in FROM dba_tablespaces;
-- statistics EXEC DBMS_STATS.GATHER_DATABASE_STATS(degree => 8); |
RMAN |
# physical check of every transported datafile rman target sys@pdb1 RMAN> VALIDATE TABLESPACE users, app_data, app_idx, app_lob; |
Then: recreate/verify services and tnsnames, redirect the application, take a full RMAN backup of the target, remove the scratch directories, and keep the source read-only for the agreed fallback period.
Timing template for the go-live
Step | Typical duration |
Final incremental (after hourly rolls) | 2–10 min |
Transfer + restore of final incremental | 2–10 min |
Metadata export | 5–30 min (depends on object count, not size) |
Metadata import | 10–60 min |
Validation, recompile, stats | 15–60 min |
Rehearse the whole procedure at least once against the real data volume; the metadata import is usually the surprise.
Common problems
xttdriver.pl fails with "checkpoint SCN mismatch" → res.txt on the target is older than the pieces; recopy it.
ORA-39123 ... ORA-19721: Cannot find datafile with absolute file number → TRANSPORT_DATAFILES list is incomplete or points to the wrong names; use xttplugin.txt.
ORA-39001 / ORA-39185: The transportable tablespace failure list is ... → self-contained check skipped; rerun TRANSPORT_SET_CHECK on the source.
ORA-29349: tablespace 'USERS' already exists → drop the empty tablespace of that name in the target PDB before importing.
Import hangs on IMPORT/EXPORT/... DOMAIN INDEX (Text/Spatial) → those index types need their schemas/parameters pre-created; check xtts_full_imp.log.
When to look at M5 instead
M5 (MOS 2999157.1) implements the same "RMAN incrementals + full transportable Data Pump" idea with plain RMAN scripts instead of Perl, supports the same cross-endian cases and is Oracle's recommended path for new projects targeting 19c/23ai. If you are starting from scratch and your source meets its prerequisites, read that note first; the phases in this runbook map one-to-one.
Comments