0. Preparations
-- Create the transferred tablespace
SQL> create tablespace tbs_single
Datafile 'C: \ Oracle \ oradata \ ora9i \ tbs_single01.dbf' size 100 M
Extent management local;
-- Create a user and use the tablespace as the default tablespace
SQL> create user tranp identified by oracle default tablespace tbs_single;
SQL> grant connect, resource to tranp;
-- Create a table in the tablespace for testing.
SQL> create table tranp. t01 as select * from sys. dba_objects;
1. Check the source and target platforms for Endianness
On the source database platform:
SQL> SELECT d. PLATFORM_NAME, ENDIAN_FORMAT
2 from v $ TRANSPORTABLE_PLATFORM. tp, V $ DATABASE d
3 WHERE tp. PLATFORM_NAME = d. PLATFORM_NAME;
PLATFORM_NAME ENDIAN_FORMAT
--------------------------------------------------
Microsoft Windows IA (32-bit) Little
On the target database platform:
SQL> SELECT d. PLATFORM_NAME, ENDIAN_FORMAT
From v $ TRANSPORTABLE_PLATFORM. tp, V $ DATABASE d
WHERE tp. PLATFORM_NAME = d. PLATFORM_NAME;
PLATFORM_NAME ENDIAN_FORMAT
--------------------------------------------------
Linux IA (32-bit) Little
Since the source and target platforms have the same Endianness, you can skip convert.
2. Check whether the tablespace is self-contained
SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK ('tbs _ sing', true );
The PL/SQL process is successfully completed.
SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;
Unselected row
It indicates that the tablespace is self-contained.
3. Generate a tablespace set for Transmission
Create directory object
SQL> create DIRECTORY tranp_dir as 'C: \ soft ';
The directory has been created.
SQL> grant read, write on DIRECTORY tranp_dir to public;
Authorization successful.
Set the tablespace to read-only.
SQL> alter tablespace tbs_single read only;
The tablespace has been changed.
Use a Data Pump to export the metadata of the transmitted tablespace
Note: If the Endianness is inconsistent, you also need to use RMAN to convert the tablespace data files.
4. Transfer the tablespace set
Transfers the tablespace data files and exported DMP files to the target database platform.
5. Import tablespace
Create directory objects and users in the target database.
SQL> create directory tranp_dir as '/home/oracle ';
Directory created.
SQL> grant read, write on directory tranp_dir to public;
Grant succeeded.
SQL> create user tranp identified by oracle;
User created.
SQL> grant connect, resource to tranp;
Grant succeeded.
Use the database pump to import it to the target database.
[Oracle @ ocmu ~] $ Impdp system/oracle dumpfile = TBSINGLE. DMP directory = tranp_dir transport_datafiles =/u01/app/oracle/oradata/PROD/TBS_SINGLE01.DBF remap_schema = tranp: tranp
Import: Release 10.2.0.1.0-Production on Thursday, 30 August, 2012 23:40:25
Copyright (c) 2003,200 5, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYSTEM ". "SYS_IMPORT_TRANSPORTABLE_01": system/********* dumpfile = TBSINGLE. DMP directory = tranp_dir transport_datafiles =/u01/app/oracle/oradata/PROD/TBS_SINGLE01.DBF remap_schema = tranp: tranp
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM". "SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 23:40:29
Set the imported tablespace to read write.
SQL> alter tablespace TBS_SINGLE read write;
Tablespace altered.