Thursday, January 29, 2015

impdp: error ORA-29913: error in executing ODCIEXTTABLEOPEN callout with Solution


DB hit below error from one of my client during import of a schema:

Starting "SYS"."SYS_IMPORT_FULL_02":  /******** AS SYSDBA dumpfile=exp_DC_OCM_2tbs_29Jan2015_1150_%U.dmp directory=DATAPUMP_DIR3 logfile=imp_exp_DC_OCM_2tbs_29Jan2015_1150.log table_exists_action=replace remap_schema=test:test parallel=24
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

ORA-31693: Table data object "TEST"."CI_TAB2_T" failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout

. . imported "TEST"."CI_TAB1_K_T"                5.003 MB 1241230 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYS"."SYS_IMPORT_FULL_02" completed with 1 error(s) at 12:04:50


ORA-31693: Table data object "TEST"."CI_TAB2_T" failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout


This is because of bug 8393456, and same can be confirmed on the Oracle Support website.

The problem seems to be related to cases where you use both PARALLEL (>1) and REMAP_SCHEMA at the same time.
Oracle versions affected are 11.2.0.1, 11.1.0.7 and 10.2.0.4.

Workaround 
implemented  by setting PARALLEL=1  (even you can user remap_schema) clause


Solution:

Do not user PARALLEL >1 with REMAP_SCHEMA clause in datapump (impdp).


Monday, January 26, 2015

Failed to establish dependency between database DBNAME and diskgroup resource


Today while working with client, found following error in alert log.


Default Temporary Tablespace will be necessary for a locally managed database in future release
Starting background process ASMB
Mon Jan 26 18:40:51 2015
ASMB started with pid=19, OS id=4843
Starting background process RBAL
NOTE: initiating MARK startup
Starting background process MARK
Mon Jan 26 18:40:52 2015
RBAL started with pid=20, OS id=4847
Mon Jan 26 18:40:52 2015
MARK started with pid=21, OS id=4849
NOTE: MARK has subscribed
NOTE: Loaded library: OSS
NOTE: Loaded library: System
SUCCESS: diskgroup DG_DATA was mounted
Mon Jan 26 18:40:57 2015
ERROR: failed to establish dependency between database ORCL and diskgroup resource ora.DG_DATA.dg
Database mounted in Exclusive Mode

Lost write protection disabled


Internal Bug 8304720 "ERROR: FAILED TO ESTABLISH DEPENDENCY BETWEEN DB and DISKGROUP"

"The db-dg dependency will be created later on if the diskgroup is used by the db again; the dependency can also be created manually through cmdline tool.

Automatically it will resolve itself later on when the db tries to use the diskgroup. Or we can manually establish the dependancy through any command line utility."


For establishing dependencies between database and diskgroups, run srvctl from RDBMS home:

$ srvctl modify database -d DB_NAME -a DG_NAME1,DG_NAME2

For example:

$ srvctl modify database -d ORCL -a "DG_DATA,DG_FRA"



Sunday, January 11, 2015

GOLDEN GATE SETUP - DML/DDL

GOLDEN GATE SETUP  -DML/DDL

Posted by: Amit Kumar Srivastava (OCM11g)
After Installation Goldengate binary on your database server add below concern environment variable on your bash profile.
SOURCE DATABASE     :     ggtest @SOURCE (vm212.ora.com)TARGET DATABASE     :     ggtest @TARGET (vm213.ora.com)
ENVIRONMENT:
SOURCE Database:
export ORACLE_SID=SOURCE
eport ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:/u01/app/gg_home
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/gg_home
TARGET Database:
export ORACLE_SID=SOURCE
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:/u01/app/gg_home
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/gg_home
ON SOURCE DATABASE (SOURCE@ggtest):
For DDL REPLICATION if you want then follow below step or ignore
DDL support scripts should be run in source database:
[oracle@vm212]$ cd /u01/app/gg_home
[oracle@vm212]$ sqlplus / as sysdba
SQL> @marker_setup.sql Enter GoldenGate schema name: ggtest
Setting schema name to ggtest
MARKER TABLE
——————————-
OK
MARKER SEQUENCE
——————————-
OK
Script complete.
Run ddl_setup script.
SQL> @ddl_setup.sqlEnter GoldenGate schema name: ggtest
SQL> @role_setup.sql
SQL> GRANT GGS_GGSUSER_ROLE TO ggtest
Grant succeeded.
SQL> @ddl_enable
Trigger altered.
ON SOURCE GOLDENGATE SERVER
GGSCI (vm212.ora.com) 1> create subdirs
Creating subdirectories under current directory /u01/app/gg_home
Parameter files                /u01/app/gg_home/dirprm: Already Exists
Report files                   /u01/app/gg_home/dirrpt: created
Checkpoint files               /u01/app/gg_home/dirchk: created
Process status files           /u01/app/gg_home/dirpcs: created
SQL script files               /u01/app/gg_home/dirsql: created
Database definitions files     /u01/app/gg_home/dirdef: created
Extract data files             /u01/app/gg_home/dirdat: created
Temporary files                /u01/app/gg_home/dirtmp: created
Stdout files                   /u01/app/gg_home/dirout: created
ON TARGET GOLDENGATE SERVER
GGSCI (vm213.ora.com) 1> create subdirs
Creating subdirectories under current directory /u01/app/gg_home
Parameter files /u01/app/gg_home/dirprm: Already Exists
Report files /u01/app/gg_home/dirrpt: created
Checkpoint files /u01/app/gg_home/dirchk: created
Process status files /u01/app/gg_home/dirpcs: created
SQL script files /u01/app/gg_home/dirsql: created
Database definitions files /u01/app/gg_home/dirdef: created
Extract data files /u01/app/gg_home/dirdat: created
Temporary files /u01/app/gg_home/dirtmp: created
Stdout files /u01/app/gg_home/dirout: created
ON SOURCE GOLDENGATE SERVER
Creating parameter files for EXTRACT AND PUMP process:add_extora_pumpora.oby
vi dirprm/add_extora_pumpora.oby
– DATABASE LOGIN DETAILS
dblogin userid ggtest, password oracle
– Add a change data extract process group named extora
— that reads from the database redologs
add extract extora, tranlog, begin now
– Associate trailfile that will contain the change data
— as output from the extora process group
add exttrail ./dirdat/et, extract extora
– FOR REMOTE OPERATION
— Add a change data extract process called a Pump
— that will copy local trail data to a
— remote, off box location
add extract pumpora, exttrailsource ./dirdat/et
– Associate remote trail with pumpora
add rmttrail ./dirdat/rt, extract pumpora
– Connect to database and add table level supplementel
— logging for tables emp and dept
— For Schema Level
add trandata ggtest.*
— For Individual table level
— add trandata ggtest.emp
— add trandata ggtest.dept
Creating parameter file for MANAGER
GGSCI> edit params mgr
PORT 7809
SYSLOG NONE
GGSCI> VIEW PARAMS MGR
Creating parameter file for EXTORA
GGSCI> edit params extora
– The first line must be the word extract
— followed by the name of extract
extract extora
— We log in here to get metadata.
— Yes the password can be encrypted
userid ggtest, password oracle
– Here is we are writing the data into trail
exttrail ./dirdat/et
– Optional parameter to update time since chkpt
— from default every 10 Secs
checkpointsecs 1
– We can list each table or using wildcarding
– DDL REPLICATIONS
DDL INCLUDE MAPPED OBJNAME ggtest.*
table ggtest.* ;
GGSCI> view params extora
Creating parameter file for PUMPORA
extract pumpora
– This is a pump process, so there is
— no reason to log into database so
— we can use the parameter passthru
passthru
– The pump writes remotely to the target machine.
— Here is we put the DNS or IP ADDRESS.
— We also put the port address that
— the REMOTE manager is running on.
rmthost vm213.ora.com, mgrport 7810
– This is the location where the trail
— is written on the target machine.
rmttrail ./dirdat/rt
– Optional parameter to update time since
— chkpt from default every 10 Secs.
checkpointsecs 1
– Listing of the Schema/tables (or wilecards)
table ggtest.*;

ON TARGET GOLDENGATE SERVER
Creating parameter file to add REPLICATE GROUP
GGSCI> edit params dirprm/add_repora.oby
– Connect to database
dblogin userid ggtest, password oracle
– Add checkpoint table
add checkpointtable ggtest.ogg_checkpoint
– Add replicat process repora that will convert
— trail rt into SQL transaction continiously
add replicat repora, exttrail ./dirdat/rt, checkpointtable ggtest.ogg_checkpoint
GGSCI> obey dirprm/add_repora.oby
Creating parameter file for MANAGER on TARGET SERVER
GGSCI> edit params mgr
PORT 7810
DYNAMICPORTLIST 8000-8010
– Dynamicportlist is a list of ports
— that the pump process on the source
— side work with the server collector
— on the TARGET side
SYSLOG NONE
GGSCI> START MGR
GGSCI> INFO ALL
Creating parameter file for REPLICATE  on TARGET SERVER
GGSCI>  edit params repora
replicat repora
ASSUMETARGETDEFS
userid ggtest, password oracle
– Ignore DDL error on replication side and continue DDL REPLICATION.
DDLERROR DEFAULT IGNORE
MAP ggtest.*, TARGET ggtest.* ;
Creating parameter file for GLOBALS on TARGET SERVER to store SCHEMA NAME for DDL REPLICATION
GGSCI> edit params ./GLOBALS
GGSCHEMA ggtest
GGSCI> view params ./GLOBALS
GGSCI> info all
GGSCI> start repora
GGSCI> info all
ON SOURCE GOLDENGATE SERVER
GGSCI> start extora
GGSCI> start pumpora
GGSCI> info all
Execute transaction on SOURCE DATABASE ON REPLICATION TABLES
GGSCI> stats extora total
GGSCI> stats pumpora total
GGSCI> info extora, detail
GGSCI> info pumpora, detail
ON TARGET GOLDENGATE SERVER
GGSCI> shell ls -lh dirdat/rt*
GGSCI> info repora
GGSCI> start repora
GGSCI> stats repora total
GGSCI> info repora
 Execute DML/DDL transaction on source database and check will it replicate on target server …
 Hope this will DML/DDL Replication on Goldengate.

Golden Gate Setup on ASM

Golden Gate on ASM -  11gR2

Starting from Oracle Database 10g release 2 introduced Oracle automatic storage management (ASM).  Oracle ASM instance showing the data flow from Oracle GoldenGate extract on an ASM environment.

Oracle GoldenGate change data capture requires ASM authentication for accessing the transaction logs. The extract parameter tranlog options handles authentication to the ASM instance


Create the parameter file for the Primary Extract group

Below configuration is :

GGSCI (dc174.ora.com)> ADD EXTRACT EXTORA, TRANLOG, THREADS 2, BEGIN NOW
GGSCI (dc174.ora.com)> ADD EXTTRAIL /u01/app/gg_home/dirdat/ts, EXTRACT EXTORA

GGSCI (dc174.ora.com)> edit params ./GLOBALS
GGSCHEMA ggtest
CHECKPOINTTABLE GGTEST.CKPT

GGSCI (dc174.ora.com)> DBLOGIN USERID ggtest, PASSWORD oracle
ADD CHECKPOINTTABLE GGTEST.CKPT

[oracle@dc174 gg_home]$ sqlplus / as sysdba

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER SYSTEM SWITCH LOGFILE;
  
Creating Network Configuration for ASM

To enable Oracle GoldenGate capture from an ASM instance transaction logs, it requires configuring the network for the ASM instance. The steps to prepare Oracle GoldenGate for an ASM instance follows.

STEP 1:

Ensure the database listener is configured to handle connection, and the TNS alias is configured. The network configuration is for the grid infrastructure network.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = SOURCE.ora.com)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = SOURCE)
    )
    (SID_DESC =
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/grid)
      (SID = +ASM)
    )
  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dc174.ora.com)(PORT = 1521))
  )

ADR_BASE_LISTENER = /u01/app/oracle

ASM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dc174.ora.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = +ASM)
    )
  )

STEP 2:

Test connectivity using SQL*Plus as SYSASM users. The test must be successful before proceeding to step 3.

$ . oraenv
ORACLE_SID = [SOURCE] ? +ASM
The Oracle base remains unchanged with value /u01/app/oracle

$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Sun Jan 11 10:02:11 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as SYSASM
Connected.



GGSCI (dc174.ora.com)> edit params EXTORA

SETENV (ORACLE_SID=SOURCE)
USERID ggtestuser, PASSWORD ggs_tmp1
EXTTRAIL /u01/app/gg_home/dirdat/ts
DISCARDFILE ./dirout/EXTORA.dsc, APPEND, MEGABYTES 10
TRANLOGOPTIONS ASMUSER SYS@+ASM, ASMPASSWORD oracle
--GETTRUNCATES
DYNAMICRESOLUTION
--TRANLOGOPTIONS FETCHCHAINEDUPDATES
ddl include mapped objname ggtest.*;
TABLE ggtest.*;
TABLEEXCLUDE ggtest.USER_ACTIVITY_TRACE;

Note: 

ASM is running and “TRANLOGOPTIONS ASMUSER SYS@+ASM, ASMPASSWORD oracle” is not configure then you will getting below error

Unable to replicate.. because redo’s are in ASM..

2015-01-11 10:20:33  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, ext.prm:  No valid log files for current redo sequence 256, thread 1, error retrieving redo file name for sequence 28, archived = 0, use_alternate = 0Not able to establish initial position for begin time 2015-01-11 10:20:33.

2015-01-11 10:20:33  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, ext.prm: PROCESS ABENDING.



Create the parameter file for the Data pump group
GGSCI (dc174.ora.com)> ADD EXTRACT PUMPORA,EXTTRAILSOURCE /u01/app/gg_home/dirdat/ts
GGSCI (dc174.ora.com)> ADD RMTTRAIL /u01/app/gg_home/dirdat/rs, EXTRACT PUMPORA

GGSCI (dc174.ora.com)> edit params PUMPORA
USERID ggtest, password oracle
rmthost dc174.ora.com, mgrport 7809
rmttrail /u01/app/gg_home/dirdat/rs
PASSTHRU
--GETTRUNCATES
DYNAMICRESOLUTION
ddl include mapped objname ggtest.*;
TABLE ggtest.*;


ON TARGET SYSTEM

Create the parameter file for the replicate group
GGSCI (dc174.ora.com)> EDIT PARAMS ./GLOBALS
GGSCHEMA GGS
CHECKPOINTTABLE GGTEST.CKPT

GGSCI (dc174.ora.com)> DBLOGIN USERID ggtest, Password oracle
ADD CHECKPOINTTABLE GGTEST.CKPT

[oracle@dc174 gg_home]$ sqlplus / as sysdba

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER SYSTEM SWITCH LOGFILE;

GGSCI (dc174.ora.com)> ADD REPLICAT REPORA,EXTTRAIL /u01/app/gg_home/dirdat/rs, CHECKPOINTTABLE GGTEST.CKPT

GGSCI (dc174.ora.com)> EDIT PARAMS REPORA
REPLICAT REPORA
ASSUMETARGETDEFS
USERID ggtest, password oracle
DDLERROR DEFAULT IGNORE
MAP ggtest.*, TARGET ggtest.*;

ON SOURCE
START EXTRACT EXTORA
START EXTRACT PUMPORA
VIEW REPORT EXTORA
VIEW REPORT PUMPORA

GGSCI (dc174.ora.com)> info all
ON TARGET SYSTEM
START REPLICAT REPORA
STATUS REPLICAT REPORA

VIEW REPORT REPORA

make sure every process is running on source and target

GGSCI (dc174.ora.com)> info all
GGSCI (vm212.ora.com)> info all


Check Goldengate alert log file for any error on source and target.

[oracle@dc174 gg_home]$ tail -f ggserr.log
[oracle@vm212 gg_home]$ tail -f ggserr.log