Transportable Tablespace Example
database May 23rd, 2009OTN上有两张很好的图阐述了传输表空间的工作过程,分享如下:


传输表空间通常需要考虑到如下限制(包括但不限于):
1、源库和目标库的字符集、国家字符集必须相同
2、目标库不能拥有与需要传输的表空间同名的表空间,但是在oracle10g及以上版本你可以在传输前通过”alter tablespace rename”来修改源库或目标库的表空间名称
3、如果需要传输的表空间存在Binary_Float 和Binary_Double这两种10g中引入的新的字段类型,则只能使用数据泵(expdp/impdp),因为传统的exp/imp不支持
4、Raw、Bfile、BLOB等不透明类型可以被传输,但是其Endian类型在跨平台传输中不会被转换,所以传输后必须由应用程序指定其Endian类型
5、10gR2版本开始支持传输包含XMLType的表空间,但是只能使用EXP/IMP而不是数据泵。并且使用EXP时需确定constraints和triggers参数被设置为默认的Y。
6、system、undo、sysaux、temp表空间不能被传输
7、如果源库或者目标库当中有一个使用ASM,则必须使用rman convert进行转换。
8、被传输的表空间集必须是自包含的
以下为一个具体的数据迁移示例,环境如下:
Source:
OS: Windows 2007
DB: 10.2.0.4
Target:
OS:AIX5300-03
DB:10.2.0.4
A. 分别检查源和目的OS平台及其ENDIAN
源平台:
SQL> col PLATFORM_NAME for A30
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 (64-bit) Little
目的平台:
SQL> col PLATFORM_NAME for A30
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
—————————— ————–
AIX-Based Systems (64-bit) Big
在此可以发现,源平台和目的平台ENDIAN不一致,步骤H中将描述如何进行转换。
B. 检查源库支持的转换平台类型
SQL> set pagesize 200
SQL> col platform_name for a40
SQL> select * from v$transportable_platform;
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
18 IBM Power Based Linux Big
已选择17行。
源和目的所在平台均被支持。
C. 选取独立的表空间集合
SQL> execute dbms_tts.transport_set_check(‘TS_WPSUSER,ICMLFQ32,ICMLNF32,ICMVFQ04,ICMSFQ04,ICMLSNDX,TS_WCMUSER,WCICMLFQ32,WCICMLNF32,WCICMVFQ04,WCICMSFQ04,WCICMLSNDX’, TRUE);
PL/SQL 过程已成功完成。
SQL> select * from transport_set_violations;
未选定行
说明这些表空间是自包含的。
D. 在源平台修改需要转换的表空间为read only方式
alter tablespace TS_WPSUSER read only;
alter tablespace ICMLFQ32 read only;
alter tablespace ICMLNF32 read only;
alter tablespace ICMVFQ04 read only;
alter tablespace ICMSFQ04 read only;
alter tablespace ICMLSNDX read only;
alter tablespace TS_WCMUSER read only;
alter tablespace WCICMLFQ32 read only;
alter tablespace WCICMLNF32 read only;
alter tablespace WCICMVFQ04 read only;
alter tablespace WCICMSFQ04 read only;
alter tablespace WCICMLSNDX read only;
E. 在源平台导出可传输表空间集合(TTS)
exp userid=\”sys/***** as sysdba\” transport_tablespace=y tablespaces=(TS_WPSUSER,ICMLFQ32,ICMLNF32,ICMVFQ04,ICMSFQ04,ICMLSNDX,TS_WCMUSER,WCICMLFQ32,WCICMLNF32,WCICMVFQ04,WCICMSFQ04,WCICMLSNDX) file =d:\ts.dmp ;
F. 传输表空间集合
使用操作系统方式(FTP等)传输对应的数据文件及步骤E导出的DMP文件
G. 修改源平台表空间为read write方式
H. 在目的平台转换字节顺序
CONVERT DATAFILE
‘/oradataloa/portaldb/date/TSWPSUSER.DBF’,
‘/oradataloa/portaldb/date/ICMLFQ32_01.DBF’,
‘/oradataloa/portaldb/date/ICMLNF32_01.DBF’,
‘/oradataloa/portaldb/date/ICMVFQ04_01.DBF’,
‘/oradataloa/portaldb/date/ICMSFQ04_01.DBF’,
‘/oradataloa/portaldb/date/ICMLSNDX_01.DBF’,
‘/oradataloa/portaldb/date/TSWCMUSER.DBF’,
‘/oradataloa/portaldb/date/WC_ICMLFQ32_01.DBF’,
‘/oradataloa/portaldb/date/WC_ICMLNF32_01.DBF’,
‘/oradataloa/portaldb/date/WC_ICMVFQ04_01.DBF’,
‘/oradataloa/portaldb/date/WC_ICMSFQ04_01.DBF’,
‘/oradataloa/portaldb/date/WC_ICMLSNDX_01.DBF’
TO PLATFORM=”AIX-Based Systems (64-bit)”
FROM PLATFORM=”Microsoft Windows x86 64-bit”
DB_FILE_NAME_CONVERT=’/oradataloa/portaldb/date/’,'/oradataloa/portaldb/data/’;
I. 导入可传输表空间集合
imp userid=\”sys/***** as sysdba\” transport_tablespace=y file=/oradataloa/portaldb/date/ts.dmp datafiles=’/oradataloa/portaldb/data/TSWPSUSER.DBF’,'/oradataloa/portaldb/data/ICMLFQ32_01.DBF’,'/oradataloa/portaldb/data/ICMLNF32_01.DBF’,'/oradataloa/portaldb/data/ICMVFQ04_01.DBF’,'/oradataloa/portaldb/data/ICMSFQ04_01.DBF’,'/oradataloa/portaldb/data/ICMLSNDX_01.DBF’,'/oradataloa/portaldb/data/TSWCMUSER.DBF’,'/oradataloa/portaldb/data/WC_ICMLFQ32_01.DBF’,'/oradataloa/portaldb/data/WC_ICMLNF32_01.DBF’,'/oradataloa/portaldb/data/WC_ICMVFQ04_01.DBF’,'/oradataloa/portaldb/data/WC_ICMSFQ04_01.DBF’,'/oradataloa/portaldb/data/WC_ICMLSNDX_01.DBF’
J. 打扫战场,修改目的平台表空间为read write方式。

November 6th, 2011 at 09:24
Hello Webmaster, I noticed that http://www.zhihong.org/transportable-tablespace-example.html is ranking pretty low for some keywords, this may be due to the new Google Panda update, or it could be due to a variety of other factors. I’m sure you already know about On-page SEO, where Google cares highly about proper formatting of various H1/H2/H3 tags, having your main keyword appear in the beginning of your post and having your post end with the keyword, along with having keyword related alt tags and very relevant LSI. However, you do not seem to have the proper Keywords or relevant Keywords in your posts and in the website. Right now you need a tool or plugin that will allow you to check on Keyword insights, search trends and check for backlink analysis and to find out your Keyword competition. To find a Keyword Plugin that combines both Keyword Research and has the ability as a Rank Checker is what WordPress Seo Keyword, please check out our 5 minute video.
[WORDPRESS HASHCASH] The poster sent us ’2070207104 which is not a hashcash value.
November 15th, 2011 at 10:09
Hello Webmaster, I noticed that http://www.zhihong.org/transportable-tablespace-example.html is ranking pretty low for some keywords, this may be due to the new Google Panda update, or it could be due to a variety of other factors. I’m sure you already know about On-page SEO, where Google cares highly about proper formatting of various H1/H2/H3 tags, having your main keyword appear in the beginning of your post and having your post end with the keyword, along with having keyword related alt tags and very relevant LSI. However, you do not seem to have the proper Keywords or relevant Keywords in your posts and in the website. Right now you need a tool or plugin that will allow you to check on Keyword insights, search trends and check for backlink analysis and to find out your Keyword competition. To find a Keyword Plugin that combines both Keyword Research and has the ability as a Rank Checker is what WordPress Seo Keyword, please check out our 5 minute video.
November 22nd, 2011 at 20:46
Hello Webmaster, I noticed that http://www.zhihong.org/transportable-tablespace-example.html is ranking pretty low for some keywords, this may be due to the new Google Panda update, or it could be due to a variety of other factors. I’m sure you already know about On-page SEO, where Google cares highly about proper formatting of various H1/H2/H3 tags, having your main keyword appear in the beginning of your post and having your post end with the keyword, along with having keyword related alt tags and very relevant LSI. However, you do not seem to have the proper Keywords or relevant Keywords in your posts and in the website. Right now you need a tool or plugin that will allow you to check on Keyword insights, search trends and check for backlink analysis and to find out your Keyword competition. To find a Keyword Plugin that combines both Keyword Research and has the ability as a Rank Checker is what WordPress Seo Keyword, please check out our 5 minute video.
[WORDPRESS HASHCASH] The poster sent us ’2070498176 which is not a hashcash value.