0

We have primary source database as Oracle 11gR2 and target as SAP HANA. We are trying to test SAP - Sybase Replication server for replication from Primary ORACLE to Target HANA.

We need to add extra columns such as RECORD_DATE and LAST_MODIFIED_DATE to HANA tables. Is it possible to add Transformations or extra columns to target tables which are not present in Primary Database.

Best Regards

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Anirudh D
  • 181
  • 3
  • 14
  • 33

2 Answers2

0

are you thinking of adding these fields during replication. or want to merge them after replication. If after replication you want to merge them simply just go to Hana Studio and make an Information view to get the the merged or simply joined data from different tables.

and if that table is not present in the the source System then instead of replication make a Excel flat file and import it into Hana using the Import option on the RHS of hana studio.

and The only way to Alter a table definition in Hana is by Using the Alter Table SQL statement no other Shortcuts. Or just import and make a join.

  • I want to add it during replication. Tables are present on both primary and secondary. Just to maintain insertion time and last modified time , I want to populate date columns in replicate database – Anirudh D Apr 17 '17 at 05:09
  • I could achieve RECORD_DATE(timestamp when record is inserted) by adding default column as current_timestamp in replicated table. But we are still struglling with LAST_MODIFIED_DATE(timestamp when record is updated). – Anirudh D Apr 17 '17 at 05:31
  • since you are replicating table into Hana it means that Hana is the not DB whose columns gets populated when a record is created or updated. – Shivam Shrivastava Apr 17 '17 at 06:38
  • go through this. and let me know if this helps https://archive.sap.com/discussions/thread/3215142 use slt trigger instead of sybase – Shivam Shrivastava Apr 17 '17 at 06:58
0

I'm assuming you want to capture auditing data for records inserted/updated by the Repserver maintenance user (in the HANA database).

While the column default (for inserts; as discussed with Shivam) will work, for updates you've got a few options:

  • an update trigger on the HANA table [I don't work with HANA so I don't know if this is doable]

  • defining the update column as a (materialized) computed column, with the associated function being responsible for obtaining the current date/time when other columns in the table are modified [while this is doable in Sybase ASE, I don't know if this is doable in HANA]

  • (in repserver) create a custom function string for the rs_update function on this table which emulates a standard rs_update function string with the addition of an update of LAST_MODIFIED_DATE = getdate() (replace getdate() with HANA's equivalent of the current date/time) [there are a couple different ways to do this depending on SRS version, what's doable with HANA-specific function strings, and personal preference - a bit much to go into at this point if a custom function string is going to be out of the question or you've already got an acceptable solution]

markp-fuso
  • 28,790
  • 4
  • 16
  • 36