How to do cross platform migration in Oracle:

Transportable Tablespaces (TTS) Overview:

Transportable Tablespaces (TTS) is an Oracle feature that allows you to move large amounts of data between Oracle databases, even across different platforms, by copying the tablespace files instead of doing a traditional export/import. This method is particularly useful for platform migrations, database consolidation, or data warehouse refreshes where minimizing downtime is crucial.

Key Benefits:

Case Study: Cross-Platform Migration using Transportable Tablespaces (TTS)

Scenario:

A company, ABC Corporation, runs an Oracle database on a Windows server, and due to cost-saving and performance reasons, they want to migrate it to a Linux environment. The database is large, and they want minimal downtime. ABC Corporation chooses Cross-Platform Transportable Tablespaces (XTTS) to migrate the data from Windows to Linux.

Problem:

Solution: Cross-Platform Transportable Tablespaces (XTTS)

Using Oracle's XTTS feature allows ABC Corporation to transport only the tablespaces of interest between Windows and Linux.

Step-by-Step Process:

Verify the endian format of the source (Windows) and target (Linux) platforms using the following query:
sql
Copy code
SELECT * FROM v$transportable_platform;


To transport the tablespaces, they must be in a read-only state:
sql
Copy code
ALTER TABLESPACE users READ ONLY;


Use Data Pump (EXPDP) to export only the metadata of the tablespaces. This contains no actual data, just the information about tablespace structures:
bash
Copy code
expdp system/password directory=dump_dir dumpfile=tts_metadata.dmp logfile=tts_export.log transport_tablespaces=users


If the endian format is different (as it usually is between Windows and Linux), use RMAN on the target (Linux) platform to convert the data files:
bash
Copy code
RMAN> CONVERT DATAFILE '/windows_path/users01.dbf' 

      TO PLATFORM 'Linux x86 64-bit' 

      FROM PLATFORM 'Microsoft Windows x86 64-bit'

      DB_FILE_NAME_CONVERT ('/windows_path/','/linux_path/');


On the target system, use Data Pump (IMPDP) to import the metadata for the transported tablespaces:
bash
Copy code
impdp system/password directory=dump_dir dumpfile=tts_metadata.dmp logfile=tts_import.log transport_datafiles='/linux_path/users01.dbf'


Once the tablespaces are successfully transported and attached, switch the tablespaces to read-write mode:
sql
Copy code
ALTER TABLESPACE users READ WRITE;


On the source system, if necessary, set the tablespaces back to read-write (if still in use):
sql
Copy code
ALTER TABLESPACE users READ WRITE;


Conclusion:

Using Transportable Tablespaces, ABC Corporation was able to migrate their Oracle database from Windows to Linux with minimal downtime and effort, avoiding the lengthy full export/import process. The XTTS method not only saved time but also ensured data integrity and efficient resource use.


Key Points to Remember: