Wednesday, May 8, 2013

ASM Persistent Device Mapping for Oracle 11gR2 RAC for RHEL 6

Recently when I was setting up a RAC setup at home using some dell desktop servers , I hit a unique problem.
Before going into that , here was my setup details

RAC Node Names : siddhu.gautham.com, surya.gautham.com (CentOS 6.4)
Openfiler : openfiler.gautham.com (Openfiler 2.3 or 2.4 (not sure) 32-bit) (ip 192.168.1.195(eth0),
                 192.168.2.195(eth1)) ->Used to provide shared storage to the RAC Nodes.

The openfiler server was deployed to provide iscsi storage to the other RAC Nodes.

After the install of the 3 servers and provisioning of the storage to the 2 RAC nodes, I reached a point where i needed to install the ASMLib libraries for device persistance. That is when I  realized that Oracle Corp had stopped supplying ASMLib packages starting RHEL 6.

So now I had to look at other alternatives for device persistence.

The below should tell you what I mean by device persistence
=========================================


[root@siddhu by-path]# pwd
/dev/disk/by-path



[root@siddhu by-path]# ls -lt |grep 192.168.2

lrwxrwxrwx 1 root root  9 May  6 23:27 ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sdb
lrwxrwxrwx 1 root root  9 May  6 23:27 ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sde
lrwxrwxrwx 1 root root  9 May  6 23:27 ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc

The reason I had to filter with 192.168.2 was because openfiler had 2 network interfaces and I want to use storage presented only via eth1 which was 192.168.2.195.

The problem above is the crs lun is available as /dev/sdb, data lun as /dev/sde and fra lun is /dev/sdc.
The moment the system is rebooted this would change to a different mapping.

Also if you go the other nac rode i.e. surya.gautham.com , you would see the above mappings as completely different i.e. CRS lun would not be presented as the same as /dev/sdb but as something else.

Therefore what i needed was a reliable mapping like say /dev/asm-crs-disk1 which would always map to crs lun and  /dev/asm-data-disk1 which would map to data lun and so on across all nodes of the RAC.

The way we get this is to use udev rules.

Before you do this, please partition the the 3 devices above using fdisk command.
Create just 1 primary partition (I am not going to the details of this).

fdisk /dev/sdb
fdisk /dev/sde
fdisk /dev/sdc

Also perform partprobe on the other node to see the resulting /dev/sd[x]1 partition.

PLEASE NOTE THAT I HAD TO REBOOT BOTH THE RAC NODES AND THERFORE THE MAPPING CHANGED FROM ABOVE.PLEASE DO NOT LET THE MISMATCH ABOVE AND BELOW CONFUSE YOU.


From above we identified that /dev/sdd points to CRS in siddhu and /dev/sdc points to CRS in surya
[root@siddhu ~]# /sbin/scsi_id -g -u -d /dev/sdd
14f504e46494c45526834373035642d374d73772d794c386b

[root@surya iscsi]# /sbin/scsi_id -g -u -d /dev/sdc
14f504e46494c45526834373035642d374d73772d794c386b

The above shows that identifier is same irrespective of whether it is /dev/sdc(surya) or /dev/sdd(siddhu)
and this identifier will always be the same for CRS.

For FRA
=======
[root@surya iscsi]#  /sbin/scsi_id -g -u -d /dev/sdf
14f504e46494c455252635354667a2d4a6153492d6c307a66

[root@siddhu ~]# /sbin/scsi_id -g -u -d /dev/sde
14f504e46494c455252635354667a2d4a6153492d6c307a66



For DATA
========
[root@siddhu ~]# /sbin/scsi_id -g -u -d /dev/sdf
14f504e46494c45523473334e397a2d70347a612d554a394f

[root@surya iscsi]# /sbin/scsi_id -g -u -d /dev/sdg
14f504e46494c45523473334e397a2d70347a612d554a394f


vi /etc/udev/rules.d/99-oracle-asmdevices.rules



KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c45526834373035642d374d73772d794c386b", NAME="asm-crs-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c455252635354667a2d4a6153492d6c307a66", NAME="asm-fra-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="14f504e46494c45523473334e397a2d70347a612d554a394f", NAME="asm-data-disk1", OWNER="oracle", GROUP="dba", MODE="0660"



After reboot
+++++++++++++

[root@surya dev]# (cd /dev/disk/by-path; ls -l *openfiler* |grep -i 192.168.2| awk '{FS=" "; print $9 " " $10 " " $11}')
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0 -> ../../sde
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.crs1-lun-0-part1 -> ../../asm-crs-disk1
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0 -> ../../sdg
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.data1-lun-0-part1 -> ../../asm-data-disk1
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0 -> ../../sdc
ip-192.168.2.195:3260-iscsi-iqn.2006-01.com.openfiler:racdb.fra1-lun-0-part1 -> ../../asm-fra-disk1
[root@surya dev]#


[root@surya dev]# ls -lt /dev/*asm*
brw-rw---- 1 oracle dba 8, 65 May  1 00:50 /dev/asm-crs-disk1
brw-rw---- 1 oracle dba 8, 33 May  1 00:50 /dev/asm-fra-disk1
brw-rw---- 1 oracle dba 8, 97 May  1 00:50 /dev/asm-data-disk1
[root@surya dev]# 



Monday, March 4, 2013

Restore and recover from cold backup using rman

Many a times before a application upgrade, we would like to take a cold backup of the database just to take care of some "mess-up" and would just want to restore it if something goes wrong.

The following is the preferred way for me to take a RMAN cold backup.





Take the BACKUP
===============
Put the DB in mount mode.

rman target / nocatalog<<EOF>backup.log

run{
allocate channel d1  device type disk format  '/oracle/arch/rmanbkp/HOMEDB_FULL_%d_%T_%U';

backup as compressed backupset tag rman_backfulcold_HOMEDB database include current controlfile ;
}
EOF

Query from RMAN to see where the control file resides


list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13      Full    39.13M     DISK        00:00:06     04-MAR-13  
        BP Key: 13   Status: AVAILABLE  Compressed: YES  Tag: RMAN_BACKFULCOLD_HOMEDB
        Piece Name: /oracle/arch/rmanbkp/HOMEDB_FULL_HOMEDB_20130304_0do3ltu7_1_1
  List of Datafiles in backup set 13

..


..
..
..

        Piece Name: /oracle/arch/rmanbkp/HOMEDB_FULL_HOMEDB_20130304_0no3ltuo_1_1
  List of Datafiles in backup set 23
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  28      Full 301818     04-MAR-13 /oracle/oradata02/HOMEDB/data/forumindextabspace01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
24      Full    1.03M      DISK        00:00:01     04-MAR-13  
        BP Key: 24   Status: AVAILABLE  Compressed: YES  Tag: RMAN_BACKFULCOLD_HOMEDB
        Piece Name: /oracle/arch/rmanbkp/HOMEDB_FULL_HOMEDB_20130304_0oo3ltup_1_1
  Control File Included: Ckp SCN: 301818       Ckp time: 04-MAR-13





STEPS TO RESTORE
================

startup nomount

Restore the CONTROL FILE from the backup piece identified above.

run
{
allocate channel c1 device type disk format '/oracle/arch/rmanbkp/HOMEDB_FULL_%d_%T_%U';
restore controlfile from '/oracle/arch/rmanbkp/HOMEDB_FULL_HOMEDB_20130304_0oo3ltup_1_1';
}

alter database mount;

run
{
allocate channel c1 device type disk format '/oracle/arch/rmanbkp/HOMEDB_FULL_%d_%T_%U';
restore database from tag='rman_backfulcold_HOMEDB';
}

Tuesday, February 19, 2013

Data Guard Catch-Up via RMAN using TSM

Many a times, we DBA's are faced with an issue where the DG has been out of synch with the Production DB for quite a long time.
Certain examples are we ran an overnight rman duplicate script to create a standy database and by the time we got to look at the status of the restore, hundreds of logs had been generated in the primary .
In all probability, in a typical production environment, a hourly RMAN archivelog backup and delete script would have run and deleted the archivelogs (after backing it up, obviously).

So to help the standby get in synch with the primary , we have to either put the standby in recover mode and restore the archivelogs on production hoping the FAL services would pick it up.

Once we realize that the archivelogs number in 100's or 1000's, this task becomes nearly impossible with the risk of endangering the archive destination on the primary getting filled up.

I have expalined a method below uses the same RMAN technique to get the standby in synch with the primary.
The example uses TSM (Tivoli) as the storage medium and please change accordingly as per your environment's tape set up.

For TSM, we need to copy over the primary node's TSM password file to the standby to ensure that the auxiliary channel can access the tape backups created from the primary database's node.Along with it , we need to ensure that both primary and standby are talking to the same TSM server.

At the Standby, Cancel the Managed recover process if running and ensure that the database is in mount mode.

alter database recover managed standby database cancel;


1)   Do the following in Primary.

create a file called recoverystandby.cmd, with the following contents


#++++++++++++++++++++++++++++++++++
#++RECOVERYSTANDBY.CMD++++++++++
#++++++++++++++++++++++++++++++++++
backup archivelog all not backed up;
run {
#Adjust it as per the archivelogs already present in standby
set until time 'sysdate-(1/24)';
#Make sure below /tmp/tdpo.opt file is available in standby database.
allocate auxiliary channel d2 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/tmp/tdpo.opt)';
recover standby clone database delete archivelog;
}

2)Do the following in Standby.

This is to make sure that the standby can access the tape backups.
******These steps are specific to TSM******
Make sure /tmp/tdpo.opt file is available. This TDPO file is used by auxiliary channel in step 1.

> cat /tmp/tdpo.opt
DSMI_LOG                /tmp
DSMI_ORC_CONFIG         /tmp/dsm.opt
TDPO_FS                 xxx
TDPO_NUM_BUFFERS        10
TDPO_NODE               prmyserver
TDPO_OWNER              oracle
TDPO_PSWDPATH           /tmp

Make sure /tmp/dsm.opt file is present referred above as DSMI_ORC_CONFIG


> cat /tmp/dsm.opt
SERVERNAME <tsm server>

Make sure you have physically copied the primary node's TSM password file. The name of the password file would be TDPO.<tdpo_node> i.e. TDPO.prmyserver and should be available under
TDPO_PSWDPATH path.





3) Do the following in Primary

Set environmental variables to connect to local primary database
export ORACLE_HOME='<path of ORACLE_HOME>'
export ORACLE_SID='<SID of Primary Database>'
export PATH=$ORACLE_HOME/bin:$PATH

Run the above command via RMAN as

rman target / auxiliary sys/manager@<standby database> catalog rman/rman@<rman db> cmdfile=recoverstandby.cmd log=catchup_stdby.log

Please allow the above script to run and this script should allow the standby to catch up with the primary without the need to restore the files into primary.

Once it has caught up, you can put the primary back into managed recovery process.

Please note that there is one more way to achieve the same thing using backup as incremental via rman like 
backup incremental from scn <scn number> database . You can look at other blogs to read more about this and decide for yourself which one to use. If there is a missing archivelog , then you cannot use my method and will be better off using the other approach I just mentioned above.




Thursday, January 31, 2013

Golden Gate Add SCHEMATRANDATA Verification

I just conjured up a small script to verify whether the GG Command

add schematrandata <schema name>

worked correctly.
By the way, please keep in mind that once you executed the above command, all future objects would be automatically covered. That is why I highly recommend setting logging at the schema level rather than the individual table level.

Basically the below query should be able to give you info

select * from table(logmnr$always_suplog_columns('name of the schema in upper case','table name in upper case'));

Please be aware that dba_log_groups will not show any entry if you had added schema level logging . Only if you had added logging at a table level using add trandata would there be an entry in dba_log_groups.

A small pl/sql snippet to go through an entire schema and report back is below

declare
l_schema varchar2(20) := upper('schema name') ;
l_table_name varchar2(200);
x_ctr number(5);
x_refcur sys_refcursor;
begin
open x_refcur for 'select table_name from dba_tables where owner='''||l_schema||''' order by table_name';
loop
fetch x_refcur into l_table_name;
exit when x_refcur%NOTFOUND;

execute immediate 'select count(*) from table(logmnr$always_suplog_columns(:1,:2))'
into x_ctr using l_schema,l_table_name ;
if x_ctr =0 then

dbms_output.put_line('Analyzing '||l_table_name||' ..**ERROR**');
else
dbms_output.put_line('Analyzing '||l_table_name||' ..OK');
end if;

end loop;
end;
/

Tuesday, December 11, 2012

Oracle Pipelined Functions


Let me give you a typical scenario which we encounter everday.

Say we have a table called employee and the fields are (or rather the most significant fields for our discussion) are
ename and dno .

SQL> select substr(ename,1,25),dno from employee;

SUBSTR(ENAME,1,25)               DNO
------------------------- ----------
JACK                              10
JILL                              10
MASON                             20
MARK                              20


you are being asked to write a small pl/sql code to return the enames of a particular department, the normal way we would
do is to write a procedure like

CREATE OR REPLACE TYPE vcarray AS TABLE OF VARCHAR2(500)
/

CREATE or replace procedure p1(dno_p IN number,ename_p OUT vcarray)
IS
CURSOR c1 is select ename from employee where dno=dno_p;
i number:=1;
BEGIN
ename_p := vcarray();
for c2 in c1
loop
 ename_p.extend;
 ename_p(ename_p.count) :=c2.ename ;
 i:=i+1;
end loop;
END;
/

To call the above procedure , we are forced to write a pl/sql block like

SQL> declare
  2  ename vcarray ;
  3  begin
  4  p1(10,ename);
  5  for i in 1..ename.COUNT
  6  LOOP
  7  dbms_output.put_line(ename(i));
  8  end loop;
  9  end;
 10  /
JACK
JILL

PL/SQL procedure successfully completed.

So in the above example we are forced to write a pl/sql block to read from the procedure.

The below example uses pipelined functions which will make it possibel for the same
job to be done via a function (eventhough we think of function as only returning
a single value) and the icing on the cake is the function can be referenced as a simple select
from sqlplus prompt itself....




CREATE OR REPLACE TYPE vcarray AS TABLE OF VARCHAR2(500)
/

CREATE OR REPLACE FUNCTION get_employees (dno_p IN number)
RETURN vcarray
PIPELINED
AS

CURSOR c1 is select ename from employee where dno=dno_p;
BEGIN

FOR c2 in c1
LOOP
   pipe row (c2.ename);
END LOOP;
RETURN;
END;
/


SQL> select * from TABLE (get_employees(10) );

COLUMN_VALUE
----------------------------------------------------------------------------------------------------
JACK
JILL

Friday, June 8, 2012

Script to monitor and restart failed GoldenGate Processes

The below script should restart aborted GG processes.
The script is capable of restarting Manager, Extract and Replicat Processes.

The logic is it just looks at info all command (of ggsci) and attempts to restart any process which it sees as not RUNNING .
A non-running process can be either in STOPPED or ABORTED status.

It is intelligent enough to find out whether the stopped process is an extract, replicat or manager.

Please note I have used a script call ed /usr/local/bin/sid to set the env parameters. This script can be replaced by your own script or by setting env variables manually.



#!/bin/ksh
. /usr/local/bin/sid xxx
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export GG_HOME=/oracle/software/goldengate/11.1.1.1.2
export PATH=$PATH:.
MSGFILE="/tmp/mail.txt"
EMAILFILE="/tmp/email.txt"
SERVERNAME=`hostname`
rm -rf $EMAILFILE 2>/dev/null



cd $GG_HOME
ggsci <<EOF >$MSGFILE
info all
exit
EOF

ERROR_CTR=`cat $MSGFILE|grep -v -i "running"|wc -l`


#following loop is for manager process restart

if  [ $ERROR_CTR -ne 0 ] ; then

cat $MSGFILE|grep -v -i "running"|grep -i "manager"|while read LINE ;do

echo "Manager has aborted ">>$EMAILFILE
echo "Attempting to restart" >>$EMAILFILE


cd $GG_HOME
ggsci <<EOF >>$EMAILFILE
start mgr
info all
exit
EOF

done
fi

#following loop is for extract process restart


if  [ $ERROR_CTR -ne 0 ] ; then

cat $MSGFILE|grep -v -i "running"|grep -i "extract"|awk '  {print $3 } '|while read LINE ;do

echo "EXTRACT $LINE has aborted ">>$EMAILFILE
echo "attempting to restart" >>$EMAILFILE


cd $GG_HOME
ggsci <<EOF >>$EMAILFILE
start extract $LINE
info all
exit
EOF



done
fi

#following loop is for replicat process restart

if  [ $ERROR_CTR -ne 0 ] ; then

cat $MSGFILE|grep -v -i "running"|grep -i "replicat"|awk '  {print $3 } '|while read LINE ;do

echo "REPLICAT $LINE has aborted ">>$EMAILFILE
echo "Attempting to restart" >>$EMAILFILE


cd $GG_HOME
ggsci <<EOF >>$EMAILFILE
start replicat $LINE
info all
exit
EOF



done
fi


[ -f $EMAILFILE ] && cat $EMAILFILE|mailx -s "Extract died on $SERVERNAME" gautha@xxx.xxx

Accurately predicting the redo log sequence needed for a Golden Gate Restart

Bounded Recovery is set to 20 Minutes.

1. Started an active transaction which runs for 5 hours at 8.11AM.
The log sequence at the start of transaction is 16230 (please see below logfile).

jupiter<oracle>/tmp> cat test.sh
#!/bin/ksh
. /usr/local/bin/sid athenadv
sqlplus ops\$gchandra/test123 << EOF >test.log

select max(sequence#) from v\$log;
select to_char(sysdate,'dd-mon-yyyy hh24:mi:ss') from dual;
drop table testtab;
create table testtab (col1 number);
insert into testtab values(1);
execute dbms_lock.sleep(18000);
commit;
exit
EOF

Run the above script(in the background)
nohup ./test.sh &

Now check the spool file created.....

jupiter<oracle>/tmp> cat test.log

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 8 08:11:22 2012

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> SQL>
MAX(SEQUENCE#)
--------------
         16230

SQL>
TO_CHAR(SYSDATE,'DD-MON-YYYYH
-----------------------------
08-jun-2012 08:11:22

SQL>
Table dropped.

SQL>
Table created.

SQL>
1 row created.


2.

At around 10am, I stop the extract process.
GGSCI (jupiter) 2> stop ext xtathdv

Sending STOP request to EXTRACT XTATHDV ...
Request processed.

3. Check the BR checkpoint from ggserr.log and also from BR directory.
It hapenned at around 9.42am.

2012-06-08 09:42:24  INFO    OGG-01738  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: CHECKPOINT: for object pool 1: p28822_extr: start=SeqNo: 16293, RBA: 75422736, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000, end=SeqNo: 16293, RBA: 75423744, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000.

jupiter<oracle>/oracle/software/goldengate/11.1.1.1.2/BR/XTATHDV> ls -lt
total 88
-rw-rw----   1 oracle     dba          65536 Jun  8 09:42 CP.XTATHDV.000000039
-rw-rw----   1 oracle     dba          65536 Jun  8 09:22 PO.XTATHDV.0000007.0000000
-rw-rw----   1 oracle     dba          65536 Jun  8 08:42 PO.XTATHDV.0000006.0000000
drwxrwxr-x   2 oracle     dba             96 Jun  7 15:54 stale


4.Check the archive log sequence at around 9.42am.

select sequence# from v$archived_log
  where to_date('08-jun-2012 09:42:00','dd-mon-yyyy hh24:mi:ss') between first_time and next_time;

SQL> select sequence# from v$archived_log
  2    where to_date('08-jun-2012 09:42:00','dd-mon-yyyy hh24:mi:ss') between first_time and next_time;

 SEQUENCE#
----------
     16293
    
This means I need only archive log from sequence 16293 when I restart GG extract process.
I should not need from sequence 16230(log sequence # from start of transaction).


5.Perform a few log switches and delete all archive files from RMAN.
SQL> alter system switch logfile;

System altered.

SQL> /

System altered.

SQL> /

System altered.

Run the following from rman -

run {
allocate channel c1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/oracle/admin/backup/config/jupiter_tdpo.opt)';
backup
filesperset = 4
format 'al_%d%s%t_%U'
archivelog until time 'SYSDATE'
delete all input;
sql 'alter system archive log current';
release channel c1;
}


6.Kill the test.sh script.

jupiter<oracle>/oracle/arch/athenadv/arch> ps -ef|grep test.sh
  oracle  5072     1  0 08:11:22 ?         0:00 /bin/ksh ./test.sh
  oracle 15014 26448  0 10:16:01 pts/6     0:00 grep test.sh
jupiter<oracle>/oracle/arch/athenadv/arch> ps -ef|grep sqlplus
  oracle  5077  5072  0 08:11:22 ?         0:00 sqlplus ops$gchandra/test123
  oracle 15018 26448  1 10:16:08 pts/6     0:00 grep sqlplus
jupiter<oracle>/oracle/arch/athenadv/arch> kill -9 5077
jupiter<oracle>/oracle/arch/athenadv/arch>
jupiter<oracle>/oracle/arch/athenadv/arch> ps -ef|grep test.sh
  oracle 16879 26448  1 10:16:27 pts/6     0:00 grep test.sh
jupiter<oracle>/oracle/arch/athenadv/arch>


7.

GGSCI (jupiter) 2> start ext xtathdv

Sending START request to MANAGER ...
EXTRACT XTATHDV starting


2012-06-08 10:44:42  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start ext xtathdv.
2012-06-08 10:44:42  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host 10.64.17.19 (START EXTRACT XTATHDV ).
2012-06-08 10:44:42  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT XTATHDV starting.
2012-06-08 10:44:42  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  EXTRACT XTATHDV starting.
2012-06-08 10:44:43  INFO    OGG-01639  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY:  ACTIVE: for object pool 1: p28822_extr.
2012-06-08 10:44:43  INFO    OGG-01640  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery start XID: 0.0.0.
2012-06-08 10:44:43  INFO    OGG-01641  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery start position: SeqNo: 16293, RBA: 75422736, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000.
2012-06-08 10:44:43  INFO    OGG-01642  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery end position: SeqNo: 16293, RBA: 75423744, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000.
2012-06-08 10:44:43  INFO    OGG-01579  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: VALID BCP: CP.XTATHDV.000000039.
2012-06-08 10:44:43  INFO    OGG-01629  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: PERSISTED OBJECTS RECOVERED: 2.
2012-06-08 10:44:45  INFO    OGG-01513  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Positioning to Sequence 16293, RBA 75422736.
2012-06-08 10:46:12  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Could not find archived log for sequence 16293 thread 1 under default destinations SQL <SELECT  name    FROM v$archived_log   WHERE sequence# = :ora_seq_no AND         thread# = :ora_thread AND         resetlogs_id = :ora_resetlog_id AND         archived = 'YES' AND         deleted = 'NO>, error retrieving redo file name for sequence 16293, archived = 1, use_alternate = 0Not able to establish initial position for sequence 16293, rba 75422736.
2012-06-08 10:46:12  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  PROCESS ABENDING.


The above log extract says that it reads from 16293. That is as per my expectation.

Since 16293 is not present in archive destination, the GG process abends as expected.



8.Restore the archive log from rman

RMAN> RESTORE ARCHIVELOG FROM SEQUENCE 16293;

Starting restore at 08-Jun-2012
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=112 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.2.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=594 device type=DISK

archived log for thread 1 with sequence 16348 is already on disk as file /oracle/arch/athenadv/arch/1_16348_783838261.dbf
archived log for thread 1 with sequence 16349 is already on disk as file /oracle/arch/athenadv/arch/1_16349_783838261.dbf
..
..
..

9. Restart the GG extract process and observe the logfile

GGSCI (jupiter) 3> start ext xtathdv

Sending START request to MANAGER ...
EXTRACT XTATHDV starting


Observe the logfile

2012-06-08 10:51:46  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT XTATHDV starting.
2012-06-08 10:51:46  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  EXTRACT XTATHDV starting.
2012-06-08 10:51:46  INFO    OGG-01639  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY:  ACTIVE: for object pool 1: p28822_extr.
2012-06-08 10:51:46  INFO    OGG-01640  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery start XID: 0.0.0.
2012-06-08 10:51:46  INFO    OGG-01641  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery start position: SeqNo: 16293, RBA: 75422736, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000.
2012-06-08 10:51:46  INFO    OGG-01642  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: recovery end position: SeqNo: 16293, RBA: 75423744, SCN: 1932.1174983728 (8299051799600), Timestamp: 2012-06-08 09:42:23.000000.
2012-06-08 10:51:46  INFO    OGG-01579  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: VALID BCP: CP.XTATHDV.000000039.
2012-06-08 10:51:46  INFO    OGG-01629  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: PERSISTED OBJECTS RECOVERED: 2.
2012-06-08 10:51:49  INFO    OGG-01513  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Positioning to Sequence 16293, RBA 75422736.
2012-06-08 10:51:49  INFO    OGG-01516  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Positioned to Sequence 16293, RBA 75422736, Jun 8, 2012 9:42:23 AM.
2012-06-08 10:51:49  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  EXTRACT XTATHDV started.
2012-06-08 10:51:49  INFO    OGG-01055  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Recovery initialization completed for target file /oracle/goldengatedata/dirdat/at000011, at RBA 32117725.
2012-06-08 10:51:49  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Output file /oracle/goldengatedata/dirdat/at is using format RELEASE 10.4/11.1.
2012-06-08 10:51:49  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Rolling over remote file /oracle/goldengatedata/dirdat/at000011.
2012-06-08 10:51:49  INFO    OGG-01053  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Recovery completed for target file /oracle/goldengatedata/dirdat/at000012, at RBA 1032.
2012-06-08 10:51:49  INFO    OGG-01057  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Recovery completed for all targets.
2012-06-08 10:51:50  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  Position of first record processed Sequence 16293, RBA 75422736, SCN 1932.1174983725, Jun 8, 2012 9:42:23 AM.
2012-06-08 10:51:50  INFO    OGG-01644  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  BOUNDED RECOVERY: COMPLETE: for object pool 1: p28822_extr at SeqNo: 16293, RBA: 75423760, SCN: 1932.1174983729 (8299051799601).
2012-06-08 10:52:37  WARNING OGG-00869  Oracle GoldenGate Capture for Oracle, xtathdv.prm:  No unique key is defined for table DV3_STATUS. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.


Looks like GG extract is chuggling along.

Hope you find this useful.