Thursday 19 September 2013

OGG-01031 Pump Abending

A fairly common occurance in the Golden Gate world. The pump abends as the target destination becomes full.
In this scenario, I had tried restarting pump process and clearing down space but that didn't resolve the problem.
The pump error message is below


2013-09-19 10:25:42 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, test_ext.prm: EXTRACT TEST_EXT started. 2013-09-19 10:25:42  INFO OGG-01226 Oracle GoldenGate Capture for Oracle, test_ext.prm: Socket buffer size set to 27985 (flush size 27985). 2013-09-19 10:25:42  ERROR OGG-01031 Oracle GoldenGate Capture for Oracle, test_ext.prm: There is a problem in network communication, a remote file problem, encryption keys for target and source do not match (if using ENCRYPT) or an unknown error. (Reply received is Unable to open file "/oracle/ggate/dirdat/rp/rp000213" (error 13, Permission denied)). 2013-09-19 10:25:42  ERROR OGG-01668 Oracle GoldenGate Capture for Oracle, test_ext.prm: PROCESS ABENDING.

In this case we have to manually tell Extract to rollover

alter extract TEST_EXT etrollover
2013-09-19 10:57:19 INFO OGG-01520 Oracle GoldenGate Command Interpreter for Oracle: Rollover performed. For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will not happen automatically.


Run info pumpname to get the new trail file name.

At the target end, the replicat should have parsed all the data received until the drive became full and data stopped coming through.
To let the target know to switch to the new file, use below command.

alter replicat TEST_EXT ,EXTSEQNO 214 , EXTRBA 0 --- replicat was reading the seqno 213. moved to 214.





Installing Grid Infrastructure for a Standalone Server

There is a very good article with a tutorial to install Grid Infrastructure on a Standalone Server

http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r2/prod/install/gridinstss/gridinstss.htm

Tuesday 3 September 2013

DROP DATABASE VIA RMAN

If drop database command is run under RMAN then it will drop datafiles, online redo logs ,controlfiles , backups and also unregister database from recovery catalog. Only thing I noticed that was left unclean was flashback logs that has to be deleted manually.

In order to drop database within RMAN, make sure that database is in mount state and in restrictive mode.

RMAN> CONNECT TARGET /


connected to target database: TESTDB1 (DBID=39523451)

RMAN> STARTUP FORCE MOUNT
RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;


NOPROMPT will not ask for confirmation so if you want to be sure then use
 RMAN> DROP DATABASE INCLUDING BACKUPS;

Above command will use controlfile of the database so in order to user catalog use

RMAN > CONNECT TARGET SYS@TESTDB CATALOG RMAN@RMANCAT


 

Monday 2 September 2013

DATA PUMP COMMAND

Data pump was introduced in oracle 10G and has become very common tool in 11G and 12C databases.

quick reference to use data pump export and import command with sysdba privileges is


For data pump you need to create a directory in database
$sqlplus / as sysdba
sql> create or replace directory DUMP_DIR as '/tmp/data_dump';


$expdp \'/ as sysdba \' dumpfile=exp_test_user.dmp logfile=exp_test_user.log directory=DUMP_DIR schemas=TEST_USER


Similar command for data pump import utility

$impdp \'/ as sysdba \' dumpfile=exp_test_user.dmp logfile=imp_test_user.log directory=DUMP_DIR tables=TEST_USER.TEST


If you just want to gnerate script for object creation then

$expdp \'/ as sysdba \' dumpfile=exp_test_user.dmp logfile=exp_test_user.log directory=DUMP_DIR schemas=TEST_USER content=METADATA_ONLY


$impdp \'/ as sysdba \' dumpfile=exp_test_user.dmp logfile=imp_test_user.log directory=DUMP_DIR tables=TEST_USER.TEST
content=METADATA_ONLY sqlpfile=testscript.sql


 

Golden Gate commands -- Quick Reference

GGCGI is golden gate command line interface which can be invoked by running
./ggsci


TO CHECK PROCESS
1> info all
or
1> show all

TO SEE DETAIL OF SPECIFIC PROCESS
2> info extract ext1


TO CHECK VERSION

to display operating system and database version information. Use DBLOGIN to connect to the database first
GGSCI  11> dblogin userid ggadmin, password gg_pwd
Successfully logged into database.
GGSCI 12> versions
Operating System:
Linux
Version #1 SMP Mon Mar 02  08:19:03 EDT 2012 Release 2.6.18-194.el5PAE
Node: linux01.oncalldba.com
Machine: i686
Database:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 – Production
PL/SQL Release 11.1.0.6.0 – Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 – Production
NLSRTL Version 11.1.0.6.0 – Production



TO RUN SHELL SCRIPT WITHIN GGSCI

GGSCI  13> shell ls -l /home/oracle/goldengate/dirdat/
total 50588
-rw-rw-r- 1 oracle oinstall     5962 Jul 16 14:57 tst000000
-rw-rw-r- 1 oracle oinstall 9976629 Jul 19 13:09 tst000001

OBEY: to process a file that contains a list of GoldenGate commands. OBEY is useful for executing commands that are frequently used in sequence.
Suppose we want to run some Goldengate commands and execute those from a Unix shell script which can be called via say cron.
So we have a start_goldgate.sh shell script which will use the GGSCI command OBEY to call a text file which has the Goldengate commands which we would like to run in sequence.
[oracle@linux01 goldengate]$ cat start_goldgate.sh
cd /home/oracle/goldengate
./ggsci < EOF
OBEY /home/oracle/goldengate/startup.txt
EOF
[oracle@linux01 goldengate]$ cat startup.txt
START MANAGER
START EXTRACT EXT3
START EXTRACT DPUMP
INFO ALL
[oracle@linux01 goldengate]$ ./start_goldgate.sh
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x86, 32bit (optimized), Oracle 11 on Sep 29 2009 08:50:50

Copyright (C) 1995, 2009, Oracle and/or its affiliates.  All rights reserved.



GGSCI  1>
GGSCI  2> START MANAGER


Manager started.


GGSCI  3> START EXTRACT EXT3

EXTRACT EXT3 is already running.


GGSCI  4> START EXTRACT DPUMP

EXTRACT DPUMP is already running.


GGSCI  5> INFO ALL


Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING
EXTRACT     RUNNING     DPUMP       00:00:00      00:00:01
EXTRACT     ABENDED     EXT2        00:00:00      172:36:58
EXTRACT     RUNNING     EXT3        00:00:00      00:00:04