вторник, 8 апреля 2014 г.

GAP Resolution

1. На STANDBY смотрим GAP:
$sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 7 10:24:00 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> SELECT * FROM V$ARCHIVE_GAP;
   THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
---------- ------------- --------------
         1          1744           1751
SQL>

2. На PRYMARY восстанавливаем логи:
$export ORACLE_SID=testdb

$rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Fri Feb 7 10:25:29 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: testdb (DBID=97255669)

RMAN> connect catalog  'rman/passwd@catdb.sun.com';
connected to recovery catalog database

RMAN> run {
2> set archivelog destination to '/tmp';
3> restore archivelog from sequence 1744 until sequence 1751 thread 1;
4> }
executing command: SET ARCHIVELOG DESTINATION
Starting restore at 07-FEB-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=237 device type=DISK
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/tmp
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1744
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1745
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1746
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1747
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1748
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1749
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1750
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1751
channel ORA_DISK_1: reading from backup piece /u09/backups/oradb/rman/testdb/db_testdb_699_1_838841522
channel ORA_DISK_1: piece handle=/u09/backups/oradb/rman/testdb/db_testdb_699_1_838841522 tag=TAG20140206T193152
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 07-FEB-14
RMAN> exit

Recovery Manager complete.
$

3. Копируем их на STANDBY:
$scp -pr testdb* stby:/tmp/
testdb_1_1744_8377911 100% |*********************************************************************************|  3476 KB    00:00   
testdb_1_1745_8377911 100% |*********************************************************************************|  1340 KB    00:00   
testdb_1_1746_8377911 100% |*********************************************************************************|   790 KB    00:00   
testdb_1_1747_8377911 100% |*********************************************************************************|   764 KB    00:00   
testdb_1_1748_8377911 100% |*********************************************************************************| 24433 KB    00:00   
testdb_1_1749_8377911 100% |*********************************************************************************|   909 KB    00:00   
testdb_1_1750_8377911 100% |*********************************************************************************|   626 KB    00:00   
testdb_1_1751_8377911 100% |*********************************************************************************|  1024       00:00   
$

4. Регистрируем их на STANDBY в controlfile:
$export ORACLE_SID=testdb

$sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Fri Feb 7 10:32:45 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1744_837791122.arc';
ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1744_837791122.arc'
*
ERROR at line 1:
ORA-16089: archive log has already been registered

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1745_837791122.arc';
Database altered.

SQL>  ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1746_837791122.arc';
 ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1746_837791122.arc'
*
ERROR at line 1:
ORA-16089: archive log has already been registered

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1747_837791122.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1748_837791122.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1749_837791122.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1750_837791122.arc';
Database altered.

SQL> ALTER DATABASE REGISTER LOGFILE '/tmp/testdb_1_1751_837791122.arc';
Database altered.
SQL>

5. После этого необходимо перестартовать MRP процесс