Bo's Oracle Station

查看: 1995|回复: 0

课程第33次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-7-28 10:18:39 | 显示全部楼层 |阅读模式


  1. select  * from v$asm_diskgroup;

  2. select  * from v$asm_attribute;


  3. select  * from v$transportable_platform;


  4. begin
  5.    dbms_tts.transport_set_check(ts_list => 'tbs05319x');
  6. end;

  7. select * from transport_set_violations;
复制代码

   VIOLATIONS
1ORA-39907: 索引 HR.I1 (在表空间 TBS05319X 中) 指向表 HR.T1 (在表空间 TBS05319 中)。

  1. begin
  2.    dbms_tts.transport_set_check(ts_list => 'tbs05319x,tbs05319');
  3. end;

  4. select * from transport_set_violations;
复制代码
获取帮助:
  1. PS C:\WINDOWS\system32> expdp  help=y

  2. Export: Release 11.2.0.4.0 - Production on 星期日 7月 28 10:20:37 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


  4. 数据泵导出实用程序提供了一种用于在 Oracle 数据库之间传输
  5. 数据对象的机制。该实用程序可以使用以下命令进行调用:

  6.    示例: expdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

  7. 您可以控制导出的运行方式。具体方法是: 在 'expdp' 命令后输入
  8. 各种参数。要指定各参数, 请使用关键字:

  9.    格式:  expdp KEYWORD=value 或 KEYWORD=(value1,value2,...,valueN)
  10.    示例: expdp scott/tiger DUMPFILE=scott.dmp DIRECTORY=dmpdir SCHEMAS=scott
  11.                或 TABLES=(T1:P1,T1:P2), 如果 T1 是分区表

  12. USERID 必须是命令行中的第一个参数。

  13. ------------------------------------------------------------------------------

  14. 以下是可用关键字和它们的说明。方括号中列出的是默认值。

  15. ATTACH
  16. 连接到现有作业。
  17. 例如, ATTACH=job_name。

  18. CLUSTER
  19. 利用集群资源并将 worker 进程分布在 Oracle RAC 上。
  20. 有效的关键字值为: [Y] 和 N。

  21. COMPRESSION
  22. 减少转储文件大小。
  23. 有效的关键字值为: ALL, DATA_ONLY, [METADATA_ONLY] 和 NONE。

  24. CONTENT
  25. 指定要卸载的数据。
  26. 有效的关键字值为: [ALL], DATA_ONLY 和 METADATA_ONLY。

  27. DATA_OPTIONS
  28. 数据层选项标记。
  29. 有效的关键字值为: XML_CLOBS。

  30. DIRECTORY
  31. 用于转储文件和日志文件的目录对象。

  32. DUMPFILE
  33. 指定目标转储文件名的列表 [expdat.dmp]。
  34. 例如, DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp。

  35. ENCRYPTION
  36. 加密某个转储文件的一部分或全部。
  37. 有效的关键字值为: ALL, DATA_ONLY, ENCRYPTED_COLUMNS_ONLY, METADATA_ONLY 和 NONE。

  38. ENCRYPTION_ALGORITHM
  39. 指定加密的方式。
  40. 有效的关键字值为: [AES128], AES192 和 AES256。

  41. ENCRYPTION_MODE
  42. 生成加密密钥的方法。
  43. 有效的关键字值为: DUAL, PASSWORD 和 [TRANSPARENT]。

  44. ENCRYPTION_PASSWORD
  45. 用于在转储文件中创建加密数据的口令密钥。

  46. ESTIMATE
  47. 计算作业估计值。
  48. 有效的关键字值为: [BLOCKS] 和 STATISTICS。

  49. ESTIMATE_ONLY
  50. 计算作业估计值而不执行导出。

  51. EXCLUDE
  52. 排除特定对象类型。
  53. 例如, EXCLUDE=SCHEMA:"='HR'"。

  54. FILESIZE
  55. 以字节为单位指定每个转储文件的大小。

  56. FLASHBACK_SCN
  57. 用于重置会话快照的 SCN。

  58. FLASHBACK_TIME
  59. 用于查找最接近的相应 SCN 值的时间。

  60. FULL
  61. 导出整个数据库 [N]。

  62. HELP
  63. 显示帮助消息 [N]。

  64. INCLUDE
  65. 包括特定对象类型。
  66. 例如, INCLUDE=TABLE_DATA。

  67. JOB_NAME
  68. 要创建的导出作业的名称。

  69. LOGFILE
  70. 指定日志文件名 [export.log]。

  71. NETWORK_LINK
  72. 源系统的远程数据库链接的名称。

  73. NOLOGFILE
  74. 不写入日志文件 [N]。

  75. PARALLEL
  76. 更改当前作业的活动 worker 的数量。

  77. PARFILE
  78. 指定参数文件名。

  79. QUERY
  80. 用于导出表的子集的谓词子句。
  81. 例如, QUERY=employees:"WHERE department_id > 10"。

  82. REMAP_DATA
  83. 指定数据转换函数。
  84. 例如, REMAP_DATA=EMP.EMPNO:REMAPPKG.EMPNO。

  85. REUSE_DUMPFILES
  86. 覆盖目标转储文件 (如果文件存在) [N]。

  87. SAMPLE
  88. 要导出的数据的百分比。

  89. SCHEMAS
  90. 要导出的方案的列表 [登录方案]。

  91. SERVICE_NAME
  92. 约束 Oracle RAC 资源的活动服务名和关联资源组。

  93. SOURCE_EDITION
  94. 用于提取元数据的版本。

  95. STATUS
  96. 监视作业状态的频率, 其中
  97. 默认值 [0] 表示只要有新状态可用, 就立即显示新状态。

  98. TABLES
  99. 标识要导出的表的列表。
  100. 例如, TABLES=HR.EMPLOYEES,SH.SALES:SALES_1995。

  101. TABLESPACES
  102. 标识要导出的表空间的列表。

  103. TRANSPORTABLE
  104. 指定是否可以使用可传输方法。
  105. 有效的关键字值为: ALWAYS 和 [NEVER]。

  106. TRANSPORT_FULL_CHECK
  107. 验证所有表的存储段 [N]。

  108. TRANSPORT_TABLESPACES
  109. 要从中卸载元数据的表空间的列表。

  110. VERSION
  111. 要导出的对象版本。
  112. 有效的关键字值为: [COMPATIBLE], LATEST 或任何有效的数据库版本。

  113. ------------------------------------------------------------------------------

  114. 下列命令在交互模式下有效。
  115. 注: 允许使用缩写。

  116. ADD_FILE
  117. 将转储文件添加到转储文件集。

  118. CONTINUE_CLIENT
  119. 返回到事件记录模式。如果处于空闲状态, 将重新启动作业。

  120. EXIT_CLIENT
  121. 退出客户机会话并使作业保持运行状态。

  122. FILESIZE
  123. 用于后续 ADD_FILE 命令的默认文件大小 (字节)。

  124. HELP
  125. 汇总交互命令。

  126. KILL_JOB
  127. 分离并删除作业。

  128. PARALLEL
  129. 更改当前作业的活动 worker 的数量。

  130. REUSE_DUMPFILES
  131. 覆盖目标转储文件 (如果文件存在) [N]。

  132. START_JOB
  133. 启动或恢复当前作业。
  134. 有效的关键字值为: SKIP_CURRENT。

  135. STATUS
  136. 监视作业状态的频率, 其中
  137. 默认值 [0] 表示只要有新状态可用, 就立即显示新状态。

  138. STOP_JOB
  139. 按顺序关闭作业执行并退出客户机。
  140. 有效的关键字值为: IMMEDIATE。


  141. PS C:\WINDOWS\system32>
复制代码
  1. PS C:\WINDOWS\system32> expdp system/oracle_4U directory=dirwin dumpfile=tbs05319.dmp  TRANSPORT_TABLESPACES=tbs05319,tbs05319x

  2. Export: Release 11.2.0.4.0 - Production on 星期日 7月 28 10:26:22 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6. 启动 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** directory=dirwin dumpfile=tbs05319.dmp TRANSPORT_TABLESPACES=tbs05319,tbs05319x
  7. 处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
  8. 处理对象类型 TRANSPORTABLE_EXPORT/TABLE
  9. 处理对象类型 TRANSPORTABLE_EXPORT/INDEX/INDEX
  10. 处理对象类型 TRANSPORTABLE_EXPORT/INDEX_STATISTICS
  11. 处理对象类型 TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  12. 处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  13. 已成功加载/卸载了主表 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01"
  14. ******************************************************************************
  15. SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 的转储文件集为:
  16.   C:\APP\APPLE\DIRWIN\TBS05319.DMP
  17. ******************************************************************************
  18. 可传输表空间 TBS05319 所需的数据文件:
  19.   C:\APP\APPLE\ORADATA\WINORCL\TBS05319.DBF
  20. 可传输表空间 TBS05319X 所需的数据文件:
  21.   C:\APP\APPLE\ORADATA\WINORCL\TBS05319X.DBF
  22. 作业 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" 已于 星期日 7月 28 10:26:58 2019 elapsed 0 00:00:34 成功完成

  23. PS C:\WINDOWS\system32>
复制代码

因为都是小码机,所以不用转码,直接拷贝C:\APP\APPLE\ORADATA\WINORCL\TBS05319X.DBF和C:\APP\APPLE\DIRWIN\TBS05319.DMP到Linux

  1. [oracle@station76 oracle]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.4.0 Production on Sun Jul 28 10:32:54 2019

  3. Copyright (c) 1982, 2013, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> create directory  dirlin as '/u01/app/oracle/dirlin';

  7. Directory created.

  8. SQL> exit
  9. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64                                                                             bit Production
  10. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  11. and Real Application Testing options
  12. [oracle@station76 oracle]$ impdp help=y

  13. Import: Release 11.2.0.4.0 - Production on Sun Jul 28 10:33:58 2019

  14. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


  15. The Data Pump Import utility provides a mechanism for transferring data objects
  16. between Oracle databases. The utility is invoked with the following command:

  17.      Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

  18. You can control how Import runs by entering the 'impdp' command followed
  19. by various parameters. To specify parameters, you use keywords:

  20.      Format:  impdp KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
  21.      Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp

  22. USERID must be the first parameter on the command line.

  23. ------------------------------------------------------------------------------

  24. The available keywords and their descriptions follow. Default values are listed                                                                              within square brackets.

  25. ATTACH
  26. Attach to an existing job.
  27. For example, ATTACH=job_name.

  28. CLUSTER
  29. Utilize cluster resources and distribute workers across the Oracle RAC.
  30. Valid keyword values are: [Y] and N.

  31. CONTENT
  32. Specifies data to load.
  33. Valid keywords are: [ALL], DATA_ONLY and METADATA_ONLY.

  34. DATA_OPTIONS
  35. Data layer option flags.
  36. Valid keywords are: SKIP_CONSTRAINT_ERRORS.

  37. DIRECTORY
  38. Directory object to be used for dump, log and SQL files.

  39. DUMPFILE
  40. List of dump files to import from [expdat.dmp].
  41. For example, DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.

  42. ENCRYPTION_PASSWORD
  43. Password key for accessing encrypted data within a dump file.
  44. Not valid for network import jobs.

  45. ESTIMATE
  46. Calculate job estimates.
  47. Valid keywords are: [BLOCKS] and STATISTICS.

  48. EXCLUDE
  49. Exclude specific object types.
  50. For example, EXCLUDE=SCHEMA:"='HR'".

  51. FLASHBACK_SCN
  52. SCN used to reset session snapshot.

  53. FLASHBACK_TIME
  54. Time used to find the closest corresponding SCN value.

  55. FULL
  56. Import everything from source [Y].

  57. HELP
  58. Display help messages [N].

  59. INCLUDE
  60. Include specific object types.
  61. For example, INCLUDE=TABLE_DATA.

  62. JOB_NAME
  63. Name of import job to create.

  64. LOGFILE
  65. Log file name [import.log].

  66. NETWORK_LINK
  67. Name of remote database link to the source system.

  68. NOLOGFILE
  69. Do not write log file [N].

  70. PARALLEL
  71. Change the number of active workers for current job.

  72. PARFILE
  73. Specify parameter file.

  74. PARTITION_OPTIONS
  75. Specify how partitions should be transformed.
  76. Valid keywords are: DEPARTITION, MERGE and [NONE].

  77. QUERY
  78. Predicate clause used to import a subset of a table.
  79. For example, QUERY=employees:"WHERE department_id > 10".

  80. REMAP_DATA
  81. Specify a data conversion function.
  82. For example, REMAP_DATA=EMP.EMPNO:REMAPPKG.EMPNO.

  83. REMAP_DATAFILE
  84. Redefine data file references in all DDL statements.

  85. REMAP_SCHEMA
  86. Objects from one schema are loaded into another schema.

  87. REMAP_TABLE
  88. Table names are remapped to another table.
  89. For example, REMAP_TABLE=HR.EMPLOYEES:EMPS.

  90. REMAP_TABLESPACE
  91. Tablespace objects are remapped to another tablespace.

  92. REUSE_DATAFILES
  93. Tablespace will be initialized if it already exists [N].

  94. SCHEMAS
  95. List of schemas to import.

  96. SERVICE_NAME
  97. Name of an active Service and associated resource group to constrain Oracle RAC                                                                              resources.

  98. SKIP_UNUSABLE_INDEXES
  99. Skip indexes that were set to the Index Unusable state.

  100. SOURCE_EDITION
  101. Edition to be used for extracting metadata.

  102. SQLFILE
  103. Write all the SQL DDL to a specified file.

  104. STATUS
  105. Frequency (secs) job status is to be monitored where
  106. the default [0] will show new status when available.

  107. STREAMS_CONFIGURATION
  108. Enable the loading of Streams metadata

  109. TABLE_EXISTS_ACTION
  110. Action to take if imported object already exists.
  111. Valid keywords are: APPEND, REPLACE, [SKIP] and TRUNCATE.

  112. TABLES
  113. Identifies a list of tables to import.
  114. For example, TABLES=HR.EMPLOYEES,SH.SALES:SALES_1995.

  115. TABLESPACES
  116. Identifies a list of tablespaces to import.

  117. TARGET_EDITION
  118. Edition to be used for loading metadata.

  119. TRANSFORM
  120. Metadata transform to apply to applicable objects.
  121. Valid keywords are: OID, PCTSPACE, SEGMENT_ATTRIBUTES and STORAGE.

  122. TRANSPORTABLE
  123. Options for choosing transportable data movement.
  124. Valid keywords are: ALWAYS and [NEVER].
  125. Only valid in NETWORK_LINK mode import operations.

  126. TRANSPORT_DATAFILES
  127. List of data files to be imported by transportable mode.

  128. TRANSPORT_FULL_CHECK
  129. Verify storage segments of all tables [N].

  130. TRANSPORT_TABLESPACES
  131. List of tablespaces from which metadata will be loaded.
  132. Only valid in NETWORK_LINK mode import operations.

  133. VERSION
  134. Version of objects to import.
  135. Valid keywords are: [COMPATIBLE], LATEST or any valid database version.
  136. Only valid for NETWORK_LINK and SQLFILE.

  137. ------------------------------------------------------------------------------

  138. The following commands are valid while in interactive mode.
  139. Note: abbreviations are allowed.

  140. CONTINUE_CLIENT
  141. Return to logging mode. Job will be restarted if idle.

  142. EXIT_CLIENT
  143. Quit client session and leave job running.

  144. HELP
  145. Summarize interactive commands.

  146. KILL_JOB
  147. Detach and delete job.

  148. PARALLEL
  149. Change the number of active workers for current job.

  150. START_JOB
  151. Start or resume current job.
  152. Valid keywords are: SKIP_CURRENT.

  153. STATUS
  154. Frequency (secs) job status is to be monitored where
  155. the default [0] will show new status when available.

  156. STOP_JOB
  157. Orderly shutdown of job execution and exits the client.
  158. Valid keywords are: IMMEDIATE.


复制代码
  1. [oracle@station76 oracle]$ impdp system/oracle_4U  directory=dirlin dumpfile=TBS05319.DMP TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/TBS05319.DBF','/u01/app/oracle/oradata/orcl/TBS05319X.DBF'

  2. Import: Release 11.2.0.4.0 - Production on Sun Jul 28 10:39:09 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  6. and Real Application Testing options
  7. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  8. Source time zone is +08:00 and target time zone is +00:00.
  9. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=dirlin dumpfile=TBS05319.DMP TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/TBS05319.DBF,/u01/app/oracle/oradata/orcl/TBS05319X.DBF
  10. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  11. Processing object type TRANSPORTABLE_EXPORT/TABLE
  12. Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
  13. Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
  14. Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
  15. Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  16. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Sun Jul 28 10:39:22 2019 elapsed 0 00:00:10
复制代码

在学完1Z0-052的第17章的时候,还要注意“versions”和“remap_schema”

--------------------------------------做一下要求转码的拓展实验:
复制代码
  1. PS C:\WINDOWS\system32> expdp system/oracle_4U directory=dirwin dumpfile=tbssolaris.dmp  TRANSPORT_TABLESPACES=tbssolaris

  2. Export: Release 11.2.0.4.0 - Production on 星期日 7月 28 10:58:06 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  6. 启动 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** directory=dirwin dumpfile=tbssolaris.dmp TRANSPORT_TABLESPACES=tbssolaris
  7. 处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
  8. 处理对象类型 TRANSPORTABLE_EXPORT/TABLE
  9. 处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  10. 已成功加载/卸载了主表 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01"
  11. ******************************************************************************
  12. SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 的转储文件集为:
  13.   C:\APP\APPLE\DIRWIN\TBSSOLARIS.DMP
  14. ******************************************************************************
  15. 可传输表空间 TBSSOLARIS 所需的数据文件:
  16.   C:\APP\APPLE\ORADATA\WINORCL\TBSSOLARIS.DBF
  17. 作业 "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" 已于 星期日 7月 28 10:58:47 2019 elapsed 0 00:00:39 成功完成

  18. PS C:\WINDOWS\system32> rman target  /

  19. 恢复管理器: Release 11.2.0.4.0 - Production on 星期日 7月 28 10:58:59 2019

  20. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  21. 已连接到目标数据库: WINORCL (DBID=2162311502)

  22. RMAN> convert tablespace tbssolaris to platform 'Solaris[tm] OE (32-bit)' format 'c:\app\apple\dirwin\tbssolaris_%U.dbf';

  23. 启动 conversion at source 于 28-7月 -19
  24. 使用目标数据库控制文件替代恢复目录
  25. 分配的通道: ORA_DISK_1
  26. 通道 ORA_DISK_1: SID=198 设备类型=DISK
  27. 通道 ORA_DISK_1: 启动数据文件转换
  28. 输入数据文件: 文件号=00008 名称=C:\APP\APPLE\ORADATA\WINORCL\TBSSOLARIS.DBF
  29. 已转换的数据文件 = C:\APP\APPLE\DIRWIN\TBSSOLARIS_DATA_D-WINORCL_I-2162311502_TS-TBSSOLARIS_FNO-8_03U7PF2C.DBF
  30. 通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:01
  31. 完成 conversion at source 于 28-7月 -19

  32. RMAN>
复制代码
直接导入,出错:
  1. <p>[oracle@station76 ~]$ impdp system/oracle_4U  directory=dirlin dumpfile=TBSSOLARIS.DMP TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF'
  2. Import: Release 11.2.0.4.0 - Production on Sun Jul 28 11:14:24 2019</p><p>Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.</p><p>Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  3. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  4. and Real Application Testing options
  5. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  6. Source time zone is +08:00 and target time zone is +00:00.
  7. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=dirlin dumpfile=TBSSOLARIS.DMP TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF
  8. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  9. ORA-39123: Data Pump transportable tablespace job aborted
  10. ORA-01565: error in identifying file '/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF'
  11. ORA-27048: skgfifi: file header information is invalid
  12. Additional information: 24</p><p>Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at Sun Jul 28 11:14:28 2019 elapsed 0 00:00:02

  13. </p>
复制代码
所以,需要在目的地这边转码(如果源头不能再来一次的话):
  1. [oracle@station76 oracle]$ rman target  /

  2. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 28 11:06:21 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1541741703)

  5. RMAN> convert datafile '/u01/app/oracle/oradata/orcl/TBSSOLARIDS_ORI.DBF' from platform 'Solaris[tm] OE (32-bit)' format '/u01/app/oracle/oradata/orcl/TBSSOLARIDS.DBF';

  6. Starting conversion at target at 2019-07-28:11:08:13
  7. using target database control file instead of recovery catalog
  8. allocated channel: ORA_SBT_TAPE_1
  9. channel ORA_SBT_TAPE_1: SID=72 device type=SBT_TAPE
  10. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  11. allocated channel: ORA_SBT_TAPE_2
  12. channel ORA_SBT_TAPE_2: SID=68 device type=SBT_TAPE
  13. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  14. RMAN-00571: ===========================================================
  15. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  16. RMAN-00571: ===========================================================
  17. RMAN-03002: failure of conversion at target command at 07/28/2019 11:08:31
  18. ORA-19625: error identifying file /u01/app/oracle/oradata/orcl/TBSSOLARIDS_ORI.DBF
  19. ORA-27037: unable to obtain file status
  20. Linux-x86_64 Error: 2: No such file or directory
  21. Additional information: 3

  22. RMAN> exit


  23. Recovery Manager complete.
  24. [oracle@station76 oracle]$ ls -l  /u01/app/oracle/oradata/orcl/TBSSOLARIDS_ORI.DBF
  25. ls: cannot access /u01/app/oracle/oradata/orcl/TBSSOLARIDS_ORI.DBF: No such file or directory
  26. [oracle@station76 oracle]$ cd /u01/app/oracle/oradata/orcl/
  27. [oracle@station76 orcl]$ ls
  28. TBS05319.DBF  TBS05319X.DBF  TBSSOLARIS_ORI.DBF
  29. [oracle@station76 orcl]$ cd
  30. [oracle@station76 ~]$ rman target  /

  31. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 28 11:09:32 2019

  32. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  33. connected to target database: ORCL (DBID=1541741703)

  34. RMAN>  convert datafile '/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF' from platform 'Solaris[tm] OE (32-bit)' format '/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF';

  35. Starting conversion at target at 2019-07-28:11:09:55
  36. using target database control file instead of recovery catalog
  37. allocated channel: ORA_SBT_TAPE_1
  38. channel ORA_SBT_TAPE_1: SID=72 device type=SBT_TAPE
  39. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  40. allocated channel: ORA_SBT_TAPE_2
  41. channel ORA_SBT_TAPE_2: SID=69 device type=SBT_TAPE
  42. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  43. DBGANY:     CMD type=backup cmdid=1 status=NOT STARTED
  44. DBGANY:       1 STEPstepid=1 cmdid=1 status=NOT STARTED devtype=DISK
  45. DBGANY:           1 TEXTNOD = -- budf_start
  46. DBGANY:           2 TEXTNOD = /* This must be retriable, which means a backup conversation may already
  47. DBGANY:           3 TEXTNOD =  * be in progress when this step (re)executes.
  48. DBGANY:           4 TEXTNOD =  */
  49. DBGANY:           5 TEXTNOD = declare
  50. DBGANY:           6 TEXTNOD =   /* backup conversation status variables */
  51. DBGANY:           7 TEXTNOD =   state       binary_integer;
  52. DBGANY:           8 TEXTNOD =   setid       number;
  53. DBGANY:           9 TEXTNOD =   stamp       number;
  54. DBGANY:          10 TEXTNOD =   pieceno     binary_integer;
  55. DBGANY:          11 TEXTNOD =   files       binary_integer;
  56. DBGANY:          12 TEXTNOD =   datafiles   boolean;
  57. DBGANY:          13 TEXTNOD =   incremental boolean;
  58. DBGANY:          14 TEXTNOD =   nochecksum  boolean;
  59. DBGANY:          15 TEXTNOD =   device      boolean;
  60. DBGANY:          16 TEXTNOD =   hdrupd      boolean  := TRUE;
  61. DBGANY:          17 TEXTNOD =   /* piece creation variables */
  62. DBGANY:          18 TEXTNOD =   done        boolean;
  63. DBGANY:          19 TEXTNOD =   concur      boolean;
  64. DBGANY:          20 TEXTNOD =   chg_tracking_err number;
  65. DBGANY:          21 TEXTNOD =   /* Miscellaneous */
  66. DBGANY:          22 TEXTNOD =   memnum      number;
  67. DBGANY:          23 TEXTNOD =   dfnumber    number;
  68. DBGANY:          24 TEXTNOD =   cfname      varchar2(512);
  69. DBGANY:          25 TEXTNOD =   copy_recid  number;
  70. DBGANY:          26 TEXTNOD =   copy_stamp  number;
  71. DBGANY:          27 TEXTNOD =   busy_retries number := 0;
  72. DBGANY:          28 TEXTNOD =   resetlogs_change  number;
  73. DBGANY:          29 TEXTNOD =   creation_change   number;
  74. DBGANY:          30 TEXTNOD =   checkpoint_change number;
  75. DBGANY:          31 TEXTNOD =   blksize           number;
  76. DBGANY:          32 TEXTNOD =   blocks            number;
  77. DBGANY:          33 TEXTNOD =   fname             varchar2(1024);
  78. DBGANY:          34 TEXTNOD =   no_delete         binary_integer;
  79. DBGANY:          35 TEXTNOD =   copy         number;
  80. DBGANY:          36 TEXTNOD =   nformat      number := 1;
  81. DBGANY:          37 TEXTNOD =   handle       varchar2(512);
  82. DBGANY:          38 TEXTNOD =   comment      varchar2(80);
  83. DBGANY:          39 TEXTNOD =   media        varchar2(80);
  84. DBGANY:          40 TEXTNOD =   wrong_format      exception;
  85. DBGANY:          41 TEXTNOD =   pragma exception_init(wrong_format, -20039);
  86. DBGANY:          42 TEXTNOD =   first_time        boolean := TRUE;
  87. DBGANY:          43 TEXTNOD =   backup_level      number;
  88. DBGANY:          44 TEXTNOD =   elapsed           number;
  89. DBGANY:          45 TEXTNOD =   starttime         date;
  90. DBGANY:          46 TEXTNOD =   hours             number;
  91. DBGANY:          47 TEXTNOD =   mins              number;
  92. DBGANY:          48 TEXTNOD =   secs              number;
  93. DBGANY:          49 TEXTNOD =   ncopies           number := 0;
  94. DBGANY:          50 TEXTNOD =   docompress        boolean := FALSE;
  95. DBGANY:          51 TEXTNOD =   compressalg       varchar2(80);
  96. DBGANY:          52 TEXTNOD =   compressasof      number;
  97. DBGANY:          53 TEXTNOD =   compresslopt      binary_integer;
  98. DBGANY:          54 TEXTNOD =   /* backup_type is used to indicate what type of backup is done. This is used
  99. DBGANY:          55 TEXTNOD =    * to get configured copies, look at krmkgbac for more comments. */
  100. DBGANY:          56 TEXTNOD =   backup_type       number := 2;
  101. DBGANY:          57 TEXTNOD =   isstby            boolean;
  102. DBGANY:          58 TEXTNOD =   larchlog_failover boolean;
  103. DBGANY:          59 TEXTNOD =   failoverdone      boolean := FALSE;
  104. DBGANY:          60 TEXTNOD =   docopies          boolean := FALSE;
  105. DBGANY:          61 TEXTNOD =   cnvrtto           boolean := FALSE;
  106. DBGANY:          62 TEXTNOD =   cnvrtfr           boolean := FALSE;
  107. DBGANY:          63 TEXTNOD =   sameen            boolean := FALSE;
  108. DBGANY:          64 TEXTNOD =   reusefile         boolean := FALSE;
  109. DBGANY:          65 TEXTNOD =   tsname            varchar2(30) := NULL;
  110. DBGANY:          66 TEXTNOD =   thread            number := NULL;
  111. DBGANY:          67 TEXTNOD =   sequence          number := NULL;
  112. DBGANY:          68 TEXTNOD =   m                 number := 8581;
  113. DBGANY:          69 TEXTNOD =   cprecid           number;
  114. DBGANY:          70 TEXTNOD =   cpstamp           number;
  115. DBGANY:          71 TEXTNOD =   rsid              number;
  116. DBGANY:          72 TEXTNOD =   rsts              number;
  117. DBGANY:          73 TEXTNOD =   cptag             varchar2(31) := NULL;
  118. DBGANY:          74 TEXTNOD =   noct              boolean := FALSE;
  119. DBGANY:          75 TEXTNOD =   nooptim           boolean := FALSE;
  120. DBGANY:          76 TEXTNOD =   dontcare          varchar2(1);
  121. DBGANY:          77 TEXTNOD =   pltfrmto          number := NULL;
  122. DBGANY:          78 TEXTNOD =   pltfrmfr          number := NULL;
  123. DBGANY:          79 TEXTNOD =   foreign_dbname    varchar2(8) := NULL;
  124. DBGANY:          80 TEXTNOD =   foreign_dbid      number := NULL;
  125. DBGANY:          81 TEXTNOD =   doconvert         boolean := FALSE;
  126. DBGANY:          82 TEXTNOD =   savepiecename     boolean := FALSE;
  127. DBGANY:          83 TEXTNOD =   transontarget     boolean := FALSE;
  128. DBGANY:          84 TEXTNOD =   transonlyundo     boolean := FALSE;
  129. DBGANY:          85 TEXTNOD =   convertdb         boolean := FALSE;
  130. DBGANY:          86 TEXTNOD =   processfile       boolean := TRUE;
  131. DBGANY:          87 TEXTNOD =   isomf             boolean;
  132. DBGANY:          88 TEXTNOD =   istmplt           boolean;
  133. DBGANY:          89 TEXTNOD =   isasm             boolean;
  134. DBGANY:          90 TEXTNOD =   validatecmd       boolean;
  135. DBGANY:          91 TEXTNOD =   validateopt       boolean;
  136. DBGANY:          92 TEXTNOD =   newcorrupt        boolean;   -- TRUE if new corruption is found
  137. DBGANY:          93 TEXTNOD =   updateok          boolean;
  138. DBGANY:          94 TEXTNOD =   snapshot_cf       boolean;
  139. DBGANY:          95 TEXTNOD =   /* Multi-section backup fields */
  140. DBGANY:          96 TEXTNOD =   msb_secbytes      number := 0;
  141. DBGANY:          97 TEXTNOD =   msb_file_size     number;
  142. DBGANY:          98 TEXTNOD =   msb_set_stamp     number;
  143. DBGANY:          99 TEXTNOD =   msb_set_count     number;
  144. DBGANY:         100 TEXTNOD =   msb_section_size  number;
  145. DBGANY:         101 TEXTNOD =   msb_first_section number;
  146. DBGANY:         102 TEXTNOD =   msb_section_count number;
  147. DBGANY:         103 TEXTNOD =   msb_piece_number  number;
  148. DBGANY:         104 TEXTNOD =   msb_piece_count   number;
  149. DBGANY:         105 TEXTNOD =   cnvrt_need_format exception;
  150. DBGANY:         106 TEXTNOD =   bkp_need_format   exception;
  151. DBGANY:         107 TEXTNOD =   pragma exception_init(cnvrt_need_format, -20038);
  152. DBGANY:         108 TEXTNOD =   pragma exception_init(bkp_need_format, -20045);
  153. DBGANY:         109 TEXTNOD = begin
  154. DBGANY:         110 TEXTNOD =
  155. DBGANY:         111 PRMVAL =  backup_level := null;
  156. DBGANY:         112 TEXTNOD =   -- set docopies and convert (if any)
  157. DBGANY:         113 TEXTNOD =
  158. DBGANY:         114 PRMVAL =  docopies := true; cnvrtfr := true; pltfrmto := 13; pltfrmfr := 1; transontarget := false;
  159. DBGANY:         115 TEXTNOD =   -- set rsid
  160. DBGANY:         116 TEXTNOD =
  161. DBGANY:         117 PRMVAL =  rsid := 9;
  162. DBGANY:         118 TEXTNOD =   -- set rsts
  163. DBGANY:         119 TEXTNOD =
  164. DBGANY:         120 PRMVAL =  rsts := 1014808195;
  165. DBGANY:         121 TEXTNOD =   -- set reusefile
  166. DBGANY:         122 TEXTNOD =
  167. DBGANY:         123 PRMVAL =  reusefile := false;
  168. DBGANY:         124 TEXTNOD =   -- set validatecmd and validateopt := FALSE/TRUE
  169. DBGANY:         125 TEXTNOD =
  170. DBGANY:         126 PRMVAL =  validatecmd := false; validateopt := false;
  171. DBGANY:         127 TEXTNOD =   -- set docompress := FALSE/TRUE
  172. DBGANY:         128 TEXTNOD =
  173. DBGANY:         129 PRMVAL =  docompress := false;
  174. DBGANY:         130 TEXTNOD =   -- set msb_secbytes
  175. DBGANY:         131 TEXTNOD =
  176. DBGANY:         132 PRMVAL =  msb_secbytes := 0;
  177. DBGANY:         133 TEXTNOD =   -- set compressalg
  178. DBGANY:         134 TEXTNOD =
  179. DBGANY:         135 PRMVAL =  compressalg := NULL;
  180. DBGANY:         136 TEXTNOD =   if pltfrmto is not null or pltfrmfr is not null then
  181. DBGANY:         137 TEXTNOD =      doconvert := true;
  182. DBGANY:         138 TEXTNOD =   end if;
  183. DBGANY:         139 TEXTNOD =   -- If returned FALSE, abort the backup job
  184. DBGANY:         140 TEXTNOD =   if (NOT beginBackupJobStep()) then
  185. DBGANY:         141 TEXTNOD =     return;
  186. DBGANY:         142 TEXTNOD =   end if;
  187. DBGANY:         143 TEXTNOD =
  188. DBGANY:         144 TEXTNOD =   sys.dbms_backup_restore.backupStatus(state, setid, stamp, pieceno, files,
  189. DBGANY:         145 TEXTNOD =                                        datafiles, incremental, nochecksum,
  190. DBGANY:         146 TEXTNOD =                                        device);
  191. DBGANY:         147 TEXTNOD =   if state = sys.dbms_backup_restore.BACKUP_NO_CONVERSATION then
  192. DBGANY:         148 TEXTNOD =     goto start_convo;
  193. DBGANY:         149 TEXTNOD =   elsif state = sys.dbms_backup_restore.BACKUP_NAMING_FILES then
  194. DBGANY:         150 TEXTNOD =     goto name_files;
  195. DBGANY:         151 TEXTNOD =   else
  196. DBGANY:         152 TEXTNOD =     goto create_piece;
  197. DBGANY:         153 TEXTNOD =   end if;
  198. DBGANY:         154 TEXTNOD = <<start_convo>>
  199. DBGANY:         155 TEXTNOD =   sys.dbms_backup_restore.setRmanStatusRowId(rsid=>rsid, rsts=>rsts);
  200. DBGANY:         156 TEXTNOD =   sys.dbms_backup_restore.backupSetDatafile(stamp, setid,
  201. DBGANY:         157 TEXTNOD =
  202. DBGANY:         158 PRMVAL = validateblk=>false,incremental=>false,nocatalog=>false,nochecksum=>false
  203. DBGANY:         159 TEXTNOD = ,
  204. DBGANY:         160 TEXTNOD =
  205. DBGANY:         161 PRMVAL = tag=>null
  206. DBGANY:         162 TEXTNOD = ,
  207. DBGANY:         163 TEXTNOD =                                             backup_level => backup_level,
  208. DBGANY:         164 TEXTNOD =                                             imagcp    => docopies,
  209. DBGANY:         165 TEXTNOD =                                             convertto => cnvrtto,
  210. DBGANY:         166 TEXTNOD =                                             convertfr => cnvrtfr,
  211. DBGANY:         167 TEXTNOD =                                             pltfrmto  => pltfrmto,
  212. DBGANY:         168 TEXTNOD =                                             pltfrmfr  => pltfrmfr,
  213. DBGANY:         169 TEXTNOD =                                             sameen    => sameen,
  214. DBGANY:         170 TEXTNOD =                                             convertdb => convertdb,
  215. DBGANY:         171 TEXTNOD =                                             validate  => validateopt,
  216. DBGANY:         172 TEXTNOD =                                             hdrupd    => hdrupd);
  217. DBGANY:         173 TEXTNOD =   if hdrupd then
  218. DBGANY:         174 TEXTNOD =      krmicd.writeMsg(6782);
  219. DBGANY:         175 TEXTNOD =      krmicd.writeMsg(6785);
  220. DBGANY:         176 TEXTNOD =      updateok := sys.dbms_backup_restore.UpdateHeaders();
  221. DBGANY:         177 TEXTNOD =      if not updateok then
  222. DBGANY:         178 TEXTNOD =         krmicd.writeMsg(6784);
  223. DBGANY:         179 TEXTNOD =         krmicd.writeMsg(8191,
  224. DBGANY:         180 TEXTNOD =                         sys.dbms_backup_restore.getParm(
  225. DBGANY:         181 TEXTNOD =                                    sys.dbms_backup_restore.TRACE_FILENAME));
  226. DBGANY:         182 TEXTNOD =      end if;
  227. DBGANY:         183 TEXTNOD =      krmicd.writeMsg(6783);
  228. DBGANY:         184 TEXTNOD =   end if;
  229. DBGANY:         185 TEXTNOD =   if (noct) then
  230. DBGANY:         186 TEXTNOD =     dontcare :=
  231. DBGANY:         187 TEXTNOD =       sys.dbms_backup_restore.getParm(sys.dbms_backup_restore.incr_noct);
  232. DBGANY:         188 TEXTNOD =   end if;
  233. DBGANY:         189 TEXTNOD =   if (nooptim) then
  234. DBGANY:         190 TEXTNOD =     dontcare :=
  235. DBGANY:         191 TEXTNOD =       sys.dbms_backup_restore.getParm(sys.dbms_backup_restore.full_nooptim);
  236. DBGANY:         192 TEXTNOD =   end if;
  237. DBGANY:         193 TEXTNOD =   -- Display appropriate message
  238. DBGANY:         194 TEXTNOD =   if docopies then
  239. DBGANY:         195 TEXTNOD =      -- convertdb messages are moved to budf_name
  240. DBGANY:         196 TEXTNOD =      if not convertdb then
  241. DBGANY:         197 TEXTNOD =         if doconvert then
  242. DBGANY:         198 TEXTNOD =            krmicd.writeMsg(8589, krmicd.getChid);
  243. DBGANY:         199 TEXTNOD =         else
  244. DBGANY:         200 TEXTNOD =            krmicd.writeMsg(8580, krmicd.getChid);
  245. DBGANY:         201 TEXTNOD =         end if;
  246. DBGANY:         202 TEXTNOD =      end if;
  247. DBGANY:         203 TEXTNOD =   else
  248. DBGANY:         204 TEXTNOD =      if backup_level is not null then
  249. DBGANY:         205 TEXTNOD =         if (docompress) then
  250. DBGANY:         206 TEXTNOD =            krmicd.writeMsg(8047, krmicd.getChid, to_char(backup_level));
  251. DBGANY:         207 TEXTNOD =         else
  252. DBGANY:         208 TEXTNOD =            krmicd.writeMsg(8048, krmicd.getChid, to_char(backup_level));
  253. DBGANY:         209 TEXTNOD =         end if;
  254. DBGANY:         210 TEXTNOD =      else
  255. DBGANY:         211 TEXTNOD =         if (docompress) then
  256. DBGANY:         212 TEXTNOD =            krmicd.writeMsg(8046, krmicd.getChid);
  257. DBGANY:         213 TEXTNOD =         elsif (validatecmd) then
  258. DBGANY:         214 TEXTNOD =            krmicd.writeMsg(8140, krmicd.getChid);
  259. DBGANY:         215 TEXTNOD =         else
  260. DBGANY:         216 TEXTNOD =            krmicd.writeMsg(8008, krmicd.getChid);
  261. DBGANY:         217 TEXTNOD =         end if;
  262. DBGANY:         218 TEXTNOD =      end if;
  263. DBGANY:         219 TEXTNOD =   end if;
  264. DBGANY:         220 TEXTNOD =   setBackupParams(docopies);
  265. DBGANY:         221 TEXTNOD = <<name_files>>
  266. DBGANY:         222 TEXTNOD =   deb('budf_start', 'set_stamp=' || stamp || ' set_count=' || setid,
  267. DBGANY:         223 TEXTNOD =       rman_constant.DEBUG_IO, rman_constant.LEVEL_MIN);
  268. DBGANY:         224 TEXTNOD = -- bucv_name
  269. DBGANY:         225 TEXTNOD =
  270. DBGANY:         226 PRMVAL =  memnum := 1;
  271. DBGANY:         227 TEXTNOD =
  272. DBGANY:         228 PRMVAL =  foreign_dbname := 'WINORCL'; foreign_dbid := 2162311502; tsname := 'TBSSOLARIS'; dfnumber := 8; fname := '/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF';
  273. DBGANY:         229 TEXTNOD =   if files < memnum then
  274. DBGANY:         230 TEXTNOD =     sys.dbms_backup_restore.convertDataFileCopy(fname,
  275. DBGANY:         231 PRMVAL = max_corrupt=>0
  276. DBGANY:         232 TEXTNOD = );
  277. DBGANY:         233 TEXTNOD =     files := files + 1;
  278. DBGANY:         234 TEXTNOD =     krmicd.writeMsg(8506, fname);
  279. DBGANY:         235 TEXTNOD =   end if;
  280. DBGANY:         236 TEXTNOD = -- bu_create
  281. DBGANY:         237 TEXTNOD = <<create_piece>>
  282. DBGANY:         238 TEXTNOD =   sys.dbms_backup_restore.backupStatus(state, setid, stamp, pieceno, files,
  283. DBGANY:         239 TEXTNOD =                                          datafiles, incremental, nochecksum,
  284. DBGANY:         240 TEXTNOD =                                          device);
  285. DBGANY:         241 TEXTNOD =   starttime := sysdate;
  286. DBGANY:         242 TEXTNOD =   -- If we get here and the files count is zero, then all files in this
  287. DBGANY:         243 TEXTNOD =   -- backup set were skipped.
  288. DBGANY:         244 TEXTNOD =   if (files = 0) then
  289. DBGANY:         245 TEXTNOD =       sys.dbms_backup_restore.backupCancel;
  290. DBGANY:         246 TEXTNOD =       krmicd.writeMsg(8057, krmicd.getChid);
  291. DBGANY:         247 TEXTNOD =   else
  292. DBGANY:         248 TEXTNOD =       -- ncopies will be substituted for ncopies := <number>
  293. DBGANY:         249 TEXTNOD =
  294. DBGANY:         250 PRMVAL =  ncopies := 1;
  295. DBGANY:         251 TEXTNOD =       if (ncopies = 0) then
  296. DBGANY:         252 TEXTNOD =          ncopies := krmicd.getBackupCopies(backup_type, krmicd.getDevType);
  297. DBGANY:         253 TEXTNOD =       end if;
  298. DBGANY:         254 TEXTNOD =       sys.dbms_backup_restore.setLimit(sys.dbms_backup_restore.dupcnt,
  299. DBGANY:         255 TEXTNOD =                                        ncopies);
  300. DBGANY:         256 TEXTNOD =       loop
  301. DBGANY:         257 TEXTNOD =           if not docopies then
  302. DBGANY:         258 TEXTNOD =              krmicd.writeMsg(8038, krmicd.getChid, to_char(pieceno+1),
  303. DBGANY:         259 TEXTNOD =                              to_char(sysdate));
  304. DBGANY:         260 TEXTNOD =           end if;
  305. DBGANY:         261 TEXTNOD =           declare
  306. DBGANY:         262 TEXTNOD =               type names is table of varchar2(512) index by binary_integer;
  307. DBGANY:         263 TEXTNOD =               fnames             names;
  308. DBGANY:         264 TEXTNOD =               lformat            names;
  309. DBGANY:         265 TEXTNOD =               lyear              varchar2(4);
  310. DBGANY:         266 TEXTNOD =               lday               varchar2(2);
  311. DBGANY:         267 TEXTNOD =               lmonth             varchar2(2);
  312. DBGANY:         268 TEXTNOD =               copyaux            number;
  313. DBGANY:         269 TEXTNOD =               chtype             varchar2(16);
  314. DBGANY:         270 TEXTNOD =               busy_retries       number := 0;
  315. DBGANY:         271 TEXTNOD =               piecefmt           varchar2(512);
  316. DBGANY:         272 TEXTNOD =               orig_fname         varchar2(512);
  317. DBGANY:         273 TEXTNOD =               set_stamp          number;
  318. DBGANY:         274 TEXTNOD =               set_count          number;
  319. DBGANY:         275 TEXTNOD =               deffmt             binary_integer;
  320. DBGANY:         276 TEXTNOD =               dest               binary_integer := 0;
  321. DBGANY:         277 TEXTNOD =               netalias           varchar2(1000) := NULL;
  322. DBGANY:         278 TEXTNOD =           begin
  323. DBGANY:         279 TEXTNOD =           <<snapshot>>
  324. DBGANY:         280 TEXTNOD =               begin
  325. DBGANY:         281 TEXTNOD =               select to_char(sysdate, 'YYYY',
  326. DBGANY:         282 TEXTNOD =                              'NLS_CALENDAR=Gregorian'),
  327. DBGANY:         283 TEXTNOD =                      to_char(sysdate, 'MM',
  328. DBGANY:         284 TEXTNOD =                              'NLS_CALENDAR=Gregorian'),
  329. DBGANY:         285 TEXTNOD =                      to_char(sysdate, 'DD',
  330. DBGANY:         286 TEXTNOD =                              'NLS_CALENDAR=Gregorian')
  331. DBGANY:         287 TEXTNOD =                 into lyear, lmonth, lday
  332. DBGANY:         288 TEXTNOD =                 from x$dual;
  333. DBGANY:         289 TEXTNOD =               -- initialize  the format
  334. DBGANY:         290 TEXTNOD =               lformat(0) := NULL;
  335. DBGANY:         291 TEXTNOD =               -- The following are substituted for variable := value
  336. DBGANY:         292 TEXTNOD =               -- format will substituted by array of
  337. DBGANY:         293 TEXTNOD =               -- lformat(<number>) := '<format>' , nformat := <number>
  338. DBGANY:         294 TEXTNOD =               -- and dest
  339. DBGANY:         295 TEXTNOD =
  340. DBGANY:         296 PRMVAL =  lformat(0) := '/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF'; nformat := 1;
  341. DBGANY:         297 TEXTNOD =               -- Call genPieceName as many times as ncopies, stored
  342. DBGANY:         298 TEXTNOD =               -- generated names into array of fnames.  Check in the
  343. DBGANY:         299 TEXTNOD =               -- array for duplicated names
  344. DBGANY:         300 TEXTNOD =               copy := 0;
  345. DBGANY:         301 TEXTNOD =               while copy < ncopies loop
  346. DBGANY:         302 TEXTNOD =                   begin
  347. DBGANY:         303 TEXTNOD =                   -- find out the format to use (backup or channel format)
  348. DBGANY:         304 TEXTNOD =                   piecefmt := lformat(mod(copy, nformat));
  349. DBGANY:         305 TEXTNOD =                   krmicd.getFormat(format  => piecefmt,
  350. DBGANY:         306 TEXTNOD =                                    copy    => copy+1,
  351. DBGANY:         307 TEXTNOD =                                    deffmt  => deffmt,
  352. DBGANY:         308 TEXTNOD =                                    dest    => dest);
  353. DBGANY:         309 TEXTNOD =                   -- If doing image copies and the channel is not a DISK,
  354. DBGANY:         310 TEXTNOD =                   -- then generate a piece name for DISK type because server
  355. DBGANY:         311 TEXTNOD =                   -- implicitly creates a disk channel.
  356. DBGANY:         312 TEXTNOD =                   chtype := krmicd.getDevType;
  357. DBGANY:         313 TEXTNOD =                   if chtype is null then
  358. DBGANY:         314 TEXTNOD =                      chtype := 'N/A';
  359. DBGANY:         315 TEXTNOD =                   elsif (docopies and chtype != 'DISK') then
  360. DBGANY:         316 TEXTNOD =                      chtype := 'DISK';
  361. DBGANY:         317 TEXTNOD =                   end if;
  362. DBGANY:         318 TEXTNOD =
  363. DBGANY:         319 PRMVAL =  savepiecename := false;
  364. DBGANY:         320 TEXTNOD =                   if docopies then
  365. DBGANY:         321 TEXTNOD =                      orig_fname := fname;
  366. DBGANY:         322 TEXTNOD =                   else
  367. DBGANY:         323 TEXTNOD =                      orig_fname := NULL;
  368. DBGANY:         324 TEXTNOD =                   end if;
  369. DBGANY:         325 TEXTNOD =                   fnames(copy) :=
  370. DBGANY:         326 TEXTNOD =                       sys.dbms_backup_restore.genPieceName(
  371. DBGANY:         327 TEXTNOD =                          pno => pieceno+1,
  372. DBGANY:         328 TEXTNOD =                          set_count => setid,
  373. DBGANY:         329 TEXTNOD =                          set_stamp => stamp,
  374. DBGANY:         330 TEXTNOD =                          format => piecefmt,
  375. DBGANY:         331 TEXTNOD =                          copyno => copy+1,
  376. DBGANY:         332 TEXTNOD =                          devtype => chtype,
  377. DBGANY:         333 TEXTNOD =                          year => lyear,
  378. DBGANY:         334 TEXTNOD =                          month => lmonth,
  379. DBGANY:         335 TEXTNOD =                          day => lday,
  380. DBGANY:         336 TEXTNOD =                          dbid => foreign_dbid,
  381. DBGANY:         337 TEXTNOD =                          ndbname => foreign_dbname,
  382. DBGANY:         338 TEXTNOD =                          cfseq => NULL,     -- not used
  383. DBGANY:         339 TEXTNOD =                          fileno => dfnumber,
  384. DBGANY:         340 TEXTNOD =                          tsname => tsname,
  385. DBGANY:         341 TEXTNOD =                          logseq => to_char(sequence),
  386. DBGANY:         342 TEXTNOD =                          logthr => thread,
  387. DBGANY:         343 TEXTNOD =                          imagcp => docopies,
  388. DBGANY:         344 TEXTNOD =                          savepname => savepiecename,
  389. DBGANY:         345 TEXTNOD =                          fname => orig_fname,
  390. DBGANY:         346 TEXTNOD =                          forcnvrt => processfile);
  391. DBGANY:         347 TEXTNOD =                   -- check if the format specified is an ASM diskgroup
  392. DBGANY:         348 TEXTNOD =                   istmplt := FALSE;
  393. DBGANY:         349 TEXTNOD =                   if (chtype = 'DISK') then
  394. DBGANY:         350 TEXTNOD =                      sys.dbms_backup_restore.isfileNameOMF(
  395. DBGANY:         351 TEXTNOD =                                               fname   => fnames(copy),
  396. DBGANY:         352 TEXTNOD =                                               isomf   => isomf,
  397. DBGANY:         353 TEXTNOD =                                               isasm   => isasm,
  398. DBGANY:         354 TEXTNOD =                                               istmplt => istmplt);
  399. DBGANY:         355 TEXTNOD =                      if deffmt != 0 then
  400. DBGANY:         356 TEXTNOD =                         if (doconvert) then
  401. DBGANY:         357 TEXTNOD =                            raise cnvrt_need_format;
  402. DBGANY:         358 TEXTNOD =                         elsif (incremental and backup_level is null) then
  403. DBGANY:         359 TEXTNOD =                            raise bkp_need_format;
  404. DBGANY:         360 TEXTNOD =                         end if;
  405. DBGANY:         361 TEXTNOD =                      end if;
  406. DBGANY:         362 TEXTNOD =                   end if;
  407. DBGANY:         363 TEXTNOD =                   -- check previous names for collision
  408. DBGANY:         364 TEXTNOD =                   -- allow OMF template
  409. DBGANY:         365 TEXTNOD =                   copyaux := 0;
  410. DBGANY:         366 TEXTNOD =                   while (not istmplt and dest = 0 and copyaux < copy) loop
  411. DBGANY:         367 TEXTNOD =                       if fnames(copy) = fnames(copyaux) then
  412. DBGANY:         368 TEXTNOD =                           raise wrong_format;
  413. DBGANY:         369 TEXTNOD =                       end if;
  414. DBGANY:         370 TEXTNOD =                       copyaux := copyaux + 1;
  415. DBGANY:         371 TEXTNOD =                   end loop;
  416. DBGANY:         372 TEXTNOD =                   -- Store the names of the second copy onwards
  417. DBGANY:         373 TEXTNOD =                   if (copy > 0) then
  418. DBGANY:         374 TEXTNOD =                       sys.dbms_backup_restore.backupPieceCrtDupSet(copy,
  419. DBGANY:         375 TEXTNOD =                                                                 fnames(copy));
  420. DBGANY:         376 TEXTNOD =                   end if;
  421. DBGANY:         377 TEXTNOD =                   end;
  422. DBGANY:         378 TEXTNOD =                   copy := copy + 1;
  423. DBGANY:         379 TEXTNOD =               end loop;
  424. DBGANY:         380 TEXTNOD =               -- Ok, now do the actual piece creation, we use the 'old'
  425. DBGANY:         381 TEXTNOD =               -- interface
  426. DBGANY:         382 TEXTNOD =               copy := 0;
  427. DBGANY:         383 TEXTNOD =               -- Do not create a backup piece unless we are processing this
  428. DBGANY:         384 TEXTNOD =               -- file (i.e. no skip unnecessary files) and we are not
  429. DBGANY:         385 TEXTNOD =               -- converting database on target.
  430. DBGANY:         386 TEXTNOD =               if processfile and not transontarget then
  431. DBGANY:         387 TEXTNOD =                 sys.dbms_backup_restore.backupPieceCreate(
  432. DBGANY:         388 TEXTNOD =                      fname            => fnames(copy),
  433. DBGANY:         389 TEXTNOD =                      pieceno          => pieceno,
  434. DBGANY:         390 TEXTNOD =                      done             => done,
  435. DBGANY:         391 TEXTNOD =                      handle           => handle,
  436. DBGANY:         392 TEXTNOD =                      comment          => comment,
  437. DBGANY:         393 TEXTNOD =                      media            => media,
  438. DBGANY:         394 TEXTNOD =                      concur           => concur,
  439. DBGANY:         395 TEXTNOD =
  440. DBGANY:         396 PRMVAL = params=>null
  441. DBGANY:         397 TEXTNOD = ,
  442. DBGANY:         398 TEXTNOD =                      reuse            => reusefile,
  443. DBGANY:         399 TEXTNOD =                      archlog_failover => larchlog_failover,
  444. DBGANY:         400 TEXTNOD =                      deffmt           => deffmt,
  445. DBGANY:         401 TEXTNOD =                      recid            => cprecid,
  446. DBGANY:         402 TEXTNOD =                      stamp            => cpstamp,
  447. DBGANY:         403 TEXTNOD =                      tag              => cptag,
  448. DBGANY:         404 TEXTNOD =                      dest             => dest,
  449. DBGANY:         405 TEXTNOD =                      post10_2         => TRUE,
  450. DBGANY:         406 TEXTNOD =                      netalias         => netalias,
  451. DBGANY:         407 TEXTNOD =                      docompress       => docompress,
  452. DBGANY:         408 TEXTNOD =                      compressalg      => compressalg,
  453. DBGANY:         409 TEXTNOD =                      compressasof     => compressasof,
  454. DBGANY:         410 TEXTNOD =                      compresslopt     => compresslopt);
  455. DBGANY:         411 TEXTNOD =                 -- Needed for DUPLICATE DATABASE with no backup
  456. DBGANY:         412 TEXTNOD =                 krmicd.fileRestored(ftype      => rman_constant.DATAFILE,
  457. DBGANY:         413 TEXTNOD =                                     fno        => nvl(dfnumber, 0),
  458. DBGANY:         414 TEXTNOD =                                     thread     => 0,
  459. DBGANY:         415 TEXTNOD =                                     sequence   => 0,
  460. DBGANY:         416 TEXTNOD =                                     resetscn   => 0,
  461. DBGANY:         417 TEXTNOD =                                     resetstamp => 0,
  462. DBGANY:         418 TEXTNOD =                                     fname      => handle);
  463. DBGANY:         419 TEXTNOD =                 -- The post10_2 flag indicates that this RMAN client is from
  464. DBGANY:         420 TEXTNOD =                 -- version 10.2 or newer. The backup piece context is deleted
  465. DBGANY:         421 TEXTNOD =                 -- in backupCancel() from this version onwards.
  466. DBGANY:         422 TEXTNOD =                 sys.dbms_backup_restore.pieceContextGetNumber(sys.dbms_backup_restore.signal_change_tracking_error, chg_tracking_err);
  467. DBGANY:         423 TEXTNOD =                 if chg_tracking_err = 1 then
  468. DBGANY:         424 TEXTNOD =                    krmicd.writeMsg(8606);
  469. DBGANY:         425 TEXTNOD =                 end if;
  470. DBGANY:         426 TEXTNOD =               else
  471. DBGANY:         427 TEXTNOD =                 done := TRUE;
  472. DBGANY:         428 TEXTNOD =               end if;
  473. DBGANY:         429 TEXTNOD =               if larchlog_failover then
  474. DBGANY:         430 TEXTNOD =                  failoverdone := TRUE;
  475. DBGANY:         431 TEXTNOD =               end if;
  476. DBGANY:         432 TEXTNOD =               if concur then
  477. DBGANY:         433 TEXTNOD =                  krmicd.writeMsg(8135, fname);
  478. DBGANY:         434 TEXTNOD =               end if;
  479. DBGANY:         435 TEXTNOD =               if done then
  480. DBGANY:         436 TEXTNOD =                  sys.dbms_backup_restore.backupCancel();
  481. DBGANY:         437 TEXTNOD =               end if;
  482. DBGANY:         438 TEXTNOD =               exception
  483. DBGANY:         439 TEXTNOD =                   when sys.dbms_backup_restore.snapshot_enqueue_busy then
  484. DBGANY:         440 TEXTNOD =                      -- retry up to 180 times, waiting 20 seconds between retries,
  485. DBGANY:         441 TEXTNOD =                      -- thus attempting to get a snapshot control file for an hour.
  486. DBGANY:         442 TEXTNOD =                      -- Since we are displaying RMAN-08512 message, user will know
  487. DBGANY:         443 TEXTNOD =                      -- that RMAN is waiting to get snapshot enqueue.
  488. DBGANY:         444 TEXTNOD =                      if busy_retries = 180 then
  489. DBGANY:         445 TEXTNOD =                         krmicd.writeMsg(20029, 'cannot make a snapshot controlfile');
  490. DBGANY:         446 TEXTNOD =                         sys.dbms_backup_restore.backupCancel();
  491. DBGANY:         447 TEXTNOD =                         raise;
  492. DBGANY:         448 TEXTNOD =                      end if;
  493. DBGANY:         449 TEXTNOD =                      busy_retries := busy_retries + 1;
  494. DBGANY:         450 TEXTNOD =                      -- print this message every 5 minutes
  495. DBGANY:         451 TEXTNOD =                      if (mod(busy_retries, 15) = 0) then
  496. DBGANY:         452 TEXTNOD =                         krmicd.writeMsg(8512);
  497. DBGANY:         453 TEXTNOD =                      end if;
  498. DBGANY:         454 TEXTNOD =                      krmicd.sleep(20);
  499. DBGANY:         455 TEXTNOD =                      krmicd.clearErrors;
  500. DBGANY:         456 TEXTNOD =                      goto snapshot;
  501. DBGANY:         457 TEXTNOD =               end;
  502. DBGANY:         458 TEXTNOD =               krmicd.writeIOs(stamp, setid);
  503. DBGANY:         459 TEXTNOD =           end; -- snapshot controlfile stuff
  504. DBGANY:         460 TEXTNOD =           if not docopies then
  505. DBGANY:         461 TEXTNOD =               if ncopies = 1 then
  506. DBGANY:         462 TEXTNOD =                   krmicd.writeMsg(8044, krmicd.getChid, to_char(pieceno),
  507. DBGANY:         463 TEXTNOD =                                   to_char(sysdate));
  508. DBGANY:         464 TEXTNOD =               else
  509. DBGANY:         465 TEXTNOD =                   -- If we have multiple copies, all copies get the same
  510. DBGANY:         466 TEXTNOD =                   -- tag, print the tag at the beginning if we have one.
  511. DBGANY:         467 TEXTNOD =                   if cptag is not null then
  512. DBGANY:         468 TEXTNOD =                      krmicd.writeMsg(8053, krmicd.getChid, to_char(pieceno),
  513. DBGANY:         469 TEXTNOD =                                      to_char(sysdate), to_char(ncopies),
  514. DBGANY:         470 TEXTNOD =                                      cptag);
  515. DBGANY:         471 TEXTNOD =                   else
  516. DBGANY:         472 TEXTNOD =                      krmicd.writeMsg(8045, krmicd.getChid, to_char(pieceno),
  517. DBGANY:         473 TEXTNOD =                                      to_char(sysdate), to_char(ncopies));
  518. DBGANY:         474 TEXTNOD =                   end if;
  519. DBGANY:         475 TEXTNOD =               end if;
  520. DBGANY:         476 TEXTNOD =           end if;
  521. DBGANY:         477 TEXTNOD =           copy := 0;
  522. DBGANY:         478 TEXTNOD =           -- No messages unless the file is being processed
  523. DBGANY:         479 TEXTNOD =           -- (i.e. no skip unnecessary files) and we are not
  524. DBGANY:         480 TEXTNOD =           -- converting database on target.
  525. DBGANY:         481 TEXTNOD =           if processfile and not transontarget then
  526. DBGANY:         482 TEXTNOD =             while copy < ncopies loop
  527. DBGANY:         483 TEXTNOD =                 if (copy > 0) then
  528. DBGANY:         484 TEXTNOD =                     -- Retrieve output parameters from server structures
  529. DBGANY:         485 TEXTNOD =                     sys.dbms_backup_restore.backupPieceCrtDupGet(copy,
  530. DBGANY:         486 TEXTNOD =                                                                  handle,
  531. DBGANY:         487 TEXTNOD =                                                                  comment,
  532. DBGANY:         488 TEXTNOD =                                                                  media);
  533. DBGANY:         489 TEXTNOD =                 end if;
  534. DBGANY:         490 TEXTNOD =                 if not docopies then
  535. DBGANY:         491 TEXTNOD =                     if comment is null then comment := 'NONE'; end if;
  536. DBGANY:         492 TEXTNOD =                     -- If we have only one copy and a tag, print the tag
  537. DBGANY:         493 TEXTNOD =                     -- next to tbe handle.  If we have more than one piece
  538. DBGANY:         494 TEXTNOD =                     -- print the handle and comment only, the same if we do
  539. DBGANY:         495 TEXTNOD =                     -- not have a tag.
  540. DBGANY:         496 TEXTNOD =                     if ncopies = 1 and cptag is not null then
  541. DBGANY:         497 TEXTNOD =                        krmicd.writeMsg(8530, handle, cptag, comment);
  542. DBGANY:         498 TEXTNOD =                     else
  543. DBGANY:         499 TEXTNOD =                        krmicd.writeMsg(8503, handle, comment);
  544. DBGANY:         500 TEXTNOD =                     end if;
  545. DBGANY:         501 TEXTNOD =                 else
  546. DBGANY:         502 TEXTNOD =                     if doconvert then
  547. DBGANY:         503 TEXTNOD =                        krmicd.writeMsg(8588, handle);
  548. DBGANY:         504 TEXTNOD =                     else
  549. DBGANY:         505 TEXTNOD =                        if cptag is NOT NULL then
  550. DBGANY:         506 TEXTNOD =                           if cprecid = 0 and cpstamp = 0 then
  551. DBGANY:         507 TEXTNOD =                              krmicd.writeMsg(8592, handle, cptag);
  552. DBGANY:         508 TEXTNOD =                           else
  553. DBGANY:         509 TEXTNOD =                              krmicd.writeMsg(8586, handle, cptag,
  554. DBGANY:         510 TEXTNOD =                                              to_char(cprecid),
  555. DBGANY:         511 TEXTNOD =                                              to_char(cpstamp));
  556. DBGANY:         512 TEXTNOD =                           end if;
  557. DBGANY:         513 TEXTNOD =                        else
  558. DBGANY:         514 TEXTNOD =                           krmicd.writeMsg(8501, handle, to_char(cprecid),
  559. DBGANY:         515 TEXTNOD =                                           to_char(cpstamp));
  560. DBGANY:         516 TEXTNOD =                        end if;
  561. DBGANY:         517 TEXTNOD =                     end if;
  562. DBGANY:         518 TEXTNOD =                 end if;
  563. DBGANY:         519 TEXTNOD =                 copy := copy + 1;
  564. DBGANY:         520 TEXTNOD =             end loop;
  565. DBGANY:         521 TEXTNOD =           end if;
  566. DBGANY:         522 TEXTNOD =           if done then
  567. DBGANY:         523 TEXTNOD =              select sysdate-starttime into elapsed from x$dual;
  568. DBGANY:         524 TEXTNOD =              dur2time(elapsed, hours, mins, secs);
  569. DBGANY:         525 TEXTNOD =              if failoverdone then
  570. DBGANY:         526 TEXTNOD =                 krmicd.writemsg(8112, krmicd.getChid);
  571. DBGANY:         527 TEXTNOD =              end if;
  572. DBGANY:         528 TEXTNOD =              if not docopies then
  573. DBGANY:         529 TEXTNOD =                 m := 8540;
  574. DBGANY:         530 TEXTNOD =              elsif processfile then
  575. DBGANY:         531 TEXTNOD =                 if transontarget then
  576. DBGANY:         532 TEXTNOD =                    m := 8306;
  577. DBGANY:         533 TEXTNOD =                 elsif doconvert then
  578. DBGANY:         534 TEXTNOD =                    m := 8590;
  579. DBGANY:         535 TEXTNOD =                 end if;
  580. DBGANY:         536 TEXTNOD =              end if;
  581. DBGANY:         537 TEXTNOD =              if processfile then
  582. DBGANY:         538 TEXTNOD =                 krmicd.writemsg(m, krmicd.getChid,
  583. DBGANY:         539 TEXTNOD =                                 to_char(hours, 'FM09') || ':' ||
  584. DBGANY:         540 TEXTNOD =                                 to_char(mins,  'FM09') || ':' ||
  585. DBGANY:         541 TEXTNOD =                                 to_char(secs,  'FM09'));
  586. DBGANY:         542 TEXTNOD =              end if;
  587. DBGANY:         543 TEXTNOD =              exit;
  588. DBGANY:         544 TEXTNOD =           end if;
  589. DBGANY:         545 TEXTNOD =       end loop;
  590. DBGANY:         546 TEXTNOD =   end if;
  591. DBGANY:         547 TEXTNOD =   first_time := TRUE;  -- in case we will be deleting what we backed up
  592. DBGANY:         548 TEXTNOD = -- bu_end
  593. DBGANY:         549 TEXTNOD =   if (endBackupJobStep(FALSE, 0)) then null; end if;
  594. DBGANY:         550 TEXTNOD =   sys.dbms_backup_restore.setRmanStatusRowId(rsid=>0, rsts=>0);
  595. DBGANY:         551 TEXTNOD = exception
  596. DBGANY:         552 TEXTNOD =   when others then
  597. DBGANY:         553 TEXTNOD =      if (not endBackupJobStep(TRUE, sqlcode)) then
  598. DBGANY:         554 TEXTNOD =         raise;
  599. DBGANY:         555 TEXTNOD =      end if;
  600. DBGANY:         556 TEXTNOD =      sys.dbms_backup_restore.setRmanStatusRowId(rsid=>0, rsts=>0);
  601. DBGANY:         557 TEXTNOD = end;
  602. RMAN-00571: ===========================================================
  603. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  604. RMAN-00571: ===========================================================
  605. RMAN-00601: fatal error in recovery manager
  606. RMAN-03004: fatal error during execution of command
  607. RMAN-00600: internal error, arguments [6000] [] [] [] []
  608. [oracle@station76 ~]$ rman target  /

  609. Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jul 28 11:10:43 2019

  610. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  611. connected to target database: ORCL (DBID=1541741703)

  612. RMAN> show all;

  613. using target database control file instead of recovery catalog
  614. RMAN configuration parameters for database with db_unique_name ORCL are:
  615. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
  616. CONFIGURE BACKUP OPTIMIZATION ON;
  617. CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
  618. CONFIGURE CONTROLFILE AUTOBACKUP ON;
  619. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
  620. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
  621. CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
  622. CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET;
  623. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  624. CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  625. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
  626. CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
  627. CONFIGURE CHANNEL 1 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)';
  628. CONFIGURE CHANNEL 2 DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)';
  629. CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 250 M;
  630. CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(OB_MEDIA_FAMILY=station76)' MAXPIECESIZE 250 M;
  631. CONFIGURE MAXSETSIZE TO UNLIMITED; # default
  632. CONFIGURE ENCRYPTION FOR DATABASE OFF;
  633. CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
  634. CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
  635. CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
  636. CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default

  637. RMAN> CONFIGURE DEFAULT DEVICE TYPE TO disk;

  638. old RMAN configuration parameters:
  639. CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
  640. new RMAN configuration parameters:
  641. CONFIGURE DEFAULT DEVICE TYPE TO DISK;
  642. new RMAN configuration parameters are successfully stored

  643. RMAN>  convert datafile '/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF' from platform 'Solaris[tm] OE (32-bit)' format '/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF';

  644. Starting conversion at target at 2019-07-28:11:11:15
  645. allocated channel: ORA_DISK_1
  646. channel ORA_DISK_1: SID=60 device type=DISK
  647. allocated channel: ORA_DISK_2
  648. channel ORA_DISK_2: SID=68 device type=DISK
  649. allocated channel: ORA_DISK_3
  650. channel ORA_DISK_3: SID=51 device type=DISK
  651. allocated channel: ORA_DISK_4
  652. channel ORA_DISK_4: SID=65 device type=DISK
  653. allocated channel: ORA_DISK_5
  654. channel ORA_DISK_5: SID=27 device type=DISK
  655. allocated channel: ORA_DISK_6
  656. channel ORA_DISK_6: SID=75 device type=DISK
  657. allocated channel: ORA_DISK_7
  658. channel ORA_DISK_7: SID=76 device type=DISK
  659. allocated channel: ORA_DISK_8
  660. channel ORA_DISK_8: SID=77 device type=DISK
  661. channel ORA_DISK_1: starting datafile conversion
  662. input file name=/u01/app/oracle/oradata/orcl/TBSSOLARIS_ORI.DBF
  663. converted datafile=/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF
  664. channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
  665. Finished conversion at target at 2019-07-28:11:11:24

  666. RMAN>
复制代码
  1. [oracle@station76 ~]$ impdp system/oracle_4U  directory=dirlin dumpfile=TBSSOLARIS.DMP TRANSPORT_DATAFILES='/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF'     
  2. Import: Release 11.2.0.4.0 - Production on Sun Jul 28 11:16:26 2019

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  5. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  6. and Real Application Testing options
  7. Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
  8. Source time zone is +08:00 and target time zone is +00:00.
  9. Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=dirlin dumpfile=TBSSOLARIS.DMP TRANSPORT_DATAFILES=/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF
  10. Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
  11. Processing object type TRANSPORTABLE_EXPORT/TABLE
  12. Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
  13. Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Sun Jul 28 11:16:41 2019 elapsed 0 00:00:10

  14. [oracle@station76 ~]$
复制代码

AA.png

左下是alter database backup controlfile to trace as '....'的set 2脚本;右上是Windows下源头传送数据库的脚本;右下是模版建库时录制的脚本:
注意那个“set database”

------------------------------------------------------------------------------------------------附:在目的地转换的脚本:
  1. RUN {
  2.   CONVERT
  3.   FROM PLATFORM 'Microsoft Windows x86 64-bit'
  4.   PARALLELISM 1
  5. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\SYSTEM01.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-SYSTEM_FNO-1_05U7PHC2'
  6. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\SYSAUX01.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-SYSAUX_FNO-2_06U7PHC5'
  7. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\UNDOTBS01.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-UNDOTBS1_FNO-3_07U7PHC9'
  8. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\RCAT01.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-RCAT_FNO-5_08U7PHCC'
  9. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\TBS05319.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-TBS05319_FNO-6_09U7PHCD'
  10. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\TBS05319X.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-TBS05319X_FNO-7_0AU7PHCE'
  11. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\TBSSOLARIS.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-TBSSOLARIS_FNO-8_0BU7PHCG'
  12. DATAFILE 'C:\APP\APPLE\ORADATA\WINORCL\USERS01.DBF' FORMAT 'C:\APP\APPLE\DIRWIN\DATA_D-WINORCL_I-2162311502_TS-USERS_FNO-4_0CU7PHCH'
  13. ; }
复制代码








回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-9 11:01 , Processed in 0.042033 second(s), 36 queries .

快速回复 返回顶部 返回列表