设为首页 收藏本站
查看: 153|回复: 0

[经验分享] rman duplicate遇到ORA-17628 该怎么解决?

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-1-12 08:40:13 | 显示全部楼层 |阅读模式
今天重新做了一次rman duplicate操作
[oracle@ora02 ~]$ rman target / auxiliary sys/oracle@PROD

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 11 15:32:10 2016

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

connected to target database: ORCL (DBID=1427785672)
connected to auxiliary database: PROD (not mounted)

RMAN> DUPLICATE TARGET DATABASE TO PROD FROM ACTIVE DATABASE
2> spfile PARAMETER_VALUE_CONVERT 'ORCL','PROD'
3> set CONTROL_FILES='/u01/app/oracle/oradata/PROD/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'
4> set DB_FILE_NAME_CONVERT='ORCL','PROD'
5> set LOG_FILE_NAME_CONVERT='ORCL','PROD';
执行最后报错
Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/11/2016 15:33:46
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:37
ORA-17628: Oracle error 19505 returned by remote Oracle server

查看备库的时候,发现在备库,参数文件和控制文件都已经复制过去了。这时检查备库,发现备库的实例处于关闭状态。手动启动备库的实例,报错,参数文件和控制文件中的db_name不一致,可以断定,rman修改控制文件的这一步就没完成。
该创建的目录应该都创建了呀!oracle网络通的,静态监听处于启动状态,要不然文件也复制不过来呀!主库的归档也开了,并且最起码有一个归档。检查一下各种文件吧!
RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    740      SYSTEM               ***     /u02/app/oracle/oradata/ORCL/system01.dbf
2    520      SYSAUX               ***     /u02/app/oracle/oradata/ORCL/sysaux01.dbf
3    70       UNDOTBS1             ***     /u02/app/oracle/oradata/ORCL/undotbs01.dbf
4    5        USERS                ***     /u02/app/oracle/oradata/ORCL/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       /u01/app/oracle/oradata/ORCL/temp01.dbf

然后就发现了问题,怎么数据文件没有在它通常的位置?突然想起,前几天还做了一些改路径的操作。再回头看rman报出的日志
Starting backup at 2016-01-11 15:33:33
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/app/oracle/oradata/ORCL/system01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:34
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/app/oracle/oradata/ORCL/sysaux01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:35
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/app/oracle/oradata/ORCL/undotbs01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:36
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/app/oracle/oradata/ORCL/users01.dbf
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                536874064 bytes
Database Buffers             289406976 bytes
Redo Buffers                   6565888 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
''PROD'' comment=
''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
}

job一直在失败,因为备库就不存在对应的目录。知道问题,解决就简单了,在DB_FILE_NAME_CONVERT里加个对应关系就好了。

RMAN> connect auxiliary sys/oracle@PROD

connected to auxiliary database: PROD (not mounted)

RMAN> DUPLICATE TARGET DATABASE TO PROD FROM ACTIVE DATABASE
2> spfile PARAMETER_VALUE_CONVERT 'ORCL','PROD'
3> set CONTROL_FILES='/u01/app/oracle/oradata/PROD/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'
4> set DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/PROD','/u02/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/PROD'
5> set LOG_FILE_NAME_CONVERT='ORCL','PROD';

Starting Duplicate Db at 2016-01-11 15:54:32
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileORCL.ora' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora'   ;
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora''";
}
executing Memory Script

Starting backup at 2016-01-11 15:54:32
using channel ORA_DISK_1
Finished backup at 2016-01-11 15:54:34

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
''PROD'' comment=
''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest =
''/u01/app/oracle/admin/PROD/adump'' comment=
'''' scope=spfile";
   sql clone "alter system set  dispatchers =
''(PROTOCOL=TCP) (SERVICE=PRODXDB)'' comment=
'''' scope=spfile";
   sql clone "alter system set  CONTROL_FILES =
''/u01/app/oracle/oradata/PROD/control01.ctl'', ''/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'' comment=
'''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
''/u01/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'', ''/u02/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'' comment=
'''' scope=spfile";
   sql clone "alter system set  LOG_FILE_NAME_CONVERT =
''ORCL'', ''PROD'' comment=
'''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''PROD'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/PROD/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=PRODXDB)'' comment= '''' scope=spfile

sql statement: alter system set  CONTROL_FILES =  ''/u01/app/oracle/oradata/PROD/control01.ctl'', ''/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''/u01/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'', ''/u02/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'' comment= '''' scope=spfile

sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''ORCL'', ''PROD'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                536874064 bytes
Database Buffers             289406976 bytes
Redo Buffers                   6565888 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
''PROD'' comment=
''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/app/oracle/oradata/PROD/control01.ctl';
   restore clone controlfile to  '/u01/app/oracle/fast_recovery_area/PROD/control02.ctl' from
'/u01/app/oracle/oradata/PROD/control01.ctl';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                536874064 bytes
Database Buffers             289406976 bytes
Redo Buffers                   6565888 bytes

Starting backup at 2016-01-11 15:54:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_ORCL.f tag=TAG20160111T155447 RECID=9 STAMP=900863687
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2016-01-11 15:54:48

Starting restore at 2016-01-11 15:54:48
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=133 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 2016-01-11 15:54:49

database mounted

contents of Memory Script:
{
   set newname for datafile  1 to
"/u01/app/oracle/oradata/PROD/system01.dbf";
   set newname for datafile  2 to
"/u01/app/oracle/oradata/PROD/sysaux01.dbf";
   set newname for datafile  3 to
"/u01/app/oracle/oradata/PROD/undotbs01.dbf";
   set newname for datafile  4 to
"/u01/app/oracle/oradata/PROD/users01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
"/u01/app/oracle/oradata/PROD/system01.dbf"   datafile
2 auxiliary format
"/u01/app/oracle/oradata/PROD/sysaux01.dbf"   datafile
3 auxiliary format
"/u01/app/oracle/oradata/PROD/undotbs01.dbf"   datafile
4 auxiliary format
"/u01/app/oracle/oradata/PROD/users01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 2016-01-11 15:54:54
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/app/oracle/oradata/ORCL/system01.dbf
output file name=/u01/app/oracle/oradata/PROD/system01.dbf tag=TAG20160111T155454
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/app/oracle/oradata/ORCL/sysaux01.dbf
output file name=/u01/app/oracle/oradata/PROD/sysaux01.dbf tag=TAG20160111T155454
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/app/oracle/oradata/ORCL/undotbs01.dbf
output file name=/u01/app/oracle/oradata/PROD/undotbs01.dbf tag=TAG20160111T155454
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/app/oracle/oradata/ORCL/users01.dbf
output file name=/u01/app/oracle/oradata/PROD/users01.dbf tag=TAG20160111T155454
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2016-01-11 15:55:28

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_01_11/o1_mf_1_23_c96qzjkx_.arc" auxiliary format
"/u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_%u_.arc"   ;
   catalog clone recovery area;
   switch clone datafile all;
}
executing Memory Script

Starting backup at 2016-01-11 15:55:28
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=23 RECID=18 STAMP=900863728
output file name=/u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 2016-01-11 15:55:29

searching for all files in the recovery area

List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc

List of files in Recovery Area not managed by the database
==========================================================
File Name: /u01/app/oracle/fast_recovery_area/PROD/control02.ctl
  RMAN-07526: Reason: File is not an Oracle Managed File

number of files not managed by recovery area is 1, totaling 9.28MB

datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=900863730 file name=/u01/app/oracle/oradata/PROD/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=900863730 file name=/u01/app/oracle/oradata/PROD/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=900863730 file name=/u01/app/oracle/oradata/PROD/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=900863730 file name=/u01/app/oracle/oradata/PROD/users01.dbf

contents of Memory Script:
{
   set until scn  1026162;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 2016-01-11 15:55:29
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 23 is already on disk as file /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc thread=1 sequence=23
media recovery complete, elapsed time: 00:00:00
Finished recover at 2016-01-11 15:55:30
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                536874064 bytes
Database Buffers             289406976 bytes
Redo Buffers                   6565888 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
''PROD'' comment=
''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''PROD'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                536874064 bytes
Database Buffers             289406976 bytes
Redo Buffers                   6565888 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "PROD" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
LOGFILE
  GROUP   1 ( '/u01/app/oracle/oradata/PROD/redo01.log' ) SIZE 50 M  REUSE,
  GROUP   2 ( '/u01/app/oracle/oradata/PROD/redo02.log' ) SIZE 50 M  REUSE,
  GROUP   3 ( '/u01/app/oracle/oradata/PROD/redo03.log' ) SIZE 50 M  REUSE
DATAFILE
  '/u01/app/oracle/oradata/PROD/system01.dbf'
CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
"/u01/app/oracle/oradata/PROD/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/PROD/sysaux01.dbf",
"/u01/app/oracle/oradata/PROD/undotbs01.dbf",
"/u01/app/oracle/oradata/PROD/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/PROD/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/PROD/sysaux01.dbf RECID=1 STAMP=900863742
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/PROD/undotbs01.dbf RECID=2 STAMP=900863742
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/PROD/users01.dbf RECID=3 STAMP=900863742

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=900863742 file name=/u01/app/oracle/oradata/PROD/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=900863742 file name=/u01/app/oracle/oradata/PROD/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=900863742 file name=/u01/app/oracle/oradata/PROD/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 2016-01-11 15:55:45



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-163264-1-1.html 上篇帖子: linux 学习 下篇帖子: CentOS6 手动编译升级 gcc
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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