Enhancements to Materialization in SAP Replication Server 15.7.1 SP305
In SAP Replication Server 15.7.1 SP305, we’ve added a dump marker label to the define subscription command. What’s a dump marker label, exactly? It’s a tag to identify a specific dump marker in the transaction log.
Why introduce a dump marker label?
When you materialize a replicate database with the define subscription command, you need to run a dump database or a dump transaction command in SAP ASE. Then, the RepAgent thread generates a dump marker at the end of the dump and forwards it to SAP Replication Server. When the dump marker reaches the distributor (DIST) thread, replication starts. When the dump marker reaches the database server interface (DSI) for the replicate database, the DSI shuts down to wait for you to load the database.
Prior to 15.7.1 SP305, if you forgot to turn off automatic backup on the primary database when you materialized a replicate database, you might have run into the following issue:
An automated transaction or database dump might happen between the define subscription command and the dump database/dump transaction command you issue on the primary database. In this case, replication starts at the first dump marker, which is the automated dump, instead of the dump you issue, and you end up with errors in the DSI.
Starting from SP305, you can set a dump marker label in the define subscription command to avoid confusion about where to start replication. This ensures that:
- When the dump marker with the specified label reaches the DIST, SAP Replication Server starts replication for the replicate database.
- When the dump marker with the specified label reaches the DSI, the DSI shuts down to wait for the database to finish loading.
When you use a dump marker label in the define subscription command, make sure you use the same label in the dump database or dump transaction commands in SAP ASE.
What has changed for you?
The materialization procedure is now slightly different from previous releases.
Non-HADR: Log Transfer Language (LTL) and stream replication
If you materialize a replicate database with the define subscription command, a couple of steps in the procedure are affected by the dump marker label.
First, on the replicate SAP Replication Server, define the subscription and include a dump marker label.
In this example, we’ll call the label ‘RESYNC001’:
define subscription <sub_name>
for database replication definition <db_repdef>
with primary at <DS.db>
with replicate at <DS.db>
use dump marker RESYNC001
Then, on the primary SAP ASE server, dump the database using the same dump marker label:
dump database <db_name>
with label = ‘RESYNC001’
Other steps for materializing a replicate database remain the same.
If you materialize the replicate database with the sap_materialize command in the Replication Management Agent (RMA), RMA prompts you to dump the database on the primary node with a specified label.
sap_materialize start <primary_logical_hostname>, <ha_logical_hostname>, <database>
TASKNAME TYPE VALUE
----------- ----------------- -------------
Status Start Time Wed Sep 28 21:56:47 EDT 2016
Status Elapsed Time 00:00:03
Materialize Task Name Materialize
Materialize Task State Completed
Materialize Short Description Materialize database
Materialize Long Description The prerequisite work for manually dumping and loading database <database> is finished. You can use "dump database <database> to ... with compression = 1, label = 'RMA_DUMP_LABEL'" to dump the database. Be sure to use the label option named 'RMA_DUMP_LABEL'.
In this example, you need to use the “RMA_DUMP_LABEL” in the dump database command.
A default label name is provided in the /DM/RMA-/config/bootstrap.prop file for all RMA instances running on the same machine. For a certain RMA, you can also modify the default label in the /DM/RMA/instances/AgentContainer/config/bootstrap.prop file, which has higher priority over the value defined in the /DM/RMA-/config/bootstrap.prop file.
Here’s an example of a label definition:
When you materialize the replicate database automatically using sap_materialize auto, RMA dumps the database with the specified label automatically. In this situation, you don’t need to worry about the dump marker label.
If you want to set a dump marker label,
- use LTL replication version 791 or later;
- use stream replication version 1.7.1 or later.
To avoid errors, you can get SAP Replication Server to perform a version check when running the define subscription command. Turn on the RSFEATURE_DMPLABLE_VER_CHECK trace:
trace "on", RSFEATURE, RSFEATURE_DMPLABLE_VER_CHECK
This trace is disabled by default.