10g+: Transportable Tablespaces Across Different Platforms (Doc ID 243304.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.2.0.1 [Release 10.1 to 12.2]
Oracle Database - Standard Edition - Version 10.1.0.2 to 12.2.0.1 [Release 10.1 to 12.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

PURPOSE

Ask Questions, Get Help, And Share Your Experiences With This Article

Would you like to explore this topic further with other Oracle Customers, Oracle Employees, and Industry Experts?

Click here to join the discussion where you can ask questions, get help from others, and share your experiences with this specific article.
Discover discussions about other articles and helpful subjects by clicking here to access the main My Oracle Support Community page for Database Datawarehousing.

Introduction  介绍

This bulletin explains how tablespaces can now be transported between different OS platforms (cross-platform), as well as different RDBMS versions.  The cross-platform feature is available in 10g onwards.  This list is taken from 11.2.0.3; older RDBMS versions may contain fewer platforms.

本公告说明了现在如何在不同的OS平台(跨平台)以及不同的RDBMS版本之间传输表空间。 跨平台功能自10g起可用。 此列表摘自11.2.0.3; 较旧的RDBMS版本可能包含较少的平台。

SQL> -- This list taken from 11.2.0.3. Older RDBMS versions may contain fewer platforms.
SQL> -- The list will not contain the platform info for the database from which you are running the query.
SQL> col platform_name for a35
SQL> select * from v$transportable_platform order by platform_id; PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- ----------------------------------- --------------
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
3 HP-UX (64-bit) Big
4 HP-UX IA (64-bit) Big
5 HP Tru64 UNIX Little
6 AIX-Based Systems (64-bit) Big
7 Microsoft Windows IA (32-bit) Little
8 Microsoft Windows IA (64-bit) Little
9 IBM zSeries Based Linux Big
10 Linux IA (32-bit) Little
11 Linux IA (64-bit) Little
12 Microsoft Windows x86 64-bit Little
13 Linux x86 64-bit Little
14 Linux x86 32-bit Little
15 HP Open VMS Little
16 Apple Mac OS Big
17 Solaris Operating System (x86) Little
18 IBM Power Based Linux Big
19 HP IA Open VMS Little
20 Solaris Operating System (x86-64) Little
21 Apple Mac OS (x86-64) Little SQL> -- You can easily find the platform info for the database running the above query by using the following SQL: SQL> SELECT tp.platform_id,substr(d.PLATFORM_NAME,1,30), ENDIAN_FORMAT
FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d
WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;

The output of the query can change with version. So please use the query above to find the current support platforms.  In previous releases, the transportable tablespace feature allowed the transfer between platforms of the same architecture only.

查询的输出可以随版本而变化。 因此,请使用上面的查询查找当前的支持平台。 在以前的版本中,传输表空间功能仅允许在相同体系结构的平台之间进行传输。

SCOPE

- Publish structured data and distribute for integration on other platforms  发布结构化数据并分发以在其他平台上集成
- Distribute data from a DW environment to data marts (typically different platforms) 将数据从DW环境分发到数据集市(通常是不同的平台)
- Share read only tablespaces across heterogeneous clusters 在异构集群之间共享只读表空间
- Migrate a database from one platform to another by only rebuilding the catalog and transporting the datafiles 仅重建目录并传输数据文件即可将数据库从一个平台迁移到另一个平台

DETAILS

Steps

1. Check for restrictions 检查限制

Review the "Limitations on Transportable Tablespace Use" section in Note 371556.1.

Among other things, objects that reside in the SYSTEM tablespace and objects owned by SYS will not be transported. This includes but is not limited to users, privileges, PL/SQL stored procedures, and views.
除其他事项外,不会传输驻留在SYSTEM表空间中的对象和SYS拥有的对象。 这包括但不限于users, privileges, PL/SQL stored procedures, and views。
If you use spatial indexes, apply the solution in Note 579136.1 "IMPDP TRANSPORTABLE TABLESPACE FAILS for SPATIAL INDEX)" before continuing.

2. Prepare the database  准备数据库

Check that the tablespace will be self-contained  检查表空间是否是独立的
SQL> execute sys.dbms_tts.transport_set_check('TBS1,TBS2', true);
SQL> select * from sys.transport_set_violations;

==>These violations must be resolved before the tablespaces can be transported  必须先解决这些冲突,然后才能传输表空间

Set the tablespace to READ ONLY  将表空间设置为只读
SQL> alter tablespace TBS1 read only;
Tablespace altered.

3. Export metadata

<HP-UX> exp userid=\'/ as sysdba\' transport_tablespace=y
tablespaces=TBS1
file=tts.dmp log=exp_tts.log
statistics=none Export: Release 10.2.0.4.0 - Mon Nov 26 11:49:49 2007
... Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace TBS1 ...
. exporting cluster definitions
. exporting table definitions
. . exporting table COL_CHG
. . exporting table DATABASES
....
. . exporting table SYSUSERS
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.

Review the export log for warnings and errors and resolve issues before continuing. Failure to do so can result in data loss.
在继续之前,请查看导出日志中的警告和错误,并解决问题。 否则可能会导致数据丢失。
Datapump can be used for that purpose too:  Datapump也可以用于此目的:

expdp \'/ as sysdba\' directory=tts_dump dumpfile=tts1_dp.dmp logfile=tts_dump_log:tts.log
transport_tablespaces=TBS1 transport_full_check=y Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_02": system/******** directory=tts_datafile dumpfile=tts1.dmp logfile=tts_dump_log:tts.log transport
_tablespaces=TBS1 transport_full_check=y
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_02" successfully loaded/unloaded
***********************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_02 is:
+DATA/tts1.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_02" successfully completed at 14:00:34

Movement of data and Enabling TTS  数据移动和启用TTS

4. Check the endianness of the target database and convert, if necessary  检查目标数据库的字节序,并在必要时进行转换

Case 1: Same Endianness (Big->Big or Little->Little) 情况1:相同的字节序 (Big->Big or Little->Little)

The source platform is Sun SPARC Solaris: endianness Big
The target platform is HP-UX (64-bit): endianness Big

SQL> SELECT PLATFORM_ID , PLATFORM_NAME FROM V$TRANSPORTABLE_PLATFORM;

PLATFORM_ID PLATFORM_NAME                       ENDIAN_FORMAT
----------- ----------------------------------- --------------
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
3 HP-UX (64-bit) Big

File conversion is NOT needed for files that meet all three of the following requirements: (1) have a source and target OS with the same endianness (bitness does not matter), (2) will be imported into an RDBMS version that contains the patch for unpublished Bug 8973825 (10.2.0.5, or 11.2.0.2 and higher), and (3) do not contain undo and rollback segments.   If the fix for unpublished Bug 8973825 is not available for your target database version, then you need to use the RMAN convert feature as shown for Case 2 below.

满足以下所有三个要求的文件不需要文件转换:(1) 源和目标OS的字节序相同(位数无关紧要), (2) 将导入包含补丁程序的RDBMS版本中 对于未发布的Bug 8973825(10.2.0.5或11.2.0.2及更高版本),以及(3)不包含 undo and rollback segment。 如果未发布的Bug 8973825的修复不适用于您的目标数据库版本,则您需要使用RMAN转换功能,如下面情况2所示。

Case 2: Different Endianness (Big->Little or Little->Big)  情况2:不同的字节序 (Big->Little or Little->Big)

The source platform is Microsoft WIndows NT: endianness Little
The target platform is HP-UX (64-bit): endianness Big

If we move the files and import the tablespace:  如果我们移动文件并导入表空间:

. importing SYS's objects into SYS
IMP-00017: following statement failed with ORACLE error 1565:
"BEGIN sys.dbms_plugts.beginImpTablespace('TBS_TTS',37,'SYS',1,0,8192,2,57"
"54175,1,2147483645,8,128,8,0,1,0,8,462754339,1,1,5754124,NULL,0,0,NULL,NULL"
"); END;"
IMP-00003: ORACLE error 1565 encountered
ORA-01565: error in identifying file '/database/db1/VB2/datafile/tbs1df.dbf'
ORA-27047: unable to read the header block of file
HP-UX Error: 2: No such file or directory
Additional information: 2
ORA-06512: at "SYS.DBMS_PLUGTS", line 1540
ORA-06512: at line 1
IMP-00000: Import terminated unsuccessfully

You have to convert the files; the files can be converted on source OR on target :  您必须转换文件; 文件可以在源上转换,也可以在目标上转换:
--> locally on the SOURCE before the import step so that the files are endian compatible:  在导入步骤之前在SOURCE上本地进行,以便文件与字节序兼容

<Solaris> rman target=/

Recovery Manager: Release 10.2.0.4.0 - 64bit
connected to target database: VB2 (DBID=3287908689) RMAN> convert tablespace 'TBS1'
2> to platform="Linux IA (32-bit)"
3> db_file_name_convert='/database/db1/VB2/datafile/tbs1df.dbf',
4> '/tmp/tbs1df.dbf'; Starting backup at 26-NOV-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=8 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00006 name=/database/db1/VB2/datafile/tbs1df.dbf
converted datafile=/tmp/reposit01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Finished backup at 26-NOV-07

The converted datafile is staged in /tmp directory until it is copied to the target server.  转换后的数据文件在/tmp目录中暂存,直到将其复制到目标服务器为止。

--> remotely on the target server after having copied them on the server. 在目标服务器上将它们复制到服务器之后,在远程服务器上

Conversion on target platform is a way forward when the v$transportable_platform of the source does Not list the target platform. 当源的v$transportable_platform未列出目标平台时,在目标平台上进行转换是一种前进的方法。
When conversion is done on the target platform then CONVERT DATAFILE is used instead of CONVERT TABLESPACE, ie:  在目标平台上完成转换后,将使用CONVERT DATAFILE而不是CONVERT TABLESPACE,即:

RMAN> CONVERT DATAFILE
'/database/db1/VB2/datafile/tbs1df.dbf'
TO PLATFORM="Linux IA (32-bit)"
FROM PLATFORM="HP TRu64 UNIX"
DB_FILE_NAME_CONVERT="/database/db1/VB2/datafile/", "/tmp/";

5. Move datafiles and export dump file  移动数据文件并导出dump文件

$ ftp tts.dmp
+/database/db1/VB2/datafile/tbs1df.dbf (no conversion) --未转换

or

/tmp/tbs1df.dbf (converted file if conversion had been required)  --(如果需要转换,则转换文件)

6. Import metadata

Note: Users need to be created in the target database first with a default tablespace of an existing tablespace name.

注意:首先需要使用现有表空间作为默认表空间在目标数据库中创建用户。

$ imp userid=\'/ as sysdba\' TRANSPORT_TABLESPACE=Y
datafiles=/database/db1/VB2/datafile/tbs1df.dbf
(or /tmp/tbs1df.dbf )
file=tts.dmp log=imp_tts.log Import: Release 10.2.0.4.0 - on Mon Nov 26 03:37:20 2007 Export file created by EXPORT:V10.02.00 via conventional path
About to import transportable tablespace(s) metadata...
...
. importing SYS's objects into SYS
. importing OMWB's objects into OMWB
. . importing table "COL_CHG"
...
. . importing table "SYSUSERS"
Import terminated successfully without warnings.

Review the import log for warnings and errors and resolve issues before continuing. Failure to do so can result in data loss.
在继续之前,请查看导入日志中的警告和错误并解决问题。 否则可能会导致数据丢失。
If we exported with DataPump, import must be done with that same tool:  如果使用DataPump导出,则必须使用相同的工具进行导入

impdp \'/ as sysdba\' directory=tts_dump dumpfile=tts1_dp.dmp logfile=tts_dump_log:tts.log
transport_datafiles='/database/oradata/tbs1.dbf','/database/oradata/tts2_db1.dbf'

It's not possible to import when tablespace already exists or when target schema is not created. If users don't exist, DataPump provides an alternative by using remap_schema (for import utility we can create the schema), ie:

表空间已存在或未创建目标 schema 时,无法导入。 如果用户不存在,DataPump可以使用remap_schema提供替代方法(对于imp,我们可以创建 schema),即:

REMAP_SCHEMA=<source_user>:<target_user>

If tablespace already exists in target, we can use remap_tablespace parameter on impdp (there is no option in import but rename tablespace at source or the existing one at target).
如果目标中已经存在表空间,则可以在impdp上使用 remap_tablespace 参数(导入中没有任何选项,但在源处重命名表空间或在目标处重命名表空间)。

REMAP_TABLESPACE=(<source_tbs1>:<target_tbs1>,<source_tbs2>:<target_tbs2>,...)

7. Set the imported tablespace to READ WRITE 将导入的表空间设置为READ WRITE

Note: After the tablespaces are read write, you will want to alter your users' default tablespaces to the correct ones.

注意:对表空间进行读写后,您将需要将用户的默认表空间更改为正确的表空间。

SQL> alter tablespace reposit read write;
Tablespace altered.

8. Take a full, no-rows export of the source database and import it into the target database to create the missing objects that are not transported with TTS, such as sequences, roles, etc. 完整no-rows地导出源数据库,并将其导入目标数据库,以创建未随TTS传输的丢失对象,例如序列,角色等。

-- For traditional export, the parameter is ROWS set to N 对于传统导出,参数为ROWS设置为N

exp FULL=y GRANTS=y CONSTRAINTS=y ROWS=n

-- For Data pump export, the parameter is CONTENT set to METADATA_ONLY  对于数据泵导出,将参数CONTENT设置为METADATA_ONLY

expdp FULL=y CONTENT=metadata_only

Still have questions  还有问题

    • In case you need to move an ASM tablespace, the steps are quite similar and Note 394798.1 can help as it describes the full process. 如果您需要移动ASM表空间,则步骤非常相似, Note 394798.1 可以帮助您描述整个过程。
    • See Document 1166564.1 Master Note for Transportable Tablespaces (TTS) -- Common Questions and Issues
    • Use MOS Data Warehousing community to search for similar discussions or start a new discussion on this subject.

REFERENCES

NOTE:394798.1 - How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based
NOTE:371556.1 - How to Migrate to different Endian Platform Using Transportable Tablespaces With RMAN
NOTE:100693.1 - Getting Started with Transportable Tablespaces
NOTE:733824.1 - How To Recreate A Database Using TTS (Transportable TableSpace)
NOTE:77523.1 - Transportable Tablespaces -- An Example to Setup and Use
NOTE:243245.1 - 10G New Storage Features and Enhancements

10g+: Transportable Tablespaces Across Different Platforms (Doc ID 243304.1)的更多相关文章

  1. Master Note for Transportable Tablespaces (TTS) -- Common Questions and Issues (Doc ID 1166564.1)

    APPLIES TO: Oracle Database Cloud Exadata Service - Version N/A and laterOracle Database Cloud Servi ...

  2. Transportable tablespace on standby (Doc ID 788176.1)

    APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.1 to 10.2.0.4 [Release 10.2]Oracle ...

  3. Checklist for an RMAN Restore (Doc ID 1554636.1)

    Checklist for an RMAN Restore (Doc ID 1554636.1) APPLIES TO: Oracle Database - Enterprise Edition - ...

  4. How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based (Doc ID 394798.1)

    How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based (Doc ID 39479 ...

  5. V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245.1)

    V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245. ...

  6. 如何使用 TRANSPORTABLE = ALWAYS 将PDB移回Non-CDB (Doc ID 2027352.1)

    How to Move a PDB Back to a Non-CDB Using TRANSPORTABLE=ALWAYS (Doc ID 2027352.1) APPLIES TO: Oracle ...

  7. Step by Step Process of Migrating non-CDBs and PDBs Using ASM for File Storage (Doc ID 1576755.1)

    Step by Step Process of Migrating non-CDBs and PDBs Using ASM for File Storage (Doc ID 1576755.1) AP ...

  8. 如何通过RMAN使用传输表空间迁移到不同的Endian平台 (Doc ID 371556.1)

    How to Migrate to different Endian Platform Using Transportable Tablespaces With RMAN (Doc ID 371556 ...

  9. 11G-使用跨平台增量备份减少可移动表空间的停机时间 XTTS (Doc ID 1389592.1)

    11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 13895 ...

随机推荐

  1. easybcd误删Win10启动项,UEFI恢复引导

    参考文章https://blog.csdn.net/A_Sen_A/article/details/89545311 想给电脑安Ubuntu双系统,期间根据一些不靠谱的文章用了easybcd软件,Ub ...

  2. 利用WPF生成Q币充值二维码——扫码登录篇

    一.前言 虽然腾讯官方不支持使用二维码充值Q币,但对于喜欢钻研的人来说这不是问题,本文利用WPF技术讲解从扫码登录到生成Q币充值二维码的一整套解决方案. 因为充值Q币需要先用QQ号登录官网.所以我们首 ...

  3. jquery.i18n 网站呈现各国语言

    在做网站的时候可能会遇到不同语言切换的问题,实现的方法有很多种,本篇文章按照 js 加载的方法的来实现. 应用到的 js 文件: jquery.i18n.properties.js jquery.js ...

  4. 记一次ES查询数据突然变为空的问题

    基本环境 elasticsearch版本:6.3.1 客户端环境:kibana 6.3.4.Java8应用程序模块. 其中kibana主要用于数据查询诊断和查阅日志,Java8为主要的客户端,数据插入 ...

  5. Selenium环境要配置浏览器驱动

    1.浏览器环境变量添加到path 2.将浏览器相应的驱动.exe复制到浏览器目录 3.这条就是让我傻逼似的配置一上午的罪魁祸首:将驱动.exe复制到python目录!!!! Selenium

  6. 对Python中一些“坑”的总结及技巧

    一.赋值即定义 1.运行以下代码会出现报错 #!/usr/bin/env python #_*_conding:utf-8_*_ x = 100 def outer(): def inner(): x ...

  7. Zabbix理论知识

    Zabbix 什么是Zabbix? Zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. Zabbix作用 Zabbix能够监视各种服务器的健康性.网络的稳定性 ...

  8. vue - Error: Can't resolve '@/assets/img/github.svg (vue-cli3.0,无法解析.svg图片,已解决)

    用vue脚手架(vue-cli3.0)生成的目录,无法解析.svg图片的问题 <img src="@/assets/img/github.svg" alt="git ...

  9. react学习之弹出层

    react的弹出层不同于以往的DOM编程,我们知道,在DOM中,弹出层事件绑定在对应的节点上即可,但是在react中,往往只能实现父子之间的传递控制,显然,弹出层的层级不符合此关系. 在这里我们需要使 ...

  10. 搭建虚拟机+静态IP+XShell管理虚拟机+jdk+tomcat热部署

    第一步:搭建虚拟机 大家可以参考http://blog.csdn.net/u012453843/article/details/68947589这篇博客进行学习 第二步:配置静态IP并且要能上网 大家 ...