Sun Cluster 2.2 Software Installation Guide

10.5.2 How to Enable SAP to Run in the Cluster

  1. Set up the SAP central instance administrative environment.

    During SAP installation, SAP creates files and shell scripts on the server on which the SAP central instance is installed. These files and scripts use physical host names. Follow these steps to replace all occurrences of physical host names with logical host names.


    Note -

    Make backup copies of all files before performing the following steps.


    First, shut down the SAP central instance and database using the following command:

    # su - <sapsid>adm
    $ stopsap all
    ...
     # su - ora<sapsid>
    $ lsnrctl stop
    

    Note -

    Become the <sapsid>adm user before editing these files.


    1. Revise the .cshrc file in the <sapsid>adm home directory.

      On the server on which the SAP central instance is installed, the .cshrc file contains aliases that use Sun Cluster physical host names. Replace the physical host names with the central instance logical host name.

      (For SAP 3.1x only) The resulting .cshrc file should look similar to the following example, in which CIloghost is the logical host containing the central instance and DBloghost is the logical host containing the database. If the central instance and database are on the same logical host, then use that logical host name for the substitutions.

      # aliases
       alias			startsap					"$HOME/startsap_CIloghost_00"
       alias			stopsap					"$HOME/stopsap_CIloghost_00"
      
       # RDBMS environment
       if (-e $HOME/.dbenv_DBloghost.csh) then
          source $HOME/.dbenv_DBloghost.csh
       else if (-e $HOME/.dbenv.csh) then
          source $HOME/.dbenv.csh
       endif

      (For SAP 4.0x only) The resulting .cshrc file should look similar to the following example, in which CIloghost is the logical host containing the central instance and DBloghost is the logical host containing the database. If the central instance and database are on the same logical host, then use that logical host name for the substitutions:

      if ( -e $HOME/.sapenv_CIloghost.csh ) then
          source $HOME/.sapenv_CIloghost.csh
       else if ( -e $HOME/.sapenv.csh ) then
          source $HOME/.sapenv.csh
       endif
      
       # RDBMS environment
       if ( -e $HOME/.dbenv_DBloghost.csh ) then
          source $HOME/.dbenv_DBloghost.csh
       else if ( -e $HOME/.dbenv.csh ) then
          source $HOME/.dbenv.csh
       endif
    2. (For SAP 4.0x only) Rename the file .sapenv_physicalhost.csh to .sapenv_CIloghost.csh, and edit it to replace occurrences of the physical host name with the logical host name.

      First rename the file, replacing the physical host name with the central instance logical host name.

      $ mv .sapenv_physicalhost.csh .sapenv_CIloghost.csh
      

      Then edit the aliases in the file. For example:

      alias startsap "$HOME/startsap_CIloghost_00"
       alias stopsap "$HOME/stopsap_CIloghost_00"
    3. Rename the .dbenv_physicalhost.csh file.

      Rename the .dbenv_physicalhost.csh file to .dbenv_DBloghost.csh. If the central instance and database are on the same logical host, use that logical host name for the substitution.

      $ mv .dbenv_physicalhost.csh .dbenv_DBloghost.csh
      
    4. (For SAP 4.0x only) Edit the .dbenv_DBloghost.csh file to set the ORA_NLS environment variable to point to the appropriate subdirectories of /var/opt/oracle for the database client configuration files. Also, set the TNS_ADMIN environment variable to point to the /var/opt/oracle directory.

      The .dbenv_DBloghost.csh file is located in the <sapsid>adm home directory.

      #setenv ORA_NLS /oracle/<SAPSID>/ocommon/NLS_723/admin/data
       setenv ORA_NLS /var/opt/oracle/ocommon/NLS_723/admin/data
      
       #setenv ORA_NLS32 /oracle/<SAPSID>/ocommon/NLS_733/admin/data
       setenv ORA_NLS32 /var/opt/oracle/ocommon/NLS_733/admin/data
      
       #setenv ORA_NLS33 /oracle/<SAPSID>/ocommon/NLS_804/admin/data
       setenv ORA_NLS33 /var/opt/oracle/ocommon/NLS_804/admin/data
      
       ...
      
       # setenv TNS_ADMIN @TNS_ADMIN@
       setenv TNS_ADMIN /var/opt/oracle
       ...
    5. Rename and revise the SAP instance startsap and stopsap shell scripts in the <sapsid>adm home directory.

      On the server on which the SAP central instance is installed, the <sapsid>adm home directory contains shell scripts that include physical host names. Rename these shell scripts by replacing the physical host names with logical host names. In this example, CIloghost represents the logical host name of the central instance:

      $ mv startsap_physicalhost_00 startsap_CIloghost_00
      $ mv stopsap_physicalhost_00 stopsap_CIloghost_00
      

      The startsap_CIloghost_00 and stopsap_CIloghost_00 shell scripts specify physical host names in their START_PROFILE parameters. Replace the physical host name with the central instance logical host name in the START_PROFILE parameters in both files.

      ...
       START_PROFILE="START_DVEBMGS00_CIloghost"
       ...
    6. Revise the SAP central instance profile files.

      During SAP installation, SAP creates three profile files on the server on which the SAP central instance is installed. These files use physical host names. Use these steps to replace all occurrences of physical host names with logical host names. To revise these files, you must be user <sapsid>adm, and you must be in the profile directory.

      • Rename the START_DVEBMGS00_physicalhost and <SAPSID>_DVEBMGS00_physicalhost profile files.

        In the /sapmnt/<SAPSID>/profile directory, replace the physical host name with the logical host name. In this example, the <SAPSID> is HA1:

      $ cdpro; pwd
      /sapmnt/HA1/profile
       $ mv START_DVEBMGS00_physicalhost START_DVEBMGS00_CIloghost
      $ mv HA1_DVEBMGS00_physicalhost HA1_DVEBMGS00_CIloghost
      
      • In the START_DVEBMGS00_CIloghost profile file, replace occurrences of the physical host name with the central instance logical host name for all `pf=' arguments.

        In this example, the <SAPSID> is HA1:

      ...
       Execute_00 =local $(DIR_EXECUTABLE)/sapmscsa -n \
       pf=$(DIR_PROFILE)/HA1_DVEBMGS00_CIloghost
      Start_Program_01   =local $(_MS) pf=$(DIR_PROFILE)/HA1_DVEBMGS00_CIloghost
      Start_Program_02   =local $(_DW) pf=$(DIR_PROFILE)/HA1_DVEBMGS00_CIloghost
      Start_Program_03   =local $(_CO) -F pf=$(DIR_PROFILE)/HA1_DVEBMGS00_CIloghost
      Start_Program_04   =local $(_SE) -F pf=$(DIR_PROFILE)/HA1_DVEBMGS00_CIloghost
      ...
      • Edit the <SAPSID>_DVEBMGS00_CIloghost file to add a new entry for the SAPLOCALHOST parameter.

        Add this entry only for the central instance profile. Set the SAPLOCALHOST parameter to be the central instance logical host name. This parameter allows external application servers to locate the central instance by using the logical host name.

      ...
       SAPLOCALHOST		 	 	 	 	 	 		=CIloghost
      ...
      • Edit the DEFAULT.PFL file to replace occurrences of the physical host name with the logical host name.

        For each of the rdisp/ parameters, replace the physical host name with the central instance logical host name. For the SAPDBHOST parameter, enter the logical host name of the database. If the central instance and database are installed on the same logical host, enter the central instance logical host name. If the database is installed on a different logical host, use the database logical host name instead. In this example, CIloghost represents the logical host name of the central instance, DBloghost represents the logical host name of the database, and HA1 is the <SAPSID>:

      ...
       SAPDBHOST	 	 	 	 	 	 	 		=DBloghost
      rdisp/mshost	 	 	 	 	 	 	 	 	=CIloghost
      rdisp/sna_gateway	 	 	 	 		 =CIloghost
      rdisp/vbname	 	 	 	 	 	 	 	 	=CIloghost_HA1_00
       rdisp/enqname	 	 	 	 	 	 	 	 	=CIloghost_HA1_00
       rdisp/btcname	 	 	 	 	 	 	 	 	=CIloghost_HA1_00
       ...
    7. Revise the TPPARAM transport configuration file.

      Change to the directory containing the transport configuration file.

      # cd /usr/sap/trans/bin
      

      Replace the database physical host name with the database logical host name. In this example, DBloghost represents the database logical host name and HA1 is the <SAPSID>. For example:

      ...
       HA1/dbhost = DBloghost
      ...
    8. (For SAP 4.0x only) In the TPPARAM file, also set /var/opt/oracle to be the location for the database client configuration files.

      ...
       HA1/dbconfpath = /var/opt/oracle
       ...
  2. Modify the environment for the SAP database user.

    During SAP installation, SAP creates Oracle files that use Sun Cluster physical host names. Replace the physical host names with logical host names using the following steps.


    Note -

    Become the ora<sapsid> user before editing these files.


    1. Revise the .cshrc file in the ora<sapsid> home directory.

      The .cshrc file on the server in which SAP was installed contains aliases that use Sun Cluster physical host names. Replace the physical host names with logical host names.

      (For SAP 3.1x only) The resulting file should look similar to the following example, in which CIloghost represents the central instance logical host and DBloghost is the database logical host. If the central instance and database reside on the same logical host, use the central instance logical host name for each of the substitutions:

      # aliases
       alias			startsap					"$HOME/startsap_CIloghost_00"
       alias			stopsap					"$HOME/stopsap_CIloghost_00"
      
       # RDBMS environment
       if (-e $HOME/.dbenv_DBloghost.csh) then
          source $HOME/.dbenv_DBloghost.csh
       else if (-e $HOME/.dbenv.csh) then
          source $HOME/.dbenv.csh
       endif

      (For SAP 4.0x only) The resulting .cshrc file should look similar to the following example, in which CIloghost is the central instance logical host and DBloghost is the database logical host. If the central instance and database reside on the same logical host, use the central instance logical host name for each of the substitutions:

      if ( -e $HOME/.sapenv_CIloghost.csh ) then
          source $HOME/.sapenv_CIloghost.csh
       else if ( -e $HOME/.sapenv.csh ) then
          source $HOME/.sapenv.csh
       endif
      
       # RDBMS environment
       if ( -e $HOME/.dbenv_DBloghost.csh ) then
          source $HOME/.dbenv_DBloghost.csh
       else if ( -e $HOME/.dbenv.csh ) then
          source $HOME/.dbenv.csh
       endif
    2. (For SAP 4.0x only) Rename the .sapenv_physicalhost.csh to .sapenv_CIloghost.csh.

      In this example, CIloghost represents the central instance logical host name.

      $ mv .sapenv_physicalhost.csh .sapenv_CIloghost.csh
      
    3. Rename the .dbenv_physicalhost.csh file.

      Replace the physical host name with the database logical host name in the .dbenv_physicalhost.csh file name. If the central instance and database are on the same logical host, use the central instance logical host name for the substitution. In this example, DBloghost represents the database logical host:

      $ mv .dbenv_physicalhost.csh .dbenv_DBloghost.csh
      
    4. (For SAP 4.0x only) Edit the .dbenv_DBloghost.csh file to set the ORA_NLS environment variable to point to the appropriate subdirectories of /var/opt/oracle for the database client configuration files. Also, set the TNS_ADMIN environment variable to point to the /var/opt/oracle directory.

      The .dbenv_DBloghost.csh file is located in the ora<sapsid> home directory.

      #setenv ORA_NLS /oracle/<SAPSID>/ocommon/NLS_723/admin/data
       setenv ORA_NLS /var/opt/oracle/ocommon/NLS_723/admin/data
      
       #setenv ORA_NLS32 /oracle/<SAPSID>/ocommon/NLS_733/admin/data
       setenv ORA_NLS32 /var/opt/oracle/ocommon/NLS_733/admin/data
      
       #setenv ORA_NLS33 /oracle/<SAPSID>/ocommon/NLS_804/admin/data
       setenv ORA_NLS33 /var/opt/oracle/ocommon/NLS_804/admin/data
      
       ...
      
       # setenv TNS_ADMIN @TNS_ADMIN@
       setenv TNS_ADMIN /var/opt/oracle
       ...
  3. Edit the Oracle SQL*Net configuration files to replace occurrences of the physical host name with the database logical host name.

    If the central instance and database instance are on the same logical host, use the central instance logical host name for the substitutions.

  4. Make the SQL*Net configuration files locally accessible on every potential master.

    Use the following steps to accomplish this.

    1. Replace all occurrences of physical host names with the database logical host name in the listener.ora and tnsnames.ora files.

      (For SAP 3.1x only) The listener.ora file is located at /etc/listener.ora. The tnsnames.ora file is located at /usr/sap/trans/tnsnames.ora.

      (For SAP 4.0x only) The listener.ora file is located at /oracle/<SAPSID>/network/admin/listener.ora. The tnsnames.ora file is located at /oracle/<SAPSID>/network/admin/tnsnames.ora.

    2. Relocate the SQL*Net configuration files on the node where the database is installed.

      (For SAP 3.1x only) During installation, SAP places the listener.ora file in the local /etc directory of the node where the installation took place, and creates a soft link in /usr/sap/trans. Move the listener.ora file to /var/opt/oracle. Reset soft links in /usr/sap/trans to point to the new location. Move the tnsnames.ora and sqlnet.ora files to the /var/opt/oracle directory.

      $ su
      # mv /etc/listener.ora /var/opt/oracle
      # rm /usr/sap/trans/listener.ora
      # ln -s /var/opt/oracle/listener.ora /usr/sap/trans
      # mv /usr/sap/trans/tnsnames.ora /var/opt/oracle
      # ln -s /var/opt/oracle/tnsnames.ora /usr/sap/trans
      # mv /usr/sap/trans/sqlnet.ora /var/opt/oracle
      # ln -s /var/opt/oracle/sqlnet.ora /usr/sap/trans
      

      (For SAP 4.0x only) SAP places the listener.ora file in the default directory under $ORACLE_HOME/network/admin. Use the steps below to move the listener.ora file to /var/opt/oracle, and re-set soft links in the original directory to point to the new location. Move all other SQL*Net files to the new location and re-set links to point to the new location.

      $ su
      # mv /oracle/<SAPSID>/network/admin/listener.ora /var/opt/oracle
      # ln -s /var/opt/oracle/listener.ora /oracle/<SAPSID>/network/admin
      # mv /oracle/<SAPSID>/network/admin/tnsnames.ora /var/opt/oracle
      # ln -s /var/opt/oracle/tnsnames.ora /oracle/<SAPSID>/network/admin
      # mv /oracle/<SAPSID>/network/admin/sqlnet.ora /var/opt/oracle
      # ln -s /var/opt/oracle/sqlnet.ora /oracle/<SAPSID>/network/admin
      # mv /oracle/<SAPSID>/network/admin/protocol.ora /var/opt/oracle
      # ln -s /var/opt/oracle/protocol.ora /oracle/<SAPSID>/network/admin
      
    3. (For SAP 4.0x only) Copy the Oracle client configuration files to the common /var/opt/oracle directory.

      # cd /var/opt/oracle; mkdir  rdbms ocommon lib
      # cd /var/opt/oracle/rdbms; cp -R /oracle/<SAPSID>/rdbms/mesg .
      # cd /var/opt/oracle/ocommon; cp -R /oracle/<SAPSID>/ocommon/NLS* .
      # cd /var/opt/oracle/lib; cp /oracle/<SAPSID>/lib/libclntsh.so.1.0 .
      
    4. Distribute the SQL*Net configuration files to all potential masters of the central instance and database instance.

      Copy or transfer the SQL*Net configuration files from the node on which the database was initially installed into the local directory /var/opt/oracle on all potential central instance and database masters. In this example, physicalhost2 represents the name of the backup physical host.

      $ su
      # tar cvf - /var/opt/oracle | rsh physicalhost2 tar xvf -
      

      Note -

      As part of the maintenance of HA-DBMS, the configuration files must be synchronized on all potential master nodes, whenever modifications are made.


  5. Update the /etc/services files on all potential masters to include the new SAP service entries.

    The /etc/services files must be identical on all nodes.

  6. Create the /usr/sap/tmp directory on all nodes.

    The saposcol program will rely on this directory.

  7. Test the SAP installation.

    Test the SAP installation by manually shutting down SAP, manually switching the logical host between the potential master nodes, and then manually starting SAP on the backup node. This will verify that all kernel parameters, service port entries, file systems and mount points, and user/group permissions are properly set on all potential masters of the logical hosts.

    1. Start the central instance and database.

      # su - ora<sapsid>
      $ lsnrctl start
      ...
       # su - <sapsid>adm
      $ startsap all
      
    2. Run the GUI and verify that SAP comes up correctly.

      In this example, the dispatcher port number is 3200.

      # su - <sapsid>adm
      $ setenv DISPLAY your_workstation:0
      $ sapgui /H/CIloghost/S/3200
      
    3. Verify that SAP can connect to the database.

      # su - <sapsid>adm
      $ R3trans -d
      
    4. Run the saplicense utility to get a CUSTOMER KEY for the current node.

      You will need a SAP license for all potential masters of the central instance logical host.

    5. Stop SAP and the database.

      # su - <sapsid>adm
      $ stopsap all
      ...
       # su - ora<sapsid>
      $ lsnrctl stop
      
  8. For each remaining node that is a potential master of the central instance logical host, switch the central instance logical host to that node and repeat the test sequence described in Step 7.

    # scadmin switch clustername phys-hahost2 CIloghost