Installation guidelines ASE 15.7

From SybaseWiki
Revision as of 14:11, 17 October 2012 by Psap (Talk | contribs) (Created page with 'This page describes how to install and configure a Sybase ASE server version 15.7. You will also learn how to connect to the server, stop and restart it. ==Get the software== Fi…')

(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.7. You will also learn how to connect to the server, stop and restart it.

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.7 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.5 Gb so 4 Gb should give you enough room to handle upgrades too. In this case we install the software in /opt/sybase/ase157. Database files will be stored /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=274877906944"

Then add kernel.shmmax=274877906944 to /etc/sysctl.conf

Raw devices or filesystem files

Sybase recommends 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. Also, consult your storage administrator when in doubt.

Raw devices

When you use raw devices, create the following:

  • master (100 Mb)
  • sybsystemprocs (172M)
  • sybsystemdb (6M)
  • data01 (for instance 10G but for testing purposes 100Mb is also good. You can always add more)
  • log01(for instance 2G 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 100Mb 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 a license file. License files can reside on the network or on the local system. Think about the license policy that suits you best. Most sites choose for license files on each Unix server.

When there is no valid license, 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, or change the license settings revert to the Express Edition.

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/ase157 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 and the installation package.

Setup your environment

In /opt/sybase/ase157 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/ase157/SYBASE.sh

By doing:

echo $SYBASE

it should return /opt/sybase/ase157. 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/licenses

Create the ASE server

Most installations, especially for development purposes, 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.sa_password: secret123
sqlsrv.new_config: yes
sqlsrv.do_add_server: yes
sqlsrv.network_protocol_list: tcp
sqlsrv.network_hostname_list: <put your hostname here>
sqlsrv.network_port_list: 4000
sqlsrv.application_type: MIXED
sqlsrv.server_page_size: 4096
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: USE_DEFAULT
sqlsrv.sybsystemprocs_database_size: USE_DEFAULT
sqlsrv.sybsystemdb_device_physical_name: /var/sybase/ASE1/sybsystemdb.dev
sqlsrv.sybsystemdb_device_size: USE_DEFAULT
sqlsrv.sybsystemdb_database_size: USE_DEFAULT
sqlsrv.tempdb_device_physical_name: /var/sybase/ASE1/tempdb.dev
sqlsrv.tempdb_device_size: 100
sqlsrv.tempdb_database_size: 100
sqlsrv.default_backup_server: SYB_BACKUP
#sqlsrv.addl_cmdline_parameters: PUT_ANY_ADDITIONAL_COMMAND_LINE_PARAMETERS_HERE
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: yes
sqlsrv.avail_physical_memory: 256
sqlsrv.avail_cpu_num: 1

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 located at $SYBASE/interfaces.
  • 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. The default is 2 Kb but with today’s hardware this will give sub-optimal performance. Once the server has been created it 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. It’s very unusual to increase the size of the master device or the master database.
  • The location of the errorlog is /opt/sybase/admin/ASE1/errorlog, can be changed later in the configuration file.
  • A device of 172 Mb will be created for the sybsystemprocs database, also with a size of 172 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 6 Mb will be created for the sybsystemdb database. The size of the database will actually be 12Mb as 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.
  • Use the optimize configuration feature and tune for 256 Mb of memory and 1 cpu.

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.

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. The login “sa" has been created, with the password that was specified in ASE.rs file. At the prompt of isql you can type a command or execute a stored procedure. Type exit to exit.

isql -Usa -Psecret123 -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 -Psecret123 -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):   4096
# Master device path:   /var/sybase/ASE1/master.dev
# Error log path:       /opt/sybase/admin/ASE1/errorlog
# Configuration file path:      /opt/sybase/ase157/ASE-15_0/ASE1.cfg
# Directory for shared memory files:    /opt/sybase/ase157/ASE-15_0
# Adaptive Server name: ASE1
#
/opt/sybase/ase157/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/ase157/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 -Psecret123 -SASE1 < $SYBASE/$SYBASE_ASE/scripts/instmsgs.ebf


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: <put your hostname here>
bsrv.network_port_list: 4001
bsrv.language: USE_DEFAULT
bsrv.character_set: USE_DEFAULT
bsrv.tape_config_file: USE_DEFAULT
bsrv.errorlog: /opt/sybase/admin/SYB_BACKUP/SYB_BACKUP.log
sqlsrv.related_sqlsrvr: ASE1
sqlsrv.sa_login: sa
sqlsrv.sa_password: secret123
#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 file to the admin directory. First shutdown the backup server:

isql -Usa -Psecret123 -SASE1
shutdown SYB_BACKUP
go
exit

Modify the file RUN_SYB_BACKUP, located at $SYBASE/$SYBASE_ASE/install. Move the line with the -s flag to the top. Sample RUN_SYB_BACKUP:

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

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:

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

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