晚上,突然后收到DG gap的报错。
分析发现,DG数据库收到了归档日志,但却在应用的时候出现了如下的报错。
看报错,应该是undo数据块损坏了。
由于数据库是DG数据库,我们就直接将主机包括数据库都重启了下,排除了逻辑错误。
重启后依然有这个报错。
我们选择的解决方案是用Primary的dbf去替代standby的dbf,操作如下:
1.close standby DB instance
--DB:standbyDB--
alter database recovery managed standby database cancel;
shutdown immediate;
2,change instance dbf name to old
--DB:standbyDB--
............check DB and host............
pwd
cd /oradata/awmsdb/
ls -lh
mv undotbs01.dbf undotbs01_old.dbf
3,change primary DB to hot backup
--DB:primaryDB--
alter tablespace UNDOTBS1 begin backup;
4,copy the dbf file from primary to standby
--DB:primaryDB--
cd /oradata/awmsdb/
ls -lh
scp undotbs01.dbf oracle@10.86.111.111:/oradata/awmsdb/
5,startup standbyDB instance to mount and startup MRP
--DB:standbyDB--
startup nomount;
alter database mount;
alter database recover managed standby database disconnect from session;
-----check...............
6,close primary DB hot backup
--DB:primaryDB--
alter tablespace UNDOTBS1 end backup;
7, delete the old broken datafile a few days later
--DB:standbyDB--
pwd
ls -lh
rm undotbs01_old.dbf