Sun Cluster Data Service for Sybase ASE Guide for Solaris OS

Installing and Configuring Sun Cluster HA for Sybase ASE

This chapter explains how to configure and administer Sun Cluster HA for Sybase ASE on your Sun Cluster nodes.

This chapter contains the following sections.

Sun Cluster HA for Sybase ASE Overview

Sun Cluster HA for Sybase ASE provides fault monitoring and automatic failover for the Sybase ASE application.


Note –

Throughout this document a non-global zone might be referred to as a “zone.” A global zone will always be referred to as a “global zone.”


You must configure Sun Cluster HA for Sybase ASE as a failover data service.

For general information about data services, resource groups, resources, and other related topics, see:

Overview of Installing and Configuring Sun Cluster HA for Sybase ASE

The following table summarizes the tasks for installing and configuring Sun Cluster HA for Sybase ASE and provides cross-references to detailed instructions for performing these tasks. Perform the tasks in the order that they are listed in the table.

Table 1 Tasks for Installing and Configuring Sun Cluster HA for Sybase ASE

Task 

Instructions 

Prepare to install Sun Cluster HA for Sybase ASE 

Preparing to Install Sun Cluster HA for Sybase ASE

Install the Sybase ASE software 

Installing the Sybase ASE Software

Configure Sybase ASE database access and create the Sybase ASE database environment 

Configuring Sybase ASE Database Access and Creating the Sybase ASE Database Environment

Install the Sun Cluster HA for Sybase ASE package 

Installing the Sun Cluster HA for Sybase ASE Packages

Register Sun Cluster HA for Sybase ASE resource types and configure resource groups and resources 

Registering and Configuring Sun Cluster HA for Sybase ASE

Verify the Sun Cluster HA for Sybase ASE installation 

Verifying the Sun Cluster HA for Sybase ASE Installation and Configuration

Tune the Sun Cluster HA for Sybase ASE fault monitor 

Tuning the Sun Cluster HA for Sybase ASE Fault Monitor

Preparing to Install Sun Cluster HA for Sybase ASE

To prepare your nodes for the Sun Cluster HA for Sybase ASE installation, select an installation location for the following files.

Installing the Sybase ASE Software

Use the procedures in this section to complete the following tasks.


Note –

Before you configure Sun Cluster HA for Sybase ASE, use the procedures that the Sun Cluster Software Installation Guide for Solaris OS describes to configure the Sun Cluster software on each node.



Note –

The Sun Cluster HA for Sybase ASE can be configured to run in a whole root or a sparse root non-global zone for x86/x64 and SPARC architectures.


ProcedureHow to Prepare the Nodes for the Installation of the Sybase ASE Software


Caution – Caution –

Perform all of the steps in this procedure on all of the nodes or zones. If you do not perform all of the steps on all of the nodes or zones, the Sybase ASE installation will be incomplete, and Sun Cluster HA for Sybase ASE will fail during startup.



Note –

Consult the Sybase ASE documentation before you perform this procedure.


  1. Become superuser on all of the nodes.

  2. Configure the /etc/nsswitch.conf file as follows so that Sun Cluster HA for Sybase ASE starts and stops correctly if a switchover or failover occurs.

    On each node or zone that can master the logical host that runs Sun Cluster HA for Sybase ASE, include the following entries in the /etc/nsswitch.conf file.

    passwd:    files [NOTFOUND=return] nis [TRYAGAIN=0]
    publickey: files [NOTFOUND=return] nis [TRYAGAIN=0]
    project:   files [NOTFOUND=return] nis [TRYAGAIN=0]
    group:     files [NOTFOUND=return] nis [TRYAGAIN=0]

    Sun Cluster HA for Sybase ASE uses the su user command to start and stop the database node.

    The network information name service might become unavailable when a cluster node's public network fails. Adding the preceding entries ensures that the su(1M) command does not refer to the NIS/NIS+ name services if the network information name service is unavailable.

  3. Configure the cluster file system for Sun Cluster HA for Sybase ASE.

    If raw devices contain the databases, configure the global devices for raw-device access. For information about how to configure global devices, see Sun Cluster Software Installation Guide for Solaris OS.


    Note –

    Configuring raw devices on non-global zones is not supported on Sun Cluster.


    If you use the Solaris Volume Manager software, configure the Sybase ASE software to use UNIX file system (UFS) logging on mirrored metadevices or raw-mirrored metadevices. For information about how to configure raw-mirrored metadevices, see the Solaris Volume Manager documentation.

  4. Prepare the SYBASE_HOME directory on a local or multihost disk.


    Note –

    If you install the Sybase ASE binaries on a local disk, use a separate disk if possible. Installing the Sybase ASE binaries on a separate disk prevents the binaries from being overwritten during reinstallation of the operating system.


  5. On each node or zone, create an entry for the database administrator (DBA) group in the /etc/group file, and add potential users to the group.

    Verify that the root and sybase users are members of the dba group, and add entries as necessary for other DBA users. Ensure that group IDs are the same on all of the nodes or zones that run Sun Cluster HA for Sybase ASE, as the following example illustrates.


    dba:*:520:root,sybase
    

    You can create group entries in a network name service. If you create entries this way, also add your entries to the local /etc/group file to eliminate dependency on the network name service.

  6. On each node or zone, create an entry for the Sybase system administrator.

    The following command updates the /etc/passwd and /etc/shadow files with an entry for the Sybase system administrator.


    # useradd -u 120 -g dba -d /Sybase-home sybase
    

    Ensure that the sybase user entry is the same on all of the nodes or zones that run Sun Cluster HA for Sybase ASE.

ProcedureHow to Install the Sybase ASE Software

  1. On a cluster node or zone, become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.

  2. If you plan to install the Sybase ASE software on the cluster file system, start the Sun Cluster software and become the owner of the disk device group.

    If you plan to install the Sybase ASE software at another location, omit this step.

    For more information about installation locations, see Preparing to Install Sun Cluster HA for Sybase ASE.

  3. Create a failover resource group to hold the network and application resources.


    # clresourcegroup create [-n node-zone-list] resource-group
    
    -n node-zone-list

    Specifies an optional, comma-separated list of physical node names or zones or IDs that identify potential masters. The order here determines the order in which the Resource Group Manager (RGM) considers primary nodes or zones during failover.

    resource-group

    Specifies the name of the resource group. This name can be your choice but must be unique for resource groups within the cluster.


    Note –

    Use the -n option to specify the order of the node list. If all of the nodes in the cluster are potential masters, you do not need to use the -n option.


  4. Verify that you have added all of the network resources that Sun Cluster HA for Sybase ASE uses to either the /etc/inet/hosts file or to your name service (NIS, NIS+) database.

  5. Add a network resource (logical host name or shared address) to the failover resource group.


    # clreslogicalhostname create -g resource-group -h host_list logical_host
    
    logical_host

    Specifies a resource name of your choice.

    host_list

    Specifies a comma-separated list of host names that are to be made available by the logical host name resource.

  6. Run the clresourcegroup(1CL) command to complete the following tasks.

    • Enabling the resource and fault monitoring

    • Moving the resource group into a managed state

    • Bringing the resource group online


    # clresourcegroup online -M resource-group
    
  7. On the node or zone that masters the resource group that you just created, log in as sybase.

    The installation of the Sybase binaries must be performed on the node or zone where the corresponding logical host is running.

  8. Install the Sybase ASE software.

    Regardless of where you install the Sybase ASE software, modify each node's /etc/system files as you would in standard Sybase ASE installation procedures. For instructions about how to install the Sybase ASE software, refer to the Sybase installation and configuration guides.

  9. For every Sybase ASE server, specify the host name that is associated with a network resource.

    If you do not specify a host name that is associated with a network resource, Sybase ASE starts only on the node or zone where the Sybase ASE software was installed.

    Some versions of Sybase ASE, such as 12.5, prompt you for the host name. Other versions of Sybase ASE, such as 12.5.1, use the physical host name. If your version of Sybase ASE uses the physical host name, you must change the physical host name to specify a network resource.

    • If the Sybase ASE installer prompts you for the host name, type the host name in response to the prompt.

    • Otherwise, modify the interfaces file to change the physical host name to a host name that is associated with a network resource.

Next Steps

After you install the Sybase ASE software, go to How to Verify the Sybase ASE Installation.

ProcedureHow to Verify the Sybase ASE Installation

    Verify that the sybase user and the dba group own the $SYBASE_HOME directory and $SYBASE_HOME children directories.

Next Steps

After you verify the Sybase ASE installation, go to Configuring Sybase ASE Database Access and Creating the Sybase ASE Database Environment.

Configuring Sybase ASE Database Access and Creating the Sybase ASE Database Environment

Configuring Sybase ASE database access and creating the Sybase ASE Database Environment involves the following tasks.

  1. Configuring Sybase ASE database access with the volume manager that you are using:

  2. Creating the Sybase ASE database environment

ProcedureHow to Configure Sybase ASE Database Access With Solaris Volume Manager

  1. Configure the disk devices for the Solaris Volume Manager software to use.

    For information about how to configure Solaris Volume Manager, see Sun Cluster Software Installation Guide for Solaris OS.

  2. If you use raw devices to contain the databases, run the following commands to change each raw-mirrored metadevice's owner, group, and mode.

    If you do not use raw devices, do not perform this step.

    1. If you create raw devices, run the following commands for each device on each node that can master the Sybase ASE resource group.


      # chown sybase /dev/md/metaset/rdsk/dn
      # chgrp dba /dev/md/metaset/rdsk/dn
      # chmod 600 /dev/md/metaset/rdsk/dn
      
      metaset

      Specifies the name of the disk set

      /rdsk/dn

      Specifies the name of the raw disk device within the metaset disk set

    2. Verify that the changes are effective.


      # ls -lL /dev/md/metaset/rdsk/dn
      
Next Steps

Go to How to Create the Sybase ASE Database Environment.

ProcedureHow to Configure Sybase ASE Database Access With Veritas Volume Manager

  1. Configure the disk devices for the VxVM software to use.

    For information about how to configure Veritas Volume Manager, see Sun Cluster Software Installation Guide for Solaris OS.

  2. If you use raw devices to contain the databases, run the following commands on the current disk-group primary to change each device's owner, group, and mode.

    If you do not use raw devices, do not perform this step.

    1. If you create raw devices, run the following command for each raw device.


      # vxedit -g diskgroup set user=sybase group=dba mode=0600 volume
      
    2. Verify that the changes are effective.


      # ls -lL /dev/vx/rdsk/diskgroup/volume
      
    3. Reregister the device group with the cluster to keep the VxVM namespace consistent throughout the cluster.


      # cldevicegroup create -t VxVM diskgroup
      
Next Steps

Go to How to Create the Sybase ASE Database Environment.

ProcedureHow to Create the Sybase ASE Database Environment

The Sybase ASE database environment consists of the following servers:

Creating the Sybase ASE database environment involves configuring these servers.

Before You Begin

Ensure that you have completed the following tasks.

  1. Run the GUI-based utility srvbuild to create the Sybase ASE database.

    This utility is contained in the $SYBASE/ASE_major-version/bin directory, where major-version is the major version of Sybase ASE that you are using. For example, if you are using Sybase ASE version 12.5.1, major-version is 12-5.

    For information about the srvbuildutility, see the Sybase ASE document Installing Sybase Adaptive Server Enterprise on Sun Solaris 2.x (SPARC).

  2. To verify successful database installation, ensure that all of the servers start correctly.

    Run the ps(1) command to verify the operation of all of the servers. Sybase ASE server logs indicate any errors that have occurred.

  3. Set the password for the Sybase ASE system administrator account.

    For details about changing the sa login password, see Sybase Adaptive Server Enterprise System Administration Guide.

  4. Create a new Sybase ASE account for fault monitoring.

    This account enables the fault monitor to perform the following tasks.

    • Supporting queries to system tables

    • Creating and updating user tables


    Note –

    Do not use the sa account for these purposes.


    The following example shows how to create a new Sybase ASE account for fault monitoring.


    # isql -Usa -Psybase -Sasedb
    1> use master
    2> go
    1> create database sc3xdb
    2>go
    1> sp_addlogin dbmon, dbmonp, sc3xdb
    2> go
    1> use sc3xdb
    2> go
    1> sp_changedbowner dbmon
    2> go
    1> sp_modifylogin dbmon, defdb, sc3xdb
    2> go
    1> exit
    

    For more information, see Tuning the Sun Cluster HA for Sybase ASE Fault Monitor.

  5. Update the stop file with the sa password.

    Because the stop file contains the sa password, protect the file with the appropriate permissions, and place the file in a directory that the system administrator chooses. Enable only the sybase user to read, write, and execute the stop file.

    For more information about the stop file, see Sun Cluster HA for Sybase ASE Security Issues.

Next Steps

After you create the Sybase ASE database environment, go to Installing the Sun Cluster HA for Sybase ASE Packages.

Installing the Sun Cluster HA for Sybase ASE Packages

If you did not install the Sun Cluster HA for Sybase ASE packages during your initial Sun Cluster installation, perform this procedure to install the packages. To install the packages, use the Sun JavaTM Enterprise System Common Installer.


Note –

You need to install the Sun Cluster HA for Sybase ASE packages in the global cluster and not in the zone cluster.


ProcedureHow to Install the Sun Cluster HA for Sybase ASE Packages

Perform this procedure on each cluster node where you are installing the Sun Cluster HA for Sybase ASE packages.

You can run the Sun Java Enterprise System Common Installer with a command-line interface (CLI) or with a graphical user interface (GUI). The content and sequence of instructions in the CLI and the GUI are similar.


Note –

Even if you plan to configure this data service to run in non-global zones, install the packages for this data service in the global zone. The packages are propagated to any existing non-global zones and to any non-global zones that are created after you install the packages.


Before You Begin

Ensure that you have the Sun Java Availability Suite DVD-ROM.

If you intend to run the Sun Java Enterprise System Common Installer with a GUI, ensure that your DISPLAY environment variable is set.

  1. On the cluster node where you are installing the data service packages, become superuser.

  2. Load the Sun Java Availability Suite DVD-ROM into the DVD-ROM drive.

    If the Volume Management daemon vold(1M) is running and configured to manage DVD-ROM devices, the daemon automatically mounts the DVD-ROM on the /cdrom directory.

  3. Change to the Sun Java Enterprise System Common Installer directory of the DVD-ROM.

    • If you are installing the data service packages on the SPARC® platform, type the following command:


      # cd /cdrom/cdrom0/Solaris_sparc
      
    • If you are installing the data service packages on the x86 platform, type the following command:


      # cd /cdrom/cdrom0/Solaris_x86
      
  4. Start the Sun Java Enterprise System Common Installer.


    # ./installer
    
  5. When you are prompted, accept the license agreement.

    If any Sun Java Enterprise System components are installed, you are prompted to select whether to upgrade the components or install new software.

  6. From the list of Sun Cluster agents under Availability Services, select the data service for Sybase ASE.

  7. If you require support for languages other than English, select the option to install multilingual packages.

    English language support is always installed.

  8. When prompted whether to configure the data service now or later, choose Configure Later.

    Choose Configure Later to perform the configuration after the installation.

  9. Follow the instructions on the screen to install the data service packages on the node.

    The Sun Java Enterprise System Common Installer displays the status of the installation. When the installation is complete, the wizard displays an installation summary and the installation logs.

  10. (GUI only) If you do not want to register the product and receive product updates, deselect the Product Registration option.

    The Product Registration option is not available with the CLI. If you are running the Sun Java Enterprise System Common Installer with the CLI, omit this step.

  11. Exit the Sun Java Enterprise System Common Installer.

  12. Unload the Sun Java Availability Suite DVD-ROM from the DVD-ROM drive.

    1. To ensure that the DVD-ROM is not being used, change to a directory that does not reside on the DVD-ROM.

    2. Eject the DVD-ROM.


      # eject cdrom
      
Next Steps

See Registering and Configuring Sun Cluster HA for Sybase ASE to register Sun Cluster HA for Sybase ASE and configure the cluster for the data service.

Registering and Configuring Sun Cluster HA for Sybase ASE

Register and configure Sun Cluster HA for Sybase ASE as a failover data service.

Setting Sun Cluster HA for Sybase ASE Extension Properties

The section that follows contains instructions for registering and configuring resources. These instructions explain how to set only extension properties that Sun Cluster HA for Sybase ASE requires you to set. For information about all Sun Cluster HA for Sybase ASE extension properties, see Sun Cluster HA for Sybase ASE Extension Properties. You can update some extension properties dynamically. You can update other properties, however, only when you create or disable a resource. The Tunable entry indicates when you can update a property.

To set an extension property of a resource, include the following option in the clresource(1CL) command that creates or modifies the resource:


-p property=value 
-p property

Identifies the extension property that you are setting

value

Specifies the value to which you are setting the extension property

You can also use the procedures in Chapter 2, Administering Data Service Resources, in Sun Cluster Data Services Planning and Administration Guide for Solaris OS to configure resources after the resources are created.

ProcedureHow to Register and Configure Sun Cluster HA for Sybase ASE

This procedure describes how to use the Sun Cluster maintenance commands to register and configure Sun Cluster HA for Sybase ASE.

This procedure includes creating the SUNW.HAStoragePlus resource type. This resource type synchronizes actions between HAStorage and Sun Cluster HA for Sybase ASE and enables you to use a highly available local file system. Sun Cluster HA for Sybase ASE is disk intensive, and therefore you should configure the SUNW.HAStoragePlus resource type.

For more information about the SUNW.HAStoragePlus resource type, see the following documentation:


Note –

Other options also enable you to register and configure the data service. For details about these options, see Tools for Data Service Resource Administration in Sun Cluster Data Services Planning and Administration Guide for Solaris OS.


To perform this procedure, you must have the following information.


Note –

Perform the following steps on one cluster node or zone.


  1. On a cluster node or zone, become superuser or assume a role that provides solaris.cluster.modify and solaris.cluster.admin RBAC authorizations.

  2. Run the clresourcetype command to register resource types for Sun Cluster HA for Sybase ASE.


    # clresourcetype register SUNW.sybase
    
  3. Register the SUNW.HAStoragePlus resource type with the cluster.


    # clresourcetype register SUNW.HAStoragePlus
    
  4. Create the resource sybase-hastp-rs of type SUNW.HAStoragePlus.


    # clresource create -g sybase-rg -t SUNW.HAStoragePlus \
    -p GlobalDevicePaths=sybase-device-group1,/dev/global/dsk/dl \
    -p FilesystemMountPoints=/global/sybase-inst \
    -p AffinityOn=TRUE sybase-hastp-rs
    

    The resource is created in the enabled state.


    Note –

    AffinityOn must be set to TRUE and the local file system must reside on global disk groups to be failover.


  5. Run the clresourcegroup command to complete the following tasks and bring the resource group sybase-rg online on a cluster node or zone.

    • Moving the resource group into a managed state

    • Bringing the resource group online

    This node becomes the primary for device group sybase-set1 and raw device /dev/global/dsk/d1. Device groups that are associated with file systems such as /global/sybase-inst are also made primaries on this node.


    # clresourcegroup online -M sybase-rg
    
  6. Create Sybase ASE application resources in the failover resource group.


    # clresource create -g resource-group \
    -t SUNW.sybase \
    -p Environment_File=environment-file-path \
    -p Adaptive_Server_Name=adaptive-server-name \
    -p Backup_Server_Name=backup-server-name \
    -p Text_Server_Name=text-server-name \
    -p Monitor_Server_Name=monitor-server-name \
    -p Adaptive_Server_Log_File=log-file-path \
    -p Stop_File=stop-file-path \
    -p Connect_string=user/passwd \
    -p resource_dependencies=storageplus-resource \
    -p Wait_for_Online=TRUE \
    -p DB_Wait_List=db1, db2, ... \
    -p Restart_type=RESOURCE_RESTART|RESOURCE_GROUP_RESTART \
    -p Custom_action_file=filepath resource
    
    -g resource-group

    Specifies the resource group name into which the RGM places the resources.

    -t SUNW.sybase

    Specifies the resource type to add.

    -p Environment_File=environment-file

    Sets the name of the environment file.

    -p Adaptive_Server_Name=adaptive-server-name

    Sets the name of the adaptive server.

    -p Backup_Server_Name=backup-server-name

    Sets the name of the backup server.

    -p Text_Server_Name=text-server-name

    Sets the name of the text server.

    -p Monitor_Server_Name=monitor-server-name

    Sets the name of the monitor server.

    -p Adaptive_Server_Log_File=log-file-path

    Sets the path to the log file for the adaptive server.

    -p Stop_File=stop-file-path

    Sets the path to the stop file.

    -p Connect_string=user/passwd

    Specifies the user name and password that the fault monitor uses to connect to the database.

    -p Wait_for_Online=TRUE

    Specifies whether the START method has to wait for the database to be brought online before exiting.

    -p DB_Wait_List=db1, db2, ...

    Specifies the list of databases that need to be online before the resource can be brought online. The valid values are either an empty list (“ ”), ALL, or a list of databases.

    -p Restart_type=RESOURCE_RESTART|RESOURCE_GROUP_RESTART

    Defines the restart behavior of the resource. If the Restart_type extension property is set to RESOURCE_RESTART, the server fault monitor restarts the database server resource. If the Restart_type extension property is set to RESOURCE_GROUP_RESTART, the server fault monitor restarts the database server resource group. This property was introduced in SUNW.sybase resource type version 5. Prior to and including SUNW.sybase resource type version 5, the server fault monitor restarted the database server resource group.

    -p Custom_action_file=filepath

    Sets the path to the custom action file that contains the custom fault monitor actions.

    resource

    Specifies the resource name to add.

    The resource is created in the enabled state.

    You do not have to specify extension properties that have default values. For more information, see Setting Sun Cluster HA for Sybase ASE Extension Properties.

Next Steps

After you register and configure Sun Cluster HA for Sybase ASE, go to Verifying the Sun Cluster HA for Sybase ASE Installation and Configuration.

Verifying the Sun Cluster HA for Sybase ASE Installation and Configuration

These checks ensure that all of the nodes that run Sun Cluster HA for Sybase ASE can start the Sybase ASE data server. These checks also ensure that other nodes in the configuration can access the Sybase ASE data server. Perform these checks to isolate any problems with starting the Sybase ASE software from Sun Cluster HA for Sybase ASE.

ProcedureHow to Verify the Sun Cluster HA for Sybase ASE Installation and Configuration

  1. Log in to the node that masters the Sybase ASE resource group.

  2. Set the Sybase ASE environment variables.

    The environment variables are the variables that you specify with the Environment_file extension property. For information about setting these environment variables, see Sun Cluster HA for Sybase ASE Extension Properties.

  3. Verify that the Sun Cluster HA for Sybase ASE resource is online.


    # clresource status
    
  4. Inspect the Sybase ASE logs to determine the cause of any errors that have occurred.

  5. Confirm that you can connect to the data server and execute the following test command.


    # isql -S adaptive-server -U sa -P password
    
    isql> sp_help
    isql> go
    isql> quit
    
  6. Kill the process for the Sybase ASE data server.

    The Sun Cluster software restarts the process.

  7. Switch the resource group that contains the Sybase ASE resource to another cluster node or zone.


    # clresourcegroup switch -n node[:zone] resource-group
    
  8. Log in to the node that now contains the resource group.

  9. Repeat Step 3 and Step 5.


    Note –

    Sybase ASE client connections cannot survive a Sun Cluster HA for Sybase ASE switchover. If a switchover occurs, the existing client connections to Sybase ASE terminate, and clients must reestablish their connections. After a switchover, the time that is required to replay the Sybase ASE transaction log determines Sun Cluster HA for Sybase ASE recovery time.


Location of Sun Cluster HA for Sybase ASE Log Files

Each instance of the Sun Cluster HA for Sybase ASE data service maintains log files in the /opt/SUNWscsyb/log directory.

These files contain information about actions that the Sun Cluster HA for Sybase ASE data service performs. Refer to these files to obtain diagnostic information for troubleshooting your configuration or to monitor the behavior of the Sun Cluster HA for Sybase ASE data service.

See also Sun Cluster HA for Sybase ASE Logging Issues.

Sun Cluster HA for Sybase ASE Logging and Security Issues

The following sections contain information about Sun Cluster HA for Sybase ASE logging and security issues.

Sun Cluster HA for Sybase ASE Logging Issues

Sun Cluster HA for Sybase ASE logs messages to the file message_log in the /opt/SUNWscsyb/log directory. Although this file cannot exceed 512 Kbytes, Sun Cluster HA for Sybase ASE does not delete old log files. The number of log files, therefore, can grow to a large number.

Sun Cluster HA for Sybase ASE writes all of the error messages in the syslog file. Sun Cluster HA for Sybase ASE also logs fault monitor history to the file restart_history in the log directory. These files can also grow to a large number.

As part of your regular file maintenance, check the following log files and remove files that you no longer need.

Sun Cluster HA for Sybase ASE Security Issues

Sun Cluster HA for Sybase ASE requires that you embed the system administrator's password in a stop file. The /opt/SUNWscsyb/bin directory contains the template for the stop file, sybase_stop_servers. Sun Cluster HA for Sybase ASE uses this file to log in to the Sybase ASE environment and to stop the Sybase ASE servers. Enable the sybase user to execute the stop file, but protect the file from general access. Give read, write, and execute privileges to only the following users.

Tuning the Sun Cluster HA for Sybase ASE Fault Monitor

The Sun Cluster HA for Sybase ASE fault monitor queries the Sybase ASE server to determine server health.


Note –

The Sun Cluster HA for Sybase ASE fault monitor monitors only the Adaptive server. The fault monitor does not monitor auxiliary servers.


The Sun Cluster HA for Sybase ASE fault monitor is contained in the resource that represents Sybase ASE. You create this resource when you register and configure Sun Cluster HA for Sybase ASE. For more information, see Registering and Configuring Sun Cluster HA for Sybase ASE.

System properties and extension properties of this resource control the behavior of the fault monitor. The default values of these properties determine the preset behavior of the fault monitor. The preset behavior should be suitable for most Sun Cluster installations. Therefore, you should tune the Sun Cluster HA for Sybase ASE fault monitor only if you need to modify this preset behavior.

Tuning the Sun Cluster HA for Sybase ASE fault monitor involves the following tasks:

Perform these tasks when you register and configure Sun Cluster HA for Sybase ASE. For more information, see the following sections:

The Sun Cluster HA for Sybase ASE fault monitor consists of the following processes.

Main Fault-Monitor Process

The fault monitor process diagnoses errors and checks statistics. The monitor labels an operation successful if the following conditions occur.

If an operation fails, the main process checks the action table for an action to perform and then performs the predetermined action. If an operation fails, the main process can perform the following actions.

  1. Restarting the resource on the current node

  2. Restarting the resource group on the current node

  3. Failing over the resource group to the next node on the resource group's node list

These actions execute external programs as separate processes in the background.

The server fault monitor also scans the Adaptive_Server_Log file and corrects any errors that the scan identifies.

Database-Client Fault Probe

The database-client fault probe performs activity checks and test transactions. The extension property Connect_string specifies an account that performs all of the database operations. The extension property Probe_timeout sets the time-out value that the probe uses to determine the time that has elapsed in a successful database probe.

Obtaining Core Files for Troubleshooting

To facilitate troubleshooting of unexplained DBMS timeouts, you can enable the fault monitor to create a core file when a probe timeout occurs. The contents of the core file relate to the fault monitor process. The fault monitor creates the core file in the / directory. To enable the fault monitor to create a core file, use the coreadm command to enable set-id core dumps. For more information, see the coreadm(1M) man page.

Customizing the Sun Cluster HA for Sybase ASE Fault Monitor

Customizing the Sun Cluster HA for Sybase ASE fault monitor enables you to modify the behavior of the server fault monitor as follows:


Caution – Caution –

Before you customize the Sun Cluster HA for Sybase ASE fault monitor, consider the effects of your customizations, especially if you change an action from restart or switch over to ignore or stop monitoring. If errors remain uncorrected for long periods, the errors might cause problems with the database. If you encounter problems with the database after customizing the Sun Cluster HA for Sybase ASE fault monitor, revert to using the preset actions. Reverting to the preset actions enables you to determine if the problem is caused by your customizations.


Customizing the Sun Cluster HA for Sybase ASE fault monitor involves the following activities:

  1. Defining custom behavior for errors

  2. Propagating a custom action file to all nodes or zones in a cluster

  3. Specifying the custom action file that a server fault monitor should use

Defining Custom Behavior for Errors

The Sun Cluster HA for Sybase ASE fault monitor detects the following types of errors:

To define custom behavior for these types of errors, create a custom action file.

Custom Action File Format

A custom action file is a plain text file. The file contains one or more entries that define the custom behavior of the Sun Cluster HA for Sybase ASE fault monitor. Each entry defines the custom behavior for a single DBMS error, a single timeout error, or several logged alerts. A maximum of 1024 entries is allowed in a custom action file.


Note –

Each entry in a custom action file overrides the preset action for an error, or specifies an action for an error for which no action is preset. Create entries in a custom action file only for the preset actions that you are overriding or for errors for which no action is preset. Do not create entries for actions that you are not changing.


An entry in a custom action file consists of a sequence of keyword-value pairs that are separated by semicolons. Each entry is enclosed in braces.

The format of an entry in a custom action file is as follows:

{
[ERROR_TYPE=DBMS_ERROR|SCAN_LOG|TIMEOUT_ERROR;]
ERROR=error-spec; 
[ACTION=SWITCH|RESTART|STOP|NONE;]
[CONNECTION_STATE=co|di|on|*;]
[NEW_STATE=co|di|on|*;]
[MESSAGE="message-string"]
}

White space might be used between separated keyword-value pairs and between entries to format the file.

The meaning and permitted values of the keywords in a custom action file are as follows:

ERROR_TYPE

Indicates the type of the error that the server fault monitor has detected. The following values are permitted for this keyword:

DBMS_ERROR

Specifies that the error is a DBMS error.

SCAN_LOG

Specifies that the error is an alert that is logged in the alert log file.

TIMEOUT_ERROR

Specifies that the error is a timeout.

The ERROR_TYPE keyword is optional. If you omit this keyword, the error is assumed to be a DBMS error.

ERROR

Identifies the error. The data type and the meaning of error-spec are determined by the value of the ERROR_TYPE keyword as shown in the following table.

Error_Type Keyword

Data Type 

Meaning 

DBMS_ERROR

Integer 

The error number of a DBMS error that is generated by Sybase ASE 

SCAN_LOG

Quoted regular expression 

A string in an error message that Sybase ASE has logged to the Sybase ASE log file 

TIMEOUT_ERROR

Integer 

The number of consecutive timed-out probes since the server fault monitor was last started or restarted 

You must specify the ERROR keyword. If you omit this keyword, the entry in the custom action file is ignored.

ACTION

Specifies the action that the server fault monitor is to perform in response to the error. The following values are permitted for this keyword:

NONE

Specifies that the server fault monitor ignores the error.

STOP

Specifies that the server fault monitor is stopped.

RESTART

Specifies that the server fault monitor stops and restarts the entity that is specified by the value of the Restart_type extension property of the SUNW.sybase resource.

SWITCH

Specifies that the server fault monitor switches over the database server resource group to another node or zone.

The ACTION keyword is optional. If you omit this keyword, the server fault monitor ignores the error.

CONNECTION_STATE

Specifies the required state of the connection between the database and the server fault monitor when the error is detected. The entry applies only if the connection is in the required state when the error is detected. The following values are permitted for this keyword:

*

Specifies that the entry always applies, regardless of the state of the connection.

co

Specifies that the entry applies only if the server fault monitor is attempting to connect to the database.

on

Specifies that the entry applies only if the server fault monitor is online. The server fault monitor is online if it is connected to the database.

di

Specifies that the entry applies only if the server fault monitor is disconnecting from the database.

The CONNECTION_STATE keyword is optional. If you omit this keyword, the entry always applies, regardless of the state of the connection.

NEW_STATE

Specifies the state of the connection between the database and the server fault monitor that the server fault monitor must attain after the error is detected. The following values are permitted for this keyword:

*

Specifies that the state of the connection must remain unchanged.

co

Specifies that the server fault monitor must disconnect from the database and reconnect immediately to the database.

di

Specifies that the server fault monitor must disconnect from the database. The server fault monitor reconnects when it next probes the database.

The NEW_STATE keyword is optional. If you omit this keyword, the state of the database connection remains unchanged after the error is detected.

MESSAGE

Specifies an additional message that is printed to the resource's log file when this error is detected. The message must be enclosed in double quotes. This message is additional to the standard message that is defined for the error.

The MESSAGE keyword is optional. If you omit this keyword, no additional message is printed to the resource's log file when this error is detected.

Changing the Response to a DBMS Error

The action that the server fault monitor performs in response to each DBMS error is preset as listed in Table 1. To determine whether you need to change the response to a DBMS error, consider the effect of DBMS errors on your database to determine if the preset actions are appropriate. For examples, see the subsections that follow.

To change the response to a DBMS error, create an entry in a custom action file in which the keywords are set as follows:

Responding to an Error Whose Effects Are Major

If an error that the server fault monitor ignores affects more than one session, action by the server fault monitor might be required to prevent a loss of service.

For example, see the following error message:


Illegal attempt to change contents of buffer: %S_BUF.

No action is preset for Sybase error 835, Illegal attempt to change contents of buffer: %S_BUF. However, this Sybase error indicates that the when a client process completes, Adaptive Server performs some cleanup tasks such as closing the buffers and releasing the resources taken up by the buffers. If the client process terminates abnormally, however (for example if the process is killed during execution), Adaptive Server might be unable to carry out the appropriate cleanup, buffers are left open, and Error 835 is raised. If this error affects only a single session, ignoring the error might be appropriate. However, if this error affects more than one session, consider specifying that the server fault monitor restart the database.

The following example shows an entry in a custom action file for changing the response to a DBMS error to restart.


Example 1 Changing the Response to a DBMS Error to Restart

{
ERROR_TYPE=DBMS_ERROR;
ERROR=835; 
ACTION=restart;
CONNECTION_STATE=*; 
NEW_STATE=*;
MESSAGE="Illegal attempt to change contents of buffer: %S_BUF.";
}

This example shows an entry in a custom action file that overrides the preset action for DBMS error 835. This entry specifies the following behavior:


Ignoring an Error Whose Effects Are Minor

If the effects of an error to which the server fault monitor responds are minor, ignoring the error might be less disruptive than responding to the error.

For example, see the following error message:


Unable to find buffer 0x%lx holding logical page %ld in sdes 0x%lx 
kept buffer pool for object '%.*s'.

The preset action for Sybase ASE error 804, Unable to find buffer 0x%lx holding logical page %ld in sdes 0x%lx kept buffer pool for object '%.*s'. is restart. This error occurs when Adaptive Server cannot find the pointer to a buffer header in a session descriptor. This error can be transient. In this situation, consider specifying that the server fault monitor ignore the error.

The following example shows an entry in a custom action file for ignoring a DBMS error.


Example 2 Ignoring a DBMS Error

{
ERROR_TYPE=DBMS_ERROR;
ERROR=804;
ACTION=none;
CONNECTION_STATE=*;
NEW_STATE=*;
MESSAGE="Unable to find buffer 0x%lx holding logical page %ld in sdes 
0x%lx kept buffer pool for object '%.*s'.";
}

This example shows an entry in a custom action file that overrides the preset action for DBMS error 804. This entry specifies the following behavior:


Changing the Response to Logged Alerts

The Sybase ASE software logs alerts in a file that is identified by the Adaptive_Server_Log_ File extension property. The server fault monitor scans this file and performs actions in response to alerts for which an action is defined.

Logged alerts for which an action is preset are listed in Table 2. Change the response to logged alerts to change the preset action, or to define new alerts to which the server fault monitor responds.

To change the response to logged alerts, create an entry in a custom action file in which the keywords are set as follows:

The server fault monitor processes the entries in a custom action file in the order in which the entries occur. Only the first entry that matches a logged alert is processed. Later entries that match are ignored. If you are using regular expressions to specify actions for several logged alerts, ensure that more specific entries occur before more general entries. Specific entries that occur after general entries might be ignored.

For example, a custom action file might define different actions for errors that are identified by the regular expressions Attempt to dirty non-log and Attempt to unhash buffer. To ensure that the entry that contains the regular expression Attempt to unhash buffer is not ignored, ensure that this entry occurs before the entry that contains the regular expression Attempt to.

The following example shows an entry in a custom action file for changing the response to a logged alert.


Example 3 Changing the Response to a Logged Alert

{
ERROR_TYPE=SCAN_LOG;
ERROR="Attempt to";
ACTION=RESTART;
}

This example shows an entry in a custom action file that overrides the preset action for logged alerts about internal errors. This entry specifies the following behavior:


Changing the Maximum Number of Consecutive Timed-Out Probes

By default, the server fault monitor restarts the database after the second consecutive timed-out probe. If the database is lightly loaded, two consecutive timed-out probes should be sufficient to indicate that the database is hanging. However, during periods of heavy load, a server fault monitor probe might time out even if the database is functioning correctly. To prevent the server fault monitor from restarting the database unnecessarily, increase the maximum number of consecutive timed-out probes.


Caution – Caution –

Increasing the maximum number of consecutive timed-out probes increases the time that is required to detect that the database is hanging.


To change the maximum number of consecutive timed-out probes allowed, create one entry in a custom action file for each consecutive timed-out probe that is allowed except the first timed-out probe.


Note –

You are not required to create an entry for the first timed-out probe. The action that the server fault monitor performs in response to the first timed-out probe is preset.


For the last allowed timed-out probe, create an entry in which the keywords are set as follows:

For each remaining consecutive timed-out probe except the first timed-out probe, create an entry in which the keywords are set as follows:


Tip –

To facilitate debugging, specify a message that indicates the sequence number of the timed-out probe.


The following example shows the entries in a custom action file for increasing the maximum number of consecutive timed-out probes to five.


Example 4 Changing the Maximum Number of Consecutive Timed-Out Probes

{
ERROR_TYPE=TIMEOUT;
ERROR=2;
ACTION=NONE;
CONNECTION_STATE=*;
NEW_STATE=*;
MESSAGE="Timeout #2 has occurred.";
}

{
ERROR_TYPE=TIMEOUT;
ERROR=3;
ACTION=NONE;
CONNECTION_STATE=*;
NEW_STATE=*;
MESSAGE="Timeout #3 has occurred.";
}

{
ERROR_TYPE=TIMEOUT;
ERROR=4;
ACTION=NONE;
CONNECTION_STATE=*;
NEW_STATE=*;
MESSAGE="Timeout #4 has occurred.";
}

{
ERROR_TYPE=TIMEOUT;
ERROR=5;
ACTION=RESTART;
CONNECTION_STATE=*;
NEW_STATE=*;
MESSAGE="Timeout #5 has occurred. Restarting.";
}

This example shows the entries in a custom action file for increasing the maximum number of consecutive timed-out probes to five. These entries specify the following behavior:


Propagating a Custom Action File to All Nodes in a Cluster

A server fault monitor must behave consistently on all cluster nodes or zones. Therefore, the custom action file that the server fault monitor uses must be identical on all cluster nodes or zones. After creating or modifying a custom action file, ensure that this file is identical on all cluster nodes or zones by propagating the file to all cluster nodes or zones. To propagate the file to all cluster nodes or zones, use the method that is most appropriate for your cluster configuration:

Specifying the Custom Action File That a Server Fault Monitor Should Use

To apply customized actions to a server fault monitor, you must specify the custom action file that the fault monitor should use. Customized actions are applied to a server fault monitor when the server fault monitor reads a custom action file. A server fault monitor reads a custom action file when the you specify the file.

Specifying a custom action file also validates the file. If the file contains syntax errors, an error message is displayed. Therefore, after modifying a custom action file, specify the file again to validate the file.


Caution – Caution –

If syntax errors in a modified custom action file are detected, correct the errors before the fault monitor is restarted. If the syntax errors remain uncorrected when the fault monitor is restarted, the fault monitor reads the erroneous file, ignoring entries that occur after the first syntax error.


ProcedureHow to Specify the Custom Action File That a Server Fault Monitor Should Use

  1. On a cluster node or zone, become superuser or assume a role that provides solaris.cluster.modify RBAC authorization.

  2. Set the Custom_action_file extension property of the SUNW.sybase resource.

    Set this property to the absolute path of the custom action file.


    # clresource set -p custom_action_file=filepath server-resource
    
    -p custom_action_file=filepath

    Specifies the absolute path of the custom action file.

    server-resource

    Specifies the SUNW.sybase resource.