Environment variables not refreshing correctly when macros are used (Doc ID 2121364.1)

Last updated on JUNE 14, 2017

Applies to:

Oracle GoldenGate - Version 11.2.1.0.19 to 12.2.0.1.0 [Release 11.2 to 12.2]
Information in this document applies to any platform.

Symptoms

--  Case scenario --

Customer execute stored procedures passing in a table name variable and parameters.
At some point, the old table name rather than the new table name is being retained and so the old table with the current parameters do not work together.

The order of things:

set environmental variable table name=person
call stored procedure (&tablename) passing in parameter1, parameter 2 (so we are substituting person as the table name and passing in 2 parms)
set environmental variable table name=department
call stored procedure (&tablename) passing in parameter1, parameter 2, parameter 3, parameter 4 (here we should be substituting department as the table name and passing in 4 parms. Instead what happens is it keeps the table name as person and then the params do not match with the table)

++ Example from test cases

--Problem output from report file--

#begin_map ( )
MAP ( test.source2, TARGET test.target2 );
?SOURCE_SCHEMA = test
?SOURCE_TABLE = source2
?TARGET_SCHEMA = test
?TARGET_TABLE = target2

2016-02-22 14:56:19 INFO OGG-01835 No schema is specified for table ( in statement 'MAP ( test.source2, TARGET test.target2 )'. Using default schema DBAGGS
.
#set_table_vars( "source1", "target1" )
SETENV ( SOURCE_TABLE = "source1" )
SETENV ( TARGET_TABLE = "target1" )
#begin_map ( )
MAP ( test.source2, TARGET test.target2 );
?SOURCE_SCHEMA = test
?SOURCE_TABLE = source2  <===== here
?TARGET_SCHEMA = test
?TARGET_TABLE = target2   <====== here

---Expected output--

#set_table_vars( "source2", "target2" )
SETENV ( SOURCE_TABLE = "source2" )
Set environment variable (SOURCE_TABLE=source2)
SETENV ( TARGET_TABLE = "target2" )
Set environment variable (TARGET_TABLE=target2)
#begin_map ( )
MAP ( test.source2, TARGET test.target2 );
?SOURCE_SCHEMA = test
?SOURCE_TABLE = source2
?TARGET_SCHEMA = test
?TARGET_TABLE = target2

2016-02-22 15:01:20 INFO OGG-01835 No schema is specified for table ( in statement 'MAP ( test.source2, TARGET test.target2 )'. Using default schema DBAGGS
.
#set_table_vars( "source1", "target1" )
SETENV ( SOURCE_TABLE = "source1" )
Set environment variable (SOURCE_TABLE=source1)
SETENV ( TARGET_TABLE = "target1" )
Set environment variable (TARGET_TABLE=target1)
#begin_map ( )
MAP ( test.source1, TARGET test.target1 );
?SOURCE_SCHEMA = test
?SOURCE_TABLE = source1   <====== here
?TARGET_SCHEMA = test
?TARGET_TABLE = target1     <====== here

 

Changes

 Upgraded from OGG v11.2.1.0.3 to v11.2.1.0.19

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms