DB:11.2.0.4
OS:Oracle Linux 5.8 -> Windows Server 2003 (64bit)
参考文档:
243304.1
整理步骤(2016/2/16)
|
Source
|
Destination
|
|
1
|
依赖性检查
|
|
|
2
|
表空间只读
|
|
|
3
|
expdp
|
|
|
4
|
convert tablespace … to
|
|
|
5
|
将上2步生成的文件复制到Dest
|
|
|
6
|
|
convert datafile … from … to
|
|
7
|
|
impdp
|
|
8
|
表空间可写(可选)
|
|
源端:
1. 检查表空间依赖关系
-
execute sys.dbms_tts.transport_set_check('soe', true);
-
select * from sys.transport_set_violations;
2. 设置表空间为只读
-
alter tablespace SOE read only;
3. 用expdp导出表空间元数据(注意,反斜杠“\”一定要保留)
-
[oracle@oltp ~]$ expdp \"/ as sysdba\" dumpfile=tts1_dp.dmp logfile=tts.log transport_tablespaces=soe transport_full_check=y
-
-
Export: Release 11.2.0.4.0 - Production on Thu Jan 29 15:47:25 2015
-
-
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
-
-
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
-
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
-
Oracle Database Vault and Real Application Testing options
-
Starting \"SYS\".\"SYS_EXPORT_TRANSPORTABLE_01\": \"/******** AS SYSDBA\" dumpfile=tts1_dp.dmp logfile=tts.log transport_tablespaces=soe transport_full_check=y
-
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
-
Processing object type TRANSPORTABLE_EXPORT/TABLE
-
Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
-
Processing object type TRANSPORTABLE_EXPORT/INDEX/FUNCTIONAL_INDEX/INDEX
-
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
-
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
-
Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS
-
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
-
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
-
Processing object type TRANSPORTABLE_EXPORT/USER_PREF_STATISTICS
-
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
-
Master table \"SYS\".\"SYS_EXPORT_TRANSPORTABLE_01\" successfully loaded/unloaded
-
******************************************************************************
-
Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:
-
/u01/app/oracle/admin/oltp/dpdump/tts1_dp.dmp
-
******************************************************************************
-
Datafiles required for transportable tablespace SOE:
-
/oradata/OLTP/datafile/o1_mf_soe_bdgpq551_.dbf
-
Job \"SYS\".\"SYS_EXPORT_TRANSPORTABLE_01\" successfully completed at Thu Jan 29 15:48:09 2015 elapsed 0 00:00:39
到指定路径找到导出的文件,和表空间数据文件一道传到目标服务器上。
4. 在目标服务器上,将导出文件
tts1_dp.dmp放到一个文件夹(例如:E:\trans)下,并为之在数据库创建direcotory对象
-
CREATE DIRECTORY tts_imp AS 'E:\trans';
5.在目标服务器上,将表空间数据文件
o1_mf_soe_bdgpq551_.dbf放到数据文件目录E:\oradata\olap\DATAFILE
6. 导入表空间(
注意,表空间对象的owner必须已经提前创建,并赋予权限!)
-
impdp \"/ as sysdba\" directory=tts_imp dumpfile=tts_sh_dp.dmp logfile=tts_sh.log transport_datafiles='E:\oradata\olap\DATAFILE\o1_mf_sh_bdoyy7os_.dbf'
7. 如有必要,设置相关用户的默认表空间。
-
alter user soe default tablespace soe;
8. 将表空间设置为在线,当前应该是read only;(包括源数据库的表空间)
-
alter tablespace soe read write;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22621861/viewspace-1419810/
,如需转载,请注明出处,否则将追究法律责任。