您好,登錄后才能下訂單哦!
檢查數據庫服務器,發現磁盤已滿,因為前期規劃問題,磁盤空間不足,還好該庫不影響。
刪除歸檔時,發現刪除過多,導致備庫歸檔沒有成功應用,就被刪除了。
這個操作確實粗心大意,檢查備庫歸檔時,發現無法應用,查看日志有如下報錯:
Fetching gap sequence in thread 1, gap sequence 42102-42102 FAL[client]: All defined FAL servers have been attempted. ------------------------------------------------------------ Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization parameter is defined to a value that's sufficiently large enough to maintain adequate log switch information to resolve archivelog gaps. ------------------------------------------------------------
處理方法,在主庫查看該歸檔的SCN發生的序列:
SQL> col first_change# for 999999999999999 SQL> select first_change# from v$archived_log where sequence#='42102' 2 ; FIRST_CHANGE# ---------------- 11769444390910 主庫 SQL> alter system set log_archive_dest_state_2=defer; 備庫 SQL> alter database managed standby database recovery cancel;
對主庫進行增量和控制文件備份:
RMAN> backup incremental from scn 11769444390910 database format '/u01/temp/archivedlog_%U'; RMAN> backup current controlfile for standby format '/u01/temp/controlfile.bak';
將文件拷貝到備庫后,進行還原
RMAN> shutdown immediate RMAN> startup nomount RMAN> restore standby controlfile from '/u01/temp/controlfile.bak'; RMAN> alter database mount; RMAN> recover database noredo;
另外如果未采用的standby log模式,則需要清空備庫redo log,有幾組清理幾組。
SQL> alter database clear logfile group 1;
切換主庫日志文件觀察主備庫日志序列是否一致!
主庫: SQL> alter system switch logfile; SQL> select max(sequence#) from v$log_history; MAX(SEQUENCE#) -------------- 42141 備庫: SQL> select max(sequence#) from v$log_history; MAX(SEQUENCE#) -------------- 42141
恢復歸檔應用
主庫 SQL> alter system set log_archive_dest_state_2=enable; 備庫 SQL> alter database managed standby database recovery disconnect from session;
關注以下幾個視圖:
v$managed_standby SQL> select process,status,sequence# from v$managed_standby; v$archive_dest_status SQL> col dest_name for a25 SQL> select dest_name,status,recovery_mode from v$archive_dest_status;
啟動時觀察alert日志發現如下內容
Wed Sep 30 14:27:09 2015
Managed Standby Recovery not using Real Time Apply
表示歸檔沒有實時同步,檢查發現備庫監聽未開啟
$ tnsping sss_dg TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 30-SEP-2015 14:27:42 Copyright (c) 1997, 2011, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x.x.x.x)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=sss))) TNS-12541: TNS:no listene
參考:
http://www.xifenfei.com/2011/07/data-guard%e5%87%ba%e7%8e%b0gap-sequence%e4%bf%ae%e5%a4%8d.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。