转://RMAN跨平台可传输表空间和数据库
参考链接:
http://blog.itpub.net/23135684/viewspace-776048/
http://blog.sina.com.cn/s/blog_69e7b8d7010164xh.html
https://www.2cto.com/database/201311/260446.html
这篇文章翻译自Oracle 11gR2官方文档。详细讨论了使用RMAN工具的CONVERT DATAFILE,CONVERT TABLESPACE和CONVERT DATABASE命令实现跨平台传输表空间和数据库。
27 Transporting Data Across Platforms
Youcan use RMAN to transport tablespaces across platforms with different endian formats. You can also use RMAN to transport an entire database to a different platform so long as the two platforms have the same endian format.
你可以使用RMAN在具有不同字节序序列的平台之间传输表空间。 你也可以使用RMAN传输整个数据库到不同的平台,只要这两个平台具有相同的字符串格式即可。
Overview of Cross-Platform Data Transportation
Purpose of Cross-Platform Data Transportation
你可以将在一个平台上运行的数据库中的表空间传输到在不同平台上运行的数据库。跨平台可运输表空间的典型用途包括:
- Publishing structured data as transportable tablespaces for distribution to customers, who can convert the tablespaces for integration into their existing databases regardless of platform
- Moving data from a large data warehouse server to data marts on smaller computers such as Linux-based workstations or servers
- Sharing read-only tablespaces across a heterogeneous cluster in which all hosts share the same endian format
· 将结构化数据作为可传输表空间发布给客户,无论平台如何,可将表空间转换为现有数据库进行集成
· 将数据从大型数据仓库服务器移动到较小型计算机(如基于Linux的工作站或服务器)上的数据集市
· 在异构集群中共享只读表空间,其中所有主机共享相同的端格式
你可以在目标主机或源主机上转换数据库。 在目的主机上转换的原因包括:
- Avoiding performance overhead on the source host due to the conversion process
- Distributing a database from one source system to multiple recipients on several different platforms
- Evaluating a migration path for a new platform
Basic Concepts of Cross-Platform Data Transportation
Tablespace and Data File Conversion
Files automatically transported to the destination platform include:
通常,初始化参数文件中的一些参数需要手动更新新的数据库。例如,您可以更改DB_NAME和参数(如CONTROL_FILES),以指示目标主机上文件的位置。
Performing Cross-Platform Tablespace Conversion on the Source Host(在源主机中执行跨平台表空间传输)
To perform cross-platform tablespace conversion on the source host:
在源主机上执行跨平台表空间转换:
- Start SQL*Plus and connect to the source database prod_source with administrator privileges.
启动SQL * Plus,并以管理员权限连接到源数据库prod_source。
- Query the name for the destination platform in the V$TRANSPORTABLE_PLATFORM view.
The database has a list of its own internal names for each platform supporting cross-platform data transport. You may need the exact name of the source or destination platform as a parameter to the CONVERT command. Query V$TRANSPORTABLE_PLATFORM to get the platform names. The following example queries Linux platform names:
在V $ TRANSPORTABLE_PLATFORM视图中查询目标平台的名称。
数据库具有支持跨平台数据传输的每个平台的自己内部名称的列表。 你可能需要源平台或目标平台的确切名称作为CONVERT命令的参数。 查询V $ TRANSPORTABLE_PLATFORM以获取平台名称。 以下示例查询Linux平台名称:
SELECT PLATFORM_ID, PLATFORM_NAME, ENDIAN_FORMAT
FROM V$TRANSPORTABLE_PLATFORM
WHERE UPPER(PLATFORM_NAME) LIKE '%LINUX%';
The PLATFORM_NAME for Linux on a PC is Linux IA (32-bit).
- Place the tablespaces to be transported in read-only mode. For example, enter:
将待传输的表空间放置在只读模式。
ALTER TABLESPACE finance READ ONLY;
ALTER TABLESPACE hr READ ONLY;
- Choose a method for naming the output files.
You must use the FORMAT or DB_FILE_NAME_CONVERT arguments to the CONVERT command to control the names of the output files. The rules are listed in order of precedence:
你必须使用CONVERT命令的FORMAT或DB_FILE_NAME_CONVERT参数来控制输出文件的名称。 规则按优先顺序列出:
- Files that match any patterns provided in CONVERT ... DB_FILE_NAME_CONVERT clause are named based upon this pattern.
- If you specify a FORMAT clause, then any file not named based on patterns provided in CONVERT ... DB_FILE_NAME_CONVERT clause is named based on the FORMAT pattern.
如果指定了FORMAT子句,则根据CONVERT ... DB_FILE_NAME_CONVERT子句中提供的模式未命名的任何文件都将基于FORMAT模式进行命名。
Note:
You cannot use CONVERT ... DB_FILE_NAME_CONVERT to generate output file names for the CONVERT command when the source and destination files have Oracle Managed File names.
当源文件和目标文件具有Oracle托管文件名时,不能使用CONVERT ... DB_FILE_NAME_CONVERT为CONVERT命令生成输出文件名。
- Start RMAN and connect to the source database (not the destination database) as TARGET. For example, enter:
% rman
RMAN> CONNECT TARGET SYS@prod_source
- Run the CONVERT TABLESPACE command to convert the data files into the endian format of the destination host.
In the following example, the FORMAT argument controls the name and location of the converted data files:
RMAN> CONVERT TABLESPACE finance,hr
2> TO PLATFORM 'Linux IA (32-bit)'
3> FORMAT '/tmp/transport_linux/%U';
The result is a set of converted data files in the /tmp/transport_linux/ directory, with data in the correct endian format for the Linux IA (32-bit) platform.
- Follow the rest of the general outline for transporting tablespaces:
- Use the Oracle Data Pump Export utility to create the export dump file on the source host.
- Move the converted data files and the export dump file from the source host to the desired directories on the destination host.
- Plug the tablespace into the new database with the Import utility.
- If applicable, place the transported tablespaces into read/write mode.
使用Oracle 数据泵在源主机上创建导出转储文件。
将转换的数据文件和导出转储文件从源主机移动到目标主机上的所需目录。
使用导入程序将表空间插入新数据库。
如果适用,将传输的表空间设置为读/写模式。
Performing Cross-Platform Data File Conversion on the Destination Host(在目标主机中执行跨平台数据文件传输)
About Cross-Platform Data File Conversion on the Destination Host
你必须使用CONVERT命令的FORMAT或DB_FILE_NAME_CONVERT参数来控制命名输出文件。规则按优先顺序列出:
- Files that match any patterns provided in CONVERT ... DB_FILE_NAME_CONVERT clause are named based upon this pattern.
- If you specify a FORMAT clause, then any file not named based on patterns provided in CONVERT ... DB_FILE_NAME_CONVERT clause is named based on theFORMAT pattern.
与CONVERT中提供的任何模式匹配的文件... DB_FILE_NAME_CONVERT子句根据此模式命名。
如果指定FORMAT子句,则根据CONVERT ... DB_FILE_NAME_CONVERT子句中提供的模式未命名的任何文件都将基于FORMAT模式进行命名。
当源文件和目标文件都是Oracle托管文件时,不能使用CONVERT ... DB_FILE_NAME_CONVERT来生成CONVERT命令的输出文件名。
Using CONVERT DATAFILE to Convert Data File Formats
To perform cross-platform data file conversion on the destination host:
- Start SQL*Plus and connect to the source database prod_source with administrator privileges.
启动SQL * Plus,并以管理员权限连接到源数据库prod_source。
- Query the name for the source platform in V$TRANSPORTABLE_PLATFORM.
The database has a list of its own internal names for each platform supporting cross-platform data transport. You may need the exact name of the source or destination platform as a parameter to the CONVERT command. For example, you can obtain the platform name of the connected database as follows:
在V $ TRANSPORTABLE_PLATFORM中查询源平台的名称。
数据库具有支持跨平台数据传输的每个平台的自己内部名称的列表。 您可能需要源或目标平台的确切名称作为CONVERT命令的参数。 例如,可以如下获取连接的数据库的平台名称:
SELECT PLATFORM_NAME
FROM V$TRANSPORTABLE_PLATFORM
WHERE PLATFORM_ID =
( SELECT PLATFORM_ID
FROM V$DATABASE );
For this scenario, assume that the PLATFORM_NAME for the source host is Solaris[tm] OE (64-bit).
- Identify the tablespaces to be transported from the source database and place them in read-only mode.
将待传输的表空间放置在只读模式。
For example, enter the following SQL statements to place finance and hr in read-only mode:
ALTER TABLESPACE finance READ ONLY;
ALTER TABLESPACE hr READ ONLY;
- On the source host, use Data Pump Export to create the export dump file
In this example, the dump file is named expdat.dmp.
在源主机使用数据泵导出一个dump文件
- Make the export dump file and the data files to be transported available to the destination host.
将导出转储文件和要传输的数据文件提供给目标主机
You can use NFS to make the dump file and current database files (not copies) accessible. Alternatively, you can use an operating system utility to copy these files to the destination host.
In this example, you store the files in the /tmp/transport_solaris/ directory of the destination host. You preserve the subdirectory structure from the original location of the files, that is, the data files are stored as:
- /tmp/transport_solaris/fin/fin01.dbf
- /tmp/transport_solaris/fin/fin02.dbf
- /tmp/transport_solaris/hr/hr01.dbf
- /tmp/transport_solaris/hr/hr02.dbf
Start RMAN and connect to the destination database (not the source database) as TARGET. For example, enter the following command:
% rman
RMAN> CONNECT TARGET SYS@prod_dest
- Execute the CONVERT DATAFILE command to convert the data files into the endian format of the destination host.
执行CONVERT DATAFILE命令将数据文件转换为目标主机的字节存储顺序。
In this example, you use DB_FILE_NAME_CONVERT to control the name and location of the converted data files. You also specify the FROM PLATFORM clause.
RMAN> CONVERT DATAFILE
2> '/tmp/transport_solaris/fin/fin01.dbf',
3> '/tmp/transport_solaris/fin/fin02.dbf',
4> '/tmp/transport_solaris/hr/hr01.dbf',
5> '/tmp/transport_solaris/hr/hr02.dbf'
6> DB_FILE_NAME_CONVERT
7> '/tmp/transport_solaris/fin','/orahome/dbs/fin',
8> '/tmp/transport_solaris/hr','/orahome/dbs/hr'
9> FROM PLATFORM 'Solaris[tm] OE (64-bit)
The result is a set of converted data files in the /orahome/dbs/ directory that are named as follows:
- /orahome/dbs/fin/fin01.dbf
- /orahome/dbs/fin/fin02.dbf
- /orahome/dbs/hr/hr01.dbf
- /orahome/dbs/hr/hr02.dbf
Follow the rest of the general outline for transporting tablespaces:
- Plug the tablespace into the new database with the Import utility.
- If applicable, place the transported tablespaces into read-only mode.
使用导入程序将表空间插入新数据库。
将传送的表空间置于只读模式。
Checking the Database Before Cross-Platform Database Conversion(跨平台数据库转换之前检查数据库)
你可以使用RMAN CONVERT DATABASE命令自动将整个数据库从一个平台复制到另一个平台。
在转换数据库之前,请参阅Oracle数据库备份和恢复参考中描述的CONVERT DATABASE命令先决条件列表。确认在尝试本节中的过程之前,满足所有这些先决条件。
如果不能使用CONVERT DATABASE命令,因为平台字节存储序列不一致,那么你可以手动创建目标平台上的数据库,并使用跨平台的可移动表空间从源数据库传输所需的表空间。
当传输整个数据库时,请注意,某些文件需要进行RMAN转换才能确保与目标平台的兼容性。即使源平台和目标平台的字节存储顺序相同,这些文件也不能简单地从源文件复制到目标系统。以下类型的文件需要RMAN转换:
- Any file containing undo segments
- Any file containing automatic segment space management (ASSM) segment headers that is being transported to or from the HP Tru64 platform
· 任何包含自动段空间管理(ASSM)段头的文件,这些段头正在传输到HP Tru64平台或从HP Tru64平台传输
在源数据库以只读模式打开时,在复制文件。类似地,如果在目的地执行转换,则当源数据库以只读模式打开时,所有数据文件都应被复制到目标。
To prepare for database conversion:
- Start a SQL*Plus session as SYSDBA on the source database.
以SYSDBA的权限使用SQl*Plus连接到源数据库
- Open the database in read-only mode.
以只读模式打开数据库
ALTER DATABASE OPEN READ ONLY;
- Ensure that server output is on in SQL*Plus.
For example, enter the following SQL*Plus command:
SET SERVEROUTPUT ON
- Execute the DBMS_TDB.CHECK_DB function.
执行DBMS_TDB.CHECK_DB函数
This check ensures that no conditions would prevent the transport of the database, such as incorrect compatibility settings, in-doubt or active transactions, or incompatible endian formats between the source platform and destination platform.
此检查确保没有条件会阻止数据库的传输,例如不正确的兼容性设置,无效或活动事务,或源平台和目标平台之间不兼容的字节存储顺序。
You can call CHECK_DB without arguments to see if a condition at the source database prevents transport. You can also call this function with the arguments shown in Table 27-1.
可以调用CHECK_DB而不用参数来查看源数据库中的条件是否阻止传输。还可以使用表27-1所示的参数调用此函数。
Table 27-1 CHECK_DB Function Parameters
Parameter |
Description |
target_platform_name |
The name of the destination platform as it appears in the V$DB_TRANSPORTABLE_PLATFORM view. This parameter is optional, but is required when the skip_option parameter is used. If omitted, it is assumed that the destination platform is compatible with the source platform, and only the conditions not related to platform compatibility are tested. |
skip_option |
Specifies which, if any, parts of the database to skip when checking whether the database can be transported. Supported values (of type NUMBER) are: <span "="">o SKIP_NONE (or 0), which checks all tablespaces <span "="">o SKIP_OFFLINE (or 2), which skips checking data files in offline tablespaces <span "="">o SKIP_READONLY (or 3), which skips checking data files in read-only tablespaces |
Example 27-1 illustrates executing CHECK_DB on a 32-bit Linux platform for transporting a database to 32-bit Windows, skipping read-only tablespaces.
验证在32位Linux平台上执行CHECK_DB,用于将数据库传输到32位Windows,并跳过只读表空间。
Example 27-1 Executing DBMS_TDB.CHECK_DB
DBMS_TDB.CHECK_DB('Microsoft Windows IA (32-bit)',DBMS_TDB.SKIP_READONLY);
PL/SQL procedure successfully completed.
如果没有出现警告,或DBMS_TDB.CHECK_DB返回TRUE,则可以传输数据库。 继续步骤6。
如果出现警告,或DBMS_TDB.CHECK_DB返回FALSE,则无法传输数据库。 继续步骤5。
检查输出以了解为什么无法传输数据库,如果可能的话可以解决问题,然后返回到步骤4.有关条件的信息,请参阅DBMS_TDB文档。
执行DBMS_TDB.CHECK_EXTERNAL函数来识别任何外部表,目录或BFILE。 RMAN无法自动传输这些文件,因此你必须手动复制文件并重新创建数据库目录。
Example 27-2 shows how to call the DBMS_TDB.CHECK_EXTERNAL function.
Example 27-2 Executing DBMS_TDB.CHECK_EXTERNAL
/* value of external is ignored, but with SERVEROUTPUT set to ON
* dbms_tdb.check_external displays report of external objects
external := DBMS_TDB.CHECK_EXTERNAL;
如果没有外部对象存在,那么该过程完成,没有输出。 但是,如果存在外部对象,则输出类似于以下内容:
PL/SQL procedure successfully completed.
Converting Data Files on the Source Host When Transporting a Database(在传输数据库时转换源主机上的数据文件)
Assume that you want to convert a database running on Solaris to a database that runs on Windows.
假设要将在Solaris上运行的数据库转换为在Windows上运行的数据库。
To convert the database on the source platform:
- Open the source database in read-only mode.
ALTER DATABASE OPEN READ ONLY;
- Start RMAN and connect to the source database as TARGET. For example, enter the following commands:
% rman
RMAN> CONNECT TARGET SYS@source_db
- Run the CONVERT DATABASE command.
Example 27-3 shows a CONVERT DATABASE command (sample output included). The TRANSPORT SCRIPT parameter specifies the location of the generated SQL script that you can use to create the new database. The TO PLATFORM parameter indicates the platform of the destination database. TheDB_FILE_NAME_CONVERT parameter specifies the naming scheme for the generated data files.
例27-3显示CONVERT DATABASE命令(包括样本输出)。 TRANSPORT SCRIPT参数指定可用于创建新数据库的生成的SQL脚本的位置。 TO PLATFORM参数指示目标数据库的平台。 DB_FILE_NAME_CONVERT参数指定生成的数据文件的命名方案。
Example 27-3 Converting a Database on the Source Host
3> TRANSPORT SCRIPT '/tmp/convertdb/transportscript.sql'
4> TO PLATFORM 'Microsoft Windows IA (32-bit)'
5> DB_FILE_NAME_CONVERT '/disk1/oracle/dbs' '/tmp/convertdb';
External table SH.SALES_TRANSACTIONS_EXT found in the database
Directory SYS.DATA_PUMP_DIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.LOG_FILE_DIR found in the database
BFILE PM.PRINT_MEDIA found in the database
User SYS with SYSDBA and SYSOPER privilege found in password file
User OPER with SYSDBA privilege found in password file
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00001 name=/disk1/oracle/dbs/tbs_01.f
converted datafile=/tmp/convertdb/tbs_01.f
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00002 name=/disk1/oracle/dbs/tbs_ax1.f
converted datafile=/tmp/convertdb/tbs_ax1.f
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00016 name=/disk1/oracle/dbs/tbs_52.f
converted datafile=/tmp/convertdb/tbs_52.f
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Run SQL script /tmp/convertdb/transportscript.sql on the destination platform
Edit init.ora file init_00gb3vfv_1_0.ora. This PFILE will be used to
create the database on the destination platform
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on
To change the internal database identifier, use DBNEWID Utility
CONVERT DATABASE完成后,可以以读写的方式打开源数据库。
将CONVERT DATABASE生成的数据文件移动到目标主机上所需的位置。
在例27-3中,该命令将在源主机上的/ tmp / convertdb /目录中创建文件。 将这些文件移动到将包含目标数据库文件的目标主机上的目录。
如果数据文件的路径在目标主机上不同,则编辑传输脚本以引用新的数据文件位置。
当数据库移动到目标平台时,你应该编辑初始化参数文件顶部的多个条目。 例如,初始化参数文件可能如下所示:
在例27-3中,传输脚本命名为/tmp/convertdb/transportscript.sql。 您可以在目标主机上运行此脚本来创建数据库。 因此,您必须使用数据文件的正确名称编辑此脚本。
在目标主机上,启动SQL * Plus,并使用操作系统身份验证以SYSDBA连接到目标数据库实例。
For example, connect as follows:
如果你选择不使用操作系统身份验证,则必须首先配置Oracle Net文件,创建密码文件,然后启动侦听器。 然后,您可以使用网络服务名称连接到实例。
在SQL * Plus中执行传输脚本,以在目标主机上创建新的数据库。
When the transport script finishes, the creation of the new database is complete.
Converting Data Files on the Destination Host When Transporting a Database(在传输数据库时转换目标主机上的数据文件)
Perform the data file conversion in the following phases:
- Performing Preliminary Data File Conversion Steps on the Source Host
- Converting Data Files on the Destination Host
Performing Preliminary Data File Conversion Steps on the Source Host
在此过程中,你可以在源主机上执行CONVERT DATABASE命令。 此命令生成一个初始化参数文件和脚本,你可以编辑该脚本以在目标主机上使用。你还将未转换的数据文件从源主机复制到目标主机。
To perform preliminary data file conversion steps on the source host:
- Ensure that the database is open in read-only mode.
确保数据库是以只读方式打开
- Start RMAN and connect to the source database as TARGET.
For example, enter the following commands:
% rman
RMAN> CONNECT TARGET SYS@source_db
- Run the CONVERT DATABASE ON DESTINATION PLATFORM command.
Example 27-4 shows a sample CONVERT DATABASE command (sample output included). The ON DESTINATION PLATFORM parameter specifies that any CONVERTcommands required for data files should be performed on the destination platform rather than the source platform. The FORMAT parameter specifies the naming scheme for the generated files.
示例27-4显示了一个示例CONVERT DATABASE命令(包括样本输出)。 ON DESTINATION PLATFORM参数指定在目标平台而不是源平台上执行数据文件所需的任何CONVERT命令。 FORMAT参数指定生成的文件的命名方案。
Example 27-4 Executing CONVERT DATABASE ON DESTINATION PLATFORM
3> CONVERT SCRIPT '/tmp/convertdb/convertscript-target'
4> TRANSPORT SCRIPT '/tmp/convertdb/transportscript-target'
6> FORMAT '/tmp/convertdb/%U';
using target database control file instead of recovery catalog
channel ORA_DISK_1: sid=39 devtype=DISK
External table SH.SALES_TRANSACTIONS_EXT found in the database
Directory SYS.DATA_PUMP_DIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.LOG_FILE_DIR found in the database
BFILE PM.PRINT_MEDIA found in the database
User SYS with SYSDBA and SYSOPER privilege found in password file
User OPER with SYSDBA privilege found in password file
channel ORA_DISK_1: starting to check datafiles
input datafile fno=00001 name=/disk1/oracle/dbs/tbs_01.f
channel ORA_DISK_1: datafile checking complete, elapsed time: 00:00:00
channel ORA_DISK_1: starting to check datafiles
input datafile fno=00002 name=/disk1/oracle/dbs/tbs_ax1.f
channel ORA_DISK_1: datafile checking complete, elapsed time: 00:00:00
channel ORA_DISK_1: starting to check datafiles
input datafile fno=00017 name=/disk1/oracle/dbs/tbs_03.f
channel ORA_DISK_1: datafile checking complete, elapsed time: 00:00:00
channel ORA_DISK_1: starting to check datafiles
input datafile fno=00015 name=/disk1/oracle/dbs/tbs_51.f
channel ORA_DISK_1: datafile checking complete, elapsed time: 00:00:00
channel ORA_DISK_1: starting to check datafiles
input datafile fno=00016 name=/disk1/oracle/dbs/tbs_52.f
channel ORA_DISK_1: datafile checking complete, elapsed time: 00:00:00
Run SQL script /tmp/convertdb/transportscript-target on the destination platform to create database
Run RMAN script /tmp/convertdb/convertscript-target on destination platform to convert datafiles
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the destination platform
To change the internal database identifier, use DBNEWID Utility
示例27-4中的命令创建一个传输脚本,一个用于新数据库的初始化参数文件,以及一个转换脚本,其中包含要转换的每个数据文件的RMANCONVERT DATAFILE命令。
CONVERT DATABASE ON DESTINATION PLATFORM不会生成转换的数据文件副本。 该命令仅创建脚本。
- The data files to be converted(要转换的数据文件)
- The convert script(转换脚本)
- The transport script(传输脚本)
- The initialization file for the destination database(目标数据库的初始化文件)
Make the source database read/write.
使源数据库读/写。
Converting Data Files on the Destination Host
本节介绍如何使用上一节中创建的脚本来转换目标主机上的数据文件。
在前一阶段创建的转换脚本使用源数据库文件的原始数据文件名。 FORMAT参数指定使用CONVERT DATABASE命令的FORMAT或DB_FILE_NAME_CONVERT参数生成的名称。
To convert the data files on the destination host:
If necessary, edit the convert script.(如有必要,编辑转换脚本)
In the script, one CONVERT DATAFILE command exists for each data file to be converted. The convert script should indicate the current temporary file names of the unconverted data files and the output file names of the converted data files. A typical convert script looks as follows:
在脚本中,每个要转换的数据文件都有一个CONVERT DATAFILE命令。 转换脚本应该指示未转换的数据文件的当前临时文件名和转换的数据文件的输出文件名。 一个典型的转换脚本如下所示:
RUN
{
CONVERT
FROM PLATFORM 'Linux IA (32-bit)'
PARALLELISM 10
DATAFILE '/disk1/oracle/dbs/tbs_01.f'
FORMAT
'/tmp/convertdb/data_D-TV_I-1778429277_TS-SYSTEM_FNO-1_7qgb9u2s';
DATAFILE '/disk1/oracle/dbs/tbs_ax1.f'
FORMAT
'/tmp/convertdb/data_D-TV_I-1778429277_TS-SYSAUX_FNO-2_7rgb9u2s';
DATAFILE '/disk1/oracle/dbs/tbs_03.f'
FORMAT
'/tmp/convertdb/data_D-TV_I-1778429277_TS-SYSTEM_FNO-17_7sgb9u2s';
DATAFILE '/disk1/oracle/dbs/tbs_51.f'
FORMAT
'/tmp/convertdb/data_D-TV_I-1778429277_TS-TBS_5_FNO-15_8egb9u2u';
DATAFILE '/disk1/oracle/dbs/tbs_52.f'
FORMAT
'/tmp/convertdb/data_D-TV_I-1778429277_TS-TBS_5_FNO-16_8fgb9u2u';
}
Edit each DATAFILE command in the convert script to specify the temporary location of each data file as input. Also, edit the FORMAT parameter of each command to specify the desired final location of the data files of the transported database.
在convert脚本中编辑每个DATAFILE命令,以指定每个数据文件的临时位置作为输入。 此外,编辑每个命令的FORMAT参数以指定传输数据库的数据文件的所需最终位置。
- If necessary, edit the initialization parameter file on the destination host to change settings for the destination database.
如有必要,编辑目标主机上的初始化参数文件以更改目标数据库的设置。
You should edit several entries at the top of the initialization parameter file before moving the database to the destination platform. For example, the initialization parameter file may look as follows:
在将数据库移动到目标平台之前,应编辑初始化参数文件顶部的多个条目。 例如,初始化参数文件可能如下所示:
# Please change the values of the following parameters:
control_files = "/tmp/convertdb/cf_D-NEWDBT_id-1778429277_00gb9u2s"
db_recovery_file_dest = "/tmp/convertdb/orcva"
db_recovery_file_dest_size= 10737418240
instance_name = "NEWDBT"
service_names = "NEWDBT.example.com"
plsql_native_library_dir = "/tmp/convertdb/plsqlnld1"
db_name = "NEWDBT"
- On the destination host, use SQL*Plus to start the database instance in NOMOUNT mode.
在目标主机上,使用SQL * Plus以NOMOUNT模式启动数据库实例。
Specify the initialization parameter file that you copied in the preceding step. For example, enter the following command:
指定在上一步中复制的初始化参数文件。 例如,输入以下命令:
SQL> STARTUP NOMOUNT PFILE='/tmp/init_convertdb_00i2gj63_1_0.ora'
- Start RMAN and connect to the destination database (not the source database) as TARGET. For example, enter the following command:
% rman
RMAN> CONNECT TARGET SYS@prod_dest
- Run the convert script at the RMAN prompt. For example, enter the following command:
RMAN> @/tmp/convertdb/convertscript-target
- Shut down the database instance.
关闭数据库实例。
This step is necessary because the transport script that must execute already includes a STARTUP NOMOUNT command.
此步骤是必需的,因为必须执行的传输脚本已经包含STARTUP NOMOUNT命令。
- If necessary, edit the transport script to use the new names for the converted data files.
如有必要,编辑传输脚本以使用转换后的数据文件的新名称。
In Example 27-3, the transport script is /tmp/convertdb/transportscript.sql. You run this script on the destination host to create the database. Thus, you must edit this script with the correct names for the data files.
在例27-3中,传输脚本为/tmp/convertdb/transportscript.sql。 您可以在目标主机上运行此脚本来创建数据库。 因此,您必须使用数据文件的正确名称编辑此脚本。
- Execute the transport script in SQL*Plus.
在SQL * Plus中执行传输脚本。
For example, create the new database on the destination host as follows:
SQL> @/tmp/convertdb/transportscript
When the transport script completes, the destination database is created.
传输脚本完成后,将创建目标数据库
转载于:https://www.cnblogs.com/zfox2017/p/8562527.html
转://RMAN跨平台可传输表空间和数据库相关推荐
- 【MOS】如何利用RMAN可传输表空间迁移数据库到不同字节序的平台(文档 ID 1983639.1)...
如何利用 RMAN 可传输表空间迁移数据库到不同字节序的平台 (文档 ID 1983639.1) 适用于: Oracle Database - Enterprise Edition - 版本 10.1 ...
- [20170623]利用传输表空间恢复数据库2.txt
[20170623]利用传输表空间恢复数据库2.txt --//继续上午的测试,测试truncate,是否可行,理论讲应该没有问题.我主要的目的测试是否要切换日志. --//参考链接 : http:/ ...
- oracle rman表空间传输,rman 实现在线传输表空间(=10g)
rman操作 RMAN> transport tablespace O_ORACLE 2> tablespace destination 'F:\rmanbackup\td' 3> ...
- 11g使用增量备份来执行跨平台传输表空间减少停机时间(xtts_rman)
使用跨平台传输表空间来迁移数据所需要的停机时间与被迁移的数据量成正比.然而,当使用增量备份跨平台迁移可以显著减小迁移数据所需要的停机时间. 传统跨平台传输表空间的主要步骤: 1.将源数据库中所被转输的 ...
- 使用RMAN传输表空间复制数据
一.检查平台是否支持 在源库和目标库执行以下语句: SQL> SELECT d.NAME, i.VERSION, d.PLATFORM_NAME, ENDIAN_FORMAT 2 FROM V$ ...
- RMAN使用备份按时间点传输表空间
使用until time或者SCN来执行transport tablespace 如果在执行传输表空间操作时,对transport tablespace命令指定了目标时间,那么RMAN将在辅助实例中使 ...
- oracle数据磊导入数据,可传输表空间记载
今天泡pub看到一个网友说到跨平台迁移表空间,把a库的表空间迁移到b库中,往常的可以通过exp和imp或者数据磊工具导入导出,记得在oracle concepts中提到了关于可传输表空间的功能,在or ...
- Oracle传输表空间
一.简介 可传输表空间(还有个集)最大的优势是其速度比export/import或unload/load要快的多.因为可传输表空间主要是复制数据文件到目标路径,然后再使用export/import或D ...
- Oracle数据库迁移:异构传输表空间TTS HP-UX迁移至Redhat Linux 7.7
墨墨导读:本文来自墨天轮用户"你好我是李白"的投稿,记录一个Oracle数据库迁移过程 :异构传输表空间TTS HP-UX迁移至Redhat Linux 7.7.墨天轮主页:htt ...
最新文章
- list删除某个元素_Python基础入门之列表(list)
- 中国发布自主开发的域名系统基础软件 “红枫”
- Redis 的各项功能解决了哪些问题?
- 密码技术--国密证书及go语言生成自签国密证书
- boost::hana::list用法的测试程序
- 面试题 - 两个页面间如何传递数据
- 第三次学JAVA再学不好就吃翔(part28)--猜数字小游戏
- emacs 替换模式_如何使用Emacs Org模式撰写博客
- 移动端前端UI框架推荐
- Embedding技术在商业搜索与推荐场景的实践
- Java学习心得——对象与类
- 5G来了,普通人看热闹,程序员看颠覆
- 毕设项目-校园活动管理小程序
- 【数据分析】销售案例——用户购买频次
- cups ipp oracle,使用 CUPS 打印管理器管理打印机
- 可爱的猫咪怎么画?超详细教你如何绘画可爱的猫咪!
- eclipse中怎么快速切换窗口?
- kitti rotation,label等细节相关
- 【Vue】 错误:Already included file name ‘××ב differs from file name ‘××ב only in casing的解决方法
- [thread 38768 also had an error]