Installation guidelines ASE 15.5

From SybaseWiki
Revision as of 19:40, 24 October 2010 by Psap (Talk | contribs) (Created page with 'This page describes how to install and configure a Sybase ASE server version 15.5. ==Get the software== First download ASE. For a licensed version you need to go here: http://s…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes how to install and configure a Sybase ASE server version 15.5.

Get the software

First download ASE.

For a licensed version you need to go here: http://sybase.subscribenet.com (account required) or to the eShop at sybase.com: http://eshop.sybase.com/eshop/buy?id=19517

To get a free download you can go to this page http://www.sybase.com/ase_1500devel. You can download ASE 15.5 for various operating systems and chipsets. When you install ASE you can choose to run without a license (limited features) or install a licenced version and buy a license from Sybase.

Downloads are also available at the Sybase download center at http://downloads.sybase.com/swd/base.do?client=support. Once registered you can download the latest EBF (patch) for the desired platform. An EBF can also be used for a full installation.

Prepare the Operating System

Make sure that the filesystem for the Sybase software is big enough. A full installation needs approx. 1.2 Gb so 4 Gb should give you enough room to handle upgrades too. In this case we install the software in /opt/sybase/ase155. Database files will be stored on raw devices and/or in /var/sybase.

Become root and add a group "sybase" and a user "sybase" to the system. Also create the needed directories. Strictly spoken, the usage of the username and groupname called "sybase" is not needed, any username is fine.

mkdir -p /opt/sybase
mkdir -p /var/sybase
groupadd sybase
useradd -g sybase -d /opt/sybase sybase
passwd sybase
chown sybase:sybase /opt/sybase
chown sybase:sybase /var/sybase

Enable the operating system to allow more than the default value for shared memory.

  • Solaris (pre version 10) /etc/system

set shmsys:shminfo_shmmax = 4294967295

  • Solaris (system 10) /etc/project
projadd -c "sybase" 'user.sybase'
projmod -s -K "project.max-shm-memory={privileged,4GB,deny}" 'user.sybase'
  • Linux:

Use "sysctl kernel.shmmax" to see the current value. Configure a new value with "sysctl -w kernel.shmmax=78643200" Then add kernel.shmmax=78643200 to /etc/sysctl.conf

Raw devices or filesystem files

Sybase recommends, and I fully 100% agree, to store all database files on raw devices except for temporary databases like tempdb. Some Unix adminstrators do not like raw devices and then you need to put everything on filesystems.

Raw devices

When you use raw devices, create the following:

  • master (60Mb but 100Mb is better)
  • sybsystemprocs (200M)
  • sybsystemdb (20M)
  • data01 (for instance 32G but for testing purposes 100Mb is also good. You can always add more)
  • log01(for instance 5G but for testing purposes 20Mb is also good. You can always add more).

Do not forget to chown the raw devices to the sybase user. Check if this setting is persistent after a reboot.

Temporory databases

Files for temporary databases (like tempdb) should be stored on the filesystem. Allow at least for 200Mb but, depending on your application, several Gb's or much more is not uncommon.

Determine your license policy

Since ASE 15.0 you cannot run a production server without license file. License files can reside on the network or on the local system. Think about the license policy that suits you best. For small sites choose for license files on each Unix server.

When there is no valid license after the installation ASE will run with a grace time of 30 days. After that it will shutdown and it cannot be rebooted anymore until you install a license.

Installation of the software

Now, switch to the newly created user:

su - sybase

You should now be in the directory /opt/sybase. Make a work directory and put the downloaded Sybase software in it.

mkdir install
cd install
<put the software in this directory>
tar -xf <software-distro>

Start the installation (when using an EBF download as installation file you may need to go into a subdirectory)

./setup.bin

When you get a message like "A suitable JVM could not be found" or “exec: 2470: /tmp/install.dir.1392/Linux/resource/jre/bin/java: not found” check the following document for a solution: Ubuntu 64 bit ASE installation

Use /opt/sybase/ase155 as the destination directory, do a full installation. At the list of possible servers to configure, deselect all options. We will do a manual configuration.

When the installation has finished successful you can safely remove the work directory.

Setup your environment

In /opt/sybase/ase155 you will find files like SYBASE.csh, SYBASE.sh and SYBASE.env. Depending on the type of shell you use you need to source in one of these. For instance, when your default shell is bash you should do this:

. /opt/sybase/ase155/SYBASE.sh

By doing:

echo $SYBASE

it should return /opt/sybase/ase155. Is is fairly common to activate the SYBASE.sh script (or similar one) from your login script.

When you have generated a licence file through http://sybase.subscribenet.com install it in the directory $SYBASE/SYSAM-2_0/licences

Create the ASE server

Most installations run multiple ASE's and backup servers from a single Sybase software installation. For a good overview it is quite handy to store files that are specific for a server in it's own directory. In this example we create two servers: an ASE called ASE1 and a backupserver called SYB_BACKUP. Configuration files and the errorlog are stored in the admin directory, database files are stored in /var/sybase.

Create the directories for these servers:

cd /opt/sybase
mkdir admin
mkdir admin/ASE1
mkdir admin/SYB_BACKUP
mkdir /var/sybase/ASE1

When you choose to use raw device it's quite handy when you create symbolic links from /var/sybase/ASE1 to those devices. For example:

ln -s /dev/hda4 /var/sybase/ASE1/master.dat

Do this also for the other raw devices that you have made.

Now go to the "/opt/sybase/admin/ASE1" directory and create a resource file. Use the following template as an example, call it ASE1.rs. You can also use the Sybase supplied resource file, it's $SYBASE/$SYBASE_ASE/init/sample_resource_files/srvbuild.adaptive_server.rs

sybinit.release_directory: USE_DEFAULT
sybinit.product: sqlsrv
sqlsrv.server_name: ASE1
sqlsrv.new_config: yes
sqlsrv.do_add_server: yes
sqlsrv.network_protocol_list: tcp
sqlsrv.network_hostname_list: <your hostname>
sqlsrv.network_port_list: 4000
sqlsrv.application_type: MIXED
sqlsrv.server_page_size: USE_DEFAULT
sqlsrv.force_buildmaster: no
sqlsrv.master_device_physical_name: /var/sybase/ASE1/master.dev
sqlsrv.master_device_size: 100
sqlsrv.master_database_size: 60
sqlsrv.errorlog: /opt/sybase/admin/ASE1/errorlog
sqlsrv.do_upgrade: no
sqlsrv.sybsystemprocs_device_physical_name: /var/sybase/ASE1/sybsystemprocs.dev
sqlsrv.sybsystemprocs_device_size: 200
sqlsrv.sybsystemprocs_database_size: 200
sqlsrv.sybsystemdb_device_physical_name: /var/sybase/ASE1/sybsystemdb.dev
sqlsrv.sybsystemdb_device_size: 20
sqlsrv.sybsystemdb_database_size: 20
sqlsrv.tempdb_device_physical_name: /var/sybase/ASE1/tempdb.dev
sqlsrv.tempdb_device_size: 100
sqlsrv.tempdb_database_size: 100M
sqlsrv.default_backup_server: SYB_BACKUP
#sqlsrv.addl_cmdline_parameters:
sqlsrv.do_configure_pci: no
sqlsrv.sybpcidb_device_physical_name: PUT_THE_PATH_OF_YOUR_SYBPCIDB_DATA_DEVICE_HERE
sqlsrv.sybpcidb_device_size: USE_DEFAULT
sqlsrv.sybpcidb_database_size: USE_DEFAULT
# If sqlsrv.do_optimize_config is set to yes, both sqlsrv.avail_physical_memory and sqlsrv.avail_cpu_num need to be set.
sqlsrv.do_optimize_config: no
sqlsrv.avail_physical_memory: PUT_THE_AVAILABLE_PHYSICAL_MEMORY_FOR_ASE_IN_OPTIMIZATION
sqlsrv.avail_cpu_num: PUT_THE_AVAILABLE_NUMBER_CPU_FOR_ASE_IN_OPTIMIZATION

This resource file will a create a Sybase server with the following characteristics:

  • The name of the server will be ASE1, can be changed later with the sp_addserver stored procedure.
  • The server will have a listener on the ip-address as indicated with <hostname> and port 4000. This can be changed later in the interfaces file.
  • Application type is mixed, so you expect both oltp and dss type of queries. This can be changed later by modification of the “optimization goal” setting with sp_configure).
  • Server page size will be 4 Kb, which is the default. This cannot be changed, a complete server rebuild is needed then.
  • The master device will be 100 Mb, the size of the master database will be 60 Mb. The master devices will contain the master database, the master database contains important meta-data about the server. The master device can be increased with the “disk resize” command, the master database can be increased with the “alter database” command. There are no documented methods for shrinking devices or databases.
  • The location of the errorlog is /opt/sybase/admin/ASE1/errorlog, can be changed later in the configuration file.
  • A device of 200 Mb will be created for the sybsystemprocs database, also with a size of 200 Mb. The size of the device can be increased with the “disk resize” command, the database can be increased with the “alter database” command.
  • A device of 20 Mb will be created for the sybsystemdb database, also with a size of 20 Mb. A small portion will also reside on the master device. The size of the device can be increased with the “disk resize” command, the database can be increased with the “alter database” command.
  • A temporary database 'tempdb' will be created on a device with a size of 100 Mb, the database will also be 100 Mb. In fact, it will be a bit larger since also a small portion will reside on the master device. Again, the device and the tempdb database can be increased in size. You can also create multiple temporary databases for improved concurrency.
  • We will build a backup server called SYB_BACKUP. The name can be changed later with sp_addserver.
  • We will not use a PCI (Pluggable Component Interface) database. This database is mainly used for Java in the server.
  • We will not use the optimize configuration feature now. When trying to use this feature through sqlsrv.do_optimize_config: yes can expect the error “Unable to find SQL file to run optimization task”. Configuration of the server will be done at a later stage.

Now build the server with the command:

srvbuildres -r ASE1.rs

When the srvbuildres command fails with:

Task failed
Unable to boot server 'ASE1'.  
Server 'ASE1' was not created.

or

Optimizing server configuration...
Unable to find SQL file to run optimization task.
Task failed

then go to this page for tips how to solve this: srvbuildres task failed.

After a successful creation you can connect to the server using the command line tool isql. At the prompt of isql you can type a command or execute a stored procedure. Type exit to exit.

isql -Usa -P -SASE1
sp_helpdb
go
exit

Basic ASE configuration

Move and modify configuration files

In this step we will move the configuration files to the admin directory. First shutdown ASE

isql -Usa -P -SASE1
shutdown
go
cd $SYBASE/$SYBASE_ASE
mv ASE1.cfg /opt/sybase/admin/ASE1
rm ASE1.*
cd install

Modify RUN_ASE1 and make the following changes:

  • Make the -s flag the first option. This has the advantage that a listing of running processes on the system will show the name of the Sybase server.
  • Change the location of the configuration files, as specified with the -c flag, to the admin directory

Each line must end with a backslash. Example RUN_ASE1 file:

#!/bin/sh
#
# ASE page size (KB):   2K
# Master device path:   /var/sybase/ASE1/master.dev
# Error log path:       /opt/sybase/admin/ASE1/errorlog
# Configuration file path:      /opt/sybase/ase155/ASE-15_0/ASE1.cfg
# Directory for shared memory files:    /opt/sybase/ase155/ASE-15_0
# Adaptive Server name: ASE1
#
/opt/sybase/ase155/ASE-15_0/bin/dataserver \
-sASE1 \
-d/var/sybase/ASE1/master.dev \
-e/opt/sybase/admin/ASE1/errorlog \
-c/opt/sybase/admin/ASE1/ASE1.cfg \
-M/opt/sybase/ase155/ASE-15_0 \

Now restart the Sybase server

./startserver -f ./RUN_ASE1

Load instmsg.ebf file

The instmsgs.ebf file contains the latest update for Sybase error messages. You can load it with isql.

isql -Usa -P -SASE1 < $SYBASE/$SYBASE_ASE/scripts/instmsgs.ebf

Configure the server using optase.sh

With the tool optase.sh you can configure your server. You need to supply the following information:

  • The amount of memory that the Sybase server can use. A rough guideline is approx 80 % of total physical memory but lower the value if your other servers or application software at the same time.
  • The number of CPU's that the Sybase server can use. Again, leave a safe margin for other processes and the operating system.
  • The pagesize of the ASE server, as specified in the ASE1.rs file. When you have used the default page size it will be 4Kb.
  • Type of product edition. Some ASE features are not available in certain editions.
  • Application type, as specified in the ASE1.rs file.

You can run optase.sh and have you prompted per item, or supply all the required information when you start the tool. Example

$SYBASE/$SYBASE_ASE/bin/optase.sh 1024 2 2 EE MIXED /tmp/config.sql

When done, run the configuration script.

isql -Usa -P -SASE1 -i /tmp/config.sql

Then reboot the ASE server, stop it first

isql -Usa -P -SASE1
shutdown
go

Start again

startserver -f $SYBASE/$SYBASE_ASE/install/RUN_ASE1

Create the backup server

Create the backup server using the following steps.

Go to the "/opt/sybase/admin/SYB_BACKUP" directory and create a resource file. Use the following template as an example, call it SYB_BACKUP.rs. You can also use the Sybase supplied resource file, it's $SYBASE/$SYBASE_ASE/init/sample_resource_files/srvbuild.backup_server.rs

sybinit.release_directory: USE_DEFAULT
sybinit.product: bsrv
bsrv.server_name: SYB_BACKUP
bsrv.new_config: yes
bsrv.do_add_backup_server: yes
bsrv.do_upgrade: no
bsrv.network_protocol_list: tcp
bsrv.network_hostname_list: prd-syb-ase2
bsrv.network_port_list: 4001
bsrv.language: USE_DEFAULT
bsrv.character_set: USE_DEFAULT
bsrv.tape_config_file: USE_DEFAULT
bsrv.errorlog: USE_DEFAULT
sqlsrv.related_sqlsrvr: ASE1
sqlsrv.sa_login: sa
sqlsrv.sa_password: USE_DEFAULT
#bsrv.addl_cmdline_parameters: PUT_ANY_ADDITIONAL_COMMAND_LINE_PARAMETERS_HERE

Build the server with the command:

srvbuildres -r SYB_BACKUP.rs

Move and modify configuration files

In this step we will move the configuration files to the admin directory. First shutdown the backup server:

isql -Usa -P -SASE1
shutdown SYB_BACKUP
go
exit

Modify the RUN_SYB_BACKUP, located at $SYBASE/$SYBASE_ASE/install. Change the location of the log file,as specified with the -e flag. Change it to the admin directory. Also, move the line with the -s flag to the top. Sample RUN_SYB_BACKUP:

#!/bin/sh
#
# Error log path:       /opt/sybase/ase155/ASE-15_0/install/SYB_BACKUP.log
# Maximum number of network connections:        25
# Maximum number of server connections: 20
# Multibuf executable path:     /opt/sybase/ase155/ASE-15_0/bin/sybmultbuf
# Backup Server name:   SYB_BACKUP
#
/opt/sybase/ase155/ASE-15_0/bin/backupserver \
-SSYB_BACKUP \
-e/opt/sybase/admin/SYB_BACKUP/SYB_BACKUP.log \
-N25 \
-C20 \
-M/opt/sybase/ase155/ASE-15_0/bin/sybmultbuf \

Remove the old log file

rm $SYBASE/$SYBASE_ASE/install/SYB_BACKUP.log

Restart the backupserver

startserver -f $SYBASE/$SYBASE_ASE/install/RUN_SYB_BACKUP

Create a user database

disk init name = data01,size="1G",physname="/var/sybase/ASE1/data01.dat"
go
disk init name = log01,size="100M",physname="/var/sybase/ASE1/log01.dat"
go
create database my_database on data01="1G" log on log01 = "100M"
go

All done

Happy Sybase-ing with your new server!!

Further reading:

Installatin guide for Linux http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc30119.1550/doc/html/title.html

Sybase System administration http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc31654.1550/html/sag1/title.htm