暂无图片
分享
主流小五
2020-04-06
rman复制到备库

RMAN> duplicate target database for standby from active database nofilenamecheck;

Starting Duplicate Db at 06-APR-20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=355 device type=DISK

contents of Memory Script:
{
backup as copy reuse
targetfile ‘+DATA/GKPTTJ/PASSWORD/pwdgkpttj.276.1036110745’ auxiliary format
‘/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapwdg’ ;
}
executing Memory Script

Starting backup at 06-APR-20
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=377 instance=gkpttj1 device type=DISK
Finished backup at 06-APR-20

contents of Memory Script:
{
sql clone “create spfile from memory”;
shutdown clone immediate;
startup clone nomount;
restore clone from service ‘gkpttj’ standby controlfile;
}
executing Memory Script

sql statement: create spfile from memory

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 1593835520 bytes

Fixed Size 2924880 bytes
Variable Size 1006636720 bytes
Database Buffers 570425344 bytes
Redo Buffers 13848576 bytes

Starting restore at 06-APR-20
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=243 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service gkpttj
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/app/oracle/oradata/DG/controlfile/o1_mf_h8op3nqs_.ctl
Finished restore at 06-APR-20

contents of Memory Script:
{
sql clone ‘alter database mount standby database’;
}
executing Memory Script

sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
set newname for tempfile 1 to
“/u01/app/oracle/oradata/dg/temp.284.1036110993”;
set newname for tempfile 2 to
“+DATA/GKPTTJ/FD9AC20F64D244D7E043B6A9E80A2F2F/DATAFILE/pdbseed_temp012020-03-27_12-37-21-am.dbf”;
set newname for tempfile 3 to
“+DATA”;
set newname for tempfile 4 to
“+DATA”;
set newname for tempfile 5 to
“+DATA”;
set newname for tempfile 6 to
“+DATA”;
set newname for tempfile 7 to
“+DATA”;
switch clone tempfile all;
set newname for datafile 1 to
“/u01/app/oracle/oradata/dg/system.279.1036110869”;
set newname for datafile 3 to
“/u01/app/oracle/oradata/dg/sysaux.280.1036110825”;
set newname for datafile 4 to
“/u01/app/oracle/oradata/dg/undotbs1.277.1036110915”;
set newname for datafile 5 to
“+DATA”;
set newname for datafile 6 to
“/u01/app/oracle/oradata/dg/users.278.1036110915”;
set newname for datafile 7 to
“+DATA”;
set newname for datafile 8 to
“/u01/app/oracle/oradata/dg/undotbs2.288.1036111531”;
set newname for datafile 9 to
“+DATA”;
set newname for datafile 10 to
“+DATA”;
set newname for datafile 11 to
“+DATA”;
set newname for datafile 12 to
“+DATA”;
set newname for datafile 13 to
“+DATA”;
set newname for datafile 14 to
“+DATA”;
set newname for datafile 15 to
“+DATA”;
set newname for datafile 16 to
“+DATA”;
set newname for datafile 17 to
“+DATA”;
set newname for datafile 18 to
“+DATA”;
set newname for datafile 19 to
“+DATA”;
set newname for datafile 20 to
“+DATA”;
set newname for datafile 21 to
“+DATA”;
set newname for datafile 22 to
“+DATA”;
set newname for datafile 23 to
“+DATA”;
restore
from service ‘gkpttj’ clone database
;
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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/dg/temp.284.1036110993 in control file
renamed tempfile 2 to +DATA/GKPTTJ/FD9AC20F64D244D7E043B6A9E80A2F2F/DATAFILE/pdbseed_temp012020-03-27_12-37-21-am.dbf in control file
renamed tempfile 3 to +DATA in control file
renamed tempfile 4 to +DATA in control file
renamed tempfile 5 to +DATA in control file
renamed tempfile 6 to +DATA in control file
renamed tempfile 7 to +DATA in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 06-APR-20
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service gkpttj
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/dg/system.279.1036110869
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service gkpttj
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/dg/sysaux.280.1036110825
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:26
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service gkpttj
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dg/undotbs1.277.1036110915
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service gkpttj
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to +DATA
dbms_backup_restore.restoreCancel() failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/06/2020 15:24:07
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
ORA-19660: some files in the backup set could not be verified
ORA-19661: datafile 5 could not be verified
ORA-19849: error while reading backup piece from service gkpttj
ORA-19504: failed to create file “+DATA”
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15001: diskgroup “DATA” does not exist or is not mounted
ORA-29701: unable to connect to Cluster Synchronization Service

RMAN>
已经尝试很多次了还是不行,备库的参数文件
image.png
主库的参数文件,
image.png
希望大神帮我看看,到底是哪里错了

收藏
分享
13条回答
默认
最新
你好我是李白

你的db_file_name_convert并没有写全主库有的所有数据文件路径,所以部分没有明确转换的路径使用了与主库相同的+datadg,造成了最后报错+datadg不存在。

登陆cdb,查询:
select name from v$datafile;
然后将所有主库有的数据文件路径均明确指定db_file_name_convert参数转换路径。

暂无图片 评论
暂无图片 有用 0
主流小五

image.png
我这里的datafile怎么这么多呢,这些数据文件是怎么产生的,我怎么指定只是+DATA/GKPTTJ/DATAFIEL目录下,不要其他目录下的,刚才删除的时候还删不掉
image.png

暂无图片 评论
暂无图片 有用 0
主流小五

之前我在主库上面进行了如下的操作
image.png

暂无图片 评论
暂无图片 有用 0
主流小五

image.png
现在已经将主库所有的数据文件路径进行了映射,还是不行
image.png

暂无图片 评论
暂无图片 有用 0
主流小五

image.png
这主库和备库的数据文件怎么会一样呢,备库不应该只有dg目录下的吗,怎么会有+DATA磁盘的呢

暂无图片 评论
暂无图片 有用 0
helios

+DATA开头这个是ASM磁盘,你就理解为等同/data这样的文件系统

set newname 路径要写对

注意上面2点你就能搞定了

暂无图片 评论
暂无图片 有用 0
主流小五

这里的set newname后面的路径应该是备库的路径吧,还有我的备库只是单文件系统没有磁盘的,如果是备库的路径的话,那么+DATA这就不对了,备库里面根本没有asm磁盘,这是什么原因呢

暂无图片 评论
暂无图片 有用 0
helios

你做RMAN恢复,备库没ASM,就用/文件系统,相关内容改成/文件系统,
这个文件系统是要存在的才可以,权限也要有。

暂无图片 评论
暂无图片 有用 0
周伟

从RAMN日志上来看,就是convert没有写全的了,你在主库上查询一下所有数据文件的id和路径,再将这些路径的convert写全,有多少就写多少了。dg配置没办法,这些全部都需要做。至于为什么会产生那些数字的路径,猜测这个和Oracle的OMF有关了,不建议你去随便删除它们,这些有些是实际路径的别名。至于这个data file 5, 你先查查他的id是多少,对应的在主库的路径又是什么,然后看看是否包含在convert里面,因为你的报错还在restore to +DATA.

暂无图片 评论
暂无图片 有用 0
有你就好

主库要传的数据文件不止在那一个目录下面,查一下主库所有的数据文件路径

暂无图片 评论
暂无图片 有用 0
你好我是李白

我看你的db_file_name_convert都是primary库的设置吧?
你duplicate到备库,备库db_file_name_convert参数要设置对呀,这个参数含义是两两一组,db_file_name_convert=转换前路径,转换后路径,转换前路径,转换后路径,
所以备库设置应该是主库路径在前,备库路径在后,你的贴图都是主库的设置,备库也要合理设置。

暂无图片 评论
暂无图片 有用 0
主流小五

在这里谢谢大家的热心回复,我第一次弄这个,开始的时候我并没有注意到我的数据文件是存放到多个地方,就按照网上的一个教程,设置了一个数据文件的存放路径,后来我在主库设置了所有数据文件的路径映射关系,还是不行,我又在备库设置了映射路径后才可以的。这个小问题也让我弄了好久,很感谢大家

暂无图片 评论
暂无图片 有用 0
主流小五
问题已关闭: 问题已经得到解决
暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏