Sap Adm540 Sample

14

Click here to load reader

description

tzase

Transcript of Sap Adm540 Sample

  • TZASE is an Early Product Training (EPT).The content of ADM540 will be based on TZASE and will be largely similar.

    TZASE / ADM540Database Administration ? Sybase ASE

    Material number: 50110995

    1For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 2

    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

    2For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • Database Administration - Sybase ASE

    Introduction

    3For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 4

    Introduction

    What is Sybase ASE (Adaptive Server Enterprise) ?

    Sybase ASE (Adaptive Server Enterprise) is a Relational Database ManagementSystem, comparable to Informix Dynamic Server, MaxDB, Microsoft SQL Server andDB2 UDB (LUW).

    It is particular popular at companies in the financial market serving custom financialapplications.

    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 systemused for analytical applications) or Sybase Replication Server ( a software which maybe used to replicate transactions across database servers)

    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) boostperformance on Symmetric Multi Processor (SMP) machines.

    ? 1994 Microsoft launches Microsoft SQL Server, based on a copy of the4.2 Sybase code.

    ? 1997 version 11.5 is renamed to Adaptive Server Enterprise ASE (todistinguish more clearly from MSSQL)

    ? 1998 ASE 11.9 introduces Row Level locking (previously the task oflocking items was placed on application side)

    ? 2005 ASE 15.0 gets released, with a complete redesign of the queryoptimizer and support for semantic data partitioning

    ? 2010 SAP buys Sybase and the project SAP on Sybase is started

    4For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 5

    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

    Sybase ASE is available in four editions, which are technically all the same, some features aredisabled though in the Express, the DE and the SMB Edition.

    Sybase ASE Cluster Edition provides the ability to configure several ASE Servers commonly usinga 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.

    5For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 6

    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

    ASE VersionsA major release usually contains many new features and may bring changes to system tables, which requiresconversion 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 previousminor release of the same major release is usually possibleThe term ESD refers to 'Electronic software delivery' , it is a collection of fixes for software defects. Usuallyany one minor release receives several ESDs on top. These are cumulative, i.e. you can install ESD #4directly 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 lessthan a true minor release.

    EBF refers to 'Electronic Binary Format' , the EBF number of a build uniquely identifies the build and thesoftware 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 tocustomers as a temporary solution for a software defect, when a customer can't wait until the next regularESD, which contains a fix.

    You can retrieve the Information of your Sybase ASE Version within the isql command line tool by executingselect @@version or select @@sbssav. The ASE version can also be determined also in DBACOCKPIT(Tab : ASE Status? Versions)

    6For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 7

    Introduction

    UNIX (or Windows) host

    ASE Server

    (dataserver process(es) , shared memory

    masterdatabase

    userdatabases

    systemdatabases

    ASE Server

    An ASE database server 15.7 consits of a dataserver process which spawns several lightweigthprocesses (POSIX or OS threads), its shared memory and a defined set of disk devices it uses topersistently 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 tothe 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 iscommon to have a dedicated host for a database server .

    7For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 8

    Introduction

    ASE Server Instance 'P01'

    modelmaster syb-systemd

    b

    syb-mgmt-

    db

    tempdb

    syb-security

    dbccdb sap-tools

    P01

    System Databases

    syb-system-procs

    System DatabasesAn ASE server comes with a couple of system databases inside the ASE server. These are usedby ASE to manage ist own metadata.Some of the system databases are mandatory and are created when the ASE server isinstantiated, 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 defaultThe master database stores information about user databases , devices, ASE server logins androles. 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 onyour server's logical page size. The master database must contain at least 6656 logical pages, soits 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.

    8For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 9

    Introduction

    master

    .. more tables

    sysdatabases

    sysusages

    sysdevices

    syslogins sysprocesses

    sysenginessysmessages

    syslocks

    System tables in the master database

    System tables in the master databaseSystem tables in the master database store server wide informationSome are real tables which store ASE metadata, some tables are virtual, the latter provide an SQLinterface to server runtime state.Examples:? User accounts / logins syslogins? Remote servers that this server can interact with sysservers? System error messages sysmessages? Databases on Adaptive Server sysdatabases? Storage space allocated to each database sysusages? Tapes and disks mounted on the system sysdevices? Character sets syscharsets? Languages syslanguages? Users who hold server-wide roles sysloginroles? Server roles syssrvroles?

    Runtime Information:? Ongoing processes sysprocesses? Active locks syslocks? Adaptive Server engines that are online sysengines? Current ASE server configuration syscurconfigs?

    9For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 10

    Introduction

    Database System Catalog

    P01

    .. more system catalog tables

    sysobjects syscolumns sysusers sysindexes

    user_table_nuser_table_1

    Each database has a couple of system catalog tables of ist own. System catalog tables that arecreated in every database store database specific metadata and provide an SQL interface to thedatabase 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

    10For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 11

    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 isnecessary.

    naming convention for system stored procedures is 'sp_' Examples:

    sp_help, sp_dropdevice, sp_configure

    ASE searches for a 'sp_' stored procedure in1. current database2. sybsystemprocs3. master4. 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

    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 proceduresavailable to perform the different tasks and there can be added ownprocedures 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]

    11For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 12

    Introduction

    ASE15_0

    $SYB

    ASE OCS15_0

    DBISQL

    charsets

    log

    interfaces

    bin

    sysamscripts

    install

    .cfg

    Sybase ASE Directory StructureTop level directory of the softwareinstallation directory is refered to as$SYBASE (UNIX) resp. %SYBASE%(Windows)

    Subdirectories store different componentsof ASE.

    Directory structureThe 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, inSAP environment this is always '/sybase/' (UNIX) resp. :\sybase\ (Windows). Thedirectory and all of its contents belong to the local sybase user id with which the software was installed. Thisis the user 'syb' in SAP installations.Some subdirectoriesDirectory OCS-15_0 contains the Sybase open client related files. It also contains isql (command lineinteractive SQL Editor) and some utilities such as bcp , a tool for bulk copying of large dataset out of or into atable. 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 .cfg lies here (directly under %SYBASE% on Windows)ASE-15_0/install contains the RUN_ file (more on that later) and the.log (ASE server error log file).ASE-15_0/bin contains executables of the server utilitiesASE-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. Thedirectory 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 .

    12For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 13

    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)

    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 incorrectenvironment settings. Check that the file was indeed sourced .

    On Windows a corresponding file SYBASE.bat exists, however the important environmentvariables are set as system wide environment variables.To review these, right click on the computer icon on the desktop, choose Properties. In the popupwindow go to 'Advanced System Settings'. In the popup 'system Properties' click the button'Environment variables'. (Windows is so easy and intuitive, isn't it)

    13For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

  • 2012 SAP AG. All rights reserved. 14

    Introduction

    bash-3.00$ isql SP01 -Usapsa -w 1024Password:1> select p.hostprocess, p.spid, p.status, count(l.spid) numlocks frommaster..sysprocesses p JOIN master..syslocks l on p.spid=l.spidgroupby l.spid having l.spid = p.spid order by p.hostprocess,p.spidgohostprocess spid status numlocks--------------- ---- ------------ -----------400 51 recv sleep 1275755 58 recv sleep 1397770 60 recv sleep 325(3 rows affected)

    The Command Line SQL Editor 'isql'

    Sybase ASE comes with a command line client- the SQLeditor 'isql'

    isql is available on UNIX and Windows it is possible to run SQL scripts in batch mode

    Sybase ASE comes with an SQL editor 'isql', which is available on UNIX and Windowsisql 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.sqland 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)

    14For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]

    For Any SAP / IBM / Oracle - Materials Purchase Visit : www.erpexams.com OR Contact Via Email Directly At : [email protected]