ORA-19504、ORA-27040异常处理

发布时间:2021-10-15 00:00:00

问题描述:搭建DG复制文件到备库,执行以下语句

RMAN> duplicate target database for standby from active database;

出现报错,如下图所示

4.png

异常信息如下:

ORA-19504: failed tocreate file "/u01/app/oracle/fast_recovery_area/orcl151/control02.ctl"

ORA-27040: file createerror, unable to create file

Linux-x86_64 Error: 2: Nosuch file or directory

异常原因:控制文件control02.ctl创建失败.

解决方案:备库中手动创建/u01/app/oracle/fast_recovery_area/orcl151目录,注意权限与/u01/app/oracle/oradata/orcl151保持一致,

并确保备库数据库处于nomount状态,主备库监听和TNS配置无问题,再去执行duplicate操作,执行无异常发生.

以下为执行过程:

RMAN>duplicate target database for standby from active database;

StartingDuplicate Db at 09-OCT-21

usingtarget database control file instead of recovery catalog

allocatedchannel: ORA_AUX_DISK_1

channelORA_AUX_DISK_1: SID=129 device type=DISK

contentsof Memory Script:

{

   backup as copy reuse

   targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl150' auxiliary format

'/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcl151'   ;

}

executingMemory Script

Startingbackup at 09-OCT-21

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: SID=192 device type=DISK

Finishedbackup at 09-OCT-21

contentsof Memory Script:

{

   backup as copy current controlfile forstandby auxiliary format '/u01/app/oracle/oradata/orcl151/control01.ctl';

   restore clone controlfile to '/u01/app/oracle/fast_recovery_area/orcl151/control02.ctl' from

'/u01/app/oracle/oradata/orcl151/control01.ctl';

}

executingMemory Script

Startingbackup at 09-OCT-21

usingchannel ORA_DISK_1

channelORA_DISK_1: starting datafile copy

copyingstandby control file

outputfile name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl150.ftag=TAG20211009T091420 RECID=3 STAMP=1085476461

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finishedbackup at 09-OCT-21

Startingrestore at 09-OCT-21

usingchannel ORA_AUX_DISK_1

channelORA_AUX_DISK_1: copied control file copy

Finishedrestore at 09-OCT-21

contentsof Memory Script:

{

   sql clone 'alter database mount standbydatabase';

}

executingMemory Script

sqlstatement: alter database mount standby database

contentsof Memory Script:

{

   set newname for tempfile  1 to

"/u01/app/oracle/oradata/orcl151/temp01.dbf";

   switch clone tempfile all;

   set newname for datafile  1 to

"/u01/app/oracle/oradata/orcl151/system01.dbf";

   set newname for datafile  2 to

"/u01/app/oracle/oradata/orcl151/sysaux01.dbf";

   set newname for datafile  3 to

"/u01/app/oracle/oradata/orcl151/undotbs01.dbf";

   set newname for datafile  4 to

"/u01/app/oracle/oradata/orcl151/users01.dbf";

   set newname for datafile  5 to

"/u01/app/oracle/oradata/orcl151/example01.dbf";

   backup as copy reuse

   datafile 1 auxiliary format

"/u01/app/oracle/oradata/orcl151/system01.dbf"   datafile

2 auxiliary format

"/u01/app/oracle/oradata/orcl151/sysaux01.dbf"   datafile

3 auxiliary format

"/u01/app/oracle/oradata/orcl151/undotbs01.dbf"   datafile

4 auxiliary format

"/u01/app/oracle/oradata/orcl151/users01.dbf"   datafile

5 auxiliary format

"/u01/app/oracle/oradata/orcl151/example01.dbf"   ;

   sql 'alter system archive log current';

}

executingMemory Script

executingcommand: SET NEWNAME

renamedtempfile 1 to /u01/app/oracle/oradata/orcl151/temp01.dbf in control file

executingcommand: SET NEWNAME

executingcommand: SET NEWNAME

executingcommand: SET NEWNAME

executingcommand: SET NEWNAME

executingcommand: SET NEWNAME

Startingbackup at 09-OCT-21

usingchannel ORA_DISK_1

channelORA_DISK_1: starting datafile copy

inputdatafile file number=00001 name=/u01/app/oracle/oradata/orcl150/system01.dbf

outputfile name=/u01/app/oracle/oradata/orcl151/system01.dbf tag=TAG20211009T091428

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channelORA_DISK_1: starting datafile copy

inputdatafile file number=00002 name=/u01/app/oracle/oradata/orcl150/sysaux01.dbf

outputfile name=/u01/app/oracle/oradata/orcl151/sysaux01.dbf tag=TAG20211009T091428

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:15

channelORA_DISK_1: starting datafile copy

inputdatafile file number=00005 name=/u01/app/oracle/oradata/orcl150/example01.dbf

outputfile name=/u01/app/oracle/oradata/orcl151/example01.dbf tag=TAG20211009T091428

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

channelORA_DISK_1: starting datafile copy

inputdatafile file number=00003 name=/u01/app/oracle/oradata/orcl150/undotbs01.dbf

outputfile name=/u01/app/oracle/oradata/orcl151/undotbs01.dbf tag=TAG20211009T091428

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

channelORA_DISK_1: starting datafile copy

inputdatafile file number=00004 name=/u01/app/oracle/oradata/orcl150/users01.dbf

outputfile name=/u01/app/oracle/oradata/orcl151/users01.dbf tag=TAG20211009T091428

channelORA_DISK_1: datafile copy complete, elapsed time: 00:00:01

Finishedbackup at 09-OCT-21

sqlstatement: alter system archive log current

contentsof Memory Script:

{

   switch clone datafile all;

}

executingMemory Script

datafile1 switched to datafile copy

inputdatafile copy RECID=3 STAMP=1085476509 filename=/u01/app/oracle/oradata/orcl151/system01.dbf

datafile2 switched to datafile copy

inputdatafile copy RECID=4 STAMP=1085476509 filename=/u01/app/oracle/oradata/orcl151/sysaux01.dbf

datafile3 switched to datafile copy

inputdatafile copy RECID=5 STAMP=1085476509 filename=/u01/app/oracle/oradata/orcl151/undotbs01.dbf

datafile4 switched to datafile copy

inputdatafile copy RECID=6 STAMP=1085476509 filename=/u01/app/oracle/oradata/orcl151/users01.dbf

datafile5 switched to datafile copy

inputdatafile copy RECID=7 STAMP=1085476509 filename=/u01/app/oracle/oradata/orcl151/example01.dbf

FinishedDuplicate Db at 09-OCT-21


<<