Tuesday, October 15, 2013

OGG-01161: Bad column index () specified for table...

If you are getting the error below, then that means there are some DDL Changes occurred at Source and Target is kicking you out...
Main problem is DDL Replication is not enabled from Source to Target.

Here is how to resolve (if DDL Replication was not enabled at source):
1. Perform the DDL that occurred at source (could be a new column or dropping a column etc.,) in the target.
2. Login into ggsci (of-course by changing direcotry to GG Home)
3. Run @ddl_enable

That will enable all DDL changes to replicate from source to target.
Data will by synced for the other DDL's that occurred prior to this enable (because you took care of them manually) so dont worry...

Finding most recent nologging operation that occurred in the database....

Going thru my old notes and found this to blog :)

Here is the sql to find most recent "nologging" operation occurred tablespace:

select name, unrecoverable_change#,                
       to_char (unrecoverable_time,'DD-MON-YYYY HH:MI:SS') 
  from v$datafile;

GoldenGate - Cleaning/Dropping a group...

In case if you ever want restart the whole Extract/Replicat group:
Here are the steps to cleanup or drop or delete a group in golden gate:
1. stop group_name
2. cleanup group_name
3. delete group_name

You can also use EXTRACT/REPLICAT after stop, cleanup, delete words but just a group_name is sufficient too.

GoldenGate not able to stop extract...

I was trying to stop Extract Process and I was getting this error (not going to blog more on this but just some commands).
There are open, long-running transactions. Before you stop Extract, make the archives containing data for those transactions available for when Extract restarts. To force Extract to stop, use the SEND EXTRACT EPCS04, FORCESTOP command.
Oldest redo log files necessary to restart Extract are:

Redo Thread 1, Redo Log Sequence Number 36376, SCN 69.4281137724 (300633881148),                             RBA 1572231184
Redo Thread 2, Redo Log Sequence Number 35408, SCN 69.4272252393 (300624995817),                             RBA 838206480.

Basically, there are some long running transactions (Active) in process and thus its not able to stop.

 send extract epcs04, showtrans
The above command shows the transaction which is active with more info.

Find out the transaction using:
select s.saddr,s.sid, s.username, s.osuser, s.status, s.program, t.start_time
  from v$session s, v$transaction t 
 where s.saddr = t.ses_addr
 order by t.start_time;

Skip the transaction: 
SEND EXTRACT , SKIPTRANS
could lose data if there are subsequent operations in this txn that need to be captured.

Force GG to "capture" the txn as-is: 
SEND EXTRACT , FORCETRANS
remains open as far as the database is concerned, but GG writes it to the trail & will no longer track it in the logs. Data could be lost if more operations occur that would need to be captured.

Or Try this:
ggsci> send extract EPCS04, report
Check the report file under dirrpt/ and find out long running transaction id:
eg.,
WARNING OGG-01027  Long Running Transaction: XID 1090.15.75000, Items 0, Extract EPCS04, Redo Thread 1, SCN 98.2643258821 (423550053829), Redo Seq #123329, Redo RBA 2649730064.

select hash_value, address, executions,buffer_gets, disk_reads,
       round(buffer_gets/decode(executions, 0, 1, executions), 1) avg_gets,
       round(disk_reads/decode(executions, 0, 1, executions), 1) avg_disk,
       last_load_time, module, sql_fulltext
  from v$sqlarea
 where sql_id = (
                 select --sid,serial#,event,machine,sql_id,seconds_in_wait,prev_sql_id,module,program,action
                        sql_id --prev_sql_id
                   from gv$session
                  where taddr = (
                                 select addr from gv$transaction where xidusn=1090 --this is the first part of XID from the report file
                                )
                )