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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to move a datafile from file system to ASM
  2. Oracle database – How to create pfile or spfile using the current parameters
  3. Script/Queries to Monitor Temporary (TEMP) Tablespace Usage in Oracle Database
  4. How to limit access to oracle database so that only 1 user per schema is connected ( 1 Concurrent user per schema)
  5. RMAN Restore/Duplicate Performs Implicit Crosschecking and Cataloging
  6. How To Change SYS user password for oracle database instance
  7. How to Create Undo Tablespace for a Newly Added RAC Instance (ORA-30012)
  8. Oracle 11g new feature – ASM Fast Rebalance
  9. New Connections to the Database lead to ORA-12518 or TNS-12518
  10. Oracle Database : Understanding Dead Connection Detection, Resource Limits, V$SESSION, V$PROCESS and OS processes

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • What Is Oracle Key Vault
  • Auditing with Oracle Database Vault Reports
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary