Primary Storage

Expand all | Collapse all

SAP Archive log schedule is returning error Failed1

  • 1.  SAP Archive log schedule is returning error Failed1

    Posted Thu October 10, 2019 09:54 PM
    Hi All,

    I have more that 50 SAP SID's backup is running on my SP 8.1.5 environment, Where DB backup is happening without any issue however most of the time SAP Arch log backup is returning error on schedule failed1 while checking the logs on SAP host, it's doesn't have logs to backup that's why logs says no offline redo log to backup and it's is showing completed on SAP host but why it's returning error failed on TSM Server.

    Can anyone please advise what's going wrong it's should reflect on schedule completed. awaiting for your advise on it.

    ------------------------------
    Thanks
    Prem
    ------------------------------

    #Storage
    #StorageManagementandReporting
    #PrimaryStorage


  • 2.  RE: SAP Archive log schedule is returning error Failed1

    Posted Fri October 11, 2019 05:36 AM
    Hi Prem,
    I would assume brarchive does not end with return code 0 in case there is no redo log file ready for archive. Did you check the return code?
    Regards,
    Thomas

    ------------------------------
    Thomas Prause
    ------------------------------



  • 3.  RE: SAP Archive log schedule is returning error Failed1

    Posted Fri October 11, 2019 07:20 AM
    Hi Thomas,

    Thanks for the response on tsm schedule it's returning with failed1 return code 1 error in actlog and sap host side on archlog directory it is showing completed successfully and on that it shows no offline redolog to backup.

    Thanks 
    Prem 





  • 4.  RE: SAP Archive log schedule is returning error Failed1

    Posted Fri October 11, 2019 08:28 AM
    Hi Prem,
    this matches the SAP documentation https://help.sap.com/SAPHELP_46c/helpdata/RU/0d/d30fdb4a0c11d182b80000e829fbfe/content.htm?no_cache=true
    Return code 1 means "Backup/restore ended with warnings. All files were backed up/restored.". Seems all you need is to somehow make your schedule command to consider rc 1 as success.
    Hope this helps.

    ------------------------------
    Thomas Prause
    ------------------------------



  • 5.  RE: SAP Archive log schedule is returning error Failed1

    Posted Fri October 11, 2019 09:28 AM
    Thanks Thomas for the continuous help but the error code which you are sharing that is Sap error code which reflect on sap gui console the code I am pointing which is tsm backup tool code and if it's returned error failed1 it will count as failed in backup success. I am also trying to skip that error code show that it returned with completed status.

    Thanks 
    Prem 





  • 6.  RE: SAP Archive log schedule is returning error Failed1

    Posted Sat October 12, 2019 09:42 PM
    Guys any other suggestions please.

    Thanks
    Prem 





  • 7.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 14, 2019 09:28 AM
    Guys pls advise if you have any suggestions.

    Thanks 
    Prem 





  • 8.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 14, 2019 10:12 AM
    May be you can create a script that maps rc 1 from brarchive into 0. So that the SP scheduler considers the action in such case as successful.

    ------------------------------
    Thomas Prause
    ------------------------------



  • 9.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 14, 2019 12:06 PM
    Brarchive is reporting 0 only but however scheduler is reporting 1 and 1 is counted  failed in SP.

    Thanks 
    Prem 





  • 10.  RE: SAP Archive log schedule is returning error Failed1

    Posted Wed October 16, 2019 04:15 AM
    Please suggest anything else from which I can resolve this.

    Thanks
    Prem 





  • 11.  RE: SAP Archive log schedule is returning error Failed1

    Posted Thu October 17, 2019 04:35 AM
    Hello,
    I think the best solution is to execute a script with the SP Schedule. In this script you can check first if there are any logs to process. with no logs present you can end the script with return code 0 and all should be fine.

    Another solution is to let SAP trigger the backups. I am not completely sure if I remember this correct, but I think there is a possibility to let SAP control the backups.

    Best regards,
    Jochen

    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    ACT Gruppe
    Duesseldorf, Germany
    ------------------------------



  • 12.  RE: SAP Archive log schedule is returning error Failed1

    Posted Thu October 17, 2019 07:05 AM
    Hi Jochen,

    As of now script is scheduled through sp to invoke can you please advise on script what should I do exactly to get the desired results.

    Thanks
    Prem 





  • 13.  RE: SAP Archive log schedule is returning error Failed1

    Posted Thu October 17, 2019 10:45 AM
    Edited by System Wed March 08, 2023 03:58 PM
    Hello,
    I don't know which OS and which scripting language you are using.
    Here is an example for a linux ksh script:

    filecount=`find <path_to_logdirectory> -type f -name "*.log" -mmin -30 | wc -l`
    if [ $filecount -gt 0 ]
    then
        <your code to backup the logs>
    else
        return 0
    fi

    Do the following adjustments before trying this code:
    - This assumes you are backing up your logs every 30 minutes, otherwise correct the value of mmin to the number of minutes the script should search for new logfiles.
    - replace the <path_to_logdiectory> with the directory the logfiles reside in.
    - replace the value of the -name parameter if your logfiles do not end with .log
    - replace the spaceholder <your code to backup the logs>with your code for the log backup

    This should start your backup when there are logfiles to process only, otherwise it returns 0.

    I hope this helps...

    Best regards,
    Jochen

    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    ACT Gruppe
    Duesseldorf, Germany
    ------------------------------



  • 14.  RE: SAP Archive log schedule is returning error Failed1

    Posted Thu October 17, 2019 05:53 PM
    Hi Jochen,

    Thanks for the quick response below is the script which is running through SP scheduler. that invokes in every 6 hour through SP scheduler. Please advice now. operating system is hp-ux.

    #!/bin/sh
    cat /dev/null>/oracle/script/DBarch_test.log
    su - oratest <<EOF
    brarchive -sd -c force -u / >> /oracle/script/DBarch_test.log
    EOF

    --
    Regards
    Prem 





  • 15.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 21, 2019 11:27 AM
    Edited by System Wed March 08, 2023 04:02 PM
    Hello Prem,
    my code will work with ksh and sh. I don't have a HP-UX system but I assume it will work with HP-UX, too as it is a standard shell script.

    In my code you have to insert the path in which your logs are written, then your code will be executed only when one or more logs are present to backup. I don't know this path, it is defined in your database configuration.
    If your script is executed every 6 hours, then change the value of the mmin parameter from -30 to -360 - I have done this in the example below.
    I don't know the names of your logs, so please adjust the value of the name parameter.

    Then the script should be something like this...

    filecount=`find <path_to_logdirectory> -type f -name "*.log" -mmin -360 | wc -l`
    if [ $filecount -gt 0 ]
    then
        cat /dev/null>/oracle/script/DBarch_test.log
        su - oratest <<EOF  
        brarchive -sd -c force -u / >> /oracle/script/DBarch_test.log
        EOF
    else
        return 0
    fi

    So, please play around with the script code and try some variations.

    Best regards,
    Jochen

    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    ACT Gruppe
    Duesseldorf, Germany
    ------------------------------



  • 16.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 21, 2019 11:21 PM
    Hi,

    Thanks for the continuous help. Directory path is /Oracle/TEST/oraarch and the extension of the log is *.dbf and script extension is also .sh so for my opinion it should work I will try and post results and only curios to know time parameter is mandatory, my ultimate purpose is when script run and it didn't find any logs then it should return 0 on sap side and SP scheduler event side as well.pls share your opinion.

    Thanks 
    Prem 





  • 17.  RE: SAP Archive log schedule is returning error Failed1

    Posted Tue October 22, 2019 04:16 AM
    Hi Prem,
    ok, you are running the brarchive in save-delete mode, so the directory should be empty after a successful run.
    In this case the -mmin parameter is not necessary. This would be useful if the logfile remain in the directory and you have to determine if there are any new logs in the given time frame.

    Best regards,
    Jochen

    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    CONET Services GmbH
    Duesseldorf, Germany
    ------------------------------



  • 18.  RE: SAP Archive log schedule is returning error Failed1

    Posted Tue October 22, 2019 05:52 PM

    This is what i prepared but I keep on getting error 
    ./test.sh[3]: Syntax error at line 6 : `<<' is not matched.

    #!/bin/sh
    filecount=`find /oracle/$SID/oraarch -type f -name "*.dbf"  | wc -l`
    if [ $filecount -gt 0 ]
    then
        cat /dev/null>/oracle/script/DBarch_test.log
        su - b6aadm <<EOF  
        brarchive -sd -c force -u / >> /oracle/script/DBarch_test.log
        EOF
    else
        return 0
    fi

    --
    Regards
    Prem 





  • 19.  RE: SAP Archive log schedule is returning error Failed1

    Posted Wed October 23, 2019 04:00 AM
    Hi Prem,
    I just copied your code.
    A simple Google search on the error message brings the following:
    "If you want to leave whitespace before the EOF (or ! or whatever you're using to complete the heredocuthingy) you have to specify it like this

    ftp aslkjdakjs <<-!
      kjashdkj
      kasdkjas
     !

    You need to say <<-! instead of just <<!
    "

    So please try
    su - b6aadm <<-EOF

    Best regards,
    Jochen


    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    CONET Services GmbH
    Duesseldorf, Germany
    ------------------------------



  • 20.  RE: SAP Archive log schedule is returning error Failed1

    Posted Fri October 25, 2019 12:29 PM
    Nope something is wrong I checked that as well it is reporting the same error to me.



    --
    Regards
    Prem 





  • 21.  RE: SAP Archive log schedule is returning error Failed1

    Posted Mon October 28, 2019 11:25 AM

    Hi Prem,
    then delete the whitespaces in front of the 4 lines of your code.
    I can test on a linux system only. Without the spaces there is no error message.
    I assume this will work on HP-UX as well.

    Best regards,
    Jochen





    ------------------------------
    Jochen Meixner
    Principal Consultant Storage & Backup Solutions
    CONET Services GmbH
    Duesseldorf, Germany
    ------------------------------