cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get at the database dump history of a Sybase ASE system in ABAP?

dr_ajt
Participant
0 Kudos

We have a simple ABAP report that reads the dates of the last database dumps and various backup statistics. This works fine for Hana and MS Sequel systems, but we would like the do the same for a Sybase ASE system.The function /SDF/SYB_BACKUP_HIST_NEW looks promising but it has the following in it:

* code not to be executed
EXIT.

at the top, so it's clearly not in use at the moment.

I can see the data in the DBA Cockpit, but it's within a webdynpro session and a swine to get at, so I'm not sure how it's reading the data. There are a whole range of functions that seem to be Sybase related, but I can't see them being used anywhere on the box at all. Most of them either don't run at all, or dump if run. None of them have any useful comments or documentation to describe what they do or if one should be using them...!

Accepted Solutions (1)

Accepted Solutions (1)

victoria_normand
Contributor

Hello Adam,
I just saw your last reply today. No worries, I realize myself that I misunderstood your initial question.

The SAP Note 2466246 - was the one that introduced the comment "* code not to be executed" because as it is mentioned there, the sp_dump_history was causing some issues for EWA data collectors, and this correction is available since ST-PI 2008_1 700 SP17 / ST-PI 2008_1 740 SP07 so included on your version as you mentioned.

I couldn't find any other correction that modify the /SDF/SYB_BACKUP_HIST_NEW back to "normal". The issue with sp_autoformat mentioned on SAP Note 2466246 was fixed with SAP Note 2415246, and besides that, the execution of sp_dump_history in chained mode is done since ASE 16 SP02 PL06. If you want to use that function, I would suggest to open an incident with component owner of /SDF/SYB_BACKUP_HIST_NEW, SV-SMG-SDD Service Data Download, to check whether is possible to have that function enabled again. Otherwise, if you trace the DBACockpit Dump History option, you'll see it uses class CL_SYB_ACTION_DUMP_HISTORY, which is the one executing the sp_dum_history.

HTH,

Best regards,
Victoria.

dr_ajt
Participant
0 Kudos

Thanks. At the moment if I copy the code from the deactivated function and run it directly it works perfectly well on our system.

The code in the class is a little different but clearly doing the same kind of thing and if I can use that, I'd prefer. Every developer prefers to stick with standard whenever possible...

Thanks.

Answers (2)

Answers (2)

hrollizo
Active Participant
0 Kudos
dr_ajt
Participant
0 Kudos

Thanks for the list of notes, but most of them can't be implement on our system, it's already past the note being on a higher SP, and the later ones don't see at first glance to be directly relavent.

victoria_normand
Contributor
0 Kudos

Hello Adam,

The function module /SDF/SYB_BACKUP_HIST_NEW for Solution Manager should work for ASE as well (as reference SAP Note 2141208 - ASE: Correction to function module /SDF/SYB_BACKUP_HIST_NEW) , it basically refers to the ASE system stored procedure sp_dump_history. It seems that the error message you are getting ("* code not to be executed") was introduced thru SAP Note 2466246 and seems to be related with authorization check. You mentioned that the data is correctly reported thru DBACockpit, which is good. To understand why this message is being returned by the FM, you may check if there is any error reported in SM21 and related dev trace file. If there is no ODBC error, you might need to involve/check with Solution Manager - SDD (Service Data Download).

HTH,

Best regards,
Victoria.

dr_ajt
Participant

Thanks for those note suggestions, but our system is at a higher support pack level so neither can be applied anymore. Our system is at level:

ST-PI 740 0011 SAPK-74011INSTPI SAP Solution Tools Plug-In

I'm not getting an error * code not to be executed, that's the actual ABAP in at the top of the function call, it appears that the FM has been deactivated by SAP but there is no explanation why or what replaces it - see below:

FUNCTION /SDF/SYB_BACKUP_HIST_NEW .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(CONTEXT) TYPE  BDLDTOC-CONTEXT OPTIONAL
*"     VALUE(DBCON_NAME) TYPE  DBCON-CON_NAME OPTIONAL
*"  TABLES
*"      IT_MESSAGE STRUCTURE  BAPIRET2
*"      SYB_DB_BACKUP_HIST_NEW STRUCTURE  /SDF/SYB_DB_BACKUP_HIST_NEW
*"----------------------------------------------------------------------
  DATA: wa_message            TYPE bapiret2,
        l_message             TYPE string,
        l_date                TYPE string,
        l_year                TYPE string,
        l_month               TYPE string,
        l_day                 TYPE string,
        l_hour                TYPE string,
        l_min                 TYPE string,
        l_sec                 TYPE string,
        l_time                TYPE string,
        l_ampm                TYPE string,
        l_stmt                TYPE string,
        l_conn                TYPE DBCON_NAME.

* code not to be executed
EXIT.

* Authorization check
 AUTHORITY-CHECK OBJECT 'S_ADMI_FCD'
                  ID    'S_ADMI_FCD'
                  FIELD 'ST0R'.

  IF sy-subrc NE 0.
    wa_message-type = 'E'.
    wa_message-id = '/SDF/S1'.
    wa_message-number = '051'.
    wa_message-message_v1 = '/SDF/SYB_DB_BACKUP_HIST'.                                                  "#EC NOTEXT
    CONCATENATE TEXT-011 wa_message-message_v1 INTO wa_message-message SEPARATED BY SPACE.              "#EC NOTEXT
    APPEND wa_message TO it_message.
    EXIT.
  ENDIF.

Ps sorry for not relying sooner...