暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

oracle 19c datagruad复制备库RMAN-05535

原创 戴先生 2022-11-09
750

[redhat8:oracle]:/u01/app/oracle/oradata/WQJDB>rman target sys/oracle123@wqjdb auxiliary sys/oracle123@wqjdbadg

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Nov 10 01:05:32 2022
Version 19.14.0.0.0

Copyright © 1982, 2019, Oracle and/or its affiliates. All rights reserved.

connected to target database: WQJDB (DBID=1538044496)
connected to auxiliary database: WQJDB (not mounted)

RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
Starting Duplicate Db at 10-NOV-22
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=254 device type=DISK
current log archived

contents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format ‘/u01/app/oracle/product/19c/db_1/dbs/orapwwqjdbadg’ ;
}
executing Memory Script

Starting backup at 10-NOV-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
Finished backup at 10-NOV-22

contents of Memory Script:
{
restore clone from service ‘wqjdb’ standby controlfile;
}
executing Memory Script

Starting restore at 10-NOV-22
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 wqjdb
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/control01.ctl
Finished restore at 10-NOV-22

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

sql statement: alter database mount standby database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/WQJDB/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/WQJDB/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/WQJDB/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/WQJDB/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /stage/datafile01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u01/app/oracle/oradata/WQJDB/temp01.dbf conflicts with a file used by the target database

contents of Memory Script:
{
set newname for tempfile 1 to
“/u01/app/oracle/oradata/WQJDB/temp01.dbf”;
switch clone tempfile all;
set newname for datafile 1 to
“/u01/app/oracle/oradata/WQJDB/system01.dbf”;
set newname for datafile 2 to
“/u01/app/oracle/oradata/WQJDB/sysaux01.dbf”;
set newname for datafile 3 to
“/u01/app/oracle/oradata/WQJDB/undotbs01.dbf”;
set newname for datafile 4 to
“/u01/app/oracle/oradata/WQJDB/users01.dbf”;
set newname for datafile 5 to
“/stage/datafile01.dbf”;
restore
from nonsparse from service
‘wqjdb’ clone database
;
sql ‘alter system archive log current’;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/WQJDB/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 restore at 10-NOV-22
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 wqjdb
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/WQJDB/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/WQJDB/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
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/WQJDB/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
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/WQJDB/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /stage/datafile01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 10-NOV-22

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
restore clone force from service ‘wqjdb’
archivelog from scn 1132743;
switch clone datafile all;
}
executing Memory Script

Starting restore at 10-NOV-22
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=45
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service wqjdb
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=46
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 10-NOV-22

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1120352760 file name=/u01/app/oracle/oradata/WQJDB/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=1120352760 file name=/u01/app/oracle/oradata/WQJDB/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=1120352760 file name=/u01/app/oracle/oradata/WQJDB/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=1120352760 file name=/u01/app/oracle/oradata/WQJDB/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=1120352760 file name=/stage/datafile01.dbf

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

executing command: SET until clause

Starting recover at 10-NOV-22
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 45 is already on disk as file /u01/app/oracle/archivelog/1_45_1117343440.dbf
archived log for thread 1 with sequence 46 is already on disk as file /u01/app/oracle/archivelog/1_46_1117343440.dbf
archived log file name=/u01/app/oracle/archivelog/1_45_1117343440.dbf thread=1 sequence=45
archived log file name=/u01/app/oracle/archivelog/1_46_1117343440.dbf thread=1 sequence=46
media recovery complete, elapsed time: 00:00:00
Finished recover at 10-NOV-22

contents of Memory Script:
{
delete clone force archivelog all;
}
executing Memory Script

released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
deleted archived log
archived log file name=/u01/app/oracle/archivelog/1_45_1117343440.dbf RECID=1 STAMP=1120352758
deleted archived log
archived log file name=/u01/app/oracle/archivelog/1_46_1117343440.dbf RECID=2 STAMP=1120352759
Deleted 2 objects

RMAN-05535: warning: All redo log files were not defined properly.
RMAN-05535: warning: All redo log files were not defined properly.
RMAN-05535: warning: All redo log files were not defined properly.
RMAN-05535: warning: All redo log files were not defined properly.
RMAN-05535: warning: All redo log files were not defined properly.
RMAN-05535: warning: All redo log files were not defined properly.
Finished Duplicate Db at 10-NOV-22

操作环境、软件版本等信息
redhat8.4
oracle19.3

尝试过的解决方法
1.两边路径一致设置转换参数报错依旧。
SQL> show parameter convert

NAME TYPE VALUE


db_file_name_convert string /u01/app/oracle/oradata/WQJDB/
, /u01/app/oracle/oradata/WQJDB/, /stage/, /stage/
log_file_name_convert string /u01/app/oracle/oradata/WQJDB/
, /u01/app/oracle/oradata/WQJDB/

2.设置standby_file_management 为MANUAL也是报错
standby_file_management string MANUAL
RMAN-05535: warning: All redo log files were not defined properly.

# 最终解决方案:
duplicate完之后
检查生产
SQL> select group#,member from v$logfile;

GROUP# MEMBER
复制

 1 /u01/app/oracle/oradata/WQJDB/redo01.log
 2 /u01/app/oracle/oradata/WQJDB/redo02.log
 3 /u01/app/oracle/oradata/WQJDB/redo03.log
 4 /u01/app/oracle/oradata/WQJDB/standlog1.log
 5 /u01/app/oracle/oradata/WQJDB/standlog2.log
 6 /u01/app/oracle/oradata/WQJDB/standlog3.log
复制

检查备库:
SQL> select member from v$logfile;

MEMBER

/u01/app/oracle/product/19c/db_1/dbs/broken0
/u01/app/oracle/product/19c/db_1/dbs/broken1
/u01/app/oracle/product/19c/db_1/dbs/broken2
/u01/app/oracle/product/19c/db_1/dbs/broken3
/u01/app/oracle/product/19c/db_1/dbs/broken4
/u01/app/oracle/product/19c/db_1/dbs/broken5

6 rows selected.

SOLUTION :
execute the rename like the following:

alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken0’ to ‘/u01/app/oracle/oradata/WQJDB/redo01.log’;
alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken1’ to ‘/u01/app/oracle/oradata/WQJDB/redo02.log’;
alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken2’ to ‘/u01/app/oracle/oradata/WQJDB/redo03.log’;
alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken3’ to ‘/u01/app/oracle/oradata/WQJDB/standlog1.log’;
alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken4’ to ‘/u01/app/oracle/oradata/WQJDB/standlog2.log’;
alter database rename file ‘/u01/app/oracle/product/19c/db_1/dbs/broken5’ to ‘/u01/app/oracle/oradata/WQJDB/standlog3.log’;

由于RMAN备份,数据库处于不一致状态,不能直接open,我们先开始物理备库的日志应用:
recover managed standby database using current logfile disconnect;
recover managed standby database cancel;
打开物理备库:
alter database open;
再追加日志,开始恢复
recover managed standby database using current logfile disconnect;
然后检查进程:
SQL> select process,status, GROUP#, SEQUENCE#,block#,blocks from v$managed_standby;

PROCESS STATUS GROUP# SEQUENCE# BLOCK# BLOCKS


ARCH CLOSING 4 48 1 4
DGRD ALLOCATED N/A 0 0 0
DGRD ALLOCATED N/A 0 0 0
ARCH CLOSING 5 49 1 39
ARCH CLOSING 4 50 1 7
ARCH CLOSING 6 47 1 1234
RFS IDLE N/A 0 0 0
RFS IDLE 3 51 926 1
MRP0 APPLYING_LOG N/A 51 926 409600

9 rows selected.
同步正常。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论