Using_Image_Copies

6.5 Using Image copies and RMAN switch command  to relocate an ASM tablespace to Filesystem
6.5.1 Prepare backup and check db layout
RMAN> copy datafile 4 to ‘/u01/app/ora112/oradata/DB1DUP/hh_test_copy.dbf’;
RMAN> report schema;
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
—- ——– ——————– ——- ————————
1    325      SYSTEM               YES     +BIG_DATA/db1dup/datafile/system.260.807722583
2    325      SYSAUX               NO      +BIG_DATA/db1dup/datafile/sysaux.261.807722585
3    200      UNDOTBS1             YES     +BIG_DATA/db1dup/datafile/undotbs1.259.807722585
4    125      HH_TEST              NO      +BIG_DATA/db1dup/datafile/hh_test.258.807871839

6.5.2  Relocate tables and switch to a new file location
RMAN> RUN
{
  SQL “ALTER TABLESPACE hh_test OFFLINE IMMEDIATE”;
  SWITCH DATAFILE  4
  TO DATAFILECOPY ‘/u01/app/ora112/oradata/DB1DUP/hh_test_copy.dbf’;
  RECOVER TABLESPACE hh_test;
  SQL “ALTER TABLESPACE hh_test ONLINE”;
 }

RMAN> report schema;

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
—- ——– ——————– ——- ————————
1    325      SYSTEM               YES     +BIG_DATA/db1dup/datafile/system.260.807722583
2    325      SYSAUX               NO      +BIG_DATA/db1dup/datafile/sysaux.261.807722585
3    200      UNDOTBS1             YES     +BIG_DATA/db1dup/datafile/undotbs1.259.807722585
4    125      HH_TEST              NO      /u01/app/ora112/oradata/DB1DUP/hh_test_copy.dbf

Full output from used Recovery commands !

6.5.3 Lessons learned in this session
– Use Rman switch command if you want relocate a datafile location

Leave a Reply

Your email address will not be published. Required fields are marked *