问题描述:在搭建DG复制文件到备库时,出现以下异常:
RMAN> duplicate target database for standby from active database;
异常信息如下:
ORA-19504: failed to create file "/u01/app/oracle/fast_recovery_area/orcl151/control02.ctl"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such 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;
Starting Duplicate Db at 09-OCT-21
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=129 device type=DISK
contents of 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' ;
}
executing Memory Script
Starting backup at 09-OCT-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=192 device type=DISK
Finished backup at 09-OCT-21
contents of Memory Script:
{
backup as copy current controlfile for standby 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';
}
executing Memory Script
Starting backup at 09-OCT-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcl150.f tag=TAG20211009T091420 RECID=3 STAMP=1085476461
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 09-OCT-21
Starting restore at 09-OCT-21
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 09-OCT-21
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of 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';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/orcl151/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 09-OCT-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl150/system01.dbf
output file name=/u01/app/oracle/oradata/orcl151/system01.dbf tag=TAG20211009T091428
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=/u01/app/oracle/oradata/orcl150/sysaux01.dbf
output file name=/u01/app/oracle/oradata/orcl151/sysaux01.dbf tag=TAG20211009T091428
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl150/example01.dbf
output file name=/u01/app/oracle/oradata/orcl151/example01.dbf tag=TAG20211009T091428
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl150/undotbs01.dbf
output file name=/u01/app/oracle/oradata/orcl151/undotbs01.dbf tag=TAG20211009T091428
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=/u01/app/oracle/oradata/orcl150/users01.dbf
output file name=/u01/app/oracle/oradata/orcl151/users01.dbf tag=TAG20211009T091428
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 09-OCT-21
sql statement: alter system archive log current
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=3 STAMP=1085476509 file name=/u01/app/oracle/oradata/orcl151/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=4 STAMP=1085476509 file name=/u01/app/oracle/oradata/orcl151/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=1085476509 file name=/u01/app/oracle/oradata/orcl151/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=1085476509 file name=/u01/app/oracle/oradata/orcl151/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=1085476509 file name=/u01/app/oracle/oradata/orcl151/example01.dbf
Finished Duplicate Db at 09-OCT-21