This is an excerpt from the bestselling book
Oracle Grid & Real Application Clusters. To get immediate
access to the code depot of working RAC scripts, buy it
directly from the publisher and save more than 30%.
A simple example:
RMAN> CONVERT
TABLESPACE ?USERS?
TO PLATFORM = ?Linux IA (32-bit)?
DB_FILE_NAME_CONVERT = ?/u02/oradata/grid/users01.dbf?,
?/dba/recovery_area/transport_linux?
Example:
Source Platform Tablespace Conversion
Suppose there is a need to
transport tablespaces RESEARCH, datafiles /oracle/oradata/rec/frec01.dbf
and /oracle/oradata/rec/rec02.dbf and PL, datafiles /oracle/oradata/rec/project01.dbf
and /oracle/oradata/rec/project02.dbf, from a source database
running on a Linux host to a destination database running on a
Windows NT 4.0 server. The plan is to store the converted datafiles
in the temporary directory tmp/oracle/transport_windows/ on the
source host.
The example assumes that the
following steps have been carried out in preparation for the
tablespace transport:
* The tablespaces to be
transported have been set to be read-only.
* Oracle's name for the
destination platform is known.
* Oracle's internal name for the
target platform will be needed. This name will be used as a
parameter to the CONVERT command. To get the platform name, use
SQL*Plus to query the view v$transportable_platform:
SQL> SELECT
PLATFORM_ID, PLATFORM_NAME, ENDIAN_FORMAT
2 FROM V$TRANSPORTABLE_PLATFORM;
PLATFORM_ID
PLATFORM_NAME
ENDIAN_FORMAT
----------- ------------------------------ --------------
1 Solaris[tm] OE (32-bit)
Big
2 Solaris[tm] OE (64-bit)
Big
3 HP-UX (64-bit)
Big
4 HP-UX IA (64-bit)
Big
5 HP Tru64 UNIX
Little
6 AIX-Based Systems
(64-bit) Big
7 Microsoft Windows NT
Little
10 Linux IA (32-bit)
Little
11 Linux IA (64-bit)
Little
To restrict the results to a
single platform type, simply add a WHERE clause such as:
WHERE
UPPER(PLATFORM_NAME) LIKE '%WINDOWS%';
The results show that the
platform_name for Windows NT is Microsoft Windows NT.
Now, RMAN would be used to
convert the datafiles to be transported to the destination host's
Linux format on the source host. The FORMAT argument controls the
name and location of the converted datafiles.
% rman TARGET
/
RMAN> CONVERT TABLESPACE research
2> TO PLATFORM 'Microsoft Windows NT'
3> FORMAT='/tmp/oracle/transport_windows/%U';
Starting
backup at 09-SEP-03
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=37 devtype=DISK
RMAN-00571:
===========================================================
RMAN-00569: ========= ERROR MESSAGE STACK FOLLOWS =========
RMAN-00571:
===========================================================
RMAN-03002: failure of backup command at 09/09/2003 13:22:57
RMAN-06598: conversion between
platforms 'Linux IA (32-bit)' and 'Microsoft Windows NT' is not
needed
So, why is it saying no
conversion is required? In the listing of platforms, the endian
setting for both Linux and NT is Little; this means their files are
compatible. If a SUN platform had been specified instead, the
results would have looked like the following:
RMAN> CONVERT
TABLESPACE research
2> TO PLATFORM 'Solaris[tm] OE (64-bit)'
3> FORMAT = '/tmp/oracle/transport_sun/%U';
Starting
backup at 09-SEP-03
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=37 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00004 name=/usr/oracle/product/10.1/oradata/aultdb1/research01.dbf
converted datafile=/tmp/oracle/transport_windows/data_D-AULTDB1_I-1051447236_TS-RESEARCH_FNO-4_02f0td2t
channel ORA_DISK_1: datafile conversion complete, elapsed time:
00:00:04
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00005 name=/usr/oracle/product/10.1/oradata/aultdb1/research01.dbf
converted datafile=/tmp/oracle/transport_windows/data_D-AULTDB1_I-1051447236_TS-RESEARCH_FNO-5_03f0td31
channel ORA_DISK_1: datafile conversion complete, elapsed time:
00:00:04
Finished backup at 09-SEP-03
The result will be a set of
converted datafiles with data in the right endian order for the
specified platform that will be located in the directory specified
by the FORMAT clause. From this point, the same procedure is
followed as for a normal tablespace transport.
The Export utility is used to
create the file of metadata information. The metadata information
file should be moved from its location and the converted datafiles
from /tmp/oracle/transport_linux/ to their respective target
directories on the destination host if it has not already been done,
then plug the tablespace(s) into the new database with the Import
utility.