Migrate Database
Migrate Database
Feedback...
APPLIES TO:
GOAL
Starting with Oracle Database 10g, you can transport tablespaces across platforms.
In this note there is a step by step guide about how to do it with ASM datafiles and
with OS filesystem datafiles.
From 11.2.0.4, 12C and further, if converting to Linux x86-64 consider to follow
this doc:
SOLUTION
Supported platforms
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------------------- --------------
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
7 Microsoft Windows IA (32-bit) Little
10 Linux IA (32-bit) Little
6 AIX-Based Systems (64-bit) Big
3 HP-UX (64-bit) Big
5 HP Tru64 UNIX Little
4 HP-UX IA (64-bit) Big
11 Linux IA (64-bit) Little
15 HP Open VMS Little
8 Microsoft Windows IA (64-bit) Little
9 IBM zSeries Based Linux Big
13 Linux 64-bit for AMD Little
16 Apple Mac OS Big
12 Microsoft Windows 64-bit for AMD Little
17 Solaris Operating System (x86) Little
If the source platform and the target platform are of different endianness, then an
additional step must be done on either the source or target platform to convert the
tablespace being transported to the target format. If they are of the same
endianness, then no conversion is necessary and tablespaces can be transported as
if they were on the same platform.
If you see that the endian formats are different and then a conversion is
necessary for transporting the tablespace set:
RMAN> convert tablespace TBS1 to platform="Linux IA (32-bit)" FORMAT '/tmp/%U';
Then copy the datafiles as well as the export dump file to the target
environment.
o Using Datapump:
CREATE OR REPLACE DIRECTORY dpump_dir AS '/tmp/subdir';
GRANT READ,WRITE ON DIRECTORY dpump_dir TO system;
Followed by:
impdp system/password DUMPFILE=expdat.dmp DIRECTORY=dpump_dir
TRANSPORT_DATAFILES='/tmp/....','/tmp/...' REMAP_SCHEMA=(source:target)
REMAP_SCHEMA=(source_sch2:target_schema_sch2)
Using DBMS_FILE_TRANSFER
You can also use DBMS_FILE_TRANSFER to copy datafiles to another host.
In releases lower than 11.2.0.4 you need to follow the same steps specified above
for ASM files. But if the endian formats are different then you must use the
RMAN convert AFTER transfering the files. The files cannot be copied directly
between two ASM instances at different platforms.
The same example, but here showing the destination being an +ASM diskgroup:
RMAN> CONVERT DATAFILE
'/hq/finance/work/tru/tbs_31.f',
'/hq/finance/work/tru/tbs_32.f',
'/hq/finance/work/tru/tbs_41.f'
TO PLATFORM="Solaris[tm] OE (32-bit)"
FROM PLATFORM="HP TRu64 UNIX"
DB_FILE_NAME_CONVERT="/hq/finance/work/tru/", "+diskgroup"
PARALLELISM=5;
Additional Resources
Community: Database Utilities
Still have questions? Use the above community to search for similar discussions or
start a new discussion on this subject.
1. The source and target database must use the same character set and national
character set.
2. You cannot transport a tablespace to a target database in which a tablespace
with the same name already exists. However, you can rename either the
tablespace to be transported or the destination tablespace before the
transport operation.
3. Objects with underlying objects (such as materialized views) or contained
objects (such as partitioned tables) are not transportable unless all of the
underlying or contained objects are in the tablespace set.
o Review Table "Objects Exported and Imported in Each Mode" from
the Oracle Database Utilities documentation, there are several
object types that are not exported in tablespace mode.
4. If the owner/s of tablespace objects does not exist on target database, the
usernames need to be created manually before starting the transportable
tablespace import.
followed by:
expdp system/password DUMPFILE=expdat.dmp DIRECTORY=dpump_dir
TRANSPORT_TABLESPACES = TBS1,TBS2
3.
If the tablespace set being transported is not self-contained, then the
export will fail.
4. Use V$TRANSPORTABLE_PLATFORM to find the exact platform
name of target database. You can execute the following query on
target platform instance:
SELECT tp.platform_id,substr(d.PLATFORM_NAME,2,30), ENDIAN_FORMAT
FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d
WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;
9. Copy the datafile '/tmp/....dbf' into the ASM area using rman:
rman nocatalog target /
RMAN> backup as copy datafile '/tmp/....dbf' format '+DGROUPA';
Using DBMS_FILE_TRANSFER
The PUT_FILE procedure reads a local file or ASM and contacts a remote
database to create a copy of the file in the remote file system. The file that
is copied is the source file, and the new file that results from the copy is the
destination file. The destination file is not closed until the procedure
completes successfully.
Syntax:
DBMS_FILE_TRANSFER.PUT_FILE(
source_directory_object IN VARCHAR2,
source_file_name IN VARCHAR2,
destination_directory_object IN VARCHAR2,
destination_file_name IN VARCHAR2,
destination_database IN VARCHAR2);
Where: