Show TOC

Background documentationAS Java Backup and Restore Locate this document in the navigation structure

 

Backing up SAP NetWeaver Application Server Java (AS Java) and the relevant database prevents you from data loss and is essential for the recovery of the server after the system breaks down. You can use the backup data to restore your system in various scenarios. For example, you can:

  • restore the initial state of the system if an installation or upgrade fails

  • restore the AS Java installation in case of operating system or file system problems

  • restore the SAP system data if the database crashes, and so on.

You can apply two backup strategies:

  • Offline backup– this strategy enables you to create a full and reliable backup of your system, so that the system can be restored in case of a hard disk crash or operating system problems. This strategy requires system downtime, and therefore is not very suitable to be performed on a daily basis. For more information, see Backup and Recovery.

  • Online backup – using this strategy, you can back up the database and the file system, which enables you to recover only particular components of your system. It does not require full system shutdown, and therefore is convenient for creating regular incremental data backup. Online backup does not guarantee a full and consistent backup of all system components.

Recommendation Recommendation

We recommend that you perform regular offline and online backups of your system and system components. The frequency recommendations provided here are only advisable. The frequency of the offline and online backups of your system should be determined by you depending on your scenario, the changes that you make in the system, the occurrence of other important system events, and your requirements for system downtime.

End of the recommendation.

Prerequisites

The backup tools for your database and the backup solution for your system are installed and available.

Note Note

The online backup procedure cannot guarantee the consistency of the JTA transaction recovery, when the transaction journal file is stored on the file system.

End of the note.

Procedure

The most important administration tasks related to backing up and restoring that you need to perform in the AS Java are listed below.

Backing up the system
  • Offline Backup

    After installation, before and after upgrade of AS Java, you need to perform a full offline backup of your system. For more information, see the relevant installation guides on SAP Service Marketplace at service.sap.com . Note that after the initial offline backup, it is highly recommended to perform offline backup at least once a week.

  • Online Backup

    After you have created a full backup of your system, you should perform regular online backups of the following components:

    • Database

      We recommend that you include the online backup of the database as well as the logs in the daily routine. In case the deployed applications use an external database as a persistent storage, make sure that you back up that database, too. Note: The consistency of data when you back up more than one database is the responsibility of the user. You can create a backup copy of your database so that you can recover the database if errors occur. For more information, see your database-specific documentation.

    • File system

      Create a backup of the SAP system directory /usr/sap/SAPSID

      To ensure that the online file system backup is consistent, the SAP System must be up and running and no deploy operations must be performed during the process. To prevent any deploy operation on the system during the backup, set the property deployment_forbidden of the deploy controller to ON. After the online backup of the system has finished, revert the property to the default value OFF.

      Note Note

      When the property is set to ON, all deploy operation will end with an exception with the following text: “Deployment cannot be performed because it is forbidden by property”. For more information, see SAP Note 1716251.

      End of the note.

    Note Note

    You must make sure that no deploy operations have been started on the system before the property is set. You can identify if there is an ongoing deploy operation by executing command sapcontrol -nr instance_number -function EnqGetLockTable.

    If the output of the command contains no entries starting with “$services.deploy” and “$services.dc”, there is no ongoing deployment.

    End of the note.

Changing the property deployment_forbidden requires user interaction. If you want to automate the process, you can use the command line tool opm. It is located in the configtool folder /usr/sap/SAPSID/Instance ID/j2ee/configtool. You can use the following command to change the value of the deploy controller property: opm -s tc~bl~deploy_controller deployment_forbidden on.

Restoring the system
  1. Shut down the system.

  2. Install a new AS Java system using SAPInst, or restore the file system from the latest offline backups that you have created.

  3. Import the database backup using the relevant tools provided by the database vendor.

  4. Restore the SAP system directory /usr/sap/SAPID from the online or offline backup

  5. Change the sync strategy of the bootstrap process to FORCE. For more information, see SAP Note 710663.

  6. Run the bootstrap process. To run the bootstrap process, execute the following command from folder /usr/sap/SAPSID/instance_name/j2ee/cluster/ with user SIDADM:

    ../../exe/jstart.exe -launch –file=../../exe/startup.properties -nodename=bootstrap pf=<path to the JXX profile>

    , where <path to the JXX profile> must contain the path to the working profile and not the start profile (for example, /usr/sap/SID/SYS/profile/SID_Jnn_hostname).

  7. Change the sync strategy of the bootstrap process to the default one.

  8. Start the system.

Result:

AS Java is restored with the last backup.