Configuring and verifying installation of Sybase 12

This article describes how to do the following:

  • Create, configure, and verify the operation of a Sybase server.
  • Create a configure a database named WAS40 and the Sybase users required by WebSphere Application Server.

These instructions assume that Sybase is installed and that the required Electronic Software Distribution (ESD) fix is installed, if necessary.

Creating, configuring, and verifying the operation of a Sybase server

Perform the following steps to create a database for WebSphere:

  1. Log in as the the user sybase. Note that when you log in as user sybase, the command prompt appears as $, rather than #, to indicate your login identity.
  2. Ensure that the DISPLAY, TERM, and JAVA_HOME environment variables are still set properly. In addition, ensure that the PATH environment variable includes the full pathname of the directory in which Java is installed.
  3. Start the Sybase Adaptive Server setup and configuration utility by entering the following command:
    $ asecfg
  4. The ASE Setup and Configuration window opens. Click Configure a new server.
  5. The srvbuild-Select Servers to Build window opens. Select the Adaptive Server radio button and type the server name. This name must match the value that you defined for the $DSQUERY environment variable. Click OK.
  6. The srvbuild-Server Attribute Editor window opens. In the Master device path field, type the following:
    install_directory/master

    In this command, install_directory is the full pathname of installation directory of the Sybase software.

  7. Accept the default values for the Master device size (MB) and Master database size (MB) fields.
  8. In the Sybsystemprocs device path field, type the following:
    install_directory/sybsystemprocs
  9. Accept the default values for the other fields, and click Edit Advanced Adaptive Server Attributes.
  10. The srvbuild-Server Attribute Editor window opens. In the Sybsystemdb (two-phase commit) device path field, type the following:
    install_directory/sybsystemdb
  11. Accept the default values for the other fields, and click Build Server!.
  12. The srvbuild-Status Output window opens. It shows the status of the various installation tasks as they run.
  13. Near the end of the installation process, the srvbuild-question window displays, asking whether you want to localize your Adaptive Server to use a language other than U.S. English or to use a different default character set or sort order. For this example installation, click No. (If you need to change these parameters, click Yes. Refer to the Sybase installation documentation for more information.)
  14. If the installation is successful, the following message appears in the srvbuild-Status Output window:
    Server 'server_name' was successfully created.
    Done
  15. Click OK to close the srvbuild-Status Output window.
  16. The srvbuild-Select Servers to Build window opens. Click Exit to close this window.
  17. A srvbuild-question window opens, asking whether you want to exit from the utility. Click Yes to continue.
  18. If the ASE Setup and Configuration window continues to be displayed, click Exit.
  19. Use the following procedure to check the operation of the server you created:
    1. As the user sybase, enter the following command to log into the Adaptive Server as the user sa and launch the Sybase isql utility:
      $ install_directory/OCS-12_0/bin/isql -Usa -P -Sserver_name

      In this command, install_directory represents the installation directory of the Sybase software.

      If server server_name is running, the isql prompt opens:

      1>

      Note: The Adaptive Server installation and setup processes require certain user roles. Different user roles own different responsibilities and privileges. The user sybase is the UNIX login account that owns all of the Sybase installation directories and files, sets permissions on those directories and files, and performs the installation and upgrading of Adaptive Server. The user sa, created when you install the Sybase software, is not a UNIX login account; it is specific to Adaptive Server and is used to log in to Adaptive Server with the isql command. It is the Sybase system administrator in charge of creating user accounts, assigning permissions on databases, and creating new databases.

    2. Shut down the server by entering the following commands:
      1> shutdown
      2> go

      A message similar to the following opens:

      Server SHUTDOWN by request.
      The SQL Server is terminating this process.

    3. Navigate to the install_directory/ASE-12_0/install directory by entering the following command:
      $ cd install_directory/ASE-12_0/install
    4. Start the server by entering the following command:
      $ startserver -f RUN_$DSQUERY
      where $DSQUERY is the value that you set for this environment variable.

      Check the messages that appear to ensure that no errors are reported.

    5. Press Return when a line similar to the following opens:
      00:00000:00001:2000/05/09 13:19:14.32 server    'iso_1' (ID = 1).
  20. As the user sybase, use the following procedure to ensure that any installed fix was applied correctly to the Sybase base installation.
    1. Type the following command to launch the Sybase isql interactive utility:
      $ install_directory/OCS-12_0/bin/isql -Usa -P -Sserver_name

      You will see the isql prompt:

      1>

    2. Type the following commands:
      1> select @@version
      2> go

      The output should include the product name, version number, and patch level.

    3. If necessary, enter the following command to exit the isql utility:
      1> quit
  21. To use the jConnect 5.2 Java Database Connectivity (JDBC) driver, update the .profile file by including the JDBC_HOME and CLASSPATH environment variables. Set these variables by doing the following (for this example installation, assume the use of jConnect 5.x with JDK 1.2):
    1. Set JDBC_HOME to the directory where you have installed jConnect (in this example installation, install_directory/jConnect-5_2).
    2. Set CLASSPATH to the location of your jConnect JAR file (in this example installation, install_directory/jConnect-5_2/classes/jconn2.jar).
    3. To enable the jConnect verification steps append CLASSPATH with install_directory/jConnect-5_2/classes.
    4. Log out and log back in as the user sybase for your changes to take effect.
  22. To verify that the jConnect driver is operating correctly, test the installation by running the supplied Version program. The Version program connects to a demonstration database that Sybase makes available on the Internet. Therefore, you must have Internet access to run the program successfully. To run the Version program, do the following:
    1. Ensure that your JAVA_HOME, JDBC_HOME, and CLASSPATH environment variables are set properly.
    2. Navigate to the directory represented by the JDBC_HOME environment variable (in this example installation, install_directory/jConnect-5_2) by entering the following command:
      $ cd install_directory/jConnect-5_2
    3. Enter the following command to run the Java program:
      $ java sample2.SybSample Version

      The SybSample window displays, showing the source code for the Version program in the top pane, text in the middle pane, and status information in the bottom pane. If you see the following text in the middle Sample Output pane, jConnect has been installed correctly:

      Using JDBC provider version 5.2 jConnect (TM) for JDBC(TM)/5.2. . .
    4. On the File menu, click Close to exit from the SybSample window.
  23. Run the instmsgs.ebf script to update the SQL server messages to the latest installed fix level. Save the output of this step to a file, as follows:
    $ install_directory/OCS-12_0/bin/isql -Usa -P -Sserver_name -n \
    -iinstall_directory/ASE-12_0/scripts/instmsgs.ebf -ooutput_file
  24. After the initial Sybase installation, the password for user sa is NULL. As the user sybase, set the password by entering the following commands:
    isgl -Usa -P -Sserver_name
    1> sp_password null, new_password
    2> go
  25. Type quit.

Creating Sybase resources required by WebSphere Application Server

Perform the following steps to create a database named WAS40 and the Sybase users required by WebSphere:

  1. Create the database WAS40 by performing the following steps:
    1. Enter the following command to start the Sybase isql interactive utility:
      $ install_directory/OCS-12_0/bin/isql -Usa -P -Sserver_name
    2. The isql prompt opens:

      1>

    3. Initialize a database device named WASEV by entering the following commands:
      disk init name = 'WASDEV',
      physname = '/install_directory/was.dat',
      vdevno = 3,
      size = 5000
      2> go

      In this example, the value for the name option is the device name, the value for the physname option is the name of the raw disk partition or operating system file, the value for the vdevno option is the identifying number for the datavase device, and the value for the size option is the size of the database in 2-KB blocks.

      Note: The value of the vdevno option must be set to the next available (unused) device. To list the devices in use, enter the commands:

      isql -Usa -P
      1> sp_helpdevice
      2> go

      The value of 5000 for the size option is equivalent to 10 MB. You can need to specify a higher value for use in a production environment. The Sybase default is 2 MB, which is too small for WebSphere Application Server.

  2. Enter the following commands to create the database WAS40 on the WASDEV database device and allocate 10 MB of space to the database. The database will be the WebSphere Application Server administrative repository that you configure during installation of WebSphere Application Server. The database name must be in uppercase letters:
    1> create database WAS40 on WASDEV = 10
    2> go

    A message similar to the following opens:

    CREATE DATABASE: allocating 4864 pages on disk 'WASDEV'
  3. Access the new database by entering the following commands:
    1> use WAS40
    2> go
  4. Create the Sybase user ID and password for WebSphere Application Server by entering the following commands:
    1> sp_addlogin EJSADMIN, 6-or-more-character_password, WAS40
    2> go

    You will use this database user ID and password when you install WebSphere Application Server. The user ID must be in uppercase letters and the password must be a minimum of 6 characters.

  5. Add the EJSADMIN user to the database WAS40 by entering the following commands:
    1> sp_adduser EJSADMIN
    2> go
  6. Create a Sybase user ID for enterprise beans by entering the following commands:
    1> sp_addlogin EJB, 6-or-more-character_password, WAS40

    You will use this user ID and password to access your data source for enterprise beans in WebSphere Application Server. The user ID must be in uppercase letters and the password must be a minimum of 6 characters.

  7. Add the user EJB to the database WAS40 by entering the following commands:
    1> sp_adduser EJB
    2> go
  8. Grant the users EJSADMIN and EJB all object access permissions to the database WAS40 by entering the following commands:
    1> grant all to EJSADMIN, EJB
    2> go
  9. Grant the user EJB the privileges of dtm_tm_role by entering the following commands. You will enable Data Transaction Management (DTM) in Step 12.
    1> grant role dtm_tm_role to EJB
    2> go
    1> COMMIT
    2> go
  10. Use the following commands to activate the database option trunc log on chkpt. Activating this option ensures that committed transactions are removed from the transaction log when the CHECKPOINT checking process occurs. Transactions are removed from the log file in this case only if 50 or more rows exist in the log.

    1> use master
    2> go
    1> sp_dboption WAS40, "trunc log on chkpt", true
    2> go

    The following text opens:

    Database option 'trunc log on chkpt' turned ON for database 'WAS40'.
    Run the CHECKPOINT command in the database that was changed.
    (return status = 0)
  11. Enter the following commands to complete the configuration:
    1> COMMIT
    2> go
    1> use WAS40
    2> go
    1> COMMIT
    2> go
    1> CHECKPOINT
    2> go
  12. Perform the following steps to enable Data Transaction Management (DTM):
    1. Activate the enable DTM configuration parameter by entering the following commands:
      1> sp_configure "enable DTM", 1
      2> go
    2. For your changes to take effect, shut down the database server by entering the following commands:
      1> shutdown
      2> go
    3. Restart the server by entering the following command:
      $ install_directory/ASE-12_0/install/startserver -f RUN_$DSQUERY