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
- Download
rman_xttconvert_VER4.3.zip
from Oracle Support or use the package provided by Oracle. - 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
- Create the same directory on both source and target systems for storing backups and migration data:
mkdir -p /home/oracle/xtts
- 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.
Create the
xtt.properties
file on the source system (/home/oracle/xtts/xtt.properties
):propertiesSOURCE_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 (useSELECT * FROM v$transportable_platform;
to find this for your platform).ASM_HOME
andASM_SID
: Only needed if using ASM.
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:
Log in as Oracle user and set the environment:
export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
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 inxtt.properties
.
Step 5: Move Backup to Target System
Transfer the RMAN backup to the target system (Linux):
scp /home/oracle/xtts/backups/* oracle@<target_ip>:/home/oracle/xtts/backups/
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
Log in to the target (Linux) system as Oracle user.
Set TMPDIR for restoration:
export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
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.
Take incremental backups on the source system:
export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
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/
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:
Gather dictionary stats for faster Data Pump export:
EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
Set tablespaces to read-only to prevent further changes:
ALTER TABLESPACE SALES READ ONLY; ALTER TABLESPACE PRODUCTS READ ONLY;
Perform the final incremental backup:
export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
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
Log in to the target system and set TMPDIR:
export TMPDIR=/home/oracle/xtts cd /home/oracle/xtts
Restore the final incremental backup:
$ORACLE_HOME/perl/bin/perl xttdriver.pl --restore
Step 10: Final Steps to Complete Migration
Open the tablespaces on the target system:
ALTER TABLESPACE SALES READ WRITE; ALTER TABLESPACE PRODUCTS READ WRITE;
Verify the target system to ensure data integrity:
SELECT tablespace_name, status FROM dba_tablespaces;
Test the application connected to the target database for functionality and performance.
Step 11: Clean Up
Remove the read-only mode for the
USERS
tablespace on the source:ALTER TABLESPACE USERS READ WRITE;
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