alter database recover managed standby database cancel;
alter session set container=appdb;
alter database datafile 11 offline drop;
select status,FILE# from v$datafile where file#=11;
alter database recover managed standby database using current logfile disconnect;
#############
oneline 报错:
alter database recover managed standby database cancel;
alter session set container=appdb;
alter database datafile 11 online;
*
ERROR at line 1:
ORA-01113: file 11 needs media recovery
ORA-01110: data file 11:
'+ARCH/SPDB19C/ED068853EA9868D3E0530B39A8C0E59F/DATAFILE/undotbs1.623.1156154065
'
##############
shu immediate
startup mount
#如果归档丢失需要先对文件进行recover from service;
#recover datafile 11 from service xxxx;
alter session set container=appdb;
alter database datafile 11 online;
exit
sqlplus / as sysdba
alter database open;
<<<< 在启动过程对文件进行recover,本地没有归档,自动通过gap处理。
alter database open
PR00 (PID:110018): Media Recovery Waiting for T-1.S-91
PR00 (PID:110018): Fetching gap from T-1.S-91 to T-1.S-93
#########
模拟归档日志丢失:
delete force noprompt archivelog all;
SQL> alter database open
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 11 was not restored from a sufficiently old backup
ORA-01110: data file 11:
'+ARCH/SPDB19C/ED068853EA9868D3E0530B39A8C0E59F/DATAFILE/undotbs1.623.1156154065
'
RMAN> recover database from service pdb19c;
SQL> alter database open;
Database altered.