You are on page 1of 87

Quick-Start with ASE Express

Session 1 - Install and Configure


WHY SYBASE ON LINUX?
 Award Winning Technology
 “Readers Choice Award “
LinuxWorld Magazine, 2004
 “Editors Choice Award”
Open Source World Magazine, 2003
 “Lowest TCO Database”
Standish Group Report

 Sybase Professional Services


 Evaluation Services
 Migration Services
 Performance and Tuning Services

 Sybase Linux Competency Centers


 New York: 2003
 Beijing: 2003
2 October 7, 2004
SYBASE’S BROAD LINUX SUPPORT

 Data Management Solutions


 Adaptive Server Enterprise
 Replication Server
 Sybase IQ
 Integration Solutions
 OpenSwitch
 EAServer
 Enterprise Portal
 Applications
Financial Fusion
 Mobile & Wireless
 SQL Anywhere Studio for LINUX

3 October 7, 2004
ACCOLADES FOR ASE EXPRESS

“Sybase Ramps Up Linux Effort With Express


Database”

“Sybase releases free Express database for


Linux”

"It's definitely a good value proposition


compared to open-source databases. Sybase is a
very mature database, known for reliability,
availability and performance."

“Sybase Offering Flagship Database For Linux”

4 October 7, 2004
MARK KUSMA
PRINCIPAL TECH SUPPORT ENGINEER

SYBASE
AGENDA

 Overview of Sybase Adaptive Server Enterprise (ASE)


 Installation
 Connectivity
 Server Configuration
 Memory
 Devices
 Databases
 Users
 Permissions
 Next Steps

6 October 7, 2004
SYBASE ASE EDITIONS
EXPRESS DEVELOPER SMALL ENTERPRISE
BUSINESS
No. of CPUs 1 1 4 No limit
Max. Memory 2GB No limit No limit No limit
Size
Max. Database 5GB No limit No limit No limit
Size
Max. number of No limit 25 256 No limit
concurrent
connections
System Available Available Available Available
Management
Suite
Options & Not Available Included Available Available
Option except DR, XRAY, Except DR, HA & DTM
EFTS
Packages
 ASE Express Edition can be installed/deployed on machines of any size (multi-processor
machines), ASE will only take advantage of one of those processors, 2GB memory and 5GB disk
space
7 . October 7, 2004
ADAPTIVE SERVER SYSTEM MODEL
Application code
Open Client
SQL
Network interface SQL compiler
Request Shared memory
Data Cache
Response RPC SQL
executive

Procedure
Optimizer Cache

Buffer Manager
Indexes Transaction
Data tables Log

Stored
Procedures

8 October 7, 2004
ADAPTIVE SERVER DATABASES

 Required Databases  Sample Databases


 master  pubs2
 model  pubs3
 sybsystemprocs  Application Databases
 sybsystemdb  User defined
 tempdb
 Additional functionality
databases
 sybsyntax
 dbccdb
 sybsecurity

9 October 7, 2004
CLIENTS

 isql – a command line program


 jisql – java application which provides a GUI interface
 Sybase Central – Java-based common framework for
managing Sybase servers, including Adaptive Server

10 October 7, 2004
DATABASE UTILITIES

 srvbuild – The Server installation utility


 dsedit – A GUI tool for creating and modifying the
interfaces file
 dscp – A command line tool for the interfaces file
 bcp – A program that copies between a table and a file
 optdiag – A program for displaying statistics from the two
system tables – systabstats and sysstatistics
 sqldbgr – A command-line utility used to debug stored
procedures and triggers
 ddlgen – A Java-based tool that generates definitions for
server and database level objects

11 October 7, 2004
SERVER COMPONENTS

 Adaptive Server Enterprise


 The database server
 Backup Server
 Performs database dumps and loads for backup and
recovery
 XP Server
 Manages & executes extended stored procedures
 Monitor Server
 Collects data for performance and tuning analysis
 Historical Server
 Saves data from Monitor Server for deferred analysis

12 October 7, 2004
ASE 12.5 DIRECTORY STRUCTURE

bin

init
ASE-
INSTALLATION 12_5 errorlog
install
DIRECTORY RUN_SYBASE
scripts
$SYBASE
charsets

Jutils-2_0 jisql jisql


isql
OCS-12_5 bin
bcp
interfaces
SYBASE.cfg

13 October 7, 2004
ENVIRONMENT VARIABLES

 $DSLISTEN (given by the Administrator)


 Specifies the name of the server
 $DSQUERY (given by the Administrator)
 Identifies the server to connect to when a utility is run
without a specific server name
 $SYBASE (given by the Administrator)
 Identifies the top-level directory for all Sybase products
 $SYBASE_ASE (set by the system to “ASE-12_5”)
 Identifies subdirectory where Adaptive Server is installed
 $JAVA_HOME (given by the Administrator)
 Identifies subdirectory where Java Development Kit (JDK)
located
 Needed only when using jisql client

14 October 7, 2004
AGENDA

 Overview of Sybase Adaptive Server Enterprise (ASE)


 Installation
 Connectivity
 Server Configuration
 Memory
 Devices
 Databases
 Users
 Permissions
 Next Steps

15 October 7, 2004
SYSTEM REQUIREMENTS

Operating System Requirements


Red Hat Enterprise Linux 2.1  kernel 2.4.9-e.3 or higher
for Intel x86 (32-bit)  glibc 2.2.4-26 or higher
Red Hat Enterprise Linux 3.0  kernel 2.4.21-4.EL or higher
for Intel x86 (32-bit)  glibc 2.3.2-95.3 or higher
 compat-libstdc++-7.3-2.123 or higher
SuSE Linux Enterprise  kernel 2.4.18-e.37 or higher
Server 8.0/United Linux 1.0  glibc 2.2.5-165 or higher
 compat–2002.8.15-29 or higher
Red Flag Linux 4.0  kernel 2.4.21-AS.1 or higher
 glibc 2.3.93-5.1 or higher

16 October 7, 2004
INSTALLATION REQUIREMENTS

 Minimum disk space required for the system databases


 master device (default 30MB, minimum 14MB)
 master – 6MB
 model – 2MB
 tempdb – 3MB
 sybsystemdb – 2MB
 sysprocsdev device (default 120MB)
 sybsystemprocs – 120MB
 Software installation: 375-655 MB
 Minimum memory required
 Adaptive Server – 64MB
 Per additional user – 140KB

17 October 7, 2004
PRE-INSTALLATION TASKS

 Create a “sybase” account on your system


 Do not install using the “root” account
 Decide where you will install to, and verify space is
available
 “sybase” needs permissions for the install directory
 Increase amount of shared memory default to 64MB, or
higher
 Most Linux systems default to 32MB
 Check limit using: /sbin/sysctl kernel.shmmax
 /sbin/sysctl –w kernel.shmmax=67108864
 Login to the machine as the “sybase” user

18 October 7, 2004
INSTALLING LINUX EXPRESS EDITION

 Download the tgz file to a temporary directory


 Unzip the file using gnu tar
 tar –zxf ase1252xe_linux.tgz
 Start the installer by entering: ./setup
 Sybase no longer uses RPM on Linux
 Select the appropriate license by selecting the country
 Select the target installation directory
 Select type of installation: Typical, Full or Custom
 Install Status window displays the result of the installation
process
 Once the software is installed, you can create the desired
server components, or exit the installer

19 October 7, 2004
CREATING SERVERS

 Creating servers
 Take defaults or can Custom Configure
 Adaptive Server: default name is hostname, port 5000
 Backup Server: default is <ase_name>_BS, port 5001
 Monitor Server: default is <ase_name>_MS, port 5002
 XP Server: default is <ASE_NAME>_XP, port 5003. The XP
Server must be named using this convention.
 Custom Configuration allows you to change names, port
numbers, page size, error log name, and initial devices
and sizes
 Not all changes are applicable to each server
 This process can be run stand-alone using the srvbuild
utility

20 October 7, 2004
STARTING SERVERS

 The RUN_<server> file is used to start a server


 It is located in the $SYBASE/ASE-12_5/install directory
 Contains the dataserver command used to start the server
 It includes the following information:
 Server name
 Location of the master device
 Location of the errorlog file
 Location of configuration file
 Location of the interfaces file
 You can modify server startup behavior by modifying the
RUN_<server> file
 RUN_<server>_XX scripts to start the other server
components (XX = BS, MS, XP)

21 October 7, 2004
POST-INSTALLATION TASKS

 To determine whether the servers you installed are


running, enter:
 $SYBASE/$SYBASE_ASE/install/showserver
 Set the environment variables
 From a command line, enter one of the following depending on
which shell you are using:
source $SYBASE/SYBASE.csh
source $SYBASE/SYBASE.sh

22 October 7, 2004
POST-INSTALLATION TASKS

 To verify that you can connect to the server, enter:


 isql –Usa –P<password> –S<server>
 Warning: The default sa password is blank (NULL). You
should change the password since this is the System
Administrator’s login.
 isql –Usa –P –S<server>
1> sp_password null, <new_password>
2> go

23 October 7, 2004
AGENDA

 Overview of Sybase Adaptive Server Enterprise (ASE)


 Installation
 Connectivity
 Server Configuration
 Memory
 Devices
 Databases
 Users
 Permissions
 Next Steps

24 October 7, 2004
ESTABLISHING CONNECTIVITY

 Sybase Open Client (SDK) software is required to make


connections to ASE
 It is installed on the server machine during ASE install
 For client installations:
 on Linux platforms, it can be installed from the ASE Express
download image by selecting only Open Client in a custom
install
 on Windows platforms, you need to download the ASE
12.5.2 Developer Edition PC-Client image from:
www.sybase.com/ase_1252devel

25 October 7, 2004
THE interfaces FILE

 The interfaces file is an “address book” that lists the name


and address of every known server
 When connecting to a server with a given name, client
applications:
 Look up the server name in the interfaces file
 Connect to the server using the specified address
 Administrators must modify and distribute the interfaces file
to users so they can connect to the server
 The file is in the $SYBASE directory
 On Windows, this file is called sql.ini and is located in the
%SYBASE%\ini directory

26 October 7, 2004
USING LDAP FOR CONNECTIVITY

 ASE 12.5.x and Open Client/Open Server can be configured to


use LDAP services to define server connection information
 LDAP directory structure is accessed by a 3rd-party LDAP server.
 Provides an optional, lightweight alternative to the interfaces file
 Lookup requests are based on server name
 LDAP supports more attributes than the interfaces file, for
example:
 server status
 version
 LDAP is a centrally located, platform independent directory
service
 Removes the need to distribute the interfaces file to clients

27 October 7, 2004
AGENDA

 Overview of Sybase Adaptive Server Enterprise (ASE)


 Installation
 Connectivity
 Server Administration/Configuration
 Memory
 Devices
 Databases
 Users
 Permissions
 Next Steps

28 October 7, 2004
CONNECTING VIA SYBASE CENTRAL

 Sybase Central is a GUI tool for administering Sybase servers


 The ASE plug-in provides support for Adaptive Server
 Enter:
 $SYBASE/ASEP/bin/aseplugin
 Select Tools|Connect, then select the server to which you want
to connect from the drop-down list.
 In the Login window, enter, the System Administrator’s user
name (sa) and password. Click OK.

29 October 7, 2004
SYBASE CENTRAL

30 October 7, 2004
SYBASE CENTRAL

31 October 7, 2004
THE CONFIGURATION FILE

 When the server is started the configuration file is used to


allocate server resources
 $SYBASE/$SYBASE_ASE/$DSLISTEN.cfg
 Configuration changes are written to the .cfg file
 Dynamic & Static configuration parameters
 Dynamic parameter changes take effect immediately
 ‘number of user connections’
 Static parameter changes take effect when the server is
restarted
 ‘max network packet size’
 170 dynamic, 49 static configuration options

32 October 7, 2004
ASE MEMORY COMPONENTS

OS and Other programs

Adaptive Server executable


Internal
Kernel structure Structures
Machine’s
Physical Server Structure
Memory Adaptive Max
Configurable
Server Allocated Memory Object Pool Parameters Memory
Total
Logical Memory Object Pools
Memory
Procedure Cache

Cache
Data Cache

33 October 7, 2004
max memory

 ‘max memory’ is a configuration parameter specifying the


maximum size of physical memory in 2K pages that
Adaptive Server can allocate
 The default value is platform specific
 max memory is the most shared memory that can be used
by the server
 The parameter is dynamic

34 October 7, 2004
total logical memory

 ‘total logical memory’ is a read-only configuration


parameter indicating the size of memory required to
satisfy the current configuration
 total logical memory cannot exceed max memory

35 October 7, 2004
NON-CACHE MEMORY
 ASE executable
 Non configurable
 Kernel structures
 Used by the server during runtime to store internal
information
 Non configurable
 Server Structures
 Used to store information about user connections,
databases in use, available locks, and so on
 Configurable
 Memory Object pools
 Blocks of memory from which smaller memory segments are
allocated dynamically
 Non configurable, though size related to max memory

36 October 7, 2004
PLANNING MEMORY CONFIGURATION

When planning memory configuration, do the following in order:

1.Maximum memory
 Determine the total memory available for the ASE server
 Configure ‘max memory’ to that amount
2.Server structures
 Determine how you will set the configuration parameters that use
large amounts of memory
 Configure these parameters as appropriate
3.Procedure and data cache
 Determine the appropriate size for each cache
 Configure ‘procedure cache size’
 Configure data cache using sp_cacheconfig

37 October 7, 2004
DEVICES

 Adaptive Server allocates database resources through a


mechanism known as devices. Before databases can be
created, the devices on which they will be created must be
initialized.
 A database device is a physical resource that stores the
objects that make up the database
 The term “device” does not necessarily refer to a distinct
physical device
 It can be any piece of disk, such as disk partition
 It can be a file in the operating system

38 October 7, 2004
TYPES OF DEVICES

 Installation devices
 The master device
 This device initially stores the master, model, tempdb, and
sybsystemdb system databases
 All of these databases except for master can be moved or
expanded off the master device
 The sysprocsdev device, which stores the sybsystemprocs
database
 SA-defined database devices
 These devices store user databases
 These devices can store system databases except for master
 Dump devices
 These devices are used for database and transaction log dumps,
such as tape devices

39 October 7, 2004
INITIALIZING DEVICES

 Device initialization is a process that prepares the device for


storage and makes it known to the server
 A device must be initialized before it can be used
 Once the device has been initialized, it can be used to store:
 Databases
 Specific database objects
 Database transaction logs
 Devices are initialized using the disk init command
 Maps the specified physical disk device or operating system file to a
database device name
 Lists the new device in master..sysdevices
 Prepares the device for database storage
 Only System Administrators can execute disk init
 disk init name=‘test_device’,
physname=‘/opt/sybase/test_dev.dat’,size=’50M’
 Can also be created using Sybase Central

40 October 7, 2004
PREREQUISITES TO CREATING A DB

 Before creating a database, decide:


 The size of the database
 The device(s) to use and is space available
 If a separate log device is needed and, if so, what size
 Databases are easy to expand, but cannot be directly
shrunk
 To shrink a database, you must copy the data out, recreate
the database, and copy the data back in
 When planning the size, consider mainly tables, indexes
and transaction logs
 Leave some free space for unanticipated activity/growth

41 October 7, 2004
CREATING DATABASES

 model acts as a “template database”


 The contents of model are always copied to the new database
 You can create stored procedures, tables, rules, user-defined
datatypes, users, privileges, and options in model
 All future databases automatically inherit these objects and
options
 System tables in master affected by database creation:
 sysdatabases
 Contains a row for every database on Adaptive Server, which
specifies the database name and owner
 Specifies a database ID, dbid, for each database
 sysusages
 Contains a row for every database fragment, indicating the size
and logical starting disk address for that fragment
42 October 7, 2004
DATABASE SIZE

 The ‘default database size’ configuration parameter specifies


the size of a database in MB when no size is given during the
database creation
 ‘default database size’ defaults to 2, meaning 2MB on a 2K page
size server
 create database test
 Creates a 2MB database with data and log on a “default” device
 create database test on test_device
 Creates a 2MB database with data and log on the same device
 create database test on test_device = 8 log on log_device = 2
 Creates a 10MB database with 8MB for data and 2MB for log, each on
different devices

43 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

44 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

45 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

46 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

47 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

48 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

49 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

50 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

51 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

52 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

53 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

54 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

55 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

56 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

57 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

58 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

59 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

60 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

61 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

62 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

63 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

64 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

65 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

66 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

67 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

68 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

69 October 7, 2004
TEMPORARY DATABASES

 tempdb database
 Used for temporary tables and work tables (sorts, joins, etc)
 Contention on the system catalog tables
 Can run out of space, affects everyone on the ASE server
 ASE 12.5.0.3 added Multiple Tempdbs
 Splits up the load to reduce contention
 One full tempdb doesn’t affect all server users
 Can setup a specific tempdb for ‘sa’ use
 Helpful to diagnose problems when other tempdbs fill

70 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

71 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

72 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

73 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

74 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

75 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

76 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

77 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

78 October 7, 2004
SYBASE CENTRAL WALKTHROUGH

79 October 7, 2004
INSTALL pubs2 DATABASE

 Install the pubs2 database using the supplied script


 cd $SYBASE/ASE-12_5/scripts
 isql –S p1252x –U sa –P –i installpubs2 –o pubs2
 Script creates a 3MB database on a ‘default’ device
 For examples of using the
pubs2 database, see the various
ASE manuals

80 October 7, 2004
NEXT STEPS

 You are now ready to start defining database objects,


logins, stored procedures, etc.
 Sybase Education fills in the holes
 Fast Track to ASE, System and Database Admin, more…
 www.sybase.com/education
 Sybase Professional Services (SPS)
 Evaluation, Migration, Performance & Tuning
 Tech Support
 www.sybase.com/support
 Support contract needed for some of the site areas

81 October 7, 2004
MICHAEL PEPPLER
PRINCIPAL CONSULTANT

DATA MIGRATIONS, INC.


ENTERPRISE vs. FREE LINUX

 ASE is certified on Enterprise version of Linux


 ASE runs fine on almost all relatively recent distros:
 RedHat 7.2, 7.3, 8.0
 Does NOT run on RH 9 due to a bug in glibc
 Fedora Core 1 and 2
 Gentoo
 Others

83 October 7, 2004
FEDORA CORE 1 and 2

 Very similar to Red Hat Enterprise 3.x


 The following packages must be installed:
 Recent Java JVM for the Sybase installer
 e.g. j2sdk-1.4.2_05-fcs from java.sun.com
 compat-libstdc++
 kernel.shmmax set to at least 67108864 (64MB).
 Raw devices can be configured in the usual way.

84 October 7, 2004
GENTOO

 Similar basic requirements:


 Recent java package (for example the dev-java/blackdown-jdk
package.)
 sys-libs/lib-compat for the libstdc++ libraries.
 kernel.shmmax set to 64MB or more.
 To use raw devices these must be configured in the kernel
(CONFIG_RAW_DRIVER).

85 October 7, 2004
GENTOO CONFIGURATION

 Gentoo is basically a source distribution – ASE depends on


glibc being correctly configured:
 /etc/make.conf must have the correct CFLAGS and CHOST
settings:
 CFLAGS should include “-march=i686”
 CHOST should be set to “i686-pc-linux-gnu”
 If ASE fails during start-up with an “infected with 11”
message, it is almost certainly due to an incorrect glibc
build.

86 October 7, 2004
QUESTIONS AND ANSWERS

You might also like