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))))' ;

相關文章
相關標籤/搜索