Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the complex and heterogeneous environments, when the data volume is high you can consider using transportable tablespace for the data instantiation. The tablespace is required to be switched to read-only mode therefore you can use this option if outage on source database is acceptable otherwise you can create a duplicate database and use that for this task.

Dbvisit Replicate uses the SCN to mark the starting point of where to start replicating from. Only changes made from the SCN specified are replicated. Therefore, you have to get the SCN from where you want to start the replication. If you are using duplicate database then recover that database upto that SCN before using it for transportable tablespace task.  

Note

Transportable tablespace feature can only be used on Oracle Enterprise Edition.


Example: 

No Format
bgColorCCC
RMAN> duplicate target database to reptest1 until scn 811782

...

No Format
bgColorCCC
SQL> conn test/test
Connected.
SQL> select * from tab where tabtype='TABLE';
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
WAREHOUSES TABLE
PRODUCT_INFORMATION TABLE
PRODUCT_DESCRIPTIONS TABLE
ORDER_ITEMS TABLE
ORDERS TABLE
ORDERENTRY_METADATA TABLE
LOGON TABLE
INVENTORIES TABLE
CUSTOMERS TABLE
9 rows selected.
SQL> select round(sum(bytes/1024/1024/1024),3) SIZE_GB from user_segments;
SIZE_GB
----------
2.85
Note

If  the endian formats are different then a conversion is necessary for transporting the tablespace. It can be done using RMAN convert tablespace and convert datafile commands. In this example endian formats are identical on the source and the target.

1. Get the current SCN from source database.

No Format
bgColorCCC
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
5568749

 


2 

 

1.  Check whether tablespace is self-contained or not. We can only transport a tablespaces that is self-contained. 

No Format
bgColorCCC
SQL> EXECUTE dbms_tts.transport_set_check('DATA',TRUE);
PL/SQL procedure successfully completed.
SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;
no rows selected.

The TRANSPORT_SET_VIOLATIONS view is empty, so the tablespace data is self-contained

 

32. Set tablespace to read-only mode.  

No Format
bgColorCCC
SQL> alter tablespace data read only;
Tablespace altered.

 

3. Get the current SCN from source database.

 

No Format
bgColorCCC
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
5568749

 

4. Export the metadata of tablespace data. 

No Format
bgColorCCC
oracle@dbvldemo101[/home/oracle] expdp system/******  dumpfile=tbs_data_exp.dmp  transport_tablespaces=data  transport_full_check=y  logfile=tes_tbs_export.log
Connected to: Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
Export: Release 11.2.0.3.0 - Production on Wed Jul 10 15:40:41 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": 
system/******** dumpfile=tbs_data_exp.dmp transport_tablespaces=data transport_full_check=y logfile=tes_tbs_export.log
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
 /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/log/tbs_data_exp.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 14:07:44 

...