ITPub博客

首页 > 数据库 > Oracle > UNRESOLVABLE GAP

UNRESOLVABLE GAP

原创 Oracle 作者:celestezhang 时间:2015-07-30 11:13:23 0 删除 编辑
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
------------------------------------------------------------
UNRESOLVABLE GAP
standby:
SQL> select switchover_status from v$database;
WITCHOVER_STATUS
------------------------------------------------------------
not allowed
但是主备库之间是通的,也就是主库切换一个日志可以传输到备库上,但是没有应用
查看日志应用情况
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;


 SEQUENCE# APPLIED
---------- ---------------------------
      1360 NO
      1361 NO
      1362 NO
      1363 NO
      1364 NO
      1365 NO
      1366 NO
      1367 NO
      1368 NO
      1369 NO
为什么没有应用那???


查看备库的应用进程的情况
SQL> select process,status from v$managed_standby
  2  ;


PROCESS                     STATUS
--------------------------- ------------------------------------
ARCH                        CONNECTED
ARCH                        CONNECTED
ARCH                        CONNECTED
ARCH                        CONNECTED
RFS                         IDLE
RFS                         IDLE
RFS                         IDLE
RFS                         IDLE
MRP0                        WAIT_FOR_GAP----------------等待gap
那到底在等待那些gap?
SQL> select * from v$archive_gap;


   THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
         1          122           1359
因为备库服务器关过,而我写了个脚本定期清理归档日志,所以导致备库好多归档日志都没有接受成功
,[oracle@db2 epaydb]$ cat  /home/oracle/scripts/bin/in0.sh
#!/bin/bash
export PATH
ORACLE_SID=epaydb
ORACLE_BASE=/home/oracle/oracledb/oracle
ORACLE_HOME=$ORACLE_BASE/product/11/db
export ORACLE_SID ORACLE_BASE ORACLE_HOME
PATH=$PATH:/$ORACLE_HOME/bin:$HOME/bin
umask 022
rman target / nocatalog log=/home/oracle/rmanlog/rman_0.log<<EOF
run{
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt obsolete;
#allocate channel ch1 device type disk;
#allocate channel ch2 device type disk;
sql'alter system switch logfile';
backup as compressed backupset
incremental level 0 database include current controlfile
#format='/home/oracle/rmanbak/archbak/inc0_%d_%T_%U.bak'
format='/home/oracle/backup/backupset/inc0_%d_%T_%U.bak'
plus archivelog format='/home/oracle/scripts/log/arch_log/arch0_%d_%T_%U.log'
tag='inc0';
#backup as compressed backupset
#current controlfile reuse
#format='/home/oracle/rmanbak/archbak/ctl_%d_%T_%U.ctl'
#tag='bkctl';
#release channel ch1;
#release channel ch2;
}
exit;
EOF

* 2 * * *             sh /home/oracle/scripts/bin/in0.sh
RMAN> show all;


using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name PDDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/oracledb/oracle/product/11/db/dbs/snapcf_epaydb.f'; # default

因为主库的归档日志丢了只能重建dg了
如果可以找到丢失的归档其实可以在备库上面找到1358这个log文件在备库上从新注册一下就可以
SQL> alter database register logfile '/home1/archivelog/1_1358_732816650.dbf';


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29898569/viewspace-1756375/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-09-19

  • 博文量
    39
  • 访问量
    98848