0410 - data provisioning - slt for hana 1.0 - repairing replication errors with abap program...

17
SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION 1 CONTENTS SYMPTOM .................................................................................................................................................. 2 STANDARD PROCEDURE ......................................................................................................................... 2 EMERGENCY PROCEDURE ...................................................................................................................... 6 MANUAL APPROACH ................................................................................................................................ 6 ABAP ASSISTED APPROACH (SEMI-AUTOMATED) ...............................................................................10 ABAP PROGRAM ......................................................................................................................................11 SAP HANA SLT Replication Repairing Replication Errors with ABAP Program Automation

Upload: tfadl1

Post on 28-Jan-2016

128 views

Category:

Documents


15 download

TRANSCRIPT

Page 1: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

1

CONTENTS

SYMPTOM .................................................................................................................................................. 2 STANDARD PROCEDURE ......................................................................................................................... 2 EMERGENCY PROCEDURE ...................................................................................................................... 6 MANUAL APPROACH ................................................................................................................................ 6 ABAP ASSISTED APPROACH (SEMI-AUTOMATED) ...............................................................................10 ABAP PROGRAM ......................................................................................................................................11

SAP HANA SLT Replication Repairing Replication Errors with ABAP Program Automation

Page 2: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

The following document provides a step-by-step approach for repairing replication errors associated with SAP HANA data provisioning. SYMPTOM

You have provision tables in SAP HANA Studio using SLT replication which have gone into error status or need to be re-replicated due issues with delta logging. These tables need to be re-replicated to ensure proper functionality and validity of SAP HANA models and SAP BusinessObjects reports. STANDARD PROCEDURE

1. Stop replication in SAP HANA Studio via Data Provisioning a. Go to Quick Launch Data Provisioning Stop Replication

Page 3: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

b. Select the tables you wish to re-replicate.

c. Wait a few minutes for replication to stop.

Page 4: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

d. Replication status can be checked via transaction IUUC_SYNC_MON on SLT server (Figure 3)

Checking status in IUUC_SYNC_MON (SLT)

Page 5: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

2. After replication has stopped, drop the table from the replication schema

3. Attempt replication again using Data Provisioning in SAP HANA Studio. NOTE: If the standard procedure fails, please refer to the emergency procedure which follows.

Page 6: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

EMERGENCY PROCEDURE MANUAL APPROACH

1. In SAP HANA Studio: Delete the records for the table from RS_STATUS in your replication schema.

NOTE: If the table has entries present in the RS_REPL table, remove its respective entries as well.

Find entries from RS_STATUS in replication schema

Delete entries from RS_STATUS table in replication schema

Page 7: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

2. In SAP HANA Studio: Drop the table in the replication schema

3. In SLT: IUUC_SYNC_MON Expert Functions Delete DB Triggers <MT-ID>/<your table name>

Page 8: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

4. In SLT: IUUC_SYNC_MON->Delete Logging tables

5. If steps 3 & 4 do not work (which occurs frequently), use IUUC_REMOTE on the source system (ECC) to clean up the triggers and logs for the respective table

6. In SLT: Check the following tables and remove entries for the table from them, if necessary:

PLEASE NOTE: The ABAP program included in the appendix can achieve automation of this step.

IUUC_TABLES DMC_MT_TABLES, DMC_COBJ IUUC_RS_ORDER IUUC_RS_STATUS

PLEASE NOTE: The ABAP program included in the appendix can achieve automation of this step.

Page 9: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

7. If absolutely no replication or load is active and you still experience issues, you can, in exceptional cases, consider removing all records from table DMC_ACT_REC.

NOTE: Please be very careful if/when doing this! NO loads or replications can be in progress while you are deleting activity records! The jobs need to be stopped. If you have one schema that needs to keep replicating, you could only remove records selectively – with the greatest caution.

8. Try your replication/load again.

9. If the table shows up again in “Data Provisioning” in HANA with status “Error”, remove it (again) from

table “<SCHEMA>”.”RS_STATUS”.

Page 10: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

ABAP ASSISTED APPROACH (SEMI-AUTOMATED, USE AT YOUR OWN RISK!)

1. Execute the following procedure in SAP HANA a) Delete the table from the replication schema (HANA Studio) b) Delete all entries for the table from RS_STATUS and RS_ORDER in replication schema (HANA

Studio)

c) Delete logging tables and triggers in ECC using t-code IUUC_REMOTE (ECC) or other preferred method

Delete triggers in ECC using IUUC_REMOTE

Delete logging tables in ECC using IUUC_REMOTE

NOTE: Please reference the screenshots copied earlier in this document if you are unsure how to complete the above steps.

2. Execute the ABAP program (copied on next page) in your SLT server

3. Start replication in SAP HANA Studio via Data Provisioning

Page 11: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

ABAP PROGRAM (NOTE: USE AT YOUR OWN RISK!)

*&---------------------------------------------------------------------* *& Report ZB_RESET_TABLE_REPL *& *&---------------------------------------------------------------------* *& Program to clean up tables and logs in SLT *& *&---------------------------------------------------------------------* REPORT ZB_RESET_TABLE_REPL. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME. PARAMETER p_mt_id LIKE DMC_MT_TABLES-id . PARAMETER p_table LIKE DMC_MT_TABLES-TABNAME . SELECTION-SCREEN END OF BLOCK b1. SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.. PARAMETER p_test AS CHECKBOX DEFAULT ''. SELECTION-SCREEN END OF BLOCK b2. SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME title text-001. PARAMETER p_tabs AS CHECKBOX DEFAULT 'X'. PARAMETER p_mttabs AS CHECKBOX DEFAULT 'X'. PARAMETER p_cobj AS CHECKBOX DEFAULT 'X'. PARAMETER p_order AS CHECKBOX DEFAULT 'X'. PARAMETER p_status AS CHECKBOX DEFAULT 'X'. PARAMETER p_rulmap AS CHECKBOX DEFAULT ''. PARAMETER p_tabstg AS CHECKBOX DEFAULT ''. PARAMETER p_typmap AS CHECKBOX DEFAULT ''. SELECTION-SCREEN END OF BLOCK b3. DATA gv_tabname LIKE dd02l-tabname. DATA gv_tname LIKE dd02l-tabname. DATA gv_groupnr(2) TYPE n. DATA gv_max(2) TYPE n. TABLES iuuc_repl_hdr. TABLES iuuc_tables. DATA gv_ident TYPE dmc_cobj-ident. DATA gs_iuuc_tables TYPE iuuc_tables. DATA gs_mt_tables TYPE dmc_mt_tables. DATA gs_cobj TYPE dmc_cobj. DATA gs_rs_order TYPE iuuc_rs_order. DATA gs_rs_status TYPE iuuc_rs_status. start-of-selection.

Page 12: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

PERFORM delete_data. * *&---------------------------------------------------------------------* *& Form Delete_data *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM delete_data. PERFORM get_gv_ident. IF p_test =''. PERFORM delete_entries. ELSE. PERFORM list_entries. ENDIF. ENDFORM. "Delete_data *&---------------------------------------------------------------------* *& Form get_gv_ident *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM get_gv_ident. DATA lv_ident TYPE char22. CONCATENATE 'Z_'p_table'_' p_mt_id INTO lv_ident. SELECT * FROM dmc_cobj INTO gs_cobj WHERE ident LIKE lv_ident. * WRITE:/ gs_cobj-ident. ENDSELECT. * WRITE:/ . IF sy-dbcnt = 1. gv_ident = gs_cobj-ident. ENDIF. ENDFORM. "get_gv_ident

Page 13: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

*&---------------------------------------------------------------------* *& Form delete_entries *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM delete_entries. *** deletion IF p_tabs = 'X'. DELETE FROM iuuc_tables WHERE mt_id = p_mt_id AND tabname = p_table. WRITE:/ 'Table IUUC_TABLES entries deleted'. ELSE. WRITE:/ 'Table IUUC_TABLES skipped'. ENDIF. IF p_mttabs = 'X'. DELETE FROM dmc_mt_tables WHERE id = p_mt_id AND tabname = p_table. WRITE:/ 'Table DMC_MT_TABLES entries deleted'. ELSE. WRITE:/ 'Table DMC_MT_TABLES skipped'. ENDIF. IF p_cobj = 'X'. DELETE FROM dmc_cobj WHERE cobj_alias EQ p_table. WRITE:/ 'Table DMC_COBJ entries deleted'. * WRITE:/ 'Ident: ', gv_ident. ELSE. WRITE:/ 'Table DMC_COBJ skipped'. ENDIF. IF p_order = 'X'. DELETE FROM iuuc_rs_order WHERE mt_id = p_mt_id AND table_name = p_table. WRITE:/ 'Table IUUC_RS_ORDER entries deleted'. ELSE. WRITE:/ 'Table IUUC_RS_ORDER skipped'. ENDIF. IF p_status = 'X'. DELETE FROM iuuc_rs_status WHERE mt_id = p_mt_id AND table_name = p_table. WRITE:/ 'Table IUUC_RS_STATUS entries deleted'. ELSE. WRITE:/ 'Table IUUC_RS_STATUS skipped'. ENDIF.

Page 14: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

IF p_rulmap = 'X'. DELETE FROM iuuc_ass_rul_map WHERE mt_id = p_mt_id AND tabname = p_table. WRITE:/ 'Table IUUC_ASS_RUL_MAP entries deleted'. ELSE. WRITE:/ 'Table IUUC_ASS_RUL_MAP skipped'. ENDIF. IF p_tabstg = 'X'. DELETE FROM iuuc_repl_tabstg WHERE mt_id = p_mt_id AND tabname = p_table. WRITE:/ 'Table iuuc_repl_tabstg entries deleted'. ELSE. WRITE:/ 'Table iuuc_repl_tabstg skipped'. ENDIF. * if p_typMap = 'X'. * DELETE FROM iuuc_repl_typmap * WHERE mt_id = p_mt_id. * WRITE:/ 'Table iuuc_repl_typmap entries deleted'. * ELSE. * WRITE:/ 'Table iuuc_repl_typmap skipped'. * ENDIF. ENDFORM. "delete_entries *&---------------------------------------------------------------------* *& Form list_entries *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM list_entries. ** testmode IF p_tabs = 'X'. * DELETE FROM iuuc_tables * WHERE mt_id = p_mt_id * AND tabname = p_table. WRITE:/. WRITE:/ 'Table in IUUC_TABLES: '. SELECT * FROM iuuc_tables INTO gs_iuuc_tables WHERE mt_id = p_mt_id AND tabname = p_table. WRITE:/ gs_iuuc_tables. ENDSELECT. ELSE. WRITE:/ 'Table IUUC_TABLES skipped'. ENDIF. IF p_mttabs = 'X'.

Page 15: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

WRITE:/. WRITE:/ 'Table in DMC_MT_TABLES: '. SELECT * FROM dmc_mt_tables INTO gs_mt_tables WHERE id = p_mt_id AND tabname = p_table. WRITE:/ gs_mt_tables-id, gs_mt_tables-tabname, gs_mt_tables-cobj_guid. ENDSELECT. ELSE. WRITE:/ 'Table DMC_MT_TABLES skipped'. ENDIF. IF p_cobj = 'X'. WRITE:/. WRITE:/ 'Ident: ', p_table. WRITE:/ 'Table in DMC_COBJ: '. SELECT * FROM dmc_cobj INTO gs_cobj WHERE cobj_alias EQ p_table. WRITE:/ gs_cobj. ENDSELECT. ELSE. WRITE:/ 'Table DMC_COBJ skipped'. ENDIF. IF p_order = 'X'. WRITE:/. WRITE:/ 'Table in IUUC_RS_ORDER: '. * DELETE FROM iuuc_rs_order * WHERE mt_id = p_mt_id * AND table_name = p_table. SELECT * FROM iuuc_rs_order INTO gs_rs_order WHERE mt_id = p_mt_id AND table_name = p_table. WRITE:/ gs_rs_order-mt_id, gs_rs_order-table_name. ENDSELECT. ELSE. WRITE:/ 'Table IUUC_RS_ORDER skipped'. ENDIF. IF p_status = 'X'. WRITE:/. WRITE:/ 'Table in IUUC_RS_STATUS: '. * DELETE FROM iuuc_rs_status * WHERE mt_id = p_mt_id * AND table_name = p_table. SELECT * FROM iuuc_rs_status

Page 16: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

SLT REPLICATION: REPAIRING REPLICATION ERRORS WITH ABAP PROGRAM AUTOMATION

INTO gs_rs_status WHERE mt_id = p_mt_id AND table_name = p_table. WRITE:/ gs_rs_status-mt_id, gs_rs_status-table_name. ENDSELECT. ELSE. WRITE:/ 'Table IUUC_RS_STATUS skipped'. ENDIF. ENDFORM. "list_entries

Page 17: 0410 - Data Provisioning - SLT for HANA 1.0 - Repairing Replication Errors with ABAP Program Automation.pdf

© 2012 SAP AG. All rights reserved.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company.

Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company.

Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. .

www.sap.com

Disclaimer: This document is not subject to your license agreement or any other agreement with SAP. SAP has no obligation to pursue any course of business outlined in this document or to develop or release any functionality mentioned in this document. This document and SAP's strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent. Authors: Haran Vinayagalingam Edward Stark Matthew Mattia Version: 1.0 Date: April 19, 2012