DG-产生ORA-10458错误

2018-06-27

在配置oracle11g dataguard 时,启动备库alter database open时数据库报错:ORA-10458

ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/oracle/database/oradata/inds1/system01.dbf'

1、开始以为数据有问题,重传数据错误仍然。
全备主库,并传输备份集到备库的相同位置
rlwrap rman target sys/pass@db1 auxiliary sys/pass@db2
duplicate target database for standby from active database nofilenamecheck;
复制controlfile
alter database create standby controlfile as '/tmp/standby.ctl';
scp /tmp/standby.ctl oracle@db02:/tmp
在备库
cp /tmp/standby.ctl $ORACLE_BASE/oradata/$ORACLE_SID/control01.ctl
cp /tmp/standby.ctl $ORACLE_BASE/fast_recovery_area/$ORACLE_SID/control02.ctl
注意:Duplicate不会将primary上的temp表空间复制到standby库上,但是在将standby库启动到open时会自动创建,standby库上的redo log oracle也将会重新创建。

2、oerr ora 10458
10458, 00000, "standby database requires recovery" 备库不能够进行介质回复
// *Cause: A standby database was in a state requiring media recovery
// when an attempt was made to open the standby database.
// *Action: Perform the necessary recovery and open the standby database.

3、检查参数设置 log_archive_dest_2
show parameter LOG_ARCHIVE_DEST_2
主库:
SERVICE=INDS1 LGWR ASYNC NOAFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=INDS2
修改为alter system set log_archive_dest_2=
'SERVICE=mydb2 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=std LGWR SYNC' scope=both;
备库:
SERVICE=INDS2 LGWR ASYNC NOAFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=INDS1
修改为alter system set log_archive_dest_2=
'SERVICE=mydb1 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pri LGWR ASYNC REOPEN=10' scope=both;

4、分别重启实例,standby可以正常启动
startup mount
开启active dataguard
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
select process, client_process, sequence#, status from v$managed_standby;

分类:数据库 | 标签: |

相关日志

评论被关闭!