• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Oracle Database 12.2 RMAN Cross Platform Tablespace Transport Over Network

by admin

Oracle Database 12.1 introduced cross platform data transport using backup-sets. We could perform database/tablespace backups using FOR TRANSPORT/TO PLATFORM clause and restore the same to a different OS Platform. This typically involved 3 steps: create backup on source, copy backup-piece to destination and perform restoration on destination.

Starting from 12.2, we can perform cross platform transport of datafiles directly over the network using the FROM SERVICE clause along with the RESTORE FOREIGN DATAFILE command. This command internally performs a cross platform backup of the requested datafiles on the source, the backup-piece chunks are transferred to the destination over network and restoration is performed on destination.

Below steps demonstrate a cross platform transport of tablespace EXAMPLE from source platform AIX (Big Endian) to destination Linux (Little Endian):

1. On source, check the datafiles which belong to tablespace EXAMPLE:

SQL> select FILE_ID from DBA_DATA_FILES where TABLESPACE_NAME='EXAMPLE';

FILE_ID
----------
2

2. On destination, perform a cross platform restore of datafiles belonging to source tablespace EXAMPLE using FROM SERVICE clause:

$ rman target sys/oracle@DEST122

RMAN> restore foreign datafile 2
2> format '/u01/app/oracle/oradata/DEST122/example01.dbf'
3> from service SRC122;

We can perform the migration using consistent or inconsistent backups. If using consistent backup, put the tablespace EXAMPLE in READ ONLY mode before running above restore command. If using inconsistent backups, the tablespace can remain in READ WRITE mode while performing an initial restore.

3. If above restoration was done with tablespace in READ ONLY mode, then recovery is not required. You can skip to the next step i.e. step# 4. However, if restoration was done with tablespace in READ WRITE mode, then we need to perform recovery. This can also be done directly over the network. Multiple recovery attempts can be performed while the source tablespace is in READ WRITE mode to sync it with the latest changes being done on source.

$ rman target sys/oracle@DEST122

RMAN> recover foreign datafilecopy '/u01/app/oracle/oradata/DEST122/example01.dbf'
2> from service SRC122;

Before, performing final recovery, put source tablepace in READ ONLY mode

SQL> alter tablespace EXAMPLE read only;

And, perform a final recovery on destination

$ rman target sys/oracle@DEST122

RMAN> recover foreign datafilecopy '/u01/app/oracle/oradata/DEST122/example01.dbf'
2> from service SRC122;

4. We now have a consistent datafile on the destination but it’s not yet plugged into the destination database. For this, we need to perform metadata export on the source and metadata import in the destination. We can also combine these 2 steps using the network_link option of impdp. For this, create a database link in the destination database pointing to the source database:

SQL> create public database link SRC122 connect to system identified by oracle using 'SRC122';

And then, perform the metadata import:

$ impdp system/password network_link=SRC122 transport_tablespaces=EXAMPLE transport_datafiles='/u01/app/oracle/oradata/DEST122/example01.dbf'

Filed Under: oracle, oracle 12c

Some more articles you might also be interested in …

  1. Shell Script to run DataPump Import Export
  2. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  3. Oracle GoldenGate: How to start Extract & Replicat using Shell Script
  4. Oracle RAC: How to modify private hostname, Private network IP & MTU
  5. How to check which options or features are used in the Oracle database
  6. How to pass a value from shell script to GoldenGate replicat for mapping to target table column
  7. How To Disable Advanced Analytics in Oracle Database 12c?
  8. How Do You Read the JMS File Store .DAT file
  9. Why Can I Login AS SYSDBA With Any Username and Password
  10. What is spfile in Oracle Database

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright