Disclaimer

Monday, 18 November 2024

Complete Guide for Cross-Platform Transportable Tablespaces (XTTS) with Incremental Backups: AIX to Linux Migration

 

Complete Guide for Cross-Platform Transportable Tablespaces (XTTS) with Incremental Backups: AIX to Linux Migration

This is a detailed, end-to-end guide for migrating an Oracle database from AIX to Linux using Cross-Platform Transportable Tablespaces (XTTS), with incremental backups to minimize downtime. The example will cover the migration of tablespaces (SALES and PRODUCTS) and ensure a smooth, low-downtime transition.

Prerequisites

  • Oracle is installed on both source (AIX) and target (Linux) systems.
  • Both systems have enough disk space for backups and the migration process.
  • Network connectivity between source and target systems.
  • ASM (if applicable) on both source and target systems.
  • Oracle 11g/12c/19c (ensure compatibility with XTTS).



Step 1: Download and Unzip the XTTS Utility

  1. Download rman_xttconvert_VER4.3.zip from Oracle Support or use the package provided by Oracle.
  2. On the Source (AIX) system, unzip the rman_xttconvert_VER4.3.zip package:

    unzip rman_xttconvert_VER4.3.zip -d /home/oracle/xtts



Step 2: Set Up Working Directories for Backup Files

  1. Create the same directory on both source and target systems for storing backups and migration data:

    mkdir -p /home/oracle/xtts
  2. Ensure enough space for backups on both systems. You can check disk space using df -h.




Step 3: Configure xtt.properties File

The xtt.properties file contains the configuration details for the migration.

  1. Create the xtt.properties file on the source system (/home/oracle/xtts/xtt.properties):

    properties

    SOURCE_SID=ORCL_AIX TARGET_SID=ORCL_LINUX PLATFORM_NAME=AIX-Based Systems TARGET_PLATFORM_NAME=Linux x86 64-bit BACKUP_LOCATION=/home/oracle/xtts/backups TRANSFER_DIR=/home/oracle/xtts/transfer TABLESPACES=SALES,PRODUCTS TARGET_DATAFILE_LOCATION=/u01/app/oracle/oradata/ORCL_LINUX TARGET_PLATFORM_ID=13 PARALLEL=4 ASM_HOME=/u01/app/grid ASM_SID=+ASM

    Key fields:

    • TABLESPACES=SALES,PRODUCTS: Specifies the tablespaces to migrate.
    • TARGET_PLATFORM_ID=13: Specifies the Linux platform ID (use SELECT * FROM v$transportable_platform; to find this for your platform).
    • ASM_HOME and ASM_SID: Only needed if using ASM.
  2. Transfer the configuration file to the target system:


    scp /home/oracle/xtts/xtt.properties oracle@<target_ip>:/home/oracle/xtts/



Step 4: Backup the Source Database

On the source system (AIX), take a full RMAN backup for the SALES and PRODUCTS tablespaces:

  1. Log in as Oracle user and set the environment:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
  2. Run the RMAN backup command using xttdriver.pl:


    $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
    • This will create the backup files in /home/oracle/xtts/backups.
    • If your backup uses ASM, ensure the appropriate paths for ASM are set in xtt.properties.




Step 5: Move Backup to Target System

  1. Transfer the RMAN backup to the target system (Linux):


    scp /home/oracle/xtts/backups/* oracle@<target_ip>:/home/oracle/xtts/backups/
  2. Transfer the res.txt file for tracking:


    scp /home/oracle/xtts/res.txt oracle@<target_ip>:/home/oracle/xtts/



Step 6: Restore the RMAN Backup on the Target System

  1. Log in to the target (Linux) system as Oracle user.

  2. Set TMPDIR for restoration:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
  3. Run the restore command to restore the backup:


    $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore

    This command restores the backup files and converts them to the appropriate endian format if necessary.




Step 7: Perform Incremental Backups

Incremental backups minimize the lag between the source and target systems, reducing downtime.

  1. Take incremental backups on the source system:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
  2. Transfer the incremental backups and res.txt file to the target system:


    scp /home/oracle/xtts/backups/* oracle@<target_ip>:/home/oracle/xtts/backups/ scp /home/oracle/xtts/res.txt oracle@<target_ip>:/home/oracle/xtts/
  3. Restore the incremental backups on the target system:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore



Step 8: Prepare for Downtime

When the downtime window starts, follow these steps to minimize the downtime:

  1. Gather dictionary stats for faster Data Pump export:


    EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
  2. Set tablespaces to read-only to prevent further changes:


    ALTER TABLESPACE SALES READ ONLY; ALTER TABLESPACE PRODUCTS READ ONLY;
  3. Perform the final incremental backup:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
  4. Transfer the final incremental backup to the target system:


    scp /home/oracle/xtts/backups/* oracle@<target_ip>:/home/oracle/xtts/backups/




Step 9: Final Restore on the Target System

  1. Log in to the target system and set TMPDIR:


    export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
  2. Restore the final incremental backup:


    $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore





Step 10: Final Steps to Complete Migration

  1. Open the tablespaces on the target system:


    ALTER TABLESPACE SALES READ WRITE; ALTER TABLESPACE PRODUCTS READ WRITE;
  2. Verify the target system to ensure data integrity:


    SELECT tablespace_name, status FROM dba_tablespaces;
  3. Test the application connected to the target database for functionality and performance.




Step 11: Clean Up

  1. Remove the read-only mode for the USERS tablespace on the source:


    ALTER TABLESPACE USERS READ WRITE;
  2. Clean up temporary directories from both source and target systems if needed.





Important Considerations

  • Backup Size: Ensure that there is enough space to store the backups and restored data on both source and target systems.
  • Endianness Conversion: If migrating from a platform with a different endian format (e.g., AIX to Linux), XTTS handles the conversion of data files automatically.
  • Incremental Backups: Run incremental backups as often as possible before the final downtime to minimize lag and reduce downtime.
  • ASM: If using ASM on either system, make sure the proper ASM paths are set in xtt.properties.



By following this detailed guide, you'll be able to perform a Cross-Platform Transportable Tablespace (XTTS) migration with minimal downtime, ensuring a smooth transition of the SALES and PRODUCTS tablespaces from AIX to Linux.











No comments:

Post a Comment

Understanding SQL Plan Baselines in Oracle Database

  Understanding SQL Plan Baselines in Oracle Database SQL Plan Baseline is the feature in Oracle started from Database 11g that helps to pre...