Saturday, January 26, 2008

Transportable TBS - Part 1


Assumptions
* Tablespace name=TTBS
* Same platform (source and target)

Source Machine
1. check tablespace is transprtable
a. execute this procedure
exec dbms_tts.transport_set_check=('ttbs',true);

b. check for any violations
select * from transport_set_violations;

2. Make tablespace read only
alter tablspace ttbs read only;

3. Identify the datafiles
select file_name
from dba_data_files
where tablespace_name='TTBS';

4. Export tablespace's metadata
expdp directory=dump1
dumpfile=expdp_ttbs.dmp
transportable_tablespace=ttbs

logfile=expdp_ttbs.log
job_name=j1

5. Copy datafile and export dump file to new location cp /home/oracle/dba01/ttbs1.dbf /temp/ttbs1.dbf cp /home/oracle/dpump1/expdp_ttbs.dmp /temp/expdp_ttbs.dmp

6. Make the tablespace read write
alter tablespace ttbs read write;

Target Machine

1. Import metadata
impdp directory=dump2
dumpfile=expdp_ttbs.dmp
transport_datafiles=/temp/ttbs1.dbf

logfile=impdp_ttbs.log
job_name=j2

2. Make tablespace read write
alter tablespace ttbs read write;

No comments: