Showing posts with label Oracle Golden gate. Show all posts
Showing posts with label Oracle Golden gate. Show all posts

Sunday, June 8, 2014

Script to find redo generated by current sessions

#################################################

Redo generated by current sessions
#################################################

select v$session.sid, username, value redo_size
from v$sesstat, v$statname, v$session
where v$sesstat.STATISTIC# = v$statname.STATISTIC#
and v$session.sid = v$sesstat.sid
and name = ‘redo size’
and value > 0
and username is not null
order by value
/

To check INACTIVE sessions with HIGH DISK IO

To check INACTIVE sessions with HIGH DISK IO
=============================================
select p.spid,s.username, s.sid,s.status,t.disk_reads, s.last_call_et/3600 last_call_et_Hrs,
s.action,s.program,s.machine cli_mach,s.process cli_process,lpad(t.sql_text,30) “Last SQL”
from gv$session s, gv$sqlarea t,v$process p
where s.sql_address =t.address and
s.sql_hash_value =t.hash_value and
p.addr=s.paddr and
t.disk_reads > 5000
and s.status=’INACTIVE’
and s.process=’1234′
order by S.PROGRAM;
=================================================================

Saturday, August 31, 2013

Oracle Golden Gate GGSCI commands

GGSCI commands executed at the ggsci line utility, are used to setup, manage, monitor and troubleshoot the different components of the Goldengate Replication configuration. You are able to look at the current status, lag, database versions, previous commands run, add/delete processes, etc.

Some of the more interesting Goldengate commands are below.

GGSCICommand -> history
GGSCI (proddb01) 44> history
 
GGSCI Command History
 
   35: info PMP02 detail
   36: info all
   37: info PMP02 detail
   38: info all
   39: info all
   40: history
   41: view report EXT02
   42: history
   43: view report EXT02 detail
   44: history
 
 
GGSCI (proddb01) 45> info all
 
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
 
MANAGER     RUNNING                                          
EXTRACT     RUNNING     PMP02       00:00:00      00:00:01   
EXTRACT     RUNNING     EXT02       00:00:00      00:00:01   
REPLICAT    RUNNING     RHA02       00:00:00      00:00:03
GGSCICommand -> !
To rerun the previous command use “!”
GGSCI (proddb01) 46> !
info all
 
Program     Status      Group       Lag at Chkpt  Time Since Chkpt
 
MANAGER     RUNNING                                          
EXTRACT     RUNNING     PMP02       00:00:00      00:00:06   
EXTRACT     RUNNING     EXT02       00:00:00      00:00:06   
REPLICAT    RUNNING     RHA02       00:00:00      00:00:08
To run a specific command from the history use “!” with the command line number.
GGSCI (proddb01) 47> !42
history
 
GGSCI Command History
 
   38: info all
   39: info all
   40: history
   41: view report EXT02
   42: history
   43: view report EXT02 detail
   44: history
   45: info all
   46: info all
   47: history
GGSCICommand -> versions
VERSION: You can view this to view the version of the OS, host info and the database version.
GGSCI (proddb02) 3> versions
Operating System:
SunOS
Version Generic_147440-01, Release 5.10
Node: proddb02
Machine: sun4u
 
Database:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
GGSCICommand -> view report
REPORTS: View the reports for specific processes.
GGSCI (proddb01) 49> view report EXT02
 
Opened new report file at 2013-03-12 00:01:00.
 
***********************************************************************
**                     Run Time Messages                             **
***********************************************************************
 
2013-03-12 02:43:12  INFO    OGG-01738  BOUNDED RECOVERY: CHECKPOINT: for object pool 1: p21775_extr: start=SeqNo: 17632, RBA: 21008, SCN: 0.1148
5118 (11485118), Timestamp: 2013-03-12 02:41:35.000000, Thread: 1, end=SeqNo: 17632, RBA: 21504, SCN: 0.11485118 (11485118), Timestamp: 2013-03-1
2 02:41:35.000000, Thread: 1.
 
2013-03-12 06:43:20  INFO    OGG-01738  BOUNDED RECOVERY: CHECKPOINT: for object pool 1: p21775_extr: start=SeqNo: 17646, RBA: 18448, SCN: 0.1149
0824 (11490824), Timestamp: 2013-03-12 06:42:08.000000, Thread: 1, end=SeqNo: 17646, RBA: 18944, SCN: 0.11490824 (11490824), Timestamp: 2013-03-1
2 06:42:08.000000, Thread: 1.
GGSCICommand -> show all
Use the “show” command to look at the configuration info on the different processes.
GGSCI (proddb01) 50> show
 
Parameter settings:
 
SET SUBDIRS    ON
SET DEBUG      OFF
 
Current directory: /u01/app/ha/ggs
 
Using subdirectories for all process files
 
Editor:  vi
 
Reports (.rpt)                 /u01/app/db01/ggs/dirrpt
Parameters (.prm)              /u01/app/db01/ggs/dirprm
Stdout (.out)                  /u01/app/db01/ggs/dirout
Replicat Checkpoints (.cpr)    /u01/app/db01/ggs/dirchk
Extract Checkpoints (.cpe)     /u01/app/db01/ggs/dirchk
Process Status (.pcs)          /u01/app/db01/ggs/dirpcs
SQL Scripts (.sql)             /u01/app/db01/ggs/dirsql
Database Definitions (.def)    /u01/app/db01/ggs/dirdef
 
GGSCI (proddb01) 52> show all
 
Parameter settings:
 
SET SUBDIRS    ON
SET DEBUG      OFF
 
Current directory: /u01/app/ha/ggs
 
Using subdirectories for all process files
 
Editor:  vi
 
Reports (.rpt)                 /u01/app/db01/ggs/dirrpt
Parameters (.prm)              /u01/app/db01/ggs/dirprm
Stdout (.out)                  /u01/app/db01/ggs/dirout
Replicat Checkpoints (.cpr)    /u01/app/db01/ggs/dirchk
Extract Checkpoints (.cpe)     /u01/app/db01/ggs/dirchk
Process Status (.pcs)          /u01/app/db01/ggs/dirpcs
SQL Scripts (.sql)             /u01/app/db01/ggs/dirsql
Database Definitions (.def)    /u01/app/db01/ggs/dirdef

Sunday, June 30, 2013

Oracle Golden Gate

http://www.oraclegis.com
http://ggsig.blogspot.in/2012/12/golden-gate-replication-oracle-db.html --> Steps to configure Replication between Oracle->Oracle
http://oraclespot.wordpress.com/2011/06/15/oracle_goldengate/

Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory


Move to the GG install directory and invoke ggsci.. 
ggsci> dblogin userid <>,password <>

-------------------------------------------------------------------------------------------------------

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ggdb1
export GG_HOME=/u01/app/oracle/ggs/11.2.0
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$GG_HOME:$LD_LIBRARY_PATH
export PATH=GG_HOME:$ORACLE_HOME/bin:$PATH


--------------------------------------------------------------------------------

Before configuring Golden Gate at DB level:

1). Put database in archivelog mode --> Requires bounce till 11gR2, but not from 12c(Need to check).
2). Enable Supplemental Logging
SELECT SUPPLEMENTAL_DATA_LOG_MIN FROM V$DATABASE;
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;