Scenario 2

You can set up replication from an SAP Business Suite application that runs on Oracle database and contains cluster tables into SAP HANA database.

These steps describe how to configure a Replication Server to enable materialization and replication.
  1. Enable the replication of trailing zeros in varbinary values:
    configure replication server 
    set varbinary_strip_trailing_zeros to 'off'
  2. Set the value of $SAPSYSTEMNAME environment variable for the SAP HANA database <sid>adm user to the sapsystemname configuration parameter:
    alter connection to rds.rdb
    set sapsystemname to 'sid_adm_value'
    
    where:
    • rds.rdb is the connection name for the SAP HANA database.
    • sid_adm_value is the name of the SID (SAP SYSTEM NAME).

      For example, the SYSTEM NAME is D01. You must enter:

      alter connection to rds.rdb set sapsystemname to 'D01'

  3. Map primary schema to replicate schema:
    alter connection to rds.rdb
    set schemamap with decluster from 
    pds.pdb.primary_schema to HANA_schema
    
    where:
    • rds.rdb is the connection name for the SAP HANA database.
    • pds.pdb is the is the connection name used in the create connection command for primary database.
    • primary_schema is the schema name of the primary database.
    • HANA_schema is the schema name of the SAP HANA database.
  4. Connect to Replication Agent through isql, and mark these SAP Data Dictionary (DD) tables—DD16S, DD03L, and DD02L—for replication:
    pdb_setreptable primary_schema.tablename, mark, owner
    go
    

    where, primary_schema.tablename is the SAP table name.

    Note: Make sure that you do not mark the cluster tables CLU4 and VER_CLUSTR for replication. For more information, see SAP Note 902817 – Inconsistencies in cluster tables (log vs phys field name): https://css.wdf.sap.corp/sap/support/notes/902817
  5. In Replication Agent, create a replication definition for each SAP DD table:
    rs_create_repdef primary_schema.tablename
    go

    where, primary_schema.tablename is the name of the SAP DD table.

  6. Create a subscription against the replicate connection to materialize the SAP DD tables on the SAP HANA database.
    create subscription sub_name 
    for table_repdef 
    with replicate at rds.rds 
    without holdlock 
    direct_load init replicate table 
    with create_or_truncate 
    user username password pass
    go
    where:
    • sub_name is the name of the subscription.
    • table_repdef is the table replication definition the subscription sub_name is for.
    • rds.rdb is the replicate SAP HANA database connection created earlier.
    • username is the user who connects to Replication Agent for Oracle.
    • pass is the password of the username. You must enter a password.
    Note: You can also also use other create subscription options such as create, recreate, or truncate.
  7. (Only for SAP Business Suite running on Oracle database) Set sap_trim_len to on to trim the first two bytes for certain SAP columns such as RAW or LRAW whose DDIC type length is greater than 255 bytes:
    alter connection to data_server.database 
    set sap_trim_len to 'on'
    
  8. Set reblock_ddntf to off to allow Replication Server to disable the FIELDS column length adjustment in the DDNTF table.
    alter connection to data_server.database  
    set reblock_ddntf to 'off'
    
  9. Connect to Replication Agent through isql, and mark these SAP tables—DDNTT, DDNTF, TADIR, SVERS, DD09L, DD12L, and DD17S:
    pdb_setreptable primary_schema.tablename, mark, owner
    go
    

    where, primary_schema.tablename is the name of the SAP table.

  10. In Replication Agent, create a replication definition for each SAP table that you marked for replication:
    rs_create_repdef primary_schema.tablename
    go

    where, primary_schema.tablename is the name of the SAP table.

  11. Create a subscription against the replicate connection to materialize the SAP tables on the SAP HANA database.
    create subscription sub_name 
    for table_repdef 
    with replicate at rds.rdb 
    without holdlock 
    direct_load init replicate table 
    with create_or_truncate 
    user username password pass
    go
    where:
    • sub_name is the name of the subscription.
    • table_repdef is the table replication definition the subscription sub_name is for.
    • rds.rdb is the replicate SAP HANA database connection created earlier.
    • username is the user who connects to Replication Agent for Oracle.
    • pass is the password of the username. You must enter a password.
    Note: You can also also use other create subscription options such as create, recreate, or truncate.
  12. Connect to Replication Agent through isql, and mark the UMGPOCNV table:
    pdb_setreptable primary_schema.UMGPOCNV, mark, owner
    go
    
  13. In Replication Agent, create a replication definition for the UMGPOCNV table:
    rs_create_repdef primary_schema.UMGPOCNV
    go
  14. Create a subscription against the replicate connection to materialize the UMGPOCNV table on the SAP HANA database.
    create subscription sub_name 
    for table_repdef 
    with replicate at rds.rdb 
    without holdlock 
    direct_load init replicate table 
    with create_or_truncate 
    user username password pass
    go
    where:
    • sub_name is the name of the subscription.
    • table_repdef is the table replication definition the subscription sub_name is for.
    • rds.rdb is the replicate SAP HANA database connection created earlier.
    • username is the user who connects to Replication Agent for UDB.
    • pass is the password of the username. You must enter a password.
  15. Create table replication definition and subscription with materialization for all other SAP tables.