• 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. TSPITR fails With RMAN-06553
  2. Oracle Database 18c new feature – Scalable Sequences
  3. ASM disk addition/deletion hung with no rebalancing
  4. How To Size UNDO Tablespace For Automatic Undo Management
  5. How to Disable os-prober in CentOS/RHEL 7
  6. How to configure Partitioned Block Devices (Non-ASMLIB) And Assign Them To ASM
  7. Oracle Database: Redo log operations (Add/Drop/Change Location)
  8. RMAN ‘Duplicate From Active Database’ Feature in Oracle 11g
  9. How to shrink a Temporary Tablespace datafile in Oracle
  10. ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright