Site icon IT Tutorial

Cross Platform Oracle 12c Migration Using Transportable Tablespace ( XTTS ) With Zero Downtime

Hi,

I will explain Cross Platform Oracle Database Migration Using Transportable Tablespace ( XTTS ) With Zero Downtime in this article.

 

You can read following article Before this article.

Oracle Database Upgrade Guide and How to Upgrade Oracle Database

 

Transportable Tablespace method can be used for Oracle database Migration and Upgrade when the operating systems of the source database and the target database are different and conversion between 32 bits and 64 bits.

When using Cross Platform Transportable Tablespaces (XTTS) to migrate database between systems that have different endian formats,
the amount of downtime required is related directly proportional to the size of the data set being moved. To reduce amount of downtime, Oracle recommend  Cross Platform Incremental Backup with Oracle 12c.

 

The high-level steps of Cross Platform Incremental Backup method are as follows.

Step 1. Initial setup

Step 2. Prepare phase (source data remains online)
2.1- Backup (level=0) of tablespaces to be transported
2.2- Transfer backup and other necessary setup files to destination system
2.3- Restore datafiles on destination system endian format

 

Step 3. Roll Forward phase (source data remains online – Repeat this phase as many times as necessary to catch destination datafile copies up to source database)
3.1- Create incremental backup on source system
3.2- Transfer incremental backup and other necessary setup files to destination system
3.3- Convert incremental backup to destination system endian format and apply the backup to the destination datafile copies
3.4- Determine next_scn for next incremental backup
3.5- Repeat steps until ready to transport the tablespace.

 

NOTE: In Version 3, if a datafile is added to the tablespace OR a new tablespace name is added to the xtt.properties file, a warning and additional instructions will be required.

Step 4. Transport phase (source data is READ ONLY)
4.1- Make tablespaces in source database READ ONLY
4.2- Repeat the Roll Forward phase one final time
 This step makes destination datafile copies consistent with source database and generates necessary export.
 Time for this step is significantly shorter than traditional XTTS method when dealing with large data because the incremental                           backup size is smaller.
4.3- Create the final incremental backup and export file for transfer to the destination

4.4- Apply last incremental backup to destination datafiles

4.5- Import Object Metadata into Destination Database

4.6- Make tablespaces in destination database READ WRITE

 

Step 5. Validation and Check after Migration

 

Step-1: Install Oracle database 12c on Target side.

If you don’t know how to install it, you can read following article.

Oracle Database 12c Step by Step Installation On Linux -3

 

After Oracle 12c software and database installation on Target side, you should upload XTTS software both Source and Target side.

You can download XTTS software ( rman-xttconvert_2.0.zip ) from this link, if you don’t have MOSC account.

 

 

Unzip rman-xttconvert_2.0.zip file as follows.

[oracle@MehmetSalihSource]$ pwd
/home/oracle/xtt

[oracle@MehmetSalihSource]$ unzip rman_xttconvert_v3.zip
Archive: rman_xttconvert_v3.zip
inflating: xtt.properties
inflating: xttcnvrtbkupdest.sql
inflating: xttdbopen.sql
inflating: xttdriver.pl
inflating: xttprep.tmpl
extracting: xttstartupnomount.sql


[oracle@MehmetSalihTarget]$ pwd
/home/oracle/xtt

[oracle@MehmetSalihTarget]$ unzip rman_xttconvert_v3.zip
Archive: rman_xttconvert_v3.zip
inflating: xtt.properties
inflating: xttcnvrtbkupdest.sql
inflating: xttdbopen.sql
inflating: xttdriver.pl
inflating: xttprep.tmpl
extracting: xttstartupnomount.sql

 

 

Display xtt.properties file and edit following parameters as follows.

 

tablespaces=DATATBS1,DATATBS2,DATATBS3,DATATBS4,DATATBS5 
platformid=13
dfcopydir=/backup_stage
backupformat=/backup_stage
stageondest=/backup_stage
storageondest=+DATA/DEVECI/datafile
backupondest=/backup_stage
parallel=8

 

You can modify these parameters’ value according to your environment.

 

Step-2:  Backup (level=0) of tablespaces to be transported as follows.

Step-2.1:   I will run backup with nohup as follows.

export TMPDIR=/home/oracle/xtt
nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup &

 

 

Step-2.2: Transfer the following Backup and tsbkupmap.txt, xttnewdatafiles.txt configuration files to the Target side.

scp DEVECI_65_tcsj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_64_tbsj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_61_tdsj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_59_tfsj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_58_tesj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_19_tasj1tk1_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_18_t9sj1tjv_1_1.bkp 192.168.63.63:/u02/dump
scp DEVECI_11_t8sj1tjv_1_1.bkp 192.168.63.63:/u02/dump

scp  tsbkupmap.txt xttnewdatafiles.txt 192.168.63.63:/u02/dump

 

 

 

Step-2.3 Restore datafiles on destination system endian format (Target Side). Set TMPDIR and run Restore with Nohup as follows.

export TMPDIR=/home/oracle/xtt
nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore &

 

 

 

Step 3. Roll Forward phase

Step 3.1- Run incremental backup with nohup on Source side as follows.

export TMPDIR=/home/oracle/xtt
nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --bkpinc &

 

 

3.2- Transfer incremental backup( 0* files) and other necessary setup files ( tsbkupmap.txt incrbackups.txt)  to destination system

scp 0* 192.168.63.64:/u02/dump
scp xttplan.txt tsbkupmap.txt incrbackups.txt 192.168.63.64:/home/oracle/xtt

 

 

3.3- Convert incremental backup to destination system endian format and apply the backup to the destination datafile copies

 

Specify new SCN for incremental backup on Source

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

 

 

Apply the Incremental backup to the destination datafile copies. Run Recover with nohup as follows.

nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --recover &

 

 

Repeat the roll forward phase 3 (3.1 – 3.3) to reduce downtime or proceed to phase 4 for final incremental backup.

 

 

Step 4. Transport phase (source data is READ ONLY)

4.1- Make tablespaces in source database READ ONLY

 

alter tablespace DATATBS1 read only;
alter tablespace DATATBS2 read only;
alter tablespace DATATBS3 read only;
alter tablespace DATATBS4 read only;
alter tablespace DATATBS5 read only;

 

4.2- Repeat the Roll Forward phase one final time. If you want to do, you can continue from Step 3.

 

4.3- Create the final incremental backup and export file for transfer to the destination.

nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --bkpexport &

 

 

Transfer export files to Target Side.

[oracle@MehmetSalihSource]$ scp `cat incrbackups.txt` oracle@MehmetSalihTarget:/stageondest
[oracle@MehmetSalihSource]$ scp xttplan.txt oracle@MehmetSalihTarget:/home/oracle/xtt
[oracle@MehmetSalihSource]$ scp tsbkupmap.txt oracle@MehmetSalihTarget:/home/oracle/xtt
[oracle@MehmetSalihSource]$ scp incrbackups.txt oracle@MehmetSalihTarget:/home/oracle/xtt

 

 

4.4- Apply last incremental backup with nohup to destination datafiles

nohup $ORACLE_HOME/perl/bin/perl xttdriver.pl --resincrdmp &

 

 

 

Object metadata export will be generated After 4.4 step. You should import these files after 4.4 Step.

 

4.5- Import Object Metadata into Destination Database as follows. Specify all datafiles belongs to transportable_tablespaces and use them in transport_datafiles parameter as follows.

 

impdp \"/ as sysdba\" directory=PUMP logfile=tts_imp.log dumpfile=impdp_Oct24_Tue_17_14_36_971.dmp
transport_datafiles='+DATAC1/GCD_TS_5.dbf','+DATAC1/DEVECI_TS_6.dbf','+DATAC1/DEVECI_TS_10.dbf',
'+DATAC1/DEVECI_TS_11.dbf','+DATAC1/DEVECI_TS_12.dbf','+DATAC1/DEVECI_TS_13.dbf','+DATAC1/DEVECI_TS_14.dbf',
'+DATAC1/DEVECI_TS_15.dbf','+DATAC1/DEVECI_TS_16.dbf','+DATAC1/DEVECI_TS_17.dbf','+DATAC1/DEVECI_TS_18.dbf',
'+DATAC1/DEVECI_TS_19.dbf','+DATAC1/DEVECI_TS_20.dbf','+DATAC1/DEVECI_TS_21.dbf','+DATAC1/DEVECI_TS_22.dbf',
'+DATAC1/DEVECI_TS_23.dbf','+DATAC1/DEVECI_TS_24.dbf','+DATAC1/DEVECI_TS_25.dbf','+DATAC1/DEVECI_TS_26.dbf',
'+DATAC1/DEVECI_TS_27.dbf','+DATAC1/DOBST_TS_7.dbf','+DATAC1/ICN_8.dbf','+DATAC1/ICN_TS_9.dbf'

 

 

4.6- Make tablespaces in destination database READ WRITE

alter tablespace DATATBS1 read write;
alter tablespace DATATBS2 read write;
alter tablespace DATATBS3 read write;
alter tablespace DATATBS4 read write;
alter tablespace DATATBS5 read write;

 

 

Step 5. Validation and Check after Migration.

RMAN> validate tablespace DATATBS1,DATATBS2,DATATBS3,DATATBS4,DATATBS5 check logical;

 

 

 

Do you want to learn LATEST XTTS, then read the following post.

Oracle XTTS – V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup

 

 

Do you want to learn Oracle Database 18c Upgrade then read the following articles

Oracle 18c RAC Database Upgrade From 12c (12.1.0.2) to 18c (18.7.0.0.0) on Full Rack Exadata -2 Manual 18c Database Upgrade

Exit mobile version