Professional Documents
Culture Documents
User Manual - IIDR CHCCLP Scripting 1 © 2015 IBM Corporation
User Manual - IIDR CHCCLP Scripting 1 © 2015 IBM Corporation
Syntax
• All commands follow a consistent pattern:
verb object parameter1 value1 parameter2 value2;
add column encodings
clear column mappings
connect/disconnect data translation
delete database schemas
describe database tables
end/start datastore events
exit/quit datastore
export/import/promote datatypes
filter derived column
flag refresh encodings
help index columns
list latency thresholds
lock/unlock journal control fields
map/unmap refresh order
mark capture point replication
modify replication table
monitor replication tables
park server
promote source column
readd source columns
reassign subscription
remove subscription events
run table mapping
select
show
Syntax
• Verb/object/parameter names and “key”-based parameter values
are case-insensitive.
• CDC/database object names are case-sensitive (e.g. a
subscription name or a database table name).
• Valid syntax requires both the parameter name and its value.
• Parameters can be:
• required or optional
• can provide a default value
• can provide a set of expected values
Syntax
• A parameter value with any of these characters can be entered
without quotes:
• A-Z a-z 0-9 _ @ * . % -
Concept of context
• Understanding Context
• At any given time CHCCLP can only be connected to one Access
Server. The context defines the source datastore, target datastore,
subscription and table mapping currently referenced through that
Access Server
• The context is similar to a selection in Management Console
• While manipulating a particular function it is important to first establish
the proper context. For example when you are configuring a derived
expression you must first set up the context to reference the correct
table mapping, subscription, datastores, and Access Server.
• The context can be viewed at any time using command ‘show
context’
CONTEXT CURRENT OBJECT
------------------ ----------------------------------
Access Server localhost@10101
Source Datastore DS1Target
Datastore DS2
Subscription SUB1
Table Mapping CDC.TABLE_1 - CDC.TABLE_1
Interactive mode
• Provides an interactive
environment to execute
commands
Embedded mode
• CHCCLP commands can be embedded in a Java program with similar
calls as interactive or batch mode.
• Java programming would be useful in cases where additional ‘logic’ is
required such as conditional statements, loops, etc.
• Results of the commands can also be manipulated in Java objects such
as result lists, tables, etc.
String mapping = "add table mapping sourceSchema {0} sourceTable {1} targetSchema {2} targetTable {3}";
script.execute(MessageFormat.format(mapping, new Object[] { "USER1", "TABLE_1", "USER1", "TABLE_1" }));
script.execute(MessageFormat.format(mapping, new Object[] { "USER1", "TABLE_2", "USER1", "TABLE_2" }));
script.execute(MessageFormat.format(mapping, new Object[] { "USER1", "TABLE_3", "USER1", "TABLE_3" }));
script.execute("start mirroring");
script.execute("disconnect server");
}
catch (EmbeddedScriptException e)
{
System.out.println(e.getResultCodeAndMessage());
}
finally
{
script.close();
}
}
}
list subscription
Enhanced to support reloading
List subscriptions reload true
Questions?
?
CDC Center of Excellence-SWG-WW