Sei sulla pagina 1di 14

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.

com

TZASE / ADM540
Database Administration

Sybase ASE

TZASE is an Early Product Training (EPT).


The content of ADM540 will be based on TZASE and will be largely similar.

Material number: 50110995

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
1

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Agenda

Introduction
Installing ASE
Login, Users, Roles
Data Storage
Databases
Backup and Restore
Architectural Overview
ASE Shared Memory
Configuring ASE for SAP Business Suite
DB Monitoring and Administration

2012 SAP AG. All rights reserved.

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
2

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Database Administration - Sybase ASE

Introduction

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
3

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
What is Sybase ASE (Adaptive Server Enterprise) ?
Sybase ASE (Adaptive Server Enterprise) is a Relational Database Management
System, comparable to Informix Dynamic Server, MaxDB, Microsoft SQL Server and
DB2 UDB (LUW).
It is particular popular at companies in the financial market serving custom financial
applications.
SAP Business Suite was made available on Sybase ASE after SAP bought Sybase Inc.
Sybase ASE should not get mixed up with Sybase IQ (a column based database system
used for analytical applications) or Sybase Replication Server ( a software which may
be used to replicate transactions across database servers)

2012 SAP AG. All rights reserved.

A bit of history
1984

Sybase Inc. is founded

1988

first RDBMs is released as Sybase SQL Server 3.0

1992

Version 4.8 supports multiple engines (server processes) boost


performance on Symmetric Multi Processor (SMP) machines.

1994

Microsoft launches Microsoft SQL Server, based on a copy of the


4.2 Sybase code.

1997

version 11.5 is renamed to Adaptive Server Enterprise ASE (to


distinguish more clearly from MSSQL)

1998

ASE 11.9 introduces Row Level locking (previously the task of


locking items was placed on application side)

2005

ASE 15.0 gets released, with a complete redesign of the query


optimizer and support for semantic data partitioning

2010

SAP buys Sybase and the project SAP on Sybase is started

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
4

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
Sybase Editions
Express Edition
unsupported , 'free' edition for SME

Development Edition
unsupported , free , for developers

Small Business Edition


supported , limited

Enterprise Edition
optional additional features available (for extra money)

Sybase ASE Cluster Edition


Enterprise Edition
comparable to ORACLE RAC / DB2 Pure Scale

Sybase Software Asset Manager (SySAM)


ASE comes with a Sybase Software Asset Manager (SySAM)

used to check editions and features you use


uses license file you need to provide
SySAM directory is in $SYBASE/SYSAM-2_0 (local)
it is also possible to have a central Sybase license manager in a network

2012 SAP AG. All rights reserved.

Sybase ASE is available in four editions, which are technically all the same, some features are
disabled though in the Express, the DE and the SMB Edition.
Sybase ASE Cluster Edition provides the ability to configure several ASE Servers commonly using
a shared disk . In that aspect it is comparable to Oracle RAC and DB2 Pure Scale.
Sybase ASE Cluster Edition is not yet available with SAP and will not get covered in this course.

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
5

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
ASE Versioning
Major Release
e.g. 15.7

Minor Release
15.7.1 the .1 is the Minor release number.

ESD Electronic Software Delivery


A patch for ASE , which contains a number of bug fixes and which received some QA testing at Sybase.
ESDs are cumulative.

IR Interim Release
kind of super ESD increases the minor release number

EBF - Electronic Binary Format


Actually the meaning of EBF changed over time , sometimes used interchangeably with ESD .
EBF number (in Sybase Version string uniquely identifies a build)

N-OFF
Build based on an ESD or another n-off build which contains one or few urgent bug fixes for customers who
cant wait until the next ESD gets released.

N-OFFs at SAP will probably be cumulative

2012 SAP AG. All rights reserved.

ASE Versions
A major release usually contains many new features and may bring changes to system tables, which requires
conversion of existing databases. Hence, a downgrade to a previous major version is often not easy .
A minor release does often contain new features but no changes to system tables, a downgrade to a previous
minor release of the same major release is usually possible
The term ESD refers to 'Electronic software delivery' , it is a collection of fixes for software defects. Usually
any one minor release receives several ESDs on top. These are cumulative, i.e. you can install ESD #4
directly without the need to install ESD 1,2 and 3.
An Interim Release is a kind of super ESD, it does increase the minor release number, but somewhat less
than a true minor release.
EBF refers to 'Electronic Binary Format' , the EBF number of a build uniquely identifies the build and the
software level. EBF number is unique, i.e. same software level , different platform (e.g. Windows vs. Linux )
will have different EBFs . The EBF number is displayed in the ASE version string.
N-OFF refers to an emergency build based on an ESD or another N-OFF . N-OFFs are delivered to
customers as a temporary solution for a software defect, when a customer can't wait until the next regular
ESD, which contains a fix.
You can retrieve the Information of your Sybase ASE Version within the isql command line tool by executing
select @@version or select @@sbssav. The ASE version can also be determined also in DBACOCKPIT
(Tab : ASE Status
Versions)

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
6

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
ASE Server

UNIX (or Windows) host


ASE Server
(dataserver process(es) , shared memory

master
database

system
databases
user
databases

2012 SAP AG. All rights reserved.

An ASE database server 15.7 consits of a dataserver process which spawns several lightweigth
processes (POSIX or OS threads), its shared memory and a defined set of disk devices it uses to
persistently store its data.
On Windows the ASE server process is called sqlsrv.exe. It spawns multiple NT threads.
In this course when we speak of an ASE database server or an ASE server instance, we refer to
the running server process, not the UNIX or Windows host on which the ASE server runs on.
One ASE database server can (and usually does) manage multiple databases.
Multiple ASE server instances may run on a single host, however, in production environments it is
common to have a dedicated host for a database server .

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
7

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
System Databases

ASE Server Instance 'P01'


master

model

dbccdb

sybsecurity

sybsystemd
b

sybsystemprocs

tempdb

sybmgmtdb

saptools

P01

2012 SAP AG. All rights reserved.

System Databases
An ASE server comes with a couple of system databases inside the ASE server. These are used
by ASE to manage ist own metadata.
Some of the system databases are mandatory and are created when the ASE server is
instantiated, these are required for proper functioning of the system.
Mandatory system databases
master
ASE's boot sector
model
template database for all other databases
tempdb
system temporary database
sybsystemprocs
stores server wide system 'stored procedures'
sybsystemdb
used for distributed transactions and Sybase two-phase
commit protocol (not used in SAP Environment)
Additional system database (not mandatory)
sybmgmtdb
job scheduler database (mandatory for SAP instances)
dbccdb
stores data generated by 'dbcc' checktool
sybsecurity
auditing database
Neither the 'sybsecurity' nor 'dbccdb' database are created by default
The master database stores information about user databases , devices, ASE server logins and
roles. You must be in the master database to issue certain commands such as 'create database',
'alter database', 'disk init' and some other. The minimum size of your master database depends on
your server's logical page size. The master database must contain at least 6656 logical pages, so
its minimum physical size for page size 16k is 104MB
ASE server in SAP environment always use 16k page size.
The databases 'saptools' and 'P01' in the picture are user databases.

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
8

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
System tables in the master database

master
sysdatabases

sysdevices

syslogins

sysusages

sysmessage
s

sysengines

.. more tables

2012 SAP AG. All rights reserved.

syslocks

sysprocesse
s

System tables in the master database


System tables in the master database store server wide information
Some are real tables which store ASE metadata, some tables are virtual, the latter provide an SQL
interface to server runtime state.
Examples:
User accounts / logins
Remote servers that this server can interact with
System error messages
Databases on Adaptive Server
Storage space allocated to each database
Tapes and disks mounted on the system
Character sets
Languages
Users who hold server-wide roles
Server roles

syslogins
sysservers
sysmessages
sysdatabases
sysusages
sysdevices
syscharsets
syslanguages
sysloginroles
syssrvroles

Runtime Information:
Ongoing processes
Active locks
Adaptive Server engines that are online
Current ASE server configuration

sysprocesses
syslocks
sysengines
syscurconfigs

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
9

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
Database System Catalog

P01
sysobjects

syscolumns

sysusers

.. more system catalog tables

sysindexes

user_table_1

user_table_n

2012 SAP AG. All rights reserved.

10

Each database has a couple of system catalog tables of ist own. System catalog tables that are
created in every database store database specific metadata and provide an SQL interface to the
database specific metadata.
Examples:
sysusers

store information about database users


(has a foreign key relation to master..syslogins)

sysobjects

database objects (tables, procedures, )

sysindexes

information about indexes

syscolumns

stores information about columns

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
10

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
System stored procedures
System table data are usually viewed and managed through system stored procedures
Most administrative tasks can be accomplished using system stored procedures,
this enables remote administration when being connected to ASE with an SQL client, no local login is
necessary.

naming convention for system stored procedures is 'sp_<something>'


Examples:
sp_help, sp_dropdevice, sp_configure

ASE searches for a 'sp_<something>' stored procedure in


1. current database
2. sybsystemprocs
3. master
4. if still not found returns a error

For non 'sp_' procedures only the current database is checked


unless database is specified in call to stored procedures
e.g. 'EXEC saptools..sp_dumptrans' , executes stored procedure sp_dumptrans in database saptools

2012 SAP AG. All rights reserved.

11

Some important stored procedures you will probably need are:


sp_configure - display and change ASE configuration
sp_helpdb display information about databases
sp_helpdevice display information about devices
sp_ddlgen generate the DDL for a database
sp_who display information about who's logged into the server
sp_lock display information about locks hold and waited for
Within a normal SAP Installation there are around 700 stored procedures
available to perform the different tasks and there can be added own
procedures where required.

backup the database with your own procedures !

~633 procedures in sybsystemprocs


~ 55 procedures in sybmgmtdb (e.g. Job Management)
~ 15 procedures in master
~ 15 procedures in saptools
[~ 18 procedures in dbccdb]

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
11

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
Sybase ASE Directory Structure
Top level directory of the software
installation directory is refered to as
$SYBASE (UNIX) resp. %SYBASE%
(Windows)

ASE15_0

Subdirectories store different components


of ASE.

bin
install
sysam
scripts

$SYBASE

<DBSID>.cfg
OCS15_0
DBISQL
charsets
log
interfaces

2012 SAP AG. All rights reserved.

12

Directory structure
The top directory where you install ASE (and perhaps other Sybase products is referred to as $SYBASE
(UNIX) , resp. %SYBASE% (Windows). Sybase ASE software may get installed in any location, however, in
SAP environment this is always '/sybase/<SID>' (UNIX) resp. <DRIVE>:\sybase\<SID> (Windows). The
directory and all of its contents belong to the local sybase user id with which the software was installed. This
is the user 'syb<sid>' in SAP installations.
Some subdirectories
Directory OCS-15_0 contains the Sybase open client related files. It also contains isql (command line
interactive SQL Editor) and some utilities such as bcp , a tool for bulk copying of large dataset out of or into a
table. OCS_15_0 also contains the runtime libaries for ESQL C.

Directory DBISQL contains the dbisql tool , a graphical SQL Editor.


Directory ASE-15_0 is the main ASE server directory , it contains some subdirectories itself.
The ASE server configuration file <DBSID>.cfg lies here (directly under %SYBASE% on Windows)
ASE-15_0/install contains the RUN_<SERVER> file (more on that later) and the
<SERVER>.log (ASE server error log file).
ASE-15_0/bin contains executables of the server utilities
ASE-15_0/sysam contains license information for the configured ASE server(s)
ASE-15_0/scripts contains additional scripts (installmaster , installjsdb , installdbccdb, )
Directory charsets (directly below $SYBASE) holds installable character sets and codepages.
Directory log contains logs from the installation. Look here when installation of ASE fails. The
directory does not contain the ASE server log , contrary to what one might think.
The directories are called ASE-15_0 , OCS-15_0 , even though we install version 15.7 .

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
12

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
Sybase Environment Variables
$SYBASE / %SYBASE% on Windows
set at installation by administrator
top level installation directory Sybase products

$SYBASE_ASE
set by installation routines, identifies the subdirectory where ASE is installed
it is ASE-15_0 , (even in ASE 15.7)

$DSLISTEN
specifies the name of the default server, if it is not specified in the RUN_SERVER file
required only during server start up
not set per default

$DSQUERY
specifies the server name to use when a client tool is called w/o specifying a server name
not set per default

$SYBASE_OCS
Open client software directory

$JAVA_HOME
needed for some tools, like 'Ribo' (Ribo is a diagnostic tool to trace communication between a Sybase ASE
client and the server)

2012 SAP AG. All rights reserved.

13

On UNIX the correct Sybase environment gets set when sourcing the file $SYBASE/SYBASE.sh.
Review the contents of that file in case you receive error messages that might result from incorrect
environment settings. Check that the file was indeed sourced .
On Windows a corresponding file SYBASE.bat exists, however the important environment
variables are set as system wide environment variables.
To review these, right click on the computer icon on the desktop, choose Properties. In the popup
window go to 'Advanced System Settings'. In the popup 'system Properties' click the button
'Environment variables'. (Windows is so easy and intuitive, isn't it)

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
13

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : sapmaterials4u@gmail.com

Introduction
The Command Line SQL Editor 'isql'
bash-3.00$ isql SP01 -Usapsa -w 1024
Password:
1> select p.hostprocess, p.spid, p.status, count(l.spid) numlocks from
master..sysprocesses p JOIN master..syslocks l on p.spid=l.spidgroup
by l.spid having l.spid = p.spid order by p.hostprocess,p.spid
go
hostprocess
spid
status
numlocks
--------------- ------------------------400
51
recv sleep
127
5755
58
recv sleep
139
7770
60
recv sleep
325
(3 rows affected)

Sybase ASE comes with a command line client- the SQL


editor 'isql'

isql is available on UNIX and Windows


it is possible to run SQL scripts in batch mode

2012 SAP AG. All rights reserved.

14

Sybase ASE comes with an SQL editor 'isql', which is available on UNIX and Windows
isql is able to run SQL scripts in batch mode , output can get redirected to output files.
Example:
isql SP01 -Usapsa -Ppass-DP01 -i input.sql -o output.txt
The above example calls isql, connects to a server P01', username is sapsa , password is
apparently 'pass' , the database it uses is called P01', the input is received from the file input.sql
and the output is stored in output.txt.
A usage is displayed with the 'help' option.
useful options (more options are avaialblewhich are not printed here) :
-b Disables the display of the table headers output.
-c cmdend

Changes the command terminator.

-D database

Selects the database in which the isql session begins.

-I inputfile

Specifies the name of the operating system file to use for input to isql.

-o outputfile

Specifies the name of an operating system file to store the output from isql.

-P password

Specifies your Adaptive Server password.

-S server_name Specifies the name of the Adaptive Server to which to connect to.
-U username

Specifies a login name. Login names are case sensitive.

-w column_width Sets the screen width for output.


Useful are the options w (adapt output width, when using isql interactively at a terminal) and
'b' (to suppress header output when calling isql in shell skripts)

For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com


OR Contact Via Email Directly At : sapmaterials4u@gmail.com
14

Potrebbero piacerti anche