ORA-38856 之 Rac 库恢复具体时间点至单实例

恢复步骤略sql

查看恢复的日志日志点
RMAN> list backup of archivelog time between "to_date('2018-11-10 00:00:01','yyyy-mm-dd hh24:mi:ss')" and "to_date('2018-11-13 23:59:59','yyyy-mm-dd hh24:mi:ss')";

恢复完起库数据库

startup database mount;oracle

查看日志组ui

col GROUP# for 9999
col STATUS for a10
col MEMBER for a50
col TYPE for a10
set pagesize 500
select GROUP#,STATUS,MEMBER,TYPE from v$logfile;日志


添加日志
alter database add logfile group 13 ('/u/data/REDO01.LOG') size 1024m;
alter database add logfile group 14 ('/u/data/REDO02.LOG') size 1024m;
alter database add logfile group 15 ('/u/data/REDO03.LOG') size 1024m;
alter database add logfile group 16 ('/u/data/REDO04.LOG') size 1024m;
 
删除不要的日志:
 
 
 select 'alter database drop logfile group '|| GROUP#||';' from v$logfile;
 
 
alter database drop logfile group 13;
alter database drop logfile group 13;
alter database drop logfile group 13;
alter database drop logfile group 13;
alter database drop logfile group 13;
alter database drop logfile group 13;
alter database drop logfile group 13;it

删除不了尝试clear 后在drop
alter database clear logfile group 1;io


--RECOVER DATABASE USING BACKUP CONTROLFILE;thread

尝试open数据库require

 alter database open resetlogs
RESETLOGS after incomplete recovery UNTIL CHANGE 9617231993566
Errors in file /u/oracle/product/diag/rdbms/orcl/orcl/trace/orcl_ora_27238.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+FRA_DG/orcl/onlinelog/group_1.27223.904685833'
ORA-17503: ksfdopn:2 Failed to open file +FRA_DG/orcl/onlinelog/group_1.27223.904685833
ORA-15001: diskgroup "FRA_DG" does not exist or is not mounted
ORA-15077: could not locate ASM instance serving a required diskgroup
ORA-29701: unable to connect to Cluster Synchronization Service
ORA-00312: online log 1 thread 1: '+DATA_DG/orcl/onlinelog/group_1.323.904685831'
ORA-17503: ksfdopn:2 Failed to open file +DATA_DG/orcl/onlinelog/group_1.323.904685831
ORA-15001: diskgroup "DATA_DG" does not exist or is not mounted
ORA-15077: could not locate ASM instance serving a required diskgroup
ORA-29701: unable to connect to Cluster Synchronization Service
Errors in file /u/oracle/product/diag/rdbms/orcl/orcl/trace/orcl_ora_27238.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '+FRA_DG/orcl/onlinelog/group_2.27224.904685833'
:date

    
重建控制文件
alter database backup controlfile to trace as '/u/orcl_20181126.sql' resetlogs;

startup mount pfile='/u/data/orcl.ora';
 

 
 SQL> startup mount pfile='/u/orcl.ora';
ORA-32006: BACKGROUND_DUMP_DEST initialization parameter has been deprecated
ORA-32006: LOG_ARCHIVE_START initialization parameter has been deprecated
ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
ORACLE instance started.

Total System Global Area  864391168 bytes
Fixed Size            2258000 bytes
Variable Size          805309360 bytes
Database Buffers       50331648 bytes
Redo Buffers            6492160 bytes
Database mounted.
SQL> ALTER DATABASE OPEN RESETLOGS;
ALTER DATABASE OPEN RESETLOGS
*
ERROR at line 1:
ORA-38856: cannot mark instance UNNAMED_INSTANCE_2 (redo thread 2) as enabled

在pfile中添加如下参数文件:
#alter system set "_allow_resetlogs_corruption"=TRUE ;

SQL>create pfile='/u/orcl.ora' from memory;

添加隐藏参数
_allow_resetlogs_corruption
_no_recovery_through_resetlogs

重启数据库
SQL> startup mount pfile='/u/orcl.ora';
ORA-32006: BACKGROUND_DUMP_DEST initialization parameter has been deprecated
ORA-32006: LOG_ARCHIVE_START initialization parameter has been deprecated
ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
ORACLE instance started.

Total System Global Area  864391168 bytes
Fixed Size            2258000 bytes
Variable Size          805309360 bytes
Database Buffers       50331648 bytes
Redo Buffers            6492160 bytes
Database mounted.
SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL> 


ALTER TABLESPACE TEMP ADD TEMPFILE  '/u/data/tmp01.dbf' size 10240 M;
ALTER TABLESPACE TEMP ADD TEMPFILE  '/u/data/tmp02.dbf' size 10240 M;

添加监听: alter system set local_listener ='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=1527))))' ;

相关文章
相关标签/搜索