Sun Cluster 3.1 Data Service for SAP

Setting Up a Lock File

Use the procedure in this section to perform the following tasks.

Set up a lock file to prevent multiple startups of the SAP instance when the instance is already active on one node. Multiple startups of the same instance crash each other. Furthermore, the crash prevents SAP shutdown scripts from performing a clean shutdown of the instances, which might cause data corruption.

If you set up a lock file, when you start the SAP instance the SAP software locks the file startup_lockfile. If you start up the same instance outside of the Sun Cluster environment and then try to bring up SAP under the Sun Cluster environment, the Sun Cluster HA for SAP data service will attempt to start up the same instance. However, because of the file-locking mechanism, this attempt will fail. The data service will log appropriate error messages in /var/adm/messages.

The only difference between the lock file for the central instance or the failover application server and the lock file for a scalable application server is that the lock file for scalable application server resides on the local file system and the lock file for the central instance or the failover application server resides on a cluster file system.

How to Set Up a Lock File for Central Instance or the Failover Application Server

Use this procedure to set up a lock file for the central instance or the failover application server.

  1. Install the latest patch for the sapstart executable, which enables Sun Cluster HA for SAP users to configure a lock file.

  2. Set up the central instance lock file or the failover application server lock file on a cluster file system.

  3. Edit the profile that sapstart uses to start the instance such that you add the new SAP parameter, sapstart/lockfile, for central instance or failover application server. This profile is the one that is passed to sapstart as a parameter in the startsap script.

    For central instance, enter the following.


    sapstart/lockfile =/usr/sap/SID/ Service-StringSystem-Number/work/startup_lockfile
    

    For failover application server, enter the following.


    sapstart/lockfile =/usr/sap/SID/ Dinstance-id/work/startup_lockfile
    
    sapstart/lockfile

    New parameter name.

    /usr/sap/SID/Service-StringSystem-Number/work

    Work directory for the central instance.

    /usr/sap/SID/Dinstance-id/work

    Work directory for failover application server.

    startup_lockfile

    Lock file name that Sun Cluster HA for SAP uses.

    SAP creates the lock file.


    Note –

    You must locate the lock file path on a cluster file system. If you locate the lock file path locally on the nodes, a startup of the same instance from multiple nodes cannot be prevented.


How to Set Up a Lock File for Scalable Application Server

Use this procedure to set up a lock file for a scalable application server.

  1. Install the latest patch for the sapstart executable, which enables Sun Cluster HA for SAP users to configure a lock file.

  2. Set up the application server lock file on the local file system.

  3. Edit the profile that sapstart uses to start the instance such that you add the new SAP parameter, sapstart/lockfile, for scalable application server. This profile is the one that is passed to sapstart as a parameter in the startsap script.


    sapstart/lockfile =/usr/sap/local/SID/Dinstance-id/work/startup_lockfile
    
    sapstart/lockfile

    New parameter name.

    /usr/sap/local/SID/Dinstance-id/work

    Work directory for the scalable application server.

    startup_lockfile

    Lock file name that Sun Cluster HA for SAP uses.

    SAP creates the lock file.


    Note –

    The lock file will reside on the local file system. The lock file does not prevent multiple startups from other nodes, but the lock file does prevent multiple startups on the same node.