Transportable Tablespaces or Full Transportable Export/Import are the common techniques you typically use when you are going to migrate larger databases from one operating system to a different one. Usually, a Endianness-change is involved. And very often you will use our M5 scripts to benefit of incremental backups to reduce the downtime. In the past weeks I learned from two customers that you need to take special care on Oracle Text when you migrate with TTS. Hence, again I need to thank you for sharing your findings with me.

What is TTS all about?
For those you are approaching such a migration, let me briefly explain how TTS (Transportable Tablespaces) or xTTS (cross-platform TTS) works. You set your data tablespaces read-only, then you migrate them to the new platform where you restore, convert and recover them. In addition, since you can’t set SYSTEM and SYSAUX tablespaces read-only, you need to move all the meta information (views, synonyms, constraints, trigger, code, privileges, roles etc) over as well.
We have features which make your life so much easier. Full Transportable Export/Import with Data Pump takes care on the tablespace metadata import, and moves all the metadata in the right order. This is available since Oracle 11.2.0.3.
Then we had PERL scripts to allow you to decrease the downtime by using incrementally rolled forward backups with a Level 0 backup at first, and then Level 1 backups taken until downtime happens – where you set your tablespaces read-only, and take the final Level 1 for consistency. Later, we added the M5 scripts which require that your source database is at least on 19.18.0 and has the Data Pump Bundle Patch in place.
You can study the whole topic in our Virtual Classroom Seminar – Episode 18 in full detail. And the slide deck you can download in addition shows you all the links, strategies, pitfalls and more. Except one – and this is the topic I am going to write about here explaining why you need to take special care on Oracle Text when you migrate with TTS.
What happens when you don’t care?
If you don’t follow these special actions, you may suffer from bad performance. And with “bad”, I mean really bad. Query runtime using Oracle Text indexes will drop from seconds to minutes if you are unlucky.
When you upgrade, you don’t need to care. During a database upgrade, all is taken care of by the Oracle Text upgrade scripts
But when you migrate from a lower version to Oracle 19c, for instance from 11.2.0.4 or 12.1.0.2 to 19c, then you need to take care. Otherwise, you will find your database doing way more logical IO, an enormous increase in buffer gets – and this is not an optimizer problem, and the hash of the plan stays the same.
The root cause
Now I need to thank Adrian who shared all the analysis and the interaction with Oracle Support with me. I hope I can put the pieces together in the right order.
The root cause for the trouble is the column TOKEN_TEXT in the internal Text table DR$<index>$I. Before 19c, the column TOKEN_TEXT is defined as a VARCHAR2(64). And in 19c, it became a VARCHAR2(255). No issue during an upgrade – but since you transport data “as is” without upgrading such structures, you end up with this column still being a VARCHAR2(64) in 19c (or any higher release). To describe this more complete, the problem is going to happen with $G and $P tables as well which all use this token size.
Why is this now problematic?
At first, an attempt to synch fails when you call CTX_DDL.SYNC_INDEX with DRG-50857: oracle error in dreii0fsh and ORA-12899: value too large for column “…DR$…$I”.”TOKEN_TEXT” (actual: 82, maximum: 64). Since the index is TRANSACTIONAL, the steadily growing DML queue does not get emptied, and every new query finds an ever increasing amount of data in the pending queue. If you try to fix this with CTX_DDL.OPTIMIZE_INDEX(…,’REBUILD’)it will fail with an ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION.
Since the SYNC operation failed, the pending queue is growing and doesn’t get emptied – and as a result you see the buffer gets increasing and increasing significantly.
The solution
Well, the customer discussed and in-place solution with Oracle Support. This would have meant to do an ALTER TABLE schema.DR$MYINDEX$I MODIFY (TOKEN_TEXT VARCHAR2(255 BYTE)); with some extra treatments. But the support engineer refused to approve this option. And the customer didn’t feel comfortable either doing it and hoping it would work fine without Oracle Support’s blessing. Furthermore, this would have been complex, too.
The only thing Oracle Support could offer is a script supnote_u1202020.sql which identifies the tables and columns but does not ALTER anything.
Therefore, the more lengthy solution seemed to be the only option: Rebuild the TEXT indexes.
This solution works – but it has one significant downside. In case your TEXT indexes are large, it takes a while to rebuild them. While this is potentially doable for a smaller database, I know databases with massive text indexes where this could eat up all the benefit from the xTTS migration. Therefore, at some point, an expdp/impdp solution may be more appropriate.
Or, you upgrade to 19c on the source platform – and then transport the database over. This has two massive advantages. At first, your TEXT index problem is gone since the indexes will be automatically adjusted correctly during the upgrade to 19c. And you have the much faster M5 scripts now to migrate the database. Of course, at the end you will have an upgrade at first, and then do a migration. But in case expdp/impdp or rebuilding the TEXT indexes is not working timely for you, I would consider this the better solution.
Isn’t there no post-TTS script available for TEXT?
This was a legit question the customer had in this case. And unfortunately, no such script exists. And I am not positive that it will be created, especially since this problem does not happen with an Oracle 19c source database but only versions below 19c.
In this particular case we found a better solution: AutoUpgrade to upgrade to 19c. Actually, there was no transport needed. And even if there would have been a transport required, then we should have had approached an upgrade to 19c, and then moved over to another operating system with xTTS when the TEXT_TOKEN columns had been extended to 255 byte already as part of the upgrade.
Further Links and Information
- M5 scripts are available for migrations to Oracle AI Database 26ai
- Transportable Tablespaces between SE2 and EE?
- Virtual Classroom Seminar – Episode 18: Cross Platform Migration – Transportable Tablespaces to the Extreme
–Mike