重庆思庄Oracle、Redhat认证学习论坛

标题: ORACLE 12C 使用备份集传输表空间 [打印本页]

作者: 郑全    时间: 2020-1-11 17:56
标题: ORACLE 12C 使用备份集传输表空间
[oracle@dbserver ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Sat Jan 11 11:13:21 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1544068695)
RMAN> backup to platform 'Microsoft Windows x86 64-bit' format '/tmp/tsp_tts.bak'
2>    datapump format '/tmp/tsp_tts.dmp'
3>    tablespace tsp_tts;
Starting backup at 11-JAN-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
Running TRANSPORT_SET_CHECK on specified tablespaces
TRANSPORT_SET_CHECK completed successfully
Performing export of metadata for specified tablespaces...
   EXPDP> Starting "SYS"."TRANSPORT_EXP_ORCL_ndmj":  
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TRANSPORT_EXP_ORCL_ndmj" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TRANSPORT_EXP_ORCL_ndmj is:
   EXPDP>   /u01/app/oracle/product/12.1.0/dbhome_1/dbs/backup_tts_ORCL_31430.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TSP_TTS:
   EXPDP>   /u01/app/oracle/oradata/orcl/tsp_tts01.dbf
   EXPDP> Job "SYS"."TRANSPORT_EXP_ORCL_ndmj" successfully completed at Sat Jan 11 11:16:50 2020 elapsed 0 00:00:55
Export completed
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/tsp_tts01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-20
channel ORA_DISK_1: finished piece 1 at 11-JAN-20
piece handle=/tmp/tsp_tts.bak tag=TAG20200111T111549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
input Data Pump dump file=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/backup_tts_ORCL_31430.dmp
channel ORA_DISK_1: starting piece 1 at 11-JAN-20
channel ORA_DISK_1: finished piece 1 at 11-JAN-20
piece handle=/tmp/tsp_tts.dmp tag=TAG20200111T111549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-20
RMAN>


--目标端
RMAN> restore foreign tablespace tsp_tts
2>     format 'D:\ORACLE\ORADATA\ORCL\zq-tsp_tts01.dbf'
3>    from backupset 'd:\oracle\oradata\tsp_tts.bak'
4>    dump file from backupset 'd:\oracle\oradata\tsp_tts.dmp';
启动 restore 于 11-1月 -20
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=242 设备类型=DISK
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部表空间 TSP_TTS 中的所有文件
通道 ORA_DISK_1: 正在读取备份片段 d:\oracle\oradata\tsp_tts.bak
通道 ORA_DISK_1: 正在将外部文件 9 还原到 D:\ORACLE\ORADATA\ORCL\ZQ-TSP_TTS01.DBF
通道 ORA_DISK_1: 外部片段句柄=d:\oracle\oradata\tsp_tts.bak
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在将数据泵转储文件还原到 d:\oracle\product\12.1.0\dbhome_1/dbs/backup_tts_ORCL_15328.dmp
通道 ORA_DISK_1: 正在读取备份片段 d:\oracle\oradata\tsp_tts.dmp
通道 ORA_DISK_1: 外部片段句柄=d:\oracle\oradata\tsp_tts.dmp
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
正在执行元数据导入...
   IMPDP> 已成功加载/卸载了主表 "SYS"."TSPITR_IMP_ORCL_rBrc"
   IMPDP> 启动 "SYS"."TSPITR_IMP_ORCL_rBrc":
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/TABLE
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/STATISTICS/MARKER
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   IMPDP> 作业 "SYS"."TSPITR_IMP_ORCL_rBrc" 已于 星期六 1月 11 11:24:14 2020 elapsed 0 00:00:15 成功完成
导入完毕
完成 restore 于 11-1月 -20



作者: 郑全    时间: 2020-1-11 17:58
目标端转换:

[oracle@dbserver ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Sat Jan 11 11:27:56 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1544068695)
RMAN> backup for transport format '/tmp/tsp_tts.bak'
2>    datapump format '/tmp/tsp_tts.dmp'
3>    tablespace tsp_tts
4>    ;
Starting backup at 11-JAN-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 device type=DISK
Running TRANSPORT_SET_CHECK on specified tablespaces
TRANSPORT_SET_CHECK completed successfully
Performing export of metadata for specified tablespaces...
   EXPDP> Starting "SYS"."TRANSPORT_EXP_ORCL_mkbD":  
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TRANSPORT_EXP_ORCL_mkbD" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TRANSPORT_EXP_ORCL_mkbD is:
   EXPDP>   /u01/app/oracle/product/12.1.0/dbhome_1/dbs/backup_tts_ORCL_24916.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TSP_TTS:
   EXPDP>   /u01/app/oracle/oradata/orcl/tsp_tts01.dbf
   EXPDP> Job "SYS"."TRANSPORT_EXP_ORCL_mkbD" successfully completed at Sat Jan 11 11:30:01 2020 elapsed 0 00:00:53
Export completed
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/orcl/tsp_tts01.dbf
channel ORA_DISK_1: starting piece 1 at 11-JAN-20
channel ORA_DISK_1: finished piece 1 at 11-JAN-20
piece handle=/tmp/tsp_tts.bak tag=TAG20200111T112902 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
input Data Pump dump file=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/backup_tts_ORCL_24916.dmp
channel ORA_DISK_1: starting piece 1 at 11-JAN-20
channel ORA_DISK_1: finished piece 1 at 11-JAN-20
piece handle=/tmp/tsp_tts.dmp tag=TAG20200111T112902 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-JAN-20
RMAN>


--目标端转换

RMAN> restore from platform 'Linux x86 64-bit'
2>    foreign tablespace tsp_tts format 'd:\oracle\oradata\orcl\sztech-tsp_tts01.dbf'
3>    from backupset 'd:\oracle\oradata\tsp_tts.bak'
4>    dump file from backupset 'd:\oracle\oradata\tsp_tts.dmp'
5>    ;
启动 restore 于 11-1月 -20
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部表空间 TSP_TTS 中的所有文件
通道 ORA_DISK_1: 正在读取备份片段 d:\oracle\oradata\tsp_tts.bak
通道 ORA_DISK_1: 正在将外部文件 9 还原到 D:\ORACLE\ORADATA\ORCL\SZTECH-TSP_TTS01.DBF
通道 ORA_DISK_1: 外部片段句柄=d:\oracle\oradata\tsp_tts.bak
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在将数据泵转储文件还原到 d:\oracle\product\12.1.0\dbhome_1/dbs/backup_tts_ORCL_31210.dmp
通道 ORA_DISK_1: 正在读取备份片段 d:\oracle\oradata\tsp_tts.dmp
通道 ORA_DISK_1: 外部片段句柄=d:\oracle\oradata\tsp_tts.dmp
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
正在执行元数据导入...
   IMPDP> 已成功加载/卸载了主表 "SYS"."TSPITR_IMP_ORCL_rxbe"
   IMPDP> 启动 "SYS"."TSPITR_IMP_ORCL_rxbe":
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/TABLE
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/STATISTICS/MARKER
   IMPDP> 处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   IMPDP> 作业 "SYS"."TSPITR_IMP_ORCL_rxbe" 已于 星期六 1月 11 11:46:22 2020 elapsed 0 00:00:14 成功完成
导入完毕
完成 restore 于 11-1月 -20
RMAN>






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2