Basic Information (SAP Library - SAP DB)

 Entering content frame

Component documentation Basic Information

Title of the Documentation | Contents
The SAP DB Database System | Introduction to the SAP DB database system: architecture, directory structure, database parameters, database tools, user and security concepts, overview of the documentation, terminology, and so on.
Reference Manual: SAP DB 7.4 | SQL statements and their syntax
SQL Mode ORACLE: SAP DB 7.4 | Special features of SQL statements in the SQL mode ORACLE
System Tables: SAP DB 7.4 | SAP DB system tables and their evaluation
Optimizer: SAP DB 7.4 | Functions of the SAP DB Optimizer
Messages 7.4 | List of all SAP DB messages
Background Knowledge: SAP DB 7.4 | Background knowledge about the SAP DB database system, such as the log concept, B* trees, standby databases

Leaving content frame


The SAP DB Database System (SAP Library - SAP DB)

 Entering content frame

Component documentation The SAP DB Database System

This manual gives you an overview of the database system SAP DB Version 7.4 and its tools.

You can find information about the following topics, among other things:

· Database instance types

· Structure of database instances

· Directory structure of the database system

· Database Files

· Database parameters

· Multiprocessor configuration

· Database tools

· Security concepts

· SAP DB user concept

· Lock behavior

· SAP DB as a UNICODE Database

· Technical Specification of SAP DB Version 7.4

· New Developments in SAP DB Version 7.4

· Supported Operating Systems and Platforms

· Overview of the SAP DB Documentation

For more detailed background knowledge about SAP DB concepts, see also Background Knowledge: SAP DB 7.4

You can obtain the SAP DB software free of charge in the following ways:

· You can download the most current version from the SAP DB homepage http://www.sapdb.org

· You can order a CD-Rom with the material number 50061824 in the SAP Shop: http://www.sap.com/company/shop

· SAP customers receive the SAP installation package that contains the database software.

You can also obtain the required installation descriptions free of charge in the SAP DB documentation.

You can also obtain Support for your SAP DB database system.


Version Notation (SAP Library - SAP DB)

 Entering content frame

Background documentation Version Notation

SAP DB versions are specified according to the version notation:
<major>.<minor>.<cl>.<build>

The specified numbers have the following meanings:

major | single digit version number
minor | single digit version number
cl | two digit correction level
build | two digit build number

In a technical context (such as the SAP Service Marketplace), you can also see the following notation:
 <major>.<minor>.<cl> Build <build>

In this case, the build number is given with three digits.

7.4.03.30and 7.4.03 Build 030 mean SAP DB Version 7.4,
correction level 3, build number 30


SAP DB Support (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Support

You can obtain support for your SAP DB database system in two ways.

Online Support

Online support is based on mutual help between SAP DB users and is free of charge.

To obtain online support, become a member of the sapdb.general@listserv.sap.com mailing list. Describe your questions and problems in an e-mail to this mailing list. Both the SAP DB development team and members of the Open Source community can then reply to you.

Online Support does not guarantee fixed response times. However, the SAP DB development team continually monitors the correspondence in the mailing list and ensures that every problem is responded to.

Premium Support

You conclude a Premium Support Contract with SAP, and then have access to the complete SAP support infrastructure. For communication purposes, you establish a Customer Competence Center with a certain number of contacts.

The fees for Premium Support are EUR 60,000 per year for each Customer Competence Center. If you have already concluded a SAP DB maintenance contract, the fees for your support contract are reduced.

The SAP DB homepage contains further information about support (http://www.sapdb.org/sap_db_support.htm) and how to become a member of the mailing list (http://www.sapdb.org/sap_db_contact.htm).


Database Instance Type (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Instance Type

The SAP DB database system supports different application areas. The SAP DB database instance has different characteristics depending on the application area. The following database instance types exist:

· SAP DB OLTP

· liveCache

· SAP DB Document Server

· SAP DB OLAP

· SAP DB E-Catalog

See also SAP DB versions and database instance types


SAP DB OLTP (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB OLTP

SAP DB is a relational database system that was developed for OLTP (Online Transaction Processing). This database instance type is optimized to process individual transactions fast in environments with a high number of users and large databases.


SAP liveCache (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP liveCache

The database instance type liveCache is only used in SAP applications.

In Supply Chain Management, large volumes of data must be permanently available and changeable. For this reason, an addition has been made to the SAP DB OLTP relational database system to enable actual data structures and data flows (such as networks and relationships) to be mapped more easily and effectively. This product is called liveCache. liveCache is object-oriented and, unlike SAP DB OLTP, operates with its data only in the main memory of the database system, if configured optimally.

For special information, and details about monitoring liveCache, see the Structure link User Manual: liveCache.


SAP DB Document Server (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Document Server

In today’s information landscape, a large amount of data must be processed that does not have the typical format of a relational database, but is unstructured (such as videos, XML documents). SAP DB database instance type Document Server was developed on the basis of the SAP DB OLTP relational database system to ensure that as much of this unstructured data as possible can be processed outside the OLTP database. This can improve the performance of the OLTP database.

One application example is the SAP Content Server.


SAP DB OLAP (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB OLAP

Online Analytical Processing (OLAP) technologies enable you to perform flexible analyses from a variety of business perspectives. It is based on a multi-dimensional data model that is achieved using relational database tables.

An application example of the SAP DB database type OLAP is the Business Warehouse System. In contrast to SAP DB OLTP systems, a Business Warehouse System is configured so that large quantities of historical and operative data can be formatted with acceptable response times.


SAP DB E-Catalog (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB E-Catalog

In Internet catalog applications, a small number of hits must be determined from a large number of product descriptions. The functions of a SAP DB OLTP database instance are enhanced for this purpose, if necessary, to become SAP DB E-Catalog.

An application example of this database instance type is the BugsEye or eMerge product from Requisite.

For this application, the TREX search engine has been integrated into the SAP DB OLTP relational database system. You can use the TREX search engine to index product descriptions (long texts) and search for search terms (exact search, phrase search, fuzzy search, linguistic search).


SAP DB Versions and Database Instance Types (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Versions and Database Instance Types

The following table contains a list of the SAP DB versions of the individual database instance types.

SAP DB Version | Database Instance Type
 | SAP DB OLTP | liveCache | SAP DB Document Server | SAP DB OLAP | SAP DB E-Catalog
7.2.05 | . | . | . | . |
7.3.00 | . |  | . | . | .
7.3.32 |  |  |  |  | .
7.4.01 |  | . |  |  |
7.4.02 |  | . |  |  |
7.4.03 | . | . | . | . | .
7.4.04 | . | . | . | . | .


Database Instances (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Instances

Once you have installed the SAP DB software on a host, you can set up and operate one or more database instances on that host.

When creating a database instance, you can choose between different database instance types, depending on your requirements.

To create and manage your database instance, use the Database Manager database tool.

Structure of the Database Instance

Every database instance consists of threads, main memory structures (caches) and volumes.

This graphic is explained in the accompanying text

Each database instance differentiates between the following areas for the logical storage of data:

· Database catalog

· Application data

You can also find an overview of the main architecture characteristics of the SAP DB relational database system in the Fact Sheet on the SAP DB homepage www.sapdb.org.


Threads (SAP Library - SAP DB)

 Entering content frame

Object documentation Threads

A database instance includes, among other things, a series of operating system threads. Together, they are called the database kernel.

We differentiate between user kernel threads (UKT) and special threads.

The required number of UKTs and of special threads depends on the hardware configuration, the number of volumes used, and the database parameters that were set.


User Kernel Threads (UKT) (SAP Library - SAP DB)

 Entering content frame

Object documentation User Kernel Threads (UKT)

A user kernel thread (UKT) forms a subset of all tasks that fulfill various tasks.

The task states give you information about the current status of a task.

The following are the most important tasks:

· Pager

· Log writer

· Server task

· Timer task

· Trace writer task

· User task

· Utility task


Pager (SAP Library - SAP DB)

 Entering content frame

Object documentation Pager

Pagers (data writers) are tasks in the user kernel thread that is responsible for writing data from the data cache to the data volumes. Pagers are active at every savepoint.

Writing a savepoint can take a long time for a large data cache. In this case, the pagers also become active between the end of a savepoint and the start of the next one, to write the changed data asynchronously.

At a restart, the pagers import the converter pages from the data volumes into the main memory.

The system calculates the number of pagers required. It depends primarily on the data cache size and the number of data volumes.


Log Writer (SAP Library - SAP DB)

 Entering content frame

Object documentation Log Writer

The Log Writer is a task in the User Kernel Thread that writes log entries from the log queue to the log area, for example at a COMMIT. When doing this, the same log page is always written to the same physical space in the log area.

For more information, see Background Knowledge: SAP DB, under Log Concept and Log Writer.


Server Task (SAP Library - SAP DB)

 Entering content frame

Object documentation Server Task

Server tasks are tasks in the user kernel thread that are used primarily for running database functions in parallel. They are required, for example, for backups, restores, and to create indexes.

The number of available server tasks is defined by the special database parameter MAXSERVERTASKS.


Timer Task (SAP Library - SAP DB)

 Entering content frame

Object documentation Timer Task

Timer tasks are tasks in the user kernel thread that handle all types of timeout situations.


Trace Writer Task (SAP Library - SAP DB)

 Entering content frame

Object documentation Trace Writer Task

The database system can write a database trace for diagnosis purposes. The trace writer task in the user kernel thread is used to do this.


User Task (SAP Library - SAP DB)

 Entering content frame

Object documentation User Task

When logging on to the database instance, that is, when opening a database session, each user of the instance or each application is assigned precisely one fixed user task. This task in the user kernel thread is responsible for the processing of SQL statements.

The number of user tasks available is defined by the MAXUSERTASKS database parameter.


Utility Task (SAP Library - SAP DB)

 Entering content frame

Object documentation Utility Task

The utility task in the user kernel thread is reserved solely for managing the database instance.

Since there is only one utility task for each database instance, it is not possible to perform management actions in parallel. An exception to this rule is the automatic log backup. This can be performed in parallel with other management actions.


Task State (SAP Library - SAP DB)

 Entering content frame

Background documentation Task State

The table shows the possible states of the database tasks.

You can view the current task states using the database console, among other things.

AsynClose | Closing input/output channels after backup/restore
AsynCntl | Task determining parameters or initializing backup device
AsynOpen | Opening input/output channels for backup/restore
AsynWait | Task waiting for execution of input/output activity when making backup/restore
Command reply | Task sending result of request to application
Command wait | Task is a database session without request
Connect wait | Free database session
Diaginit | Initializing trace volume
DcomObjCalled | Task is executing database procedure/COM object
Inactive | Task is in initial state and has no resources (such as stack)
InsertEvent | Task generating an event
IO wait | Waiting for I/O (W:write, R:read)
RescheduleMsec | Short-term wait situation; starts running again automatically after specified period (in microseconds)
Runnable | Can run now, but swapped due to long runtime or priority of another task
Running | Running, using CPU
Sus... | Special suspend situations
Terminated | Ending task/terminating database instance, or instance crashing
Vattach | Opening input/output channels (volumes, normal operation)
Vbegexcl | Waiting for protected memory access
Vdetach | Closing input/output channels (volumes, normal operation)
Vdevsize | Determining size or formatting of volume
Vendexcl | Can run again after protected memory access that caused lock collision
Vopmsg | Writing a message to the files knldiag, knldiag.err and/or opmsg[n]
Vrelease | Ending database session between database instance and application
Vshutdown | Operational state of database instance changing from ONLINE to ADMIN
Vsleep | Short-term wait situation; starts running again automatically after specified period
Vsuspend | Waiting for B* tree lock (very short) or log I/O, awoken explicitly
Vwait | Waiting for SQL lock
WaitForEvent | Task waiting for generation of events


Special Thread (SAP Library - SAP DB)

 Entering content frame

Background documentation Special Thread

A database instance has the following special threads, among others:

Clock Thread

It computes internal times; for example, to determine the time needed to execute an SQL statement. It is only used under Microsoft Windows NT.

Console Thread

The console thread processes requests from the Database Console.

Coordinator

The coordinator monitors all threads of the database instance. It is the first active thread when the database instance is started and coordinates the start processes of the other threads. If operating errors occur, the coordinator can stop other database threads.

Dev Threads

Dev threads are responsible for processing the read and write commands from and to data and log volumes that tasks ask to have performed.

The number of dev threads is primarily dependent on the number of volumes in the database instance. Under normal circumstances, two dev threads are activated for every Data Volume and every Log Volume. Only one dev thread is activated for writing the database trace, if it is enabled.

The dev thread dev0 plays a special role here. It coordinates and monitors the other dev threads.

Requester

The Requester accepts user process logons to the database and assigns them to a User Kernel Thread.

temporary dev threads

To perform data backups, temporary dev threads (asdev<i>) are activated for reading and writing data.

Timer

Timer are used to monitor time for timeout control.


Caches (SAP Library - SAP DB)

 Entering content frame

Object documentation Caches

To reduce the number of times that the disk is accessed, read and write operations on the data of a database instance are buffered. The relevant main memory structures are called caches. They can be dimensioned appropriately using the corresponding database parameters.

The following are the most important caches:

· Catalog cache

· I/O buffer cache

¡ Data cache

¡ Converter

· Log queue


Catalog Cache (SAP Library - SAP DB)

 Entering content frame

Object documentation Catalog Cache

The catalog cache of a database instance stores the database catalog objects most recently used by a database session and the internal representation (execution plans) of the most recently executed SQL statements.

One catalog cache exists for each database session. You can configure its size using the special database parameter CAT_CACHE_SUPPLY. The hit rate should be above 85 percent.

Data that is displaced from the catalog cache is stored in the data cache.


I/O Buffer Cache (SAP Library - SAP DB)

 Entering content frame

Object documentation I/O Buffer Cache

When the database instance is started, the I/O buffer cache is created in the main memory in accordance with the size entered in the database parameter CACHE_SIZE.

Its pages are managed using the page pool. A certain number of the pages are made available to the converter, and the other pages are made available to the data cache.

If the converter requires more pages during database operation, the distribution of all I/O buffer cache pages between the converter and data cache is dynamically changed to meet this requirement.


Converter (SAP Library - SAP DB)

 Entering content frame

Object documentation Converter

The converter is used for the assignment of logical to physical data pages. When data pages that are not located in the data cache are accessed, their logical position is first searched for in the converter. The converter then determines the corresponding physical position of the data pages in the data volumes.

The converter is a main memory structure that is shared simultaneously by all active users. Only the converter pages that contain a mapping of permanent data pages are written to the data volumes with each savepoint. In a restart, the pager can use these pages to restore the converter.

The converter is dimensioned dynamically, which means that you cannot set the size of the converter. The required converter pages are taken from the I/O buffer cache, which is used jointly by the converter and the data cache. The size of the I/O buffer cache is determined by the database parameter CACHE_SIZE.

If the converter requires more pages than were originally assigned, the number of data cache pages is reduced accordingly. If the converter requires fewer pages, the free pages are managed via the page pool, and can be used again by the converter if it grows.


Data Cache (SAP Library - SAP DB)

 Entering content frame

Object documentation Data Cache

The data cache contains the last read- or write-accessed pages of the data volumes.

The data cache is a main memory structure that is shared simultaneously by all active users.

The data cache is dimensioned dynamically, which means that you cannot directly influence the size of the data cache. The required data cache pages are taken from the I/O buffer cache, which is used jointly by the converter and the data cache. The size of the I/O buffer cache is determined by the database parameter CACHE_SIZE. If the converter grows, the number of data cache pages is reduced accordingly.

The hit rate, that is the proportion of successful accesses in the total number of accesses, is a crucial measure of performance. Successful access means that the required data was already available in the data cache when it was accessed.


Log Queue (SAP Library - SAP DB)

 Entering content frame

Object documentation Log Queue

The main memory area required for logging is called the log queue. The size of a log queue is determined by the special database parameter LOG_IO_QUEUE.

For a detailed explanation of the log concept, and the tasks of the log queue, see Background Knowledge: SAP DB, under Log Concept.


Volumes (SAP Library - SAP DB)

 Entering content frame

Object documentation Volumes

A volume is a logical grouping of physical storage units (disks). A volume can be a part of a physical disk, a complete physical disk, or a completely structured storage system consisting of several storage units. The disks used should have identical performance parameters (specifically access speeds) to ensure an even filling of the volumes.

The database system differentiates between data volumes and log volumes. Every database instance has one or more log volumes and data volumes. You configure the maximum numbers of data and log volumes that are possible when installing the database instance. If necessary, you can add data or log volumes to a database instance while the database is running.

If database management tools are used (such as the Database Manager), a volume is addressed using a directory path. You can change the directory paths.

Use the Database Manager to manage the volumes.


Data Volume (SAP Library - SAP DB)

 Entering content frame

Object documentation Data Volume

The volumes in which the database content is recorded by pagers are called data volumes. All data volumes together form the data area.

Among other things, the data volumes contain the application data and the metadata of the database catalog.

Managing Application Data

The application data of a table or index can use just one page in the data area as a minimum. A table can extend across all data volumes of the data area as a maximum. A table increases or decreases in size automatically without administrative intervention. As a rule, a database-internal striping algorithm distributes the data belonging to a table evenly across all the data volumes.

It is therefore not possible or necessary to assign tables to the individual data volumes.

For more information, see Data Management Using B* Trees in Background Knowledge: SAP DB

Managing Data Volumes

You can configure one or more data volumes when you install a new database instance. The disk storage space defined by all the data volumes is the total size of the database, and must not fall below 2000 pages.

During database operation, you can add new data volumes. The number of data volumes is limited by the general database parameter MAXDATAVOLUMES.

See also:
Database Manager GUI, section Managing Database Instances
Database Manager CLI, section Adding a Volume

For secure database operation, perform regular data backups .


Data Area (SAP Library - SAP DB)

 Entering content frame

Object documentation Data Area

The total of all data volumes is called the data area.

In the data area, there must always be sufficient space to hold all the data that arises during database operation.


Log Volume (SAP Library - SAP DB)

 Entering content frame

Object documentation Log Volume

The volumes in which all changes to database content are recorded by the Log Writer are called log volumes. All log volumes form the log area.

Managing Log Volumes

You can configure one or more log volumes when you install a new database instance.

During database operation, you can add new log volumes. The number of log volumes is limited by the general database parameter MAXLOGVOLUMES.

Database Manager GUI, section Managing Database Instances
Database Manager CLI, section Adding a Volume

Log Backups and Log Settings

The log entries are needed to allow database content to be restored if a media device fails. To ensure uninterrupted and secure database operation, you must ensure that there is always enough space available in the log area, and that the log entries are regularly backed up.

You should therefore always perform log backups or activate the automatic log backup. You should therefore also choose the corresponding log settings.

You must match the size of the log segments, the size of the log volume, and the capacity of the backup media to each other.


Log Area (SAP Library - SAP DB)

 Entering content frame

Object documentation Log Area

The volume memory area used for logging is called the log area. A log area can extend across several log volumes.

For information about the log concept, see Background Knowledge SAP DB, Log Concept

Mirroring the Log Area

For security, the log area should always be mirrored. If possible, you should mirror the log area on a hardware basis.
If hardware-based mirroring is not possible, you can use an appropriate log mode setting. In a production database system, make sure that redo log management is always activated, and that the log area cannot be overwritten until it has been backed up (Log Settings).

Backing Up the Log Area

A full log causes the database to stop. Therefore, you must always carry out log backups in good time. For this purpose, activate automatic log backup.

In log backups, the log area is not saved as a whole. Instead, it is saved in backup units, called log segments.


Log Segment (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Segment

In log backups, the log area is not saved as a whole. Instead, it is saved in backup units, called log segments.

The size of a log segment is defined by the general database parameter LOG_SEGMENT_SIZE and has the following meaning:

· It determines in what size parts the log entries are saved during interactive log backups.

· It also determines the threshold value for automatic log backups at which the backup of the log area is triggered.

The size of the log segment depends on the size of the individual log volumes and must not be greater than the sum of all log volumes. The size should be selected so that enough space remains in the log area during the backup of a log segments to ensure that the changes taking place at the time can also be recorded.

User-defined value | Log segment sizes used by the system
No definition of log segment size ( LOG_SEGMENT_SIZE = 0) | A third of the total log area.
The log segment size in pages is smaller than or the same as 50% of the title log area. | The defined value for LOG_SEGMENT_SIZE.
The log segment > 50% of the total log area. | 50% of the log area.


Database Catalog (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Catalog

The database catalog of a database instance consists of metadata in which definitions of database objects such as Basis tables, view tables, synonyms, value ranges, indexes, users, and user groups are stored.

The database catalog is made up of the following sections:

· Information about the installation of the database system and metadata with the definitions of users and user groups
This part is not assigned to any user or any user group.

· Metadata for the objects that have been created by a user or a user group
This includes metadata about basis tables and view tables.

A user can only access the metadata of another user or another user group if authorized to do so. See also: User Concept


Application Data (SAP Library - SAP DB)

 Entering content frame

Object documentation Application Data

The application data of a database instance are all the rows of all base tables and all the index entries created for the base tables.


Directory Structure of the Database System (SAP Library - SAP DB)

 Entering content frame

Component documentation Directory Structure of the Database System

How the directories required for the SAP DB database system are distributed to the available hard disks has a significant impact on the security and performance of your database system. A good distribution of files on the hard disk must meet the following requirements:

· There must be enough free space to allow the database to expand

· The data must be stored securely

· The hardware must meet the performance requirements

The optimum design of the directory structure depends upon the specified hardware configurations. There is no single solution or definition for the distribution of the files of an SAP DB database instance.

When attempting to find the optimum data distribution for your database environment in a production system, bear in mind the information in the following sections:

· Availability

· Performance Requirements

· Various Database Systems

· SAP DB directories


Performance Requirements (SAP Library - SAP DB)

 Entering content frame

Background documentation Performance Requirements

For performance reasons, each of the different types of volume should be stored on a different disk. Therefore, create data volumes and log volumes on different disks. Because all changes to the database instance are logged in the log areas , it is the log volumes for a database instance that see the most write activity.

Even when you use RAID-5 systems, configure the database instance with multiple data volumes. Performance will be better with many data volumes than with a single one, because some parallel mechanisms used by the database system depend on the number of configured data volumes.

For performance reasons, the log volumes must not be created on RAID-5 systems but only on dedicated disks or RAID-1 systems.

If swap or paging areas and log entries are kept on the same disk, performance will be negatively affected.

On UNIX systems, you should use raw devices for the data volumes and log volumes, because accessing data in raw devices is generally quicker than accessing data in files.

In the example illustrated below, the data volumes and the log volumes are stored on different disks. The log volumes are mirrored.

This graphic is explained in the accompanying text


Using Multiple Database Systems (SAP Library - SAP DB)

 Entering content frame

Background documentation Using Multiple Database Systems

For performance reasons, the SAP DB database system should not be installed on the same computer along with other database systems.

IF you want to install multiple SAP DB database instances, then install each database instance on a separate computer. This allows you to deal with any performance problems more effectively.


SAP DB Directories (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Directories

The following table contains the distribution of the SAP DB directories on the hard disk for a database instance.

Directory name | Description
<independent_data_path>/config | Configuration directory that, among other things, contains configuration files for database parameters, database tools, and files for user authorization
<independent_data_path>/wrk/<database_name> | Default value for the run directory of the database instance <database_name> that, among other things, contains the log files
<independent_program_path> | Directory with the following content: · Programs Independent of the Database Software Version · Libraries for the Client Run-Time Environment
<dependent_path> | Directory that contains the programs that are dependent on the database software version

The following directories are also relevant for SAP DB database instances in SAP systems:

/sapdb/<database_name>/data | Directory for data volumes
/sapdb/<database_name>/log | Directory for log volumes and mirrored log volumes
/sapdb/<database_name>/save | Directory for backup files of log backups and data backups

You can install the database tools supported by SAP DB on the database host or onto a computer of your choice. You can choose any installation directory.

See also:

Variables

Example Directory Structure

Displaying SAP DB Directories

Defining SAP DB Directories


Run Directory (SAP Library - SAP DB)

 Entering content frame

Object documentation Run Directory

The log files are stored in the run directory. The directory is specified with the general database parameter RUNDIRECTORY and created by the database system when installing a new database instance .

The default value for the run directory is <independent_data_path>/wrk/<database_name>

The log files in the run directory are overwritten at a restart after a database crash. Older log files are therefore moved to the directory <diag_history_path>. The default value for this directory is <rundirectory>/DIAGHISTORY.

See also SAP DB Directories


Programs that Are Independent of the Database Software Version (SAP Library - SAP DB)

 Entering content frame

Background documentation Programs that Are Independent of the Database Software Version

Programs that are independent of the database software version are only installed once for each computer, since they are needed for the database services that exist for each computer.

The programs that are independent of the database software version are situated in the SAP DB directory < independent_program _path>.

In this directory and its subdirectories, you will always find the programs for the most recently installed version of the database software.

/sapdb/indep_prog/bin/x_server
(version-independent program X server)

/sapdb/indep_prog/pgm/dbmcli
(version-independent program Database Manager CLI)


Programs that Are Dependent on the Database Software Version (SAP Library - SAP DB)

 Entering content frame

Background documentation Programs that Are Dependent on the Database Software Version

The programs that are dependent on the database software version are installed once per database instance. This means that the database software version of a database instance is independent of the database software versions of other database instances running on the same machine.

The programs that are dependent on the database software version are situated in the SAP DB directory <dependent_path>.


Libraries for the Client Run-time Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Libraries for the Client Run-time Environment

The libraries required for the client run-time environment are installed once on each computer, but must be available in different versions.

The libraries are stored in a subdirectory of the SAP DB directory <independent_program_path>/runtime/<version>.


Example Directory Structure (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example Directory Structure

Example for the structure of the SAP DB directory

This graphic is explained in the accompanying text


Displaying SAP DB Directories (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying SAP DB Directories

You can use the following Database Manager CLI commands to display the paths for the SAP DB directories:

Directory name | Database Manager CLI Command
<independent_data_path> | dbm_getpath indepdatapath
<independent_program_path> | dbm_getpath indepprogpath
<dependent_path> | db_enum


Defining the SAP DB Directories (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining the SAP DB Directories

You can use the following Database Manager CLI commands to define the paths for the SAP DB directories:

Directory name | Database Manager CLI Command
<independent_data_path> | dbm_setpath indepdatapath <independent_data_path>
<independent_program_path> | dbm_setpath indepprogpath <independent_program_path>
<dependent_path> | inst_reg <dependent_path>


Database Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Files

The system creates a range of files for each database instance. These files are stored in various locations in the directory structure of the database system, depending on their file types.

The following file types exist:

· Log files

· Configuration files


Log Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Files

SAP DB has different classes of log files. The table below shows which log files are generated by the database instance. The files are stored in the run directory and its subdirectories.

File name

Log class

File Content

knldiag
( KNLDIAG)

protocol

Current kernel log; this log is created when the database instance is started with the size specified in the special database parameter KERNELDIAGSIZE.

Messages about starts in the operational state ADMIN are not overwritten cyclically.
Messages from the normal operation are overwritten cyclically.

knldiag.old
( KNLDIAGOLD)

protocol

Last kernel log.

Each time the database instance is started, the file knldiag is renamed to knldiag.old.

knldiag.err
( KNLDIAGERR)

protocol

Kernel error messages

This file is not overwritten. New error messages are added to the end of the file.

knldiag.evt
 (KNLEVT)

protocol

Log of database events

knltrace
(KNLTRC)

dump

Log file of the database trace

This file can also contain information about the causes of crashes. This file is initialized each time the database instance is started.

<database_name>.prt
(KNLTRCPRT)

protocol

Test version of database trace

knldump
( KNLDUMP)

dump

Backup of the main memory information after a database crash

rtedump
( RTEDUMP)

dump

Memory dump from runtime environment of database instance

<database_name>.pah
( DBMPAHI)

protocol

History of database parameters

The following log files also exist:

dbm.*
dbahist.prt

Database Manager Log Files

loader.prt

SAP DB Loader Log File

xserver.prt

X-Server log file

SAPDB<profile>_install-
<date>-<time>.log

Log of the Standard Installation or the Update of the database software

These files belong to the liveCache database instance type (only in SAP systems):

lcinit.log | Start or initialization of liveCache with CCMS functions from the SAP system
lcinit.his | History of all liveCache actions Information from the log lcinit.log is added to this file.
lc<token> | Log of liveCache activities


Classes of Log Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Classes of Log Files

Log files can have the following classes:

protocol | General log files
backup | Log files for backups and restores
lvc | Special log files for the database instance type liveCache
dump | Memory dumps


Database Trace (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Trace

You can activate a database trace. When you do this, the trace writer task logs all reactions of the database kernel to database statements in the log file knltrace.

You can use a database trace to detect errors when processing the statements. You can also use the trace to classify inconsistencies caused by hardware errors more exactly.

Only activate a database trace if you are asked to do so by the SAP DB Support team. We do not recommend that you activate the trace function unless it is really necessary, because it seriously affects the performance of the database instance.

While the database trace is activated, run the database instance with the smallest load possible, and only perform those actions needed to reproduce the error.

Deactivate the database trace as soon as the actions needed for the analysis have been logged.

Procedure

Database Manager GUI, section Activating the Database Trace
Database Manager CLI: SAP DB 7.4, section Database Trace Functions
Database Administration in CCMS OLTP, Database Trace


Configuration Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Configuration Files

The system creates separate configuration files for each database instance in the SAP DB Directories.

The following configuration files exist:

· The configuration file with the database parameters

The file <database_name> is stored in the directory <independent_data_path>\config\<database_name>.

The history of the database parameters is part of the log files.

· Configuration files of the database tools: Configuration Files of the Database Manager


Database Parameters (SAP Library - SAP DB)

 Entering content frame

Component documentation Database Parameters

Use database parameters to define various characteristics of the SAP DB database instance. When you install the database software, a default configuration is stored. This configuration is basically runnable. If necessary, you can adjust the database parameters originally set to suit any specific requirements you may have.

Alternatively, you can use the configuration of a database instance already present on the host or the configuration from a complete data backup. Even after this you can still adjust the database parameters to suit your own requirements.

The database parameters are divided into the following groups:

· General database parameters

· Special database parameters

· Support database parameters

Support parameter do not need to be and should not be changed for normal database operation. The setting of these database parameters requires a detailed knowledge of the database system, and should therefore only be carried out by the SAP DB Support team.

Displaying and Changing Database Parameters

You can use the Database Manager to display or change database parameters.

· Displaying and Changing Database Parameters with the Database Manager GUI

· Configuring Database Instances with the Database Manager CLI

Changes take effect only after you have restarted the database instance.


General Database Parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation General Database Parameters

The following database parameters specify general database properties:

CACHE_SIZE | see CACHE_SIZE
INSTANCE_TYPE | Database instance type OLTP OLTP LVC: liveCache BW OLAP CS Document Server EMERGE: SAP DB E-Catalog
KERNELVERSION | Version of the database software
LOG_SEGMENT_SIZE | Size of a log segment in pages
MAXBACKUPDEVS | Maximum number of files or tape devices in a Group of Parallel Backup Media The maximum value for MAXBACKUPDEVS is 32.
MAXCPU | See MAXCPU
MAXDATAVOLUMES | Maximum number of data volumes
MAXLOCKS | Maximum number of entries in the lock list, in which the locks of all users and their lock requests are stored
MAXLOGVOLUMES | Maximum number of log volumes
MAXUSERTASKS | see MAXUSERTASKS
RESTART_SHUTDOWN | see RESTART_SHUTDOWN
RUNDIRECTORY | Run directory of the database instance

You can display more information about the parameters with the Database Manager.


CACHE_SIZE (SAP Library - SAP DB)

 Entering content frame

Object documentation CACHE_SIZE

The general database parameter CACHE_SIZE denotes the size of the I/O buffer cache in pages .


MAXCPU (SAP Library - SAP DB)

 Entering content frame

Object documentation MAXCPU

The general database parameter MAXCPU denotes the maximum number of CPUs allowed on the database instance. MAXCPU defines over how many CPUs the user tasks generating the main load are distributed.

When defining MAXCPU, however, remember that operating system resources must also be available for other processes.

This means you can define and also restrict the number of CPUs the database instance uses for user tasks on multiprocessor computers (Multiprocessor Configuration).

If you are using a single processor computer, you should choose a value of 1 for the MAXCPU.


MAXUSERTASKS (SAP Library - SAP DB)

 Entering content frame

Object documentation MAXUSERTASKS

The general database parameter MAXUSERTASKS denotes the maximum number of users that can work on a database at any one time ( user tasks , database sessions ).

Overconfiguration exceeding the actual requirement leads to increased demands on address space, especially shared memory.

Once the number of configured database sessions is reached, no other users can connect to the database instance concerned. The number of active database sessions is therefore a critical parameter of database operation and must be monitored.


RESTART_SHUTDOWN (SAP Library - SAP DB)

 Entering content frame

Object documentation RESTART_SHUTDOWN

The general database parameter RESTART_SHUTDOWN determines whether database instance modes should be changed automatically or not.

The database parameter only takes effect if you are using a Windows operating system (NT, 2000, XP).

  • Manual: All changes to the mode of the database instance must be initiated by the DBA.
  • Auto: The following changes are made to the database instance automatically:
    The Windows Service Manager switches the database instance straight to     operating mode ONLINE when it starts.
    A database instance in ONLINE mode will be shut down automatically if the operating system shuts down.

Since the shutdown of an operating system is subject to a time limit, it may interrupt the automatic shutdown of a database instance, particularly if you are working with large database instances where a high volume of data is being changed.

If you restart the database after the shutdown was interrupted, you must import log entries to restore the database instance. We therefore recommend you set the database parameter RESTART_SHUTDOWN to manual.


Special Database Parameters (Extended) (SAP Library - SAP DB)

 Entering content frame

Background documentation Special Database Parameters (Extended)

The following parameters are database parameters that specify special database properties:

_EVENT_ALIVE_CYCLE | The time in seconds of an event cycle
_MAX_MESSAGE_FILES | Maximum number of trace files that can be open simultaneously
_MAXEVENTS | Maximum number of events stored by the kernel in the cache for processing by the Database Manager
_UNICODE | see _UNICODE
CAT_CACHE_SUPPLY | Size of catalog cache memory for all user tasks in pages
DATE_TIME_FORMAT | System default for the date and time format
DEADLOCK_DETECTION | Maximum search level for deadlock detection. Deadlocks that have not been detected by the deadlock detection up to the given search level of the specified value are only resolved by the parameter REQUEST_TIMEOUT. If DEADLOCK_DETECTION = 0, deadlock detection is disabled.
DEFAULT_CODE | See DEFAULT_CODE
DEVNO_BIT_COUNT | See DEVNO_BIT_COUNT
DIAG_HISTORY_NUM | Number of histories in the <diag_history_path> directory
DIAG_HISTORY_PATH | Directory <diag_history_path> for the histories of log files The default value is DIAGHISTORY in the run directory of the database instance.
JOIN_MAXTAB_LEVEL4 | Threshold value for the number of tables in a join for selecting the join sequence algorithm. The default value is 16.
JOIN_MAXTAB_LEVEL9 | Threshold value for the number of tables in a join for selecting the join sequence algorithm. The default value is 4.
JOIN_SEARCH_LEVEL | see JOIN_SEARCH_LEVEL
KERNELDIAGSIZE | Size of the log file knldiag in KB
LOG_BACKUP_TO_PIPE | Specifies whether log backup in pipes is permitted
LOG_IO_QUEUE | Size of the log queue in pages
LRU_FOR_SCAN | Specifies whether the entire data cache is used for scans
MAXRGN_REQUEST | Maximum number of attempts a task should make to access a critical region. If this number is exceeded, the task lets another task access the CPU as long as it belongs to the same user kernel thread.
MAXSERVERTASKS | Determines the number of server tasks that are, for example, available for backup and restore
MP_RGN_LOOP | Maximum number of times a task may attempt to access a critical section that has been locked by another task. If this number is exceeded, the accessing task changes its status “Waiting”.
OPTIM_INV_ONLY | Determines whether the Index Only strategy is used for joins
OPTIM_MAX_MERGE | Specifies the change of the optimizer algorithm’s strategies for merging index lists If the number of pages of an index that need to be merged exceeds the value specified in OPTIM_MAX_MERGE, this index will not be used for an index merging strategy.
REQUEST_TIMEOUT | see REQUEST_TIMEOUT
SEQUENCE_CACHE | The size of the sequence cache in pages
SESSION_TIMEOUT | see SESSION_TIMEOUT
UTILITY_PROT_SIZE | Size of the log file dbm.utl in pages

You can display the full list of special database parameters for your database instance and additional information about these parameters using the Database Manager.


_UNICODE (SAP Library - SAP DB)

 Entering content frame

Object documentation _UNICODE

The special database parameter _UNICODE determines whether user data and metadata for database objects is saved in UNICODE.

This database parameter cannot be changed once the SAP DB database system is installed.

See also Installing a UNICODE-Enabled Database


DEFAULT_CODE (SAP Library - SAP DB)

 Entering content frame

Object documentation DEFAULT_CODE

If no other code attribute was specified by appropriate SQL statements, the special database parameter DEFAULT_CODE denotes which code attribute was used to create columns of data type CHAR[ACTER] , VARCHAR and LONG[VARCHAR] in the database instance.


DEVNO_BIT_COUNT (SAP Library - SAP DB)

 Entering content frame

Object documentation DEVNO_BIT_COUNT

The special database parameter DEVNO_BIT_COUNT denotes the number of bits in the converter block address that is reserved for the logical device number of a data volume.

Default value: 8

Size of a page: 8 KB
DEVNO_BIT_COUNT is set to 8
SAP DB can therefore manage 256 data volumes. Each data volume can have a maximum size of 128 GB.

The value that was set for DEVNO_BIT_COUNT when the database instance was installed should not be subsequently changed. If you change this database parameter during database operation, you must then recover the database instance to update the numbering of the data volumes.

Possible values for DEVNO_BIT_COUNT: 6 <= DEVNO_BIT_COUNT <= 12

The higher the value of the database parameter DEVNO_BIT_COUNT, the more data volumes can be managed. However, a high number of data volumes means the capacity of the individual data volumes is reduced.


JOIN_SEARCH_LEVEL (SAP Library - SAP DB)

 Entering content frame

Object documentation JOIN_SEARCH_LEVEL

The special database parameter JOIN_SEARCH_LEVEL determines the algorithm for the join sequence search. The level specified here determines how many resources and how much time the join sequence search takes.

· 9 (Join sequence search level 9): All possible join sequences are calculated.

· 4 (join sequence level 4): Various join sequences are calculated, depending on the query structure (transformer algorithm).

· 1 (join sequence search level 1): The simplest algorithm is used for the join sequence search (greedy algorithm).

· 0 (classified join sequence search level 0, level 0 is the default setting): The algorithm that is used for the join sequence search depends on the number of tables that were selected in join.
Joins with n number of tables, where n<=JOIN_MAXTAB_LEVEL9: Level 9 of the join sequence search is used.
Joins with n number of tables, where JOIN_MAXTAB_LEVEL9<n<=JOIN_MAXTAB_LEVEL4: Level 4 of the join sequence search is used.
Joins with n number of tables, where JOIN_MAXTAB_LEVEL4<n: Level 1 of the join sequence search is used.

JOIN_MAXTAB_LEVEL4 is set to 16.
JOIN_MAXTAB_LEVEL9 is set to 4.
JOIN_SEARCH_LEVEL is set to 0.
5 tables are used for a join.

Join sequence search level 4 (transformer algorithm) is used for this join because the database parameter JOIN_MAXTAB_LEVEL9<5<=JOIN_MAXTAB_LEVEL4 is most appropriate.


REQUEST_TIMEOUT (SAP Library - SAP DB)

 Entering content frame

Object documentation REQUEST_TIMEOUT

The special database parameter REQUEST_TIMEOUT denotes the maximum amount of time (in seconds) you should have to wait for a lock to be released.

This database parameter limits the amount of time you have to wait until a lock is lifted by other users for all database sessions.

If a lock request cannot be satisfied within the time defined here, a message is returned to the waiting database session. Any changes made previously in the transactions are undone.


SESSION_TIMEOUT (SAP Library - SAP DB)

 Entering content frame

Object documentation SESSION_TIMEOUT

The special database parameter SESSION_TIMEOUT specifies the timeout value, the time (in seconds) that a database session can remain inactive before being timed out.

If no SQL statement is issued within the specified time, the database system terminates the database session concerned (ROLLBACK WORK RELEASE statement).


Multiprocessor Configuration (SAP Library - SAP DB)

 Entering content frame

Background documentation Multiprocessor Configuration

To allow multiprocessor configurations to be used to the best advantage, the database system supports external/internal tasking that can be configured.

The aim here is to allow the maximum possible number of database sessions to be supported by the minimum possible number of operating system threads.

The configuration of the database system controls the degree of external/internal tasking using the two general database parameters MAXUSERTASKS and MAXCPU.

On a computer, four processors are available for the database instance. No more than 800 database sessions should be running simultaneously.

You set MAXCPU to four, and MAXUSERTASKS to 800.

The database instance can then utilize up to four processors by establishing four operating system threads, each of which performs internal tasking for up to 200 users.


Database Tools (SAP Library - SAP DB)

 Entering content frame

Component documentation Database Tools

SAP DB provides the following tools for working with the database:

· The Database Manager for managing database instances

· The Database Analyzer for performance analysis

· The Loader for unloading and loading data

· The Query Tools for executing SQL statements

· The Web-based application SAP DB WebDAV GUI for indexing XML documents in an SAP DB database instance


Database Manager (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager

The Database Manager is a database tool for managing SAP DB databases. You can use it to create, control, monitor, backup, and if necessary restore database instances on the local host or on remote hosts.

The Database Manager consists of a server part and a client part. The following clients, providing similar functions, are available, depending on your operating system and your requirements:

· Database Manager GUI for Microsoft Windows operating systems

· The command-line oriented Database Manager CLI

· The Web-based Web DBM

The server is called DBM Server.

A script interface (such as Perl, Python, or Java) is available.

See also Architecture of the Database Manager
and Architecture of the SAP DB Web Tools


Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager GUI

If you want to use the Database Manager to monitor several SAP DB database instances, which may be on different hosts, you should use the Database Manager GUI. It has an easy-to-use graphical user interface.

The Database Manager GUI can, however, only be used on hosts with Microsoft Windows operating systems. If you want to use the functions of the Database Manager on other operating system platforms, you must use the Database Manager CLI or Web DBM.

For the documentation for the Database Manager GUI, see
Database Manager GUI: SAP DB 7.4


Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager CLI

You can use the command line-oriented Database Manager CLI regardless of your operating system.

You can use the Database Manager CLI to perform all Database Manager actions and to schedule these actions in the background. In this way, you can automate actions that are repeated again and again.

The program is suitable for both interactive and background operation.

For the documentation for the Database Manager CLI, see
Database Manager CLI: SAP DB 7.4


Web DBM (SAP Library - SAP DB)

 Entering content frame

Background documentation Web DBM

The Web DBM is the Web-based version of the Database Manager. If you install the Web DBM once in the network, it can be called from all browsers.

Web DBM basically provides you with the same functionality as the Database Manager GUI. However, its operation is different because it is a Web-based application.

For the documentation for the Web DBM, see
Web DBM: SAP DB 7.4


Architecture of the Database Manager (SAP Library - SAP DB)

 Entering content frame

Background documentation Architecture of the Database Manager

The Database Manager has a client/server architecture. The DBM Server is responsible for the functions, and the user uses the client to access the tool.

The Database Manager clients can be used for remote connections. This means that the client and the DBM Server can be installed on different hosts. However, the DBM Server must always be installed on the same host as the database instance that you want to access with the Database Manager.

This graphic is explained in the accompanying text

At the request of the client (Database Manager GUI or Database Manager CLI), the X server starts the DBM server. After a connection has been successfully created, an additional thread or an additional child process is started in the X server process to transport the data packets over the network.

See also: Architecture of the SAP DB Web Tools


DBM Server (SAP Library - SAP DB)

 Entering content frame

Background documentation DBM Server

The Database Manager Server (DBM Server) is the server part of the Database Manager. It is installed by the server installation on the database server.

The DBM Server creates the connection to the database instance and can access its environment using operating system resources.

Client applications such as the Database Manager GUI or the Database Manager CLI form a link to the DBM server and exchange data with the DBM server using a request-reply mechanism.

See also: Architecture of the Database Manager


Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Analyzer

The Database Analyzer is a database tool for analyzing the performance of SAP DB database instances. If problems occur with the database instance, you can use this tool to simplify your search for the cause of the problems.

You can use the Database Analyzer regardless of the SAP DB version and the database instance type. You can also use this tool to access the database instance from a remote host.

For the documentation for the Database Analyzer, see
Database Analyzer

Leaving content frame


Loader (SAP Library - SAP DB)

 Entering content frame

Background documentation Loader

The Loader is a database tool for unloading and loading data and for formatting (transforming) data between different data sources and data targets.

The Loader can execute commands and SQL statements for these purposes.

The Loader consists of a Loader Server and a client part (Architecture of the Loader). A possible client is the command line-oriented Loader CLI. A script interface (such as for Perl, Python, or Java) is available. If you want to react to Loader return codes, you must use one of the script interfaces.

For the documentation for the Loader, see
Loader 7.4


Architecture of the Loader (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Architecture of the Loader

The Loader has a client-server architecture, but can also be used as a standalone executable program (client and server in one executable program).

The client is the user interface for the Loader server, with which the commands to be processed are transferred to the loader server.

The Loader server itself is, in turn, a client with regard to a database instance. The Loader can be used with remote connections; that is, the Loader and the database instance can be installed on different servers.

The Loader server processes the commands. To do this, the server communicates with the database kernel using a special protocol and processes the external data.

In practice, the following configuration is frequently used:
All Loader components are on one host, and the database instance is on another host.

This graphic is explained in the accompanying text

1. At the request of the client (for example, Loader CLI), the Loader is started directly, without the X server being called.

2. Communication between the Loader and the database kernel is established via the X server.


Loader Server (SAP Library - SAP DB)

 Entering content frame

Background documentation Loader Server

The Loader has its own loader server (Architecture of the Loader). The Loader server must be installed on the host on which the utilized media are located.

The Loader server creates the connection to the database instance and can access its environment using operating system resources.

The Loader server can communicate remotely with the database instance and with the client.

For the documentation for the Loader, see
Loader 7.4


Query Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Query Tools

The SAP DB query tools SQL Studio and Web SQL Studio are database tools that enable easy access to application data and the database catalog of an SAP DB database instance.

· SQL Studio provides a user friendly graphical interface for Microsoft Windows operating systems.

· The Web-based Web SQL Studio is suitable for all operating systems.

You can use the query tools to create, execute, and manage any number of SQL statements. SQL Studio for Microsoft Windows also gives you the option of editing data records in a screen, and of creating database queries with visual support.

The client part of the query tools creates a connection to the database instance through the ODBC interface. The server is the database instance.

See also Architecture of the Query Tools
and Architecture of the SAP DB Web Tools


Architecture of the Query Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Architecture of the Query Tools

The Query Tools communicate with the database instance as follows:

  • SQL Studio (GUI for Microsoft Windows): When requested by the client, a connection is set up to the database instance through the ODBC interface. After this, communication can take place between the client and the database instance.
  • Web SQL Studio: Calling the Web SQL Studio in the Web browser sets up a connection to the client (Web SQL service integrated into the Web server ). The communication between this client and the database instance takes places through the ODBC interface (see also Architecture of the SAP DB Web Tools ).

This graphic is explained in the accompanying text


SAP DB WebDAV GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB WebDAV GUI

The SAP DB WebDAV GUI allows simple administration and metadata maintenance for the indexing of XML documents that are stored in the document store of the SAP DB WebDAV Service. You can download the WebDAV Service free of charge with the SAP DB Web Tools from the SAP DB Homepage http://www.sapdb.org (see also Installation Manual Web Tools).

For the documentation for SAP DB WebDAV GUI, see
SAP DB WebDAV GUI

Leaving content frame


Architecture of the SAP DB Web Tools (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Architecture of the SAP DB Web Tools

The SAP DB Web tools are implemented as a Web service and can be used with the SAP DB Web Server as well as with current Web server Apache.

The Web services are installed together with the Web server on one computer. The database system can be on a different computer or on the same computer as the Web server. (See also Web Tools Installation Guide)

This graphic is explained in the accompanying text

A connection to the client (Web DBM or Web SQL service integrated into the Web server) is created by calling an SAP DB Web Tool in the Web browser. The communication between the client and the database instance takes place, for the Web DBM tool, through the DBM Server and through the ODBC interface for the Web SQL Studio tool (Architecture of the Query Tools).


Web Server (SAP Library - SAP DB)

 Entering content frame

Background documentation Web Server

The Web Server is the client part of the SAP DB Web Tools Web DBM and Web SQL Studio.

Possible Web servers are the SAP DB Web Server or the Web server Apache. The SAP DB Web server is installed during the installation of the SAP DB Web Tools. Apache must be installed separately or configured. For more information, see the Installation Guide Web Tools.


X Server (SAP Library - SAP DB)

 Entering content frame

Object documentation X Server

The X Server is the communication instance of SAP DB software. It is required, above all, if the individual software components are on different hosts: Database applications and SAP DB tools communicate with a database instance installed on a remote host using the X server also running on the remote host (see Architecture of the Database Manager and Architecture of the Loader).

Under UNIX operating systems, the X server is also used to allow communication with the DBM Server within a host.

SQL connections on UNIX systems and all connections within hosts under Microsoft Windows use Shar ed Memory. If you nevertheless want to force the use of the X server, specify the option –n localhost when logging on to the database instance.

The following prerequisites must be fulfilled to allow communication using the X server:

· On Microsoft Windows operating systems, the X server is registered as the system service XServer. This service must be active. An additional thread within the X server process is created with every successful connection using the X server.

· Under UNIX operating systems, the X server must be running in the background as the process vserver. An additional child process is started for every successful connection using the X server.

Starting and Stopping the X Server

x_server [<option>] start|stop

You can specify the following options when calling the X server:

Option | Explanation
-Y | Suppresses the communication through the NI server, which is only relevant for SAP Support
-F | Suppresses the determining of DNS entries and therefore speeds up the creation of connections
-S <service|port> | Specifies an alternative list port


Security Concepts (SAP Library - SAP DB)

 Entering content frame

Component documentation Security Concepts

· You can guarantee a high level of security against the failure of the SAP DB database system by using fault-tolerant hardware and software.

· Use the log settings to define whether the log area is mirrored and how logging is performed.

For more information about logging, see Background Knowledge: Log Concept

· To enable you to backup datasets in accordance with your desired backup strategy SAP DB offers tools for performing data backups and log backups.

· The restartability of the SAP DB database system enables some errors to be corrected automatically when the database system is started.

· To restore datasets, SAP DB provides tools that automate restore processes to the greatest possible extent.


Availability (SAP Library - SAP DB)

 Entering content frame

Background documentation Availability

Using the appropriate hardware, operating system, or database features can improve the downtime security of a database instance.

· Log volumes

In a production system, the log area should always be mirrored for security. You should use hardware-based solutions to do this. If this is not possible, you can set the log mode of the SAP DB database system to use software-based methods for the mirroring.

Operate the log volumes in a RAID-1 configuration, since the database instance writes the log entries sequentially.

In a production system, always stick to standard log backups, and never deactivate redo log management, even if you use RAID systems for the data volumes.

See Log settings

· Data volumes

If you want to ensure a high standard of availability, we recommend using RAID-5 or RAID-1 configurations for the data area. A disk crash and change will then not affect the running of the database, if the RAID system is able to carry out a restore.

Every volume category should be stored on a different disk.

When using fault-tolerant hardware, it is best to only use the same type of hardware when you want to extend the capacity. For example, RAID-5 systems should only be extended using RAID-5 systems and mirroring disks with mirroring disks.

UNIX: In a production system, data volumes and log volumes should be used in conjunction with raw devices. Raw devices achieve better performance, and are more secure in the event of a system failure.


Log Settings (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Settings

The following log settings are possible:

· You can mirror the log area.

If you cannot use hardware-base mirroring for the log area, we recommend that you use the software-based mirroring setting. To make this setting, proceed as described in Log Mode.

If you only require a lower level of security for your system, you can also decide not to mirror the log area.

· You can decide to do without log backups and use a non-standard log backup strategy by setting the overwrite mode for the log area accordingly.

Allow the log area to be overwritten only if all you require in the event of a database crash is for the system to be restored to the state of an existing data backup.

· In very special situations, you can deactivate redo log management temporarily.

However, deactivating redo log management places the security of your system at serious risk, and should be considered only under exceptional circumstances.

See Background Knowledge: Activating or Deactivating Redo Log Management.

Combination of Log Settings

The combination of log settings you choose depends on your security requirements. In production database systems, you should aim for the highest possible security standards. In this case, make the following log settings:

· Hardware-based mirroring of the log area

· Use the standard log backup, that is, do not allow overwriting of the log area and perform regular log backups

· Always leave redo log management activated

For more information about logging, see Background Knowledge: Log Concept


Log Mode (SAP Library - SAP DB)

 Entering content frame

Object documentation Log Mode

You can use this log setting to control whether the log area is mirrored using software-based mirroring.

By default, the database instance uses only one log area. Implement hardware-based mirroring using RAID-5 or RAID-1 systems to achieve a higher level of security for the database system. RAID systems guarantee a good level of security for production use of the database.

Mirroring the Log Area

If hardware-based mirroring is not possible, you can mirror the log area using database resources with the corresponding setting of the log mode.

In this case, the database instance uses the two log areas as follows:

· Data is written to both log areas in parallel.

· During a restart or log backup, the log entries are only read from one log area – the primary log entry.

· When you use standard log backups, neither of the two log areas can be overwritten until the log entries of the primary log area have been backed up.

· If access problems occur in the primary or secondary log area, the log volume in question is marked as BAD and the database instance is switched t the operational state OFFLINE.

· The defective log volume of a log area can be restored in the operational state ADMIN. In this process, the complete contents of the relevant log volume are copied from the other log area to the defective log volume.

This ensures that the database instance does not have to be restored after a disk error that led to the loss of a log volume, as the content of the log volume was mirrored.

Procedure

Configure the required additional log volumes. Use the Database Manager to do this.
Database Manager GUI, section Changing Log Settings (Configuration Wizard)
Database Manager CLI: SAP DB 7.4, section Changing Volume Parameters


Overwrite Mode for the Log Area (SAP Library - SAP DB)

 Entering content frame

Background documentation Overwrite Mode for the Log Area

Use this log setting to control whether the log area can be overwritten or not without backing up the log entries.

Normal Log Backups

By default, the log area can be overwritten only if the appropriate log entries have been backed up. You must therefore make regular log backups (see Backing Up).

The log entries of the log area and the log backups are then available if you need to restore the database. If these entries and the data backups are complete and available without gaps, you can restore the database up to any point in time.

If you change the overwrite mode, and then reactivate the default setting, you must then make a complete data backup.

Overwriting the Log Area Without a Log Backup

The log area is overwritten cyclically, even if you do not perform any log backups.

This interrupts the log backup history. Only the log entries of the log area are available if you need to restore the database. This usually means that you cannot restore your database instance up to the last COMMIT before the crash, or to any other time; instead, you can restore it only to the state it had at the time of the last data backup.

You can only restore the database to a time of your choice if all the log entries written after the data backup exist in the log area (which means that the log area has not been overwritten since the data backup).

Procedure

You can set the overwrite mode with the database instance in the operational state ADMIN or ONLINE. Use, for example, the Database Manager GUI, as described in Changing Log Settings (Configuration Wizard).


Backing Up (SAP Library - SAP DB)

 Entering content frame

Background documentation Backing Up

One key element of the security concept for your database system is the regular backing up of your data. You should therefore regularly perform data backups and log backups.

You can use external backup tools to reduce the time needed for backup.

Data Backup

Note that, in the case of a restore, a more up-to-date data backup means that fewer log entries need to be reproduced. Therefore, perform data backups as often as possible.

· Perform a complete data backup on each day of production.

· If you cannot or do not want to perform a data backup every day, you should at least perform an incremental data backup on each day of production.

If complete data backup is active, incremental data backup cannot be started.

You can perform data backups in parallel to reduce the time required for the backups.

Log backups

In production systems, choose the following log settings: mirror the log area, the log area can be overwritten only after it has been backed up, and redo log management is always activated. Perform log backups at regular intervals.

· Automatic log backup

The automatic log backup (autosave log mechanism) should always be active. Complete and incremental data backups are also possible while the automatic log backup is active.

· Interactive log backup

You should save the log entries every productive day.

If automatic log backup is not active, you must regularly check that there is enough storage space available in the log area. If necessary, back up the log area immediately by starting an interactive log backup. If new log entries cannot be written to the log area because there is not enough storage space, the database stops.

· Archiving of version files

You should regularly archive the version files written during a log backup to a medium of your choice. Once the files have been archived successfully, you can delete the version files written during the log backup, and thereby ensure that there is enough space available in the directory for version files.

If you use an external backup tool, you can automate the archiving of version files. To do this, follow the instructions in Archiving Version Files of the Log Area.

Tapes containing data or log backups should not be directly overwritten with the next backup. If you retain, say, the last four backup generations, it may be possible to use an older backup if a media failure occurs.


Data Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Backup

A data backup saves the contents of the data volumes, and the database parameter values needed for restores.

For the SAP DB database system, we differentiate between the following types of data backup:

· Complete data backup

· Incremental data backup

You can perform complete and incremental data backups in the operational mode ONLINE or ADMIN. When doing so, you can back up to a group of parallel backup media. Data backups are always consistent in themselves.

Procedure

Use the Database Manager or, in SAP systems, the DBA Planning Calendar to perform the backups.

Database Manager GUI, Section Backup Processes

Database Manager CLI, Commands for Backing Up and Archiving

Database Administration in CCMS OLTP, DBA Planning Calendar

To restore a database instance, you may also need log backups in addition to a data backup.

See also: Backing Up


Complete Data Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Complete Data Backup

In a complete data backup, all the pages of the data volumes are backed up to the backup medium you specified.


Incremental Data Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Incremental Data Backup

In an incremental data backup, all the pages of the data volumes changed since the last complete data backup are backed up to the backup medium you specified.


Log Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Backup

In a log backup, the contents of the log area are copied to version files or backed up using an external backup tool.

A version file is generated for each log segment of the log area.

The space originally taken up by the backed up log area becomes free again after the log backup.

Log Backup Types

The following log backup options are supported for the database system SAP DB:

· Automatic log backup

· Interactive log backup

Need for log backup

· In the case of a restore, a data backup alone is not enough to restore the current state of the database instance up to a certain point in time (for example, the time just before the disk error occurred).
To restore the current state, both the data backup and the log entries that were written after the data backup must be imported into the database system.

· If new log entries cannot be written because there is not enough storage space in the log area, the database stops.

For these reasons, it is necessary to back up the log entries at regular intervals.

See also: Backing Up


Automatic Log Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Automatic Log Backup

To guarantee the security and availability of the data in your database system, we recommend automatic log backups.

If automatic log backup is activated, a log segment of the log area is saved as soon as it has been filled. This log segment is then released again. This mechanism ensures that overflows in the log area are practically impossible.

We particularly recommend activating automatic log backups for all database instances where many changes are made to the data, leading to a high volume of logs. In this way, constant monitoring of the usage level of the log area is not necessary.

As long as automatic log backup is active, you cannot start an interactive log backup. However, you can perform a data backup at the same time.

You can only perform automatic log backups in the operational state ONLINE.

In the case of an automatic log backup, you can only use version files as the backup medium

See also: Backing Up

Procedure

Use the Database Manager or the DBA Planning Calendar in SAP systems to activate and deactivate automatic log backups.

Database Manager GUI, Activating and Deactivating the Automatic Log Backup

Database Manager CLI, Commands for Backing Up and Archiving

Database Administration in CCMS OLTP, Activating Automatic Log Backup


Interactive Log Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Interactive Log Backup

You can use the interactive log backup to back up all the pages of the log area that have been written since the last log backup.

If you back up the log entries in version files, a version file is also generated for the last log segment, which may not be full.

Prerequisites

A full data backup of the current database instance has been created.

You can perform interactive log backups in operational mode ONLINE or ADMIN.

You cannot perform any other backup while the interactive log backup is running.

See also: Backing Up

Procedure

Use the Database Manager or, in SAP systems, the DBA Planning Calendar to perform interactive log backups.

Database Manager GUI, Section Backup Processes

Database Manager CLI, Commands for Backing Up and Archiving

Database Administration in CCMS OLTP, DBA Planning Calendar


Backup History (SAP Library - SAP DB)

 Entering content frame

Object documentation Backup History

Information on all actions that have been carried out that relate to backing up and restoring the database instance are registered in chronological order in the backup history.

The system writes a backup history to log file dbm.knl. This file is in the database instance’s run directory.

Displaying the Backup History

Use the Database Manager or, in SAP systems, the Database Assistant to display the backup history.

Database Manager GUI, Displaying the Backup History

Database Manager CLI, Commands for the Backup History

Database Administration in CCMS OLTP, DBA Action Logs


Backup ID (SAP Library - SAP DB)

 Entering content frame

Object documentation Backup ID

The database system automatically gives each backup a backup ID to allow them to be identified. This ID uniquely identifies the backups done since the creation of the database instance. If external backup tools are used for the backup, the backup is given an external backup ID.

The backup ID consists of the type of backup (complete or incremental data backup or log backup) and a sequential number.

Full and incremental data backups are numbered sequentially together. Log backups are numbered in a separate sequence.

After the backup, the backup ID is written to the log dbm.knl. You can display all the contents of this file in the backup history.

In a restore the label is shown first and must be confirmed before the operation can start.

If the backup medium is a tape or a cassette, you should write the backup ID on the sticker of the tape or cassette at the end of the backup.

Formal Description of the Backup IDs

<backup_id> ::= <save_type>_<sequence_no>

<save_type> ::= DAT | PAG | LOG
<sequence_no> ::= <number>


External Backup ID (SAP Library - SAP DB)

 Entering content frame

Object documentation External Backup ID

A unique backup ID (External Backup ID) is created for every backup and every data stream created using an external backup tool when backing up or unloading. If a backup was created using a media group, every part of this backup has its own external backup ID.

Generating the Backup ID

· Backing Up with External Backup Tools
The external backup ID is written to the logs dbm.knl (Backup History) and dbm.ebf during the backup.

· Unloading with External Backup Tools
The external backup ID is written to Loader logs during the unloading.

Using the Backup ID

The external backup ID is required when restoring or loading data, to request the desired backup or data stream.

· Restoring with External Backup Tools
You can display the external backup IDs with the Database Manager, and then select the desired backup using its ID.

· Loading with External Backup Tools
Determine the external backup ID from the Loader logs and specify this in the desired load command in the syntax rule mediumtype_spec.


Backup Medium (SAP Library - SAP DB)

 Entering content frame

Object documentation Backup Medium

A backup medium is assigned to each backup or restore action you perform. Backup media include files, tapes, autoloaders, and pipes.

You define separate backup media for each database instance. You can combine multiple backup media in a group of parallel backup media.

Recommended Backup Media

Note the following points:

· The recommended backup media for data backups are tape and autoloader. Data may also be backed up to pipes or files.

· Log backups are always made to files (version files).

· You should only use pipes if you are working with an external backup tool.

· Follow the naming conventions for backup media.

· For security reasons, archive your files or versions files.

In general, only archive files to a separate medium that can be stored in another location, where it is protected from fire and similar hazards.

You must follow the manufacturer's recommendations on how frequently backup media should be used.

Defining Backup Media

For more information, see the following documentation:

Database Manager GUI, section Creating a Single Backup Medium/Creating a Group of Parallel Backup Media

Database Administration in CCMS OLTP, section Database Assistant ® Configuration ® Backup Media

Database Administration in CCMS: liveCache, section liveCache Assistant ® liveCache: Monitoring ® Administration ® Configuration ® Backup Media


Group of Parallel Backup Media (SAP Library - SAP DB)

 Entering content frame

Background documentation Group of Parallel Backup Media

You can use multiple backup media to back up in parallel or to restore from parallel backup media. For this purpose you define a group of parallel backup media that is identified by a single, grouped media name.

Parallel backup media are simultaneously written or read by the database instance. This increases data throughput - and thus the speed of backup or restore.

The general database parameter MAXBACKUPDEVS specifies the maximum possible number of files or tape devices in a group of parallel backup media.


External Backup Tool (SAP Library - SAP DB)

 Entering content frame

Background documentation External Backup Tool

You can back up and restore, and unload and load data with external backup tools and external media.

SAP DB supports the use of the following external backup tools:

· TSM (IBM/Tivoli)

· NetWorker (Legato)

· All backup tools that support Backint for Oracle

· All backup tools that support Backint for SAP DB

If you want to use a different backup tool, contact SAP DB Support.

Depending on the platform, it may also be possible to address TSM using the Backint for Oracle interface.

For more information about the requirements for a Backint for SAP DB interface, see
Backup and Restore Interface for SAP DB Systems at http://www.sapdb.org/7.4/pdf/backint_eng.pdf

Procedure

· Use the Database Manager to back up and restore the database instance. When defining the backup media, follow the naming convention. The backups created receive an external backup ID.

· To unload or load data, use the Loader and follow the procedure described in Unloading or Loading with External Backup Tools.

· For information about setting up the external backup tools, see the documentation Connecting External Backup Tools.


Naming Conventions for Backup Media (SAP Library - SAP DB)

 Entering content frame

Background documentation Naming Conventions for Backup Media

Note the following naming conventions when defining backup media:

· If you are using an external backup tool, the media names must begin with the following defined character strings:

Character String | Backup Tool
ADSM | TSM (IBM/Tivoli)
BACK | Backup tool with the interfaces Backint for Oracle or Backint for SAP DB
NSR | NetWorker (Legato)

· If you are not using an external backup tool, choose a media name that does not begin with any of the above character strings.


Restartability (SAP Library - SAP DB)

 Entering content frame

Background documentation Restartability

If the database fails (for example, as the result of a power failure), and the volumes were fully functioning, the database system carries out a restart. This means that the effects that completed transactions had on the data volumes are reproduced (ROLL FORWARD), and the effects that uncompleted transactions would have had are cancelled out (ROLLBACK).


Restore (SAP Library - SAP DB)

 Entering content frame

Background documentation Restore

By importing backups from a backup medium, you can restore a database instance after a crash or an error, or reset it to a previous status.

Usually, a complete data backup is imported first, and then, if necessary, additional incremental data backups and log backups from the backup history.

You can also import data backups from a group of parallel backup media to reduce the restore time.

Procedure

Use the Database Manager to perform the restore.

· Database Manager GUI, section Restoring Data

· Database Manager CLI, section Commands for Restoring

You may also then have to restore indexes.

· Database Manager GUI, section Restoring the Indexes After a Database Restore

· Database Manager CLI, section Recreating a Damaged Index


User Concept (SAP Library - SAP DB)

 Entering content frame

Component documentation User Concept

The SAP DB database system uses SAP DB user classes and supports different roles (role concept).

Setting Up a Database Session

A database session is started when the user logs on to the database instance. In order to log on, certain user data needs to be transferred to the SAP DB component for identification purposes.

The following user data is needed to log on:

user_name | User name
password | The user’s password
database_name | The name of the SAP DB instance you want to work on
database_server | The name of the server on which the database you called is running

In addition to this generally required user data, you can enter further data, which is then transferred when you log on.

You can also transfer the user data to the SAP DB tools or the C/C++ Precompiler programs in the following ways:

· Enter user data as options (note that the required options must always be entered for each tool used)

· Enter user data on the logon screen (for the Database Manager GUI and SQL Studio tools)
Note the special features of entering user data in the SQL Studio (Opening a Database Session).

· Use XUSER to specify user data

Entering incomplete or incorrect user data when calling the C/C++ Precompiler programs, application programs, or the SAP DB tools causes the program to terminate with an error message.

When you call the C/C++ Precompiler and application programs that were generated using the SAP DB programming interface, you can also transfer user data directly in the program itself. For this reason, the program contains a special modified rule for the transfer of user data. Basically, the logon options for the C/C++ Precompiler and application programs are the same as for the SAP DB tools.


SAP DB User Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB User Classes

The SAP DB database system differentiates between two main user classes:

  • Database Manager Operator (DBM Operator)
  • Database Users


Database Manager Operator (DBM Operator) (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager Operator (DBM Operator)

Users working with the Database Manager are known as Database Manager Operators. The SAP DB user class is the DBM operator.

Depending on what authorizations the DBM operator has been given, a DBM operator is able to perform all kinds of Database Manager functions.

You create the first DBM operator when you install a database instance.

The Database Manager stores the name and password of the DBM operator in uppercase characters. Special characters are not permitted.

When you register a database instance, you must specify the name and the password of the first DBM operator. In this way, you legitimize yourself as the DBM operator of the database instance. The DBM operator’s password can be changed at a later date.

· This DBM operator is then responsible for managing and monitoring the database system and for running backups and restores. The DBM operator is also authorized to perform all Database Manager functions, regardless of what operational state the database instance is in.

· The DBM operator is also authorized to create additional DBM operators, and assign them some or all of his or her authorizations.

· The DBM operator can log on to the Database Manager more than once, which means the DBM operator can, for example, query operating parameters while functions that take a long time are still running.

DBM operators are not database users. To be able to work with a database instance, you must create the database user (with the query tool SQL Studio, for example).


Authorizations (SAP Library - SAP DB)

 Entering content frame

Background documentation Authorizations

The database system SAP DB makes a distinction between two types of authorizations for the Database Manager operator (DBM operator):

  • User authorizations
    Authorizations of the DBM operator for executing the functions of the     Database Manager
  • Operating system user authorizations
    Authorizations of the DBM operator for accessing remote servers via the Database Manager


User Authorizations (SAP Library - SAP DB)

 Entering content frame

Background documentation User Authorizations

User authorizations are the authorizations of the Database Manager operator (DBM operator) that he/she needs to use the required functionality of the Database Manager.

An authorization may cover more than one command and one command may have more than one authorization assigned to it.

Use the Database Manager to assign the relevant user authorizations to a DBM operator.

See also:

Database Manager CLI: User Authorizations.

The entries in the following table refer to the relevant sections of the documentation on the Database Manager CLI.

User authorization | Description
DBInfoRead | Displaying state information
ExecLoad | Running the LOAD program
SystemCmd | Executing operating system commands
Backup | Carrying out backups
InstallMgm | Installation management
LoadSysTab | Loading system tables
DBStart | Starting the database instance
DBStop | Stopping the database instance
UserMgm | Managing the DBM operators
Recovery | Restoring backups
DBFileRead | Accessing database files (read-only)
ParamCheckWrite | Accessing database parameters (checked write)
ParamFull | Accessing database parameters (read and write)
ParamRead | Accessing database parameters (read-only)
AccessSQL | Accessing SQL session
AccessUtility | Accessing a utility session

The first Database Manager operator you create when you register a database instance has all user authorizations.


Operating System User Authorizations (SAP Library - SAP DB)

 Entering content frame

Background documentation Operating System User Authorizations

The operating system user authorization is one of the authorizations of the Database Manager operator (DBM operator). To execute operating system commands on remote computers using the Database Manager , the DBM operator must have operating system user authorizations on those computers.

Use the Database Manager functionality to assign a DBM operator the user identification for the operating system.


Database User (SAP Library - SAP DB)

 Entering content frame

Background documentation Database User

Database users log on to a database instance and work with database objects such as tables, views, and indexes (the SAP DB user class is database user).

SAP DB differentiates between various database user classes .

Database users can be grouped into user groups .


Database User Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Database User Classes

Database users are divided into database user classes. The database user class that a database user belongs to defines which operations that user is allowed to execute.

SAP DB differentiates between the following database user classes:

  • SYSDBA
  • DBA
  • DOMAIN
  • RESOURCE
  • STANDARD


SYSDBA (SAP Library - SAP DB)

 Entering content frame

Background documentation SYSDBA

The SYSDBA user (database system administrator) is a special database user of the database user class SYSDBA. The SYSDBA user is the first database user that the Database Manager creates when a new database instance is installed. Enter a user name and password for this user.

When you enter the data for the SYSDBA user and when you use it in the SQL environment, remember that the Database Manager automatically converts all characters into uppercase.

Each database instance has a single SYSDBA user.

The SYSDBA user’s password can be changed once the database registration is complete (for example, using the query tool SQL Studio).

The SYSDBA user is very important, especially when database instances are installed. The SYSDBA user is responsible for setting up the system and for creating other database users. The SYSDBA user is the owner of system tables. When system tables are uploaded, the upload tool logs on to the database instance as SYSDBA.

The SYSDBA is able to define data and database procedures. The SYSDBA can also grant other users privileges for these database objects.


DBA (SAP Library - SAP DB)

 Entering content frame

Background documentation DBA

A DBA user (database system administrator) is a special database user in the database user class DBA. A database user must be created by SYSDBA (with the query tool SQL Studio, for example).

A DBA user is authorized to create RESOURCE and STANDARD users. The DBA user can also define data and database procedures and grant other users all or some DBA user privileges for these database objects.

A DBA user can group users with identical access rights into user groups.

A special DBA user is the user DOMAIN.


DOMAIN (SAP Library - SAP DB)

 Entering content frame

Object documentation DOMAIN

The DOMAIN user is a special database user of the database user class DBA . The DOMAIN user is the owner of the system tables of the database catalog .

Just like the SYSDBA user, the DOMAIN user is created when a database instance is installed. The DOMAIN user is created by the system under the pre-defined name DOMAIN. The password is the same as that of the SYSDBA user that was created earlier.

The DOMAIN user’s password can be changed at a later date.


RESOURCE (SAP Library - SAP DB)

 Entering content frame

Background documentation RESOURCE

RESOURCE users are special database users of the database user class RESOURCE. RESOURCE users can be created by SYSDBA users and DBA users .

RESOURCE users can define data and database procedures and grant other users privileges for these database objects.


STANDARD (SAP Library - SAP DB)

 Entering content frame

Background documentation STANDARD

STANDARD users are special database users of the database user class STANDARD. STANDARD users only have access to data and database procedures that were defined by other users and for which they have privileges.

STANDARD users themselves can define view, synonyms, and temporary tables.


User Groups (SAP Library - SAP DB)

 Entering content frame

Background documentation User Groups

Database users can be grouped into user groups.

A user group can either be assigned to the database user class RESOURCE or to the database user class STANDARD . Database users can be defined as members of a user group.

All database objects defined by members of a certain user group can be identified by the user group name. The owner of objects such as these is the user group and not the individual user that defined the objects. If a member of a user group creates objects, each member of that group can work with these objects as if they were the object owners.

Privileges can only be granted or removed from the user group as a whole and not from individual members of the group.


The Role Concept (SAP Library - SAP DB)

 Entering content frame

Background documentation The Role Concept

The SAP DB database system supports different roles. A role is a grouping of privileges, which can be assigned to database users, user groups, or other roles.

Procedure

...

1. A role is created using the CREATE ROLE statement. This role is initially empty. Only database users belonging to database user class DBA are able to create roles . The new role name cannot be the same as the name of any other role, a user, or a user group.

2. Privileges are assigned to a role using the GRANT statement. Privileges can be revoked from a role using the REVOKE statement.

3. A role can be assigned to database users, user groups, or other roles using the GRANT statement and specification of the role name.

4. You use the ALTER_USER- and ALTER_USERGROUP-statement to define which of the roles that were assigned to a user or user group is to be used when a database session is opened.

5. During a database session, you can use the SET statement to activate other roles assigned to the user or user group
If a role is activated during a session, the current user then has all the privileges that are assigned to a role.
If a password has been assigned to a role, users assigned to that role can only activate it by entering the password in the SET statement.

Result

That a role is available and the properties of that role are all registered in the catalog in the form of metadata. A user that creates a role becomes its owner.

The roles assigned to the user or user group as a result of the ALTER USER and ALTER-USERGROUP statements are activated as soon as a database session is opened.

Roles are not active during execution of data definition commands.

See also:

Reference Manual, Section Role Name


User Data as Options (SAP Library - SAP DB)

 Entering content frame

Procedure documentation User Data as Options

User data for logging on to the database instance and, in some cases, other data can be entered as options when calling the SAP DB Tools, the C/C++ Precompiler, or the application programs.

If you explicitly specify the minimum required options (in most cases, this is the options -u, -d, and -n) and this data is complete and contains no errors, you are logged on to the desired database tool or the C/C++ Precompiler is called.

When logging on to the Database Manager GUI or SQL Studio, you can also enter user data using a logon screen.

The Database Manager CLI and the C/C++-Precompiler support User Data Using XUSER.


Required Options (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Required Options

If, when logging on to the database tools, you specify the user data as options, note the following minimum options:

· Database Manager GUI, SQL Studio

Specifying options is not required. These tools are started even if options are not entered, or if options are incorrect or incomplete. Database Manager GUI and SQL Studio always display a logon screen. In the logon screen, enter the user data required to log on to the database instance.

· Database Manager CLI

You need to connect to the database instance to use all of the functions of this tool. Enter the option -d <database_name> , if the database instance is on the local computer, and enter the option -n <server_node> as well if the database instance is on a remote computer. Further user data such as user name and password can be specified as options (for example -u) or, if required, as commands (for example user_logon).

If you do not specify the options required to log on to the database instance, or specify only some of them, or the details are incorrect, the Database Manager CLI is still started, and a connection to the DBM server is created, however, you are not logged on to the database instance. In this case, the Database Manager CLI can only be used to call DBM commands that are not related to the database (such as help, dbm_version, and so on).

· Loader CLI

If you call the Loader without options or only specifying the option -d <database_name>, you must enter the other commands to create a database session in the command file or interactively.

If you specify the option -b, the Loader expects the required commands in the command file. If you do not specify the option –b, the Loader is started interactively.

If you enter the options incorrectly, the Loader is not started, but a list of all possible options is displayed.


User Data and XUSER (SAP Library - SAP DB)

 Entering content frame

Procedure documentation User Data and XUSER

You can store user data under a particular user key ( user_key) with the XUSER tool. When the Database Manager CLI or the C/C++-Precompiler is called or when an SAP system is started with the option -U <user_key>, this XUSER data is accessed.

· Microsoft Windows 2000/Microsoft Windows XP: You can manage individual user data in this way if, for example, more than one database user is using the same host and each user is logging on under a different name.

· UNIX: You can manage individual user data in this way if, for example, more than one database user is using the same Home directory and each user is logging on under a different name.

Procedure

...

1. The database administrator (DBA operator) sets up a database user using the relevant CREATE USER statement.

2. The database administrator informs the operating system user what this database user’s data is.

3. The operating system user saves the database user’s data using XUSER.

See Using XUSER

Applications such as SAP DB Loader and the Database Manager GUI, and applications that use the ODBC interface (for example, SQL Studio) have no way of accessing XUSER data.


Using XUSER (SAP Library - SAP DB)

 Entering content frame

Background documentation Using XUSER

User data for setting up a database session can be predefined and saved by entering a user key (user_key) using the tool XUSER. When the Database Manager CLI or the C/C++ Precompiler is called or an SAP system is started, the system can access the required XUSER data by entering the relevant user key).

Use

· You can use the XUSER options to generate the XUSER data (options for the required data combined with the option set).

· You can use the option -b to generate the XUSER data (Generating the XUSER Data in the Background).

· If you do not generate the XUSER data, you can use the data in the user key DEFAULT.

· XUSER data is called using option -U (User Data Using XUSER).

Enter the user key exactly as it was defined in XUSER, that is, your entries are case-sensitive.

· You can use the XUSER options to delete the XUSER data (options for the required data combined with the option clear).


XUSER Options (SAP Library - SAP DB)

 Entering content frame

Background documentation XUSER Options

When you use the XUSER tool, you can use the XUSER options to help you set your XUSER data. The user key data that you set with the options overrides any data already specified in the user key.

You can use the following options:

Option | Explanation (see also XUSER Data)
-h | Help texts
-V | XUSER version
-A ASCII8 | XUSER data is interpreted as ASCII8
-b <file_name> | Generates XUSER data in the background
-U <user_key> | User key
-u <user_name>,<password> | User name and password
-d <database_name> | Name of the database instance
-n <database_server> | Host server name
-S <SQL_mode> | SQL mode
-t <timeout> | Timeout value
-I <isolation_level> | Isolation level
list | xuser list: List of data for all user keys xuser –U <user_key> list: Data for specified user key
clear | xuser clear: Deletes data for all user keys xuser –U <user_key> clear: Deletes data for specified user key
set | xuser <options> set: Data set for user key DEFAULT <options>::= -u|-d|-n|-S|-t|-I xuser –U <user_key> <options> set: Data set for specified user key

The options list, clear and set must be always be the last options specified in the list.


Generating XUSER Data in the Background (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Generating XUSER Data in the Background

If you use the XUSER tool, you can generate the XUSER data in the background by using a file specified with the option –b when you call XUSER.

Syntax

xuser -b <file_name>

You are free to define your own file name. The file is made up of groups of 10 lines:

The option -b <file_name> always generates new XUSER data. Any existing XUSER data is overwritten.

Structure of the File <file_name>:

The entries in the file <file_name> begin in the first column. There are no field descriptions and they contain the following data in the specified order:

<user_key>
<user_name>
<password>
<database_name>
<database_server>
<SQL_mode>
               empty line
<timeout>
<isolation_level>
               empty line

This data is explained in more detail in the section XUSER Data. If you do not want to enter any optional data, make sure the line is left blank. The empty lines in the file must be left empty, since they are meant to contain other XUSER data that is no longer relevant for SAP DB Version 7.4.

DEFAULT
meyer
secret
TEST1
server1
INTERNAL
                 empty line
-1
-1
                 empty line

This example contains all data required for SAP DB Version 7.4.

HOME
meyer
"top_secret"
TEST2
server1
                 empty line
                 empty line
90
1
                 empty line

This example contains no data on the SQL mode.


XUSER Data (SAP Library - SAP DB)

 Entering content frame

Background documentation XUSER Data

You can save XUSER data when you use the XUSER tool.

XUSER can manage up to 32 combinations of XUSER data for each operating system user.

· Windows 2000/Windows XP: XUSER data is stored in the database registry.
You are not permitted to make manual changes in the registry because these may result in inconsistencies in the operating system.

· UNIX: XUSER data is stored in the file .XUSER.62 (also referred to as the XUSER file) in the user’s HOME directory.

Procedure

You can generate the XUSER data as followed:

· Use XUSER options

· Generate XUSER data in the background

You can enter the following XUSER data with SAP DB Version 7.4:

XUSER Data

Explanation

user_key

Name of the user key used to address this combination of XUSER data (character string with a maximum of 18 characters)

XUSER data is delivered under the user key name DEFAULT in the program XUSER. This name cannot be changed.
If you enter additional key names, these are case-sensitive.

If you do not specify a user key, then the remaining data refers to the DEFAULT user key.

user_name

User name (character string with a maximum of 18 characters)

If the user name contains small letters or special characters, it must appear within double quotation marks. Otherwise small letters will be converted to capitals.

password

Password of user (character string with a maximum of 18 characters)

If the password contains small letters or special characters, it must appear within double quotation marks. Otherwise small letters will be converted to capitals.

database_name

Name of the database instance that you want to work with (character string with a maximum of 18 characters)

If you do not specify a database, the system uses the name in the environment variable SERVERDB.
This entry is case-sensitive.

database_server

Name of the server on which the database is running (character string with a maximum of 64 characters)

If you do not specify a name, the local server is selected.
This entry is case-sensitive.

SQL_mode

SQL mode (character string with a maximum of eight characters)

If you do not specify a mode, the INTERNAL SQL mode is selected.
Possible values: INTERNAL, SAPDB, ANSI, DB2, ORACLE, SAPR3
This parameter affects the precompiler programs.

timeout

Timeout value in seconds

If you do not specify a value, the value –1 is chosen. This means that the default value of the database instance is used.
Possible values: -1, <number>, 0
If you set the timeout value to 0, then no timeout value is used.

isolation_level

Isolation level (for application programs and precompilers only)

If you do not specify a value, the value –1 is chosen. This means that the default value of the database instance is used.
Possible values: -1, 0, 1, 2, 3, 10, 15, 20, 30


Lock Behavior (SAP Library - SAP DB)

 Entering content frame

Component documentation Lock Behavior

The SAP DB database system is a complete transactional implementation that allows concurrent transactions to access the same database objects. To ensure synchronization and isolation of individual transactions, lock mechanisms are required.

Lock Behavior

The basic idea behind a lock mechanism is that the transaction locks as many of the database objects it is using for as long as is required to ensure the transaction is executed correctly.

Locking an object means that other transactions are not able to use it in certain ways.

The more locks that are set, and the longer these stay in place, the less concurrency is possible in database operation. For this reason, locks should only be set if they are absolutely necessary, and locks that have been set should be released as soon as possible.

· Lock mechanisms differ according to the type of lock selected.

· Locks can be requested and released implicitly and explicitly (Requesting and Releasing a Lock).

· Locks can be set at row, table, and database catalog level.
If too many row locks (shared or exclusive locks) are requested by a transaction for a table, the database system attempts to lock the table. If this causes collisions with other locks, the database system continues to request row locks. This means that table locks are obtained without waiting periods. The limit beyond which the system attempts to transform row locks into table locks depends on the general database parameter MAXLOCKS.


Lock (SAP Library - SAP DB)

 Entering content frame

Background documentation Lock

The lock behavior depends among other things on the type of lock. Tables and rows are locked in a transaction with a defined lock mode ( Requesting and Releasing a Lock ).

The database system differentiates between the following locks:

  • Shared lock
  • Exclusive lock
  • Optimistic lock
  • Special locks for he metadata of the database catalog , which must, however, always be explicitly assigned.

The following table provides an overview of the possible parallel shared locks (S locks) and exclusive locks (E locks).

This graphic is explained in the accompanying text

A lock collision exists in the cases which are marked with "No"; i.e., after having requested a lock within a transaction, the user must wait for the lock to be released until one of the above situations or one of the situations that are marked with "Yes" in the matrix occurs.

  • If no lock has been assigned to a transaction for a data object, then a shared or exclusive lock can be requested within any transaction and the lock is immediately assigned to the transaction.
  • If a shared lock has been assigned to a transaction T for a data object, and if no lock has been assigned to any concurrent transaction for this data object, then the transaction T can request an exclusive lock for this data object and the lock is immediately assigned to this transaction.
  • If an exclusive lock has been assigned to a transaction for a data object, then a shared can, but need not, be requested for this transaction.


Shared Lock (SAP Library - SAP DB)

 Entering content frame

Object documentation Shared Lock

One type of lock is the shared lock.

Once a shared lock is assigned to a transaction for a particular data object, concurrent transactions can access the object but not modify it. Other transactions can set a shared lock, but not an exclusive lock for this object.

Shared locks refer to a row or a table.

See also:

Requesting and Releasing a Lock


Exclusive Lock (SAP Library - SAP DB)

 Entering content frame

Object documentation Exclusive Lock

One type of lock is the exclusive lock.

Once an exclusive lock is assigned to a transaction for a particular data object, other transactions cannot modify this object. Transactions that check for the existence of exclusive locks, or that want to set exclusive or shared locks, conflict with the existing exclusive lock of another transaction. They do not have access to the locked object.

Exclusive locks refer to a row or a table.

See also:

Requesting and Releasing a Lock


Optimistic Lock (SAP Library - SAP DB)

 Entering content frame

Object documentation Optimistic Lock

One type of lock is the optimistic lock at row level. It only makes sense to use an optimistic lock if one of the isolation levels 0 , 1 or 10 or 15 was assigned. An optimistic row lock must be explicitly requested by specifying a LOCK statement .

An update operation performed by the current user on a row that the user set an optimistic lock on is only actually carried out if this row has not been changed in the meantime by a concurrent transaction . If this row has been changed in the meantime by a concurrent transaction, the update operation of the current user is rejected.

The optimistic lock is released in both cases.

  • If the update operation was successful, an exclusive lock is set for this row.
  • If the update operation was not successful, it should be repeated after reading the row again with or without optimistic lock. In isolation level 0, an explicit lock must be specified for the new read operation. In this way, it can be ensured that the update is done to the current state and that no modifications made in the meantime are lost.

The request of an optimistic lock only collides with an exclusive lock. Concurrent transactions do not collide with an optimistic lock.


Requesting and Releasing a Lock (SAP Library - SAP DB)

 Entering content frame

Background documentation Requesting and Releasing a Lock

To control lock behavior, you can request and release locks.

Depending on the lock mode selected, locks can be requested and released implicitly or explicitly.

Request Locks

· Request locks implicitly
The lock mode can be determined by specifying an isolation level in the CONNECT statement.
In this case, the database system requests locks implicitly during processing of an SQL statement in accordance with the specified isolation level. These locks are then assigned to the transaction that contains this SQL statement. All SQL statements that result in a change (INSERT/UPDATE/DELETE), continuously request an exclusive lock implicitly.

· Request locks explicitly
The lock mode can be defined by explicitly specifying locks in the LOCK statement. These locks are then assigned to the transaction that contains this LOCK statement.
Individual rows of a table can be locked by specifying a LOCK option in an SQL statement. The LOCK option can also be used to change the isolation level for the specified SQL statement, and thereby the locks for the complete table.
Explicit lock requests are possible with every isolation level.

If the database system has to wait too long for locks to be released when setting explicit or implicit locks, it issues a return code to this effect. The user can then respond to this return code, e.g., by terminating the transaction. In this case, the database system does not execute an implicit ROLLBACK WORK.

Release Locks

The locks assigned to a transaction are usually released at the end of the transaction, making the respective database objects accessible again to other transactions.

The locks assigned to a transaction by the LOCK statement are usually released when the transaction ends provided that the COMMIT statements or the ROLLBACK statements that end a transaction do not contain a LOCK statement.

· The length of time for which an implicit shared lock is maintained also depends on the isolation level. Exclusive locks set implicitly cannot be released within a transaction.

· Exclusive locks for rows that have not yet been modified and shared locks on rows can be released by the UNLOCK statement before the end of the transaction.

· Exclusive locks on updated rows, exclusive locks that were requested by an SQL statement that leads to a change (INSERT/UPDATE/DELETE), and table blocks cannot be released within a transaction, only after the transaction has ended.


Isolation Level (SAP Library - SAP DB)

 Entering content frame

Background documentation Isolation Level

The lock mode plays an important part in the lock behavior. The lock mode is determined by specifying an isolation level.

By defining an isolation level, you specify whether and how shared locks and exclusive locks are implicitly requested or released (Requesting and Releasing a Lock).

The selected isolation level affects both the degree of concurrency and the guaranteed consistency.

· A high degree of concurrency is characterized by a state in which a maximum number of concurrent transactions can process a database without long waiting periods for locks to be released.

· As far as consistency is concerned, phenomena can arise through concurrent access to the same database at different isolation levels.

The lower the value of the isolation level, the higher the degree of concurrency and the lower the guaranteed consistency. This means that a compromise between concurrency and consistency that best suits the requirements of the application at hand must always be found.

You can use the CONNECT statement to help define the isolation level you require. The following isolation levels exist:

Isolation Level 0 (uncommitted)

Isolation Level 1 or 10 (committed)

Isolation Level 15

Isolation Level 2 or 20 (repeatable)

Isolation Level 3 or 30 (serializable)


Isolation Level 0 (SAP Library - SAP DB)

 Entering content frame

Object documentation Isolation Level 0

If isolation level 0 (uncommitted) is specified, rows can be read without shared locks being requested, that is to say, shared locks are not implicitly requested. For this reason, there is no guarantee that a given row will still be in the same state when it is read again within the same transaction as when it was accessed earlier, since it may have been modified in the meantime by a concurrent transaction.

Furthermore, there is no guarantee that the state of a row that was read has already been recorded in the database using COMMIT WORK.

When rows are inserted, updated or deleted, implicit exclusive locks are assigned to the transaction for the rows concerned. These cannot be released until the end of the transaction.

Isolation level 0 is suitable for applications that use their own methods to enable concurrent access to objects, so guaranteeing concurrent access throughout the database system.


Isolation Level 1 or 10 (SAP Library - SAP DB)

 Entering content frame

Object documentation Isolation Level 1 or 10

If isolation level 1 or 10 (committed) is specified, a shared lock is assigned to the transaction for a read row R1 of a table. When the next row R2 in the same table is read, the lock on R1 is released and a shared lock is assigned to the transaction for the row R2.

For data retrieval using a QUERY statement, the database system ensures that, at the time each row is read, no exclusive lock has been assigned to other transactions for the given row. It is impossible to predict, however, whether a query statement causes a shared lock for a row of the specified table or not and for which row this may occur.

When rows are inserted, updated or deleted, implicit exclusive locks are assigned to the transaction for the rows concerned. These cannot be released until the end of the transaction.


Isolation Level 15 (SAP Library - SAP DB)

 Entering content frame

Object documentation Isolation Level 15

The following rules apply if isolation level 15 is specified:

For all SQL statements, the behavior described for isolation level 1 or 10 also applies for isolation level 15: The only difference is that, with isolation level 15, shared locks are requested for all the tables addressed by the SQL statement before processing starts. When the sql statement generates a result table that is not physically stored, these locks are not released until the end of the transaction or until the result table is closed. Otherwise, they are released immediately after the sql statement has been processed.

When rows are inserted, updated or deleted, implicit exclusive locks are assigned to the transaction for the rows concerned. These cannot be released until the end of the transaction.


Isolation Level 2 or 20 (SAP Library - SAP DB)

 Entering content frame

Object documentation Isolation Level 2 or 20

If isolation level 2 or 20 (repeatable) is specified, shared locks are requested for all the tables addressed by an SQL statement data query before processing starts.

When an sql statement generates a result table that is not physically stored, these locks are not released until the end of the transaction or until the result table is closed. Otherwise, they are released immediately after the sql statement has been processed. This table shared lock is not assigned to the transaction in the case of SQL statements in which just one table row is processed that is determined by key specifications or by CURRENT OF <result_table_name>.

In addition, an implicit shared lock is assigned to the transaction for each row read while an sql statement is being processed. These locks can only be released with the UNLOCK statement or by ending the transaction.

When rows are inserted, updated or deleted, exclusive locks are assigned implicitly to the transaction for the rows concerned. These cannot be released until the end of the transaction. However, no locks are set for the entire table.


Isolation Level 3 or 30 (SAP Library - SAP DB)

 Entering content frame

Object documentation Isolation Level 3 or 30

If isolation level 3 or 30 (serializable) is specified, a table shared lock is implicitly assigned to the transaction for every table addressed by an SQL statement.

These shared locks cannot be released until the end of the transaction. This table shared lock is not assigned to the transaction in the case of SQL statements in which just one table row is processed that is determined by key specifications or by CURRENT OF <result_table_name>.

When rows are inserted, updated or deleted, exclusive locks are assigned implicitly to the transaction for the rows concerned. These cannot be released until the end of the transaction.


Phenomena (SAP Library - SAP DB)

 Entering content frame

Background documentation Phenomena

During processing of concurrent transactions , unclarified situations, or "phenomena" can arise. When you define the lock behavior in your database system, you should take account on the ways of avoiding these phenomena.

The following phenomena can occur if the same data is accessed concurrently:

  • Dirty Read
  • Non-Repeatable Read
  • Phantom

The lock mode if defined via the isolation level ( Requesting and Releasing a Lock ). Depending on the isolation level you determine, you can prevent these phenomena from occurring.

The following table provides an overview of which phenomena can occur in the individual isolation levels:

 | Isolation Level 0 | Isolation Level 1 | Isolation Level 2 | Isolation Level 3
Dirty Read | + | - | - | -
Non-Repeatable Read | + | + | - | -
Phantom | + | + | + | -


Dirty Read (SAP Library - SAP DB)

 Entering content frame

Background documentation Dirty Read

One of the phenomena that can occur during processing of concurrent transactions is the dirty read phenomenon.

A row is modified in the course of a transaction T1, and a transaction T2 reads this row before T1 has been concluded with the COMMIT statement. T1 then executes the rollback statement, i.e. T2 has read a row that never actually existed.


Non-Repeatable Read (SAP Library - SAP DB)

 Entering content frame

Background documentation Non-Repeatable Read

One of the phenomena that can occur during processing of concurrent transactions is the non-repeatable read phenomenon.

A transaction T1 reads a row. A transaction T2 then modifies or deletes this row, concluding with the commit statement. If T1 subsequently reads the row again, it either receives the modified row or a message indicating that the row no longer exists.


Phantom (SAP Library - SAP DB)

 Entering content frame

Background documentation Phantom

One of the phenomena that can occur during processing of concurrent transactions is the phantom phenomenon.

A transaction T1 executes an SQL statement S that reads a set M of rows that fulfill a search condition . A transaction T2 then uses the insert statement or the update statement to create at least one additional row that satisfies the search condition. If S is subsequently re-executed within T1, the set of read rows will differ from M.


SAP DB as UNICODE Database (SAP Library - SAP DB)

 Entering content frame

Component documentation SAP DB as UNICODE Database

SAP DB can be used as a UNICODE database.

  • UNICODE
  • Installing a UNICODE-Enabled Database
  • UNICODE and SQL
  • UNICODE in Programming Languages


UNICODE (SAP Library - SAP DB)

 Entering content frame

Background documentation UNICODE

Data types such as CHAR ASCII and CHAR EBCDIC are mainly suited to English and central European languages. With other character sets, a code attribute is usually used for these data types. This code attribute uses a different presentation code to ASCII and EBCDIC, even for internal storage in the database system. This causes problems if you want to access these database systems using a different character set, or if you want to exchange data between database systems with different character sets.

You can avoid these problems by using internal character coding in accordance with UNICODE. Internally, the UNICODE data is stored in UTF-16/UCS-2 format. In UTF-16/UCS-2 format, all characters are two bytes long.
SAP DB is able to display various presentation codes in UNICODE format (UNICODE code in line with ISO 10646, page 1).

Metadata in UNICODE

The names of the database objects (such as table or column names) can be stored internally in UNICODE and can therefore then be displayed in the required presentation code in the database tools.

Application data in UNICODE

SAP DB supports the code attribute UNICODE for the data types CHAR[ACTER], VARCHAR and LONG[VARCHAR].

See also:

Installing a UNICODE-Enabled Database

Reference Manual, Code attribute


Installing a UNICODE-Enabled Database (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Installing a UNICODE-Enabled Database

To make storage of metadata and application data in UNICODE , proceed as follows:

Metadata in UNICODE

When installing the database instance, set the database parameter _UNICODE to YES.

Application data in UNICODE

  1. When installing the database instance, set the database parameter _UNICODE to YES.
  2. Enter the code attribute UNICODE.

Please note that SAP DB UNICODE data is stored internally in UTF-16/UCS-2 format. As a result, double the space is required to store the UNICODE data in the database instance.

Procedure

Setting Database Parameter _UNICODE

Setting Code Attribute UNICODE


Setting the Database Parameter _UNICODE (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting the Database Parameter _UNICODE

In order to install a UNICODE-enabled database, the database parameter _UNICODE must be set to YES.

Note that you cannot change the database parameter _UNICODE once it has been set.

You can use the Database Manager to set the database parameter _UNICODE when you install the database instance.

Database Manager GUI

...

1. Start the Database Wizard.

2. Perform the first five installation steps.

3. In step 6 (Parameters), choose Extended.

4. Set the _UNICODE parameter to YES.

5. Continue with the installation.

See also: Database Manager GUI 7.4, section Creating or Initializing a New Database Instance

Database Manager CLI

A script with configuration information for the database instance contains, among other things, lines for definition of the database parameters. You must insert the following line at this point:

param_put _UNICODE YES

See also: Database Manager CLI 7.4, Changing the Value of a Database Parameter


Setting Code Attribute UNICODE (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Code Attribute UNICODE

To be able to store the application data in UNICODE, the database must be UNICODE-enabled and you must set the code attribute UNICODE for the required application data (Installing a UNICODE-Enabled Database). You can set the code attribute in the following ways:

· Database parameter DEFAULT_CODE is not set to value UNICODE:

...

¡ If you specify the code attribute UNICODE in the column definition, then the application data is stored in UNICODE, only for this column.

¡ If you do not enter a code attribute, the code entered in the parameter DEFAULT_CODE is used for these column values.

· Database parameter DEFAULT_CODE is set to value UNICODE:

If you do not specify a code attribute or specify the code attribute UNICODE in the column definition, then the application data is stored in UNICODE for this column.

¡ If you specify a different code attribute, the data is stored using this code attribute.

Database parameter DEFAULT_CODE is set to value UNICODE.

Column definition | Result
CHAR (n) UNICODE | UNICODE column
CHAR (n) | UNICODE column
CHAR (n) ASCII | ASCII column
CHAR (n) BYTE | Code neutral, that is, the column values are not converted by the database system

For information on setting database parameters, see the following documentation:

· Database Manager GUI, Displaying and Changing Database Parameters

· Database Manager CLI, Changing the Value of a Database Parameter


UNICODE and SQL (SAP Library - SAP DB)

 Entering content frame

Background documentation UNICODE and SQL

UNICODE can be used for metadata, application data and in SQL statements if installation of a UNICODE-enabled database has been carried out.

UNICODE for Metadata

If the database is UNICODE-enabled, all columns in the system tables that can be used to request the metadata have a data type with the code attribute UNICODE.

UNICODE for Application Data

To make application data UNICODE-enabled, you must set the UNICODE code attribute in a UNICODE-enabled database for the required application data. The UNICODE code attribute can be used for the data types CHAR[ACTER] (n), VARCHAR (n) and LONG[VARCHAR]:

· CHAR[ACTER] (n) UNICODE

· VARCHAR (n) UNICODE

· LONG[VARCHAR] UNICODE

Example 1 illustrates the definition of Java class TableDef. Java class TableDef can be used to display the results of various column definitions.

Displaying the Column Definition of a Table

java TableDef <jdbcurl> <table_name>

Creating a temporary table using the determined column definitions, and displaying these column definitions

<command> ::= java TableDef <jdbcurl> <table_name> <column_definition>

<jdbcurl> ::= jdbc:sapdb:<database_name>?user=<user_name>&password=<password>

java TableDef jdbc:sapdb:TST?user=TEST&password=TEST DUMMY a varchar (20)

TABLE: DUMMY
A: VARCHARASCII (20)

UNICODE in SQL Statements

SQL statements can contain both UNICODE literals and UNICODE identifiers. The prerequisite for implementing these SQL statements is a UNICODE-enabled client (C/C++-Precompiler, JDBC, ODBC, SQL Studio or Web SQL Studio).

The prerequisite for using UNICODE in the SQL Studio and Web SQL Studio is that a UNICODE-enabled ODBC has been installed. SQL Studio and Web SQL Studio are used on the operating system Windows 2000. This operating system supports UNICODE.


Example 1 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example 1

The Java class TableDef can be used to display the results of various column definitions (see UNICODE and SQL , section UNICODE for application data).

TableDef Definition

import java.sql.*;
/**
 *
 */
public class TableDef
{
    private Connection connection;
    /**
     * creates a new TableDef
     */
   public
    TableDef (
        String url)
    throws SQLException, ClassNotFoundException
    {
        // load class
        Class.forName ("com.sap.dbtech.jdbc.DriverSapDB");
        // create connection
        this.connection = DriverManager.getConnection(url,
            new java.util.Properties ());
        this.connection.setAutoCommit (false);
    }
    /**
     *
     */
    protected void
    createTable (
        String tableName,
        String createCommand)
    throws SQLException
    {
        String fullCommand = "CREATE TABLE " + tableName + " ("
            + createCommand + " )";
        Statement stmt = this.connection.createStatement ();
        stmt.execute (fullCommand);
    }
    /**
     *
     */
    protected void
    showTableDef (
        String tableName)
    throws SQLException
    {
        System.out.println ("Table: " + tableName); //#print
        DatabaseMetaData metaData = this.connection.getMetaData ();
        ResultSet tableColumns = metaData.getColumns(null,
           metaData.getUserName (), tableName, null);
        while (tableColumns.next ()) {
            String columnName = tableColumns.getString ("COLUMN_NAME");
            String typeName = tableColumns.getString ("TYPE_NAME");
            int colSize = tableColumns.getInt ("COLUMN_SIZE");
            System.out.println ("    " + columnName
                + ": " + typeName + " (" + colSize + ")"); //#print
         }
    }
    /**
     *
     */
    protected void
    close ()
    {
        try {
            this.connection.rollback ();
            this.connection.close ();
        }
        catch (SQLException sqlExc) {
                // ignore
        }
    }
    /**
     *
     */
    static protected String
    join (
        String [] args,
        int startIndex)
    {
         if (startIndex >= args.length) {
           return null;
        }
        StringBuffer result = new StringBuffer ();
        for (int i = startIndex; i < args.length; ++i) {
            result.append(args [i]);
            result.append (' ');
        }
        return result.toString();
    }
    /**
     * used when called form the command line
     */
    public static void main (String [] args)
    throws ClassNotFoundException
    {
        String url = args [0];
        String tableName = args [1];
        String createCommand = join (args, 2);
        TableDef tableDef = null;

        try {
           tableDef = new TableDef (url);
            if (createCommand != null) {
                tableDef.createTable (tableName, createCommand);
            }
            tableDef.showTableDef (tableName);
        }
        catch (SQLException sqlExc) {
            System.out.println (sqlExc);
        }
        finally {
            if (tableDef != null) {
                 tableDef.close ();
            }
        }

    }
}


UNICODE in Programming Languages (SAP Library - SAP DB)

 Entering content frame

Background documentation UNICODE in Programming Languages

JDBC, ODBC, the C/C++ Precompiler and Python support UNICODE.

JDBC

Since Java works with UNICODE strings, it can read and write UNICODE columns.

If you also want to use UNICODE in SQL statements, you must set the unicode CONNECT-property to true. SQL statements are then transferred to the database instance in UTF-16/UCS-2 format. If the transfer package for the SQL statements is not large enough, you can increase its size using database parameter _PACKET_SIZE.

ODBC

UNICODE is supported in the ODBC driver.

Depending on your operating system, you must take account of the following factors:

Operating System |
Windows 2000 | The ODBC driver only exports the UNICODE and/or Wide functions of the ODBC-API. ANSI functions are mapped to the relevant Wide functions by the Windows Driver Manager . This means that applications can use both the ANSI and the UNICODE functions of the ODBC-API.
UNIX/Linux | The use of the ODBC driver is currently not possible on platforms for which the standard UNICODE type WCHAR_T is defined with four bytes. The database and ODBC driver process UNICODE internally as values that are two bytes long. Both the ANSI and UNICODE variants of the ODBC-API are defined in the driver. Applications that do not require the functionality of a Driver Manager can be statically linked with the ODBC driver.

C/C++ Precompiler

During CONNECT, the C/C++ Precompiler checks whether the database is UNICODE-enabled (Database parameter _UNICODE = YES).

See also: Example 2 (HelloUnicodeDB.cpc) and Working with UNICODE Data

Python

Python 2.*: UNICODE columns can be read and written. UNICODE character strings cannot be used as SQL statements.

Python 1.5.2: UNICODE-type output values are converted to ASCII. If this conversion fails, an error is reported.


Example 2 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example 2

HelloUnicodeDB.cpc is a Precompiler program that uses UNICODE host variables (see UNICODE in Programming Languages , Section C/C++ Precompiler).

HelloUnicodeDB.cpc Definition

/**********************************************************************

  module     : HelloUnicodeDB.cpc

  ---------------------------------------------------------------------

  responsible : MarcoP

  special area: demonstration program precompiler
  description : demonstration program for unicode features of SAPDB precompiler

  The following steps are needed to execute the demo program:
  1. customize the connect data in the embedded SQL program source (line 43 - 46)

  2. precompile/compile the embedded SQL program HelloUnicodeDB.cpc
     cpc [-u <userid>,<password> -d <database_name> -n <server_node>] HelloUnicodeDB

  3. linking the embedded SQL program HelloUnicodeDB.cpc
     cpclnk HelloUnicodeDB

  last changed: 2000-04-30 17:17
  see also :

  ---------------------------------------------------------------------

  copyright: Copyright by SAP AG, 2001

**********************************************************************/

/*===================================================================*
 *  INCLUDES                                                      *
 *===================================================================*/
#include <stdio.h>
#include <string.h>

/*===================================================================*
 *  DEFINES                                                       *
 *===================================================================*/

#define KNLIDNTFR 63 /* max. number of character for a unicode kernel identifier*/

 /* connect data */
#define USERID     "TEST"       /* username */
#define PASSWD     "TEST"       /* password */
#define SERVERNODE "localhost"  /* computer name */
#define SERVERDB   "TST"        /* name of database*/

/*===================================================================*
 *  MACROS                                                        *
 *===================================================================*/

/*===================================================================*
 *  LOCAL CLASSES, STRUCTURES, TYPES, UNIONS ...                    *
 *===================================================================*/

/*===================================================================*
 *  STATIC/INLINE FUNCTIONS (PROTOTYPES)                            *
 *===================================================================*/

/* print UCS2 string as 7-bit Ascii, replace non-ascii characters with '?'*/
static void printAs7bitAscii(SQLUCS2 *aUCS2Str, int length)
{
   int i;
   for (i = 0; i < length; i++) {
     if (   aUCS2Str[i] == 0x0000
         || aUCS2Str[i] == 0x0020 )
       return;
     if (   aUCS2Str[i] < 0x007f
         && aUCS2Str[i] > 0x0000)
       printf("%c",aUCS2Str[i]);
     else
       printf("?");
   }
}

/* format sql error for output */
static char *FormatSQLError(sqlcatype *sqlca)
{
  static char buffer[512];
#ifndef sql_oracle

  sprintf(buffer, "(%d):%.*s", sqlca->sqlcode,
     sqlca->sqlerrml, sqlca->sqlerrmc);
#else
  sprintf(buffer, "(%d):%.*s", sqlca->sqlcode,
     sqlca->sqlerrm.sqlerrml, sqlca->sqlerrm.sqlerrmc);
#endif
  return(buffer);
}

/*==================================================================*
 *  METHODS                                                      *
 *==================================================================*/

int main(int argc, char **argv)
{
  EXEC SQL BEGIN DECLARE SECTION;
   char *user         = USERID;
   char *pwd          = PASSWD;
   char *servernode    = SERVERNODE;
   char *serverdb      = SERVERDB;
   /* "SELECT TABLENAME FROM DOMAIN.TABLES " encoded in UCS2 */
   SQLUCS2 sqlstmt[36] = {0x0053, 0x0045, 0x004C, 0x0045, 0x0043, 0x0054, 0x0020, 0x0054, 0x0041, 0x0042,
                           0x004C, 0x0045, 0x004E, 0x0041, 0x004D, 0x0045, 0x0020, 0x0046, 0x0052, 0x004F,
                           0x004D, 0x0020, 0x0044, 0x004F, 0x004D, 0x0041, 0x0049, 0x004E, 0x002E, 0x0054,
                           0x0041, 0x0042, 0x004C, 0x0045, 0x0053, 0x0000};
   SQLUCS2 resultstring[64];
  EXEC SQL END DECLARE SECTION;

  /* set connect properties */
  EXEC SQL SET SERVERDB :serverdb ON :servernode;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* connect to database */
  EXEC SQL CONNECT :user IDENTIFIED BY :pwd;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* parse a unicode sql command and give it a statement name */
  EXEC SQL PREPARE stmt1 FROM :sqlstmt;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* declare a cursor for a prepared statement name */
  EXEC SQL DECLARE curs1 CURSOR FOR stmt1;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* open the cursor "curs1" */
  EXEC SQL OPEN curs1;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* loop over resultset */
  while (sqlca.sqlcode != 100)
  {
    /* fetch a single row into a character hostvariable encoded in UCS2 */
    EXEC SQL FETCH curs1 INTO :resultstring;
    if (sqlca.sqlcode != 0 && sqlca.sqlcode != 100) {
      printf("\n%s\n", FormatSQLError(&sqlca));
    }
    else {
      printAs7bitAscii(resultstring, KNLIDNTFR);
      printf("\n");
    }
  }

  /* close the cursor */
  EXEC SQL CLOSE curs1;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }

  /* commit and release the session */
  EXEC SQL COMMIT WORK RELEASE;
  if (sqlca.sqlcode != 0 ) {
    printf("\n%s\n", FormatSQLError(&sqlca));
  }
}

/*===================================================================*
 *  END OF CODE                                                   *
 *===================================================================*/


SAP DB Version 7.4 (SAP Library - SAP DB)

 Entering content frame

Component documentation SAP DB Version 7.4

Development of the independent SAP DB software was begun in 1997 on the basis of version 6.1. Since then, SAP AG has significantly further developed and improved the SAP DB technology. The most important parts of the original software package have been completely redesigned and integrated into the SAP DB software. In this way, SAP DB meets the demands placed on a modern database system: high performance, high availability, simple operation, and low costs for the database operator.

· SAP DB Improvements Since 1997

· Technical Specification of SAP DB Version 7.4

· New Developments in SAP DB Version 7.4

· Supported Operating Systems and Platforms


SAP DB Improvements Since 1997 (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Improvements Since 1997

  • Optimized checkpoint handling
  • Parallel creation of indexes
  • Parallel backup and restore
  • Optimized locking and logging
  • Better handling of "log full" and "database full" errors
  • Interactive support for the restore process
  • Reduced converter cache size (factor 10)
  • Improved monitoring and diagnostics
  • Unicode support (UTF-16)
  • Support for the Linux operating system
  • 64 bit UNIX versions as operating system platform
  • New database tools


Technical Specification of SAP DB Version 7.4 (SAP Library - SAP DB)

 Entering content frame

Background documentation Technical Specification of SAP DB Version 7.4

Restrictions

 | Maximum Value
Size of data area | 32 TB (with 8 KB page size)
Number of data volumes per database | Default value: 256 You can use the database parameter DEVNO_BIT_COUNT to set a value between 64 and 4096 when you install the database system
Size of a data volume | Default value: 128 GB Depends on the number of data volumes
Size of the log area. | 32 TB
SQL statement length | >= 16 KB (Default value 64 KB, defined by a database parameter)
SQL character string length | Defined by a database parameter
Identifier length | 32 characters
Numeric precision | 38 places
Number of tables | unlimited
Number of columns per table (with KEY) | 1024
Number of columns per table (without KEY) | 1023
Number of primary key columns per table | 512
Number of columns in an index | 16
Number of foreign key columns per table | 16
Number of the columns in an ORDER or GROUP clause | 128
Number of columns in a SELECT statement | 1023
Number of columns in an INSERT statement | 1024
Number of columns in a results table | 1023
Number of join tables in a SELECT statement | 64
Number of triggers per Basis table | 3
Number of indexes per table | 255
Number of referential CONSTRAINT definitions (foreign key dependencies) per table | unlimited
Number of references per table | unlimited
Number of rows per table | limited by database size
Internal length of a table row | 8088 bytes
Total of internal lengths of all key columns | 1024 bytes
Total of internal lengths of all columns belonging to an index | 1024 bytes
Internal length of a LONG column | 2 GB
Length of the columns in an ORDER or GROUP clause | 1020 bytes
Nested trigger levels | unlimited
Nested subqueries | 127
Number of join conditions in a WHERE clause of a SELECT statement | 128
Number of correlated columns in an SQL statement | 64
Number of correlated columns in an SQL statement | 16
Number of parameters in an SQL statement | 2000


New Developments in SAP DB Version 7.4 (SAP Library - SAP DB)

 Entering content frame

Background documentation New Developments in SAP DB Version 7.4

I/O Management

· No system volume
There is no longer a system volume.
The converter pages are all distributed across all data volumes.

· No converter cache
The converter pages and data pages are kept in a shared I/O buffer cache.
You now only require the database parameter CACHE_SIZE for the configuration of the size of the I/O buffer cache.

· Parallel converter queries (multi-region converter)
The converter can now be accessed in multiple critical regions at the same time.

· It is possible to read from and write to the converter simultaneously.

Database Size Can Be Reduced

· The size of the database is independent of the largest page number used for a data page. In some circumstances, gaps in the sequence of the page numbers can mean that the database is significantly smaller than suggested by the highest number.

Log Management

See also log concept in Background Knowledge: SAP DB and log settings.

· Abolition of the log cache
Log entries are created directly in the log wait queue.

· Before and after images split
Before images are stored in transaction-specific undo log files in the data area.
After images are stored in the log area.

· Parallel writing of before images
For transactions, the before images are saved in transaction-specific undo log files, independent of other transactions.

· The overwrite mode setting is no longer connected to the log mode.

· You can temporarily deactivate the redo log management.

Data backups

· Checkpoints are obsolete.

· Each data backup is consistent internally. This means that you can start the database instance after importing the data backup without needing to import log entries. The state of the data then matches the state when the data backup was started. You can use the log entries in the log area or in log backups to restore the state of the database instance to a chosen time after the data backup.

· Incremental data backups contain all changes since the last complete data backup
This simplifies the restore process. When you restore the database instance, you need only to import the last complete data backup and the last incremental data backup, as well as the log entries required for your chosen point-in-time.


Supported Operating Systems and Platforms (SAP Library - SAP DB)

 Entering content frame

Background documentation Supported Operating Systems and Platforms

SAP DB Version 7.4 supports the following operating systems and platforms:

· Compaq Tru64 Unix (Alpha)

· HP-UX (HP-PA)

· IBM AIX (PowerPC)

· Linux (i386, ia64)

· SUN Solaris (SPARC)

· Microsoft Windows 2000 (i386)

· Microsoft Windows XP (i386)

· Microsoft Windows Server 2003 (i386, ia64)

liveCache does not support Microsoft Windows XP.


SAP DB Documentation (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Documentation

The following tables provide an overview of the SAP DB documentation.

Basic Information

Title | Explanation
The SAP DB Database System | Introduction to the SAP DB database system: architecture, directory structure, database parameters, database tools, user and security concepts, overview of the documentation, terminology, and so on.
Background Knowledge: SAP DB 7.4 | Background knowledge about the SAP DB database system, such as the log concept, B*-trees, shadow databases
Reference Manual: SAP DB 7.4 | SQL statements and their syntax
SQL Mode ORACLE: SAP DB 7.4 | Special features of SQL statements in the SQL mode ORACLE
System Tables: SAP DB 7.4 | SAP DB system tables and their evaluation
Optimizer: SAP DB 7.4 | Functions of the SAP DB Optimizer
Messages 7.4 | List of all SAP DB messages
Structure link User Manual: liveCache | Notes about monitoring the liveCache, only required by SAP customers
SAP High Availability | Conditions for guaranteeing the high availability of an SAP system Only required by SAP customers

Tools

Title | Explanation
Database Manager · Database Manager GUI: SAP DB 7.4 · Web DBM 7.4 · Database Manager CLI: SAP DB 7.4 | Creating and managing database instances · Graphical user interface · Web-based user interface · Command line-oriented user interface
Connecting External Backup Tools | Configuring the SAP DB software to use various external backup tools
Database Analyzer | Analysis of the performance of database instances
Loader 7.4 | Loading and unloading data
Query Tools · SQL Studio 7.4 · Web SQL Studio 7.4 | Data queries and data processing · Graphical user interface · Web-based user interface
SAP DB WebDAV GUI | Web-based application for indexing XML documents in the SAP DB WebDAV service

Installation Documentation

Title | Explanation
Database Software Installation Guide 7.4 | Standard installation, update, and uninstallation of all SAP DB software
Web Tools Installation Guide | Installation of SAP DB Web Tools
Installation Manual | Installation, update and uninstallation of installation profiles and individual SAP DB software components, updates of database instances, including software
SAP Web Application Server Installation on UNIX | Installation of an SAP system with a SAP DB database on UNIX Available only to SAP customers on the SAP Service Marketplace
SAP Web Application Server Installation on Windows NT | Installation of an SAP system with a SAP DB database on Microsoft Windows Available only to SAP customers on the SAP Service Marketplace
SAP Web Application Server 630: Homogeneous and Heterogeneous System Copy | Copy of the SAP system Available only to SAP customers on the SAP Service Marketplace

Interfaces

Title | Explanation
C/C++ Precompiler User Manual | Options for the C/C++ Precompilers, Embedded SQL
ODBC Manual: SAP DB | Basics and special features of the SAP DB ODBC driver

Development

Title | Explanation
Development Environment | Usage of the development environment
Source Text for Tools | Creating source texts
Web Based Problem Tracking System | Web interface for internal SAP DB program PTS (Problem Tracking System) for documenting problem messages about SAP DB software

Database Administration in CCMS

(Only for SAP customers)

Title | Explanation
Database Administration in CCMS OLTP | Using the SAP system to analyze and monitor a SAP DB database instance, scheduling actions, alert monitoring
Structure link Database Administration in CCMS: liveCache | Using the SAP system to analyze a liveCache database instance, alert monitoring

Access to SAP DB Documentation

You can access SAP DB documentation in the following ways:

· For current SAP DB documentation and other important information, see the SAP DB Homepage at http://www.sapdb.org:
Choose Documentation ® SAP DB Online Library or Download.

· For SAP DB documentation for SAP systems, see the Help Portal at http://help.sap.com:
Choose SAP NetWeaver ® SAP Web Application Server ® SAP Web Application Server <release> ® <language> ® SAP NetWeaver Components ® SAP DB.

· For liveCache documentation for SAP systems, see the Help Portal at http://help.sap.com:
Choose SAP NetWeaver ® SAP Web Application Server ® SAP Web Application Server <release> ® <language> ® SAP NetWeaver Components ® liveCache.

· For high availability documentation for SAP systems, see the Help Portal at http://help.sap.com:
Choose SAP NetWeaver ® SAP Web Application Server ® SAP Web Application Server <release> ® <language> ® SAP NetWeaver Components ® SAP Web Application Server ® Computing Center Management System ® SAP High Availability.

· For installation guides for SAP solutions, see the SAP Service Marketplace at http://service.sap.com (available to SAP customers only):
Choose Installation/Upgrade Guides.
Choose SAP NetWeaver in Detail ® Solution Life-Cycle Management ® Installation ® Installation and Upgrade Guides ® SAP Web Application Server.


Terms (SAP Library - SAP DB)

 Entering content frame

Component documentation Terms

After Images | Application data | Automatic log backup
Availability |  |
B* tree | Backing up | Backup history
Backup ID | Backup medium | Before images
Cache | Catalog | Catalog cache
COMMIT | Complete data backup | Configuration files
Console | Converter |
Data area | Data backup | Data cache
Data page | Data volume | Data Writer
Database administrator | Database Analyzer | Database catalog
Database consistency | Database console | Database instance
Database instance type | Database Manager | Database Manager CLI
Database Manager GUI | Database Manager operator (DBM operator) | Database name
Database parameters | Database session | Database structure check
Database tools | Database trace | Database user
DBA user | DBM operator | DBM Server
DBMCLI | DBMGUI | Dev thread
Dirty read | DOMAIN |
Exclusive lock | External backup ID | External backup medium
External backup tool |  |
Garbage Collector | Group of parallel backup media |
History file | History list | Homogeneous system copy
I/O buffer cache | Incremental data backup | Instance type
Interactive log backup | Isolation level |
Kernel |  |
Language support (Mapchar sets) | liveCache | Loader
Loader Server | Loading data | Lock
Log area | Log backup | Log entry
Log files | Log mode | Log queue
Log segment | Log settings | Log volume
Log Writer | Logging |
Multiprocessor configuration |  |
Naming conventions for backup media | Normal log backups |
Online logging | Operational state | Optimistic lock
Optimizer |  |
Page | Page pool | Pager
Parallel backup | Password |
Query tools |  |
Redo list | Redo log entry | Redo log file
Redo log management | Redo Log Manager | RESOURCE
Restart | Restore | Role concept
ROLLBACK | Run directory |
SAP DB Document Server | SAP DB E-Catalog | SAP DB OLAP
SAP DB OLTP | SAP DB user classes | Savepoint
Server task | Session | Shared lock
Special Thread | SQL lock | SQL mode
SQL Studio | Standby database | SYSDBA
System tables |  |
Task | Task state | Thread
Timeout value | Timer Task | Trace Writer Task
Transaction | Transaction file | Transaction list
Undo log entry | Undo log file | Undo log management
UNICODE | Unloading data | User
User groups | User Kernel Thread | User task
Utility task |  |
Variables | Version file | Version notation
Volume |  |
Web DBM | Web-Server | Web SQL Studio
X Server |  |


Operational State (SAP Library - SAP DB)

 Entering content frame

Background documentation Operational State

The following operational states exist for a database instance:

· ONLINE: The database instance has been started, and users can log on.

· ADMIN: The database instance is only available to administrators for administrative work.

· OFFLINE: The database instance is not running.


COMMIT (SAP Library - SAP DB)

 Entering content frame

Background documentation COMMIT

In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a COMMIT, a new transaction is implicitly opened.

In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.


Database Console (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Database Console

The Database Console (program X_CONS) is a tool that gives you a quick overview of the operating system resources being used by the database system, the distribution of the database sessions among the operating system threads, and the status of the active database sessions.

· Windows
The console thread, a special thread, processes requests from the Database Console. To do this, the X_CONS program communicates with the console thread.

· UNIX
The database console receives some of the information it requires directly from the shared memory area of the database kernel, and some of the information from the communication between X_CONS and the console thread.

Database Console Commands

You have the following options for using the Database Console:

· Starting the X_CONS program from the operating system level:
x_cons <database_name> <command> [<time>] [<count>]
For an overview of all possible commands, use the command:
x_cons <database_name> help

· If you are using an SAP system, you can call the database console from the CCMS.
For details on this, see the following documentation:
Database Administration in CCMS OLTP, section Database Console
Database Administration in CCMS: liveCache, section Console


Database Name (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Name

In principle, the name of a database instance is freely definable, but must meet the following conditions:

· The maximum length of a database name is 8 characters.

· The database name can contain the characters from the 7-bit ASCII character set.

· The database name can start with a letter or a number.

· The database system does not distinguish between uppercase and lowercase characters.


Database Session (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Session

When you create a user, a password is assigned to it. In order to work with a database instance , users must enter a user name and password that the database system recognizes.

When a user enters a correct user name and password, they are granted access to the database instance. This opens a database session and automatically calls up the initial transaction.

You can only work with the database instance within a database session. Users must end each session explicitly.

If the user does not belong to a user group, the "Current User" is the user name they entered to gain access to the database instance. If, on the other hand, the user does belong to a user group, the "Current User" is name of the user group.

See also:

User Concept


Unloading Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Unloading Data

You can unload the database catalog and/or application data of a database instance or parts of the database catalog or application data using the Loader.

You can send the data stream generated by doing this to various media. You can also use a tape as a medium. This is addressed using an external backup tool (Unloading with External Backup Tools).

Data unloaded with the Loader is not suitable for a restore of a database instance, as the consistency of the data is not ensured. Unloaded data cannot therefore replace data backups.


Loading Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Loading Data

You can load the database catalog and/or application data of a database instance or parts of the database catalog or application data using the Loader. You can import the data stream required to do this from various media. You can also use a tape as a medium. This is addressed using an external backup tool (Unloading with External Backup Tools).

Data unloaded with the Loader is not suitable for a restore of a database instance, as the consistency of the data is not ensured. Loading data cannot therefore replace a restore from a data backup.


Page Pool (SAP Library - SAP DB)

 Entering content frame

Object documentation Page Pool

The page pool is used to manage the pages of the I/O buffer cache . The pages of the I/O buffer cache are dynamically assigned to the Converter and the data cache using the information in the page pool.


Checking the Database Structures (SAP Library - SAP DB)

 Entering content frame

Object documentation Checking the Database Structures

You can check the database structures. There are two ways to do this:

· Checking the database structures for all tables and indexes (CHECK DATA)

· Checking the database structures for selected tables (CHECK TABLE)

Checking a database structure takes a long time. You should therefore only schedule the check at times when there is a low database load (on a weekend, for example).

Check the database structure as infrequently as possible, however, at least once during a backup history. Also make sure that you remove a backup from the backup history only if a database structure check was performed after the backup was made.

Checking the database structures for all tables and indexes (CHECK DATA)

You can perform this database structure check in the operational state ADMIN or ONLINE. The B* trees of the tables and indexes are checked. In the case of the database instance type liveCache, the corresponding liveCache structures are also checked.

If a data page flagged as BAD is found more than once when the database instance is ONLINE, then the corresponding B* tree or liveCache structure is also flagged as BAD. You can clean up this situation by checking the database structure.

If you check the database structure in the operational state ADMIN, any pages that are no longer referenced are taken out of the Converter.

Procedure

Database Manager GUI: SAP DB 7.4, section Checking Database Structures

Database Administration in CCMS OLTP, section Scheduling a Database Structure Check

Database Administration in CCMS: liveCache, section Checking the Database Structures

Checking the Database Structures for Selected Tables (CHECK TABLE)

You can make this database structure check in the operational state ONLINE only. You can check individual tables. If a data page flagged as BAD is found when the database instance is ONLINE (and hence a B* tree flagged as BAD), then you can clean up this situation by checking the database consistency.

Procedure

· Checking a table
Database Administration in CCMS OLTP, section Tables/Views

· Checking all tables
Database Administration in CCMS OLTP, section Scheduling a Database Structure Check


Restart (SAP Library - SAP DB)

 Entering content frame

Background documentation Restart

When the database system is restarted, all the available redo log entries from the log area are reproduced, and if necessary, undo log entries are evaluated in order to roll back transactions.

The system starts with the status of he database system that was recorded with the last savepoint.

...

See also Restartability, and in Background Knowledge: SAP DB, under Restart or Recovery


ROLLBACK (SAP Library - SAP DB)

 Entering content frame

Background documentation ROLLBACK

In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

· Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

· As a result of a ROLLBACK, a new transaction is implicitly opened.

In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.


Savepoint (SAP Library - SAP DB)

 Entering content frame

Object documentation Savepoint

The system carries out a backup action at regular intervals for the most important database information. This backup action is known as a savepoint.

It writes all changed pages held in the data cache to the data area.

· The data cache contains, among other things, the undo log files. As these are also permanently backed up to the data area by a savepoint, the database instance can be restored to a transaction-consistent state in a restart.

· At the time of a savepoint, the data of all open transactions is written to the transaction file.

See also log concept in Background Knowledge: SAP DB.


Page (SAP Library - SAP DB)

 Entering content frame

Object documentation Page

A page is a basic physical unit of disk input and output, that is, a page corresponds to a certain number of blocks. Storage and disk space is often measured in pages.

For the SAP DB database system, the page size is fixed at 8 KB.


Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Backup

You should perform the following backups for the SAP DB database system in accordance with the strategy that you have chosen for backing up data:

· Data backup

· Log backup

All backups can be carried out on an individual backup medium, and data backups can also be carried out on a group of parallel backup media.

Follow the naming conventions for backup media.


Language Support (MapChar Sets) (SAP Library - SAP DB)

 Entering content frame

Background documentation Language Support (MapChar Sets)

A Mapchar set is a character set used to convert language-specific characters to this character set. This allows you to convert characters. MapChar sets enable country-specific letters to be mapped to one or two non-country-specific letters (for example, representation of "ü" as "ue").

The underlying code (ASCII, EBCDIC, UNICODE) must match for the characters to be replaced and the Mapchar set.

Mapchar sets are only of significance for internal system functions. For example, Mapchar sets are used by the MAPCHAR(x,n,i) SQL function to sort fields containing umlauts.

· When the database instance is configured, a conversion of these country-specific letters is implicitly allowed and stored under the Mapchar set name DEFAULTMAP (defined as ASCII).

· If a Mapchar set is defined as UNICODE, then it can be used for UNICODE values only.

· A Mapchar set that is not defined as UNICODE cannot be used for UNICODE values.

The DEFAULTMAP Mapchar set can be changed. Additional MapChar sets can also be defined.

You can use the Database Manager to create, display, change, or delete Mapchar sets. Proceed as described in the documentation Database Manager GUI: SAP DB 7.4, sections Creating Mapchar Sets, Displaying, Changing and Deleting Mapchar Sets.


SQL Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Mode

The SAP DB database system is capable of executing database applications that are written in accordance with one of the following definitions:

  • INTERNAL: internal database system definition
  • ANSI: ANSI standard in accordance with ANSI X3.135-1992, entry SQL
  • DB2: Definition DB2 Version 4
  • ORACLE: Definition ORACLE7

When you log on to the database system, you can select one of the definitions listed above (see CONNECT Statement ). The default SQL mode is INTERNAL.

The database system is capable of checking new applications to ascertain whether they correspond to one of the above definitions. In particular, this means that no extensions that go beyond the selected definition are regarded as correct.

Support of other SQL modes is restricted with regard to DDL statements.

SQL Mode ORACLE


Timeout Value (SAP Library - SAP DB)

 Entering content frame

Object documentation Timeout Value

The timeout value defines the maximum period of inactivity during a database session. The inactivity period is the time interval between the completion of an SQL statement and the next SQL statement. The database session is terminated with a ROLLBACK WORK RELEASE when the specified maximum inactivity period is exceeded.

Timeout values are specified in seconds.

Setting the Timeout Value

You set the timeout value with a database parameter and, if necessary, SQL statements.

· The default timeout value for all users is set with the database parameter SESSION_TIMEOUT.

· You can use a CREATE USER statement or an ALTER USER statement to define a user-specific timeout value.

· You can use a CREATE USERGROUP statement or an ALTER USERGROUP statement to define a timeout value for a group of users. If a user belongs to a user group that has a timeout value, then this value is also the user-specific timeout value.

· When a user connects to the database instance, the current timeout value is determined:
If the user-specific timeout value is larger than the timeout value defined with SESSION_TIMEOUT, or if there is no user-specific timeout value, then the current timeout value is the one defined in SESSION_TIMEOUT. Otherwise, the current timeout value is the user-specific timeout value.

· You can specify a timeout value when you connect to the database instance (CONNECT statement). This timeout value must be less than or equal to the current timeout value.
If you do not specify a timeout value, then the current timeout value that the system has determined is valid.


Transaction (SAP Library - SAP DB)

 Entering content frame

Background documentation Transaction

A transaction is a series of database operations that form a unit with regard to data backup and synchronization.

Transactions are closed with COMMIT or ROLLBACK.

See also Lock Behavior and Reference Manual, Transaction


Version File (SAP Library - SAP DB)

 Entering content frame

Object documentation Version File

If, during a log backup, you use a backup medium that refers to a file, the content of the log area is copied to files known as “version files.” One version file is generated for each log segment.

The names of the generated version files consist of the version file name entered during definition of the backup medium, and a number that the database system assigns in sequence during backup of the log segments.

Archive the version files as described in Backing Up.


Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Variables

The following table shows which variables are used in the SAP DB documentation.

<arch>

Name of the operating system architecture in the path specifications

<build>

Build number of the SAP DB software

<database_name>

Name of the database instance

<database_server>

Name of the host on which the database instance is installed

<dba_user>

Name of the database administrator (DBA user)

<dbm_user>

Name of the Database Manager operator

<dependent_path>

Location of the server software that is dependent on the database version
This path must be unique. Many different directories with different versions can exist alongside each other.
Any programs in these version-specific directories are not executed directly by the user; instead, they are called by programs located in <independent_program_path>.

For an RPM-based installation (Linux), this directory is defined as follows:
/opt/sapdb/depend74

<domain_user>

Name of the DOMAIN user

<group>

UNIX/Linux: Name of the group of the SAP DB software

<independent_data_path>

Location of the data, configuration, and run directories of SAP DB database instances and SAP DB applications

For an RPM-based installation (Linux), this directory is defined as follows:
 /var/opt/sapdb/indep_data

<independent_program_path>

Location of the programs and libraries shared by the SAP DB database instances and SAP DB applications
Choose a directory that has a large enough memory for any future enhancements of the client software.

For an RPM-based installation (Linux), this directory is defined as follows:
/opt/sapdb/indep_prog

<inst_profile>

Name of the installation profile

<os>

Name of the operating system in the path specifications

<os_user>

Name of the operating system user

<owner>

UNIX/Linux: Name of the owner of the SAP DB software

<package_directory>

Directory where the software package is located after it has been installed

<package_name>

Logical name of the software package

<password>

Password

<path>

Path specification

<program_path>

Standard Microsoft Windows directory for the user software (for example, C:\Program Files)

<server_name>

Name of the host server

<sysdba_user>

Name of the SYSDBA user

<user_name>

Name of the user

<version>

Version number in accordance with the four-character SAP DB Version Notation

<web_server>

Name of the host on which the Web server is installed


Reference Manual (SAP Library - SAP DB)

 Entering content frame

Reference Manual

This document outlines the syntax and semantics of the SQL statements of the SAP DB database system, version 7.4. The syntax notation used in this document is BNF.

An SQL statement performs an operation on the database instance. The parameters used are host variables of a programming language in which the SQL statements are embedded.

For general information about the SAP DB database system, see the documentation The SAP DB Database System and the SAP DB homepage at http://www.sapdb.org.

For information on the Optimizer functions for SQL statements , see the documentation Optimizer 7.4 .

Concepts

Basic Elements

SQL Statements: Overview

Data Definition

Authorization

Data Manipulation

Data Query

Transaction

Statistics

Restrictions

Syntax Directory

Other Documentation

System Tables 7.4

SQL Mode ORACLE: SAP DB 7.4


Concepts (SAP Library - SAP DB)

 Entering content frame

Concepts

The following terms are explained here:

Code Attribute

Code Tables

Column

Database Catalog/Application Data

Database Procedure

Database Session

Data Integrity

Data Type

Domain

Index

Parameter

Privilege

Role

SERIAL

SQL Mode

Subtransaction

Synonym

Table

Transaction

Trigger

Users and User Groups

See also:

The SAP DB Database System ® Terms


Users and User Groups (SAP Library - SAP DB)

 Entering content frame

Users and User Groups

The following user names and passwords are defined when the database system is installed.

· DBM operator

· Database system administrator (SYSDBA)

· DOMAIN user

There are four database user classes when the database is operating:

· Database system administrator (SYSDBA)

· Database administrators (DBA users)

· RESOURCE users

· STANDARD users

You can also define user groups. All of the members of a user group have the same rights with regard to data assigned to the group.

See also:

The SAP DB Database System, sections User Concept or Terms

User Name

User Group Name

CREATE USER Statement

CREATE USERGROUP Statement


Code Attribute (SAP Library - SAP DB)

 Entering content frame

Code Attribute

For column values with the following data types, a code attribute can be entered as part of a column definition, if required: CHAR[ACTER], VARCHAR, LONG[VARCHAR]

A code attribute defines the sort sequence to be used for comparing values.

Code Attribute | Column Values
No code attribute | Have the code attribute defined in the database system
ASCII | In ASCII code
BYTE | Code-neutral, that is, the column values are not converted by the database system
EBCDIC | In EBCDIC code
UNICODE | In UNICODE

If you do not specify a code attribute, the code defined in the database system is used.

· The code can be defined for particular users using appropriate SQL statements (for more information, see: CREATE/ALTER USER Statement or CREATE/ALTER USERGROUP Statement).

· The code can be defined globally during the installation of the database system using the database parameter DEFAULT_CODE.

The code defined for a user overrides the code specified globally in the database system.


UNICODE (SAP Library - SAP DB)

 Entering content frame

UNICODE

SAP DB uses the UNICODE code in line with ISO 10646, Page 1. You can find general information on UNICODE in the following documentation:

The SAP DB Database System ® Terms ® UNICODE

The SAP DB Database System ® SAP DB as UNICODE Database

Metadata in UNICODE

The names of the database objects (such as table or column names) can be stored internally in UNICODE and can therefore be displayed in the database tools in the required presentation code.

Application Data in UNICODE

SAP DB supports the code attribute UNICODE for the data types CHAR[ACTER], VARCHAR, and LONG[VARCHAR] and is able to map various presentation codes to the UNICODE format.


Code tables (SAP Library - SAP DB)

 Entering content frame

Code tables

  • ASCII code pursuant to ISO 8859/1
  • EBCDIC code CCSID 500, codepage 500


ASCII code (SAP Library - SAP DB)

 Entering content frame

ASCII code

The ASCII code (in accordance with ISO 8859/1.2) is as follows:

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text possibly used by the operating system


EBCDIC code (SAP Library - SAP DB)

 Entering content frame

EBCDIC code

EBCDIC code CCSID 500, codepage 500:

This graphic is explained in the accompanying text

This graphic is explained in the accompanying text


Database Catalog/Application Data (SAP Library - SAP DB)

 Entering content frame

Database Catalog/Application Data

Data is stored logically in one of the following areas of a SAP DB database:

· The database catalog comprises metadata that contains the definitions of database objects such as base tables, view tables, synonyms, domains, indexes, and users and usergroups.
See also: The SAP DB Database System, Database Catalog section.

· Application Data: The SAP DB Database System, Application Datasection.


Database procedure (SAP Library - SAP DB)

 Entering content frame

Database procedure

In a well-structured database application, SQL statements are typically not distributed over the entire application but concentrated in a single access layer instead. This access layer has a procedural interface to the rest of the application at which the operations for application objects are made available in form of abstract data types.

In client/server configurations, the client and server interact when an SQL statement is executed in the access layer. The number of these interactions can be reduced considerably by transferring the SQL access layer from the client to the server.

SAP DB provides a language (special SQL syntax) for this purpose that allows an SQL access layer to be formulated on the server side. This special SQL syntax can be used to define database procedures and triggers .

This has three main advantages:

  • The number of interactions between client and server is reduced considerably (several factors). Client/server communication is only required for each operation on the application object, and not for each SQL statement. This enhances the performance of client-server configurations considerably.
  • The SQL access layer contains the procedurally formulated integrity and business rules. By concentrating these rules on the server side and eliminating them from the database applications, modifications can be made centrally and thus become valid immediately in all database applications. In this way, the integrity and decision rules also become a part of the catalog in the database system.
  • An SQL access layer in the form of database procedures transferred to the server side is an essential customizing tool, as it allows customer-specific database functionality to be included.

To be able to execute a database procedure, users must have the call privilege. This call privilege is independent of the user privileges for the tables and columns used in the database procedure. As a result, users may be able to use a database procedure to execute SQL statements that they otherwise would not have access to.

Database procedures are called explicitly from the programming language of the application. They can contain parameters, except for LONG column s. The extent to which LONG columns can be used within database procedures depends on the length of the LONG columns and the amount of storage space available.

As with any SQL statement, precautions must be taken to ensure that calling a database procedure has the desired effect, and that errors do not have any lasting effects on the database system. SAP DB provides nested transactions for this purpose. Each database procedure call can run in a subtransaction that can be reset without interfering with transaction control in the database application.

See also:

Name of a database procedure


Database Session (SAP Library - SAP DB)

 Entering content frame

Database Session

You can find an explanation of this term in The SAP Database System ® Terms ® Database session.

See also:

Users and User Groups

Password

CONNECT Statement

SET Statement


Data integrity (SAP Library - SAP DB)

 Entering content frame

Data integrity

  • Integrity rules: the database system provides a wide range of declarative integrity rules, thus reducing the programming requirements for applications. Integrity rules that refer to a table can also be specified (see constraint name ).
  • Key: a key comprising one or more columns can be defined for each table. The database system ensures that each key is unique. A key can also consist of columns of different data types (see key definition ).
  • UNIQUE definition: the uniqueness of the values in other columns and column combinations can also be ensured by using other mechanisms (see UNIQUE definition for "alternate keys").
  • NOT NULL: by specifying NOT NULL, you can ensure that the NULL value is not accepted in individual columns.
  • DEFAULT definition: you can define default values for each column (see DEFAULT specification ).
  • Referential integrity conditions: by specifying referential integrity conditions, you can declare deletion and existence dependencies between the rows in two tables (see name of a referential constraint ).
  • Database procedures and triggers: complex integrity rules that require access to further tables can be formulated with database procedures or triggers .


Data Type (SAP Library - SAP DB)

 Entering content frame

Data Type

A data type is a set of values that can be represented.

  • NULL value
  • Special NULL value
  • Non-NULL value

Character string , LONG column , number , date value , time value , timestamp value , BOOLEAN

Use

As well as specifying the column name when you define columns , you can also specify data types.

If required, a code attribute can also be entered for LONG columns and some kinds of character strings.

See also:

Using data types in SQL statements: data_type


BOOLEAN (SAP Library - SAP DB)

 Entering content frame

BOOLEAN

BOOLEAN is a data type that can only assume one of the states TRUE or FALSE and the NULL value .

A boolean value can only be compared to other boolean values.

See also:

BOOLEAN


Date value (SAP Library - SAP DB)

 Entering content frame

Date value

The date value date type is a special character string .

A date value can be compared to other date values and to character strings with the code attributes ASCII, EBCDIC, and UNICODE.

See also:

DATE

Date and time format


LONG column (SAP Library - SAP DB)

 Entering content frame

LONG column

A LONG column is a data type that contains a sequence of characters of any length to which no functions can be applied.

LONG columns cannot be compared to one another. The contents of LONG columns cannot be compared to character strings or other data types.

See also:

LONG[VARCHAR]

In a column definition , a code attribute can be entered for the data type LONG[VARCHAR].


NULL value (SAP Library - SAP DB)

 Entering content frame

NULL value

The data type NULL value (that is, an unspecified value) is a special value. Its relationship to any other value is always unknown.


Special NULL value (SAP Library - SAP DB)

 Entering content frame

Special NULL value

A special NULL value is a special data type and is the result of arithmetic operations that lead to an overflow or a division by 0.

The special NULL value is only permitted for output columns and for columns in the ORDER clause . If an overflow occurs in an arithmetic operation or a division by 0 at another point, the SQL statement is abnormally terminated.

The comparison of a special NULL value with any value is always undefined.

As far as sorting is concerned, the special NULL value is greater than all non-NULL values, but less than the NULL value .


Number (SAP Library - SAP DB)

 Entering content frame

Number

A number is a special data type . There are fixed point and floating point numbers:

  • Fixed point number

A fixed point number is described by the number of significant digits and the scale. The maximum number of significant digits is 38.

Examples: FIXED , INT[EGER] , SMALLINT
  • Floating point number

A floating point number consists of a mantissa and an exponent. The mantissa may have up to 38 significant digits. The valid range of values for floating point numbers consists of the intervals from -9. 9999999999999999999999999999999999999E +62 to -1E-64 and from +1E-64 to +9. 9999999999999999999999999999999999999E +62 and the value 0.0.

Example: FLOAT

All numbers can be compared to one another.


Character String (SAP Library - SAP DB)

 Entering content frame

Character String

A character string is a data type that consists of a series of alphanumeric characters.

Examples: CHAR[ACTER], VARCHAR, DATE, TIME, TIMESTAMP

In a column definition, a code attribute can be entered for the data types CHAR[ACTER] and VARCHAR.

The following comparison options exist for data types CHAR[ACTER] andVARCHAR:

Character strings with the same code attribute | These character strings can be compared to each other.
Character strings with the code attributes ASCII, EBCDIC and UNICODE | These character strings are comparable with the character strings of code attributes EBCDIC, ASCII, and UNICODE, and with date, time, and timestamp values.


Timestamp value (SAP Library - SAP DB)

 Entering content frame

Timestamp value

The timestamp value date type is a special character string . A timestamp consists of a date and time value and a microsecond specification.

A timestamp value can be compared to other timestamp values and to character strings with the code attributes ASCII, EBCDIC, and UNICODE.

See also:

TIMESTAMP

Date and time format


Time value (SAP Library - SAP DB)

 Entering content frame

Time value

The time value date type is a special character string .

A time value can be compared to other time values and to character strings with the code attributes ASCII, EBCDIC, and UNICODE.

See also:

TIME

Date and time format


Index (SAP Library - SAP DB)

 Entering content frame

Index

Indexes speed up access to rows in a table. They can be created for a single column or for a series of columns. When defining indexes, you specify whether the indexed column values in the different rows must be unique or not.

The assigned index name and table name must be unique.

See also:

CREATE INDEX statement


Parameter (SAP Library - SAP DB)

 Entering content frame

Parameter

SQL statements for the database system can be embedded in programming languages such as C and C++. This enables the database system to be accessed from various programs. The values to be retrieved from stored in the database system can be transferred with the SQL statements using parameters. The parameters are declared variables (so-called host variables) within the embedding program.

The data type of the host variables is defined when they are declared in the programming language. If possible, the values of the host variables are implicitly converted from the programming language data type to the data type of the database system, and vice versa.

Each parameter can be combined with an indicator variable that indicates irregularities which may have occurred when the values were assigned, for example, different value and parameter lengths, NULL value , special NULL value , etc. Indicator variables are essential for transferring NULL values and special NULL values. The indicator variables are declared as variables in the embedding program.

See also:

Parameter name

Indicator name


Privilege (SAP Library - SAP DB)

 Entering content frame

Privilege

A privilege is used to impose restrictions on operations carried out on certain objects.

Users can only execute operations on objects if they have been granted the privileges to do so. The owner of an object receives all of the relevant privileges when the object is created. Privileges can be explicitly granted to other users. Privileges are not granted to other users implicitly.

Users who are not the owner of an object can only grant privileges to other users if they have already been granted these privileges and are allowed to pass them on, i.e. with the relevant option.

See also:

Privilege type

GRANT statement


Role (SAP Library - SAP DB)

 Entering content frame

Role

A role is a collection of privileges.

Like a privilege, a role can be assigned to a different role or to a user.

While privileges are always valid, roles are always inactive, that is, the privileges they contain are not valid. Roles can be activated for individual database sessions. Every user to which roles were assigned can also define which of the roles should be active in each of his or her database sessions. This definition can be changed after a database session has been opened.

All roles are inactive for the current database session while data definition commands are being executed.

See also:

Role name

CREATE ROLE statement

DROP ROLE statement

Role concept


SERIAL (SAP Library - SAP DB)

 Entering content frame

SERIAL

SERIAL is a number generator that generates positive integers starting with 1 or a specified value.

SERIAL can be used as a DEFAULT specification for columns (DEFAULT SERIAL) that can only contain fixed point numbers. The maximum value generated is (10**n)-1 if DEFAULT SERIAL is defined for a column of the data type FIXED (n).

SERIAL columns can only be assigned a value when a row is inserted. The values of a SERIAL column cannot be changed with an UPDATE statement. A SERIAL column, therefore, can be used to determine the insertion sequence and identify a row in a table uniquely.


Column (SAP Library - SAP DB)

 Entering content frame

Column

All values in a table column have the same data type . A value in a column within a row is the smallest unit of data that can be modified or selected from a table or to which functions can be applied.

  • An alphanumeric column is a character string column.
    All character strings in an alphanumeric column have the same length.
  • A numeric column is either a floating point or a fixed point column.
    All numbers in a floating point column (floating point     number ) have the same mantissa length.
    All numbers in a fixed point column (fixed point     number ) have the same format; that is, the same number of digits before and after the decimal point.

Each column in a base table has a name that is unique within the table.

See also:

Column name

Using column definitions in SQL statements: column_definition


SQL Mode (SAP Library - SAP DB)

 Entering content frame

SQL Mode

You can find an explanation of this term in The SAP DB Database System ® Terms ® SQL mode.

This document describes the database system functions provided by the INTERNAL SQL mode.

Only those SQL statements are described for which the same SQL mode is used to both generate the object and execute the statement for the object. If database objects are created in one SQL mode and addressed in another, the object may have properties that are not known in the current SQL mode and, therefore, cannot be described.

SQL Statement for Specifying the SQL Mode

CONNECT Statement


Subtransaction (SAP Library - SAP DB)

 Entering content frame

Subtransaction

The purpose of closed, nested transactions (subtransactions) is to let a series of database operations within a transaction appear as a unit with regard to modifications to the database.

Subtransactions are preceded by SUBTRANS BEGIN and closed by SUBTRANS END or SUBTRANS ROLLBACK.

  • If a subtransaction is concluded with SUBTRANS END, any modifications made are kept.
  • If a subtransaction is closed with SUBTRANS ROLLBACK, all modifications made to the database system are reversed. Modifications made by subtransactions contained in this subtransaction are also reversed, even if they were concluded with SUBTRANS END.

SUBTRANS END and SUBTRANS ROLLBACK do not affect locks. These are only released by COMMIT or ROLLBACK. COMMIT or ROLLBACK implicitly close all subtransactions.

See also:

SUBTRANS statement

COMMIT statement

ROLLBACK statement


Synonym (SAP Library - SAP DB)

 Entering content frame

Synonym

A synonym is another name for a table .

Every synonym has a name that is unique within the entire database system and differs from all the other table names.

See also:

Synonym name

CREATE SYNONYM statement


Table (SAP Library - SAP DB)

 Entering content frame

Table

  • A table is a set of rows.
    A row is an ordered list of values.
    The row is the smallest unit of data that can be inserted in or deleted from a table.
    Each row in a table has the same number of     columns and contains a value for each column.
  • A base table is a table that usually has a permanent memory representation and description.
    It is also possible to create a base table that has only a temporary memory representation and description. This table and its description are implicitly dropped when a user stops working with the database system (end of session).
  • A result table is a temporary table that is generated from one or more base table(s) by means of a SELECT statement.
  • A view table is a table derived from base tables. A view table has a permanent description in the form of a SELECT statement.

Each table has a name that is unique within the overall database system. The names of existing tables can be used to name result tables. The original tables, however, cannot be accessed as long as the result tables exist.

If a table name was defined without an owner , the catalog sections (part catalogs) are searched in the following order to locate the specified table name:

  1. Catalog part of the current owner
  2. Set of PUBLIC synonyms
  3. Catalog part of the DBA who created the current user
  4. Catalog part of the SYSDBA
  5. Catalog part of the owner of the system tables

A table of another user can only be used if the relevant privileges have been granted.

See also:

Table name

Result table name

CREATE TABLE statement

CREATE VIEW statement


Transaction (SAP Library - SAP DB)

 Entering content frame

Transaction

A transaction is a sequence of sql statements that are handled by the database system as a basic unit, in the sense that any modifications made to the database by the sql statements are either all reflected in the state of the database, or else none of the database modifications are retained.

The first transaction is opened when a database session is opened with the CONNECT statement. The transaction is concluded with the COMMIT statement or the ROLLBACK statement. When a transaction is successfully concluded with a commit statement, all of the changes to the database are retained. If a transaction is aborted using a rollback statement, on the other hand, or if it is aborted in another way, all of the changes to the database made by the transaction are rolled back.

Both the COMMIT and ROLLBACK statements open a new transaction implicitly.

A transaction can be divided into other basic units, subtransactions.

Locks

Since the database system permits concurrent transactions on the same database objects, locks on rows, tables, and the database catalog are necessary to isolate individual transactions.

For information about the lock concept, see the The SAP DB Database System, Lock Behavior section.

· The assignment of implicit locks can be affected by the setting of the isolation level with the CONNECT statement.

· Locks can be assigned explicitly using the LOCK statement or by the assignment of a LOCK option.

· Exclusive locks for rows that have not yet been modified, and share locks on rows can be released by the UNLOCK statement before the end of the transaction.

The locks assigned to a transaction are usually released at the end of the transaction, making the respective database objects accessible again to other transactions.

SQL Statements for Transaction Management

CONNECT Statement | SET Statement |
COMMIT Statement | ROLLBACK Statement | SUBTRANS Statement
LOCK Statement | UNLOCK Statement | RELEASE Statement


Trigger (SAP Library - SAP DB)

 Entering content frame

Trigger

While database procedures are called explicitly from the programming language of the application, triggers are special procedures that run implicitly on a base table (or a view table built on this base table) after a data manipulation statement has been executed.

The conditions under which a trigger is to be executed can be restricted further.

The trigger is executed for each row to which the SQL statement refers. The trigger can access both the old values (values before update or deletion) and the new values (values after update or insertion) in this row.

A trigger can call further triggers implicitly.

Triggers can be used to check complicated integrity rules, to initiate derived database modifications for the row in question, or to implement complex access protection rules.

SAP DB provides a language (special SQL syntax) that can be used to define database procedures and triggers.

See also:

Trigger name


Domain (SAP Library - SAP DB)

 Entering content frame

Domain

Domain definitions enable ranges of values to be defined and designated for table columns .

Each value range definition has a name that is unique within the overall database system.

If a domain was defined without an owner , the catalog sections (part catalogs) are searched in the following order to locate the specified value range:

  1. Catalog part of the current owner
  2. Catalog part of the DBA who created the current user
  3. Catalog part of the SYSDBA

See also:

Domain name

CREATE DOMAIN statement


Basic Elements (SAP Library - SAP DB)

 Entering content frame

Basic Elements

Character

Literal

Token

Names

Column spec

Parameter spec

Specifying values

Date and time format

String specification

Key specification

Expression

Predicate

Search condition

Functions: Overview

Function

Set function


Character (SAP Library - SAP DB)

 Entering content frame

Character

A character is an element of a character string or keyword .

Syntax

<character> ::= <digit>
             | <letter>
             | <extended_letter>
             | <hex_digit>
             | <language_specific_character>
             | <special_character>

digit , letter , extended_letter , hex_digit , language_specific_character , special_character


Digit (SAP Library - SAP DB)

 Entering content frame

Digit

A digit is a character .

Syntax

<digit> ::= 0 | 1 | 2 | | 3 | 4 | 5 | 6 | 7 | 8 | 9


Letter (SAP Library - SAP DB)

 Entering content frame

Letter

A letter is a character .

Syntax

<letter> ::= A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z


Extended letter (SAP Library - SAP DB)

 Entering content frame

Extended letter

An extended letter is a character .

Syntax

<extended_letter> ::= # | @ | $


hex_digit (SAP Library - SAP DB)

 Entering content frame

hex_digit

A hex_digit is a character .

Syntax

<hex digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
| A | B | C | D | E | F
| a | b | c | d | e | f


language_specific_character (SAP Library - SAP DB)

 Entering content frame

language_specific_character

A language-specific character is any letter that occurs in a northern, southern, or central European language and is not contained in the list of letters .

German umlauts: ä, ö, ü

French letters with a "grave" accent.

If you have installed a UNICODE -enabled database, a language-specific character is a character that is not included in the ASCII-Code list from 0 to 127.


Special character (SAP Library - SAP DB)

 Entering content frame

Special character

A special character is any character that is not contained in the following list:

  • digit
  • letter
  • extended_letter
  • hex_digit
  • language_specific_character
  • Characters that indicate the end of a line in a file


Literal (literal) (SAP Library - SAP DB)

 Entering content frame

Literal (literal)

A literal is an unknown data object that is defined fully by virtue of its value (specifies a non-NULL value, see data type). Literal values cannot be modified. A distinction is made between string literals and numeric literals.

Syntax

<literal> ::= <string literal> | <numeric literal>

string_literal, numeric_literal

String literals
 '69190 Walldorf'
'Anthony Smith'

Numeric literals
+0.58498
1E160
-765E-04


String Literal (string_literal) (SAP Library - SAP DB)

 Entering content frame

String Literal (string_literal)

A string literal is a sequence of characters in quotation marks. String literals can also be represented in hexadecimal notation by preceding them with x or X.

Syntax

<string_literal> ::= '' | '<character>...' | <hex_literal>

Character, hex_literal

'69190 Walldorf'

'Anthony Smith'

X'12ab'

Explanation

A quotation mark within a character string is represented by two successive quotation marks.

A string literal of the type '<character>...'or '' is only valid for a value referring to an alphanumeric column with the code attribute ASCII or EBCDIC. A hex literal is only valid for a value referring to a column with the code attribute BYTE.

A string literal of the type '', x'' and X'', and string literals that only contain blanks are not the same as the NULL value.


hex_literal (SAP Library - SAP DB)

 Entering content frame

hex_literal

String literal that contains a value in hexadecimal notation.

Syntax

<hex_literal> ::= x'' | X'' | x'<hex_digit_seq>' | X'<hex_digit_seq>'

hex_digit_seq

x'123F'
X'12ab'


hex_digit_seq (SAP Library - SAP DB)

 Entering content frame

hex_digit_seq

Sequence of hexadecimal digits ( hex_digit_seq ).

Syntax

<hex_digit_seq> ::=
<hex_digit><hex_digit> | <hex_digit_seq><hex_digit><hex_digit>

hex_digit


Numeric Literal (numeric_literal) (SAP Library - SAP DB)

 Entering content frame

Numeric Literal (numeric_literal)

A numeric literal is a number represented as a fixed or floating point number.

Syntax

<numeric_literal> ::= <fixed_point_literal> | <floating_point_literal>

fixed_point_literal, floating_point_literal


Fixed point literal (SAP Library - SAP DB)

 Entering content frame

Fixed point literal

Numeric literal that specifies a number as a fixed point number.

Syntax

<fixed_point_literal> ::=   [<sign>]<digit_sequence>[.<digit_sequence>]
| [sign]<digit_sequence>. | [sign].<digit_sequence>

sign , digit_sequence

+123.12
1234.


Sign (SAP Library - SAP DB)

 Entering content frame

Sign

Sign

Syntax

<sign> ::= + | -


Digit sequence (SAP Library - SAP DB)

 Entering content frame

Digit sequence

Sequence of digits

Syntax

<digit_sequence> ::= <digit>...

digit


Floating point literal (SAP Library - SAP DB)

 Entering content frame

Floating point literal

Numeric literal that specifies a number as a floating point number.

Syntax

<floating_point_literal> ::=  <mantissa>E<exponent> | <mantissa>e<exponent>

mantissa , exponent

1e160
-765E-04


Mantissa (SAP Library - SAP DB)

 Entering content frame

Mantissa

Mantissa

Syntax

<mantissa> ::= <fixed_point_literal>

fixed_point_literal


Exponent (SAP Library - SAP DB)

 Entering content frame

Exponent

Exponent

Syntax

<exponent> ::= [<sign>][[<digit>]<digit>]<digit>

sign , digit


Unsigned integer (SAP Library - SAP DB)

 Entering content frame

Unsigned integer

An unsigned_integer is a special numeric literal.

Syntax

<unsigned_integer> ::= <numeric_literal>

numeric_literal

Explanation

An unsigned integer can be represented in any way but must be a positive integer.


Integer (SAP Library - SAP DB)

 Entering content frame

Integer

An integer is a special numeric_literal . This integer can be displayed in any number of ways.

Syntax

<integer> ::= [sign]<unsigned_integer>

sign , unsigned_integer


Token (SAP Library - SAP DB)

 Entering content frame

Token

A character set or token comprises a series of characters that are combined to form a lexical unit. A distinction is made between regular and delimiter tokens.

Syntax

<token> ::= <regular token> | <delimiter token>

regular_token, delimiter_token

SELECT * FROM reservation
ALTER TABLE reservation DROP FOREIGN KEY customer_reservation

Explanation

Each token can be followed by any number of blanks. Each regular_token must be followed by a delimiter_token or a blank.

Double quotes within a special identifier are represented by two consecutive quotes.


Regular token (SAP Library - SAP DB)

 Entering content frame

Regular token

Normal character set ( token ) ( regular_token )

Syntax

<regular_token> ::= <literal> | <keyword> | <identifier> | <parameter_name>

Literal , key_word , identifier , parameter_name

SELECT

'Tours10'


Keyword (SAP Library - SAP DB)

 Entering content frame

Keyword

Keyword. A distinction is made between „normal" and reserved keywords.

Syntax

<keyword> ::= <not_reserved_key_word> | <reserved_keyword>

Not_reserved_keyword , reserved_keyword

Explanation

Keywords can be entered in uppercase/lowercase characters.

Reserved keywords must not be used in simple identifiers . Reserved keywords, however, can be specified in the form of special identifiers .


Not reserved keyword (SAP Library - SAP DB)

 Entering content frame

Not reserved keyword

Keywords (not reserved keywords). If possible, these key words should not be used to designate objects.

You can find a list of all keywords in the syntax directory: not_reserved_key_word


Reserved keyword (SAP Library - SAP DB)

 Entering content frame

Reserved keyword

Reserved keywords (reserved key_word). These key words must not be used to designate objects.

You can find a list of all keywords in the syntax directory: reserved_key_word


Identifier (SAP Library - SAP DB)

 Entering content frame

Identifier

Identifier ( identifier). A distinction is made between simple identifiers and special identifiers.

Syntax

<identifier> ::= <simple identifier> | <double quotes><special identifier><double quotes>

simple_identifier, double_quotes, special_identifier

Explanation

Identifiers can be entered in uppercase/lowercase characters. When you specify simple identifiers, upper and lower case are ignored, as the system always converts the identifier to upper case letters.

Reserved keywords must not be used in simple identifiers. Reserved keywords, however, can be specified in the form of special identifiers.

Double quotation marks within a special identifier are represented by two consecutive quotation marks.

Simple identifier: reservation

Special identifier: "ADD"


Simple Identifier (simple_identifier) (SAP Library - SAP DB)

 Entering content frame

Simple Identifier (simple_identifier)

Simple identifier. The first character in a simple identifier must not be a digit or underscore.

Syntax

<simple_identifier> ::= <first_character>[<identifier_tail_character>...]

first_character, identifier_tail_character

Explanation

Simple identifiers are always converted into uppercase characters in the database. For this reason, simple identifiers are not case sensitive.

Reserved keywords must not be used in simple identifiers.

If the name of a database object is to contain lowercase letters, special characters, reserved keywords, or blanks, the identifier must be specified as a special identifier (enclosed in double quotation marks).


First character (SAP Library - SAP DB)

 Entering content frame

First character

First character in a simple identifier .

Syntax

<first_character> ::= <letter> | <extended_letter> | <language_specific_character>

letter , extended_letter , language_specific_character


Identifier tail character (SAP Library - SAP DB)

 Entering content frame

Identifier tail character

Character allowed after the first character in a simple identifier or password .

Syntax

<identifier_tail_character> ::=
<letter> | <extended_letter> | <language_specific_character>
| <digit> | <underscore>

letter , extended_letter , language_specific_character , digit , underscore


Underscore (SAP Library - SAP DB)

 Entering content frame

Underscore

Underscore

Syntax

<underscore> ::= _


Double quotes (SAP Library - SAP DB)

 Entering content frame

Double quotes

Quotation marks ( double_quotes )

Syntax

<double_quotes> ::= "


Special Identifier (special_identifier) (SAP Library - SAP DB)

 Entering content frame

Special Identifier (special_identifier)

Special identifier ( special_identifier). A special identifier must be entered in double quotation marks if it is to be used as an identifier.

Syntax

<special_identifier> ::= <special_identifier_character>...

<special_identifier_character> ::= any characters, that can be linked in any sequence

Explanation

Special identifiers are always used as specified in the database; that is upper and lower case characters are taken into account. Special identifiers are case-sensitive.

If the name of a database object is to contain lowercase letters, special characters, reserved keywords (reserved_key_word), or blanks, the identifier must be specified as a special identifier (enclosed in double quotation marks).

“ADD”, “Example_1”


Delimiter token (SAP Library - SAP DB)

 Entering content frame

Delimiter token

Delimiter token

Syntax

<delimiter_token> ::=
  ( | ) | , | . | + | - | * | / | < | > | <> | != | = | <= | >=
| ¬= | ¬< | ¬> (for machines with EBCDIC code )

| ~= | ~< | ~> (for machines with ASCII code )


Names (SAP Library - SAP DB)

 Entering content frame

Names

Names identify objects. The following list contains names that are frequently used in the syntax description of the SQL statements.

Name |
Alias name | alias_name
Column name | column_name
Constraint name | constraint_name
Name of a database procedure | dbproc_name
Domain name | domain_name
Index name | index_name
Indicator name | indicator_name
Mapchar set name | mapchar_set_name
Owner | owner
Parameter name | parameter_name
Password | password
Reference name | reference_name
Name of a referential constraint | referential_constraint_name
Result table name | result_table_name
Role name | role_name
Sequence name | sequence_name
Synonym name | synonym_name
Table name | table_name
Trigger name | trigger_name
Usergroup name | usergroup_name
User name | user_name

Explanation

For all names consisting of several identifiers that are separated by a ".", any number of blanks can be specified before and after the dot.


Alias name (SAP Library - SAP DB)

 Entering content frame

Alias name

An alias name is a new column name that specifies the name of a column in the following types of tables:

  • View tables
  • Tables defined with a recursive DECLARE CURSOR statement

Syntax

<alias_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining an alias name

CREATE VIEW statement

Recursive DECLARE CURSOR statement


usergroup name (SAP Library - SAP DB)

 Entering content frame

usergroup name

A usergroup name identifies a usergroup.

Syntax

<usergroup_name> ::= <identifier>

identifier

Explanation

An error message occurs if the name has more than 32 characters.

SQL Statement for Defining a usergroup name

CREATE USERGROUP statement


User name (SAP Library - SAP DB)

 Entering content frame

User name

A user name defines a user .

Syntax

<user_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining a user name

CREATE USER statement


Constraint name (SAP Library - SAP DB)

 Entering content frame

Constraint name

A constraint name defines a condition ( data integrity ) that must be satisfied by the rows in a table.

Syntax

<constraint_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statements for defining a constraint name

CONSTRAINT definition

CREATE TABLE statement

ALTER TABLE statement


Name of a database procedure (dbproc_name) (SAP Library - SAP DB)

 Entering content frame

Name of a database procedure (dbproc_name)

The name of a database procedure ( dbproc_name ) designates a database procedure .

Syntax

<dbproc_name> ::= [<owner>.]<procedure_name>

<procedure_name> ::= <identifier>

owner , identifier

Explanation

You cannot specify TEMP as the owner in a database procedure.

SQL statements for creating, calling, and dropping a database procedure

CREATE DBPROC statement

CALL statement

DROP DBPROC statement


Domain name (SAP Library - SAP DB)

 Entering content frame

Domain name

A domain name identifies a domain in a table column .

Syntax

<domain_name> ::= [<owner>.]<identifier>

owner , identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining a domain name

CREATE DOMAIN statement

You cannot specify TEMP as the owner in a domain name.


Owner (SAP Library - SAP DB)

 Entering content frame

Owner

The owner of an object is defined by specifying the name of owner name.

Syntax

<owner> ::= <user_name> | <usergroup_name> | TEMP

user_name , usergroup_name

Explanation

If the owner is not a member of a usergroup, the owner name and usergroup name are identical.

If TEMP is specified as the owner in a table name , the table is a temporary table. The owner of this temporary table is the current owner.

An error message is output if the name of the owner has more than 32 characters.


Result table name (SAP Library - SAP DB)

 Entering content frame

Result table name

A result table name identifies a result table (see table ).

Syntax

<result_table_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining a result table name

QUERY statement


Index name (SAP Library - SAP DB)

 Entering content frame

Index name

An index name identifies an index .

Syntax

<index_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for creating an index

CREATE INDEX statement


Indicator name (SAP Library - SAP DB)

 Entering content frame

Indicator name

An indicator name designates an indicator variable in an application that can be specified together with a parameter name.

Syntax

<indicator_name> ::= <parameter_name>

parameter_name

Explanation

The indicator variable of a parameter provides information on any irregularities (e.g. NULL value, difference value and parameter lengths).


Mapchar Set Name (mapchar_set_name) (SAP Library - SAP DB)

 Entering content frame

Mapchar Set Name (mapchar_set_name)

A Mapchar set name ( mapchar_set_name) identifies a Mapchar set.

Syntax

<mapchar_set_name> ::= <identifier>

identifier

Functions Using Mapchar Sets

MAPCHAR

See also:

Creating Mapchar Sets

Displaying, Changing, and Deleting Mapchar Sets


Password (SAP Library - SAP DB)

 Entering content frame

Password

Users require a password to connect to the database instance (start a database session ).

Syntax

<password> ::= <identifier> | <first_password_character>[<identifier_tail_character>...]

identifier , identifier_tail_character

<first_password_character> ::= <letter> | <extended_letter> | <language_specific_letter> | <digit>

letter , extended_letter , language_specific_letter , digit

Explanation

Passwords are truncated after 18 characters.

SQL statement for defining a user password

CREATE USER statement

SQL statement for changing a user password

ALTER PASSWORD statement


Parameter name (SAP Library - SAP DB)

 Entering content frame

Parameter name

A parameter name identifies a parameter (host variable) in an application containing SQL statements from the database system.

Syntax

<parameter_name> ::= :<identifier> | :<identifier>(<identifier>) | :<identifier>(.<identifier>.)

identifier

Explanation

The conventions of the programming language in which the SQL statements of the database system are embedded determine the number of significant characters in the parameter name.

Identifiers for parameter names may contain the characters "." and "_", but not as the first character.


Privilege type (privilege) (SAP Library - SAP DB)

 Entering content frame

Privilege type (privilege)

A privilege type ( privilege ) identifies a certain privilege .

Syntax

<privilege> ::= INSERT | UPDATE [(<column_name>,...)]
| SELECT [(<column_name>,...)] | SELUPD [(<column_name>,...)]
| DELETE | INDEX | ALTER | REFERENCES [(<column_name>,...)]

column_name

Explanation

Privilege | Explanation
INSERT | Allows the identified user to insert rows in the specified table. The current user must be authorized to grant the INSERT privilege.
UPDATE | Allows the identified user to update rows in the specified table. If column names are specified, the rows may only be updated in the columns identified by these names. The current user must be authorized to grant the UPDATE privilege.
SELECT | Allows the identified user to select rows in the specified table. If column names are specified, the rows may only be selected in the columns identified by these names. The current user must be authorized to grant the SELECT privilege.
SELUPD | The SELECT and UPDATE privileges are granted. If column names are specified, the rows may only be selected or updated in the columns identified by these names. The current user must be authorized to grant both the SELECT and the UPDATE privileges.
DELETE | Allows the identified user to delete rows from the specified table. The current user must be authorized to grant the DELETE privilege.
INDEX | Allows the identified user to execute the CREATE INDEX and DROP INDEX statements for the specified tables. The INDEX privilege can only be granted for base tables. The current user must be authorized to grant the INDEX privilege.
ALTER | Allows the identified user to execute the ALTER TABLE statement for the specified tables. The ALTER privilege can only be granted for base tables. The current user must be authorized to grant the ALTER privilege.
REFERENCES | Allows the identified user to specify the table as a referenced table in a column_definition or referential_constraint_definition .

SQL statement for granting or revoking privileges

GRANT statement

REVOKE statement


Name of a referential constraint (referential_constraint_name) (SAP Library - SAP DB)

 Entering content frame

Name of a referential constraint (referential_constraint_name)

The name of a referential constraint ( referential_constraint_name ) identifies a referential constraint (referential integrity condition, data integrity ). This integrity condition specifies deletion and existence dependencies between two tables.

Syntax

<referential_constraint_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining a referential constraint

Referential CONSTRAINT definition

CREATE TABLE statement

ALTER TABLE statement


Reference name (SAP Library - SAP DB)

 Entering content frame

Reference name

The reference name is an identifier that is declared for a certain validity range and associated with exactly one table . The scope of this declaration is the entire SQL statement.

Syntax

<reference_name> ::= <identifier>

identifier

Explanation

The same reference name specified in various scopes can be associated with different tables or with the same table.

An error message is output if the name has more than 32 characters.


Role Name (role_name) (SAP Library - SAP DB)

 Entering content frame

Role Name (role_name)

A role name identifies a role .

Syntax

<role_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statement for defining a role

CREATE ROLE statement

SQL statement to assign privileges to a role

GRANT statement

SQL statement for granting a role

GRANT statement

SQL statements for activating a role

ALTER USER statement

ALTER USERGROUP statement

SET statement

SQL statement for dropping a role

DROP ROLE statement

See also:

Role concept


Sequence name (SAP Library - SAP DB)

 Entering content frame

Sequence name

A sequence name identifies a sequence of values.

Syntax

<sequence_name> ::= <identifier>

identifier

Explanation

A sequence is a series of values that are generated in accordance with certain rules. The step width between these values can be defined, among other things.

Sequences can be used to generate unique values. These are not uninterrupted, because values generated within a transaction that was rolled back cannot be used again.

An error message is output if the name has more than 32 characters.

SQL statement for defining a sequence name

CREATE SEQUENCE statement


Column name (SAP Library - SAP DB)

 Entering content frame

Column name

A column name identifies a column .

Syntax

<column_name> ::= <identifier>

identifier

Explanation

An error message is output if the name has more than 32 characters.

SQL statements for defining a column name

CREATE TABLE statement

CREATE VIEW statement

ALTER TABLE statement

QUERY statement


Synonym name (SAP Library - SAP DB)

 Entering content frame

Synonym name

A synonym name identifies a synonym for a table name.

Syntax

<synonym_name> ::= <identifier>

identifier

Explanation

If the synonym is not a PUBLIC synonym, it is only known by one user or usergroup . A PUBLIC synonym is known by every user and user group.

An error message is output if the name has more than 32 characters.

SQL statement for defining a synonym name

CREATE SYNONYM statement


Table name (SAP Library - SAP DB)

 Entering content frame

Table name

A table name identifies a table .

Syntax

<table_name> ::= [<owner>.]<identifier>

owner , identifier

Explanation

The database system uses certain table names for internal purposes. The identifiers of these tables begin with SYS. To avoid naming conflicts, therefore, you should not use table names that start with SYS.

If the name of the owner was not specified in the table name, the catalog parts are searched for the table name in the following order:

  1. Catalog part of the current owner
  2. Set of PUBLIC synonyms
  3. Catalog part of the DBA who created the current user
  4. Catalog part of the SYSDBA
  5. Catalog part of the owner of the system tables

An error message is output if the name has more than 32 characters.

SQL statements for defining a table name

CREATE TABLE statement

CREATE VIEW statement

CREATE SYNONYM statement


Trigger Name (trigger_name) (SAP Library - SAP DB)

 Entering content frame

Trigger Name (trigger_name)

A trigger name identifies a trigger that is defined for a table.

Syntax

<trigger_name> ::= <identifier>

identifier

Explanation

A trigger name must not exceed 32 characters in length.

SQL statements for creating and dropping a trigger

CREATE TRIGGER statement

DROP TRIGGER statement


Column specification (column_spec) (SAP Library - SAP DB)

 Entering content frame

Column specification (column_spec)

A column specification ( column_spec ) specifies a column in a table.

Syntax

<column_spec> ::= <column_name> | <table_name>.<column_name>
| <reference_name>.<column_name> | <result_table name>.<column_name>

column_name , table_name , reference_name , result_table_name

Explanation

For all names consisting of several identifiers separated by a ".", any number of blanks can be specified before and after the dot.


Parameter specification (parameter spec) (SAP Library - SAP DB)

 Entering content frame

Parameter specification (parameter spec)

A parameter specification ( parameter spec) identifies the parameter name and, if necessary, the indicator name needed to specify a parameter.

Syntax

<parameter spec> ::= <parameter name> [<indicator name>]

parameter_name, indicator name

Explanation

The indicator must be declared as a variable in the embedding programming language. It must be possible to assign at least four-digit integers to this variable.

A distinction is made between output parameters and input parameters:

· Output parameters: parameters that are to receive values retrieved from the database system.

- An indicator parameter with the value 0 indicates that the transferred value is not a NULL value and that the parameter value is the transferred value.

- An indicator with the value –1 indicates that the parameter value is the NULL value.

- Alphanumeric output parameters: an indicator with a value greater than 0 indicates that the assigned character string was too long and has been truncated. The indicator specifies the untruncated length of the original output column.

- Numeric output parameters: an indicator with a value greater than 0 indicates that the assigned value has too many significant digits and decimal places have been truncated. The indicator specifies the number of digits in the original value.

- For numeric output parameters, an indicator with the value -2 indicates that the parameter value is the special NULL value.

· Input parameters: parameters containing values that are to be transferred to the database system.

- An indicator with a value greater than or equal to 0 indicates that the specified parameter value is the value that is to be transferred to the database system.

- An indicator with a value less than 0 indicates that the specified parameter value is the NULL value.


Specifying values (extended value spec) (SAP Library - SAP DB)

 Entering content frame

Specifying values (extended value spec)

Values can be specified (extended value spec) by specifying values (value spec) or with one of the keywords DEFAULT or STAMP.

Syntax

<extended value spec> ::= <value spec> | DEFAULT | STAMP

value_spec

Explanation

  • DEFAULT keyword
    DEFAULT identifies the default value for the column in a     CREATE TABLE statement or ALTER TABLE statement . DEFAULT cannot be used to specify values if one of these values is not defined.
    The DEFAULT keyword can be used in the following SQL statements:
    INSERT statement
    UPDATE statement
    The DEFAULT keyword can be used in a     DEFAULT predicate .
  • STAMP key word
    The database system is able to generate unique values. This is a serial number that starts with X'000000000001'. The values are assigned in ascending order. It cannot be ensured that a sequence of values is uninterrupted. The STAMP key word supplies the next value generated by the database system.
    The STAMP keyword can be used in the following SQL statements (only on columns of the data type CHAR(n) BYTE with n>=8, see     DEFAULT specification ):
    INSERT statement
    UPDATE statement
    If the user wants to find out the generated value before it is applied to the column, the following SQL statement must be used:
     NEXT STAMP statement


Specifying Values (value_spec) (SAP Library - SAP DB)

 Entering content frame

Specifying Values (value_spec)

Values can be specified ( value_spec) by specifying literals, parameter specifications, or a series of keywords.

Syntax

<value_spec> ::= <literal> | <parameter_spec>
| NULL | USER | USERGROUP | SYSDBA | UID
| [<owner>.]<sequence_name>.NEXTVAL | [<owner>.]<sequence_name>.CURRVAL
| <table_name>.CURRVAL
| DATE | TIME | TIMESTAMP | UTCDATE | TIMEZONE | UTCDIFF
| TRUE | FALSE | TRANSACTION

literal | Literal
parameter_spec | Parameter specification
NULL | NULL value
USER | Current user name
USERGROUP | Name of the user group to which the user calling the SQL statement belongs. If the user does not belong to a user group, the user name is displayed.
SYSDBA | SYSDBA of the database instance
UID | Identification of the current user. This is a whole number.
[<owner>.]<sequence_name>.NEXTVAL | Next value generated for the specified sequence name (of the owner in question).
[<owner>.]<sequence_name>.CURRVAL | Value that was generated using [<owner>.]<sequence_name>.NEXTVAL as the final value for the specified sequence name.
<table_name>.CURRVAL | Last assigned value of the serial column in the table_name table in the current database session.
DATE | Current date
TIME | Current time
TIMESTAMP | Current timestamp
UTCDATE | Current UTC time stamp (Greenwich Mean Time)
TIMEZONE | Time difference in hours in the format hhmmss (in data type FIXED(6)) between your local time value and the UTC time value (Greenwich Mean Time)
UTCDIFF | Time difference in hours (in data type FIXED(4,2)) between your local time and the UTC time value.
TRUE | FALSE | Corresponding value of a column of the data type BOOLEAN
TRANSACTION | Identification of the current transaction. This is a value of data type CHAR(10) BYTE.


Date and Time Format (datetimeformat) (SAP Library - SAP DB)

 Entering content frame

Date and Time Format (datetimeformat)

The date and time format ( datetimeformat) specifies the way in which date values, time values, and timestamp values are represented.

Syntax

<datetimeformat> ::= EUR | INTERNAL | ISO | JIS | USA

Date Value

'YYYY' | Four-digit year format
'MM' | Two-digit month format (01-12)
'DD' | Two-digit day format (01-31)

Format | General Format | Example
EUR | 'DD.MM.YYYY' | '23.01.1999'
INTERNAL | 'YYYYMMDD' | '19990123'
ISO/JIS | 'YYYY-MM-DD' | '1999-01-23'
USA | 'MM/DD/YYYY' | '01/23/1999'

In all formats, with the exception of INTERNAL, leading zeros may be omitted in the identifiers for the month and day.

Time Value

'HHHH' | Four-digit hour format
'HH' | Two-digit hour format
'MM' | Two-digit minute format (00-59)
'SS' | Two-digit second format (00-59)

Format | General Format | Example
EUR | 'HH.MM.SS' | '14.30.08'
INTERNAL | 'HHHHMMSS' | '00143008'
JIS/ISO | 'HH:MM:SS' | '14:30:08'
USA | 'HH:MM AM (PM)' | '2:30 PM'

In all time formats, the identifier of the hour must consist of at least one digit. In the USA time format, the minute identifier can be omitted completely. In all the other formats, with the exception of INTERNAL, the minute and second identifiers must comprise at least one digit.

In the ISO and USA formats, the hours are displayed modulo 24.
In the EUR and JIS formats, a number of hours greater than 99 causes an error.
In the INTERNAL format, you can use up to 9999 hours.

Timestamp Value

'YYYY' | Four-digit year format
'MM' | Two-digit month format (01-12)
'DD' | Two-digit day format (01-31)
'HH' | Two-digit hour format (0-24)
'MM' | Two-digit minute format (00-59)
'SS' | Two-digit second format (00-59)
'MMMMMM' | Six-digit microsecond format

Format | General Format | Example
EUR/JIS/USA | 'YYYY-MM-DD-HH.MM.SS.MMMMMM' | '1999-01-23-14.30.08.456234'
ISO | 'YYYY-MM-DD HH:MM:SS.MMMMMM' | '1999-01-23 14:30:08.456234'
INTERNAL | 'YYYYMMDDHHMMSSMMMMMM' | '19990123143008456234'

The microsecond identifier can be omitted in all timestamp formats. In all formats, with the exception of INTERNAL, the month and day identifiers must consist of at least one digit.

Explanation

The date and time format determines the format in which the date, time, and timestamp values may be represented in SQL statements and the way in which results are displayed.

The date and time format is determined when the database system is installed.

Users can change the date and time format for the current session by setting the relevant parameters in the database tools or by specifying the corresponding parameters when using programs.

The ISO date and time format is used by ODBC and JDBC applications and cannot be replaced with a different date and time format.


Specifying a string (string spec) (SAP Library - SAP DB)

 Entering content frame

Specifying a string (string spec)

Only expressions that have an alphanumeric value as a result are allowed as a string specification (string_spec).


Specifying a Key (key_spec) (SAP Library - SAP DB)

 Entering content frame

Specifying a Key (key_spec)

A key specification (key_spec) allows rows in a table to be located whose key column values match the values in the key specification. A row with the specified key values does not have to exist.

Syntax

<key_spec> ::= <column_name> = <value_spec>

column_name , value_spec

Explanation

The value specification (value_spec) must not be NULL.

The column name must identify a key column in the table.

The key specification must contain all the key columns in a table. The individual key specifications (key_spec) must be separated by commas.

For tables defined without key columns, there is the implicitly generated column SYSKEY CHAR(8) BYTE which contains a key generated by the database system. This column can only be used in a key specification.


Expression (SAP Library - SAP DB)

 Entering content frame

Expression

An expression specifies a value that is generated, if required, by applying arithmetic operators to values.

A distinction is made between the following arithmetic operators:

  • Additive operators
    + Addition
    - Subtraction
  • Multiplicative operators
    * Multiplication
    / Division
    DIV integer division
    MOD remainder after integer division

Syntax

<expression> ::= <term> | <expression> + <term> | <expression> - <term>
<expression_list> ::= (<expression>,...)

<term> ::= <factor>
| <term> * <factor> | <term> / <factor>
| <term> DIV <factor>| <term> MOD <factor>

factor

Explanation

The arithmetic operators can only be applied to numeric data types.

 | Result of an expression
expression | Value of any data type
factor supplies a NULL value | NULL value
factor supplies a special NULL value | Special NULL value
expression leads to a division by 0 | Special NULL value
expression leads to an overflow of the internal temporary result | Special NULL value

If no parentheses are used, the operators have the following precedence:

  1. The sign has a higher precedence than the additive and multiplicative operators.
  2. The multiplicative operators have a higher precedence than the additive operators.
  3. The multiplicative operators have different priorities.
  4. The additive operators have different priorities.
  5. Operators with the same precedence are evaluated from left to right.

Operands are fixed point numbers

Operand1 (a) | Operand2 (b) | Result
Fixed point number (p precision s number of decimal places | Fixed point number (p' precision s' number of decimal places) | Fixed point number (p" precision s" number of decimal places) or floating point number

The data type of the result depends on the operation as well as on the precision and number of decimal places of the operands.

Note that the data type of a column determines its name, and not the precision and number of decimal places in the current value.

Operands are fixed point numbers, operands are +, - , * or /

The result of addition, subtraction, and multiplication is generated from a temporary result which can have more than 38 valid digits. If the temporary result has no more than 38 valid digits, the final result is equal to the temporary result. Otherwise, a result is generated as a floating point number with 38 places. Decimal places are truncated if necessary.

Condition

Operator

Result

max(p-s,p'-s')

+, -

Fixed point number
p''=max(p-s,p'-s')+max(s,s')+1
s''=max(s,s')

(p+p')<=38

*

Fixed point number
p''=p+p'
s''=s+s'

(p-s+s')<=38

/

Fixed point number
p''=38
s''=38-(p-s+s')
Special NULL value, if b=0

Operands are integers, operators are DIV, MOD

Condition | Operator | Result
ABS (a)<1E38 and ABS(b)<1E38 and b<>0 | DIV | TRUNC (a/b)
b=0 | DIV | Special NULL value
ABS(a)>=1E38 and b<>0 or ABS(b)>=1E38 | DIV | Error message
ABS(a)<1E38 and ABS(b)<1E38 and b<>0 | MOD | a-b*(a DIV b)
b=0 | MOD | a
ABS(a)>=1E38 and b<>0 or ABS(b)>=1E38 | MOD | Error message

An operand is a floating point number

If an operand is a floating point number , the result of the arithmetic operation is a floating point number.


factor (SAP Library - SAP DB)

 Entering content frame

factor

Specifies how the values are determined that are to be linked in an expression by means of arithmetic operators.

Syntax

<factor> ::= [<sign>] <value_spec> | [<sign>] <column_spec>
| [<sign>] <function_spec> | [<sign>] <set_function_spec>
| <scalar_subquery> |<expression>

sign , value_spec , column_spec , function_spec , set_function_spec , scalar_subquery , expression


Predicate (predicate) (SAP Library - SAP DB)

 Entering content frame

Predicate (predicate)

A predicate is specified in a WHERE condition in a statement which is "true", "false", or "unknown". The result is generated by applying the predicate to a specific row in a result table (see result table name) or to a group of rows in a table that was formed by the GROUP clause.

Syntax

<predicate> ::=
  <between_predicate> | <bool_predicate> | <comparison_predicate>
| <default_predicate> | <exists_predicate> | <in_predicate>
| <join_predicate> | <like_predicate> | <null_predicate>
| <quantified_predicate> | <rowno_predicate> | <sounds_predicate>

between_predicate, bool_predicate, comparison_predicate, default_predicate, exists_predicate, in_predicate, join_predicate, like_predicate, null_predicate, quantified_predicate, rowno_predicate, sounds_predicate

Explanation

· Columns in a table with the same code attribute are comparable.

· Columns with different code attributes ASCII and EBCDIC (see code tables) can be compared.

· Columns with the code attributes ASCII and EBCDIC can be compared with date values, time values, or timestamp values.

· LONG columns can only be used in the NULL predicate.

Example table: customer

Selection without a condition:

SELECT city, name, firstname FROM customer

CITY | NAME | FIRSTNAME
New York | Porter | Jenny
Dallas | DATASOFT | ?
Los Angeles | Porter | Martin
Los Angeles | Peters | Sally
Hollywood | Brown | Peter
New York | Porter | Michael
New York | Howe | George
Los Angeles | Randolph | Frank
Los Angeles | Peters | Joseph
Los Angeles | Brown | Susan
Los Angeles | Jackson | Anthony
Los Angeles | Adams | Thomas
New York | Griffith | Mark
Los Angeles | TOOLware | ?
Hollywood | Brown | Rose

Selection with restricting condition:

SELECT city, name, firstname FROM customer
WHERE city = 'Los Angeles'

CITY | NAME | FIRSTNAME
Los Angeles | Porter | Martin
Los Angeles | Peters | Sally
Los Angeles | Randolph | Frank
Los Angeles | Peters | Joseph
Los Angeles | Brown | Susan
Los Angeles | Jackson | Anthony
Los Angeles | Adams | Thomas
Los Angeles | TOOLware | ?


BETWEEN predicate (between_predicate) (SAP Library - SAP DB)

 Entering content frame

BETWEEN predicate (between_predicate)

The BETWEEN predicate ( between_predicate) checks whether a value is within a specified range.

Syntax

<between_predicate> ::= <expression> [NOT] BETWEEN <expression> AND <expression>

expression

Explanation

Let x, y, and z be the results of the first, second, and third expression. The values x,y,z must be comparable.

 | Result of the specified predicate
x BETWEEN y AND z | x>=y AND x<=z
x NOT BETWEEN y AND z | NOT(x BETWEEN y AND z)
x, y, or z are NULL values | x [NOT] BETWEEN y AND z is undefined

Example table: customer

Finding customers with a credit balance between –420 and 0:

SELECT title, name, city, account FROM customer
WHERE account BETWEEN -420 AND 0

TITLE | NAME | CITY | ACCOUNT
Mr | Porter | Los Angeles | 0.00
Mrs | Peters | Los Angeles | 0.00
Mr | Brown | Hollywood | 0.00
Mr | Porter | New York | 0.00
Mr | Howe | New York | -315.40
Mr | Randolph | Los Angeles | 0.00
Mr | Jackson | Los Angeles | 0.00
Mr | Adams | Los Angeles | -416.88
Mr | Griffith | New York | 0.00

You want to list the customers who have either a credit balance or a significant debit balance:

SELECT title, name, city, account FROM customer
WHERE account NOT BETWEEN -10 AND 0

TITLE | NAME | CITY | ACCOUNT
Mrs | Porter | New York | 100.00
Comp | DATASOFT | Dallas | 4813.50
Mr | Howe | New York | -315.40
Mr | Peters | Los Angeles | 650.00
Mrs | Brown | Los Angeles | -4167.79
Mr | Adams | Los Angeles | -416.88
Comp | TOOLware | Los Angeles | 3770.50
Mrs | Brown | Hollywood | 440.00


Boolean predicate (bool_predicate) (SAP Library - SAP DB)

 Entering content frame

Boolean predicate (bool_predicate)

Boolean values ( BOOLEAN ) are compared in a boolean predicate .

Syntax

<bool_predicate> ::= <column_spec> [ IS [NOT] <TRUE | FALSE>]

column spec

Explanation

If only one column specification ( column_spec ) is specified, the syntax is identical to <column_spec> IS TRUE .

The column_spec must always denote a column with the data type BOOLEAN.

The following rules apply to the result of a boolean predicate:

Column value | IS TRUE | IS NOT TRUE | IS FALSE | IS NOT FALSE
false | false | true | true | false
undefined | undefined | undefined | undefined | undefined
true | true | false | false | true


Comparison Predicate (comparison_predicate) (SAP Library - SAP DB)

 Entering content frame

Comparison Predicate (comparison_predicate)

A comparison predicate specifies a comparison between two values or lists of values.

Syntax

<comparison_predicate> ::= <expression> <comp_op> <expression>
| <expression> <comp_op> <subquery>
| <expression_list> <equal_or_not> (<expression_list>)
| <expression_list> <equal_or_not> <subquery>

expression, expression_list, subquery

The following operators are available for comparing two values:
<, >, <>, !=, =, <=, >= (comp_op)

Value lists can only be compared with the = and <> operators (equal_or_not).

Explanation

The subquery ( subquery) must supply a result table (see result table name) that contains the same number of columns as the number of values on the left of the operator. The result table may contain no more than one row.

The list of values specified to the right of the equal_or_notoperator ( expression_list) must contain the same number of values as specified in the value list in front of the equal_or_notoperator.

The JOIN predicate is a special case.

Comparing two values

Let x be the result of the first expression and y the result of the second expression or of the subquery.

· The values x and y must be comparable with one another.

· Numbers are compared to one another according to their algebraic values.

· Character strings are compared character by character.
Any blanks (code attribute ASCII, EBCDIC, UNICODE) or binary zeros (code attribute BYTE) at the end of one or both of the character strings are removed.
If the character strings have the different code attributes ASCII and EBCDIC, one of the two strings is converted implicitly so that they both have the same code attribute.
If the character strings have the different code attributes ASCII or EBCDIC and UNICODE, the character string with the code attribute ASCII or EBCDIC is implicitly converted into a character string with the code attribute UNICODE.
Two character strings are identical if they have the same characters in all positions.
The relationship between two character strings that are not identical is defined by the first character that differs in a comparison from left to right. This comparison is performed in accordance with the code attribute selected for this column (ASCII, EBCDIC, UNICODE, or BYTE).

· If x or y are NULL values, or if the result of the subquery is empty, (x <comp_op> y) is not defined.

Comparing two value lists

If a value list (expression_list) is specified on the left of the comparison operator equal_or_not, x is the value list that comprises the results of the values x1, x2, ..., xn in this list. y is the result of the subquery or the result of the second value list. A value list y consists of the results of the values y1, y2, ..., yn.

· A value xm must be comparable with the associated value ym.

· x=y is true if for xm=ym for all m=1, ..., n.

· x<>y is true if at least xm<>ym for at least one m.

· (x <equal_or_not> y) is undefined (not known) if there is no m for which (xm <equal_or_not> ym) is false and if there is at least one m for which (xm <equal_or_not> ym) is undefined.

· If one xm or one ym is a NULL value, or if the result of the subquery is empty, (x <equal_or_not> y) is undefined.

Example table: customer

Which customers are female?

SELECT title, firstname, name FROM customer
WHERE title = 'Mrs'

TITLE | FIRSTNAME | NAME
Mrs | Jenny | Porter
Mrs | Sally | Peters
Mrs | Susan | Brown
Mrs | Rose | Brown


Comparison operators (comp_op) (SAP Library - SAP DB)

 Entering content frame

Comparison operators (comp_op)

Operators for comparing values (comp_op)

Syntax

<comp_op> ::= < | > | <> | != | = | <= | >=
| Ø = | Ø < | Ø > (for machines with EBCDIC code )
| ~ = | ~ < | ~ > (for machines with ASCII code )


Comparison operators (equal_or_not) (SAP Library - SAP DB)

 Entering content frame

Comparison operators (equal_or_not)

Operators for comparing value lists (equal_or_not)

Syntax

<equal_or_not> ::= <> |=
| Ø = (for machines with EBCDIC code )
| ~ = (for machines with ASCII code )


DEFAULT predicate (SAP Library - SAP DB)

 Entering content frame

DEFAULT predicate

By specifying a DEFAULT predicate , you can check whether a column contains the default value defined for this column.

Syntax

<default_predicate> ::= <column_spec> <comp_op> DEFAULT

column_spec , comp_op

Explanation

A DEFAULT specification must be made for the specified column. This can be done in the following SQL statements:

  • CREATE TABLE statement
  • ALTER TABLE statement

If the column contains the NULL value , <column_spec> <comp_op> DEFAULT is undefined.

The rules for comparing values or value lists, as defined under comparison predicate , apply here.


EXISTS Predicate (exists_predicate) (SAP Library - SAP DB)

 Entering content frame

EXISTS Predicate (exists_predicate)

The EXISTS predicate ( exists_predicate) checks whether a result table (see result table name) contains at least one row.

Syntax

<exists_predicate> ::= EXISTS <subquery>

subquery

Explanation

The truth content of an EXISTS predicate is either true or false.

The subquery generates a result table. If this result table contains at least one row, EXISTS <subquery> is true.

Example tables: customer, reservation

Only select customers that have one or more reservations:

SELECT * FROM customer WHERE EXISTS
(SELECT * FROM reservation WHERE customer.cno = reservation.cno)

CNO | TITLE | NAME | FIRSTNAME | ZIP | CITY | ACCOUNT
3000 | Mrs | Porter | Jenny | 80335 | New York | 100.00
3100 | Comp | DATASOFT | ? | 50933 | Dallas | 4813.50
3200 | Mr | Porter | Martin | 10969 | Los Angeles | 0.00
3600 | Mr | Howe | George | 81737 | New York | -315.40
3900 | Mrs | Brown | Susan | 13599 | Los Angeles | -4167.79
4100 | Mr | Adams | Thomas | 13355 | Los Angeles | -416.88
4300 | Comp | TOOLware | ? | 13629 | Los Angeles | 3770.50
4400 | Mrs | Brown | Rose | 40233 | Hollywood | 440.00


IN Predicate (in_predicate) (SAP Library - SAP DB)

 Entering content frame

IN Predicate (in_predicate)

The IN predicate checks whether a value or a value list is contained in a specified set of values or value lists.

Syntax

<in_predicate> ::=
  <expression> [NOT] IN <subquery>
| <expression> [NOT] IN <expression_list>
| <expression_list> [NOT] IN <subquery>
| <expression_list> [NOT] IN (<expression_list>,...)

expression, expression_list, subquery

Explanation

The subquery must supply a result table (see result table name) that contains the same number of columns as the number of values specified by the expression on the left-hand side of the IN operator.

Each value list specified on the right-hand side of the IN operator must contain the same number of values as specified in the value list on the left-hand side of the IN operator.

· x [NOT] IN S, whereby x <expression>and S <subquery> or <expression_list>
The value x and the values in S must be comparable.

· x [NOT] IN S, whereby x <expression_list> with the values x1, x2, ..., xn and S <subquery>(set of value lists s) or (<expression_list>,...) (Range of values lists s) with the value lists s: s1, s2, ..., sn
A value xm must be comparable with all values sm.
x=s is true if xm=sm, m=1,...,n
x=s is false if there is at least one m for which xm=sm is false
x=s is undefined if there is no m for which xm=sm is false and there is at least one m for which xm=sm is undefined.

The entry '------' in the list below means that no statement can be made if only the result of the comparison with one s is known.

 | Result of the function x IN S
x=s is true for at least one s | true
x=s is true for all s | true
S contains NULL values and x=s is true for the remaining s | true
S is empty | false
x=s is false for at least one s | ------
x=s is false for all s | false
S contains NULL values and x=s is false for the remaining s | undefined
x=s is not true for any s and is undefined for at least one value s | undefined

x NOT IN S has the same result as NOT(x IN S)

Example table: customer

Choosing all customers who are natural persons (not companies):

SELECT title, firstname, name, city FROM customer
WHERE title IN ('Mr','Mrs')

TITLE | FIRSTNAME | NAME | CITY
Mrs | Jenny | Porter | New York
Mr | Martin | Porter | Los Angeles
Mrs | Sally | Peters | Los Angeles
Mr | Peter | Brown | Hollywood
Mr | Michael | Porter | New York
Mr | George | Howe | New York
Mr | Frank | Randolph | Los Angeles
Mr | Joseph | Peters | Los Angeles
Mrs | Susan | Brown | Los Angeles
Mr | Anthony | Jackson | Los Angeles
Mr | Thomas | Adams | Los Angeles
Mr | Mark | Griffith | New York
Mrs | Rose | Brown | Hollywood


JOIN Predicate (join_predicate) (SAP Library - SAP DB)

 Entering content frame

JOIN Predicate (join_predicate)

A JOIN predicate specifies a JOIN. A JOIN predicate can be specified with or without one or with two OUTER JOIN indicators.

Syntax

<join_predicate> ::=
<expression> [<outer_join_indicator>] <comp_op> <expression> [<outer_join_indicator>]

<outer_join_indicator> ::= (+)

expression, comp_op

Explanation

Each expression must contain a column specification. A column specification must exist for the first and second expression so that both specifications refer to different table names or reference names.

Let x be the value of the first expression and y the value of the second expression. The values x and y must be comparable with one another.

The rules outlined under comparison predicate apply here.

If at least one OUTER JOIN indicator is specified in a JOIN predicate of a search condition, the corresponding table expression must be based on exactly two tables, or the following has to apply:

· OUTER JOIN indicators are only specified for one of the tables in the FROM clause.

· All of the JOIN predicates in this table to just one other table contain the OUTER JOIN indicator.

· All other JOIN predicates contain no OUTER JOIN indicators.

If a JOIN requires more than two tables for the QUERY specification and if one of the rules above cannot be observed, a QUERY expression can also be used in the FROM clause.

Only those rows from the table that have a counterpart of the comparison operator in the JOIN predicate specified in the table are transferred to the result table.

The OUTER JOIN indicator must be specified on the side of the comparison operator where the other table is specified if each row in a table is to appear at least once in the result table.
If it is not possible to find at least one counterpart for a table row in the other table, this row is used to build a row for the result table. The NULL value is then used for the output columns which are formed from the columns in the other table.
Since the OUTER JOIN indicator can be specified on both sides of the comparison operator if the table expression is based on just two tables, it can be ensured that each line in both tables appears at least once in the result table.

The JOIN predicate is a special case of the comparison predicate. The number of JOIN predicates in a search condition is limited to 128.

JOIN predicate

Example tables: customer, reservation

Is there a reservation for the customer 'Porter'? If so, for what date?

SELECT reservation.rno, customer.name,customer.firstname, reservation.arrival, departure

FROM customer, reservation

WHERE customer.name = 'Porter' AND customer.cno = reservation.cno

RNO | NAME | FIRSTNAME | ARRIVAL | DEPARTURE
100 | Porter | Jenny | 13/11/2001 | 15/11/2001
110 | Porter | Jenny | 24/12/2001 | 06/01/2002
120 | Porter | Martin | 14/11/2001 | 18/11/2002

Specifying an OUTER JOIN indicator

Example tables: hotel, reservation

List all the hotels in Los Angeles for which a reservation exists and those for which a reservation does not exist. Missing reservation numbers are assigned a NULL value.

SELECT hotel.hno, hotel.name, reservation.rno

FROM hotel, reservation

WHERE hotel.city = 'Los Angeles' AND hotel.hno = reservation.hno (+)

HNO | NAME | RNO
80 | Midtown | 100
50 | Lake Michigan | 120
80 | Midtown | 140
120 | Sunshine | 180
40 | Eight Avenue | ?


LIKE Predicate (like_predicate) (SAP Library - SAP DB)

 Entering content frame

LIKE Predicate (like_predicate)

A LIKE predicate ( like_predicate) is used to search for character strings that have a certain pattern. This pattern can be a certain character string or any sequence of characters (whose length may or may not be known).

Syntax

<like_predicate> ::= <expression> [NOT] LIKE <like_expression> [ESCAPE <expression>]

<like_expression> ::= <expression> | '<pattern_element>...'

expression, pattern_element

Explanation

The expression in the like_expression must supply an alphanumeric value or a date or time value.

x NOT LIKE y has the same result as NOT(x LIKE y).

Result of x LIKE y

x or y are NULL values

x LIKE y is undefined

x and y are non-NULL values

x LIKE y is either true or false

x can be split into substrings with the result that:

A substring of x is a sequence of 0,1, or more contiguous characters, and each character of x belongs to exactly one substring.

The number of substrings of x and y is identical.

If the nth pattern element of y is a sequence of characters and the nth substring of x is a sequence of 0 or more characters.

x LIKE y is true
ESCAPE

An escape character (ESCAPE <expression>) must be used if you want to search for an <underscore>, '%', or the hexadecimal value X'1E' or X'1F' in the LIKE predicate.

If ESCAPE <expression> is specified, the corresponding expression ( expression) must supply an alphanumeric value that consists of just one character. If this escape character is contained in the LIKE expression ( like_expression), the following character must be one of the special characters <underscore>, %, X’1E’, or X’1F’. This special character is then viewed as standing for itself.

Search for any character string with a minimum length of 1: LIKE '%_'
Search for a character string in which a fixed number of characters is known: LIKE'_c_'
Search for a character string with any number of characters, whereby the character string must contain an <underscore>: LIKE '%:_%'ESCAPE':'

Example table: customer

Customers whose name ends with 'FT':

SELECT name, city FROM customer
WHERE name LIKE '%FT'

NAME | CITY
DATASOFT | Dallas

Finding all customers whose names consist of six letters and begin with 'P':

SELECT name, firstname, city FROM customer
WHERE name LIKE 'P_ _ _ _ _'

NAME | FIRSTNAME | CITY
Porter | Jenny | New York
Porter | Martin | Los Angeles
Peters | Sally | Los Angeles
Porter | Michael | New York
Peters | Joseph | Los Angeles

Customers with a 'p' in their name from the second position:

SELECT name, city FROM customer
WHERE name LIKE '_%p%'

NAME | CITY
Randolph | Los Angeles


Pattern element (SAP Library - SAP DB)

 Entering content frame

Pattern element

Element for specifying a comparison pattern (for a LIKE predicate ). A comparison can be carried out with a string of characters or a set of characters.

Syntax

<pattern_element> ::= <match_string> | <match_set>

match_string , match_set


match_string (SAP Library - SAP DB)

 Entering content frame

match_string

If a match_string is specified, this position in the search pattern can be replaced by any number of characters.

Syntax

<match_string> ::= % | X'1F'

Explanation

A LIKE predicate is used to search for character strings that have a certain pattern. Match_string can be used to specify the pattern (pattern element).

Example table: customer

Finding all customers whose first names have any lengths and begin with 'M':

SELECT firstname, name FROM customer
WHERE firstname LIKE 'M%'

FIRSTNAME | NAME
Martin | Porter
Michael | Porter
Mark | Griffith


match_set (SAP Library - SAP DB)

 Entering content frame

match_set

If a match_set is specified, this position in the search pattern can be replaced by the exact number of characters specified in the match_set.

Syntax

<match_set> ::= <underscore> | X'1E' | <match_char>

<match_char>    ::= Every character other than %, X'1F', underscore, X'1E'

underscore

Explanation

A LIKE predicate is used to search for character strings that have a certain pattern. Match_set can be used to specify the pattern (pattern element).

· <underscore> | X'1E' : this position in the pattern can be replaced by any one character

· match_char : this position in the pattern can be replaced by the specified character itself.

Example table: customer

Finding all customers whose names consist of six letters and begin with 'P':

SELECT name, firstname, city FROM customer
WHERE name LIKE 'P_ _ _ _ _'

NAME | FIRSTNAME | CITY
Porter | Jenny | New York
Porter | Martin | Los Angeles
Peters | Sally | Los Angeles
Porter | Michael | New York
Peters | Joseph | Los Angeles


NULL predicate (SAP Library - SAP DB)

 Entering content frame

NULL predicate

By specifying a NULL predicate , you can test whether the value is a NULL value .

Syntax

<null_predicate> ::= <expression> IS [NOT] NULL

expression

Explanation

The truth content of a NULL predicate is either true or false.

 | Result of the function x IS NULL
x is NULL value | true
x is a special NULL value | false

x IS NOT NULL has the same result as NOT(x IS NULL) .


Quantified Predicate (quantified_predicate) (SAP Library - SAP DB)

 Entering content frame

Quantified Predicate (quantified_predicate)

By specifying a quantity predicate, you can compare a value or list of values to a set of values or value lists.

Syntax

<quantified_predicate> ::=
  <expression> <comp_op> <quantifier> <expression_list>
| <expression> <comp_op> <quantifier> <subquery>
| <expression_list> <equal_or_not> <quantifier> (<expression_list>,...)
| <expression_list> <equal_or_not> <quantifier> <subquery>

subquery, expression_list

The following operators are available for comparing values:
<, >, <>, !=, =, <=, >= (comp op)

Value lists can only be compared with the = and <> operators (equal_or_not).

The quantified predicate can be qualified with ALL, SOME, or ANY (quantifier).

Explanation

The subquery must supply a result table (see result table name) that contains the same number of columns as the number of values specified by the expression or expression list on the left-hand side of the operator.

Each list of values specified to the right of the equal_or_notoperator ( expression_list) must contain the same number of values as specified in the value list in front of the equal_or_notoperator.

· Let x be the result of the first expression and S the result of the subquery or sequence of values. S is a set of values s. The value x and the values in S must be comparable with each other.

· If a value list ( expression_list) is specified on the left of the comparison operator equal_or_not, then let x be the value list comprising the results of the values x1, x2, ..., xn of this value list. Let S be the result of the subquery consisting of a set of value lists s or a sequence of value lists s. A value list s consists of the results of the values s1, s2, ..., sn. A value xm must be comparable with all values sm.
x=s is true if xm=sm, m=1,...,n
x<>s is true if there is at least one m for which xm<>sm
x <equal or not> s is undefined if there is no m for which xm <equal or not> sm is false and if there is at least one m for which xm <equal_or_not> sm is undefined.
If one xm or one ym is a NULL value, or if the result of the subquery is empty, x <equal_or_not> y is undefined.

The entry '------' in the list below means that no statement can be made if only the result of the comparison with one s is known.

x <compare> <quantifier> S, whereby compare ::= comp_op | equal_or_not

 | quantifier ::= ALL | quantifier ::= ANY | SOME
S is empty | true | false
x <compare> S is true for at least one s from S | ------ | true
x <compare> S is true for all s from S | true | true
x <compare> S is not false for any value from S and is undefined for at least one value s | undefined |
S contains NULL values and x <compare> S is true for all other s | undefined | true
x <compare> S is false for at least one value s from S | false | ------
x <compare> S is false for all s from S | false | false
x <compare> S is not true for any value s from S and is undefined for at least one value s |  | undefined
S contains NULL values and x <compare> S is false for all other s | false | undefined

Example table: hotel

List of hotels that have the same name as other cities in the base table.

SELECT name, city FROM hotel
WHERE name = ANY (SELECT city FROM hotel)

The subquery SELECT city FROM hotel determines the list of city names that are compared with the hotel names.

NAME | CITY
Los Angeles | Cincinatti
Long Beach | Long Beach
Dallas | Dallas


Quantifier (SAP Library - SAP DB)

 Entering content frame

Quantifier

The quantified predicate can be qualified with ALL, SOME, or ANY.

Syntax

<quantifier> ::= ALL | SOME | ANY


ROWNO Predicate (rowno_predicate) (SAP Library - SAP DB)

 Entering content frame

ROWNO Predicate (rowno_predicate)

The ROWNO predicate restricts the number of lines in a result table (see result table name ).

Syntax

<rowno_predicate> ::= ROWNO < <unsigned_integer>
| ROWNO < <parameter_spec>
| ROWNO <= <unsigned_integer>
| ROWNO <= <parameter_spec>

unsigned_integer , parameter_spec

Explanation

A ROWNO predicate may only be used in a WHERE clause that belongs to a QUERY statement. The ROWNO predicate can be used like any other predicate in the WHERE clause if the following restrictions are observed:

  • The ROWNO predicate must be linked to the other predicates by a logic AND
  • The ROWNO predicate must not be negated
  • The ROWNO predicate may not be used more than once in the WHERE clause

You can specify the maximum number of lines in the result table using an unsigned integer or a parameter specification. If more lines are found, they are simply ignored and do not lead to an error message. Specifying a ROWNO predicate of the type ROWNO <= 0 results in an empty results table.

If a ROWNO predicate and an ORDER clause are specified, only the first n result lines are searched and sorted. The result usually differs from that which would have been obtained if a ROWNO predicate had not been used and if the first n result rows had been considered.

If a ROWNO predicate and a set function are specified, the set function is only applied to the number of lines restricted by the ROWNO predicate.


SOUNDS predicate (SAP Library - SAP DB)

 Entering content frame

SOUNDS predicate

A SOUNDS predicate is used to perform a phonetic comparison.

Syntax

<sound_predicate> ::= <expression> [NOT] SOUNDS [LIKE] <expression>

expression

Explanation

Specifying LIKE in the SOUNDS predicate has no effect.

The values in the expressions must be alphanumeric (code attribute ASCII, EBCDIC, see code tables ).

A phonetic comparison between values is carried out according to the SOUNDEX algorithm. First, all vowels and some consonants are eliminated, then all consonants which are similar in sound are mapped to each other.

x [NOT] SOUNDS [LIKE] y

 | Result of the predicate
x or y is the NULL value | x SOUNDS y is undefined
x and y are non-NULL values | x SOUNDS y is true or false
x and y are phonetically identical | x SOUNDS y is true

x NOT SOUNDS y has the same result as NOT (x SOUNDS y) .

See also:

SOUNDEX(x) string function


Search Condition (search_condition) (SAP Library - SAP DB)

 Entering content frame

Search Condition (search_condition)

A search_condition links statements that can be true, false, or undefined. Rows in a table may be found that fulfill several conditions that are linked with AND or OR.

Syntax

<search_condition> ::= <boolean_term> | <search_condition> OR <boolean_term>

<boolean_term> ::= <boolean_factor> | <boolean_term> AND <boolean_factor>

boolean factor: determine the boolean values (BOOLEAN) to be linked or their negation ( NOT).

Explanation

Predicates in a WHERE clause are applied to the specified row or a group of rows in a table formed with the GROUP clause. The results are linked using the specified Boolean operators (AND, OR, NOT).

If no parentheses are used, the precedence of the operators is as follows: NOT has a higher precedence than AND and OR, AND has a higher precedence than OR. Operators with the same precedence are evaluated from left to right.

NOT

x | NOT(x)
true | false
false | true
undefined | undefined

x AND y

x y | false | undefined | true
false | false | false | false
undefined | false | undefined | undefined
true | false | undefined | true

x OR y

x y | false | undefined | true
false | false | undefined | true
undefined | undefined | undefined | true
true | true | true | true

Example table: customer

Customers who live in New York or have a credit balance:

SELECT firstname, name, city, account FROM customer
WHERE city = 'New York' OR account > 0

FIRSTNAME | NAME | CITY | ACCOUNT
Jenny | Porter | New York | 100.00
? | DATASOFT | Dallas | 4813.50
Michael | Porter | New York | 0.00
George | Howe | New York | -315.40
Joseph | Peters | Los Angeles | 650.00
Mark | Griffith | New York | 0.00
? | TOOLware | Los Angeles | 3770.50
Rose | Brown | Hollywood | 440.00

Customers who live in Hollywood and have a credit balance:

SELECT firstname, name, city, account FROM customer
WHERE city = 'Hollywood' AND account > 0

FIRSTNAME | NAME | CITY | ACCOUNT
Rose | Brown | Hollywood | 440.00


Boolean factor (SAP Library - SAP DB)

 Entering content frame

Boolean factor

Specifies how the Boolean values are determined that are to be linked in a search condition by AND or OR.

Syntax

<boolean_factor> ::= [NOT] <predicate> | [NOT] (<search_condition>)

predicate , search_condition


Functions: Overview (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions: Overview

List of all function names

ABS | ACOS | ADDDATE
ADDTIME | ALPHA | ASCII
ASIN | ATAN | ATAN2
AVG |  |
CASE | CEIL | CHAR
CHR | COS | COSH
COT | COUNT |
DATE | DATEDIFF | DAY
DAYNAME | DAYOFMONTH | DAYOFWEEK
DAYOFYEAR | DECODE | DEGREES
EBCDIC | EXP | EXPAND
FIXED | FLOAT | FLOOR
GET_OBJECTNAME | GET_OWNER | GREATEST
HEX | HEXTORAW | HOUR
INDEX | INITCAP |
LEAST | LENGTH | LFILL
LN | LOG | LOWER
LPAD | LTRIM |
MAKEDATE | MAKETIME | MAX
MAPCHAR | MICROSECOND | MIN
MINUTE | MONTH | MONTHNAME
NOROUND | NUM |
PI | POWER |
RADIANS | REPLACE | RFILL
ROUND | RPAD | RTRIM
SECOND | SIGN | SIN
SINH | SOUNDEX |
SQRT | SUBDATE | SUBSTR
SUBTIME | STDDEV | SUM
TAN | TANH | TIME
TIMEDIFF | TIMESTAMP | TRANSLATE
TRIM | TRUNC |
UPPER |  |
VALUE | VARIANCE |
WEEKOFYEAR |  |
YEAR |  |
|| | & |


Function (function_spec) (SAP Library - SAP DB)

 Entering content frame

Function (function_spec)

There is a series of functions that can be applied to a value (row) as an argument ( function_spec ) and supply a result.

Syntax

<function_spec> ::= <arithmetic_function> | <trigonometric_function>
| <string_function> | <date_function> | <time_function>
| <extraction_function> | <special_function>
| <conversion_function>

arithmetic_function , trigonometric_function , string_function , date_function , time_function , extraction_function , special_function , conversion_function

Explanation

The arguments and results of the functions are numeric, alphanumeric or Boolean values that are subject to certain restrictions. LONG columns are not allowed as arguments.


Arithmetic function (SAP Library - SAP DB)

 Entering content frame

Arithmetic function

An arithmetic function is a function that supplies a numeric value as a result.

Syntax

<arithmetic_function> ::=
  TRUNC   ( <expression>[, <expression>] )
| ROUND   ( <expression>[, <expression>] )
| NOROUND ( <expression> )
| FIXED   ( <expression>[, <unsigned_integer> [, <unsigned_integer] ] )
| FLOAT   ( <expression>[, <unsigned_integer> ] )
| CEIL    ( <expression> )
| FLOOR   ( <expression> )
| SIGN    ( <expression> )
| ABS     ( <expression> )
| POWER   ( <expression>, <expression> )
| EXP     ( <expression> )
| SQRT    ( <expression> )
| LN      ( <expression> )
| LOG     ( <expression>, <expression> )
| PI
| LENGTH  ( <expression> )
| INDEX   ( <string_spec>, <string_spec> [,<expression>[, <expression>] ] )

expression , unsigned_integer , string_spec

TRUNC(a,n) , ROUND(a,n) , NOROUND(a) , FIXED(a,p,s) , FLOAT(a,s) , CEIL(a) , FLOOR(a) , SIGN(a) , ABS(a) , POWER(a,n) , EXP(a) , SQRT(a) , LN(a) , LOG(a,b) , PI , LENGTH(a) , INDEX(a,b,p,s)


ABS(a) (SAP Library - SAP DB)

 Entering content frame

ABS(a)

ABS(a) is an arithmetic_function that determines the unsigned value (absolute value) of the number a.

 | Result of the ABS(a) function
a is NULL value | NULL value
a is special NULL value | Special NULL value


CEIL(a) (SAP Library - SAP DB)

 Entering content frame

CEIL(a)

CEIL(a) is an arithmetic function that calculates the smallest integer value that is greater than or equal to the number a.

The result is a fixed point number with 0 decimal places.

An error message is output if it is not possible to represent the result of CEIL(a) as a fixed point number.

 | Result of CEIL(a) function
a is the NULL value | NULL value
a is special NULL value | Special NULL value


EXP(a) (SAP Library - SAP DB)

 Entering content frame

EXP(a)

EXP(a) is an arithmetic function that calculates the power from base e (2.71828183) and the exponent a ("e to the power of a").

 | Result of EXP(a) function
a is NULL value | NULL value
a is special NULL value | Special NULL value


FIXED(a,p,s) (SAP Library - SAP DB)

 Entering content frame

FIXED(a,p,s)

FIXED(a,p,s) is an arithmetic function that is used to output the number a in a format of the data type FIXED (p,s).

Digits after the decimal point are rounded to s decimal places, if necessary.

 | Result of the FIXED(a,p,s) function
s not specified | Result as for s=0
p not specified | Result as for p=38
ABS(a)>10exp(p-s) | Special NULL value
a is the NULL value | NULL value
a is special NULL value | Special NULL value


FLOAT(a,s) (SAP Library - SAP DB)

 Entering content frame

FLOAT(a,s)

FLOAT(a,s) is an arithmetic function that outputs the figure a in a format of the data type FLOAT (s). It is rounded to s places if necessary.

 | Result of the FLOAT(a,s) function
a is NULL value | NULL value
a is special NULL value | Special NULL value


FLOOR(a) (SAP Library - SAP DB)

 Entering content frame

FLOOR(a)

FLOOR(a) is an arithmetic function that calculates the largest integer value that is less than or equal to the number a.

The result is a fixed point number with 0 decimal places.

An error message is output if it is not possible to represent the result of FLOOR(a) as a fixed point number.

 | Result of the FLOOR(a) function
a is the NULL value | NULL value
a is special NULL value | Special NULL value


INDEX(a,b,p,s) (SAP Library - SAP DB)

 Entering content frame

INDEX(a,b,p,s)

INDEX(a,b,p,s) is an arithmetic function that determines the position of the substring specified in b within the character string a.

The parameter p is optional. If p is specified (p>=1), it defines the start position for the search for the substring b. If p is not specified, the search is started at position 1.

The parameter s is optional. If s is specified, it determines the number of searches for the substring b. If s is not specified, the search is carried out for the first occurrence.

 | Result of the INDEX(a,b,p,s) function
a, b character strings and b not less than s times substring of a | 0
a character string and b empty character string | p
a,b,p or s is NULL value | NULL value
p or s is special NULL value | Error Message

Example table: customer

The position of the character string ‘er’ is to be determined in all customer surnames.

SELECT name, INDEX(name,'er') position_er FROM customer

NAME | POSITION_ER
Porter | 5
DATASOFT | 0
Porter | 5
Peters | 4
Brown | 0
Porter | 5
Howe | 0
Randolph | 0
Peters | 4
Brown | 0
Jackson | 0
Adams | 0
Griffith | 0
TOOLware | 0
Brown | 0


LENGTH(a) (SAP Library - SAP DB)

 Entering content frame

LENGTH(a)

LENGTH(a) is an arithmetic function that specifies the number of characters or bytes that are required to represent the value a internally. The function can be used for all data types except LONG.

 | Result of the LENGTH(a) function
a is a value of data type CHAR|VARCHAR <ASCII|EBCDIC|UNICODE> with n characters | Number of characters n
a is a value of another data type (other than LONG) of length n | Length n in bytes
a is a NULL value | NULL value
a is special NULL value | Special NULL value

The length of the number of characters or the length in bytes is determined without any consideration of trailing blanks (code attribute ASCII, EBCDIC, UNICODE) or binary zeros (code attribute BYTE).

Example table: customer

The customer table is sorted according to the length of the surnames, with names with the same length sorted in alphabetical order.

SELECT name, LENGTH(name) mylength
FROM customer ORDER BY mylength, name

NAME | MYLENGTH
Howe | 4
Adams | 5
Brown | 5
Brown | 5
Brown | 5
Peters | 6
Peters | 6
Porter | 6
Porter | 6
Porter | 6
Jackson | 7
DATASOFT | 8
Griffith | 8
Randolph | 8
TOOLware | 8


LN(a) (SAP Library - SAP DB)

 Entering content frame

LN(a)

LN(a) is an arithmetic function that calculates the natural logarithm of the number a.

 | Result of the LN(a) function
a is NULL value | NULL value
a is special NULL value | Special NULL value


LOG(a,b) (SAP Library - SAP DB)

 Entering content frame

LOG(a,b)

LOG(a,b) is an arithmetic function that calculates the logarithm of the number b to base a.

 | Result of the LOG(a,b) function
a or b is the NULL value | NULL value
b is special NULL value | Special NULL value


NOROUND(a) (SAP Library - SAP DB)

 Entering content frame

NOROUND(a)

NOROUND(a) is an arithmetic function that prevents the result of an UPDATE or INSERT statement from being rounded so that it matches the data type of the target column.

If the non-rounded number does not correspond to the data type of the target column, an error message is output.

 | Result of the NOROUND(a) function
a is the NULL value | NULL value
a is special NULL value | Special NULL value


PI (SAP Library - SAP DB)

 Entering content frame

PI

PI is an arithmetic function that outputs the value p.


POWER(a,n) (SAP Library - SAP DB)

 Entering content frame

POWER(a,n)

POWER(a,n) is an arithmetic function that calculates the nth power of the number a.

An error message is output if n is not an integer.

 | Result of the POWER(a,n) function
a or n is the NULL value | NULL value
a is special NULL value | Special NULL value


ROUND(a,n) (SAP Library - SAP DB)

 Entering content frame

ROUND(a,n)

ROUND(a,n) is an arithmetic function with the following result (for the values a and n):

ROUND(a) – round decimal places up and down
ROUND(a,n) – round up and down to the nth place on the right of the decimal point
ROUND(a,-n) – round up and down to the nth place on the left of the decimal point

 | Result of the ROUND(a,n) function
a>=0 | TRUNC (a+0.5*10E-n,n)
a<0 | TRUNC(a-0.5*10E-n,n)
n not specified | Result as for n=0
n is not an integer | The integer component of n is used and the result is as with a>=0 or a<0
a is floating point number | Floating point number
a is fixed point number | Fixed point number
a is the NULL value | NULL value
a is special NULL value | Special NULL value


SIGN(a) (SAP Library - SAP DB)

 Entering content frame

SIGN(a)

SIGN(a) is an arithmetic function that indicates the sign of the number a.

 | Result of the SIGN(a) function
a<0 | -1
a=0 | 0
a>0 | 1
a is the NULL value | NULL value
a is special NULL value | Special NULL value


SQRT(a) (SAP Library - SAP DB)

 Entering content frame

SQRT(a)

SQRT(a) is an arithmetic function that calculates the square root of the number a.

 | Result of the SQRT(a) function
a>0 | Square root of a
a=0 | 0
a<0 or a is NULL value | NULL value
a is special NULL value | Special NULL value


TRUNC(a,n) (SAP Library - SAP DB)

 Entering content frame

TRUNC(a,n)

TRUNC(a,n) is an arithmetic function with the following result (for the values a and n):

TRUNC(a) – truncate the decimal places of a
TRUNC(a,n) – truncate the number a after n decimal places
TRUNC(a,-n) – set n places in the number a before the decimal point to 0

 | Result of the TRUNC(a,n) function
n>0 | Number a that is truncated n places after the decimal point
n=0 | Integer component of a
n<0 | Number a that is truncated s places in front of the decimal point
n not specified | As with n=0
n is not an integer | The integer component of n is used and the result is as with n>0, n=0, or n<0
a is floating point number | Floating point number
a is fixed point number | Fixed point number
a is the NULL value | NULL value
a is special NULL value | Special NULL value


Trigonometric function (SAP Library - SAP DB)

 Entering content frame

Trigonometric function

A trigonometric function is a function that supplies a numeric value as a result.

Syntax

<trigonometric_function> ::=
  COS     ( <expression> )
| SIN     ( <expression> )
| TAN     ( <expression> )
| COT     ( <expression> )
| COSH    ( <expression> )
| SINH    ( <expression> )
| TANH    ( <expression> )
| ACOS    ( <expression> )
| ASIN    ( <expression> )
| ATAN    ( <expression> )
| ATAN2   ( <expression>, <expression> )
| RADIANS ( <expression> )
| DEGREES ( <expression> )

expression

All of the values (expression) in every trigonometric function identify an angle in radians. The only exception to this is the RADIANS function.

 | Result of the trigonometric function
<expression> is NULL value | NULL value
<expression> is special NULL value | Special NULL value
COS(a) | Cosine of number a
SIN(a) | Sine of number a
TAN(a) | Tangent of number a
COT(a) | Cotangent of number a
COSH(a) | Hyperbolic cosine of number a
SINH(a) | Hyperbolic sine of number a
TANH(a) | Hyperbolic tangent of number a
ACOS(a) | Arc cosine of number a
ASIN(a) | Arc sine of number a
ATAN(a) | Arc tangent of number a
ATAN2(a,b) | Arc tangent of the value a/b, where -p <=a<=+p and -p <=b<=+p
ASIN(a) | Arc sine of number a
RADIANS(a) | Angle in radians of the number a
DEGREES(a) | Value in degrees of the number a


String Function (string_function) (SAP Library - SAP DB)

 Entering content frame

String Function (string_function)

A string function is a function that supplies an alphanumeric value as a result.

Syntax

<string_function> ::=
  <string_spec> || <string_spec>
| <string_spec> & <string_spec>
| SUBSTR    (<string_spec>,<expression>[,<expression>])
| LFILL     (<string_spec>,<string_literal>[,<unsigned_integer>])
| RFILL     (<string_spec>,<string_literal>[,<unsigned_integer>])
| LPAD      (<string_spec>,<expression>,<string_literal>[,<unsigned_integer>])
| RPAD      (<string_spec>,<expression>,<string_literal>[,<unsigned_integer>])
| TRIM      (<string_spec>[,<string_spec>])
| LTRIM     (<string_spec>[,<string_spec>])
| RTRIM     (<string_spec>[,<string_spec>])
| EXPAND    (<string_spec>,<unsigned_integer>)
| UPPER     (<string_spec>)
| LOWER     (<string_spec>)
| INITCAP   (<string_spec>)
| REPLACE   (<string_spec>,<string_spec>[,<string_spec>])
| TRANSLATE (<string_spec>,<string_spec>,<string_spec>)
| MAPCHAR   (<string_spec>[,<unsigned_integer>][,<mapchar_set_name>])
| ALPHA     (<string_spec>[,<unsigned_integer>])
| ASCII     (<string_spec>)
| EBCDIC    (<string_spec>)
| SOUNDEX   (<string_spec>)
| GET_OBJECTNAME (<string_literal>)
| GET_OWNER      (<string_literal>)

string_spec , expression , string_literal , unsigned_integer , mapchar_set_name

Concatenation (x||y and x&y) , SUBSTR(x,a,b) , LFILL(x,a,n) , RFILL(x,a,n) , LPAD(x,a,y,n) , RPAD(x,a,y,n) , TRIM(x,y) , LTRIM(x,y) , RTRIM(x,y) , EXPAND(x,n) , UPPER(x)/LOWER(x) , INITCAP(x) , REPLACE(x,y,z) , TRANSLATE(x,y,z) , MAPCHAR(x,n,i) , ALPHA(x,n) , ASCII(x)/EBCDIC(x) , SOUNDEX(x) , GET_OBJECTNAME(x,o) , GET_OWNER(x,o)


ALPHA(x,n) (SAP Library - SAP DB)

 Entering content frame

ALPHA(x,n)

ALPHA(x,n) is a string function that enables a character x in ASCII or EBCDIC code (code tables) to be converted to a different one or two-character representation in the DEFAULTMAP (mapchar_set_name). ALPHA(x,n) is used to define the sort sequence.

The function ALPHA(x,n) uses the MAPCHAR(x,n,i) function internally (where i is the DEFAULTMAP) and also performs a conversion to uppercase letters (UPPER(x)).

The parameter n is optional and specifies the maximum length of the result.

 | Result of the ALPHA(x,n) function
ALPHA(x,n) | UPPER(MAPCHAR(x,n,DEFAULTMAP))

The function ALPHA enables an appropriate sort, e.g. if "ü" is to be treated for as "UE" sorting purposes. The MAPCHAR SET with the name DEFAULTMAP is used.

SELECT...,ALPHA(<column name>) sort,...FROM...ORDER BY sort


ASCII/EBCDIC(x) (SAP Library - SAP DB)

 Entering content frame

ASCII/EBCDIC(x)

ASCII(x) or EBCDIC(x) is a string function that converts a character string x in ASCII code to EBCDIC code and vice versa.

 | Result of the ASCII(x) or EBCDIC(x) function
Code attribute for x is ASCII or EBCDIC | ASCII(x) is a character string in ASCII notation
Code attribute for x is ASCII or EBCDIC | EBCDIC(x) is a character string in EBCDIC notation
x is NULL value | NULL value

The ASCII and EBCDIC functions are useful when a specific code is to be used for sorting or comparison purposes.

Output of a sorted result table in EBCDIC order:

SELECT EBCDIC(name) FROM...WHERE...ORDER BY 1


EXPAND(x,n) (SAP Library - SAP DB)

 Entering content frame

EXPAND(x,n)

EXPAND(x,n) is a string function that inserts as many blanks (code attribute ASCII, EBCDIC ( code tables )) or binary zeros (code attribute BYTE) to the end of a character string x as are needed to give the string the length specified by n.

 | Result of the EXPAND(x,n) function
x is NULL value | NULL value

See also:

LFILL(x,a,n)

RFILL(x,a,n)


GET_OBJECTNAME(x,o) (SAP Library - SAP DB)

 Entering content frame

Function documentation GET_OBJECTNAME(x,o)

The string function GET_OBJECTNAME(x,o) returns the name of the database object.

x: Identifier of the object
The argument x is a string literal in the format[<owner>.]<identifier> or a character parameter of this type.
<owner> and <identifier> can be special identifiers .

o: Object type
You can use one of the following key words:
DBPROC[EDURE]: database procedure
DOMAIN: domain
SEQUENCE: sequence
SYNONYM: synonym
VIEW: view table
TABLE: table

 | Result of the Function GET_OBJECTNAME(x,o)
x identifies an object that is not of object type o | NULL value
Object x does not exist | NULL value
Object x exists, however the current user does not have any privileges for this object | NULL value
Object x exists for the owner specified under <owner> and the current user has a privilege for this object | <identifier>
Object x exists, and the current user has a privilege for this object | First object name found in the search hierarchy

For some object types, there is no search hierarchy. In this case, the function only searches for the object in the schema of the current user.


GET_OWNER(x,o) (SAP Library - SAP DB)

 Entering content frame

Function documentation GET_OWNER(x,o)

The string function GET_OWNER(x,o) returns the name of the owner of the specified database object.

x: Identifier of the object
The argument x is a string literal in the format[<owner>.]<identifier> or a character parameter of this type.
<owner> and <identifier> can be special identifiers .

o: Object type
You can use one of the following key words:
DBPROC[EDURE]: database procedure
DOMAIN: domain
SEQUENCE: sequence
SYNONYM: synonym
VIEW: view table
TABLE: table

 | Result of the Function GET_OWNER(x,o)
x identifies an object that is not of object type o | NULL value
Object x does not exist | NULL value
Object x exists, however the current user does not have any privileges for this object | NULL value
Object x exists for the owner specified under <owner> and the current user has a privilege for this object | <owner>
Object x exists, and the current user has a privilege for this object | First owner of this object found in the search hierarchy

For some object types, there is no search hierarchy. In this case, the function only searches for the object in the schema of the current user.


INITCAP(x) (SAP Library - SAP DB)

 Entering content frame

INITCAP(x)

INITCAP(x) is a string function that changes a character string so that the first character of a word is an uppercase letter and the rest of the word consists of lowercase characters. When this happens, different words are split by one or more characters from the 7-bit ASCII character set that are not letters or digits (commas, blanks, or colons, for example).

 | Result of the Function INITCAP(x)
x is a NULL value | NULL value

Example table: customer

Standardizing the notation for names

SELECT name, INITCAP(name) new_name
FROM customer WHERE firstname IS NULL

NAME | NEW_NAME
DATASOFT | Datasoft
TOOLware | TOOLware


LFILL(x,a,n) (SAP Library - SAP DB)

 Entering content frame

LFILL(x,a,n)

LFILL(x,a,n) is a string function that inserts the character string a at the start of the character string x as often as required until the character string has reached the length n. If the character string a cannot be completely inserted without exceeding the specified total length, only the part that is needed to reach the total length is inserted.

 | Result of the LFILL(x,a,n) function
LFILL(x,a) x must identify a CHAR or VARCHAR column. | The column x is filled with the characters of a until its maximum length is reached.
x is NULL value | NULL value
a or n is the NULL value | Error Message

Example table: customer

SELECT LFILL (firstname,' ',8) firstname, name, city
FROM customer
WHERE firstname IS NOT NULL AND city = 'Los Angeles'

FIRSTNAME | NAME | CITY
Martin | Porter | Los Angeles
Sally | Peters | Los Angeles
Frank | Randolph | Los Angeles
Joseph | Peters | Los Angeles
Susan | Brown | Los Angeles
Anthony | Jackson | Los Angeles
Thomas | Adams | Los Angeles

RFILL(x,a,n)

EXPAND(x,n)


LPAD(x,a,y,n) (SAP Library - SAP DB)

 Entering content frame

LPAD(x,a,y,n)

LPAD(x,a,y,n) is a string function that inserts the character string y at the start of the character string x as often as specified by the parameter a. Leading and subsequent blanks in the character string x are truncated. The optional parameter n defines the maximum total length of the character string created.

The result of the parameter a must be a positive integer.

The optional parameter n must be greater than or equal to the total LENGTH(x)+a*LENGTH(y).

 | Result of the LPAD(x,a,y,n) function
LPAD(x,a,y) x must identify a CHAR or VARCHAR column. | The maximum length of the character string is the length of the character string x.
x or a is the NULL value | NULL value
a is the special NULL value | Error Message

Example table: customer

Creating bar charts: LPAD inserts asterisks in front of the first parameter (in this case, a blank). This is done according to the number equal to account divided by 100.

SELECT name, account, LPAD(' ',TRUNC(account/100),'*',50) graph
FROM customer WHERE account > 0 ORDER BY account DESC

NAME | ACCOUNT | GRAPH
DATASOFT | 4813.50 | ************************************************
TOOLware | 3770.50 | *************************************
Peters | 650.00 | ******
Brown | 440.00 | ****
Porter | 100.00 | *

See also:

RPAD(x,a,y,n)


LTRIM(x,y) (SAP Library - SAP DB)

 Entering content frame

LTRIM(x,y)

LTRIM(x,y) is a string function that removes all of the characters specified in the character string y from the start of the character string x. The result of LTRIM(x,y), therefore, starts with the first character that was not specified in y.

 | Result of the LTRIM(x,y) function
LTRIM(x) | Only blanks (code attribute ASCII, EBCDIC ( code tables )) or binary zeros (code attribute BYTE) are removed from x.
x is NULL value | NULL value

See also:

TRIM(x,y)

RTRIM(x,y)


MAPCHAR(x,n,i) (SAP Library - SAP DB)

 Entering content frame

MAPCHAR(x,n,i)

MAPCHAR(x,n,i) is a string function that converts country-specific letters to a different format (for example, German umlauts, French letters with a grave accent).

MAPCHAR(x,n,i) uses the MapChar set with the name i (mapchar set name) to convert the character string x. If you do not specify a MapChar set name, the MapChar set with the name DEFAULTMAP (defined for the ASCII code) is used.

The code on which the character string x is based and the code on which the implemented Mapchar set is based must match.

The parameter n is optional and specifies the maximum length of the result.

 | Result of the MAPCHAR(x,n,i) Function
MAPCHAR(x,i) | MAPCHAR(x,n,i), where n is the length of the character string x
MAPCHAR(x,i) x is CHAR or VARCHAR column | MAPCHAR(x,n,i), where n is the length of the column x
MAPCHAR(x) | MAPCHAR(x,DEFAULTMAP)
x is a NULL value | NULL value

The function MAPCHAR enables data to be sorted correctly, for example, if "ü" is to be treated as "UE" for sorting purposes. The MAPCHAR SET with the name DEFAULTMAP is used.

SELECT...,MAPCHAR(<column name>) sort,...FROM...ORDER BY sort


REPLACE(x,y,z) (SAP Library - SAP DB)

 Entering content frame

REPLACE(x,y,z)

REPLACE(x,y,z) is a string function that replaces the character string y in the character string x with the character string z.

 | Result of the REPLACE(x,y,z) function
REPLACE(x,y) | The character string y in x is deleted
x is a NULL value | NULL value
y is NULL value | x remains unchanged
z is NULL value | The character string y in x is deleted

Example table: hotel

The abbreviated notation for Street (St.) is to be written out in full (Street) for the sake of uniformity.

SELECT hno, zip, city, REPLACE (address,' t.' ,' treet' ) address

FROM hotel where address like '%tr%'

HNO | ZIP | CITY | ADDRESS
10 | 89477 | Detroit | 155 Beechwood Street
20 | 86159 | Cincinnati | 1499 Grove Street
80 | 20251 | Los Angeles | 12 Barnard Street
100 | 50668 | Dallas | 1980 34th Street
110 | 81245 | New York | 111 78th Street

See also:

TRANSLATE(x,y,z)


RFILL(x,a,n) (SAP Library - SAP DB)

 Entering content frame

RFILL(x,a,n)

RFILL(x,a,n) is a string function that inserts the character string a at the end of the character string x as often as required until the character string has reached the length n. If the character string a cannot be completely inserted without exceeding the specified total length, only the part that is needed to reach the total length is inserted.

 | Result of the RFILL(x,a,n) function
RFILL(x,a) x must identify a CHAR or VARCHAR column. | The column x is filled with the characters of a until its maximum length is reached.
x is NULL value | NULL value
a or n is the NULL value | Error message

See also:

LFILL(x,a,n)

EXPAND(x,n)


RPAD(x,a,y,n) (SAP Library - SAP DB)

 Entering content frame

RPAD(x,a,y,n)

RPAD(x,a,y,n) is a string function that inserts the character string y at the end of the character string x as often as specified by the parameter a. Leading and subsequent blanks in the character string x are truncated. The optional parameter n defines the maximum total length of the character string created.

The result of the parameter a must be a positive integer.

The optional parameter n must be greater than or equal to the total LENGTH (x)+a*LENGTH(y).

 | Result of the RPAD(x,a,y,n) function
RPAD(x,a,y) x must identify a CHAR or VARCHAR column. | The maximum length of the character string is the length of the character string x.
x or a is the NULL value | NULL value
a is the special NULL value | Error message

See also:

LPAD(x,a,y,n)


RTRIM(x,y) (SAP Library - SAP DB)

 Entering content frame

RTRIM(x,y)

RTRIM(x,y) is a string function that removes the blanks (code attribute ASCII, EBCDIC ( code tables )) or binary zeros (code attribute BYTE) from the end of the character string x and then all of the characters specified in the character string y. The result of RTRIM(x,y), therefore, ends with the last character that was not specified in y.

 | Result of the RTRIM(x,y) function
RTRIM(x) | Only blanks (code attribute ASCII, EBCDIC or binary zeros (code attribute BYTE) are removed from x.
x is NULL value | NULL value

See also:

TRIM(x,y)

LTRIM(x,y)


SOUNDEX(x) (SAP Library - SAP DB)

 Entering content frame

SOUNDEX(x)

SOUNDEX(x) is a string function that converts a character string x to a format that is generated by the SOUNDEX algorithm.

This representation can be used if the user does not know the exact spelling of the search term.

 | Result of the SOUNDEX(x) function
SOUNDEX(x) | The SOUNDEX algorithm is used. The result is a value with the data type CHAR(4).
x is NULL value | NULL value

The SOUNDS predicate is often applied to a column x.

Since inversions cannot be used here, it is advisable for performance reasons to define an additional table column x1 with the data type CHAR(4), in which the result of SOUNDEX(x) is then inserted.

The requests should then refer to x1:
Instead of x SOUNDS LIKE <string literal> ,
use x1= SOUNDEX(<string literal>)


SUBSTR(x,a,b) (SAP Library - SAP DB)

 Entering content frame

SUBSTR(x,a,b)

SUBSTR(x,a,b) is a string function that outputs part of x (character string with length n).

 | Result of the SUBSTR(x,a,b) function
SUBSTR(x,a,b) | Part of the character string x that starts at the ath character and is b characters long.
SUBSTR(x,a) | SUBSTR(x,a,n-a+1) supplies all of the characters in the character string x from the ath character to the last (nth) character.
b is an unsigned integer | SUBSTR(x,a,b) b can also have a value that is greater than (n-a+1).
b is not an unsigned integer | SUBSTR(x,a,b) b must not be greater than (n-a+1).
b>(n-a+1) | SUBSTR(x,a) As many blanks (code attribute ASCII, EBCDIC) or binary zeros (code attribute BYTE) are appended to the end of this result as are needed to give the result the length b.
x, a or b is the NULL value | NULL value

Example table: customer

The SUBSTR function is used to reduce the firstname to one letter, add a period and a blank, and then concatenate it with the name.

SELECT SUBSTR (firstname,1,1)&'. '&name name, city
FROM customer WHERE firstname IS NOT NULL

NAME | CITY
J. Porter | New York
M. Porter | Los Angeles
S. Peters | Los Angeles
P. Brown | Hollywood
M. Porter | New York
G. Howe | New York
F. Randolph | Los Angeles
J. Peters | Los Angeles
S. Brown | Los Angeles
A. Jackson | Los Angeles
T. Adams | Los Angeles
M. Griffith | New York
I. Braun | Los Angeles


TRANSLATE(x,y,z) (SAP Library - SAP DB)

 Entering content frame

TRANSLATE(x,y,z)

TRANSLATE(x,y,z) is a string function that replaces the ith character of the character string y with the ith character of the character string z in the character string x. The character strings y and z must have the same length.

 | Result of the TRANSLATE(x,y,z) function
x is a NULL value | NULL value
y is NULL value | x remains unchanged

Example table: customer

Each occurrence of the ith letter in the first character string is replaced by the ith letter in the second one.

SELECT name, TRANSLATE (name,'or','es') new_name
FROM customer WHERE firstname IS NOT NULL AND city = 'Los Angeles'

NAME | NEW_NAME
Porter | Pestes
Peters | Petess
Randolph | Sandelph
Peters | Petess
Brown | Bsewn
Jackson | Jacksen
Adams | Adams

See also:

REPLACE(x,y,z)


TRIM(x,y) (SAP Library - SAP DB)

 Entering content frame

TRIM(x,y)

TRIM(x,y) is a string function that removes all of the characters specified in the character string y from the start of the character string x. The result of TRIM(x,y), therefore, starts with the first character that was not specified in y.

TRIM(x,y) also removes the blanks (code attribute ASCII, EBCDIC (code tables)) or binary zeros (code attribute BYTE) from the end of the character string and then all of the characters specified in the character string y. The result of TRIM(x,y), therefore, ends with the last character that was not specified in y.

 | Result of the TRIM(x,y) function
TRIM(x) | Only blanks (code attribute ASCII, EBCDIC or binary zeros (code attribute BYTE) are removed from x.
x is a NULL value | NULL value

Example table: customer

SELECT name, TRIM(CHR(account)) & ' EURO' account
FROM customer WHERE account > 0.00

NAME | ACCOUNT
Porter | 100.00 EURO
DATASOFT | 4813.50 EURO
Peters | 650.00 EURO
TOOLware | 3770.50 EURO
Brown | 440.00 EURO

See also:

LTRIM(x,y)

RTRIM(x,y)


UPPER/LOWER(x) (SAP Library - SAP DB)

 Entering content frame

UPPER/LOWER(x)

UPPER(x) and LOWER(x) are string functions that convert a character string to uppercase/lowercase letters.

 | Result of the Function UPPER(x) or LOWER(x)
x is a NULL value | NULL value

Example table: hotel

Refining searches by specifying uppercase/lowercase letters

SELECT * FROM hotel WHERE UPPER(name) = 'REGENCY'

HNO | NAME | ZIP | CITY | ADDRESS
30 | Regency | 48153 | Portland | 477 17th Avenue


Concatenation (concatenation) (SAP Library - SAP DB)

 Entering content frame

Concatenation (concatenation)

A concatenation ( concatenation) x||y or x&y is a string function that supplies the following results for x (character string with the length n) and y (character string with the length m):

 | Result of the concatenation
x||y or x&y | x and y are concatenated to a character string with the length n+m. If a character string originates from a column, its length is determined without any consideration of trailing blanks (code attribute. ASCII, EBCDIC, UNICODE) or binary zeros (code attribute BYTE).
x or y is the NULL value | NULL value

Columns with the same code attribute can be concatenated.

Columns with different code attributes (ASCII, EBCDIC and UNICODE) can be concatenated together as well as with date values, time values, and timestamp values.

Example table: customer

SELECT name, zip & ' – ' & city address FROM customer
WHERE city = 'New York'

NAME | ADDRESS
Porter | 80335 – New York
Porter | 70596 – New York
Howe | 81737 – New York
Griffith | 81739 – New York


Date function (SAP Library - SAP DB)

 Entering content frame

Date function

A date function is a function that is applied to date or timestamp values or supplies a date or timestamp value as a result.

Syntax

<date_function> ::=
  ADDDATE    ( <date_or_timestamp_expression>, <expression> )
| SUBDATE    ( <date_or_timestamp_expression>, <expression> )
| DATEDIFF   ( <date_or_timestamp_expression>, <date_or_timestamp_expression> )
| DAYOFWEEK  ( <date_or_timestamp_expression> )
| WEEKOFYEAR ( <date_or_timestamp_expression> )
| DAYOFMONTH ( <date_or_timestamp_expression> )
| DAYOFYEAR  ( <date_or_timestamp_expression> )
| MAKEDATE   ( <expression>, <expression> )
| DAYNAME    ( <date_or_timestamp_expression> )
| MONTHNAME  ( <date_or_timestamp_expression> )

date_or_timestamp_expression , expression

ADDDATE(t,a)/SUBDATE(t,a) , DATEDIFF(t,s) , DAYOFWEEK(t), WEEKOFYEAR(t), DAYOFMONTH(t), DAYOFYEAR(t) , MAKEDATE(a,b) , DAYNAME(t), MONTHNAME(t)

Explanation

Although the Gregorian calendar was not introduced until 1582, it can also be applied to date functions that use dates prior to that year. This means that every year is assumed to have either 365 or 366 days.

A variety of date and time formats (ISO, USA, EUR, JIS, INTERNAL) are available for processing date and time values.


ADDDATE/SUBDATE(t,a) (SAP Library - SAP DB)

 Entering content frame

ADDDATE/SUBDATE(t,a)

ADDDATE(t,a) and SUBDATE(t,a) are date functions that calculate a date in the future or past.

t: date_or_timestamp_expression

a: numeric value that represents the number of days. Any decimal places in a are truncated if necessary.

 | Result of the ADDDATE(t,a)/SUBDATE(t,a) function
Addition of a to t/ subtraction of a from t | Date value or Time stamp value
t or a is NULL value | NULL value
a is special NULL value | Error Message

Example table: reservation

Increasing a reservation date by two days

SELECT arrival, ADDDATE(arrival,2) arrival2, rno
FROM reservation WHERE rno = 130

ARRIVAL | ARRIVAL2 | RNO
01/02/2002 | 03/02/2002 | 130


DATEDIFF(t,s) (SAP Library - SAP DB)

 Entering content frame

DATEDIFF(t,s)

DATEDIFF(t,s) is a date function that calculates the number of days between a start and end date.

t and s: date_or_timestamp_expression

 | Result of DATEDIFF(t,s) function
Positive difference between t and s | Numeric value (number of days)
t or s are timestamp values | Only the dates in the timestamp value are used to calculate DATEDIFF(t,s).
t or s is NULL value | NULL value

Example table: reservation

SELECT arrival, departure, DATEDIFF(departure,arrival) difference, rno
FROM reservation WHERE rno = 130

ARRIVAL | DEPARTURE | DIFFERENCE | RNO
01/02/2002 | 03/02/2002 | 2 | 130


DAYNAME/MONTHNAME(t) (SAP Library - SAP DB)

 Entering content frame

DAYNAME/MONTHNAME(t)

DAYNAME(t) and MONTHNAME(t) are date functions that supply the weekday or month of the specified day.

t: date_or_timestamp_expression

 | Result of the function
DAYNAME(t) or MONTHNAME(t) | Character string that supplies the name of a weekday (Sunday to Saturday) or month (January to December).
t is NULL value | NULL value


DAYOFWEEK/WEEKOFYEAR/DAYOFMONTH/DAYOFYEAR(t) (SAP Library - SAP DB)

 Entering content frame

DAYOFWEEK/WEEKOFYEAR/DAYOFMONTH/DAYOFYEAR(t)

DAYOFWEEK(t)/WEEKOFYEAR(t)/DAYOFMONTH(t)/DAYOFYEAR(t) are date functions that calculate the following:

t: date_or_timestamp_expression

 | Result of the function
DAYOFWEEK(t) | Numeric value between 1 and 7 (weekday) The first day is Monday, the second Tuesday, etc.
WEEKOFYEAR(t) | Numeric value between 1 and 53 (calendar week of the specified day)
DAYOFMONTH(t) | Numeric value between 1 and 31 (day of the month of the specified day)
DAYOFYEAR(t) | Numeric value between 1 and 366 (day of the year of the specified day)
t is NULL value | NULL value


MAKEDATE(a,b) (SAP Library - SAP DB)

 Entering content frame

MAKEDATE(a,b)

MAKEDATE(a,b) is a date function that supplies a date value from a year and day value.

The values a and b ( expression ) in MAKEDATE must supply numeric values.
The following restrictions also apply: a>=0 (a represents a year value)
b>0 (b represents a day value)
Decimal places in a and b are truncated if necessary.

 | Result of the MAKEDATE(a,b) function
a or b is the NULL value | NULL value
a or b is the special NULL value | Error message

MAKEDATE(1999,49) in the INTERNAL date format outputs '19990218'


date_or_timestamp_expression (SAP Library - SAP DB)

 Entering content frame

date_or_timestamp_expression

When used in a function, the date_or_timestamp_expression argument must supply a date value , a timestamp value , or an alphanumeric value that matches the current date or timestamp format .


Time Function (time_function) (SAP Library - SAP DB)

 Entering content frame

Time Function (time_function)

A time function ( time_function) is a function that is applied to time or timestamp values, or that supplies a time or timestamp value as a result.

Syntax

<time_function> ::=
  ADDTIME    ( <time_or_timestamp_expression>, <time_expression> )
| SUBTIME    ( <time_or_timestamp_expression>, <time_expression> )
| TIMEDIFF   ( <time_or_timestamp_expression>, <time_or_timestamp_expression> )
| MAKETIME   ( <hours>, <minutes>, <seconds> )

time_or_timestamp_expression, time_expression, hours, minutes, seconds

ADDTIME/SUBTIME(t,a), TIMEDIFF(t,s), MAKETIME(h,m,s)

A variety of date and time formats (ISO, USA, EUR, JIS, INTERNAL) are available for processing date and time values.

In the ISO and USA formats, the hours are displayed modulo 24.
In the EUR and JIS formats, a number of hours greater than 99 causes an error.
In the INTERNAL format, you can use up to 9999 hours.


ADDTIME/SUBTIME(t,a) (SAP Library - SAP DB)

 Entering content frame

ADDTIME/SUBTIME(t,a)

ADDTIME(t,a) and SUBTIME(t,a) are time functions that calculate a time/timestamp value in the past or future.

t: time_or_timestamp_expression
a: time_expression

 | Result of the ADDTIME(t,a)/SUBTIME(t,a) function
Addition of a to t/ subtraction of a from t | Time value or time stamp value
SUBTIME(t,a) and t and a are time values | a must be less than t, otherwise an error is output
t or a is NULL value | NULL value


MAKETIME(h,m,s) (SAP Library - SAP DB)

 Entering content frame

MAKETIME(h,m,s)

MAKETIME(h,m,s) is a time function that calculates a time value from the total number of hours, minutes, and seconds .

 | Result of the MAKETIME(h,m,s) function
h,m,s is NULL value | NULL value
h,m,s is special NULL value | Error message


TIMEDIFF(t,s) (SAP Library - SAP DB)

 Entering content frame

TIMEDIFF(t,s)

TIMEDIFF(t,s) is a time function that calculates the time value between a start and end time.

t and s: time_or_timestamp_expression
Both arguments must have the same data type, i.e. they must be either a time value or a timestamp value .

 | Result of the TIMEDIFF(t,s) function
Positive difference between t and s | Time value
t or s are timestamp values for alphanumeric values that match the current timestamp format. | The dates contained in the timestamp value are used to calculate TIMEDIFF(t,s).
Difference of more than 9999 hours | Number of hours modulo 10000
t or s is NULL value | NULL value


hours/minutes/seconds (SAP Library - SAP DB)

 Entering content frame

hours/minutes/seconds

When used in a function, each of these arguments ( hours , minutes or seconds ) must be an integer greater than or equal to 0.

Decimal places are truncated.


Time expression (SAP Library - SAP DB)

 Entering content frame

Time expression

When used in a function, the argument time_expression must supply a time value or an alphanumeric value that is in the current time format .


Time or timestamp expression (SAP Library - SAP DB)

 Entering content frame

Time or timestamp expression

When used in a function, the argument time_or_timestamp_expression must supply a time value , timestamp value , or an alphanumeric value that matches the current time or timestamp format .


Extraction function (SAP Library - SAP DB)

 Entering content frame

Extraction function

An extraction function is a function that extracts parts of a date value , time value , or timestamp value or that calculates a date, time, or timestamp value.

Syntax

<extraction_function> ::=
  YEAR        ( <date_or_timestamp_expression> )
| MONTH       ( <date_or_timestamp_expression> )
| DAY         ( <date_or_timestamp_expression> )
| HOUR        ( <time_or_timestamp_expression> )
| MINUTE      ( <time_or_timestamp_expression> )
| SECOND      ( <time_or_timestamp_expression> )
| MICROSECOND ( <expression> )
| TIMESTAMP   ( <expression>[, <expression> ] )
| DATE        ( <expression> )
| TIME        ( <expression> )

date_or_timestamp_expression , time_or_timestamp_expression , expression

YEAR(t), MONTH(t), DAY(t) , HOUR(t), MINUTE(t), SECOND(t) , MICROSECOND(a) , TIMESTAMP(a,b) , DATE(a) , TIME(a)

A variety of date and time formats (ISO, USA, EUR, JIS, INTERNAL) are available for processing date and time values.


DATE(a) (SAP Library - SAP DB)

 Entering content frame

DATE(a)

DATE(a) is a function ( extraction ) that calculates a date value .

 | Result of DATE(a) function
a is a date value or an alphanumeric value that matches the current date format | This date value
a is an alphanumeric value that does not match the current date format | Error message
a is a timestamp value or an alphanumeric value that matches the current timestamp format | The date value that is part of the timestamp
a is a fixed point or floating point number | Date value that is equal to the xth day after December 31, 0000 (x= TRUNC(a) )
a is NULL value | NULL value
a is special NULL value | Error message


HOUR/MINUTE/SECOND(t) (SAP Library - SAP DB)

 Entering content frame

HOUR/MINUTE/SECOND(t)

HOUR(t), MINUTE(t), and SECOND(t) are functions ( extraction ) that extract the hours, minutes, or seconds from the specified time or timestamp value.

t: time_or_timestamp_expression

 | Result of the function
HOUR(t), MINUTE(t), or SECOND(t) | Numeric value (hours, minutes, and seconds)
t is NULL value | NULL value


MICROSECOND(a) (SAP Library - SAP DB)

 Entering content frame

MICROSECOND(a)

MICROSECOND(a) is a function ( extraction ) that extracts the microseconds from a.

The value a must be a timestamp value or supply an alphanumeric value that matches the current timestamp format.

 | Result of MICROSECOND(a) function
MICROSECOND(a) | Numeric value (microseconds)
a is NULL value | NULL value


TIME(a) (SAP Library - SAP DB)

 Entering content frame

TIME(a)

TIME(a) is a function ( extraction ) that calculates a time value .

 | Result of TIME(a) function
a is a time value or an alphanumeric value that matches the current time format | This time value
a is an alphanumeric value that does not match the current time format | Error message
a is a timestamp value or an alphanumeric value that matches the current timestamp format | The time value that is part of the timestamp
a is NULL value | NULL value


TIMESTAMP(a,b) (SAP Library - SAP DB)

 Entering content frame

TIMESTAMP(a,b)

TIMESTAMP(a,b) is a function ( extraction ) that calculates a timestamp value comprising a date value , time value , and 0 microseconds.

 | Result of TIMESTAMP(a,b) function
TIMESTAMP(a) | a must be a timestamp value or an alphanumeric value that matches the current timestamp format The result is this timestamp value.
TIMESTAMP(a,b) | a must be a date value and b a time value (or alphanumeric value that matches the current format for date and time values). The result is a timestamp value calculated from a date value, time value, and 0 microseconds.
a or b is the NULL value | NULL value


YEAR/MONTH/DAY(t) (SAP Library - SAP DB)

 Entering content frame

YEAR/MONTH/DAY(t)

YEAR(t), MONTH(t), and DAY(t) are functions ( extraction ) that extract the year, month, and day from the specified date or timestamp value.

t: date_or_timestamp_expression

 | Result of the function
YEAR(t), MONTH(t), or DAY(t) | Numeric value (year, month, day)
t is NULL value | NULL value


Special Function (special_function) (SAP Library - SAP DB)

 Entering content frame

Special Function (special_function)

There are certain special functions (special_function) that are not restricted to specific data types.

Syntax

<special_function> ::=
  VALUE    (<expression>,<expression>,...)
| GREATEST (<expression>,<expression>,...)
| LEAST    (<expression>,<expression>,...)
| DECODE   (<check_expression>,<search_and_result_spec>,...[,<default_expression>])
| <case_function>

<check_expression> ::= <expression>
<search_and_result_spec> ::= <search_expression>,<result_expression>
<default_expression> ::= <expression>
<result_expression> ::= <expression>
<case_function> ::= <simple_case_function>|<searched_case_function>

expression

VALUE(x,y,...) , GREATEST(x,y,...), LEAST(x,y,...) , DECODE(x,y,...,z) , simple_case_function , searched_case_function


DECODE(x,y(i),...,z) (SAP Library - SAP DB)

 Entering content frame

DECODE(x,y(i),...,z)

DECODE(x,y(i),...,z) is a special function that decodes expressions in accordance with their values.

x | check_expression | Expression ( expression) for which a comparison is to be carried out with the values in y(i)
y(i) | search_and_result_spec | <search_and_result_spec> ::= <search_expression>, <result_expression> (y(i)=u(i),v(i), i=1,...) Combination of the comparison value u(i) and the value v(i) that is to replace this comparison value
z | default_expression | Optional default value
u(i) | search_expression | Comparison value that is to be replaced by v(i) if it matches x
v(i) | result_expression | Value that is to be replace u(i)

The data types of x and u(i) must be comparable. The data types of v(i) and z must be comparable. The data types of u(i) and v(i) do not have to be comparable.

DECODE compares the values of x with the values u(i) consecutively. If a match is found, the result of DECODE is the value v(i) in the combination y(i)=u(i),v(i).

A match is present if x and u(i) are NULL values. The comparison of the special NULL value with any other value never results in a match.

If a match is not found, DECODE supplies the result of z. If z is not specified, the NULL value is the result of DECODE.

Example table: room

The room type identifiers are to be replaced in the output by an identifier declared in the DECODE function.

SELECT hno, price, DECODE (roomtype,
'SINGLE', 1, 'DOUBLE', 2, 'SUITE', 3) room_code
FROM room


GREATEST/LEAST(x,y,...) (SAP Library - SAP DB)

 Entering content frame

GREATEST/LEAST(x,y,...)

GREATEST(x,y,...) or LEAST(x,y) is a special function that calculates the maximum or minimum value of all arguments.

The functions can be applied to any data type. The data types of the individual arguments must be comparable.

 | Result of the function
At least one argument is the NULL value | NULL value
At least one argument is the special NULL value | Special NULL value


VALUE(x,y,...) (SAP Library - SAP DB)

 Entering content frame

VALUE(x,y,...)

VALUE(x,y,...) is a special function that can be used to replace NULL values with a non-NULL value.

The arguments of the VALUE function must be comparable. The arguments are evaluated one after the other in the specified order.

 | Result of the VALUE(x,y) function
One of the arguments is a non-NULL value | The first non-NULL value that occurs
Each argument is a special NULL value | Special NULL value
Each argument is a NULL value | NULL value

Example table: customer

The title does not occur in the output list. The word company is to be output for companies in the firstname column instead of a NULL value.

SELECT VALUE(firstname, 'company') firstname, name FROM customer

FIRSTNAME | NAME
Jenny | Porter
Company | DATASOFT
Martin | Porter
Sally | Peters
Peter | Brown
Michael | Porter
George | Howe
Frank | Randolph
Joseph | Peters
Susan | Brown
Anthony | Jackson
Thomas | Adams
Mark | Griffith
Company | TOOLware
Rose | Brown


General CASE Function (searched_case_function) (SAP Library - SAP DB)

 Entering content frame

General CASE Function (searched_case_function)

The general CASE function (searched_case_function) is a special function that analyzes a quantity of search conditions to determine a result_expression.

Syntax

<searched_case_function> ::=
CASE
  WHEN <search_condition> THEN <result_expression>
    [...]
  [ELSE <default_expression>])
END

<result_expression> ::= <expression>
<default_expression> ::= <expression>

search_condition, expression

Explanation

u(i) | search_condition | Search conditions u(i). All search conditions without ROWNO Predicate are permissible.
v(i) | result_expression | Value v(i) that is to be accepted, if the search condition u(i) is true
z | default_expression | Value z, optional default value

CASE checks the search conditions u(i) in succession. As soon as a search condition that is true is found, the result of the general CASE function is the value v(i) that belongs to u(i).

The data types of v(i) and z must be comparable.

If no search condition that is true is found, CASE returns the result of z. If z is not specified, the NULL value is the result of CASE.

CASE
  WHEN price IS NULL THEN 'Not yet priced'
  WHEN price < 10 THEN 'Very Reasonable Title'
  WHEN price >= 10 and price < 20 THEN 'Coffee Table Title'
  ELSE 'Expensive book!'
END

See also:

Simple CASE function (simple_case_function)


Simple CASE Function (simple_case_function) (SAP Library - SAP DB)

 Entering content frame

Simple CASE Function (simple_case_function)

The simple CASE function (simple_case_function) is a special function that analyzes a quantity of simple expressions to determine a result expression (result_expression).

Syntax

<simple_case_function> ::=
CASE <check_expression>
        WHEN <search_expression> THEN <result_expression>
            [...]
        [ELSE <default_expression>])
END

<check_expression> | <search_expression> | <result_expression> | <default_expression> ::= <expression>

expression

Explanation

x | check_expression | Expression x for which a comparison is to be made with the comparison values u(i)
u(i) | search_expression | Comparison value u(i). The function delivers the result v(i) when u(i) first matches x.
v(i) | result_expression | Value v(i) that is assumed if u(i) matches x
z | default_expression | Value z, optional default value

CASE compares the values of x with the values u(i) consecutively. If values match, the result of the simple CASE function is the value v(i) associated with u(i).

The data types of x and u(i) must be comparable. The data types of v(i) and z must be comparable. The data types of u(i) and v(i) do not have to be comparable.

A match is exists if x and u(i) are NULL values. The comparison of the special NULL value with any other value never results in a match.

If a match is not found, CASE supplies the result of z. If z is not specified, the NULL value is the result of CASE.

See also:

General CASE Function (searched_case_function)


Conversion Function (conversion_function) (SAP Library - SAP DB)

 Entering content frame

Conversion Function (conversion_function)

A conversion function is a function that converts a value from one data type to another.

Syntax

<conversion_function> ::=
  NUM   ( <expression> )
| CHR   ( <expression>[, <unsigned_integer> ] )
| HEX   ( <expression> )
| HEXTORAW ( <expression> )
| CHAR  ( <expression>[, <datetimeformat> ] )

expression , unsigned_integer , datetimeformat

NUM(a) , CHR(a,n) , HEX(a) , HEXTORAW(a) , CHAR(a,t)


CHAR(a,t) (SAP Library - SAP DB)

 Entering content frame

CHAR(a,t)

CHAR(a,t) is a function ( conversion function ) that converts the date values , time values , or timestamp values to a character string with the format for date values, time values, or timestamp values specified in t.

 | Result of the CHAR(a,t) function
CHAR(a) | The current date and time format is used for the value a.
a is the NULL value | NULL value


CHR(a,n) (SAP Library - SAP DB)

 Entering content frame

CHR(a,n)

CHR(a,n) is a function ( conversion function ) that converts numbers into character strings.

The CHR function can only be applied to numeric values, character strings , and boolean values .

 | Result of the CHR(a,n) function
a is a numeric value | Character string that matches the CHAR representation of the numeric value a. The code attribute of the character string corresponds to the code type of the computer.
a is character string | Identical character string
a is a boolean value | T, if a=TRUE F, if a=FALSE
a is not a numeric value, a character string, or a boolean value | Error message
CHR(a,n), n>=1 | Output with the length attribute n
CHR(a) | The length attribute n is calculated as a function of the data type and the length of a.
CHR(a) and a if of the data type FLOAT(p) | If p=1, then n=6 If p>1, then n=p+6
CHR(a) and a is of the data type FIXED(p,s) | If p=s, then n=p+s If s=0, then n=p+1
a is the NULL value | NULL value
a is the special NULL value | Error message


HEX(a) (SAP Library - SAP DB)

 Entering content frame

HEX(a)

HEX(a) is a function ( conversion function ) that converts the argument a to hexadecimal notation. The function can be applied to any data type.

 | Result of the HEX(a) function
a is the NULL value | NULL value
a is the special NULL value | Error message


HEXTORAW(a) (SAP Library - SAP DB)

 Entering content frame

Function documentation HEXTORAW(a)

HEXTORAW(a) is a function ( conversion function ). Arguments of the function must be hexadecimal characters ( hex_digit ). The argument a is converted to a character string with the code attribute BYTE that contains the corresponding characters. During this conversion, two hexadecimal characters are converted to one character.

 | Result of the HEXTORAW(a) Function
a is the NULL value | NULL value
a is the special NULL value | Error message


NUM(a) (SAP Library - SAP DB)

 Entering content frame

NUM(a)

NUM(a) is a function ( conversion function ) that converts the argument a to a numeric value.

NUM can be applied to character string s with the code attributes ASCII or EBCDIC (see code tables ), date value s, time value s, time stamp value s, and to numeric and boolean values ( BOOLEAN ).

 | Result of the NUM(a) function
a is a character string and can be interpreted as a numeric value | Corresponding numeric value
a is a numeric value | Identical numeric value (unchanged)
a is a boolean value | 1, if a=TRUE 0, if a=FALSE
a is a character string that cannot be interpreted as a numeric value; a is a character string that does not have the code attribute ASCII or EBCDIC; a is neither a numeric nor a Boolean value. | Error message
a is a character string that can be interpreted as a numeric value outside the range –9.9999999999999999999999999999999999999E+62, 9.9999999999999999999999999999999999999E+62 | Special NULL value
a is the NULL value | NULL value
a is the special NULL value | Special NULL value


Set Function (set_function_spec) (SAP Library - SAP DB)

 Entering content frame

Set Function (set_function_spec)

There is a series of functions that can be applied to a set of values (rows) as an argument and supply a result. These functions are referred to as set functions ( set function spec).

Syntax

<set_function_spec> ::= COUNT (*) | <distinct_function> | <all_function>

COUNT (*), distinct_function, all_function

Explanation

Set functions operate across groups of values but only return one value. The result comprises one row. If a set function is used in a statement, a similar function must also be applied to each of the other columns in the request. This, however, does not apply to columns that were grouped using GROUP BY. In this case, the value of the set function can be defined for each group.

The argument of a DISTINCT function or an ALL function is a result table or a group (the result table can be grouped using a GROUP condition).

With the exception of the COUNT(*) function, no NULL values are included in the calculation.

No locks are set for certain set functions, irrespective of the isolation level specified when the user connected to the database.

Example table: customer

SELECT SUM(account) sum_account, MIN(account) min_account,
FIXED (AVG(account),7,2) avg_account,
MAX(account) max_account, COUNT(*) number
FROM customer WHERE city = 'Los Angeles'

SUM_ACCOUNT | MIN_ACCOUNT | AVG_ACCOUNT | MAX_ACCOUNT | NUMBER
-164.17 | -4167.79 | -20.52 | 3770.50 | 8


DISTINCT Function (distinct_function) (SAP Library - SAP DB)

 Entering content frame

DISTINCT Function (distinct_function)

The DISTINCT function ( distinct_function) is a set function that removes duplicated values and all NULLvalues.

Syntax

<distinct function>::= <set function name> ( DISTINCT <expression> )

set_function_name, expression

Explanation

The argument of a DISTINCT function is a set of values that is calculated as follows:

...

1. A result table or group (the result table can be grouped with a GROUP condition) is formed.

2. The expression is applied to each row in this result table or group.
The expression must not contain a set function.

3. All of the NULL values and duplicated values are removed (DISTINCT). Special NULL values are not removed and two special NULL values are considered identical.

The DISTINCT function is executed taking into account the relevant set function name for this set of values.

 | Result of the DISTINCT function
Set of values is empty and the DISTINCT function is applied to the entire result table | The set functions AVG, MAX, MIN, STDDEV, SUM, VARIANCE supply the NULL value as their result. The set function COUNT supplies the value 0.
There is no group to which the DISTINCT function can be applied. | The result is an empty table.
The set of values contains at least one special NULL value. | Special NULL value

Example table: customer

In how many cities do the customers live?

SELECT COUNT(DISTINCT city) number_cities FROM customer

number_cities

4


ALL function (SAP Library - SAP DB)

 Entering content frame

ALL function

The ALL function is a set function that removes the NULL value s.

Syntax

<all_function>::= <set_function_name> ( [ALL] <expression> )

set_function_name , expression

Explanation

The argument of an ALL function is a set of values that is calculated as follows:

  1. A result table or group (the result table can be grouped with a GROUP condition) is formed.
  2. The expression is applied to each row in this result table or group.
    The expression must not contain a set function.
  3. All NULL values are removed. Special NULL value s are not removed and two special NULL values are considered identical.

The ALL function is executed taking into account the relevant set function name for the set of values.

The result of an ALL function is independent of whether the keyword ALL is specified or not.

 | Result of the ALL function
The set of values is empty and the ALL function is applied to the entire result table | The set functions AVG, MAX, MIN, STDDEV, SUM, VARIANCE supply the NULL value as their result. The set function COUNT supplies the value 0.
There is no group to which the ALL function can be applied. | The result is an empty table.
The set of values contains at least one special NULL value. | Special NULL value


Set function name (SAP Library - SAP DB)

 Entering content frame

Set function name

Set function name is the name of a function that can be specified in a DISTINCT function and an ALL function .

Syntax

<set_function_name> ::= COUNT | MAX | MIN | SUM | AVG | STDDEV | VARIANCE

COUNT , MAX, MIN , SUM , AVG , STDDEV , VARIANCE


AVG (SAP Library - SAP DB)

 Entering content frame

AVG

AVG is a set function.

The result of AVG is the arithmetical mean of the values of the argument.

AVG can only be applied to numeric values. The result has the data type FLOAT(38).

Example table: customer

How many corporate customers are taken into account? What is the average value of their account balance?

SELECT COUNT(*) number, FIXED (AVG(account),7,2) avg_account
FROM customer WHERE firstname IS NULL

NUMBER | AVG_ACCOUNT
2 | 4292.00


COUNT (SAP Library - SAP DB)

 Entering content frame

COUNT

COUNT is a set function.

· COUNT(*) supplies the total number of values (rows in a result table or group).

· COUNT(DISTINCT <expression>)supplies the total number of different values (number of values in the argument of the DISTINCT function).

· COUNT(ALL <expression>)supplies the number of values that differ from the NULL value (number of values in the argument of the ALL function)

The result has the data type FIXED(10).

Example table: customer

How many customers are there?

SELECT COUNT (*) number FROM customer

number

15


MAX/MIN (SAP Library - SAP DB)

 Entering content frame

MAX/MIN

MAX/MIN is a set function .

The result of MAX is the largest value of the argument.

The result of MIN is the smallest value of the argument.


STDDEV (SAP Library - SAP DB)

 Entering content frame

STDDEV

STDDEV is a set function .

The result of STDDEV is the standard deviation of the values of the argument.

STDDEV can only be applied to numeric values. The result has the data type FLOAT (38).


SUM (SAP Library - SAP DB)

 Entering content frame

SUM

SUM is a set function .

The result of SUM is the sum of the values of the argument.

SUM can only be applied to numeric values. The result has the data type FLOAT (38).


VARIANCE (SAP Library - SAP DB)

 Entering content frame

VARIANCE

VARIANCE is a set function .

The result of VARIANCE is the variance of the values of the argument.

VARIANCE can only be applied to numeric values. The result has the data type FLOAT (38).


SQL Statement: Overview (SAP Library - SAP DB)

 Entering content frame

SQL Statement: Overview

All SQL statements ( sql_statement) can be embedded in programming languages. For more information, see the precompiler documentation. All SQL statements, with the exception of NEXT STAMP, can be specified interactively.

Comments can be specified for every SQL statement. There are example statements, using the example tables, for many SQL statements.

SQL statements for data definition

CREATE TABLE statement | DROP TABLE statement | ALTER TABLE statement RENAME TABLE statement RENAME COLUMN statement EXISTS TABLE statement
CREATE DOMAIN statement | DROP DOMAIN statement |
CREATE SEQUENCE statement | DROP SEQUENCE statement |
CREATE SYNONYM statement | DROP SYNONYM statement | RENAME SYNONYM statement
CREATE VIEW statement | DROP VIEW statement | RENAME VIEW statement
CREATE INDEX statement | DROP INDEX statement | ALTER INDEX statement RENAME INDEX statement
COMMENT ON statement |  |
CREATE TRIGGER statement | DROP TRIGGER statement |
CREATE DBPROC statement | DROP DBPROC statement |

SQL statements for authorization

CREATE USER statement | DROP USER statement | ALTER USER statement RENAME USER statement GRANT USER statement
CREATE USERGROUP statement | DROP USERGROUP statement | ALTER USERGROUP statement RENAME USERGROUP statement GRANT USERGROUP statement
CREATE ROLE statement | DROP ROLE statement |
ALTER PASSWORD statement | GRANT statement | REVOKE statement

SQL statements for data manipulation

INSERT statement | UPDATE statement | DELETE statement
NEXT STAMP statement | CALL statement |

SQL statements for data query

QUERY statement | SINGLE SELECT statement | EXPLAIN statement
OPEN CURSOR statement | FETCH statement | CLOSE statement

SQL statements for transaction management

CONNECT statement | SET statement |
COMMIT statement | ROLLBACK statement | SUBTRANS statement
LOCK statement | UNLOCK statement | RELEASE statement

SQL statements for statistics management

UPDATE STATISTICS statement

MONITOR statement


Comment (sql_comment) (SAP Library - SAP DB)

 Entering content frame

Comment (sql_comment)

A comment (sql_comment) can be included for every SQL statement .

Syntax

<sql_comment> ::= /*<comment text>*/ | --<comment text>

Explanation

You can enter any commend text.

If you use the syntax rule --<comment text> in a line, all characters entered in this line after -- are regarded as comments.

CREATE TABLE person (cno FIXED(4), first name CHAR(7), last name CHAR(7), account FIXED(7,2)) /*create table person*/


Example Tables (SAP Library - SAP DB)

 Entering content frame

Example Tables

customer

hotel

room

reservation


customer (SAP Library - SAP DB)

 Entering content frame

customer

Create the table customer and fill it with the values listed below.

Table Structure

CREATE TABLE customer
(cno        FIXED(4) PRIMARY KEY CONSTRAINT cno BETWEEN 1 AND 9999,
 title      CHAR(5) CONSTRAINT title IN ('Mr','Mrs','Comp'),
 name       CHAR(10) NOT NULL,
 firstname  CHAR(7),
 zip        CHAR(5) CONSTRAINT zip like '(0-9)(0-9)(0-9)(0-9)(0-9)',
 city       CHAR(12) NOT NULL,
 account    FIXED(7,2) CONSTRAINT account BETWEEN –10000 AND 10000)

Content

CNO | TITLE | NAME | FIRSTNAME | ZIP | CITY | ACCOUNT
3000 | Mrs | Porter | Jenny | 80335 | New York | 100.00
3100 | Comp | DATASOFT | ? | 50933 | Dallas | 4813.50
3200 | Mr | Porter | Martin | 10969 | Los Angeles | 0.00
3300 | Mrs | Peters | Sally | 14165 | Los Angeles | 0.00
3400 | Mr | Brown | Peter | 40233 | Hollywood | 0.00
3500 | Mr | Porter | Michael | 70596 | New York | 0.00
3600 | Mr | Howe | George | 81737 | New York | -315.40
3700 | Mr | Randolph | Frank | 22525 | Los Angeles | 0.00
3800 | Mr | Peters | Joseph | 10787 | Los Angeles | 650.00
3900 | Mrs | Brown | Susan | 13599 | Los Angeles | -4167.79
4000 | Mr | Jackson | Anthony | 10785 | Los Angeles | 0.00
4100 | Mr | Adams | Thomas | 13355 | Los Angeles | -416.88
4200 | Mr | Griffith | Mark | 81739 | New York | 0.00
4300 | Comp | TOOLware | ? | 13629 | Los Angeles | 3770.50
4400 | Mrs | Brown | Rose | 40233 | Hollywood | 440.00

Other example tables


hotel (SAP Library - SAP DB)

 Entering content frame

hotel

Create the table hotel and fill it with the values listed below.

Table Structure

CREATE TABLE hotel
(hno     FIXED(4) PRIMARY KEY CONSTRAINT hno BETWEEN 1 AND 9999,
 name    CHAR(20) NOT NULL,
 zip     CHAR(5) CONSTRAINT zip like '(0-9)(0-9)(0-9)(0-9)(0-9)',
 city    CHAR(12) NOT NULL,
 address CHAR(25) NOT NULL)

Content

HNO | NAME | ZIP | CITY | ADDRESS
10 | Congress | 89477 | Detroit | 155 Beechwood St.
20 | Los Angeles | 86159 | Cincinatti | 1499 Grove Street
30 | Regency | 48153 | Portland | 477 17th Avenue
40 | Eight Avenue | 21109 | Los Angeles | 112 8th Avenue
50 | Lake Michigan | 20097 | Los Angeles | 354 OAK Terrace 43
60 | Airport | 60313 | New Orleans | 650 C Parkway
70 | Empire State | 80805 | New York | 65 Yellostone Dr.
80 | Midtown | 20251 | Los Angeles | 12 Barnard Street
90 | Long Beach | 45193 | Long Beach | 200 Yellostone Dr.
100 | Dallas | 50668 | Dallas | 1980 34th St.
110 | Atlantic | 81245 | New York | 111 78th Street
120 | Sunshine | 12249 | Los Angeles | 35 Broadway 77
130 | Star | 40223 | Hollywood | 13 Beechwood Place 2
140 | River Boat | 70469 | New York | 788 MAIN STREET 14
150 | Indian Horse | 69117 | Santa Clara | 16 MAIN STREET

Other example tables


room (SAP Library - SAP DB)

 Entering content frame

room

Create the table room and fill it with the values listed below.

Table Structure

CREATE TABLE room
(hno      FIXED(4),
 roomtype  CHAR(6) CONSTRAINT roomtype IN ('SINGLE', 'DOUBLE', 'SUITE'),
 max_free FIXED(3) CONSTRAINT max_free>=0,
 price    FIXED(6,2) CONSTRAINT price BETWEEN 0.00 AND 1000.00,

 PRIMARY KEY(hno,roomtype))

The room table is linked to the hotel table via the hotel number.

Content

HNO | ROOMTYPE | MAX_FREE | PRICE
10 | DOUBLE | 45 | 200.00
10 | SINGLE | 20 | 135.00
20 | DOUBLE | 13 | 100.00
20 | SINGLE | 10 | 70.00
30 | DOUBLE | 15 | 80.00
30 | SINGLE | 12 | 45.00
40 | DOUBLE | 35 | 140.00
40 | SINGLE | 20 | 85.00
50 | DOUBLE | 230 | 180.00
50 | SINGLE | 50 | 105.00
50 | SUITE | 12 | 500.00
60 | DOUBLE | 39 | 200.00
60 | SINGLE | 10 | 120.00
60 | SUITE | 20 | 500.00
70 | DOUBLE | 11 | 180.00
70 | SINGLE | 4 | 115.00
80 | DOUBLE | 19 | 150.00
80 | SINGLE | 15 | 90.00
80 | SUITE | 5 | 400.00
90 | DOUBLE | 145 | 150.00
90 | SINGLE | 45 | 90.00
90 | SUITE | 60 | 300.00
100 | DOUBLE | 24 | 100.00
100 | SINGLE | 11 | 60.00
110 | DOUBLE | 10 | 130.00
110 | SINGLE | 2 | 70.00
120 | DOUBLE | 78 | 140.00
120 | SINGLE | 34 | 80.00
120 | SUITE | 55 | 350.00
130 | DOUBLE | 300 | 270.00
130 | SINGLE | 89 | 160.00
130 | SUITE | 100 | 700.00
140 | DOUBLE | 9 | 200.00
140 | SINGLE | 10 | 125.00
140 | SUITE | 78 | 600.00
150 | DOUBLE | 115 | 190.00
150 | SINGLE | 44 | 100.00
150 | SUITE | 6 | 450.00

Other example tables


reservation (SAP Library - SAP DB)

 Entering content frame

reservation

Create the table reservation and fill it with the values listed below.

Table Structure

CREATE TABLE reservation
(rno       FIXED(4) PRIMARY KEY CONSTRAINT rno BETWEEN 1 AND 9999,
 cno       FIXED(4) CONSTRAINT cno BETWEEN 1 AND 9999,
 hno       FIXED(4) CONSTRAINT hno BETWEEN 1 AND 9999,
 roomtype  CHAR(6) CONSTRAINT roomtype IN ('SINGLE','DOUBLE','SUITE'),
 arrival   DATE NOT NULL,
 departure DATE CONSTRAINT departure > arrival)

A logical link between the customer, hotel, and room tables is established through the reservation table.

Content

RNO | CNO | HNO | ROOMTYPE | ARRIVAL | DEPARTURE
100 | 3000 | 80 | SINGLE | 13/11/2001 | 15/11/2001
110 | 3000 | 100 | DOUBLE | 24/12/2001 | 06/01/2002
120 | 3200 | 50 | SUITE | 14/11/2001 | 18/11/2001
130 | 3900 | 110 | SINGLE | 01/02/2002 | 03/02/2002
140 | 4300 | 80 | DOUBLE | 12/04/2001 | 30/04/2001
150 | 3600 | 70 | DOUBLE | 14/03/2002 | 24/03/2002
160 | 4100 | 70 | SINGLE | 12/04/2001 | 15/04/2001
170 | 4400 | 150 | SUITE | 01/09/2001 | 03/09/2001
180 | 3100 | 120 | DOUBLE | 23/12/2001 | 08/01/2002
190 | 4300 | 140 | DOUBLE | 14/11/2001 | 17/11/2001

Other example tables


Data definition (SAP Library - SAP DB)

 Entering content frame

Data definition

The following sections contain an introduction to the data definition language (DDL) used by the database system.

SQL statements for data definition

CREATE TABLE statement | DROP TABLE statement | ALTER TABLE statement RENAME TABLE statement RENAME COLUMN statement EXISTS TABLE statement
CREATE DOMAIN statement | DROP DOMAIN statement |
CREATE SEQUENCE statement | DROP SEQUENCE statement |
CREATE SYNONYM statement | DROP SYNONYM statement | RENAME SYNONYM statement
CREATE VIEW statement | DROP VIEW statement | RENAME VIEW statement
CREATE INDEX statement | DROP INDEX statement | ALTER INDEX statement RENAME INDEX statement
COMMENT ON statement |  |
CREATE TRIGGER statement | DROP TRIGGER statement |
CREATE DBPROC statement | DROP DBPROC statement |


CREATE TABLE Statement (create_table_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE TABLE Statement (create_table_statement)

A CREATE TABLE statement ( create_table_statement) defines a base table (see Table).

Syntax

<create table statement> ::=
  CREATE TABLE <table name> (<column definition>[,<table description element>,...])
  [IGNORE ROLLBACK] [<sample definition>]
| CREATE TABLE <table name> [(<table description element>,...)]
  [IGNORE ROLLBACK] [<sample_definition>] AS <query_expression> [<duplicates_clause> ]
| CREATE TABLE <table_name> LIKE <table_name> [IGNORE ROLLBACK]

<table_description_element> ::= <column_definition> | <constraint_definition > | <referential_constraint_definition> | <key_definition> | <unique_definition>

table_name , sample_definition , query_expression , duplicates_clause , column_definition , constraint_definition , referential_constraint_definition , key_definition , unique_definition

SQL statement for creating a table called person:

CREATE TABLE person (cno FIXED(4), firstname CHAR(7), name CHAR(7), account FIXED(7,2))

This CREATE TABLE statement comprises the keywords CREATE TABLE followed by the table name and (in parentheses) a list of column names, separated by commas. You can also define other criteria, such as a primary key, or referential integrity conditions.

Other examples: customer, hotel, reservation, room

Explanation

Executing a CREATE TABLE statement causes data that describes the table (or base table) to be stored in the database catalog. This data is called metadata.

A CREATE TABLE statement cannot contain more than one key definition.

The table name must not be identical with the name of an existing table of the current user.

The current user becomes the owner of the new table. In other words, he or she obtains the INSERT, UPDATE, DELETE, and SELECT privileges for this table. If the table is not a temporary table, the owner is also granted the INDEX, REFERENCES, and ALTER privileges.

See also:

Restrictions

Owner of a table

· The table owner must be specified in front of the table name: temporary tables are a special type of table. They only exist during a user database session and are deleted with their entire contents afterwards. Temporary tables are identified by the owner TEMP in front of the table name.
If a table name has an owner other than TEMP, the owner must be identical to the name of the current user and the user must have the status DBA or RESOURCE.

· The owner of the table is not specified: the result is the same as if the current user were the owner.

CREATE TABLE … AS <query_expression> …

· If a QUERY expression is not specified, the CREATE TABLE statement must contain at least one column definition.

· If a query expression is specified, a base table is defined with the same structure as the result table defined by the QUERY expression.
If column definitions are specified, the column definition may only consist of a column name and the number of column definitions must be equal to the number of columns in the result table generated by the QUERY expression.
The data_type of the ith column in the base table is identical to that of the ith column in the result table generated by the QUERY expression.
The result table may also contain LONG columns.
If no column definitions are specified, the column names of the result table are used.
The rows of the result table are implicitly inserted in the generated base table. The DUPLICATES clause can be used to determine how key collisions are handled.
The QUERY expression is subject to certain restrictions that also apply to the INSERT statement.

LIKE <table_name>

If LIKE <table_name> is specified, an empty base table is created which, from the point of view of the current user, has the same structure as the source table, that is, it has all the columns with the same column names and definitions as the source table. This view does not necessarily have to be identical to the actual structure of the source table, since the user may not know all the columns because of privilege limitations.

The specified table must be either a base table, a view table, or a synonym. The user must have at least one privilege for this table.

The current user is the owner of the base table.

If all the key columns of the table specified after LIKE are contained in the base table, they form the key columns in this table. Otherwise, the database system implicitly inserts a key column SYSKEY CHAR(8) BYTE which then represents the key for the base table.

DEFAULT specifications or CONSTRAINT definitions for columns that are copied to the base table also apply to the new base table.

IGNORE ROLLBACK

IGNORE ROLLBACK is optional and can only be specified for temporary tables. Temporary tables with this characteristic are not affected by the transaction mechanism; i.e., changes affecting these tables are not reversed by rolling back a transaction.

SQL statements for changing table properties

Adding, deleting columns, changing data types, changing the CONSTRAINT definition

ALTER TABLE statement

Renaming columns

RENAME COLUMN Statement

Renaming tables

RENAME TABLE statement


SAMPLE definition (SAP Library - SAP DB)

 Entering content frame

SAMPLE definition

A SAMPLE definition defines the number of rows in a table that are to be used when statistics are updated.

Syntax

<sample_definition> ::= SAMPLE <unsigned_integer> ROWS
| SAMPLE <unsigned_integer> PERCENT

unsigned_integer

Explanation

The database system manages statistics for each base table. These statistics are used to determine the best strategy for executing an SQL statement. The statistics are stored in the catalog by the UPDATE STATISTICS statement .

If a SAMPLE definition is specified in an UPDATE STATISTICS statement, it specifies the number of rows in the table that are to be used to calculate the statistics.

If a SAMPLE definition is not specified in an UPDATE STATISTICS statement and if it is not mandatory that all of the rows in the table be used to calculate the statistics, the database system uses the appropriate SAMPLE definition of the CREATE TABLE or ALTER TABLE statement.

The number of rows for which the UPDATE STATISTICS statement is to be executed can be defined by specifying a numeric or percentage value.

  • If a SAMPLE definition is specified as a PERCENT, the unsigned integer must be between 1 and 100.
  • If a SAMPLE definition is not defined, the database system uses the value 20000 ROWS.

SQL statements in which the SAMPLE definition can be used

CREATE TABLE statement

ALTER TABLE statement

UPDATE STATISTICS statement


Column Definition (column_definition) (SAP Library - SAP DB)

 Entering content frame

Column Definition (column_definition)

A column definition defines a column in a table. The name and data type of each column are defined by the column name and data type. The column names must be unique within a base table.

Syntax

<column_definition> ::= <column_name> <data_type> [<column_attributes>]
| <column_name> <domain_name> [<column_attributes>]

column_name , data_type , column_attributes , domain_name

Explanation

If the [PRIMARY] KEY column attribute is specified, the CREATE TABLE statement must not contain a key definition .

A column definition may only consist of a column name if a QUERY expression is used in the CREATE TABLE statement.

If a column name and domain name (the name of a value range) are specified, the domain name must identify an existing domain. The data type and the length of the domain are assigned to the specified column. If the domain has a constraint_definition , the effect is the same as if the corresponding CONSTRAINT definition were specified in the column attribute of the column definition.

Columns, which are part of the key, or for which NOT NULL was defined, are called NOT NULL columns. A NULL value cannot be inserted in these columns.

  • Mandatory columns: NOT NULL columns for which a DEFAULT specification has not been declared as a column attribute are called mandatory columns. Whenever rows are inserted, values must be specified for these columns.
  • Optional columns: columns that are not mandatory are referred to as optional columns. A value does not have to be specified when a row is inserted in these columns. If a DEFAULT specification exists for the column, the default value is entered in the column. If there is no DEFAULT specification, a NULL value is entered in the column.

Memory requirements of a column value as a function of the data type

See also:

Restrictions


Data Type (data_type) (SAP Library - SAP DB)

 Entering content frame

Data Type (data_type)

As well as specifying the column name when you define columns , you can also specify data types.

Syntax

<data_type> ::=
  CHAR[ACTER] [(<unsigned_integer>)] [ASCII | BYTE | EBCDIC | UNICODE]
| VARCHAR [(<unsigned_integer>)] [ASCII | BYTE | EBCDIC | UNICODE]
| LONG [VARCHAR] [ASCII | BYTE | EBCDIC | UNICODE]
| BOOLEAN
| FIXED (<unsigned_integer> [,<unsigned_integer>])
| FLOAT (<unsigned_integer>)
| INT[EGER] | SMALLINT
| DATE | TIME | TIMESTAMP

unsigned_integer

CHAR[ACTER] , VARCHAR , LONG[VARCHAR] , BOOLEAN , FIXED , FLOAT , INT[EGER] , SMALLINT , DATE , TIME , TIMESTAMP

Explanation

For the following character strings , a code attribute can be entered as part of a column definition (column_definition), if required: CHAR[ACTER], VARCHAR, LONG[VARCHAR]

In addition to the data types defined above, the following data types are permitted in a column definition and are mapped as follows to the data types below:

Data Type | Is Mapped To
BINARY(p) | FIXED(p)
DEC[IMAL](p,s) | FIXED(p,s)
DEC[IMAL](p) | FIXED(p)
DEC[IMAL] | FIXED(5)
DOUBLE PRECISION | FLOAT(38)
FLOAT | FLOAT(16)
FLOAT(39..64) | FLOAT(38)
LONG VARCHAR | LONG
NUMERIC(p,s) | FIXED(p,s)
NUMERIC(p) | FIXED(p)
NUMERIC | FIXED(5)
REAL(p) | FLOAT(p)
REAL | FLOAT(16)
SERIAL | FIXED(10) DEFAULT SERIAL
SERIAL(p) | FIXED(10) DEFAULT SERIAL(p)

See also:

Data type

Memory requirements of a column value as a function of the data type


CHAR[ACTER] (SAP Library - SAP DB)

 Entering content frame

CHAR[ACTER]

Definition

An alphanumerical column is defined. Specification of length attribute n is optional. If no other length attribute is specified, then n=1.

CHAR[ACTER] [(n)]: 0<n<=8000
CHAR[ACTER] [(n)] UNICODE: 0<n<=4000

The database system determines, in accordance with n, whether the values in the column are stored with a fixed or variable length. If you want to store the values in a variable length regardless of the value of n, you must enter a value for VARCHAR .

Use

Specification of data type CHAR[ACTER] in column definition , with a code attribute , if required.

Integration

Data type (data_type)


VARCHAR (SAP Library - SAP DB)

 Entering content frame

VARCHAR

Definition

An alphanumerical column is defined. Specification of length attribute n is optional. If no other length attribute is specified, then n=1.

VARCHAR [(n)]: 0<n<=8000
VARCHAR [(n)] UNICODE: 0<n<=4000

Use VARCHAR (n) if the values in the column are to be stored with a variable length, irrespective of n.

Use

Specification of data type VARCHAR in column definition , with a code attribute , if required.

Integration

Data type (data_type)


LONG[VARCHAR] (SAP Library - SAP DB)

 Entering content frame

LONG[VARCHAR]

Definition

An alphanumeric column is defined with any length (not for temporary tables).

LONG[VARCHAR]: A maximum of 2 GB of characters can be written in a LONG column.
LONG[VARCHAR] UNICODE: A maximum of 2 GB bytes can be written in a LONG column.

You can only give LONG columns NOT NULL or a DEFAULT specification as a column attribute .

Use

Specification of data type LONG in column definition , with a code attribute , if required.

LONG columns can be used in the following SQL statements:
INSERT statement , UPDATE statement , NULL predicate , and in selected columns .

Integration

Data type (data_type)


BOOLEAN (SAP Library - SAP DB)

 Entering content frame

BOOLEAN

Definition

BOOLEAN: The column is given the data type BOOLEAN .

Use

Specifying the data type BOOLEAN when defining columns

Integration

Data type (data_type)


FIXED (SAP Library - SAP DB)

 Entering content frame

FIXED

Definition

FIXED (p,s): A column with a fixed point number with precision p and with s number of decimal places (0<p<=38, s<=p). If no s is specified, it is assumed that the decimal places are 0.

Use

Specifying the data type FIXED when defining columns

Integration

Data type (data_type)


FLOAT (SAP Library - SAP DB)

 Entering content frame

FLOAT

Definition

FLOAT (p): A column with a floating point number with precision p (0<p<=38).

Use

Specifying the data type FLOAT when defining columns

Integration

Data type (data_type)


INT[EGER] (SAP Library - SAP DB)

 Entering content frame

INT[EGER]

Definition

INT[EGER]: This data type is the same as FIXED (10.0). Its permitted values are between -2147483648 and 2147483647.

Use

Specifying the data type INT[EGER] when defining columns

Integration

Data type (data_type)


SMALLINT (SAP Library - SAP DB)

 Entering content frame

SMALLINT

Definition

SMALLINT: This data type is the same as FIXED (5.0). Its permitted values are between -32768 and 32767.

Use

Specifying the data type SMALLINT when defining columns

Integration

Data type (data_type)


DATE (SAP Library - SAP DB)

 Entering content frame

DATE

Definition

DATE: An alphanumeric column in which you can store date values .

Use

Specifying the data type DATE when defining columns

Integration

Data type (data_type)


TIME (SAP Library - SAP DB)

 Entering content frame

TIME

Definition

TIME: An alphanumeric column in which you can store time values .

Use

Specifying the data type TIME when defining columns

Integration

Data type (data_type)


TIMESTAMP (SAP Library - SAP DB)

 Entering content frame

TIMESTAMP

Definition

TIMESTAMP: An alphanumeric column in which you can store time stamp values .

Use

Specifying the data type TIMESTAMP when defining columns

Integration

Data type (data_type)


Memory requirements of a column value per data types (SAP Library - SAP DB)

 Entering content frame

Memory requirements of a column value per data types

Data type

Column definition

Data Type | Memory Requirements of a Column Value in Bytes for This Data Type
FIXED (p,s) | (p+1) DIV 2 + 2
FLOAT (p) | (p+1) DIV 2 + 2
BOOLEAN | 2
DATE | 9
TIME | 9
TIMESTAMP | 21
LONG | 9
CHAR (n); n<=30 | n+1
CHAR(n); 30<n<=254; key column | n+1
CHAR(n); 30<n<=254; not key column | n+2
CHAR(n); 254<n | n+3
CHAR(n) UNICODE; n<=15 | 2*n+1
CHAR(n) UNICODE; 15<n<=127; key column | 2*n+1
CHAR(n) UNICODE; 15<n<=127; not key column | 2*n+2
CHAR(n) UNICODE; 127<n | 2*n+3
VARCHAR (n); 30<n<=254; key column | n+1
VARCHAR(n); 30<n<=254; not key column | n+2
VARCHAR(n); 254<n | n+3
VARCHAR(n) UNICODE; 15<n<=127; key column | 2*n+1
VARCHAR(n) UNICODE; 15<n<=127; not key column; | 2*n+2
VARCHAR(n) UNICODE; 127<n | 2*n+3


Column Attributes (column_attributes) (SAP Library - SAP DB)

 Entering content frame

Column Attributes (column_attributes)

A column_definition can contain the column name and column attributes.

Syntax

<column_attributes> ::= [<key_or_not_null_spec>] [<default_spec>] [UNIQUE] [<constraint_definition>]
[REFERENCES <referenced_table> [(<referenced_column>)] [<delete_rule>]]

<key_or_not_null_spec> ::= [PRIMARY] KEY | NOT NULL [WITH DEFAULT]

default_spec , constraint_definition , delete_rule

  • A CONSTRAINT definition defines a condition that must be fulfilled by all the column values in the columns defined by the column definition .
  • [REFERENCES <referenced_table> [(<referenced_column>)] [<delete_rule>]
    has the same effect as specifying the referential CONSTRAINT definition
    FOREIGN KEY [<referential_constraint_name>] (<referencing_column>)
    REFERENCES <referenced_table> [(<referenced_column>,...)] [<delete_rule>]

referenced_table
referenced_column

referenced table
referenced column

Explanation

The [PRIMARY] KEY and UNIQUE column attributes must not be used together in a column definition.

If the [PRIMARY] KEY column attribute is specified, the CREATE TABLE statement must not contain a key definition .

LONG data type: you may only specify NOT NULL or a DEFAULT specification as a column attribute for LONG columns.

UNIQUE

The UNIQUE column attribute determines the uniqueness of column values (see also CREATE INDEX statement ).

KEY

If the KEY column attribute is specified, this column is part of the key of a table and is called the key column. The database system ensures that the key values in a table are unique. To improve performance, the key should start with key columns which can assume many different values and which are to be used frequently in conditions with the "=" operator.

See also:

Restrictions

If a table is defined without a key column, the database system implicitly creates a key column SYSKEY CHAR(8) BYTE. This column is not visible with a SELECT *. However, it can be specified explicitly and has then the same function as a key column. The SYSKEY column can be used to obtain unique keys generated by the database system. The keys are in ascending order, thus reflecting the order of insertion in the table. The key values in the SYSKEY column are only unique within a table; i.e., the SYSKEY column in two different tables may contain the same values. If a unique key is desired across the entire database system, a key column of the data type CHAR(8) BYTE with the DEFAULT specification STAMP can be defined.

NOT NULL

NOT NULL must not be used together with the DEFAULT specification DEFAULT NULL.

NOT NULL WITH DEFAULT defines a default value that is dependent on the data type of the column. NOT NULL WITH DEFAULT must not be used with any of the DEFAULT specifications.

Column data type | DEFAULT value
CHAR (n); VARCHAR (n) | ' '
CHAR(n) BYTE; VARCHAR(n) BYTE | X'00'
FIXED (p,s), INT , SMALLINT , FLOAT (p) | 0
DATE | DATE
TIME | TIME
TIMESTAMP | TIMESTAMP
BOOLEAN | FALSE


DEFAULT Specification (default_spec) (SAP Library - SAP DB)

 Entering content frame

DEFAULT Specification (default_spec)

A DEFAULT specification is formed by specifying the keyword DEFAULT and a DEFAULT value The maximum length of a default value is 254 characters.

Syntax

<default_spec> ::= DEFAULT <literal> | DEFAULT NULL
| DEFAULT USER | DEFAULT USERGROUP | DEFAULT SYSDBA
| DEFAULT DATE | DEFAULT TIME | DEFAULT TIMESTAMP
| DEFAULT UTCDATE | DEFAULT UTCDIFF | DEFAULT TIMEZONE
| DEFAULT TRUE | DEFAULT FALSE
| DEFAULT TRANSACTION | DEFAULT STAMP
| DEFAULT SERIAL[(<unsigned_integer>)]

literal , unsigned integer

Explanation

If a DEFAULT specification has been made for a column, the default value ( <literal>, NULL, USER,...) must be a value that can be inserted in the column.

DEFAULT Specification

Explanation

DEFAULT <literal>

The literal must be comparable with the data type of the column.

DEFAULT USER

Gets the user name of the current user and can only be specified for columns that have the data type [VAR]CHAR(n) or CHAR(n) (n ³ 32)

DEFAULT USERGROUP

Gets the user group name for members of a user group, or the user name for users who do not belong to a user group. This DEFAULT specification can only be specified for columns that have the data type [VAR]CHAR(n) (n ³ 32).

DEFAULT SYSDBA

Gets the name of the SYSDBA and can only be specified for columns that have the data type [VAR]CHAR(n) (n ³ 32) (from version 7.4.04.02)

DEFAULT DATE

Gets the current date and can only be specified for columns that have the data type DATE

DEFAULT TIME

Gets the current time and can only be specified for columns that have the data type TIME

DEFAULT TIMESTAMP

Gets the current timestamp and can only be specified for columns that have the data type TIMESTAMP

DEFAULT UTCDATE

Gets the current UTC timestamp (Greenwich Mean Time) and can only be specified for columns that have the data type TIMESTAMP (from Version 7.4.04.02)

DEFAULT UTCDIFF

Gets the time difference (in hours) between your local time and UTC time and can only be specified for columns that have the data type FLOAT(p) (p ³ 4) or FIXED(p,s) (s ³ 2, p ³ s+2) (from Version 7.4.04.02)

DEFAULT TIMEZONE

Gets the time difference (in hours) between your local time and UTC time and can only be specified for columns that have the data type FLOAT(p) (p ³ 6) or FIXED(p,s) (s ³ 0, p ³ s+6) (from Version 7.4.04.02)

DEFAULT TRUE/DEFAULT FALSE

Can only be specified for columns that have the data type BOOLEAN

DEFAULT TRANSACTION

Gets the ID of the current transaction and can only be specified for columns that have the data type CHAR(n) BYTE (n>=8)

DEFAULT STAMP

Gets an eight-character value that is unique within the database system. Can only be specified for columns that have the data type CHAR(n) BYTE (n>=8).

If a table is defined without a key column, the database system implicitly creates a key column SYSKEY CHAR(8) BYTE. The key values in the SYSKEY column are only unique within a table; that is, the SYSKEY column in two different tables may contain the same values. If you want a unique key across the entire database system, you can define a key column with the DEFAULT specification STAMP.

DEFAULT SERIAL [(<unsigned_integer)]

Gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL).

The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value.

If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0.

Each table may not contain more than one column with the DEFAULT specification DEFAULT SERIAL.


CONSTRAINT definition (constraint_definition) (SAP Library - SAP DB)

 Entering content frame

CONSTRAINT definition (constraint_definition)

A CONSTRAINT definition defines an integrity condition (restrictions for column values, see data integrity ) that must be fulfilled by all the rows in one table.

Syntax

<constraint_definition> ::= CHECK <search_condition>
| CONSTRAINT <search_condition>
| CONSTRAINT <constraint_name> CHECK <search_condition>

search condition , constraint name

Simple constraint (for one column), example table customer

title CHAR(7) CONSTRAINT title IN ('Mr','Mrs','Comp')

Complex constraint (for several columns), example table reservation

arrival DATE NOT NULL
departure DATE CONSTRAINT departure > arrival

The system checks whether the arrival is before the departure.

Explanation

A CONSTRAINT definition defines an integrity condition that must be fulfilled by all the column values in the columns defined by the column definition with CONSTRAINT definition.

The CONSTRAINT definition in a column is checked when a row is inserted and a column changed that occurs in the CONSTRAINT definition. If the CONSTRAINT definition is violated, the INSERT or UPDATE statement fails.

When you define a constraint, you specify implicitly that the NULL value is not permitted as an input.

The search condition ( search_condition) of the CONSTRAINT definition must not contain a subquery .

The search condition of the CONSTRAINT definition must only contain column names in the form <column name>.

Constraint name

· No constraint name:
The database system assigns a constraint name that is unique for the table in question.

· Constraint name is specified:
The constraint name must be different to all other constraint names for this table.

Number of columns in a search condition

· Contains only one column name in the table:
When the table is created (CREATE TABLE statement), you can check whether an additional DEFAULT value (default_spec) specified as a column attribute fulfills the search condition. If it is not true, the CREATE TABLE statement fails.

· Contains more than one column name in the table:
When the table is created (CREATE TABLE statement), it is not possible to decide whether DEFAULT values of the table columns fulfill the search condition. In this case, an attempt to insert DEFAULT values in the table when an INSERT or UPDATE statement is executed may fail.


Referential CONSTRAINT definition (referential_constraint_definition)

A referential CONSTRAINT definition defines an integrity condition (restrictions for columns values, see data integrity) that must be satisfied by all the rows in two tables. The resultant dependency between two tables affects changes to the rows contained in them.

Syntax

<referential_constraint_definition> ::=
FOREIGN KEY [<referential_constraint_name>] (<referencing_column>,...)
REFERENCES <referenced_table> [(<referenced_column>,...)] [<delete_rule>]

referential_constraint_name, delete_rule

referenced_table referenced_column | Reference table, referenced column (table/column that is to be addressed)
referencing_column | Referencing column (column that establishes the link to the column that is to be addressed)

Dependency between the model tables customer and reservation. The referential CONSTRAINT definition is specified when the reservation table is defined. The reservation table is assigned a foreign key that corresponds to the key in the customer table.

CREATE TABLE reservation (rno FIXED(4) PRIMARY KEY, cno FIXED(4), hno FIXED(4), roomtype CHAR(6), arrival DATE, departure DATE,

FOREIGN KEY customer_reservation (cno) REFERENCES customer ON DELETE CASCADE)

The defined relationship is called customer_reservation. The DELETE rule ON DELETE CASCADE specifies that deleting rows in the customer table causes the associated rows in the reservation table to be deleted automatically.

Explanation

A referential CONSTRAINT definition can be used in a CREATE TABLE statement or ALTER TABLE statement. The table specified in the corresponding statement ( table_name) is referred to in the following sections as the referencing table.

The referencing columns are specified in the referential CONSTRAINT definition. The referencing columns must denote columns in the referencing table and must all be different. They are also called foreign key columns.

Referenced columns ( referenced_column)

· If no referencing columns are specified, the result is the same as if the key columns in the referenced table were specified in the defined sequence.

· If referenced columns are specified that are not the key in the referencing table, the referenced table must have a UNIQUE definition whose column names and sequence match those of the referenced columns.

Relationship between referenced and referencing columns:

· The number of referenced columns is equal to the number of referencing columns.

· The nth referencing column corresponds to the nth referenced column.

· The data type and the length of each referencing column must match the data type and length of the corresponding referenced column.

The referencing table and the referenced table must be base tables, but not temporary base tables.

The current user must have the ALTER privilege for the referencing table and the REFERENCE privilege for the referenced table.

Name of a referential constraint ( referential_constraint_name)

The name of a referential constraint can be specified after the keywords FOREIGN KEY.

· If the name of a referential constraint is specified, it must be different from all other names of referential constraints for the referencing table.

· If no referential constraint name is specified, the database system assigns a unique name (based on the referencing table).

Inserting and modifying rows in the referenced table

The following restrictions apply when rows in the referencing table are added or modified:

Let Z be an inserted or modified row. Rows can only be inserted or modified if one of the following conditions is fulfilled for the associated referenced table:

· Z is a matching row

· Z contains a NULL value in one of the referencing columns.

· The referential CONSTRAINT definition defines the DELETE rule ON DEFAULT SET DEFAULT, and Z contains the DEFAULT value in each referencing column.

Further terms

· DELETE rule

· CASCADE dependency

· Reference cycle

· A referential CONSTRAINT definition is self-referencing if the referenced and referencing tables are identical.
With self-referencing referential CONSTRAINT definitions, the order in which a DELETE statement is processed can be important.
Specifying CASCADE: all of the rows affected by the DELETE statement are first deleted irrespective of the referential CONSTRAINT conditions. All matching rows in the rows that have just been deleted are then also deleted. As a result, all of the matching rows in the previous deletion operation are deleted, etc.
Specifying SET NULL or SET DEFAULT: all of the rows affected by the DELETE statement are first deleted irrespective of the referential CONSTRAINT conditions. Following this, SET NULL or SET DEFAULT is applied to the matching row.

· When rows are deleted from a referenced table, the number of rows deleted is entered in the third SQLERRD entry in the SQLCA database.

· When an INSERT or UPDATE statement is applied to a referencing table, irrespective of the isolation level defined for the current session, the database uses a blocking behavior for the referenced table that corresponds to isolation level 1.
When a DELETE statement is applied to a referenced table, the database system uses a locking behavior that corresponds to isolation level 3.


DELETE rule (SAP Library - SAP DB)

 Entering content frame

DELETE rule

The DELETE rule defines the effects that deleting a row in the referenced table has on the referencing table (see referential_constraint_definition ). The DELETE rule is also used when column attributes are defined.

Syntax

<delete_rule> ::= ON DELETE CASCADE | ON DELETE RESTRICT
| ON DELETE SET DEFAULT | ON DELETE SET NULL

Explanation

  • No DELETE rule: deleting a row in the referenced table will fail if matching rows exist.
  • ON DELETE CASCADE: if a row in the referenced table is deleted, all of the matching rows are deleted.
  • ON DELETE RESTRICT: deleting a row in the referenced table will fails if matching rows exist.
  • ON DELETE SET DEFAULT: if a row in the referenced table is deleted, the associated DEFAULT value is assigned to each referencing column for each matching row.
    A     DEFAULT specification must exist for each referencing column.
  • ON DELETE SET NULL: if a row in the referenced table is deleted, a NULL value is assigned to each referencing column of every matching row.
    None of these referencing tables may be a NOT NULL column.


CASCADE dependency (SAP Library - SAP DB)

 Entering content frame

CASCADE dependency

A table T* is CASCADE dependent on table T if a series of referential CONSTRAINT definitions R1, R2, ..., Rn (n>=1) exist where:

  • T* is the referencing table of R1
  • T is the referenced table of Rn
  • All of the referential CONSTRAINT definitions use CASCADE from the DELETE rule or from the CASCADE option .
  • For i=1,...,n-1, n>1 is the referenced table of Ri is equal to the referencing table of Ri+1

Let R1 and R2 be two different referential CONSTRAINT definitions with the same referencing table S. T1 denotes the referenced table of R1, T2 denotes the referenced table of R2.

If T1 and T2 are identical, or if a table T exists so that T1 and T2 are CASCADE dependent on T, then R1 and R2 must both specify either CASCADE or RESTRICT.

There are different sequences of referential CONSTRAINT definitions that link the tables S and T. A DELETE statement on table T results in an action in table S. In order to ensure that the result of the DELETE statement does not depend on which of the two sequences of referential CONSTRAINT definitions is processed, the above restriction was selected for R1 and R2.

See also:

CASCADE option


Reference cycle (SAP Library - SAP DB)

 Entering content frame

Reference cycle

A reference cycle is a sequence of referential CONSTRAINT definitions R1, R2,...,Rn where n>1, so that the following applies:

  • i=1,...,n-1 the referenced table of Ri is equal to the referencing table of Ri+1
  • the reference table of Rn is the referencing table of R1

A reference cycle in which all of the referential CONSTRAINT definitions specify CASCADE ( CASCADE dependency ) is not allowed.

A reference cycle in which one referential CONSTRAINT definition does not specify CASCADE and all other referential CONSTRAINT definitions specify CASCADE is not allowed.


Matching row (SAP Library - SAP DB)

 Entering content frame

Matching row

A row in the referencing table is called a matching row of a row in the referenced table if the values of the corresponding referencing and referenced columns are identical.

A referential CONSTRAINT definition defines a 1:n relationship between two tables. This means that more than one matching row can exist for each row in the referenced table.

A row in the referenced table in a referenced column cannot be changed if at least one matching row exists.


Key Definition (key_definition) (SAP Library - SAP DB)

 Entering content frame

Key Definition (key_definition)

A key definition in a CREATE TABLE statement or an ALTER TABLE statement defines the key in a base table. The key definition is introduced by the keywords PRIMARY KEY.

Syntax

<key_definition> :: PRIMARY KEY (<column_name>,...)

column_name

SQL statement for creating a person table with a one-column primary key for the column cno:

CREATE TABLE person (cno FIXED(4), firstname CHAR(7), name CHAR(7), account FIXED(7,2), PRIMARY KEY (cno))

Rows are inserted in the same way as in a base table without a key definition. Double entries for the customer number, however, are rejected.

Explanation

The column name must identify a column in the base table. The specified column names are key columns in the table.

A key column must not identify a column of the data type LONG and is always a NOT NULL column. The database system ensures that no key column has a NULL value and that no two rows of the table have the same values in all key columns.

See also:

Restrictions


UNIQUE Definition (unique_definition) (SAP Library - SAP DB)

 Entering content frame

UNIQUE Definition (unique_definition)

A UNIQUE definition in the CREATE TABLE statement defines the uniqueness of column value combinations.

Syntax

<unique_definition> ::= [CONSTRAINT <index_name>] UNIQUE (<column_name>,...)

index_name, column_name

Explanation

Specifying a UNIQUE definition in a CREATE TABLE statement has the same effect as specifying the CREATE TABLE statement without a UNIQUE definition, but with a CREATE INDEX statement with UNIQUE.

· Index name specified: the generated index is stored under this name in the database catalog.

· No index name: The database system assigns a unique index name to the index.


DROP TABLE statement (SAP Library - SAP DB)

 Entering content frame

DROP TABLE statement

A DROP TABLE statement deletes a base table (see Table ).

Syntax

<drop_table_statement> ::= DROP TABLE <table_name> [<cascade_option>]

table_name , cascade_option

Explanation

The table name must be the name of an existing base table. The current user must be the owner of the base table.

All the metadata and rows in the base table and all the view tables (see table ), indexes , privileges , synonyms , and referential CONSTRAINT definitions derived from it are deleted.

CASCADE option RESTRICT: the DROP TABLE statement will fail if view tables or synonyms are based on the specified table.

No CASCADE option specified: the CASCADE value is accepted.

If all of the data that is linked to this base table by means of a referential_constraint_definition with a DELETE rule , are processed according to the specified DELETE rule, a DELETE statement must first be executed for this base table and then the DROP TABLE statement.


CASCADE option (SAP Library - SAP DB)

 Entering content frame

CASCADE option

A CASCADE option determines the deletion behavior for objects (e.g. tables, users), i.e. it defined whether certain dependencies are to be taken into account when objects are deleted.

Syntax

<cascade_option> ::= CASCADE | RESTRICT

See also:

CASCADE dependency


ALTER TABLE statement (SAP Library - SAP DB)

 Entering content frame

ALTER TABLE statement

An ALTER TABLE statement changes the properties of a base table (see Table ).

Syntax

<alter_table_statement> ::=
  ALTER TABLE <table_name> <add_definition>
| ALTER TABLE <table_name> <drop_definition>
| ALTER TABLE <table_name> <alter_definition>
| ALTER TABLE <table_name> <column_change_definition>
| ALTER TABLE <table_name> <modify_definition>
| ALTER TABLE <table_name> <referential_constraint_definition>
| ALTER TABLE <table_name> DROP FOREIGN KEY <referential_constraint_name>
| ALTER TABLE <table_name> <sample_definition>

table_name , add_definition , drop_definition , alter_definition , column_change_definition , modify_definition , referential_constraint_definition , referential_constraint_name , sample_definition

Explanation

The table name must be the name of an existing base table. The table must not be a temporary base table. The current user must have the ALTER privilege for the specified table.

  • If a referential CONSTRAINT definition was specified, a new referential constraint is defined for the base table. The rules described in the referential CONSTRAINT definition apply.
  • If DROP FOREIGN KEY was specified, the referential CONSTRAINT definition identified by the name of the referential constraint is dropped.
  • If a SAMPLE definition is specified, a new number of rows is defined and is taken into account by the database system when the table statistics are calculated.


ADD Definition (add_definition) (SAP Library - SAP DB)

 Entering content frame

ADD Definition (add_definition)

You can define additional table properties by specifying an ADD definition in the ALTER TABLE statement.

Syntax

<add_definition> ::= ADD <column_definition>,...
| ADD (<column_definition>,...)
| ADD <constraint_definition>
| ADD <referential_constraint_definition>
| ADD <key_definition>

column_definition, constraint_definition, key_definition, referential_constraint_definition

The following statement adds two columns to the customer table. The columns initially contain the NULL value in all rows.

ALTER TABLE customer ADD (phone_number FIXED (8), street CHAR (15))

The new columns can be used immediately.

Explanation

Adding a Column Definition: ADD <column_definition>

You can specify column definitions to add these columns to the table specified in the ALTER TABLE statement. These specifications must not exceed the maximum number of columns allowed and the maximum length of a row.

The memory requirements for each column are increased by one character (for normal memory requirements, see Memory requirements of a column value as a function of the data type), if the length described is less than 31 characters and the column does not have the data type VARCHAR.

The newly defined columns contain the NULL value in all rows, if no default value has been specified for these columns using a DEFAULT specification. If the NULL value violates a CONSTRAINT definition of the table, the ALTER TABLE statement will fail.

When you add LONG columns, you cannot make a DEFAULT specification. If you want to define a default value for a LONG column, you can define the LONG column using the ADD definition and then use MODIFY Definition to define a default value for the definition.

In every other respect, specifying a column definition has the same effect as specifying a column definition in a CREATE TABLE statement.

· If view tables are defined for the specified table, and if alias names are defined for one of these view tables, and if the view tables reference the columns in the table with *, the ALTER TABLE statement will fail.

· If view tables are defined for the specified table, and if no alias names are defined, and if the view tables reference the columns in the table with *, this view table contains the columns added to the base table by the ADD definition.

Adding a CONSTANT Definition: ADD <constant definition>

All of the rows in the table must satisfy the condition defined by the search condition of the CONSTRAINT definition.

Adding a Referential CONSTRAINT Definition: ADD <referential_constraint_definition>

An integrity condition is defined for the table specified in the ALTER TABLE statement. The columns specified in the referential CONSTRAINT definition must be columns in the table.All of the rows in the table must satisfy the integrity condition defined by the referential CONSTRAINT definition.

Adding a Key Definition: ADD <key definition>

A key is defined for the table specified in the ALTER TABLE statement. At execution time, the table must only contain the key column SYSKEY generated by the database system. The columns specified in the key definition must be columns in the table and must satisfy the key properties (none of the columns may contain NULL value, and no two rows in the table may have the same values in all columns of the key definition). The new key is stored in the metadata of the table. The key column SYSKEY is omitted. This is an extremely lengthy procedure for tables with a large number of rows, since extensive copy operations are carried out.

If a primary key is defined for the table specified in the ALTER TABLE statement, and the structure of this primary key matches the structure of an existing index exactly, then this index is deleted.


ALTER definition (SAP Library - SAP DB)

 Entering content frame

ALTER definition

By specifying an ALTER definition in the ALTER TABLE statement , you can change a CONSTRAINT definition or a key definition .

Syntax

<alter_definition> ::=
  ALTER CONSTRAINT <constraint_name> CHECK <search_condition>
| ALTER <key_definition>

constraint_name , search_condition , key_definition

Explanation

CONSTRAINT <constraint_name>

The constraint name must identify a CONSTRAINT definition in the table. If the specified search condition is not violated by any row in the table, it replaces the existing search condition of the CONSTRAINT definition. Otherwise, the ALTER TABLE statement fails.

<key_definition>

The key specified by the key definition replaces the current key in the table. The columns specified in the key definition must identify columns in the table and must have the key property ( key definition ).

If a column of the key to be replaced is a referenced column of a referential CONSTRAINT definition, the ALTER TABLE statement will fail.

With large tables, in particular, this may take more time, since extensive copy operations have to be carried out.


COLUMN change definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation COLUMN change definition

You can modify the properties of a column by specifying a COLUMN change definition in the ALTER TABLE statement .

Syntax

<column_change_definition> ::= COLUMN <column_name> NOT NULL
| COLUMN <column_name> DEFAULT NULL
| COLUMN <column_name> ADD <default_spec>
| COLUMN <column_name> ALTER <default_spec>
| COLUMN <column_name> DROP DEFAULT

column_name , default_spec

Explanation

NOT NULL

NOT NULL can only be specified if the column contains no NULL value s. You cannot add a NULL value to the column once the ALTER TABLE statement has been successfully executed.

DEFAULT NULL

DEFAULT NULL allows a NULL value for the column. The system does not check whether a NULL value violates existing CONSTRAINT definitions in the table. For this reason, inserting the NULL value can fail when an INSERT or UPDATE statement is executed.

ADD <default_spec>

The column must not contain a DEFAULT specification before the ALTER TABLE statement is executed with ADD <default spec>. ADD <default spec> assigns a DEFAULT value to the column.

ALTER <default spec>

ALTER <default spec> changes the DEFAULT value assigned to the column. All of the rows that contain the old default value in the column remain unaltered.

DROP DEFAULT

DROP DEFAULT drops the DEFAULT specification of the column. If the column is the foreign key column of a referential CONSTRAINT definition with the DELETE RULE ON DELETE SET DEFAULT, the ALTER TABLE statement will fail.


DROP definition (SAP Library - SAP DB)

 Entering content frame

DROP definition

You can delete table properties by specifying a DROP definition in the ALTER TABLE statement .

Syntax

<drop_definition> ::= DROP <column_name>,... [<cascade_option>] [RELEASE SPACE]
| DROP (<column_name>,...) [<cascade_option>] [RELEASE SPACE]
| DROP CONSTRAINT <constraint_name> | DROP PRIMARY KEY

column_name , cascade_option , constraint_name

Explanation

Dropping a column: DROP <column_name>

Each column name must be a column of the table identified by the ALTER TABLE statement. The column must be neither a key column nor a foreign key column of a referential CONSTRAINT definition of the table.

The columns are marked as dropped in the metadata of the table. A DROP definition does not automatically reduce the memory requirements of the underlying table. RELEASE SPACE forces the column values of the dropped columns to be dropped in every row in the table. With large tables, in particular, this may take more time, since extensive copy operations have to be carried out.

Any privileges and comments for the columns to be dropped are dropped as well.

If one of the columns to be dropped occurs as a selected column in a view definition, the specified column in the view table is dropped.
If this view table is used in the FROM condition of another view table, the described procedure is recursively applied to this view table.

  • If one of the columns to be dropped occurs in the QUERY specification of a view definition and if no CASCADE condition is specified or if the CASCADE condition in the DROP is specified in the DROP definition, the view definition is dropped with all the view tables, privileges, and synonyms that depend on it.
  • The ALTER TABLE statment will fail if one of the columns to be dropped appears in the QUERY specification of a view definition and the CASCADE condition RESTRICT is specified in the DROP definition.

Existing indexes referring to columns to be dropped are also dropped. The storage locations for the dropped indexes are released.

All CONSTRAINT definitions that contain one of the dropped columns are dropped.

Dropping a constraint: DROP CONSTRAINT <constraint_name>

The constraint name must identify a CONSTRAINT definition in the table. The latter is then removed from the metadata of the table.

Dropping a key: DROP PRIMARY KEY

  • The table must have a key defined by the user.
  • The table must not contain more than 1023 columns.
  • The maximum permissible length of a row must not exceed 8088 bytes.
  • The key columns must not be a referenced column of a referential CONSTRAINT definition .

The key is replaced by the key column SYSKEY generated by the database system. With large tables, in particular, this may take more time, since extensive copy operations have to be carried out.


MODIFY definition (SAP Library - SAP DB)

 Entering content frame

MODIFY definition

You can modify data types and properties of table columns by specifying a MODIFY definition in the ALTER TABLE statement .

Syntax

<modify_definition> ::= MODIFY (<column_name> [<data_type>] [<column_attributes>]...)

column_name , data_type , column_attributes

The parentheses are not necessary if the MODIFY definition only contains one column name.

Explanation

Each column name must be a column of the base table specified in the ALTER TABLE statement.

Column attributes

Only the following column attributes are allowed:

  • NULL
     NULL value
  • NOT NULL
    If NOT NULL is specified, the table must not have any rows that contain a NULL value in the corresponding column. A NULL value can no longer be inserted into the column after being modified.
  • DEFAULT specification
    The DEFAULT specification DEFAULT SERIAL is not permitted.
    If a DEFAULT specification is specified, it replaces an existing DEFAULT specification in the corresponding column. The new DEFAULT specification only affects subsequent INSERT statements and not affect rows that already exist in the table.

Data types

If a DEFAULT specification is not specified and if a DEFAULT specification is defined for the corresponding column, it must be compatible with the data type.

  • Code attribute ASCII or EBCDIC: the corresponding column must have the data type DATE , TIME , or TIMESTAMP or the code attribute ASCII, EBCDIC, or UNICODE before it is modified.
  • Code attribute UNICODE: A transformation from UNICODE to ASCII must be possible for the relevant column.
  • Code attribute BYTE: the corresponding column must have the data type DATE, TIME, or TIMESTAMP or the code attribute ASCII, EBCDIC, or BYTE before it is modified.

Data type CHAR(n), VARCHAR(n): the corresponding column must have the data type CHAR (n), VARCHAR (n), DATE, TIME, or TIMESTAMP. In this case, the table must not contain a row in which the column has a value with a length greater than n.
If a column had the code attribute UNICODE before the ALTER TABLE statement was executed, and the new code attribute is not UNICODE, transformation to the new code attribute must be possible.

Data type DATE: the corresponding column must have the data type CHAR(n), VARCHAR(n), or DATE . This column must contain a date value in any of the date formats supported by the database system in all rows of the table.

Data type FIXED(n,m): the corresponding column must have the data type FIXED (n,m), FLOAT , INT , or SMALLINT . In this case, the table must not contain a row in which the column has a value with more than (n - m) integral or m fractional digits.

Data type FLOAT(n): the corresponding column must have the data type FIXED(n,m), FLOAT(n), INT, or SMALLINT.

Data type INT: the corresponding column must have the data type FIXED(n,m), FLOAT(n), INT, or SMALLINT. In this case, the table must only contain rows in which this column has integral values in the range between -2147483648 and 2147483647.

Data type SMALLINT: the corresponding column must have the data type FIXED(n,m), FLOAT(n), INT, or SMALLINT. In this case, the table must only contain rows in which this column has integral values in the range between -32768 and 32767.

Data type TIME: the corresponding column must have the data type CHAR(n), VARCHAR(n), or TIME . This column must contain a time value in any of the time formats supported by the database system in all rows of the table.

Data type TIMESTAMP: the corresponding column must have the data type CHAR(n), VARCHAR(n), or TIMESTAMP . This column must contain a timestamp value in any of the timestamp formats supported by the database system in all rows of the table.

Column attribute NULL: a NULL value can be entered in the corresponding column with a subsequent INSERT or UPDATE statement.

If one of the columns identified by column name is contained in a search condition for the table, this column must also define a legal search condition after the data type has been modified.

Others

Depending on the type of modification, the MODIFY definition may result in the table having to be recopied and/or indexes rebuilt. In such a case, the runtime will be considerably long.

If a table is recopied and the table contains columns marked as deleted, then these columns are removed from the catalog and from the table rows, thus reducing the space requirements of the table.


RENAME TABLE statement (SAP Library - SAP DB)

 Entering content frame

RENAME TABLE statement

A RENAME TABLE statement changes the name of a base table (see Table ).

Syntax

<rename_table_statement> ::=
RENAME TABLE <old_table_name> TO <new_table_name>

<old_table_name> ::= <table_name>
<new_table_name> ::= <identifier>

table_name , identifier

Explanation

The old table name must identify a base table that is not a temporary table. The current user must be the owner of the table.

The new table name must not already be assigned to a base or view table or a private synonym of the current user.

The old table is assigned the name specified in the new_table_name. All of the properties of the table (e.g. privileges, indexes) remain unchanged. The definitions of view tables based on the old table name are adapted to the new name.


RENAME COLUMN statement (SAP Library - SAP DB)

 Entering content frame

RENAME COLUMN statement

A RENAME COLUMN statement ( rename_column_statement ) changes the name of a table column.

Syntax

<rename_column_statement> ::=
RENAME COLUMN <table_name>.<column_name> TO <column_name>

table_name , column_name

Explanation

The specified table must be a base or view table. The current user must be the owner of the table.

The specified table column is given a new name. If the column name of a view table (that was defined with this table) was derived from the column name of the base table, the old column name in the view table is replaced by the new name. If the new column name is identical with an existing column name of the view table, the RENAME COLUMN statement fails.


EXISTS TABLE statement (SAP Library - SAP DB)

 Entering content frame

EXISTS TABLE statement

An EXISTS TABLE statement indicates whether a table exists or not.

Syntax

<exists_table_statement> ::= EXISTS TABLE <table_name>

table_name

Explanation

The specified table must be a base table, view table, or a synonym .

The existence or non-existence of the specified table is indicated by the return code 0 or by the error message -4004 UNKNOWN TABLE NAME .

A table only exists for a user if the user has a privilege on this table.


CREATE DOMAIN statement (SAP Library - SAP DB)

 Entering content frame

CREATE DOMAIN statement

A CREATE DOMAIN statement defines a value range (domain) .

Syntax

<create_domain_statement> ::= CREATE DOMAIN <domain_name> <data_type> [<default_spec>] [<constraint_definition>]

domain_name , data_type , default_spec , constraint_definition

Explanation

The CONSTRAINT definition must not contain a constraint name .

The CREATE DOMAIN statement can be executed by all users with DBA status.

If the domain name is specified without an owner, the current user is assumed to be the owner. If you specify the domain name with an owner, this owner must be identical to the current user. In this case, the current user becomes the owner of the domain.

The name of the domain must differ from all other domain names of the current user.

If a domain is generated with a CONSTRAINT definition, the domain name is included in the search condition as a column name.


DROP DOMAIN statement (SAP Library - SAP DB)

 Entering content frame

DROP DOMAIN statement

A DROP DOMAIN statement drops the definition of a domain .

Syntax

<drop_domain_statement> ::= DROP DOMAIN <domain_name>

domain_name

Explanation

The domain name must identify an existing domain. The current user must be owner of the domain.

The metadata of the domain is dropped from the catalog. Dropping a domain has no effect on tables in which this domain was used to define columns.


CREATE SEQUENCE Statement (create_sequence_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE SEQUENCE Statement (create_sequence_statement)

The CREATE SEQUENCE statement defines a database object that supplies integer values (number generator). In the following description, this object is referred to as a sequence.

Syntax

<create_sequence_statement> ::= CREATE SEQUENCE [<owner>.]<sequence_name>
[INCREMENT BY <integer>] [START WITH <integer>]
[MAXVALUE <integer> | NOMAXVALUE] [MINVALUE <integer> | NOMINVALUE]
[CYCLE | NOCYCLE]
[CACHE <unsigned_integer> | NOCACHE]
[ORDER | NOORDER]

owner , sequence_name , integer , unsigned_integer

Explanation

The sequence names can be specified in any order.

The current user must have RESOURCE or DBA status. If an owner is specified, it must identify the current user. The current user becomes the owner of the sequence.

The integer values generated by the sequence can be used to assign key values.

INCREMENT BY

Defines the difference between the next sequence value and the last value assigned. A negative value for INCREMENT BY generates a descending sequence. The value 1 is used if no value is assigned.

START WITH

Defines the first sequence value. If no value is specified, the value specified for MAXVALUE or –1 is used for descending sequences and the value specified for MINVALUE or 1 for ascending sequences.

MINVALUE

Defines the smallest value generated by the sequence. If no value is defined for MINVALUE, the smallest integer value that can be represented with 38 digits is used.

MAXVALUE

Defines the largest value generated by the sequence. If no value is defined for MAXVALUE, the largest integer value that can be represented with 38 digits is used.

CYCLE/NOCYCLE

CYCLE: MINVALUE is produced for ascending sequences after MAXVALUE has been assigned. MAXVALUE is produced for ascending sequences after MINVALUE has been assigned.

NOCYCLE: a request for a sequence value fails if the end of the sequence has already been reached, i.e. if MAXVALUE has been assigned for ascending sequences or MINVALUE for descending sequences.

If neither CYCLE nor NOCYCLE is specified, NOCYCLE is assumed.

CACHE/NOCACHE

CACHE: access to the sequence can be accelerated because the defined number of sequence values is held in the memory.

NOCACHE: no sequence values are defined beforehand.

If neither CACHE nor NOCACHE is specified, CACHE 20 is assumed.

ORDER/NOORDER

Specifying ORDER or NOORDER has no effect.

Sequence values can be specified using CURRVAL and NEXTVAL (see value_spec ). In this way, you can interrogate or increase the current counter value.


DROP SEQUENCE statement (SAP Library - SAP DB)

 Entering content frame

DROP SEQUENCE statement

A DROP SEQUENCE statement drops a number generator (sequence).

Syntax

<drop_sequence_statement> ::= DROP SEQUENCE [<owner>.]<sequence_name>

owner , sequence_name

Explanation

The current user must be the owner. The sequence name must identify a sequence of the current user.

The metadata of the sequence is removed from the catalog.


CREATE SYNONYM statement (SAP Library - SAP DB)

 Entering content frame

CREATE SYNONYM statement

The CREATE SYNONYM statement defines a synonym (alternative name) of a table name .

Syntax

<create_synonym_statement> ::= CREATE [PUBLIC] SYNONYM [<owner>.]<synonym_name> FOR <table_name>

owner , synonym_name , table_name

Explanation

The table name must not denote a temporary base table (see Table ). The user must have a privilege for the specified table. The current user must be the owner.

The synonym name can be specified anywhere instead of the table name. This has the same effect as specifying the table name for which the synonym was defined.

PUBLIC

If PUBLIC is specified, the synonym name must not be identical to the name of a synonym defined with PUBLIC. A synonym is generated that can be accessed by all users.

If PUBLIC is not specified, a private synonym is generated that is only known by the current user. In this case, the synonym name must not be identical to the name of an existing base table, view table, or a private synonym of the current user. If a synonym with the same name and the PUBLIC attribute exists, it cannot be accessed by the current user until the private synonym has been dropped.


DROP SYNONYM statement (SAP Library - SAP DB)

 Entering content frame

DROP SYNONYM statement

The DROP SYNONYM statement drops a synonym (alternative name) of a table name .

Syntax

<drop_synonym_statement> ::= DROP [PUBLIC] SYNONYM [<owner>.]<synonym_name>

owner , synonym_name

Explanation

The specified synonym name must identify an existing synonym of the current user.

If PUBLIC is specified, the synonym identified by the synonym name must be defined as PUBLIC.

The synonym definition is removed from the set of table name synonyms available to the user.


RENAME SYNONYM statement (SAP Library - SAP DB)

 Entering content frame

RENAME SYNONYM statement

The RENAME SYNONYM statement changes the name of a synonym .

Syntax

<rename_synonym_statement> ::= RENAME [PUBLIC] SYNONYM <old_synonym_name> TO <new_synonym_name>

old/new_ synonym_name

Explanation

The old synonym name must have been generated by the current user.

If PUBLIC is specified, the old must be defined as PUBLIC.

A table of the current user with the new synonym name must not exist already.


CREATE VIEW Statement (create_view_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE VIEW Statement (create_view_statement)

The CREATE VIEW statement defines a view table (see Table). A view table never actually exists physically. Instead, it is formed from the rows of the underlying base table(s) when this view table is specified in an SQL statement.

Syntax

<create_view_statement> ::= CREATE [OR REPLACE] VIEW <table_name> [(<alias_name>,...)] AS <query_expression> [WITH CHECK OPTION]

table_name, alias_name, query_expression

Explanation

When the CREATE VIEW statement is executed, metadata that describes the view table is stored in the catalog.

The view table is always identical to the table that would be obtained as the result of the QUERY expression. The QUERY expression must not contain a parameter specification. The QUERY expression must not reference a temporary table or a result table name.

The table expressions of the QUERY specification in the QUERY statement of the CREATE VIEW statement must not contain a QUERY expression.

If a column selected by the QUERY statement is of the data type LONG, the FROM clause must contain exactly one table name that is based on exactly one base table.

The user must have the SELECT privilege for all columns occurring in the view definition. The user is the owner of the view table and has at least the SELECT privilege for it. The user may grant the SELECT privilege for any columns in the view table derived from columns for which the user is authorized to grant the SELECT privilege to others. The user has the INSERT, UPDATE, or DELETE privilege when he has the corresponding privileges for the tables on which the view table is based, and when the view table is updateable. The user may only grant these privileges to others if he or she is authorized to grant the corresponding privilege for all tables on which the view table is based.

OR REPLACE

If OR REPLACE is not specified, the table name must not be identical to the name of an existing view table.

If OR REPLACE is specified, the table name may be identical to the name of an existing view table. In this case, the definition of the existing view table is replaced by the new definition. The database system then attempts to adapt privileges granted for the existing view table to the new view definition, with the result that the privileges for the view table usually remain unchanged. Privileges are only removed implicitly if conflicts occur that cannot be resolved by the database system. If there are major discrepancies between the two view definitions, the CREATE VIEW statement may fail in the following case: the CREATE VIEW statement of a view table based on the existing view table cannot be executed correctly for the new view definition.

Alias names (alias_name)

The column names of the view table must be unique. Otherwise, alias names must be specified for the result table generated by the QUERY expression. The number of alias names must be equal to the number of columns in the result table generated by the QUERY expression. If no alias names are specified, the column names of the result table generated by the QUERY expression are applied to the view table. The column descriptions for the view table are taken from the corresponding columns in the query expression. The FROM clause of the QUERY expression can contain one or more tables.

WITH CHECK OPTION

If the create view statement contains a WITH CHECK OPTION, the owner of the view table must have the INSERT, UPDATE, or DELETE privilege for the view table.

Specifying WITH CHECK OPTION has the effect that the insert statement or update statement issued on the view table does not create any rows that could not be selected subsequently via the view table; i.e. the search condition of the view table must be true for any resulting rows.

The CHECK OPTION is inherited; i.e. if a view table V was defined WITH CHECK OPTION and V occurs in the from clause of an updateable view table V1, only those rows that can be selected using V can be inserted or altered using V1.

Further terms and information

· Complex View Table

· Updateable View Table

· INSERT Privilege for Owners of the View Table

· UPDATE Privilege for Owner of the View Table

· DELETE Privilege for Owner of the View Table

· Updateable Join View Table


Complex view table (SAP Library - SAP DB)

 Entering content frame

Complex view table

A view table (see CREATE VIEW statement ) is a complex view table if it satisfies one of the following conditions:

  • The definition of the view table contains DISTINCT or GROUP BY or HAVING.
  • The CREATE VIEW statement contains EXCEPT, INTERSECT, or UNION.
  • The search condition in the QUERY expression of the CREATE VIEW statement contains a subquery .
  • The CREATE VIEW statement contains an outer join, that is an OUTER JOIN indicator in a JOIN predicate of the search condition.


Updateable View Table (SAP Library - SAP DB)

 Entering content frame

Updateable View Table

A view table (see CREATE VIEW statement ) is called updateable if it is not a complex view table , and if it is not based on a complex view table.

For join view tables, that is, view tables whose FROM clause contains more than one table or join table, the following additional conditions must be satisfied:

  • Each base table on which the view table is based has a key defined by the user.
  • Referential CONSTRAINT definitions must exist between the base tables on which the view table is based.
  • One of the base tables, on which the view table is based, is not a referenced table of a referential CONSTRAINT definition for a different base table of the view table. This table is the key table of the view table.
  • For each base table on which the view table is based, there is a sequence of referential CONSTRAINT definitions so that the respective base table can be accessed from the key table.
  • The referential CONSTRAINT definitions must be reflected as a JOIN predicate in the search condition of the CREATE VIEW statement, that is, the condition "key column = foreign key column" must exist for every column in each referential CONSTRAINT definition.
  • The CREATE VIEW statement must contain either the primary key or foreign key column from each referential CONSTRAINT definition as the selected column , but not both.
  • The view table must be defined with WITH CHECK OPTION.


INSERT Privilege for the Owner of the View Table (SAP Library - SAP DB)

 Entering content frame

INSERT Privilege for the Owner of the View Table

The owner of the view table (see CREATE VIEW statement) has the INSERT privilege. This means that he or she can specify the view table as the insert table in the INSERT statement, if the following conditions are satisfied:

· The view table can be updated (updateable view table).

· The owner of the view table has the INSERT privilege for all tables in the FROM clause of the CREATE VIEW statement.

· The selected columns of the CREATE VIEW statement consist of table columns or column names, but they do not consist of expressions with more than one column name.

· The CREATE VIEW statement contains every mandatory column from all tables of the FROM clause as the selected column.


UPDATE privilege for the owner of the view table (SAP Library - SAP DB)

 Entering content frame

UPDATE privilege for the owner of the view table

The owner of the view table (see CREATE VIEW statement ) has the UPDATE privilege for a column in the view table, i.e. he or she can specify the column as a the column to be updated in an UPDATE statement if the following conditions are satisfied:

  • The view table is updateable ( updateable view table ).
  • The owner of the view table has the UPDATE privilege for the table columns or the column name that defines the column.
  • The column is defined by specifying table columns or by means of a column name, but not by an expression with more than one column name.


DELETE privilege for the owner of the view table (SAP Library - SAP DB)

 Entering content frame

DELETE privilege for the owner of the view table

The owner of the view table (see CREATE VIEW statement ) has the DELETE privilege for the view table, i.e. he or she can specify the view table as a table in which entries are to be deleted in the DELETE statement if the following conditions are satisfied:

  • The view table is updateable ( updateable view table ).
  • The owner of the view table has the DELETE privilege for all tables in the FROM clause of the CREATE VIEW statement.


Updateable join view table (SAP Library - SAP DB)

 Entering content frame

Updateable join view table

It is assumed that the definition of the join table V (see CREATE VIEW statement ) in the FROM clause contains the base tables T1,...,Tn (n>1).

  • Let Ti and Tj be two base tables selected by V. Let Rij be a referential CONSTRAINT definition of Ti and Tj in which Ti is the referencing table and Tj the referenced table.
    Let PKj1,...,PKjm be the key columns of Tj.
    Let Fki1,...,Fkim be the corresponding foreign key columns of Ti.
    The referential CONSTRAINT definition is relevant for V if the     JOIN predicate (PKj1=Fki1 AND ... AND PKjm=FKjm) is part of the search condition of V.
  • Let Ti and Tj be two base tables selected by V and Rij a referential CONSTRAINT definition of Ti and Tj that is relevant for V.
    Ti is the predecessor of Tj (Ti<Tj) if Rij is the only referential CONSTRAINT definition of Ti and Tj that is relevant for V.
  • Let Rij be a referential CONSTRAINT definition that is relevant for V.
    Rij defines a 1 : 1 relationship between Ti and Tj if the foreign key columns of Rij make up the key columns of Tj.
  • Let Rij be a referential CONSTRAINT definition that is relevant to V and s a key column of Tj or a foreign key column of this referential CONSTRAINT definition of Ti. The column s can be derived from V if exactly one of the following conditions is satisfied:
    - s is a     selected column of V.
    – a key column or a foreign key column s' of a referential CONSTRAINT definition that is relevant to V exists that can be derived from V and the JOIN predicate s=s' is part of the search condition of V.
  • A column v of V corresponds to a column s of a base table T if one of the following conditions is satisfied
    - v is the ith column of V and s is the ith selected column of V
    - v corresponds to a key column PK of Tj of a referential CONSTRAINT definition Rij that is relevant to V and s is the foreign key column of Ti that is assigned to PK
    - v corresponds to a foreign key column FK of Ti of a referential CONSTRAINT definition Rij that is relevant to V and s is the key column of Tj that is assigned to FK.

A join view table V is updateable if the following conditions are satisfied:

  • Each base table Ti (1 <= i <= n) has a key defined by the user.
  • The database system must be able to determine a processing sequence for the underlying base tables; i.e. an order Ti1,…,Tin of the tables T1,…,Tn must exist so that j < k can be deduced from Tij<Tik. The columns of V from which the key columns of Ti1 can be derived make up the key of V. Ti1 is called the key table of V. The order of the tables does not have to be unique.
  • Starting with a row in the key table of V, it must be possible to assign each underlying base table exactly one row; that is, there is a sequence of tables Ti1,...,Tij for each table Tij (1 <= j <= n) such that Ti1 < .. < Tij
    This sequence is unique for each base table referred to by V.
  • It must be possible to derive the key columns and foreign key columns of all referential CONSTRAINT definitions relevant to V from the columns of V.
  • The join predicates needed to recognize the relevance of a referential CONSTRAINT definition must be specified in parts of the search condition defined with the WITH CHECK OPTION. If the view definition only contains base tables, this means that the view table must be defined WITH CHECK OPTION. If a view table V is derived from a view table V' and if V' was defined WITH CHECK OPTION, then V inherits the CHECK OPTION for the part of the qualification passed on by V'.


DROP VIEW statement (SAP Library - SAP DB)

 Entering content frame

DROP VIEW statement

The DROP VIEW statement drops a view table (see Table ).

Syntax

<drop_view_statement> ::= DROP VIEW <table_name> [<cascade_option>]

table name , cascade option

Explanation

The table name must identify an existing view table.

The user must be the owner of the specified view table.

The metadata of the view table and all dependent synonyms , view tables, and privilege s are dropped. The tables on which the view table was created remain unaffected.

If the CASCADE option RESTRICT is specified and other view tables or synonyms based on this view table exist, the drop view statement will fail.


RENAME VIEW statement (SAP Library - SAP DB)

 Entering content frame

RENAME VIEW statement

A RENAME VIEW statement changes the name of a view table (see Table ).

Syntax

<rename_view_statement> ::= RENAME VIEW <old_table_name> TO <new_table_name>

<old_table_name> ::= <table_name>
<new_table_name> ::= <table_name>
 table_name

Explanation

The old_table_name must be a view table. The current user must be the owner of the view table.

The new_table_name must not yet be used for a table of the current user.

The CREATE VIEW statement of the old_table_name view table is adapted to the new name. The result of this adaptation can be retrieved from the table DOMAIN.VIEWDEFS.

The definitions of view tables based on the old_table_name are adapted to the new name.


CREATE INDEX Statement (create_index_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE INDEX Statement (create_index_statement)

The CREATE INDEX statement creates an index of a base table (see table).

Syntax

<create_index_statement> ::=
CREATE [UNIQUE] INDEX <index_name> ON <table_name> (<column_name> [ASC|DESC],...)

table_name, column_name, index_name

Explanation

Indexes provide access to the table data using non-key columns. Maintaining these indexes, however, can be quite complex in the case of an INSERT, UPDATE, or DELETE statement.

The index is created across the specified table columns. The secondary key consists of the specified columns of the table, in the specified order.

· The specified table must be an existing base table, and not a temporary table. The index name must not be identical with an existing index name of the table.

· The column defined by the column name must be a column in the specified table. This column must not be a LONG column. All of the column name pairs must be different.

· The current user must have the INDEX privilege type for the columns.

· Restrictions

UNIQUE

If UNIQUE is specified, the database system ensures that no two rows of the specified table have the same values in the indexed columns. In this way, if two rows both contain the NULL value for all columns of an index, the two index values are not considered to be identical. If there is not at least one column that does not contain the NULL value, two rows that have the same value in all non-NULL columns are considered to be identical.

ASC | DESC

The index values are stored in ascending or descending order. If the specification of ASC or DESC is omitted, ASC is implicitly assumed.


DROP INDEX Statement (drop_index_statement) (SAP Library - SAP DB)

 Entering content frame

DROP INDEX Statement (drop_index_statement)

The DROP INDEX statement drops an index for a base table (see table ). The metadata of the index is dropped from the database catalog. The storage space occupied by the index is released.

Syntax

<drop_index_statement> ::= DROP INDEX <index_name> [ON <table_name>]

index_name , table_name

Explanation

The specified index must exist and the specified table name must be the name of an existing base table.

ON <table name> is not necessary if the index name identifies an index unambiguously.

The current user must be the owner of the specified table or have the INDEX privilege for it.


ALTER INDEX Statement (alter_index_statement) (SAP Library - SAP DB)

 Entering content frame

ALTER INDEX Statement (alter_index_statement)

The ALTER INDEX (alter_index_statement) statement determines how an index is used in data queries.

Syntax

<alter_index_statement> ::= ALTER INDEX <index_name> [ON <table_name>] ENABLE
| ALTER INDEX <index_name> [ON <table_name>] DISABLE
| ALTER INDEX <index_name> [ON <table_name>] INIT USAGE

index_name , table_name

Explanation

When a CREATE INDEX statement is executed, an index is generated across the specified columns. This index is modified accordingly for all of the following SQL statements for data manipulation ( INSERT statement , UPDATE statement , DELETE statement ). With all other SQL statements in which individual rows in a table are specified, the database system can use this index to speed up the search for these rows.

ALTER INDEX … DISABLE

The index can no longer be used for this search, however it continues to be changed by the use of the SQL statements INSERT, UPDATE, or DELETE.

ALTER INDEX … ENABLE

The index can be used for the search again.

ALTER INDEX … INIT USAGE

The column INDEX_USED in the system table DOMAIN.INDEXES is initialized with 0; that is, the count of how often an index is used is restarted.


RENAME INDEX statement (SAP Library - SAP DB)

 Entering content frame

RENAME INDEX statement

The RENAME INDEX statement changes the name of an index .

Syntax

<rename_index_statement> ::= RENAME INDEX <old_index_name> [ON <table_name>] TO <new_index_name>

<old_index_name> ::= <index_name>
<new_index_name> ::= <index_name>

table_name , index_name

Explanation

The specified table name must be the name of an existing base table (see table ).

The index identified by the old_index_name must exist. ON <table_name> is not necessary if this index is unique.

The current user must be the owner of the specified table or have the INDEX privilege for it.

The new index name must not be identical to an existing index name for the table.


COMMENT ON Statement (comment_on_statement) (SAP Library - SAP DB)

 Entering content frame

COMMENT ON Statement (comment_on_statement)

The COMMENT ON statement ( comment_on_statement) creates, alters, or drops a comment for a database object stored in the database catalog.

Syntax

<comment_on_statement> ::= COMMENT ON <object_spec> IS <comment>

<object_spec> ::= see explanation
<comment> ::= <string_literal> | <parameter_name>

string_literal, parameter_name

Explanation

Comments can be specified for the following database objects:

<object_spec> ::= | Explanation
COLUMN <table_name>.<column_name> table_name, column_name | The column must exist in the specified table. The current user must be the owner of the table. The comment for this column can be interrogated by selecting the system table DOMAIN. COLUMNS.
DBPROC[EDURE] <dbproc_name> dbproc_name | dbproc_name must identify an existing database procedure whose owner is the current user. A comment is stored for the DB procedure. The comment can be interrogated by selecting the system table DOMAIN. DBPROCEDURES.
DOMAIN <domain_name> domain_name | domain_name must specify a domain of the current user. The comment for this domain can be interrogated by selecting the system table DOMAIN. DOMAINS.
FOREIGN KEY <table_name>.<referential_constraint_name> referential constraint name | referential_constraint_name must specify a referential CONSTRAINT definition for the specified table of the current owner. The comment for this referential CONSTRAINT definition can be interrogated by selecting the system table DOMAIN. FOREIGNKEYS.
INDEX <index_name> ON <table_name> index_name | index_name must specify an index of the specified table. The current user must be the owner of the table. The comment for this index can be interrogated by selecting the system table DOMAIN. INDEXES.
SEQUENCE <sequence_name> sequence_name | An existing sequence must be specified using sequence_name. The current user must be the owner of the sequence. The comment for this sequence can be interrogated by selecting the system table DOMAIN. SEQUENCES.
[PUBLIC] SYNONYM <synonym_name> synonym_name | synonym_name must specify a synonym of the current user. If PUBLIC is specified, the synonym must have the PUBLIC attribute. The comment for this synonym can be interrogated by selecting the system table DOMAIN. SYNONYMS.
TABLE <table_name> table_name | The specified table must identify a base or view table of the current user that is not a temporary table. The comment for this table can be interrogated by selecting the system table DOMAIN.TABLES.
TRIGGER <trigger_name>.<table_name> trigger_name | The specified trigger name must identify a trigger of the specified table. The current user must be the owner of the table. A comment is stored for the trigger. The comment can be interrogated by selecting the system table DOMAIN. TRIGGERS.
USER <user_name> user_name | The specified user must identify an existing user whose owner is the current user. The comment for this user can be interrogated by selecting the system table DOMAIN.USERS.
USERGROUP <usergroup_name> usergroup_name | The specified user group must identify an existing user group whose owner is the current user. The comment for this user group can be interrogated by selecting the system table DOMAIN. USERS.
<parameter_name> parameter_name | The corresponding variable must contain one of the values listed in the table. The values must be encapsulated in quotation marks. Example of specifying the corresponding variables: 'COLUMN <table_name>.<column_name>'


CREATE DBPROC Statement (create_dbproc_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE DBPROC Statement (create_dbproc_statement)

The CREATE DBPROC statement ( create_dbproc_statement) defines a database procedure.

Syntax

<create_dbproc_statement> ::= CREATE DBPROC <procedure_name> [(<formal_parameter>,..)] [RETURNS CURSOR] AS <routine>

<formal_parameter> ::=
  IN <argument> <data_type>
| OUT <argument> <data_type>
| INOUT <argument> <data_type>

<argument> ::= <identifier>

procedure_name, data_type, identifier, routine

The database procedure determines the average price for single rooms in hotels that are located within the specified zip code range.

CREATE DBPROC avg_price (IN zip CHAR(5), OUT avg_price FIXED(6,2)) AS
VAR sum FIXED(10,2); price FIXED(6,2); hotels

INTEGER;
TRY
SET sum = 0; SET hotels = 0;
SELECT price FROM travel.room,travel.hotel WHERE zip = :zip

AND
room.hno = hotel.hno AND roomtype = 'SINGLE';
WHILE $rc = 0 DO BEGIN
FETCH INTO :price;
SET sum = sum + price;
SET hotels = hotels + 1;
END;
CATCH
IF $rc <> 100 THEN STOP ($rc, 'unexpected error');
IF hotels > 0 THEN SET avg_price = sum / hotels
ELSE STOP (100, 'no hotel found');

Explanation

A database procedure is a subroutine that runs on the SAP DB server. SAP DB provides a language (special SQL syntax that has been extended to include variables, control structures, and troubleshooting measures) that can be used to define database procedures and triggers.

The current user is the owner of a database procedure. He or she has the EXECUTE privilege to execute the procedure.

Parameter

When an application invokes the database procedure with the CALL statement, it exchanges data via parameters that are defined by means of the formal parameters. A formal parameter of the database procedure usually corresponds to a variable in the application.

IN | OUT | INOUT

The parameter mode (IN | OUT | INOUT) specifies the direction in which the data is transferred when the procedure is invoked.

IN: defines an input parameter, i.e. the value of the variable is transferred to the database procedure when the procedure is invoked.

OUT: defines an output parameter, i.e. the value of the formal parameter is transferred from the database procedure to the variable after the procedure has terminated.

INOUT: defines an input/output parameter that combines the IN and OUT functions.

Argument

By specifying an argument, you assign a name to a formal parameter of the database procedure. This parameter name can then be used as a variable in expressions and assignments in the database procedure.

Data Type

Only BOOLEAN, CHAR[ACTER], DATE, FIXED, FLOAT, INT[EGER], NUMBER, REAL, SMALLINT, TIME, TIMESTAMP, and VARCHAR can be used as the data type of a formal parameter of a database procedure.

RETURNS CURSOR

If RETURNS CURSOR is specified, a database procedure is defined that returns a results table when called.

The name of this table is defined using the system variable $CURSOR. There must therefore be a statement in the database procedure that generates a results table with the result set name $CURSOR.

The value of $CURSOR is already assigned by most programming language embeddings, but can also be explicitly assigned in the database procedure.

CREATE DBPROC hotels_of_town (IN zip CHAR(5))
RETURNS CURSOR AS
$CURSOR = 'HOTEL_CURSOR';
DECLARE :$CURSOR CURSOR FOR
SELECT * FROM travel.hotel WHERE zip = :zip;

Further information

routine


routine (SAP Library - SAP DB)

 Entering content frame

routine

The part of the CREATE DBPROC or CREATE TRIGGER-statement referred to as the routine is the implementation of the database procedure or trigger . . It consists of optional variable declarations and statements.

Syntax

<routine> ::= [<local_variables>] <statement_list>;

<local_variables> ::=VAR <local_variable_list>;
<local_variable_list> ::= <local_variable> | <local_variable_list>; <local_variable>
<local_variable> ::= <variable_name> <data_type>
<variable_name> ::= <identifier>

<statement_list> ::= <statement> | <statement_list> ; <statement>

identifier , data_type , statement

Explanation

Variables

The local variables of the database procedure must be declared explicitly by specifying a data type before they are used. Only BOOLEAN, CHAR[ACTER], DATE, FIXED, FLOAT, INT[EGER], NUMBER, REAL, SMALLINT, TIME, TIMESTAMP, and VARCHAR are permitted as data types data types . Once they have been declared, the variables can be used in any SQL and other statements.

Every database procedure has the variables $RC, $ERRMSG, and $COUNT implicitly.

The $RC variable returns a numeric error code after an SQL statement has been executed. The value 0 means that the SQL statement was successfully executed.
In parallel with $RC, the $ERRMSG variable returns an explanation of the error containing a maximum of 80 characters.
The number of lines processed in an SQL statement is indicated by the $COUNT variable.

Variables can be assigned a value with the assignment_statement (see statement ).

Restrictions

The statement list must not contain more than 255 SQL statements.


statement (SAP Library - SAP DB)

 Entering content frame

statement

statement is a syntax element that is used in a routine. The statements specified in the statementsyntax description can be used to define a database procedure (see CREATE DBPROC statement) or trigger (see CREATE TRIGGER statement).

Syntax

<statement> ::= BEGIN <statement_list> END | BREAK | CONTINUE | CONTINUE EXECUTE
| <if_statement> | <while_statement> | <assignment_statement> | <case_statement>
| RETURN
| STOP (<expression> [,<expression>] )
| TRY <statement_list>; CATCH <statement>
| <routine_sql_statement>

<statement_list> ::= <statement> | <statement_list> ; <statement>

<if_statement> ::= IF <search_condition> THEN <statement>

[ELSE <statement>]
<while_statement> ::= WHILE <search_condition> DO

<statement>
<assignment_statement> ::= [SET] <variable_name> =

<expression>
<case_statement> ::= <simple_case_statement> |

<searched_case_statement>

<routine_sql_statement> ::=
  <call_statement> | <close_statement> | <create_table_temp> | <drop_table_temp>
| <declare_cursor_statement> | <delete_statement> | <fetch_statement>
| <insert_statement> | <lock_statement>
| <select_statement> | <named_select_statement> | <single_select_statement>
| <subtrans_statement> | <update_statement>

<variable_name> ::= <identifier>

<create_table_temp> :: = <create_table_statement> for creating temporary tables, that is, the table_name in the CREATE TABLE statement must have the format TEMP.<identifier>.

<drop_table_temp> ::= DROP TABLE TEMP.<identifier>

expression, search_condition, simple_case_statement, searched_case_statement, call_statement, close_statement, create_table_statement, declare_cursor_statement; delete_statement, fetch_statement, insert_statement, lock_statement, select_statement, named_select_statement, single_select_statement, subtrans_statement, update_statement, identifier

Explanation

Variables specified in a routine can be assigned a value with the assignment statement.

Control Structures

The IF statement first evaluates the search condition. If this is fulfilled, the statement specified in the THEN branch is executed. Otherwise, the statement in the ELSE branch (if defined) is executed.

The WHILE statement enables statements to be repeated in response to certain conditions. The statement is executed as long as the specified search condition is true. The condition is checked, in particular, before the statement is executed for the first time. This means that the statement may not be executed at all. By specifying BREAK, you can exit the loop straight away, without checking the condition. If CONTINUE is specified in the loop, the condition is re-evaluated immediately and the loop is processed again or exited, depending on the result.

The CASE statement (case_statement) allows the conditional execution of a statement, dependent on search conditions or the equality of operators. There are simple and general CASE statements.

Specifying RETURN allows an immediate error-free exit of the surrounding database procedure.

Troubleshooting

If an SQL error occurs in the statement list between TRY and CATCH, the system branches directly to the statement that follows CATCH. The actual troubleshooting routine can be programmed in this statement. If CONTINUE EXECUTE is executed here, the system jumps directly to the point after the statement that triggered the error.

The database procedure is interrupted immediately when the STOP function is invoked. The value of the first parameter of the STOP function is the return or error message that the application receives as the result of the database procedure call. An error text can also be returned.

SQL Statements (routine_sql_statement)

The tables in the SQL statements of the database procedure must always be complete, that is, with the owner specified. In the case of SELECT statements, a full statement of the table name in the FROM clause is sufficient.

Restrictions

The statement list must not contain more than 255 SQL statements.

The length of an SQL statement (routine sql statement) must not exceed approximately 8 KB.


General CASE Statement (searched_case_statement) (SAP Library - SAP DB)

 Entering content frame

General CASE Statement (searched_case_statement)

The general CASE statement (searched_case_statement) is a syntax element that is used in a statement . You can use the general CASE statement to define a database procedure (see CREATE DBPROC statement ) or a trigger (see CREATE TRIGGER statement ).

Syntax

<searched_case_statement> ::= CASE
<searched_case_when_clause>...
[<case_else_clause>]
END [CASE]

<searched_case_when_clause> ::= WHEN <search_condition> THEN <statement>
<case_else_clause> ::= ELSE <statement>

search_condition , statement

Explanation

Variables specified in a routine can be assigned a value with a statement.

Control Structures

A CASE statement (case_statement) allows the conditional execution of a statement, dependent on search conditions or the equality of operators.

In the case of a general CASE statement (searched_case_statement), the first fulfilled search condition is determined, the associated statement executed, and the CASE statement ends.

CASE
WHEN digit = 0 THEN toCHAR = 'zero';
WHEN digit = 1 THEN toCHAR = 'one';
WHEN digit = 2 THEN toCHAR = 'two';
WHEN digit = 3 THEN toCHAR = 'three';
WHEN digit = 4 THEN toCHAR = 'four';
WHEN digit = 5 THEN toCHAR = 'five';
WHEN digit = 6 THEN toCHAR = 'six';
WHEN digit = 7 THEN toCHAR = 'seven';
WHEN digit = 8 THEN toCHAR = 'eight';
WHEN digit = 9 THEN toCHAR = 'nine';
ELSE STOP(-29000, 'no digit');
END CASE

In a CASE statement, if no matching literal or fulfilled search condition exists, the statement in the ELSE branch is executed.

If there is no ELSE branch, runtime error -28901 is returned.

See also:

Simple CASE statement (simple_case_statement)


Simple CASE Statement (simple_case_statement) (SAP Library - SAP DB)

 Entering content frame

Simple CASE Statement (simple_case_statement)

The simple CASE statement (simple_case_statement) is a syntax element that is used in a statement . You can use the simple CASE statement to define a database procedure (see CREATE DBPROC statement ) or a trigger (see CREATE TRIGGER statement ).

Syntax

<simple_case_statement> ::= CASE <expression>
<simple_case_when_clause>...
[<case_else_clause>]
END [CASE]

<simple_case_when_clause> ::= WHEN <literal>[ ...] THEN <statement>
<case_else_clause> ::= ELSE <statement>

expression , literal , statement

Explanation

Variables specified in a routine can be assigned a value with a statement.

Control Structures

A CASE statement (case_statement) allows the conditional execution of a statement, dependent on search conditions or the equality of operators.

In the case of a simple CASE statement (simple_case_statement), the expression is compared with the literals. If the expression matches a literal, the associated statement is executed and the CASE statement ends.

CASE digit
WHEN 0 THEN toCHAR = 'zero';
WHEN 1 THEN toCHAR = 'one';
WHEN 2 THEN toCHAR = 'two';
WHEN 3 THEN toCHAR = 'three';
WHEN 4 THEN toCHAR = 'four';
WHEN 5 THEN toCHAR = 'five';
WHEN 6 THEN toCHAR = 'six';
WHEN 7 THEN toCHAR = 'seven';
WHEN 8 THEN toCHAR = 'eight';
WHEN 9 THEN toCHAR = 'nine';
ELSE STOP(-29000, 'no digit');
END CASE

In a CASE statement, if no matching literal or fulfilled search condition exists, the statement in the ELSE branch is executed.

If there is no ELSE branch, runtime error -28901 is returned.

See also:

General CASE Statement (searched_case_statement)


DROP DBPROC statement (SAP Library - SAP DB)

 Entering content frame

DROP DBPROC statement

The DROP DBPROC statement drops a database procedure .

Syntax

<drop_dbproc_statement> ::= DROP DBPROC <dbproc_name>

dbproc_name

Explanation

The specified database procedure name must identify an existing database procedure of the current user.

The metadata of the database procedure is dropped.


CREATE TRIGGER Statement (create_trigger_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE TRIGGER Statement (create_trigger_statement)

The CREATE TRIGGER statement defines a trigger for a base table (see Table).

Syntax

<create_trigger_statement> ::= CREATE TRIGGER <trigger_name> FOR <table_name>
AFTER <trigger_event,..> EXECUTE (<routine>) [WHENEVER <search_condition> ]

<trigger_event> :: INSERT | UPDATE [(<column_list>)] | DELETE
<column_list> ::= <column_name> | <column_list>,<column_name>

trigger_name, table_name, search_condition, routine, column_name

The trigger ensures that the hotel number in the roomtable is also changed when a hotel number is changed in the hotel table.

CREATE TRIGGER hotel_update FOR hotel AFTER UPDATE EXECUTE (
TRY
  IF NEW.hno <> OLD.hno
  THEN UPDATE travel.room SET hno = :NEW.hno WHERE hno = :OLD.hno;
CATCH
  IF $rc <> 100
  THEN STOP ($rc, 'unexpected error');
)

Explanation

A trigger is a special type of database procedure that is assigned to a base table. This database procedure cannot be executed explicitly with the CALL statement, but rather automatically by SAP DB when defined events (trigger events) for the table occur.

SAP DB provides a language (special SQL syntax that has been extended to include variables, control structures, and troubleshooting measures) that can be used to define database procedures and triggers.

The specified synonym name must identify an existing base table of the current user.

Trigger Event

The trigger event defines what triggers the trigger. The trigger is always invoked if the triggering event has been processed correctly.

INSERT: the INSERT trigger event causes the trigger to be executed for each row inserted in the table.

UPDATE: the UPDATE event causes the trigger to be executed for each modification made to a row in the table. If a column list is specified, the trigger is only called if one of the columns in the column list was modified.

DELETE: the DELETE trigger event causes the trigger to be executed for every row deleted from the table.

A maximum of one trigger can be defined for each trigger event in each table.

Trigger Routine

Each INSERT trigger implicitly has a corresponding variable NEW.<column_name> for each column in the table. When the trigger is executed, this variable has the value of the corresponding column in the inserted row. It is only permissible to specify NEW for SQL statements specified in routine_sql_statements. Specifying NEW for the other statements leads to an error.

Each UPDATE trigger implicitly has a corresponding variable NEW.<column name> and OLD.<column name> for each column in the table. When the trigger is executed, the OLD.<column_name> variable has the value of the corresponding column in front of and NEW.<column_name> after the change in the row. Specifying NEW and OLD is optional.

Each DELETE trigger implicitly has a corresponding variable OLD.<column_name> for each column in the table. When the trigger is executed, this variable has the value of the corresponding column in the deleted row. It is only permissible to specify OLD for SQL statements specified in routine_sql_statements. Specifying OLD for the other statements leads to an error.

:NEW and :OLD must always be used with a colon in SQL statements that are used in triggers and that belong to the routine_sql_statements
(For example: UPDATE travel.room SET hno = :NEW.hno WHERE hno = :OLD.hno).

NEW and OLD must always be used without a colon in SQL statements that are used in triggers and that do not belong to the routine_sql_statements
(For example: IF NEW.hno <> OLD.hno).

See also:

routine

If the trigger is terminated by STOP with an error number not equal to zero, the entire SQL statement that triggered the trigger fails.

The SUBTRANS statement is not allowed in a trigger.

If a WHENEVER statement is specified, the trigger is only executed if the search condition is fulfilled. The condition must not contain a subquery nor any set functions.


DROP TRIGGER statement (SAP Library - SAP DB)

 Entering content frame

DROP TRIGGER statement

A DROP TABLE statement deletes a trigger for a table.

Syntax

<drop_trigger_statement> ::= DROP TRIGGER <trigger_name> OF <table_name>

trigger_name , table_name

Explanation

The specified table name must identify an existing table of the current user.

The specified trigger name must identify an existing trigger of the table.

The metadata of the trigger is dropped.


Authorization (SAP Library - SAP DB)

 Entering content frame

Authorization

SQL statements for authorization

CREATE USER statement | DROP USER statement | ALTER USER statement RENAME USER statement GRANT USER statement
CREATE USERGROUP statement | DROP USERGROUP statement | ALTER USERGROUP statement RENAME USERGROUP statement GRANT USERGROUP statement
CREATE ROLE statement | DROP ROLE statement |
ALTER PASSWORD statement | GRANT statement | REVOKE statement


CREATE USER Statement (create_user_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE USER Statement (create_user_statement)

The CREATE USER statement ( create_user_statement) defines a user. The existence and the properties of the user are recorded in the database catalog in the form of metadata.

Syntax

<create_user_statement> ::= CREATE USER <user_name> PASSWORD <password>
[<user_mode>]
[TIMEOUT <unsigned_integer>] [COSTWARNING <unsigned_integer>] [COSTLIMIT <unsigned_integer>] [[NOT] EXCLUSIVE] [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]
| CREATE USER <user_name> PASSWORD <password> LIKE <source_user>
| CREATE USER <user_name> PASSWORD <password> USERGROUP <usergroup_name>

user_name, user_mode, unsigned_integer, usergroup_name

Explanation

The current user must be a DBA user. The user is the owner of the created user.

The specified user name must not be identical to the name of an existing user, user group, or role.

The password ( password) must be specified when an database session is started. It ensures that only authorized users can access the database system.

Unsigned integers ( unsigned_integer) must always be greater than 0.

Unlimited disk space is available to the user for the storage of his or her private and temporary tables (in the context of the sizes specified for the data volumes during the installation).

TIMEOUT

The Timeout value is specified in seconds and must be between 30 and 32400.

Only the SYSDBA user can define users with the timeout value 0.

COSTWARNING/COSTLIMIT

COSTWARNING and COSTLIMIT limit costs by preventing users from executing query statements or insert statements in the form of INSERT...SELECT... beyond a specified degree of complexity.

Before these SQL statements are executed, the costs expected to result from this statement are estimated. This SELECT costs estimate can be output with the EXPLAIN statement. In interactive mode, the estimated SELECT cost value is compared with the COSTWARNING and COSTLIMIT values specified for the user.

The COSTWARNING and COSTLIMIT values are ignored with query statements or insert statements in the form INSERT...SELECT... which are embedded in a programming language.

COSTWARNING: specifies the estimated SELECT cost value beyond which the user receives a warning. In this case, the user is asked whether the SQL statement is to be executed.

COSTLIMIT: specifies the estimated SELECT cost value beyond which the SQL statement is not executed.

The COSTLIMIT value must be greater than the COSTWARNING value.

EXCLUSIVE

EXCLUSIVE: prevents the user from opening two different database sessions simultaneously.

NOT EXCLUSIVE: allows the user to open several database sessions simultaneously.

If the EXCLUSIVE condition is not specified, EXCLUSIVE is assumed implicitly (without NOT).

DEFAULTCODE <ASCII | EBCDIC | UNICODE>

The value of the database parameter DEFAULT_CODE is overridden with the code attribute specified in DEFAULTCODE for the objects of the specified user.

LIKE

The current user must have owner authorization over the source user ( source_user).

If the source user is not a member of a user group, the new user receives the same user class and values for PERMLIMIT, TEMPLIMIT, TIMEOUT, COSTWARNING, COSTLIMIT, and EXCLUSIVE as the source user. The new user receives all the privileges that the source user was granted by other users.

If the source user is a member of a user group, a new member is created in this user group with the new user name.

USERGROUP

The user issuing the SQL statement must be the owner of the specified user group. The new user then becomes a member of this user group.


User mode (SAP Library - SAP DB)

 Entering content frame

User mode

User mode is used to specify the user class or status of the defined user when a user is created ( CREATE USER statement ). The user class specifies the operations that the defined user can execute.

Syntax

<user_mode> ::= DBA | RESOURCE | STANDARD

Explanation

If no user class is specified, the STANDARD class is assumed implicitly.

DBA

The specified user is authorized to define private data and grant privileges for this data to other users. The user can define additional users. DBA status may only be assigned by the SYSDBA that was created when the database system was installed.

RESOURCE

The specified user is authorized to define private data and grant privileges for these objects to other users.

STANDARD

The specified user can only access private data, which was created by other users and for which he or she has the appropriate privileges, as well as view tables, synonyms, and temporary tables.

Dependencies

The user classes are hierarchically ordered as follows:

  • The user class RESOURCE encompasses all the rights of STANDARD users.
  • The user class DBA encompasses all the rights of RESOURCES users.
  • The SYSDBA user can create DBA users. He or she has owner rights over all users. Otherwise, the SYSDBA has the same function and the same rights as a DBA user, i.e. whenever a DBA user is allowed to execute an SQL statement, this also applies to a SYSDBA user.

See also:

Users and user groups

usergroup_mode


CREATE USERGROUP Statement (create_usergroup_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE USERGROUP Statement (create_usergroup_statement)

The CREATE USERGROUP statement ( create_usergroup_statement) defines a user group.

Syntax

<create_usergroup_statement> ::= CREATE USERGROUP <usergroup_name>
[<usergroup_mode>]
[TIMEOUT <unsigned_integer>] [COSTWARNING <unsigned_integer>] [COSTLIMIT <unsigned_integer>] [[NOT] EXCLUSIVE] [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]

usergroup_name, usergroup_mode, unsigned_integer

Explanation

The current user must be a DBA operator.

The specified user group name must not be identical to the name of an existing user, user group, or role.

You can use the CREATE USER statement to define multiple users who belong to this user group. All private objects created by members of the user group are identified by the user group name. The owner of a private object is the group, not the user who created the object. Each user can work with any private object of the group, as if this user were the owner of the object. Privileges can only be granted or revoked from the group. A privilege cannot be granted or revoked from a single member of the group.

Unsigned integers ( unsigned_integer) must always be greater than 0.

Unlimited disk space is available to the user for the storage of his or her private and temporary tables (in the context of the sizes specified for the data volumes during the installation).

TIMEOUT

The Timeout value is specified in seconds and must be between 30 and 32400.

Only the SYSDBA user can define users with the timeout value 0.

COSTWARNING/COSTLIMIT

COSTWARNING and COSTLIMIT limit costs by preventing users in this user group from executing query statements or insert statements in the form of INSERT...SELECT... beyond a specified degree of complexity and that are therefore cost-intensive.

Before these SQL statements are executed, the costs expected to result from this statement are estimated. This SELECT costs estimate can be output with the EXPLAIN statement. In interactive mode, the estimated SELECT cost value is compared with the COSTWARNING and COSTLIMIT values specified for the user.

The COSTWARNING and COSTLIMIT values are ignored with query statements or insert statements in the form INSERT...SELECT... which are embedded in a programming language.

COSTWARNING: specifies the estimated SELECT cost value beyond which the user receives a warning. In this case, the user is asked whether he or she really wants to execute the SQL statement.

COSTLIMIT: specifies the estimated SELECT cost value beyond which the SQL statement is not executed.

The COSTLIMIT value must be greater than the COSTWARNING value.

EXCLUSIVE

EXCLUSIVE: prevents users in this user group from opening two different database sessions simultaneously.

NOT EXCLUSIVE: allows the user to open several database sessions simultaneously.

If the EXCLUSIVE condition is not specified, EXCLUSIVE is assumed implicitly (without NOT).

DEFAULTCODE <ASCII | EBCDIC | UNICODE>

The value of the database parameter DEFAULT_CODE is overridden with the code attribute specified in DEFAULTCODE for the objects of the specified user.


Usergroup name (SAP Library - SAP DB)

 Entering content frame

Usergroup name

Usergroup mode is used to specify the user class or status of the defined usergroup when a usergroup is created ( CREATE USERGROUP statement ).

Syntax

<usergroup_mode> ::= RESOURCE | STANDARD

Explanation

If no user class is specified, the STANDARD class is assumed implicitly.

RESOURCE

A user in the specified usergroup is authorized to define private data and grant privileges for these objects to other users.

STANDARD

A user in the specified usergroup can only access private data, which was created by other users and for which he or she has the appropriate privileges, as well as view tables, synonyms, and temporary tables.

The user class RESOURCE encompasses all the rights of STANDARD users.

See also:

Users and user groups

user_mode


DROP USER statement (SAP Library - SAP DB)

 Entering content frame

DROP USER statement

A DROP USER statement drops a user definition. The metadata of the user to be dropped is dropped from the catalog.

Syntax

<drop_user_statement> ::= DROP USER <user_name> [<cascade_option>]

user_name , cascade_option

Explanation

The current user must have owner authorization over the user to be dropped.

The specified user must not be logged onto the database system when the DROP USER statement is executed.

  • If the user to be dropped does not belong to a usergroup and is the owner of synonyms or tables, and if the CASCADE option RESTRICT was specified, the DROP USER statement fails.
  • If no cascade option or the cascade option CASCADE is specified, all the synonyms and tables of the user to be dropped, as well as all indexes, privileges, view tables, etc. based on these objects, are dropped.

Dropping a user with the user class DBA does not affect any users that were created by this user. The SYSDBA user then becomes the new owner of these users.


DROP USERGROUP statement (SAP Library - SAP DB)

 Entering content frame

DROP USERGROUP statement

The DROP USERGROUP statement drops a usergroup definition. The metadata of the usergroup to be dropped is dropped from the catalog.

Syntax

<drop_usergroup_statement> ::= DROP USERGROUP <usergroup_name> [<cascade_option>]

usergroup_name , cascade_option

Explanation

The current user must have owner authorization over the usergroup to be dropped.

The users in this usergroup must not be logged onto the database system when the DROP USERGROUP statement is executed.

  • If the usergroup to be dropped does not belong to a usergroup and is the owner of synonyms or tables, and if the CASCADE option RESTRICT was specified, the DROP USERGROUP statement fails.
  • If no cascade option or the cascade option CASCADE is specified, all the synonyms and tables of the usergroup to be dropped, as well as all indexes, privileges, view tables, etc. based on these objects, are dropped.


ALTER USER Statement (alter_user_statement) (SAP Library - SAP DB)

 Entering content frame

ALTER USER Statement (alter_user_statement)

The ALTER USER statement alters the properties assigned to a user.

Syntax

<alter_user_statement> ::= ALTER USER <user_name> [<user_mode>]
[TIMEOUT <unsigned_integer> | TIMEOUT NULL]
[COSTWARNING <unsigned_integer> | COSTWARNING NULL]
[COSTLIMIT <unsigned_integer> | COSTLIMIT NULL]
[DEFAULT ROLE ALL [EXCEPT <role_name>] | DEFAULT ROLE NONE
| DEFAULT ROLE <role_name> [IDENTIFIED BY <password>]]
[[NOT] EXCLUSIVE] [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]

user_name, user_mode, unsigned_integer, role_name, password

Explanation

At least one of the optional clauses must be specified.

The specified user name must identify a defined user, who is not a member of a user group.

The current user must have owner authorization over the user whose properties are to be altered.

The specified user must not be logged onto the database system when the ALTER USER statement is executed.

User class (user_mode)

· DBA: specifies that the user is to be assigned the user class DBA. The DBA user class can only be granted by the SYSDBA.

· RESOURCE: specifies that the user is to be assigned the user class RESOURCE. If the user was previously assigned to the user class DBA, owner authorization for all users he or she created is revoked. The SYSDBA user then becomes the new owner.

· STANDARD: specifies that the user is removed from the current user class and loses the right to create base tables. All the base tables created by the user are dropped.

· No user class: if no user class is specified, the user class remains unchanged.

NULL

If the NULL value is specified, the value defined previously is cancelled.

DEFAULT ROLE

DEFAULT ROLE defines which of the roles assigned to the user is activated automatically when a database session is opened.

· ALL: all the roles assigned to the user are activated when a session is opened. EXCEPT can be used to exclude specified roles from activation.

· NONE: none of the roles is activated when a user database session is opened.

· Role name specified: the roles specified here must exist and be assigned to the user. They are automatically activated when a user database session is opened.

See also:

Role concept

TIMEOUT, COSTWARNING, COSTLIMIT, [NOT] EXCLUSIVE, and DEFAULTCODE are described under the CREATE USER statement.


ALTER USERGROUP Statement (alter_usergroup_statement) (SAP Library - SAP DB)

 Entering content frame

ALTER USERGROUP Statement (alter_usergroup_statement)

The ALTER USERGROUP statement ( alter_usergroup_statement) alters the properties assigned to a user group.

Syntax

<alter_usergroup_statement> ::= ALTER USERGROUP <usergroup_name> [<usergroup_mode>]
[TIMEOUT <unsigned_integer> | TIMEOUT NULL]
[COSTWARNING <unsigned_integer> | COSTWARNING NULL] [COSTLIMIT <unsigned_integer> | COSTLIMIT NULL]
[DEFAULT ROLE ALL [EXCEPT <role_name>] | DEFAULT ROLE NONE
| DEFAULT ROLE <role_name> [IDENTIFIED BY <password>]]
[[NOT] EXCLUSIVE] [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]

usergroup_name , usergroup_mode , unsigned_integer , role_name , password

Explanation

At least one of the optional clauses must be specified.

The specified user group must identify a defined user group.

The current user must have owner authorization over the user group whose properties are to be altered.

The members of the specified user group must not be logged onto the database system when the ALTER USERGROUP statement is executed.

User class of the user group (usergroup mode)

· RESOURCE: specifies that the user group is to be assigned to the user class RESOURCE.

· STANDARD: specifies that the user group is removed from the current user class and loses the right to create base tables. All the base tables created by the user group are dropped.

· No user class: if no user class is specified, the user class remains unchanged.

NULL

If the NULL value is specified, the value defined previously is cancelled.

DEFAULT ROLE

DEFAULT ROLE defines which of the roles assigned to the user group is activated automatically when a session is opened by a group member.

· ALL: all the roles assigned to the user group are activated when a session is opened. EXCEPT can be used to exclude specified roles from activation.

· NONE: none of the roles is activated when a session is opened by a member of the user group.

· Role name specified: the roles specified here must exist and be assigned to the user group. They are automatically activated when a session of a group member is opened.

See also:

Role concept

For information about the specifications TIMEOUT, COSTWARNING, COSTLIMIT, [NOT] EXCLUSIVE, and DEFAULTCODE, see CREATE USERGROUP statement.


RENAME USER Statement (rename_user_statement) (SAP Library - SAP DB)

 Entering content frame

RENAME USER Statement (rename_user_statement)

The RENAME USER statement ( rename_user_statement) changes the name of a user.

Syntax

<rename_user_statement> ::= RENAME USER <user_name> TO <new_user_name>

user_name

Explanation

The user whom you want to modify must exist. The user name must identify a user whose owner is the current user.

The new user name ( new_user_name) must not be identical to the name of an existing user, user group, or role.

The user whom you want to modify must not be logged on to the database system when the RENAME USER statement is executed.

The database system automatically adapts the objects that are dependent on the modified user to the new user name.


RENAME USERGROUP statement (SAP Library - SAP DB)

 Entering content frame

RENAME USERGROUP statement

The RENAME USERGROUP statement changes the name of a usergroup .

Syntax

<rename_usergroup_statement> ::= RENAME USERGROUP <usergroup_name> TO <new_usergroup_name>

usergroup_name

Explanation

The usergroup to be modified must exist. The name of the usergroup must identify a usergroup for which the current user has the owner privilege.

The new usergroup name must not be identical to that of an existing user, usergroup, or role.

The members of this usergroup must not be logged onto the database system when the RENAME USERGROUP statement is executed.

The database system automatically adapts the objects that are dependent on the modified usergroup to the new usergroup name.


GRANT USER Statement (grant_user_statement) (SAP Library - SAP DB)

 Entering content frame

GRANT USER Statement (grant_user_statement)

The GRANT USER statement grants another user the owner privilege that the SYSDBA or a DBA user has over a user .

Syntax

<grant user statement> ::= GRANT USER <granted users> [FROM <user_name>] TO <user_name>

<granted users> ::= <user name>,...| *
user name

Explanation

The current user must be a DBA user.

The user names specified after the FROM and TO keywords must be different and must identify DBA users. If FROM <user name> is not specified, the current user is assumed implicitly.

The users specified after the GRANT USER keywords must exist and must not be a member of a usergroup. They must also have the user class RESOURCE or STANDARD . The FROM user must have the owner privilege for these users. If * is specified, the GRANT USER statement affects all users for which the FROM user has the owner privilege.

The FROM user grants the TO user the owner privileges which the FROM user has over the specified users. These rights are revoked from the FROM user. In particular, the TO user is granted the right to drop any specified user and to alter the user class and other properties of this user.


GRANT USERGROUP Statement (grant_usergroup_statement) (SAP Library - SAP DB)

 Entering content frame

GRANT USERGROUP Statement (grant_usergroup_statement)

The GRANT USERGROUP statement grants the owner privilege that the SYSDBA or a DBA user has over a usergroup to another user.

Syntax

<grant_usergroup_statement> ::= GRANT USERGROUP <granted_usergroups> [FROM <user_name>] TO <user_name>

<granted usergroups> ::= <usergroup name>,...| *
 user name , usergroup name

Explanation

The current user must be a DBA user.

The user names specified after the FROM and TO keywords must be different and must identify DBA users. If FROM <user name> is not specified, the current user is assumed implicitly.

The usergroup name must identify a usergroups for which the FROM user has the owner privilege. An asterisk * stands for all usergroups for which the FROM user has the owner privilege.

The FROM user grants the TO user the owner authorization which the FROM user has over the specified usergroups. These rights are revoked from the FROM user. In particular, the TO user is granted the right to drop any usergroup, to alter the user class and properties of this usergroup, and to drop or create group members.


ALTER PASSWORD statement (SAP Library - SAP DB)

 Entering content frame

ALTER PASSWORD statement

The ALTER PASSWORD statement is required to alter a user's password.

Syntax

<alter_password_statement> ::= ALTER PASSWORD <old_password> TO <new_password>
| ALTER PASSWORD <user_name> <new_password>

<old_password> ::= <password>
<new_password> ::= <password>

user_name , password

Explanation

The old password must match the password entered in the catalog for the current user.

If the user_name is specified, the current user must be the SYSDBA.

The new password must be specified in the CONNECT statement the next time the user starts a session.


CREATE ROLE Statement (create_role_statement) (SAP Library - SAP DB)

 Entering content frame

CREATE ROLE Statement (create_role_statement)

The CREATE ROLE statement defines a role .

Syntax

<create_role_statement> ::= CREATE ROLE <role_name> [IDENTIFIED BY <password>]

role name , password

Explanation

The current user must be a DBA user.

The role name must not be the same as the name of an existing role, user, or usergroup.

See also:

Role concept


DROP ROLE Statement (drop_role_statement) (SAP Library - SAP DB)

 Entering content frame

DROP ROLE Statement (drop_role_statement)

The DROP ROLE statement drops a role .

Syntax

<drop_role_statement> ::= DROP ROLE <role_name>

role_name

Explanation

The current user must be the owner of the role.

The metadata of the role to be dropped is dropped from the database catalog .


GRANT Statement (grant_statement) (SAP Library - SAP DB)

 Entering content frame

GRANT Statement (grant_statement)

The GRANT statement assigns privileges for tables, individual columns and roles, the SELECT privilege for a sequence, and the execution privilege for a database procedure.

Syntax

<grant_statement> ::= GRANT <priv_spec>,... TO <grantee>,... [WITH GRANT OPTION]
| GRANT EXECUTE ON <dbproc_name> TO <grantee>,...
| GRANT SELECT ON <sequence_name> TO <grantee>,... [WITH GRANT OPTION]

priv_spec , grantee , dbproc_name , sequence_name

Explanation

The privileges in the privilege specification are assigned to the users , user groups , and roles (see also: Role Concept ) specified in the grantee list.

WITH GRANT OPTION

Users or usergroups identified as grantees are allowed to pass on their privileges to other users. The current user must have the authorization to pass on these privileges.

The WITH GRANT OPTION cannot be specified if grantee identifies a role.

GRANT EXECUTE ON

GRANT EXECUTE ON allow the user identified by grantee to execute the specified database procedure . The current user must be the owner of the database procedure.

GRANT SELECT ON

GRANT SELECT ON allows the user identified by grantee to execute the specified sequence.


Privilege specification (priv_spec) (SAP Library - SAP DB)

 Entering content frame

Privilege specification (priv_spec)

A privilege specification ( priv_spec ) defines a role or a set of privileges for specific tables.

Syntax

<priv_spec> ::= ALL [PRIV[ILEGES]] ON [TABLE] <table_name>,...
| <privilege>,... ON [TABLE] <table_name>,... | <role_name>

table_name , privilege , role_name

Explanation

These tables must not be temporary base tables.

The user must have the authorization to grant ( GRANT statement ) and revoke ( REVOKE statement ).privileges for the specified tables. For base tables, the owner of the table has this authorization.

In the case of view tables (see Table ), the owner may not always be authorized to assign or revoke all privileges. The database determines the privileges that a user can assign or revoke for a view table when the table is created. The result depends on the type of table and on the user's privileges for the tables selected in the view table. The owner of a table can interrogate the privileges that he or she is allowed to grant or revoke by selecting the system table DOMAIN.PRIVILEGES.

A list of all the privileges that can be granted is provided in the privilege type .

If a role is defined as a privilege specification, it must exist and the current user must be the owner of the role.

ALL [PRIV[ILEGES]]

All of the privileges that the user can grant for tables are granted (GRANT statement) or revoked (REVOKE statement) for the specified users, usergroups, and roles.

If a user who is not the owner of the table specifies ALL in a REVOKE statement, all of the privileges he or she has granted to the specified user for this table are revoked.


grantee (SAP Library - SAP DB)

 Entering content frame

grantee

In grantee the user (or several users) or role is specified for which privileges are to be granted with the GRANT statement or revoked with the REVOKE statement .

Syntax

<grantee> ::= PUBLIC | <user_name> | <usergroup_name> | <role_name>

user_name , usergroup_name , role_name

Explanation

A user in the grantee list must not be identical to the user name of the current user or the name of the owner of the table. A user in the grantee list must not denote a member of a usergroup .

Roles

If a role is assigned to a user or usergroup, it extends the set of roles which can be activated for this user or usergroup. The user activates the role either with the SET statement or by including the role in the set of roles automatically activated when a session was opened with the ALTER USER statement or ALTER USERGROUP statement .

A cycle may not be created when a role is assigned to a role, that is

  • a role may not be assigned to itself.
  • if a role R1 is assigned to a role R2, R2 may not be assigned to R1.
  • if a role R1 is assigned to a role R2 and R2 is assigned to a role R3, R3 may not be assigned to either R2 or R1.
  • etc.

PUBLIC

The listed privileges are granted to all users, both to current ones and to any created later.

A role cannot be assigned to PUBLIC.


REVOKE Statement (revoke_statement) (SAP Library - SAP DB)

 Entering content frame

REVOKE Statement (revoke_statement)

The REVOKE statement revokes privileges .

Syntax

<revoke statement> ::= REVOKE <priv spec>,... FROM <grantee>,... [<cascade_option>]
| REVOKE EXECUTE ON <dbproc_name> FROM <grantee>,...
| REVOKE SELECT ON <sequence_name> FROM <grantee>,... [<cascade_option>]

priv_spec , grantee , cascade_option , dbproc_name , sequence_name

Explanation

The owner of a table can revoke the privileges granted for this table from any user .

If a user is not the owner of the table, he may only revoke the privileges he has granted.

If the SELECT privilege was granted for a table any specified column names, REVOKE SELECT (<column name>,...) can be used to revoke the SELECT privilege (see privilege type ) for the specified columns; the SELECT privilege for table columns that have not been specified remains unchanged. The same is true for the UPDATE, REFERENCES, and SELUPD privileges.

The REVOKE statement can cascade; that is, revoking a privilege from one user can result in this privilege being revoked from other users who have received the privilege from the user in question.

Let U1, U2, and U3 be users.
U1 grants U2 the privilege set P WITH GRANT OPTION.
U1 grants U3 the privilege set P' (P'<=P).

If U1 revokes the privilege set P'' (P''<=P) from user U2, the privilege set (P'*P'') is revoked implicitly from user U3.
  • Whenever the SELECT privilege is revoked from the owner of a view table for a selected that does not occur in the table_expression of the view definition ( CREATE VIEW statement ), the column defined by select_column is dropped from the view table.
    If this view table is used in the     FROM clause of another view table, the described procedure is applied recursively to this view table.
  • If the SELECT privilege is revoked from the owner of a view table for a column or table occurring in the table_expression of the view definition, the view table is dropped, along with all view tables (see Table ), privileges , and synonyms based on this view table, if no CASCADE option or the cascade option CASCADE is specified. The REVOKE statement will fail if the CASCADE option RESTRICT is specified.

REVOKE EXECUTE

If REVOKE EXECUTE is specified, the authorization to execute the database procedure is revoked from the user identified by grantee. The authorization for execution can only be revoked by the owner of the database procedure.


Data Manipulation (SAP Library - SAP DB)

 Entering content frame

Data Manipulation

The following sections provide an introduction to the Data Manipulation Language (DML) used by the database system.

Every SQL statement that manipulates data implicitly sets an exclusive lock (see also Lock Behavior ) for each inserted, updated, or deleted row.

SQL statements for data manipulation

INSERT statement | UPDATE statement | DELETE statement
NEXT STAMP statement | CALL statement |


INSERT Statement (insert_statement) (SAP Library - SAP DB)

 Entering content frame

INSERT Statement (insert_statement)

The INSERT statement creates new rows in a table.

Syntax

<insert_statement> ::=
  INSERT [INTO] <table_name> [(<column_name>,...)] VALUES (<insert_expression>,...) [<duplicates_clause>]
| INSERT [INTO] <table_name> [(<column_name>,...)] <query_expression> [<duplicates_clause>]
| INSERT [INTO] <table_name> SET <set_insert_clause>,... [<duplicates_clause>]

<insert_expression> ::= <extended_expression> | <subquery>

table_name, column_name, extended_expression, duplicates_clause, subquery, query_expression, set_insert_clause

Explanation

The table name must denote an existing base table, view table (see Table), or a synonym.

If column names or a SET INSERT clause are specified, all of the specified column names must be columns in the table. If the table was defined without a key (that is, if the SYSKEY column is created internally by the database), the SYSKEY column must not occur in the sequence of column names or in a SET INSERT clause. A column must not occur more than once in a sequence of column names or in more than one SET INSERT clause.

The user must have the INSERT privilege for the table identified by the table name. If the table name identifies a view table, even the owner of the view table may not have the INSERT privilege because the view table cannot be changed.

A specified column (identified by column name or the column name in the set_insert_clause) is a target column. Target columns can be specified in any order.

· If a column name and SET INSERT clause are not specified, the result is the same as if a sequence of columns were specified that contains all of the columns in the table in the order specified in the CREATE TABLE statement or CREATE VIEW statement. In this case, every table column defined by the user is a target column.

· The number of expressions ( insert_expression) must be equal to the number of target columns.The ith expression is assigned to the ith column name.

· Expressions ( extended_expression) and subqueries (subquery) can be specified simultaneously.

· You can specify one or more subqueries.

· The specified subqueries must only return a single result line.

· The number of selected columns specified in the QUERY expression must be identical to the number of target columns.

· All mandatory columns of the table identified by table name must be target columns.

· If the table name identifies a view table, rows are inserted the base table(s) on which the view table is based. In this case, the target columns of the specified table name correspond to columns of the base tables, on which the view table is based. In the following, the term target column always refers to the corresponding column in the base table.

Further Information

· Data type of the target column and data type of the value to be inserted

· Join view table in INSERT statement

· QUERY expression in INSERT statement

· DUPLICATES clause

· Constraint definition in INSERT statement

· Trigger in INSERT statement

In the case of the INSERT statement, the third entry of SQLERRD in the SQLCA is set to the number of inserted rows.

If errors occur when rows are inserted, the INSERT statement fails, and the table remains unmodified.


Data type of the target column and inserted value (SAP Library - SAP DB)

 Entering content frame

Data type of the target column and inserted value

Let C be a target column and v a value that is not equal to the NULL value.

v is to be inserted in C by means of an INSERT statement .
v is to be used to modify C with an UPDATE statement .

Target column C | Required value for v
Numeric column | Number within the permissible range of C. INSERT statement: if v is the result of a QUERY expression, decimal places are rounded off if necessary. UPDATE statement: if v is the result of an expression that does not comprise one single numeric literal , decimal places are rounded off if necessary.
Alphanumeric column with the code attribute ASCII or EBCDIC | Character string whose length is not greater than the length attribute of C. Subsequent blanks are ignored when the length of v is calculated. If the length of v is shorter than the length attribute of C, then v is lengthened by the corresponding number of blanks. When assigning an alphanumeric value with the code attribute ASCII (EBCDIC) to a column with the code attribute EBCDIC (ASCII), the value is implicitly converted before it is assigned.
Alphanumeric column with the code attribute BYTE | Hexadecimal character string whose length is not greater than the length attribute of C. Subsequent binary zeros are ignored when the length of v is calculated. If the length of v is shorter than the length attribute of C, then v is lengthened by the corresponding number of binary zeros.
Data type DATE | Date value in the current date format.
Data type TIME | Time value in the current time format.
Data type TIMESTAMP | Timestamp value in the current timestamp format.
Data type BOOLEAN | One of the values TRUE or FALSE ( BOOLEAN )


Join View Table in INSERT Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation Join View Table in INSERT Statement

If the table name does not identify a join view table in an INSERT statement (see CREATE VIEW statement ), and a row containing the key of the row to be inserted already exists, the result will depend on the DUPLICATES clause . The INSERT statement will fail if no DUPLICATES clause is specified.

If the table name identifies a join view table, a row is inserted into each base table on which the view table is based. If the key table of the view table already contains a row with the key of the row to be inserted, the INSERT statement will fail. If any row in a base table, which is not the key table of the view table, already contains the key of the row to be inserted, the INSERT statement will fail if the row to be inserted does not match the existing row.


QUERY Expression in INSERT Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation QUERY Expression in INSERT Statement

If a QUERY expression is specified in the INSERT statement , the specified table must not be a join view table.

The QUERY expression defines a result table (see result table name ) whose ith column is assigned to the ith target column. A row is formed from each row in the result table and inserted in the base table. Each of these rows has the following contents:

  • Each base table column that is a target column of the INSERT statement contains the value of the corresponding column in the current result table row.

If a QUERY expression is not specified in the INSERT statement, exactly one row is inserted in the specified table. The inserted row has the following contents:

  • Each base table column that is a target column of the INSERT statement contains the value assigned to the respective target column.

The following still applies to the inserted row(s):

  • All columns of the base table that are not target columns of the INSERT statement and for which a DEFAULT specification exists contain the DEFAULT value.
  • All columns of the base table that are not target columns of the INSERT statement and for which no DEFAULT specification exists contain the NULL value .


DUPLICATES clause (SAP Library - SAP DB)

 Entering content frame

DUPLICATES clause

The DUPLICATES clause can be used to determine how key collisions are handled.

Syntax

<duplicates_clause> ::= REJECT DUPLICATES | IGNORE DUPLICATES | UPDATE DUPLICATES

Explanation

SQL statements in which the DUPLICATES clause is used

CREATE TABLE statement

REJECT DUPLICATES or no DUPLICATES clause | The CREATE TABLE statement fails if key collisions occur.
IGNORE DUPLICATES | Any rows that key collisions on insertion are ignored.
UPDATE DUPLICATES | Any rows that key collisions on insertion overwrite the rows with which they collide.

INSERT statement

If there is already a row in the base table with the key of the row to be inserted, the following cases must be distinguished:

REJECT DUPLICATES or no DUPLICATES clause | The INSERT statement fails.
IGNORE DUPLICATES | The new row is not inserted and processing of the INSERT statement is continued.
UPDATE DUPLICATES | The existing row is overwritten by the new row and processing of the INSERT statement is continued.

If there is more than one key collision for the same key for an INSERT statement with UPDATE DUPLICATES and QUERY expression specification, it is impossible to predict the content of the respective base table row once the INSERT statement has been completed.

If, for an INSERT statement with IGNORE DUPLICATES and a QUERY expression, more than one row in the result table produces the same base table key, and if this key did not exist before in the base table, it is impossible to predict the row that will be inserted in the table.

If the table name specified in the INSERT statement identifies a table without a user-defined key, the DUPLICATES clause has no effect.


Constraint Definition in INSERT Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation Constraint Definition in INSERT Statement

If CONSTRAINT definitions exist for base tables in which rows are to be inserted with the INSERT statement , each row that is to be inserted is checked against the CONSTRAINT definition. The INSERT statement fails if this is not the case for at least one row.

If at least one of the base tables in which rows are to be inserted with the INSERT statement is the referencing table of a referential CONSTRAINT definition , the database system checks each row to be inserted to determine whether the foreign key resulting from the row exists as a key or as a value of an index defined with UNIQUE (see CREATE INDEX statement ) in the corresponding referenced table. The INSERT statement fails if this is not the case for at least one row.


Trigger in INSERT Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation Trigger in INSERT Statement

If triggers that are to be executed after an INSERT statement were defined for base tables in which rows are to be inserted with the INSERT statement, they are executed accordingly. The INSERT statement will fail if one of these triggers fails.


Extended expression (SAP Library - SAP DB)

 Entering content frame

Extended expression

An extended expression can be specified by means of an expression or one of the keywords DEFAULT or STAMP.

Syntax

<extended_expression> ::= <expression> | DEFAULT | STAMP

expression

Explanation

  • Expression
     INSERT statement : an expression in an INSERT statement must not contain a column specification .
    The value specified by a     parameter specification in an expression is the value of the parameter identified by the specification. If an indicator parameter is specified with a negative value, the value defined by the parameter specification is a NULL value.
  • Keyword DEFAULT
    DEFAULT denotes the value used as the DEFAULT for the column.
  • STAMP key word
    The database system is able to generate unique values. This is a serial number that starts with X'000000000001'. The values are assigned in ascending order. It cannot be ensured that a sequence of values is uninterrupted. The STAMP key word supplies the next value generated by the database system.
    The STAMP keyword can be used in the     INSERT statement or in the UPDATE statement , but only for columns of the data type CHAR(n) BYTE with n>=8 ( default specification ).
    If the user wants to find out the generated value before it is applied to a column, he or she must use the following SQL statement:
     NEXT STAMP statement

See also:

SET INSERT condition

SET UPDATE condition


SET INSERT clause (SAP Library - SAP DB)

 Entering content frame

SET INSERT clause

SET INSERT clause

Syntax

<set_insert_clause> ::= <column_name> = <extended_value_spec>

column_name , extended_value_spec

Explanation

SQL statements in which the SET INSERT clause is used

INSERT statement


UPDATE Statement (SAP Library - SAP DB)

 Entering content frame

UPDATE Statement

The UPDATE statement changes column values in table rows.

Syntax

<update_statement> ::=
  UPDATE [OF] <table_name> [<reference_name>] SET <set_update_clause>,... [KEY <key_spec>,...] [WHERE <search_condition>]
| UPDATE [OF] <table_name> [<reference_name>] (<column_name>,...) VALUES (<extended_value_spec>,...) [KEY <key_spec>,...] [WHERE <search_condition>]
| UPDATE [OF] <table_name> [<reference_name>] SET <set_update_clause>,... WHERE CURRENT OF <result_table_name>
| UPDATE [OF] <table_name> [<reference_name>] (<column_name>,...) VALUES (<extended_value_spec>,...) WHERE CURRENT OF <result_table_name>

table name , reference name , set update clause , key spec , search condition , column name , extended value spec , result table name

Explanation

The table name must denote an existing base table, view table (see Table ), or a synonym .

Columns whose values are to be updated are called target columns. One or more target columns and new values for these columns are specified after the table name and reference name (if necessary).

  • All target columns must identify columns in the specified table, and each target column may only be listed once.
  • The number of specified values ( extended_value_spec ) must be identical to the number of target columns. The ith value specification is assigned to the ith target column.
  • The current user must have the UPDATE privilege for each target column in the specified table.
    If the table name identifies a view table, even the owner of the view table may not be able to update column values because the view table is not updateable.
  • If the specified table is a view table, column values are only updated in rows in the base tables on which the view table is based. In this case, the target columns of the specified table correspond to columns in the base tables on which the view table is based. In the following paragraphs, the term target column always refers to the corresponding column in the base table.

Data type of the target column and data type of the value to be inserted

The following specifications determine the rows in the table that are updated:

  • Optional sequence of key specifications and optional search condition
    Key specification and no search condition: a row with the specified key values already exists. The corresponding values are assigned to the target columns in this row. No rows are updated if a row with the specified key values does not exist.
    Key specification and a search condition: a row containing the specified key values exists. The search condition is applied to this row. If the search condition is satisfied, the corresponding values are assigned to the target columns of this row. No rows are updated if a row with the specified key values does not exist or if a search condition applied to a row is not fulfilled.
    No key specification and a search condition: the search condition is applied to each row in the specified table. The corresponding values are assigned to the target columns of all rows that satisfy the search condition.
  • If CURRENT OF is used, i.e. if the cursor position in the result table (result_table_name) is specified: no rows are updated if the cursor is not positioned on a row in the result table.
  • If none of the above specifications were made, all of the rows in the specified table are updated.
  • If no row is found that satisfies the conditions defined by the optional clauses, the following message appears: 100 row not found.

Even values in key columns that were defined by a user in a CREATE TABLE statement or ALTER TABLE statement can be updated. The implicit key column SYSKEY, if created, cannot be updated.

If the table name specifies a join view table (see CREATE VIEW statement ), columns may exist that can only be updated in conjunction with other columns (determine the column combination for a column or a join view table ). To update the value of the relevant column, a value must be specified for all of the columns in the column combination. This is true of all target columns that fulfill the following conditions:

  • The target columns are located in a base table that is not a key table of the join view table and does not have a 1 : 1 relationship with the key table of the join view table.
  • The target columns are foreign key columns of a referential CONSTRAINT definition that is relevant for the join view table.

CURRENT OF

If CURRENT OF is specified, the table name in the FROM clause of the QUERY statement, with which the result table was built, must be identical to the table name in the UPDATE statement.

If CURRENT OF is specified and the cursor is positioned on a row in the result table, the corresponding values are assigned to the target columns of the corresponding row. The corresponding row is the row of the table specified in the FROM clause of the query statement, from which the result table row was formed. This procedure requires that the result table was specified with FOR UPDATE. It is impossible to predict whether or not the updated values in the corresponding row are visible the next time the same row of the result table is accessed.

Reasons for an UPDATE statement failure

If CONSTRAINT definitions exist for base tables in which rows were updated with the UPDATE statement, each row that was updated is checked against the CONSTRAINT definitions. The UPDATE statement fails if this is not the case for at least one modified row.

For each row in which the value of foreign key columns has been updated with the UPDATE statement, the database system checks whether the respective resulting foreign key exists as a key or as a value of an index defined with UNIQUE (see CREATE INDEX statement ) in the corresponding referenced table. The UPDATE statement fails if this is the case for at least one modified row.

For each row in which the value of a referenced column of a referential CONSTRAINT definition is to be updated using the update statement, the database system checks whether there are rows in the corresponding foreign key table that contain the old column values as foreign keys. The UPDATE statement fails if this is the case for at least one row.

If triggers that are to be executed after an UPDATE statement were defined for base tables in which rows are to be updated with the UPDATE statement, they are executed accordingly. The UPDATE statement will fail if one of these triggers fails.

Further information

The update statement can only be used to assign a value to columns with the data type LONG if it contains a parameter or NULL specification. The assignment of values to LONG columns is therefore only possible with some database tools.

In the case of the UPDATE statement, the third entry of SQLERRD in the SQLCA is set to the number of updated rows. Rows are also counted as updated when the old value was overwritten with a new but identical value.

If errors occur while rows are updated, the UPDATE statement fails, leaving the table unchanged.


SET UPDATE clause (SAP Library - SAP DB)

 Entering content frame

SET UPDATE clause

SET UPDATE clause

Syntax

<set_update_clause> ::= <column_name> = <extended_expression>
| <column_name>,... = (<extended_expression>,...)
| (<column_name>,...) = (<extended_expression>,...)
| <column_name> = <subquery>
| (<column_name>,...) = <subquery>

column_name , extended_expression , subquery

Explanation

The expression of a SET UPDATE clause must not contain a set function .

The subquery must produce a result table with at most one row. The number of columns must be equal to the number of target columns specified.

SQL statement in which the SET UPDATE clause is used

UPDATE statement


Column combination for a given column of a join view table (SAP Library - SAP DB)

 Entering content frame

Column combination for a given column of a join view table

To determine the combination of columns for a given column v in the join view table V, use the following procedure:

  1. Determine the base table Tj containing the column which corresponds to v.
  2. Determine the unique table sequence Til...Tik that contains Tj.
  3. Determine the last table Til in this sequence that has a 1:1 relationship with the key table.
  4. The columns of V, which correspond to the foreign key columns of Til of the referential CONSTRAINT definition between Til and Til+I that is relevant for V, are elements of the column combination.
  5. All columns of V which correspond to columns of the tables Til+l...Tik are elements of the column combination.

To update the column value of the column v in an UPDATE statement , a value must be specified for each of the columns of the column combination.


DELETE statement (SAP Library - SAP DB)

 Entering content frame

DELETE statement

The DELETE statement deletes rows in a table.

Syntax

<delete_statement> ::=
  DELETE [FROM] <table_name> [<reference_name>] [KEY <key_spec>,...] [WHERE <search_condition>]
| DELETE [FROM] <table_name> [<reference_name>] WHERE CURRENT OF <result_table_name>

table name , reference name , key spec , search condition , result table name

Explanation

The table name must denote an existing base table, view table (see Table ), or a synonym .

The current user must have the DELETE privilege for the specified table. If the table name identifies a view table, even the owner of the view table may not have the DELETE privilege because the view table cannot be changed.

Table name identifies a view table: the rows of the tables on which the view tables are based are deleted.

Table name identifies a join view table: only the following rows are deleted:

  • Rows in the key table of the join view table
  • Rows in base tables on which the view table is based and that have a 1:1: relationship with the key table.

The following specifications determine the rows in the table that are deleted:

  • Optional sequence of key specifications and optional search condition
    Key specification and no search condition: a row with the specified key values already exists. This row is deleted. No rows are deleted if a row with the specified key values does not exist.
    Key specification and a search condition: a row containing the specified key values exists. The search condition is applied to this row. If the search condition is satisfied, then the row is deleted. No rows are deleted if a row with the specified key values does not exist or if a search condition applied to a row is not fulfilled.
    No key specification and a search condition: the search condition is applied to each row in the specified table. All rows for which the search condition is satisfied are deleted.
  • If CURRENT OF is used, i.e. if the cursor position in the result table (result_table_name) is specified: no rows are deleted if the cursor is not positioned on a row in the result table.
  • If none of the above specifications were made, all of the rows in the specified table are deleted.
  • If no row is found that satisfies the conditions defined by the optional clauses, the following message appears: 100 row not found.

CURRENT OF

If CURRENT OF is specified, the table name in the FROM clause of the QUERY statement, with which the result table was built, must be identical to the table name in the DELETE statement.

If CURRENT OF is specified and the cursor is positioned on a row in the result table, the corresponding row is deleted. The corresponding row is the row of the table specified in the FROM clause of the query statement, from which the result table row was formed. This procedure requires that the result table was specified with FOR UPDATE. Afterwards, the cursor is positioned behind the result table row. It is impossible to predict whether or not the updated values in the corresponding row are visible the next time the same row of the result table is accessed.

DELETE rule

For each row deleted in the course of the delete statement which originates from a referenced table of at least one referential CONSTRAINT definition , one of the following actions is carried out - depending on the DELETE rule of the referential constraint definition:

  • DELETE CASCADE: all matching rows in the corresponding foreign key table are deleted.
  • DELETE RESTRICT: if there are matching rows in the corresponding foreign key table, the delete statement fails.
  • DELETE SET NULL: the NULL value is assigned to the respective foreign key columns of all matching rows in the corresponding foreign key table.
  • DELETE SET DEFAULT: the DEFAULT value that was set with a DEFAULT specification is assigned to the respective foreign key columns of all matching rows in the corresponding foreign key table.

Trigger

If triggers that are to be executed after a DELETE statement were defined for base tables from which rows are to be deleted with the DELETE statement, they are executed accordingly. The DELETE statement will fail if one of these triggers fails.

Further information

In the case of the DELETE statement, the third entry of SQLERRD in the SQLCA is set to the number of deleted rows. If this counter has the value -1, either a significant part of the table or the entire table was deleted by the delete statement.

If errors occur in the course of the delete statement, the statement fails, leaving the table unchanged.


NEXT STAMP statement (SAP Library - SAP DB)

 Entering content frame

NEXT STAMP statement

The NEXT STAMP statement supplies a unique key that was generated by the database system.

Syntax

<next_stamp_statement> ::= NEXT STAMP [INTO] <parameter_name>

parameter_name

Explanation

The database system is able to generate unique values. This is a serial number that starts with X'0000000000001'. The values are assigned in ascending order. It cannot be ensured that a sequence of values is uninterrupted. These values can be stored in a column with the data type CHAR (n) BYTE with n>=8.

The NEXT STAMP statement assigns the next key generated by the database system to the variable denoted by parameter name.

The NEXT STAMP statement can only be embedded in a programming language and cannot be used in interactive mode.

The keyword STAMP can be also used in an INSERT statement or an UPDATE statement if the next value is to be generated by the database system and stored in a column without the user knowing the value.


CALL Statement (call_statement) (SAP Library - SAP DB)

 Entering content frame

CALL Statement (call_statement)

The CALL statement causes a database procedure to be executed.

Syntax

<call_statement> ::= CALL <dbproc_name> [(<expression>,...)] [WITH COMMIT]

dbproc name , expression

Explanation

The specified database procedure name must identify an existing database procedure.

The current user must have the EXECUTE privilege for the database procedure.

The number of expressions must be equal to the number of formal parameters for the database procedure.

The data type of the ith expression must be compatible with the data type of the ith formal parameter for the database procedure.

If the ith formal parameter for the database procedure has the OUT or INOUT mode (see CREATE DBPROC statement ), the corresponding expression must be a parameter specification .

WITH COMMIT

If WITH COMMIT is specified, the current transaction is terminated with COMMIT after the database procedure has been executed correctly. If execution of the database procedure fails, the current transaction is terminated with ROLLBACK.


Data Query (SAP Library - SAP DB)

 Entering content frame

Data Query

The following sections provide an introduction to the query language (also referred to as the data retrieval language) used by the database system.

SQL statements for data queries

QUERY statement | SINGLE SELECT statement | EXPLAIN statement
OPEN CURSOR statement | FETCH statement | CLOSE statement


QUERY statement (SAP Library - SAP DB)

 Entering content frame

QUERY statement

A QUERY statement specifies a result table that can be ordered (see result table name ). There are four different ways of formulating a QUERY statement.

Syntax

<query_statement> ::= <declare_cursor_statement> | <recursive_declare_cursor_statement>
| <named_select_statement> | <select_statement>

declare_cursor_statement , recursive_declare_cursor_statement , named_select_statement , select_statement

Explanation

A QUERY statement generates a named/unnamed result table .

A distinction is made between the following QUERY statements:

Basic types of QUERY statement |
DECLARE CURSOR statement | A named result table is defined. The table is generated with an OPEN CURSOR statement .
Recursive DECLARE CURSOR statement | This statement can be used to generate bills of material.
SELECT statement ( named_select_statement ) | A named result table is defined and generated.
SELECT statement ( select_statement ) | An unnamed result table is defined and generated.

The SELECT statement ( named_select_statement ) and SELECT statement ( select_statement ) are subject to the rules that were specified for the DECLARE CURSOR statement and those that were specified for the OPEN CURSOR statement.

The order of rows in the result table depends on the internal search strategies of the system and is arbitrary. The only reliable means of sorting the result rows is to specify an ORDER clause .

Updateable result table

A result table or the underlying base tables are updateable if the query statement satisfies the following conditions:

  • See the section entitled "Updateable result table" in the SELECT statement (named_select_statement) or SELECT statement (select_statement)
  • The result table is a named result table, i.e. it must not have been generated by a select statement ( select_statement ).


Named/Unnamed Result Table (SAP Library - SAP DB)

 Entering content frame

Named/Unnamed Result Table

The difference between a named result table and an unnamed result table (see result table name ) is that the unnamed result table cannot be specified in a FROM clause or in CURRENT OF <result_table_name> of a subsequent SQL statement.

QUERY statement |
DECLARE CURSOR statement (declare_cursor_statement) | A named result table is generated. The column names of a result table defined by this QUERY statement do not have to be unique.
SELECT statement (select_statement) | A unnamed result table is generated. The column names of a result table defined by this QUERY statement do not have to be unique.
SELECT Statement (named_select_statement) | A named result table is generated. The column names of a result table generated by this QUERY statement must be unique.


DECLARE CURSOR statement (SAP Library - SAP DB)

 Entering content frame

DECLARE CURSOR statement

The DECLARE CURSOR statement defines a named result table (see named/unnamed result table ) with the name result_table_name .

Syntax

<declare_cursor_statement> ::= DECLARE <result_table_name> CURSOR FOR <select_statement>

result_table_name , select_statement

Explanation

An OPEN CURSOR statement with the name of the result table is required to actually generate the result table defined with a DECLARE CURSOR statement.

See also:

SELECT statement (select_statement)


Recursive DECLARE CURSOR statement (SAP Library - SAP DB)

 Entering content frame

Recursive DECLARE CURSOR statement

The recursive DECLARE CURSOR statement can be used to receive bills of material by means of a command.

Syntax

<recursive_declare_cursor_statement> ::= DECLARE <result_table_name> CURSOR FOR
WITH RECURSIVE <reference_name> (<alias_name>,...) AS
(<initial_select> UNION ALL <recursive_select>) <final_select>

<initial_select> ::= <query_spec>
<recursive_select> ::= <query_spec>
<final_select> ::= <select_statement>

result_table_name , reference_name , alias_name , query_spec , select_statement

DECLARE C CURSOR FOR
WITH RECURSIVE PX (MAJOR, MINOR, NUMBER, MAINMAJOR) AS
  (SELECT W,X,Y,W FROM T WHERE W = 'aaa' UNION ALL
   SELECT W,X,Y,MAINMAJOR FROM T, PX WHERE MINOR = T.W)
 SELECT MAINMAJOR,MINOR,NUMBER FROM PX ORDER BY NUMBER

Explanation

  • The QUERY specification initial_select is executed and the result is entered in a temporary result table whose name is defined by specifying the reference name. The column names contained in it receive the names from the list of alias names. The number of output columns in the QUERY specification must be identical to the number of alias names.
  • The QUERY specification recursive select should comprise a SELECT statement that contains at least the reference name in the FROM clause and one JOIN predicate between this table and a different table from the FROM clause.
    The QUERY specification     recursive_select is repeated until it does not produce a result. The respective results are (logically) entered in the temporary result table whose name is defined by the reference name. This table is extended continuously. It is ensured, however, that the results of the n th execution are used for the n+1 th execution to avoid an endless loop.
  • The SELECT statement final_select must only contain one QUERY expression that comprises a QUERY specification .
    This is a SELECT statement across the table with the specified reference name in which the following elements can be used:     set function names , GROUP clause , HAVING clause , ORDER clause , LOCK option

If a result table name with the specified reference name existed before the recursive DECLARE CURSOR statement was executed, the corresponding cursor is closed implicitly.


SELECT Statement (named_select_statement) (SAP Library - SAP DB)

 Entering content frame

SELECT Statement (named_select_statement)

A SELECT statement (named_select_statement) defines and creates a result table with the name result_table_name (see named/unnamed result table ).

Syntax

<named_select_statement> ::= <named_query_expression>
[<order_clause>] [<update_clause>] [<lock_option>] [FOR REUSE]

named query expression , order clause , update clause , lock option

Explanation

An OPEN CURSOR statement is not permitted for result tables created with this SELECT statement.

The SELECT statement (named select statement) is subject to the rules that were specified for the DECLARE CURSOR statement and those that were specified for the OPEN CURSOR statement.

Depending on the search strategy, either all the rows in the result table are searched when the SELECT statement (named select statement) is executed and the result table is physically generated, or each next result table row is searched when a FETCH statement is executed, without being physically stored. This must be taken into account for the time behavior of FETCH statements.

Updateable result table

A result table or the underlying base tables are updateable if the query statement satisfies the following conditions:

  • The QUERY expression (named_query_expression) must only comprise one QUERY specification (named_query_spec) .
  • Only one base table or one updateable view table may be specified in the FROM clause of the QUERY specification (named query spec).
  • The DISTINCT keyword (see DISTINCT specification ), a GROUP clause , or HAVING clause must not be specified.
  • Expressions must not contain a set function (set_function_spec) .
  • See also the section entitled "Updateable result table" under QUERY statement .

ORDER clause

The ORDER clause specifies a sort sequence for a result table.

UPDATE clause

An UPDATE clause can only be specified for updateable result tables. For updateable result tables, a position within a particular result table always corresponds to a position in the underlying tables and thus, ultimately, to a position in one or more base tables.

If an UPDATE clause was specified, the base tables can be updated using the position in the result table (CURRENT OF <result table name>) by means of an UPDATE statement or a DELETE statement . A lock can be requested for the affected lines of each of the affected base tables using a LOCK statement .

LOCK option

The LOCK option determines which locks are to be set on the read rows.

FOR REUSE

If the result table is to be specified in the from clause of a subsequent QUERY statement , the table should be specified with FOR REUSE keywords. If FOR REUSE is not specified, the reusability of the result table depends on internal system strategies.

Since specifying FOR REUSE increases the response times of some query statements, it should only be specified if it is required to reuse the result table.

See also:

SELECT statement (select_statement)


SELECT Statement (select_statement) (SAP Library - SAP DB)

 Entering content frame

SELECT Statement (select_statement)

A SELECT statement (select_statement) defines and creates an unnamed result table (see named/unnamed result table ).

Syntax

<select_statement> ::= <query_expression> [<order_clause>] [<update_clause>] [<lock_option>] [FOR REUSE]

query expression , order clause , update clause , lock option

Explanation

An OPEN CURSOR statement is not permitted for result tables created with this SELECT statement.

The SELECT statement (select_statement) is subject to the rules that were specified for the DECLARE CURSOR statement and those that were specified for the OPEN CURSOR statement.

Depending on the search strategy, either all the rows in the result table are searched when the SELECT statement (select_statement) is executed and the result table is physically generated, or each next result table row is searched when a FETCH statement is executed, without being physically stored. This must be taken into account for the time behavior of FETCH statements.

Updateable result table

A result table or the underlying base tables are updateable if the query statement satisfies the following conditions:

  • The QUERY statement comprises a DECLARE CURSOR statement.
  • The QUERY expression (query_expression) must only comprise one QUERY specification (query_spec) .
  • Only one base table or one updateable view table may be specified in the FROM clause of the QUERY specification (query_spec).
  • The DISTINCT keyword (see DISTINCT specification ), a GROUP clause , or HAVING clause must not be specified.
  • Expressions must not contain a set function (set_function_spec) .
  • See also the section entitled "Updateable result table" under QUERY statement .

ORDER clause

The ORDER clause specifies a sort sequence for a result table.

UPDATE clause

An UPDATE clause can only be specified for updateable result tables. For updateable result tables, a position within a particular result table always corresponds to a position in the underlying tables and thus, ultimately, to a position in one or more base tables.

If an UPDATE clause was specified, the base tables can be updated using the position in the result table (CURRENT OF <result table name>) by means of an UPDATE statement or a DELETE statement . A lock can be requested for the affected lines of each of the affected base tables using a LOCK statement .

LOCK option

The LOCK option determines which locks are to be set on the read rows.

FOR REUSE

If the result table is to be specified in the from clause of a subsequent QUERY statement , the table should be specified with FOR REUSE keywords. If FOR REUSE is not specified, the reusability of the result table depends on internal system strategies.

Since specifying FOR REUSE increases the response times of some query statements, it should only be specified if it is required to reuse the result table.

See also:

SELECT Statement (named_select_statement)


QUERY expression (query expression) (SAP Library - SAP DB)

 Entering content frame

QUERY expression (query expression)

QUERY expressions are required to generate an unordered result table in a SELECT statement .

Syntax

<query_expression> ::= <query_term> | <query_expression> UNION [ALL] <query_term> | <query_expression> EXCEPT [ALL] <query_term>

query_term

Explanation

If the QUERY expressions consists of only one QUERY specification (query spec) (specified in query term), the result of the expression is the unchanged result of the QUERY specification.

If a QUERY expression consists of more than one QUERY specification, the number of selected columns in all QUERY specifications of the QUERY expression must be the same. The respective ith selected columns of the QUERY specifications must be comparable.

Column type (select column) |
Numeric columns | Are comparable. If all ith selected columns are numeric columns, the ith column of the result table is a numeric column.
Alphanumerical column, code attribute BYTE | Are comparable.
Alphanumerical column, code attribute ASCII, EBCDIC, UNICODE | Are comparable. Are also comparable with date, time, and timestamp values.
All ith columns are date values | The ith column of the result table is a date value.
All ith columns are time values | The ith column of the result table is a time value.
All ith columns are timestamp values | The ith column of the result table is a timestamp value.
Columns of the type BOOLEAN | Are comparable.
All ith columns are of the type BOOLEAN | The ith column of the result table is of the type BOOLEAN.
Columns of any other data type (not mentioned above) | The ith column of the result table is an alphanumeric column. Comparable columns with differing code attributes are converted.

If columns are comparable but have different lengths, the corresponding column of the result table has the maximum length of the underlying columns.

Column names in the result table

The names of the result table columns are formed from the names of the selected columns of the first QUERY specification.

Let T1 be the left operand of UNION, EXCEPT, or INTERSECT (defined in query term). Let T2 be the right operand. Let R be the result of the operation on T1 and T2.

  • A row is a duplicate of another row if both have identical values in each column. NULL values are assumed to be identical. Special NULL values are assumed to be identical.
  • UNION: R contains all rows from T1 and T2.
  • EXCEPT: R contains all rows from T1 which have no duplicate rows in T2.
  • INTERSECT: R contains all rows from T1 which have a duplicate row in T2. A row from T2 can only be a duplicate row of exactly one row from T1. More than one row from T1 cannot have the same duplicate row in T2.
  • DISTINCT is implicitly assumed for the query expressions belonging to T1 and T2 if ALL is not specified. All duplicate rows are removed from R.

If parentheses are missing, then INTERSECT will be evaluated before UNION and EXCEPT. UNION and EXCEPT have the same precedence and will be evaluated from left to right in the case that parentheses are missing.


QUERY term (query_term) (SAP Library - SAP DB)

 Entering content frame

QUERY term (query_term)

A QUERY term ( query_term ) is part of the syntax in a QUERY expression ( query_expression or named_query_expression ).

Syntax

<query_term> ::= <query_primary> | <query_term> INTERSECT [ALL] <query_primary>

<query_primary> ::= <query_spec> | (<query_expression>)

query_spec , query_expression

Explanation

See QUERY expression or QUERY expression (named_query_expression)


QUERY expression (named query expression) (SAP Library - SAP DB)

 Entering content frame

QUERY expression (named query expression)

QUERY expressions (named_query_expressions) are required to generate an unordered result table in a SELECT statement (named_select_statement) .

Syntax

<named_query_expression> ::= <named_query_term> | <named_query_expression> UNION [ALL] <query_term> | <named_query_expression> EXCEPT [ALL] <query_term>

named_query_term , query_term

Explanation

If the QUERY expressions consists of more than one QUERY specification (query_spec) (specified in named_query_term or in query_term), the only the first QUERY specification in the QUERY expression may be a QUERY specification (named_query_spec).

If the QUERY expressions consists of only one QUERY specification (named_query_spec) (specified in named_query_term), the result of the expression is the unchanged result of the QUERY specification.

If a QUERY expression consists of more than one QUERY specification, the number of selected columns in all QUERY specifications of the QUERY expression must be the same. The respective ith selected columns of the QUERY specifications must be comparable.

Column type (select column) |
Numeric columns | Are comparable. If all ith selected columns are numeric columns, the ith column of the result table is a numeric column.
Alphanumerical column, code attribute BYTE | Are comparable.
Alphanumeric columns, code attribute ASCII, EBCDIC, UNCODE | Are comparable. Are also comparable with date, time, and timestamp values.
All ith columns are date values | The ith column of the result table is a date value.
All ith columns are time values | The ith column of the result table is a time value.
All ith columns are timestamp values | The ith column of the result table is a timestamp value.
Columns of the type BOOLEAN | Are comparable.
All ith columns are of the type BOOLEAN | The ith column of the result table is of the type BOOLEAN.
Columns of any other data type (not mentioned above) | The ith column of the result table is an alphanumeric column. Comparable columns with differing code attributes are converted.

If columns are comparable but have different lengths, the corresponding column of the result table has the maximum length of the underlying columns.

Column names in the result table

The names of the result table columns are formed from the names of the selected columns of the first QUERY specification.

Let T1 be the left operand of UNION, EXCEPT, or INTERSECT (defined in named_query_term). Let T2 be the right operand. Let R be the result of the operation on T1 and T2.

  • A row is a duplicate of another row if both have identical values in each column. NULL values are assumed to be identical. Special NULL values are assumed to be identical.
  • UNION: R contains all rows from T1 and T2.
  • EXCEPT: R contains all rows from T1 which have no duplicate rows in T2.
  • INTERSECT: R contains all rows from T1 which have a duplicate row in T2. A row from T2 can only be a duplicate row of exactly one row from T1. More than one row from T1 cannot have the same duplicate row in T2.
  • DISTINCT is implicitly assumed for the query expressions belonging to T1 and T2 if ALL is not specified. All duplicate rows are removed from R.

If parentheses are missing, then INTERSECT will be evaluated before UNION and EXCEPT. UNION and EXCEPT have the same precedence and will be evaluated from left to right in the case that parentheses are missing.


QUERY term (named query term) (SAP Library - SAP DB)

 Entering content frame

QUERY term (named query term)

A QUERY term ( named_query_term ) is part of the syntax in a QUERY expression ( named_query_expression ).

Syntax

<named_query_term> ::= <named_query_primary> | <named_query_term> INTERSECT [ALL] <query_primary>

<named_query_primary> ::= <named_query_spec> | (<named_query_expression>)
<query_primary> ::= <query_spec> | (<query_expression>)

named_query_spec , named_query_expression , query_spec , query_expression

Explanation

See QUERY expression (named_query_expression)


QUERY specification (query_spec) (SAP Library - SAP DB)

 Entering content frame

QUERY specification (query_spec)

QUERY specifications ( query_spec ) are required to generate an unordered result table in a SELECT statement . A QUERY specification is part of the syntax in a QUERY term (query_term) or QUERY term (named_query_term) .

Syntax

<query_spec> ::= SELECT [<distinct_spec>] <select_column>,... <table_expression>

distinct_spec , select_column , table_expression

Explanation

A QUERY specification specifies a result table. The result table is generated from a temporary result table. The temporary result table is the result of the table expression .


DISTINCT function (distinct spec) (SAP Library - SAP DB)

 Entering content frame

DISTINCT function (distinct spec)

The DISTINCT specification (distinct_spec) is specified in a QUERY specification (query_spec) , QUERY specification (named_query_spec) , or SINGLE SELECT statement to remove duplicate rows.

Syntax

<distinct_spec> ::= DISTINCT | ALL

Explanation

A row is a duplicate of another row if both have identical values in each column. NULL values are assumed to be identical. Special NULLvalues are also assumed to be identical.

DISTINCT: all duplicate rows are removed from the result table.

ALL: no duplicate rows are removed from the result table.

If no DISTINCT specification is specified, no duplicate rows are removed from the result table.


Selected Column (select_column) (SAP Library - SAP DB)

 Entering content frame

Selected Column (select_column)

Selected columns (select_column) must be specified in a QUERY specification (query_spec) or a QUERY specification (named_query_spec) to specify a result table.

The sequence of selected columns defines the columns in the result table. The columns in the result table are produced from the columns of the temporary result table and by the rowno columns or stamp columns, if these exist. The columns of the temporary result table are determined by the FROM clause of the table expression . The order of the column names in the temporary result table is determined by the order of the table names in the FROM clause.

Syntax

<select_column> ::= <table_columns> | <derived_column> | <rowno_column> | <stamp_column>

<table_columns> ::= * | <table_name>.* | <reference_name>.*
<derived_column> ::= <expression> [ [AS] <result_column_name>] | <result_column_name> = <expression>
<rowno_column> ::= ROWNO [<result_column_name>] | <result_column_name> = ROWNO
<stamp_column> ::= STAMP [<result_column_name>] | <result_column_name> = STAMP

<result_column_name> ::= <identifier>
 table_name , reference_name , expression , identifier

Explanation

Every column name that is specified as a selected column must uniquely denote a column in a QUERY specification (query spec) of the underlying tables. If necessary, the column name must be qualified with the table name.

The specification of a column with the data type LONG in a selected column is only valid in the uppermost sequence of selected columns in a QUERY statement or SINGLE SELECT statement if the DISTINCT specification was not used there.

The specification of a column with the data type LONG in a selected column is only valid in the uppermost sequence of select columns in a CREATE VIEW statement which is based on exactly one base table.

If a selected column contains a set function (set function spec) , the sequence of selected columns to which the selected column belongs must not contain any table columns, and every column name occurring in an expression must denote a grouping column, or the expression must consist of grouping columns.

It is possible to specify scalar subqueries .

  • Specifying table columns in a selected column is a quick way of specifying the result table columns.
    • Specifying a selected column of the type * is a quick way of specifying all temporary result table columns.
      Columns for which the user has not the SELECT privilege and the implicitly generated column SYSKEY are not passed.
    • Specifying <table_name>.* or <reference_name>.* is quick way of specifying all the columns in the underlying table. The first column name of the result table is taken from the first column name of the underlying table, the second column name of the result table corresponds to the second column name of the underlying table, etc. The order of column names in the underlying table corresponds to the order determined when the underlying table is defined.
      Columns for which the user has not the SELECT privilege and the implicitly generated column SYSKEY are not passed.
  • Specifying derived column in a selected column defines a column in the result table. If a column of the result table has the form <expression> [AS] <result_column_name> or the form <result_column_name> = <expression>, this result column receives the name result_column_name.
    If no     <result_column_name> is specified and the expression is a column specification that denotes a column in the temporary result table, the column in the result table receives the column name of the temporary result table.
    If no     <result_column_name> is specified and the expression is not a column specification, the column receives the name EXPRESSION_, where "_" denotes a number with a maximum of three digits, starting with EXPRESSION1, EXPRESSION2, etc.
  • A ROWNO column may only be used in a selected column that belongs to a QUERY statement.
    If a rowno column is specified, a column with the data type     FIXED (10) is generated with the name ROWNO. It contains the values 1, 2, 3,... which the numbers of the result table rows.
    If the ROWNO column was specified in the form     ROWNO <result_column_name> or the form <result_column_name> = ROWNO, this result column receives the name result_column_name.
    A rowno column>must not be ordered by using ORDER BY.
  • A STAMP column may only be specified in a selected column that belongs to a QUERY- expression of an INSERT statement .
    The database system is able to generate unique values. This is a serial number that starts with X'000000000001'. The values are assigned in ascending order. It cannot be ensured that a sequence of values is uninterrupted.
    If a stamp column is specified, the next value of the data type     CHAR (8) BYTE generated by the database system is produced for each row in the temporary result table.

Each column of a result table has exactly the same data type, the same length, the same precision, and the same scale as the derived column or the column underlying the table columns.

This does not apply to the data types DATE and TIMESTAMP. To enable the representation of any date and time format, the length of the result table column is set to the maximum length required for the representation of a date value (length 10) or a timestamp value (length 26).


QUERY specification (named_query_spec) (SAP Library - SAP DB)

 Entering content frame

QUERY specification (named_query_spec)

QUERY specifications ( named_query_spec ) are required to generate an unordered result table in a SELECT statement (named_select_statement) . A QUERY specification is part of the syntax in a QUERY term (named_query_term) .

Syntax

<named_query_spec> ::= SELECT [<distinct_spec>] <result_table_name> (<select_column>,...) <table_expression>

distinct_spec , result_table_name , select_column , table_expression

Explanation

A QUERY specification specifies a result table with the name result_table_name . The result table is generated from a temporary result table. The temporary result table is the result of the table expression .


Table expression (SAP Library - SAP DB)

 Entering content frame

Table expression

A table expression specifies a single or a simple or grouped result table (see result table name ).

Syntax

<table_expression> ::= <from_clause> [<where_clause>] [<group_clause>] [<having_clause>]

from_clause , where_clause , group_clause , having_clause

Explanation

A table expression produces a temporary result table. If there are no optional clauses, this temporary result table is the result of the from clause. Otherwise, each specified clause is applied to the result of the previous condition and the table is the result of the last specified clause. The temporary result table contains all of the columns in all the tables listed in the from clause.

The order of the GROUP and HAVING clauses is random.


FROM clause (SAP Library - SAP DB)

 Entering content frame

FROM clause

A FROM clause specifies a table in a table expression that is formed from one or more tables.

Syntax

<from_clause> ::= FROM <from_table_spec>,...

from_table_spec

Explanation

The from clause specifies a table. This table can be derived from several base, view, and result tables (see Table ). The number of underlying tables in a FROM clause is equal to the total number of underlying tables in each FROM TABLE specification. The number of underlying tables in a from clause must not exceed 64.

The user must have the SELECT privilege for each specified table or for at least one column in the specified table.

The result of a FROM clause is a table that is generated from the specified tables as follows:

  • If the FROM clause comprises a single FROM TABLE specification, the result is the specified table.
  • If the from clause contains more than one from table specification, a result table is built that includes all possible combinations of all rows of the first table with all rows of the second table, etc. From a mathematical perspective, this is the Cartesian product of all the tables.

This rule describes the effect of the from clause, not its actual implementation.


FROM TABLE specification (SAP Library - SAP DB)

 Entering content frame

FROM TABLE specification

Each FROM TABLE specification ( from_table_spec) in a FROM clause specifies either no table identifier, one table identifier, or any number of table identifiers.

Syntax

<from_table_spec> ::= <table_name> [AS] [<reference_name>]
| <result_table_name> [AS] [<reference_name>]
| (<query_expression>) [AS] [<reference_name>]
| <joined_table>

table_name, reference_name, result_table_name, query_expression, joined_table

Explanation

Reference Name (reference_name)

If a FROM TABLE specification does not contain a reference name, the table name ( table_name) or result table name ( result_table_name) is the table identifier.

If a FROM TABLE specification contains a reference name, the reference name is the table identifier.

Each reference name must be different from each identifier that specifies a table name. If a result table name is a table identifier, then there can be no table identifier with the form <table_name> equals [<owner>]<result_table_name>, in the case where the owner <owner> is the current user. Each table identifier must differ from any other table identifier.

The validity range of the table identifiers is the entire QUERY specification within which the FROM TABLE specification is used. If column names are to be qualified within the query specification, table identifiers must be used for this purpose.

Reference names are essential for formulating JOIN conditions within a table. For example, FROM HOTEL, HOTEL X defines a reference name X for the second occurrence of the HOTEL table. Reference names are also necessary sometimes to formulate correlated subqueries. Similarly, a reference name is required if a column in the result of a QUERY expression can only be identified uniquely by specifying the reference name.

Number of Underlying Tables

If a from table specification denotes a base table, result table, or the result of a query expression, the number of tables underlying this from table specification is equal to 1.

If a from table specification denotes a complex view table, the number of tables underlying this from table specification is equal to 1.

If a from table specification denotes a view table that is not a complex view table, the number of underlying tables is equal to the number of tables underlying the FROM condition of the view table.

If a from table specification denotes a JOINED TABLE, the number of tables underlying this from table specification is equal to the total number of underlying tables of the FROM TABLE specifications contained in it.

QUERY Expression (query_expression)

A FROM TABLE specification that contains a QUERY expression specifies a table identifier only if a reference name is specified.

If a FROM TABLE specification contains a QUERY expression, a result table is built that matches this QUERY expression. This result table obtains a system-internal name that collides neither with an unnamed nor a named result table. While the from condition is being processed, the result of the query expression is used in the same way as a named result table and is deleted implicitly after processing.

A table expression containing at least one OUTER JOIN indicator (see JOIN predicate) or OUTER JOIN TYPE (LEFT | RIGHT | FULL) (see joined_table) is subject to strict restrictions if it is to be based on more than two tables. For this reason, a QUERY expression is frequently required to formulate a QUERY specification that is to be based on at least three tables and in which at least one OUTER JOIN indicator is used in a JOIN predicate.

JOINED TABLE (joined_table)

A from table specification containing a JOINED TABLE (joined_table) specifies the number of table identifiers that are specified by the FROM TABLE specifications it contains.


joined_table (SAP Library - SAP DB)

 Entering content frame

joined_table

JOINED TABLE (joined table) can be specified as part of a FROM TABLE specification (from table spec) .

Syntax

<joined_table> ::=
<from_table_spec> CROSS JOIN <from_table_spec>
| <from_table_spec> [INNER] JOIN <from_table_spec> <join_spec>
| <from_table_spec> [<LEFT|RIGHT|FULL> [OUTER]] JOIN <from_table_spec> <join_spec>

<join_spec> ::= ON <search_condition>

from_table_spec , search_condition , column_name

Explanation

If a FROM TABLE specification comprises a JOINED TABLE, the result is generated as follows:

Let FT1 be the set of all rows in the table specified by the first from table specification. Let FT2 be the set of all rows in the table specified by the second from table specification.

  • If JOINED TABLE is specified as CROSS JOIN, a table is created that comprises all possible combinations of FT1 and FT2. From a mathematical perspective, the Cartesian product of the two tables is calculated.
  • If JOINED TABLE is specified with the keyword JOIN without the optional keywords INNER, LEFT, RIGHT, FULL, or OUTER, the JOIN type is assumed to be INNER.

Let T be the set of result rows consisting of all possible combinations of FT1 and FT2. Each result row satisfies the join specification for this set.

  • If JOINED TABLE is specified with the JOIN type INNER, the result is the set T.
  • If JOINED TABLE is specified with the JOIN type LEFT, the result is the set T plus the rows from FT1 that are not in T. The result columns that are not formed from FT1 are assigned the NULL value.
  • If JOINED TABLE is specified with the JOIN type RIGHT, the result is the set T plus the rows from FT2 that are not in T. The result columns that are not formed from FT2 are assigned the NULL value.
  • If JOINED TABLE is specified with the JOIN type FULL, the result is the set T plus the rows from FT1 that are added by the JOIN types LEFT and RIGHT.

The rules specified for the WHERE condition apply to the JOIN specification (join_spec) ON <search_condition> with the restriction that no links using the Boolean operator OR are permitted.


WHERE Clause (where_clause) (SAP Library - SAP DB)

 Entering content frame

WHERE Clause (where_clause)

The WHERE clause specifies the conditions for building a result table (see result table name ).

Syntax

<where_clause> ::= WHERE <search_condition>

search_condition

Explanation

The search condition is applied to each row in the temporary result table formed by the FROM clause . The result of the WHERE clause is a table that only contains those rows from the result table for which the search condition is true.

The search condition may only contain column specifications for which the user has the SELECT privilege.

Each column specification directly contained in the search condition must uniquely identify a column from the tables specified in the FROM clause of the table expression . If necessary, the column name must be qualified with the table identifier. If reference names are defined in the FROM clause for table names, they must be used as table identifiers in the search condition.

Expressions in the search condition must not contain a set function (set_function_spec) , except in the exception below.

SELECT ... FROM uppertab,…
HAVING ... (SELECT ...
                  WHERE MIN(uppertab, ...)...
           )

The SELECT statement is allowed in the specified format.

HAVING clause : In a subquery used in this clause, it is possible to use WHERE clauses that contain Set functions for the columns of the table used in the SELECT … HAVING statement ( Correlated Subquery ).

In the case of correlated subqueries, a column specification can identify a column in a table that was specified in a FROM clause of a different table expression in the QUERY specification .

Each subquery in the search condition is usually evaluated only once. In the case of a correlated subquery, the subquery is executed for each row in the result table generated by the from clause.


GROUP Clause (group_clause) (SAP Library - SAP DB)

 Entering content frame

GROUP Clause (group_clause)

The GROUP clause specifies grouping criteria for a result table (see result table name ).

Syntax

<group_clause> ::= GROUP BY <expression>,...

expression

Explanation

Each column name specified in the GROUP clause must identify a result_column_name in the selected columns of the QUERY specification or uniquely identify a column in the tables on which the QUERY specification is based. If necessary, the column name must be qualified with the table identifier.

The GROUP clause allows the functions SUM , AVG , MAX/MIN , COUNT , STDDEV , and VARIANCE to be applied not only to entire result tables but also to groups of rows within a result table. A group is defined by the grouping columns specified in GROUP BY. All rows of a group have the same values in the grouping columns. Rows containing the NULL value in a grouping column are combined to form a group. The same is true for the special NULL value .

GROUP BY generates one row for each group in the result table. The selected columns in the QUERY specification, therefore, may only contain those grouping columns and operations on grouping columns, as well as those expressions that use the functions SUM, AVG, MAX/MIN, COUNT, STDDEV, and VARIANCE.

If no rows satisfy the conditions indicated in the WHERE clause and a group clause was specified, the result table is empty.

Specifying scalable subqueries is not permissible in a GROUP clause.

See also:

Restrictions


HAVING clause (SAP Library - SAP DB)

 Entering content frame

HAVING clause

The HAVING clause specifies the properties of a group.

Syntax

<having_clause> ::= HAVING <search_condition>

search_condition

Explanation

Each expression in the search condition that does not occur in the argument of a set function (set_function_spec) must identify a grouping column.

If the having clause is used without a GROUP clause , the result table built so far is regarded as a group.

The search condition is applied to each group in the result table. The result of the HAVING clause is a table that only contains those groups for which the search condition is true.


Subquery (SAP Library - SAP DB)

 Entering content frame

Subquery

A subquery specifies a result table (see result table name ) that can be used in certain predicates and for updating column values.

Syntax

<subquery> ::= (<query_expression>)

query_expression

Explanation

Subqueries can be used in a SET UPDATE condition of an UPDATE statement . In this case, the subquery must produce a result table that contains a maximum of one row.

Subqueries can be used in an INSERT statement ( INSERT statement) ).

Subqueries can be used in the following predicates:

Comparison predicate
EXISTS predicate
IN predicate
Quantified predicate

See also:

Scalar Subquery

Correlated Subquery


Correlated Subquery (SAP Library - SAP DB)

 Entering content frame

Correlated Subquery

Certain predicates can contain subqueries. These subqueries, in turn, can contain other subqueries, etc. A subquery with further subqueries is the higher-level subquery of the subqueries it contains.

· The search condition of a subquery can contain column names that belong to tables that are contained in higher levels in the FROM clause. This type of subquery is called a correlated subquery.

· Tables that are used in subqueries in this way are called correlated tables. No more than 16 correlated tables are allowed within an SQL statement.

· Columns that are used in subqueries in this way are called correlated columns. A total of 64 correlated columns can be used in an SQL statement.

If the qualifying table name or reference name does not clearly identify a table at a higher level, the table at the lowest level is taken from these non-unique tables.

If the column name is not qualified by the table name or reference name, the tables at higher levels are searched. The column name must be unique in all tables of the from clause to which the table found belongs.

If a correlated subquery is used, the values of one or more columns in a temporary result row at a higher level are included in the searchcondition of a subquery at a lower level, whereby the result of the subquery is used to uniquely qualify the higher-level temporary result row.

Example tables hotel and room.
For every city, the names of all hotels are searched which have single room prices less than the average price of the city concerned.

SELECT name, city FROM hotel X, room

WHERE X.hno = room.hno AND room.roomtype = 'SINGLE' AND room.price <

(SELECT AVG(room.price) FROM hotel, room

WHERE hotel.hno = room.hno AND hotel.city = X.city AND room.roomtype = 'SINGLE' )

Name | City
Eight Avenue | Los Angeles
Sunshine | Los Angeles
Atlantic | New York


Scalar Subquery (scalar_subquery) (SAP Library - SAP DB)

 Entering content frame

Background documentation Scalar Subquery (scalar_subquery)

A scalar subquery (scalar_subquery) is a special subquery.

Syntax

<scalar_subquery> ::= <subquery>

subquery

Explanation

Scalar subqueries are produced through the restriction of the result set of a result table to a maximum of one value.

Scalar subqueries can be used as expressions (see factor).

Scalar subqueries are not allowed in a GROUP clause or an ORDER clause.

Scalar subquery in the list of the values to be inserted in an INSERT statement for the table hotel:

INSERT hotel VALUES((SELECT MAX(hno)+10 FROM hotel), 'Three Seasons', 90014, 'Los Angeles', '247 Broad Street')

Scalar subquery in a selected column:

SELECT hno, price, (SELECT MIN(price) FROM room) FROM room


ORDER Clause (order_clause) (SAP Library - SAP DB)

 Entering content frame

ORDER Clause (order_clause)

The ORDER clause specifies a sort sequence for a result table (see result table name ).

Syntax

<order_clause> ::= ORDER BY <sort_spec>,...

<sort_spec> ::= <unsigned_integer> [ASC | DESC] | <expression> [ASC | DESC]

unsigned_integer , expression

Explanation

The sort columns specified in the order clause determine the sequence of the sort criteria.

A number n specified in the sorting specification (sort_spec) identifies the nth column in the result table. n must be less than or equal to the number of columns in the result table.

Scalable subqueries are not permissible in an ORDER clause.

ASC/DESC

ASC: the values are sorted in ascending order.

DESC: the values are sorted in descending order.

The default setting is ASC.

Further information

If a QUERY expression consists of more than one QUERY specification , sort specifications must be specified in the form <unsigned_integer> [ASC | DESC].

If a query specification was specified with DISTINCT, the total of the internal lengths of all sorting columns must not exceed 1016 characters; otherwise it can comprise 1020 characters.

Column names in the sort specifications must be columns in the tables of the FROM clause or a result_column_name in the selected columns of the QUERY specification.

If DISTINCT or a set function in a selected column was used, the sort specification must identify a column in the result table.

Values are compared in accordance with the rules for the comparison predicate . For sorting purposes, NULL value s are greater than non-NULL values, and special NULL value s are greater than non-NULL values but less than NULL values.

See also:

Restrictions


UPDATE Clause (update_clause) (SAP Library - SAP DB)

 Entering content frame

UPDATE Clause (update_clause)

The UPDATE clause specifies that a result table (see result table name) is to be updateable. The system sets exclusive locks for all rows that form this result table.

Syntax

<update_clause> ::= FOR UPDATE [OF <column_name>,...] [NOWAIT]

column_name

Explanation

The specified column names must identify columns in the tables underlying the QUERY specification. They do not have to occur in a selected column.

The QUERY statement that contains the UPDATE clause must generate an updateable result table.

The UPDATE clause is a prerequisite for using the results table with CURRENT OF <result_table_name> in the UPDATE statement, in the DELETE statement, and in the LOCK statement. The update clause is meaningless for other forms of the above mentioned SQL statements, as well as in interactive mode.

All columns of the underlying base tables are updateable if the user has the corresponding privileges, irrespective of whether they were specified as a column name.

For performance reasons, it is recommended to specify column names only if the cursor is to be used in an update statement.

Assume that the a column x fulfills the following conditions:

· x is contained in the primary key or an index

· x is contained in the search condition of the QUERY statement

· x is contained in a SET UPDATE clause of the UPDATE statement in the type x = <expression>, where the expression contains the column x.

If all of the conditions are fulfilled, it is essential that you specify the column x as a column name in the UPDATE clause.

If at least one of these conditions is not satisfied, the column name should not be specified.

NOWAIT

If NOWAIT is not specified and a lock collision occurs, the system waits for the locked data object to be released (but only as long as is specified by the database parameter REQUEST_TIMEOUT).

If NOWAIT is specified, the database system does not wait until another user has released a data object. Instead, it returns a message if a collision occurs. If there is no collision, the requested lock is set.


LOCK Option (lock_option) (SAP Library - SAP DB)

 Entering content frame

LOCK Option (lock_option)

The LOCK option requests a lock for each selected row.

Syntax

<lock_option> ::=
  WITH LOCK [(IGNORE)|(NOWAIT)] [EXCLUSIVE|OPTIMISTIC] [ISOLATION LEVEL <unsigned_integer>]

unsigned_integer may only have the values 0, 1, 2, 3, 10, 15, 20, or 30

Explanation

IGNORE

If (IGNORE) is not specified and a lock collision occurs, the system waits for a locked row to be released (but only as long as is specified by the database parameter REQUEST_TIMEOUT ).

If (IGNORE) is specified, the system does not wait for a locked row to be released by another transaction. Instead, it ignores this row if a lock collision occurs. If there is no collision, the requested lock is set. (IGNORE) can only be specified in isolation level 1.

NOWAIT

If (NOWAIT) is not specified and a lock collision occurs, the system waits for the locked data object to be released (but only as long as is specified by the database parameter REQUEST_TIMEOUT).

If (NOWAIT) is specified, the database system does not wait until another user has released a data object. Instead, it returns a message if a collision occurs. If there is no collision, the requested lock is set.

EXCLUSIVE

An exclusive lock is defined. As long as the locked row has not been changed or deleted, the exclusive lock can be released using the UNLOCK statement .

OPTIMISTIC

An optimistic lock is defined on rows. This is only meaningful in connection with isolation levels 0 , 1, 10 , and 15 .

Share Lock

If neither EXCLUSIVE nor OPTIMISTIC is specified, a share lock is set on the corresponding rows.

ISOLATION LEVEL

The locks are set independently of the ISOLATION specification (isolation_spec) of the CONNECT statement . The isolation level of the LOCK option can have a higher or lower value than that in the CONNECT statement.

If an isolation level is specified by the lock option, it is only valid for the duration of the SQL statement which contains the LOCK option specification. Afterwards, the isolation level that was specified in the CONNECT statement is applicable again. In the case of a SELECT statement (named_select_statement) , SELECT statement (select_statement) , or an OPEN CURSOR statement , for which the result table is not actually physically generated, the specified isolation level is valid for this SQL statement and all FETCH statements that refer to the result table. The isolation level that was specified in the CONNECT statement is applicable for other SQL statements that were executed in the meantime.

See also:

Lock Behavior


OPEN CURSOR statement (SAP Library - SAP DB)

 Entering content frame

OPEN CURSOR statement

An OPEN CURSOR statement generates the result table defined under the specified name with a DECLARE CURSOR statement .

Syntax

<open_cursor_statement> ::= OPEN <result_table_name>

result_table_name

Explanation

Existing result tables are implicitly deleted when a result table is generated with the same name.

All result tables generated within the current transaction are implicitly deleted at the end of the transaction using the ROLLBACK statement .

All result tables are implicitly deleted at the end of the session using the RELEASE statement . A CLOSE statement can be used to delete them explicitly beforehand.

If the name of a result table is identical with that of a base table, view table (see Table ), or a synonym , these tables cannot be accessed as long as the result table exists.

At any given time when a result table is processed, there is a position which may be before the first row, on a row, after the last row or between two rows. After generating the result table, this position is before the first row of the result table.

Depending on the search strategy, either all the rows in the result table are searched when the OPEN CURSOR statement is executed and the result table is physically generated, or each next result table row is searched when a FETCH statement is executed, without being physically stored. This must be considered for the time behavior of open cursor statements and fetch statements.

If the result table is empty, the return code 100 – row not found - is set.

The number of rows in the result table is returned in the SQLCA in the third entry of SQLERRD. If this counter has the value -1, there is at least one result row.


FETCH statement (SAP Library - SAP DB)

 Entering content frame

FETCH statement

The FETCH statement assigns the values of the current row in a result table (see result table name ) to parameters.

Syntax

<fetch_statement> ::=
FETCH [FIRST | LAST | NEXT | PREV | <position> | SAME] [<result_table_name>] INTO <parameter_spec>,...

<position> ::= POS (<unsigned_integer>) | POS (<parameter_spec>)
| ABSOLUTE <integer> | ABSOLUTE <parameter_spec>
| RELATIVE <integer> | RELATIVE <parameter_spec>

result_table_name , parameter_spec , unsigned_integer , integer

Explanation

If no result table name is specified, the fetch statement refers to the last unnamed result table that was generated (see named/unnamed result table ).

Depending on the search method, either all the rows in the result table are searched when the OPEN CURSOR statement , the SELECT statement (select_statement) , or the SELECT statement (named_select_statement) is executed and the result table is generated, or each subsequent row in the result table is searched when a FETCH statement is executed, but they are not physically stored. This must be taken into account for the time behavior of FETCH statements. Depending on the isolation level selected, this can also cause locking problems with a FETCH, e.g. return code 500 - LOCK REQUEST TIMEOUT.

Row not found

Let C be the position in the result table. The return code 100 - ROW NOT FOUND - is output and no values are assigned to the parameters if any of the following conditions is satisfied:

  • The result table is empty.
  • C is positioned on or after the last result table row, and FETCH or FETCH NEXT is specified.
  • C is positioned on or before the first row of the result table and FETCH PREV is specified.
  • FETCH is specified with a position which does not lie within the result table.

FIRST | LAST | NEXT | PREV

  • FETCH FIRST or FETCH LAST: the result table is not empty. C is positioned in the first or last row of the result table and the values of this row are assigned to the parameters.
  • FETCH or FETCH NEXT: C is positioned before a row in the result table. C is positioned in this row and the values of this row are assigned to the parameters.
  • FETCH or FETCH NEXT: C is positioned in a row that is not the last row in the result table. C is positioned in the next row and the values in this row are assigned to the parameters.
  • FETCH PREV: C is positioned behind a row in the result table. C is positioned in this row and the values of this row are assigned to the parameters.
  • FETCH PREV: C is positioned in a row that is not the first row in the result table. C is positioned in the previous row and the values in this row are assigned to the parameters.

Position: POS

Regardless of an ORDER clause , there is an implicit order of the rows in a result table. This can be displayed by specifying a rowno column as a selected column . The specified position refers to this internal numbering.

If a position is defined with POS, the parameter specification must denote a positive integer.

If a position that is less than or equal to the number of rows in the result table was defined with POS, C is set to the corresponding row and the values of this row are assigned to the parameters. If a position that is greater than the number of rows in the result table was specified, the message 100 – ROW NOT FOUND is output.

Position: ABSOLUTE

Let x be the value of the integer or parameter specification specified with the position. Let abs_x be the absolute value of x.

  • FETCH ABSOLUTE and x is : FETCH ABSOLUTE is the same as a FETCH POS.
  • FETCH ABSOLUTE and x=0: the return code 100 – row not found is set.
  • FETCH ABSOLUTE and x is negative: C is set after the last row of the result table where FETCH PREV is executed abs_x times. The last row found is the result of the SQL statement. This description refers to the logic and not the flow of the statement. If abs_x is larger than the number of rows in the result table, the message 100 – ROW NOT FOUND is output.

Position: RELATIVE

Let x be the value of the integer or parameter specification specified with the position. Let abs_x be the absolute value of x.

  • FETCH RELATIVE and x is positive: FETCH NEXT is executed x times from the current position in the result table C.
  • FETCH RELATIVE and x=0: corresponds to a FETCH SAME.
  • FETCH RELATIVE and x is negative: FETCH PREV is executed abs_x times starting from C. This description refers to the logic and not the flow of the statement. The return code 100 – row not found is output if one of the conditions in the section "row not found" is fulfilled.

FETCH SAME

The last row found in the result table is output again.

Parameter specification

The parameter specification specified in position must denote an integer.

The remaining parameters in the parameter specification are output parameters. The parameter identified by the nth parameter specification corresponds to the nth value in the current result table row. If the number of columns in this row exceeds the number of specified parameters, the column values for which no corresponding parameters exist are ignored. If the number of columns in the row is less than the number of specified parameters, no values are assigned to the remaining parameters. You must specify an indicator name in order to assign NULL values or special NULL values .

Numbers are converted and character strings are truncated or lengthened, if necessary, to suit the corresponding parameters. If an error occurs when assigning a value to a parameter, the value is not assigned and no further values are assigned to the corresponding parameters for this fetch statement. Any values that have already been assigned to parameters remain unchanged.

Let p be a parameter and v the corresponding value in the current row of the result table.

  • v is a number: p must be a numeric parameter and v must be within the permissible range of p.
  • v is a character string: p must be an alphanumeric parameter.

Further information

If no FOR REUSE was specified in the QUERY statement (see SELECT statement ), subsequent INSERT, update, or delete statements that refer to the underlying base table and are executed by the current user or by other users can cause several executions of a fetch statement to denote different rows in the result table, even though the same position was specified.

You can prevent other users from making changes by executing a LOCK statement for the entire table or by using the isolation level 2, 3, 15, 20, or 30 with the CONNECT statement or the LOCK option of the query statement.
FOR REUSE must be specified if this is not possible or if the user makes changes to this table. Changes made in the meantime are not visible in this case.

If a result table that was physically created contains LONG columns and if the isolation levels 0, 1, and 15 are used, consistency between the content of the LONG columns and that of the other columns is not ensured. If the result table was not physically generated, consistency is not ensured at isolation level 0 only. For this reason, it is advisable to ensure consistency by using a LOCK statement or the isolation levels 2, 3, 20, or 30.


CLOSE statement (SAP Library - SAP DB)

 Entering content frame

CLOSE statement

The CLOSE statement deletes a result table (see result table name ).

Syntax

<close_statement> ::= CLOSE [<result_table_name>]

result_table_name

Explanation

  • If the name of a result table is specified, this result table is deleted. This name can be used to denote another result table.
  • If no result table name is specified, an existing unnamed result table is deleted.

An unnamed result table is implicitly deleted by the next SELECT statement .

Result tables are implicitly deleted when a result table with the same name is generated.

All result tables generated within the current transaction are implicitly deleted at the end of the transaction using the ROLLBACK statement .

All result tables are implicitly deleted at the end of the session using the RELEASE statement .


SINGLE SELECT statement (SAP Library - SAP DB)

 Entering content frame

SINGLE SELECT statement

A SINGLE SELECT statement specifies a result table with one row (see result table name ) and assigns the values in this row to parameters.

Syntax

<single_select_statement> ::=
SELECT [<distinct_spec>] <select_column>,...
INTO <parameter_spec>,... FROM <from_table_spec>,...
[<where_clause>] [<group_clause>] [<having_clause>] [<lock_option>]

distinct_spec , select_column , parameter_spec , from_table_spec , where_clause , group_clause , having_clause , lock_option

Explanation

The number of rows in the result table must not be greater than one. If the result table is empty or contains more than one row, corresponding messages or error codes are issued and no values are assigned to the parameters specified in the parameter specifications. The return code 100 – row not found - is set if the result table is empty.

If the result table contains just one row, the values of this row are assigned to the corresponding parameters. The FETCH statement rules apply for assigning the values to the parameters.

The order of the GROUP and HAVING clauses is random.

A LONG column can only be specified in a selected column in the uppermost sequence of selected columns in a single select statement if the DISTINCT specification DISTINCT was not used there.


EXPLAIN Statement (explain_statement) (SAP Library - SAP DB)

 Entering content frame

EXPLAIN Statement (explain_statement)

The EXPLAIN statement describes the search strategy used internally by the database system for a QUERY statement or SINGLE SELECT statement (statements for searching for certain rows in specific tables). This statement indicates, in particular, whether and in which form key columns or indexes are used for the search.

Syntax

<explain_statement> ::=
  EXPLAIN [(<result_table_name>)] <query_statement>
| EXPLAIN [(<result_table_name>)] <single_select_statement>

result_table_name, query_statement, single_select_statement

Explanation

The explain statement can be used to check the effect of creating or deleting indexes (see index) on the choice of search strategy for the specified SQL statement. You can also estimate the time needed by the database system to process the specified SQL statement. The specified QUERY or SINGLE SELECT statement is not executed while the EXPLAIN statement is being executed.

You can find information on the Optimizer functions in Optimizer: SAP DB 7.4.

The EXPLAIN statement generates a result table (see Result Table Name). You can give the result table a name, otherwise it is called SHOW.

Structure of the EXPLAIN Result Table

OWNER | CHAR(64)
TABLENAME | CHAR(64)
COLUMN_OR_INDEX | CHAR(64)
STRATEGY | CHAR(40)
PAGECOUNT | CHAR(10)

The sequence in which the SELECT is processed is described by the order of the rows in the result table.

STRATEGY

The STRATEGY column shows which search strategy or strategies are used and whether a result table is generated. A result table is physically generated if the column STRATEGY contains RESULT IS COPIED in the last result row.

See also Entries in the Strategy Column

COLUMN_OR_INDEX

The COLUMN_OR_INDEX column shows which key column or indexed column or which index is used for the strategy.

PAGECOUNT

The PAGECOUNT column shows which sizes are assumed for the tables or, in the case of certain strategies, for the indexes. These sizes influence the choice of the search strategy.

The assumed sizes are updated using the UPDATE STATISTICS statement and can be requested by selecting the system table OPTIMIZERSTATISTICS. The current sizes of tables or indexes can be checked by selecting the TABLESTATISTICS and INDEXSTATISTICS system tables. If there are large discrepancies between the values contained in the OPTIMIZERSTATISTICS and TABLESTATISTICS, perform the update statistics statement for this table.

If the system discovers during a search in a table that the values determined by the last UPDATE STATISTICS statement are extremely low, a row is entered in the sysupdstatwanted system table that contains the table name. In all other cases, rows are entered in this system table that describe columns in tables. The UPDATE STATISTICS statement should be executed for tables and columns in tables that are described in the SYSUPDSTATWANTED system table.

The last row contains the estimated SELECT cost value in the PAGECOUNT column. The specifications for COSTLIMIT and COSTWARNING in the CREATE USER, CREATE USERGROUP, ALTER USER, and ALTER USERGROUP statements refer to this estimated SELECT cost value.


CONNECT Statement (connect_statement) (SAP Library - SAP DB)

 Entering content frame

CONNECT Statement (connect_statement)

A CONNECT statement opens a database session and a transaction for a database user.

Syntax

<connect_statement> ::=
  CONNECT <parameter_name> IDENTIFIED BY <parameter_name> [<connect_option>...]
| CONNECT <parameter_name> IDENTIFIED BY <password> [<connect_option>...]
| CONNECT <user_name> IDENTIFIED BY <parameter_name> [<connect_option>...]
| CONNECT <user_name> IDENTIFIED BY <password> [<connect_option>...]

<connect_option> ::=
  SQLMODE <INTERNAL|ANSI|DB2|ORACLE>
| ISOLATION LEVEL <unsigned_integer>
| TIMEOUT <unsigned_integer>

parameter_name, password, user_name, unsigned_integer

Explanation

If the parameter name/user name and parameter name/password combination is valid, the user opens a database session and gains access to the database. As a result, he or she is the current user in this session.

A transaction is implicitly opened.

Each connect option ( connect_option) may only be specified once.

SQLMODE

The specification SQLMODE <INTERNAL|ANSI|DB2|ORACLE> can be used to select the SQL mode. The default SQL mode is INTERNAL.

The CONNECT option SQLMODE <INTERNAL|ANSI|DB2|ORACLE> is not allowed in programs. The appropriate precompiler option must be used to specify an SQLMODE other than INTERNAL.

ISOLATION LEVEL

The isolation level specified in the connect statement is applied to each new transaction. This specification determines the lock operation type (Lock Behavior).

The isolation level is set using an integer without a plus/minus sign after the keywords ISOLATION LEVEL. The following values are permissible: 0, 1, 2, 3, 10, 15, 20, and 30. If no isolation level is specified, isolation level 1 is used.

· Isolation Level 0

· Isolation Level 1 or 10

· Isolation Level 15

· Isolation Level 2 or 20

· Isolation Level 3 or 30

TIMEOUT

The specified timeout value must be smaller than or the same as the current timeout value, otherwise an error is returned at logon.

If no timeout value is specified, the system uses the current timeout value.

If the TIMEOUT value is set to 0, the inactivity period is not monitored. This can result in a situation where database resources are not available again even though the associated application was concluded or aborted without a RELEASE statement.

Users with the NOT EXCLUSIVE attribute

Users defined with the attribute NOT EXCLUSIVE can open several sessions at the same time. Whenever this is the case, or whenever two users of the same user group open a session at the same time, the sessions are considered to be distinct. This means that lock requests of the sessions concerned can collide.


SET Statement (set_statement) (SAP Library - SAP DB)

 Entering content frame

SET Statement (set_statement)

The SET statement alters the properties of a database session.

Syntax

<set_statement> ::= SET ROLE ALL [EXCEPT <role_name>] | SET ROLE NONE
| SET ROLE <role_name> [IDENTIFIED BY <password>]
| SET ISOLATION LEVEL <unsigned_integer>

role_name, password, unsigned_integer

Explanation

SET ROLE

DEFAULT ROLE in the ALTER USER statement or ALTER USERGROUP statement specifies which of the roles assigned to the current user or user group is active in the user session or group member session. If a role is active, the current user has all the privileges that are included in the role.

If the ALTER USER statement or ALTER USERGROUP statement assigns a role to the current user that is activated automatically when a session is opened, then this role is deactivated when the SET statement is executed, if it has not been identified by the SET ROLE specification in the SET statement.

· ALL: all roles assigned to the current user are active. EXCEPT can be used to exclude specified roles from activation.

· NONE: none of the roles is active.

· Role name specified: the roles specified here must exist and be assigned to the current user. If a password exists for the role, it must be defined in the set statement in addition to the owner of the role.
The role identified with role name is activated.

ISOLATION LEVEL

Specifying an isolation level changes the lock behavior for all subsequent SQL statements of the current database session.

The isolation level is set using an integer without a plus/minus sign after the keywords ISOLATION LEVEL. The following values are permissible: 0, 1, 2, 3, 10, 15, 20, and 30.

· Isolation Level 0

· Isolation Level 1 or 10

· Isolation Level 15

· Isolation Level 2 or 20

· Isolation Level 3 or 30


COMMIT Statement (commit_statement) (SAP Library - SAP DB)

 Entering content frame

COMMIT Statement (commit_statement)

A COMMIT statement ( commit_statement) terminates the current transaction and starts a new one (see transactions).

Syntax

<commit_statement> ::= COMMIT [WORK]

lock_statement

Explanation

The commit statement terminates the current transaction. This means that the modifications executed within the transaction are recorded and are thus visible to concurrent users as well. The locks assigned to the transaction are released.

The COMMIT statement implicitly opens a new transaction. Any locks set within the new transaction are assigned to this transaction. The setting of locks in the new transaction is controlled by the isolation level declared in the CONNECT statement (see Isolation Level).


ROLLBACK Statement (rollback_statement) (SAP Library - SAP DB)

 Entering content frame

ROLLBACK Statement (rollback_statement)

The ROLLBACK statement cancels the current transaction and starts a new transaction.

Syntax

<rollback_statement> ::= ROLLBACK [WORK]

lock_statement

Explanation

The ROLLBACK statement cancels the current transaction. This means that any modifications made within the transaction are reversed. The locks assigned to the transaction are released.

The ROLLBACK statement implicitly opens a new transaction. Any locks set within the new transaction are assigned to this transaction. The setting of locks in the new transaction is controlled by the isolation level declared in the CONNECT statement (see Isolation Level).

All result tables generated within the current transaction are implicitly deleted at the end of the transaction using the ROLLBACK statement.


SUBTRANS Statement (subtrans_statement) (SAP Library - SAP DB)

 Entering content frame

SUBTRANS Statement (subtrans_statement)

The SUBTRANS statement divides a transaction into units known as subtransactions .

Syntax

<subtrans_statement> ::= SUBTRANS BEGIN | SUBTRANS END | SUBTRANS ROLLBACK

Explanation

SUBTRANS BEGIN

A subtransaction is opened, that is, the database records the current point in the transaction. This can be followed by any sequence of SQL statements. If this sequence does not contain an additional SUBTRANS BEGIN, all database modifications performed since the SUBTRANS BEGIN can be reversed using a SUBTRANS ROLLBACK.

The sequence, however, can also contain additional SUBTRANS BEGIN statements that open additional subtransactions. This means several nested subtransactions may be open at the same time.

SUBTRANS END

A subtransaction is closed, that is, the database system "forgets" the point in the transaction recorded with SUBTRANS BEGIN. An open subtransaction must exist for this purpose. If more than one open subtransaction exists, the last opened subtransaction is closed; that is, it is no longer considered to be an open subtransaction.

SUBTRANS ROLLBACK

SUBTRANS ROLLBACK reverses all database modifications performed within a subtransaction and then closes the subtransaction. Any database modifications performed by any subtransactions within the subtransaction are reversed, irrespective of whether they were ended with SUBTRANS END or SUBTRANS ROLLBACK. All result tables generated within the subtransaction are closed.

An open subtransaction must exist for this purpose. If more than one open subtransaction exists, the last opened subtransaction is rolled back. The subtransaction concerned is then no longer considered open.

Further information

The subtrans statement does not affect locks assigned to the transaction. In particular, SUBTRANS END and SUBTRANS ROLLBACK do not release any locks.

The subtrans statement is particularly useful in keeping the effects of subroutines or database procedures atomic; that is, it ensures that they either fulfil all their tasks or else have no effect. To this end, a SUBTRANS BEGIN is issued initially. If the subroutine succeeds in fulfilling its task, it is ended with a SUBTRANS END; in the event of an error, a SUBTRANS ROLLBACK is used to reverse all the modifications performed by the subroutine.

The COMMIT statement and the ROLLBACK statement close any open subtransactions implicitly.


LOCK Statement(lock_statement) (SAP Library - SAP DB)

 Entering content frame

LOCK Statement(lock_statement)

The LOCK statement assigns a lock to the current transaction (see lock ).

Syntax

<lock_statement> ::=
LOCK [(WAIT)|(NOWAIT)] <lock_spec> IN SHARE MODE
LOCK [(WAIT)|(NOWAIT)] <lock_spec> IN EXCLUSIVE MODE
LOCK [(WAIT)|(NOWAIT)] <lock_spec> IN SHARE MODE <lock_spec> IN EXCLUSIVE MODE
LOCK [(WAIT)|(NOWAIT)] <row_spec>... OPTIMISTIC

<lock_spec> ::= TABLE <table_name>,... | <row_spec>...
| TABLE <table_name>,... <row_spec>...

row_spec , table_name

Explanation

The specified table cannot be a base table, a view table (see table ), nor a synonym . If the table name identifies a view table, locks are set on the base tables on which the view table is based.

WAIT/NOWAIT

  • If (NOWAIT) is specified, the database does not wait for a lock to be released by another transaction. Instead, it issues an error message if a lock collision occurs. If there is no collision, the requested lock is set.
  • In the event of a lock collision, if either the wait option is omitted or (WAIT) is specified, the system waits for locks to be released, until the period specified by the database parameter REQUEST_TIMEOUT has elapsed.

<row_spec>...

A <row_spec>... creates a lock for the table row denoted by the key values or a position in a result table.

Specifying a row_spec requires that the specified table have a key column; that is, if the table name identifies a view table, this must be modifiable.

TABLE <table_name>,...

If TABLE <table_name>,... is specified, a lock is created for the table in question.

If the view table identified by the table name is not changeable, only a share lock can be set for this view table. As a result of this SQL statement, share locks are set for all base tables underlying the view table.

SHARE

SHARE defines a share lock for the listed objects. To set share locks, the current user must have the SELECT privilege.

EXCLUSIVE

EXCLUSIVE defines an exclusive lock for the listed objects. To set exclusive locks, the current user must have the UPDATE, DELETE, or INSERT privilege.

OPTIMISTIC

OPTIMISTIC defines an optimistic lock on rows. This is only meaningful in connection with isolation levels 0 , 1, 10 , and 15 .

Deadlock

Whenever the database system recognizes a deadlock caused by locks, it ends the transaction with an implicit ROLLBACK WORK.

Reproducibility

If reproducible results are needed to read rows using a select statement, the read objects must be locked and the locks must be kept until reproduction. Reproducibility usually requires that share locks are set for the tables concerned, either by explicitly locking them using one or more lock statements, or implicitly by using the isolation level 3 . This ensures that other users cannot modify the table.

See also:

Lock Behavior


ROW specification (row spec) (SAP Library - SAP DB)

 Entering content frame

ROW specification (row spec)

The ROW specification (row_spec) is a syntax element in a LOCK statement or an UNLOCK statement .

Syntax

<row_spec> ::= ROW <table_name> KEY <key_spec>,...
| ROW <table_name> CURRENT OF <result_table_name>

table_name , result_table_name

Explanation

For tables defined without key columns, the implicit key column SYSKEY CHAR(8) BYTE can be used in a key specification.

If CURRENT OF <result_table_name> is specified, the result table must have been specified with FOR UPDATE.


UNLOCK Statement (unlock_statement) (SAP Library - SAP DB)

 Entering content frame

UNLOCK Statement (unlock_statement)

The UNLOCK statement releases rows on rows.

Syntax

<unlock_statement> ::= UNLOCK <row_spec>... IN SHARE MODE
| UNLOCK <row_spec>... IN EXCLUSIVE MODE
| UNLOCK <row_spec>... IN SHARE MODE <row_spec>... IN EXCLUSIVE MODE
| UNLOCK <row_spec>... OPTIMISTIC

row_spec

Explanation

Using the UNLOCK statement, locks of the following types can be released within a transaction for single table rows that have not yet been changed: share locks , optimistic locks , and exclusive locks .

If a row has not been inserted, changed, or deleted, its exclusive lock cannot be released using the UNLOCK statement.

The unlock statement does not fail if the specified lock does not exist or cannot be released.

See also:

Lock Behavior


RELEASE Statement (release_statement) (SAP Library - SAP DB)

 Entering content frame

RELEASE Statement (release_statement)

The RELEASE statement terminates a user's transaction and database session .

Syntax

<release_statement> ::= COMMIT [WORK] RELEASE | ROLLBACK [WORK] RELEASE

Explanation

Ending a session using a release statement implicitly deletes all result tables, the data stored in temporary base tables, and the metadata of these tables.

COMMIT WORK RELEASE

The current transaction is aborted without opening a new one. The user session is ended.

If the database system has to reverse the current transaction implicitly, COMMIT WORK RELEASE fails, and a new transaction is opened. The user session is not ended in this case.

ROLLBACK WORK RELEASE

The current transaction is aborted without opening a new one. Any database modifications performed during the current transaction are undone. The user session is ended. ROLLBACK WORK RELEASE has the same effect as a ROLLBACK statement followed by COMMIT WORK RELEASE.

If the accounting function in the database system is activated, information on the session is added to the table SYSACCOUNT.


Statistics (SAP Library - SAP DB)

 Entering content frame

Statistics

The database system addresses disks in units of 8KB. The term ‘page’ is used to refer to these units.

SQL statements for statistics management

UPDATE STATISTICS statement

MONITOR statement


UPDATE STATISTICS Statement (update_statistics_statement) (SAP Library - SAP DB)

 Entering content frame

UPDATE STATISTICS Statement (update_statistics_statement)

The UPDATE STATISTICS statement defines the storage requirements of tables and indexes as well as the value distribution of columns, and stores this information in the database catalog.

Syntax

<update statistics statement> ::=
  UPDATE STAT[ISTICS] COLUMN <table name>.<column name> [ESTIMATE [<sample definition>]]
| UPDATE STAT[ISTICS] COLUMN (<column name>,...) FOR <table name> [ESTIMATE [<sample definition>]]
| UPDATE STAT[ISTICS] COLUMN (*) FOR <table name> [ESTIMATE [<sample definition>]]
| UPDATE STAT[ISTICS] <table name> [ESTIMATE [<sample definition>]]
| UPDATE STAT[ISTICS] [<owner>.][<identifier>]* [ESTIMATE [<sample definition>]]

table_name, column_name, sample_definition, owner, identifier

Explanation

When the update statistics statement is executed, information on the table, such as the number of rows, the number of pages used, the sizes of indexes, the value distribution within columns or indexes, and so on, is stored in the database catalog. These values are used by the Optimizer to determine the best strategy for executing SQL statements.

You will find information on the Optimizer functions in Optimizer 7.4.

The update statistics statement implicitly performs a COMMIT statement for each base table; i.e. the transaction within which the update statistics statement has been executed is closed.

When a CREATE INDEX statement is executed, the above-mentioned information is stored in the database catalog for the index as well as for the base table for which this index is being defined. No information is stored for other indexes defined on this base table.

The statistical values stored in the database catalog can be retrieved by selecting the system table OPTIMIZERSTATISTICS. Each row of the table describes statistical values of indexes, columns or the size of a table.

For a definition of the statistics system tables, see System Tables, Definition of the System Tables .

<table name>

If a table name is specified, the table must be a non-temporary base table and the user must have a privilege for it.

<column name>

If a column name is specified, this column must exist in specified table.

If * is specified, all columns in the table are assumed.

<identifier>*

Specifying <identifier>* has the same effect as issuing the update statistics statement for all base tables for which the current user has a privilege, and whose table name begins with the identifier.

UPDATE STATISTICS *

The SYSDBA user can use UPDATE STATISTICS * to execute the update statistics statement for all base tables, even if the SYSDBA has not been assigned a privilege for these tables.

ESTIMATE

· If ESTIMATE and a sample definition are specified, the database system estimates the statistical values by selecting data at random. The number of random selects can be given as number of rows or as percentage. For a specification of 50% or more, all rows are analyzed. The runtime of the update statistics statement can be considerably reduced by specifying ESTIMATE. In most cases, the precision of the statistical values determined is sufficient.

· If ESTIMATE is specified without a sample definition, the database system estimates the statistical values by selecting data at random. The number of selects was defined with the CREATE TABLE statement or an ALTER TABLE statement by means of a sample_definition for the specified table. For a specification of 50% or more, all rows are analyzed. The runtime of the update statistics statement can be considerably reduced by specifying ESTIMATE. In most cases, the precision of the statistical values determined is sufficient.

· If ESTIMATE is not specified, the database system determines exact statistical values by considering the complete data of the table. For large tables, the runtime can be considerably long.


MONITOR Statement (monitor_statement) (SAP Library - SAP DB)

 Entering content frame

MONITOR Statement (monitor_statement)

The MONITOR statement can be used to initialize counters for monitoring the database with 0.

Syntax

<monitor statement> ::= MONITOR INIT

Explanation

The database system always records result counters. These are initialized with 0 when the system is started. The MONITOR statement can be used to reset them to 0.

The event counters recorded by the database system can be retrieved by selecting monitor system tables.

For a definition of the monitor system tables, see System Tables, Definition of the System Tables .


Restrictions (SAP Library - SAP DB)

 Entering content frame

Restrictions

Maximum values

Identifier length | 32 characters
Precision of numeric values | 38 digits
Number of tables | unlimited
Internal length of a table row | 8088 bytes
Length of a LONG column | 2147483647 bytes
Number of columns per table (with KEY) | 1024
Number of columns per table (without KEY) | 1023
Number of primary key columns per table | 512
Sum of internal lengths of all key columns | 1024 bytes
Number of indexes per table | 255
Number of columns in an index | 16
Sum of internal lengths of all columns belonging to an index | 1024 bytes
Number of referential CONSTRAINT definitions (foreign key dependencies) per table | unlimited
Number of columns in a referential CONSTRAINT definition | 16
Number of triggers per table | 3
Number of rows per table | unlimited
Number of result columns in a SELECT instruction | 1023
Number of join tables in a SELECT statement | 64
Number of join conditions in a WHERE clause of a SELECT statement | 128
Number of correlated columns in an SQL statement | 64
Number of correlated columns in an SQL statement | 16
Number of the columns in an ORDER or GROUP clause | 128
Length of the columns in an ORDER or GROUP clause | 1020 bytes
Number of parameters in an SQL statement | 2000
Length of an SQL statement (Configuration parameter _PACKET_SIZE less administration overhead) | at least 16000 bytes


Syntax List (SAP Library - SAP DB)

 Entering content frame

Component documentation Syntax List

The syntax notation used in this document is BNF.

The syntax rules are specified in the following form:

Clause ::=
  Rule

If you want an explanation of the syntax rules, you can use the clause link to go to the relevant part of the Reference Manual. As a result, you exit the syntax list itself.

If further syntax rules are required for the individual syntax modules, you can access these by selecting the relevant links in the left-hand part of the syntax rules, or by directly selecting the syntax module in the alphabetical syntax list.


Syntax Notation (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Syntax Notation

This documentation uses the BNF syntax notation with the following conventions:

 | Explanation
KEYWORDS | Keywords are shown in uppercase letters for the sake of clarity. They can be entered in uppercase or lowercase letters.
<xyz> | Terms in angle brackets are placeholders for syntactical units explained in this document. Do not use angle brackets when entering an SQL statement.
clause ::= rule | Clauses are the building blocks of SQL statements. Rules describe how these building blocks are put together to form more complex clauses and also dictate the notation that is used.
clause1 clause2 | The two clauses are written one after the other, separated by at least one blank.
[clause] | Optional clause. This clause can be ignored. Do not use square brackets when entering an SQL statement.
Clause1 | clause2 | ... | clausen | Alternative clauses. You can use exactly one of these clauses.
Clause,... | The clause can be repeated as often as required. The individual repetitions must be written one after the other and separated by a comma and any number of blanks.
Clause... | The clause can be repeated as often as required. The individual repetitions must be written directly one after the other without a separating comma or blank.


add_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation add_definition

< add_definition > ::=
  ADD < column_definition >,...
| ADD (<column_definition>,...)
| ADD < constraint_definition >
| ADD < referential_constraint_definition >
| ADD < key_definition >


alias_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alias_name

< alias_name > ::=
  < identifier >


all_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation all_function

< all_function > ::=
  < set_function_name > ( [ALL] < expression > )


alter_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_definition

< alter_definition > ::=
  ALTER CONSTRAINT < constraint_name > CHECK < search_condition >
| ALTER < key_definition >


alter_index_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_index_statement

< alter_index_statement > ::=
  ALTER INDEX < index_name > [ON < table_name >] ENABLE
| ALTER INDEX <index_name> [ON <table_name>] DISABLE
| ALTER INDEX <index_name> [ON <table_name>] INIT USAGE


alter_password_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_password_statement

< alter_password_statement >::=
  ALTER PASSWORD <old_ password > TO <new_password>
| ALTER PASSWORD < user_name > <new_password>


alter_table_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_table_statement

< alter_table_statement > ::=
  ALTER TABLE < table_name > < add_definition >
| ALTER TABLE <table_name> < drop_definition >
| ALTER TABLE <table_name> < alter_definition >
| ALTER TABLE <table_name> < column_change_definition >
| ALTER TABLE <table_name> < modify_definition >
| ALTER TABLE <table_name> < referential_constraint_definition >
| ALTER TABLE <table_name> DROP FOREIGN KEY < referential_constraint_name >
| ALTER TABLE <table_name> < sample_definition >


alter_user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_user_statement

< alter_user_statement > ::=
  ALTER USER < user_name > [< user_mode >]
    [TIMEOUT < unsigned_integer > | TIMEOUT NULL]
    [COSTWARNING <unsigned_integer> | COSTWARNING NULL]
    [COSTLIMIT <unsigned_integer> | COSTLIMIT NULL]
    [DEFAULT ROLE ALL [EXCEPT < role_name >] | DEFAULT ROLE NONE
    | DEFAULT ROLE <role_name> [IDENTIFIED BY < password >]]
    [[NOT] EXCLUSIVE]
    [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]


alter_usergroup_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation alter_usergroup_statement

< alter_usergroup_statement > ::=
  ALTER USERGROUP < usergroup_name > [< usergroup_mode >]
    [TIMEOUT < unsigned_integer > | TIMEOUT NULL]
    [COSTWARNING <unsigned_integer> | COSTWARNING NULL]
    [COSTLIMIT <unsigned_integer> | COSTLIMIT NULL]
    [DEFAULT ROLE ALL [EXCEPT < role_name >] | DEFAULT ROLE NONE
    | DEFAULT ROLE <role_name> [IDENTIFIED BY < password >]]
    [[NOT] EXCLUSIVE]
    [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]


argument (SAP Library - SAP DB)

 Entering content frame

Syntax documentation argument

< argument > ::=
  < identifier >


arithmetic_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation arithmetic_function

< arithmetic_function > ::=
  TRUNC ( < expression >[, <expression>] )
| ROUND ( <expression>[, <expression>] )
| NOROUND ( <expression> )
| FIXED ( <expression>[, < unsigned_integer > [, <unsigned_integer] ] )
| FLOAT ( <expression>[, <unsigned_integer> ] )
| CEIL ( <expression> )
| FLOOR ( <expression> )
| SIGN ( <expression> )
| ABS ( <expression> )
| POWER ( <expression>, <expression> )
| EXP ( <expression> )
| SQRT ( <expression> )
| LN ( <expression> )
| LOG ( <expression>, <expression> )
| PI
| LENGTH ( <expression> )
| INDEX ( < string_spec >, <string_spec> [,<expression>[, <expression>] ] )


assignment_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation assignment_statement

< assignment_statement > ::=
  SET < variable_name > = < expression >


between_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation between_predicate

< between_predicate > ::=
  < expression > [NOT] BETWEEN <expression> AND <expression>


bool_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation bool_predicate

< bool_predicate > ::=
  < column_spec > [ IS [NOT] <TRUE | FALSE>]


boolean_factor (SAP Library - SAP DB)

 Entering content frame

Syntax documentation boolean_factor

< boolean_factor > ::=
  [NOT] < predicate >
| [NOT] (< search_condition >)


boolean_term (SAP Library - SAP DB)

 Entering content frame

Syntax documentation boolean_term

< boolean_term > ::=
  < boolean_factor >
| <boolean_term> AND <boolean_factor>


call_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation call_statement

< call_statement > ::=
  CALL < dbproc_name > [(< expression >,...)] [WITH COMMIT]


cascade_option (SAP Library - SAP DB)

 Entering content frame

Syntax documentation cascade_option

< cascade_option > ::=
  CASCADE
| RESTRICT


case_else_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation case_else_clause

< case_else_clause > ::=
  ELSE < statement >


case_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation case_function

< case_function > ::=
  < simple_case_function >
| < searched_case_function >


case_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation case_statement

< case_statement > ::=
  < simple_case_statement >
| < searched_case_statement >


character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation character

< character > ::=
  < digit >
| < letter >
| < extended_letter >
| < hex_digit >
| < language_specific_character >
| < special_character >


close_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation close_statement

< close_statement > ::=
  CLOSE [< result_table_name >]


column_attributes (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_attributes

< column_attributes > ::=
  [< key_or_not_null_spec >] [< default_spec >] [UNIQUE] [< constraint_definition >]
    [REFERENCES < referenced_table > [(< referenced_column >)] [< delete_rule >]]


column_change_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_change_definition

< column_change_definition > ::=
  COLUMN < column_name > NOT NULL
| COLUMN <column_name> DEFAULT NULL
| COLUMN <column_name> ADD < default_spec >
| COLUMN <column_name> ALTER <default_spec>
| COLUMN <column_name> DROP DEFAULT


column_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_definition

< column_definition > ::=
  < column_name > < data_type > [< column_attributes >]
| <column_name> < domain_name > [<column_attributes>]


column_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_list

< column_list > ::=
  < column_name >
| <column_list>, <column_name>


column_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_name

< column_name > ::=
  < identifier >


column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_spec

< column_spec > ::=
  < column_name >
| < table_name >.<column_name>
| < reference_name >.<column_name>
| < result_table_name >.<column_name>


comment (SAP Library - SAP DB)

 Entering content frame

Syntax documentation comment

< comment > ::=
  < string_literal >
| < parameter_name >


comment_on_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation comment_on_statement

< comment_on_statement > ::=
  COMMENT ON < object_spec > IS < comment >


commit_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation commit_statement

< commit_statement > ::=
  COMMIT [WORK]


comp_op (SAP Library - SAP DB)

 Entering content frame

Syntax documentation comp_op

< comp_op > ::=
  <
| >
| <>
| !=
| =
| <=
| >=
| ¬= | ¬< | ¬> (for machines with EBCDIC code)
| ~= | ~< | ~> (for machines with ASCII code)


comparison_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation comparison_predicate

< comparison_predicate > ::=
  < expression > < comp_op > <expression>
| <expression> <comp_op> < subquery >
| < expression_list > < equal_or_not > (<expression_list>)
| <expression_list> <equal_or_not> <subquery>


connect_option (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_option

< connect_option > ::=
  SQLMODE <INTERNAL | ANSI | DB2 | ORACLE>
| ISOLATION LEVEL < unsigned_integer >
| TIMEOUT <unsigned_integer>


connect_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_statement

< connect_statement > ::=
  CONNECT < parameter_name > IDENTIFIED BY <parameter_name> [< connect_option >...]
| CONNECT <parameter_name> IDENTIFIED BY < password > [<connect_option>...]
| CONNECT < user_name > IDENTIFIED BY <parameter_name> [<connect_option>...]
| CONNECT <user_name> IDENTIFIED BY <password> [<connect_option>...]


constraint_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation constraint_definition

< constraint_definition > ::=
  CHECK < search_condition >
| CONSTRAINT <search_condition>
| CONSTRAINT < constraint_name > CHECK <search_condition>


constraint_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation constraint_name

< constraint_name > ::=
  < identifier >


conversion_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation conversion_function

< conversion_function > ::=
  NUM (< expression >)
| CHR (<expression>[,< unsigned_integer >])
| HEX (<expression>)
| HEXTORAW (<expression>)
| CHAR (<expression>[,< datetimeformat >])


create_dbproc_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_dbproc_statement

< create_dbproc_statement > ::=
  CREATE DBPROC < procedure_name > [(< formal_parameter >,..)] [RETURNS CURSOR] AS < routine >


create_domain_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_domain_statement

< create_domain_statement > ::=
  CREATE DOMAIN < domain_name > < data_type > [< default_spec >] [< constraint_definition >]


create_index_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_index_statement

< create_index_statement > ::=
CREATE [UNIQUE] INDEX < index_name > ON < table_name > (< column_name > [ASC | DESC],...)


create_role_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_role_statement

< create_role_statement > ::=
  CREATE ROLE < role_name > [IDENTIFIED BY < password >]


create_sequence_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_sequence_statement

< create_sequence_statement > ::=
  CREATE SEQUENCE [< owner >.]< sequence_name >
    [INCREMENT BY < integer >]
    [START WITH <integer>]
    [MAXVALUE <integer> | NOMAXVALUE]
    [MINVALUE <integer> | NOMINVALUE]
    [CYCLE | NOCYCLE]
    [CACHE < unsigned_integer > | NOCACHE]
    [ORDER|NOORDER]


create_synonym_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_synonym_statement

<create_synonym_statement> ::=
  CREATE [PUBLIC] SYNONYM [<owner>.]<synonym_name> FOR <table_name>


create_table_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_table_statement

< create_table_statement > ::=
  CREATE TABLE < table_name > (<column_definition>
    [,< table_description_element >,...]) [IGNORE ROLLBACK] [< sample_definition >]
| CREATE TABLE <table_name> [(<table_description_element>,...)]
    [IGNORE ROLLBACK] [<sample_definition>] AS < query_expression > [< duplicates_clause >]
| CREATE TABLE <table_name> LIKE <table_name> [IGNORE ROLLBACK]


create_table_temp (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_table_temp

< create_table_temp > :: =
  < create_table_statement > for creating temporary tables,
    that is, the table_name in the CREATE TABLE statement
    must have the format TEMP.< identifier >.


create_trigger_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_trigger_statement

< create_trigger_statement > ::=
  CREATE TRIGGER < trigger_name > FOR < table_name > AFTER < trigger_event ,..>
    EXECUTE (< routine >) [WHENEVER < search_condition >]


create_user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_user_statement

< create_user_statement > ::=
  CREATE USER < user_name > PASSWORD < password >
    [< user_mode >]
    [TIMEOUT < unsigned_integer >]
    [COSTWARNING <unsigned_integer>]
    [COSTLIMIT <unsigned_integer>]
    [[NOT] EXCLUSIVE]
    [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]
| CREATE USER <user_name> PASSWORD <password> LIKE < source_user >
| CREATE USER <user_name> PASSWORD <password> USERGROUP < usergroup_name >


create_usergroup_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_usergroup_statement

< create_usergroup_statement > ::=
  CREATE USERGROUP < usergroup_name >
    [< usergroup_mode >]
    [TIMEOUT < unsigned_integer >]
    [COSTWARNING <unsigned_integer>]
    [COSTLIMIT <unsigned_integer>]
    [[NOT] EXCLUSIVE]
    [DEFAULTCODE <ASCII | EBCDIC | UNICODE>]


create_view_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation create_view_statement

< create_view_statement > ::=
  CREATE [OR REPLACE] VIEW < table_name > [(< alias_name >,...)]
    AS < query_expression > [WITH CHECK OPTION]


data_type (SAP Library - SAP DB)

 Entering content frame

Syntax documentation data_type

< data_type > ::=
  CHAR[ACTER] [(< unsigned_integer >)] [ASCII | BYTE | EBCDIC | UNICODE]
| VARCHAR [(<unsigned_integer>)] [ASCII | BYTE | EBCDIC | UNICODE]
| LONG [VARCHAR] [ASCII | BYTE | EBCDIC | UNICODE]
| BOOLEAN
| FIXED (<unsigned_integer> [,<unsigned_integer>])
| FLOAT (<unsigned_integer>)
| INT[EGER]
| SMALLINT
| DATE
| TIME
| TIMESTAMP


date_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation date_function

< date_function > ::=
  ADDDATE ( < date_or_timestamp_expression >, < expression > )
| SUBDATE ( <date_or_timestamp_expression>, <expression> )
| DATEDIFF ( <date_or_timestamp_expression>, <date_or_timestamp_expression> )
| DAYOFWEEK ( <date_or_timestamp_expression> )
| WEEKOFYEAR ( <date_or_timestamp_expression> )
| DAYOFMONTH ( <date_or_timestamp_expression> )
| DAYOFYEAR ( <date_or_timestamp_expression> )
| MAKEDATE ( <expression>, <expression> )
| DAYNAME ( <date_or_timestamp_expression> )
| MONTHNAME ( <date_or_timestamp_expression> )


date_or_timestamp_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation date_or_timestamp_expression

< date_or_timestamp_expression > ::=
  < expression >


datetimeformat (SAP Library - SAP DB)

 Entering content frame

Syntax documentation datetimeformat

< datetimeformat > ::=
  EUR
| INTERNAL
| ISO
| JIS
| USA


dbproc_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dbproc_name

< dbproc_name > ::=
  [< owner >.]< procedure_name >


declare_cursor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation declare_cursor_statement

< declare_cursor_statement > ::=
  DECLARE < result_table_name > CURSOR FOR < select_statement >


default_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation default_predicate

< default_predicate > ::=
  < column_spec > < comp_op > DEFAULT


default_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation default_spec

< default_spec > ::=
  DEFAULT < literal >
| DEFAULT NULL
| DEFAULT USER
| DEFAULT USERGROUP
| DEFAULT SYSDBA
| DEFAULT DATE
| DEFAULT TIME
| DEFAULT TIMESTAMP
| DEFAULT UTCDATE
| DEFAULT UTCDIFF
| DEFAULT TIMEZONE
| DEFAULT TRUE
| DEFAULT FALSE
| DEFAULT TRANSACTION
| DEFAULT STAMP
| DEFAULT SERIAL[(< unsigned_integer >)]


delete_rule (SAP Library - SAP DB)

 Entering content frame

Syntax documentation delete_rule

< delete_rule > ::=
  ON DELETE CASCADE
| ON DELETE RESTRICT
| ON DELETE SET DEFAULT
| ON DELETE SET NULL


delete_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation delete_statement

< delete_statement > ::=
  DELETE [FROM] < table_name > [< reference_name >]
    [KEY < key_spec >,...] [WHERE < search_condition >]
| DELETE [FROM] <table_name> [<reference_name>]
    WHERE CURRENT OF < result_table_name >


Delimiter token (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Delimiter token

< delimiter_token > ::=
  ( | ) | , | . | + | - | * | / | < | > | <> | != | = | <= | >=
| ¬= | ¬< | ¬> (for machines with EBCDIC code)
| ~= | ~< | ~> (for machines with ASCII code)


derived_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation derived_column

< derived_column > ::=
  < expression > [ [AS] < result_column_name >]
| <result_column_name> = <expression>


digit (SAP Library - SAP DB)

 Entering content frame

Syntax documentation digit

< digit > ::=
  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9


digit_sequence (SAP Library - SAP DB)

 Entering content frame

Syntax documentation digit_sequence

< digit_sequence > ::=
  < digit >...


distinct_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation distinct_function

< distinct_function >::=
  < set_function_name > ( DISTINCT < expression > )


distinct_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation distinct_spec

< distinct_spec > ::=
  DISTINCT
| ALL


domain_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation domain_name

< domain_name > ::=
  [< owner >.]< identifier >


double_quotes (SAP Library - SAP DB)

 Entering content frame

Syntax documentation double_quotes

< double_quotes > ::=
  "


drop_dbproc_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_dbproc_statement

< drop_dbproc_statement > ::=
  DROP DBPROC < dbproc_name >


drop_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_definition

< drop_definition > ::=
  DROP < column_name >,... [< cascade_option >] [RELEASE SPACE]
| DROP (<column_name>,...) [<cascade_option>] [RELEASE SPACE]
| DROP CONSTRAINT < constraint_name >
| DROP PRIMARY KEY


drop_domain_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_domain_statement

< drop_domain_statement > ::=
  DROP DOMAIN < domain_name >


drop_index_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_index_statement

< drop_index_statement > ::=
  DROP INDEX < index_name > [ON < table_name >]


drop_role_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_role_statement

< drop_role_statement > ::=
  DROP ROLE < role_name >


drop_sequence_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_sequence_statement

< drop_sequence_statement > ::=
  DROP SEQUENCE [< owner >.]< sequence_name >


drop_synonym_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_synonym_statement

< drop_synonym_statement > ::=
  DROP [PUBLIC] SYNONYM [< owner >.]< synonym_name >


drop_table_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_table_statement

< drop_table_statement > ::=
  DROP TABLE < table_name > [< cascade_option >]


drop_trigger_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_trigger_statement

< drop_trigger_statement > ::=
  DROP TRIGGER < trigger_name > OF < table_name >


drop_user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_user_statement

< drop_user_statement > ::=
  DROP USER < user_name > [< cascade_option >]


drop_usergroup_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_usergroup_statement

< drop_usergroup_statement > ::=
  DROP USERGROUP < usergroup_name > [< cascade_option >]


drop_view_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation drop_view_statement

< drop_view_statement > ::=
  DROP VIEW < table_name > [< cascade_option >]


duplicates_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation duplicates_clause

< duplicates_clause > ::=
  REJECT DUPLICATES
| IGNORE DUPLICATES
| UPDATE DUPLICATES


equal_or_not (SAP Library - SAP DB)

 Entering content frame

Syntax documentation equal_or_not

< equal_or_not > ::=
  <>
| =
| Ø = (for machines with EBCDIC code)
| ~= (for machines with ASCII code)


exists_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation exists_predicate

< exists_predicate > ::=
  EXISTS < subquery >


exists_table_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation exists_table_statement

< exists_table_statement > ::=
  EXISTS TABLE < table_name >


explain_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation explain_statement

< explain_statement > ::=
  EXPLAIN [(< result_table_name >)] < query_statement >
| EXPLAIN [(<result_table_name>)] < single_select_statement >


exponent (SAP Library - SAP DB)

 Entering content frame

Syntax documentation exponent

< exponent > ::=
  [< sign >][[< digit >]<digit>]<digit>


expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation expression

< expression > ::=
  < term >
| <expression> + <term>
| <expression> - <term>


expression_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation expression_list

< expression_list > ::=
  (< expression >,...)


extended_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extended_expression

< extended_expression > ::=
  < expression >
| DEFAULT
| STAMP


extended_letter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extended_letter

< extended_letter > ::=
  #
| @
| $


extended_value_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extended_value_spec

< extended_value_spec > ::=
  < value_spec >
| DEFAULT
| STAMP


extraction_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extraction_function

< extraction_function > ::=
  YEAR ( < date_or_timestamp_expression > )
| MONTH ( <date_or_timestamp_expression> )
| DAY ( <date_or_timestamp_expression> )
| HOUR ( < time_or_timestamp_expression > )
| MINUTE ( <time_or_timestamp_expression> )
| SECOND ( <time_or_timestamp_expression> )
| MICROSECOND ( < expression > )
| TIMESTAMP ( <expression>[, <expression> ] )
| DATE ( <expression> )
| TIME ( <expression> )


factor (SAP Library - SAP DB)

 Entering content frame

Syntax documentation factor

< factor > ::=
  [< sign >] < value_spec >
| [<sign>] < column_spec >
| [<sign>] < function_spec >
| [<sign>] < set_function_spec >
| < scalar_subquery >
| < expression >


fetch_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation fetch_statement

< fetch_statement > ::=
  FETCH [FIRST | LAST | NEXT | PREV | < position > | SAME] [< result_table_name >]
    INTO < parameter_spec >,...


final_select (SAP Library - SAP DB)

 Entering content frame

Syntax documentation final_select

< final_select > ::=
  < select_statement >


first_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation first_character

< first_character > ::=
  < letter >
| < extended_letter >
| < language_specific_character >


first_password_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation first_password_character

< first_password_character > ::=
  < letter >
| < extended_letter >
| < language_specific_letter >
| < digit >


fixed_point_literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation fixed_point_literal

< fixed_point_literal > ::=
  [< sign >]< digit_sequence >[.<digit_sequence>]
| [sign]<digit_sequence>.
| [sign].<digit_sequence>


floating_point_literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation floating_point_literal

< floating_point_literal > ::=
  < mantissa >E< exponent >
| <mantissa>e<exponent>


formal_parameter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation formal_parameter

< formal_parameter > ::=
  IN < argument > < data_type >
| OUT <argument> <data_type>
| INOUT <argument> <data_type>


from_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation from_clause

< from_clause > ::=
  FROM < from_table_spec >,...


from_table_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation from_table_spec

< from_table_spec > ::=
  < table_name > [AS] [< reference_name >]
| < result_table_name > [AS] [<reference_name>]
| (< query_expression >) [AS] [<reference_name>]
| < joined_table >


function_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation function_spec

< function_spec > ::=
  < arithmetic_function >
| < trigonometric_function >
| < string_function >
| < date_function >
| < time_function >
| < extraction_function >
| < special_function >
| < conversion_function >


grant_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation grant_statement

< grant_statement > ::=
  GRANT < priv_spec >,... TO < grantee >,... [WITH GRANT OPTION]
| GRANT EXECUTE ON < dbproc_name > TO <grantee>,...
| GRANT SELECT ON < sequence_name > TO <grantee>,... [WITH GRANT OPTION]


grant_user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation grant_user_statement

< grant_user_statement > ::=
  GRANT USER < granted_users > [FROM < user_name >] TO <user_name>


grant_usergroup_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation grant_usergroup_statement

< grant_usergroup_statement > ::=
  GRANT USERGROUP < granted_usergroups > [FROM < user_name >] TO <user_name>


granted_usergroups (SAP Library - SAP DB)

 Entering content frame

Syntax documentation granted_usergroups

< granted_usergroups > ::=
  < usergroup_name >,...
| *


granted_users (SAP Library - SAP DB)

 Entering content frame

Syntax documentation granted_users

< granted_users > ::=
  < user_name >,...
| *


grantee (SAP Library - SAP DB)

 Entering content frame

Syntax documentation grantee

< grantee > ::=
  PUBLIC
| < user_name >
| < usergroup_name >
| < role_name >


group_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation group_clause

< group_clause > ::=
  GROUP BY < expression >,...


having_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation having_clause

< having_clause > ::=
  HAVING < search_condition >


hex_digit (SAP Library - SAP DB)

 Entering content frame

Syntax documentation hex_digit

< hex_digit > ::=
  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
| A | B | C | D | E | F
| a | b | c | d | e | f


hex_digit_seq (SAP Library - SAP DB)

 Entering content frame

Syntax documentation hex_digit_seq

< hex_digit_seq > ::=
  < hex_digit ><hex_digit>
| <hex_digit_seq><hex_digit><hex_digit>


hex_literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation hex_literal

< hex_literal > ::=
  x''
| X''
| x'< hex_digit_seq >'
| X'<hex_digit_seq>'


hours (SAP Library - SAP DB)

 Entering content frame

Syntax documentation hours

< hours > ::=
  < expression >


identifier (SAP Library - SAP DB)

 Entering content frame

Syntax documentation identifier

< identifier > ::=
  < simple_identifier >
| < double quotes >< special_identifier ><double_quotes>


identifier_tail_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation identifier_tail_character

< identifier_tail_character > ::=
  < letter >
| < extended_letter >
| < language_specific_character >
| < digit >
| < underscore >


if_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation if_statement

< if_statement > ::=
  IF < search_condition > THEN < statement > [ELSE <statement>]


in_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation in_predicate

< in_predicate > ::=
  < expression > [NOT] IN < subquery >
| <expression> [NOT] IN < expression_list >
| <expression_list> [NOT] IN <subquery>
| <expression_list> [NOT] IN (<expression_list>,...)


index_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation index_name

< index_name > ::=
  < identifier >


indicator_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation indicator_name

< indicator_name > ::=
  < parameter_name >


initial_select (SAP Library - SAP DB)

 Entering content frame

Syntax documentation initial_select

< initial_select > ::=
  < query_spec >


insert_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation insert_expression

< insert_expression > ::=
  < extended_expression >
| < subquery >


insert_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation insert_statement

< insert_statement > ::=
  INSERT [INTO] < table_name > [(< column_name >,...)]
    VALUES (< insert_expression >,...) [< duplicates_clause >]
| INSERT [INTO] <table_name> [(<column_name>,...)]
    < query_expression > [<duplicates_clause>]
| INSERT [INTO] <table_name> SET < set_insert_clause >,... [<duplicates_clause>]


integer (SAP Library - SAP DB)

 Entering content frame

Syntax documentation integer

< integer > ::=
  [ sign ]< unsigned_integer >


join_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation join_predicate

< join_predicate > ::=
  < expression > [< outer_join_indicator >] < comp_op > <expression> [<outer_join_indicator>]


join_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation join_spec

<join_spec> ::=
  ON < search_condition >


joined_table (SAP Library - SAP DB)

 Entering content frame

Syntax documentation joined_table

< joined_table > ::=
  < from_table_spec > CROSS JOIN <from_table_spec>
| <from_table_spec> [INNER] JOIN <from_table_spec> < join_spec >
| <from_table_spec> [<LEFT|RIGHT|FULL> [OUTER]] JOIN
    <from_table_spec> <join_spec>


key_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key_definition

< key_definition > ::
  PRIMARY KEY (< column_name >,...)


key_or_not_null_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key_or_not_null_spec

< key_or_not_null_spec > ::=
  [PRIMARY] KEY
| NOT NULL [WITH DEFAULT]


key_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key_spec

< key_spec > ::=
  < column_name > = < value_spec >


key_word (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key_word

< key_word > ::=
  < not_reserved_key_word >
| < reserved_keyword >


language_specific_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation language_specific_character

< language_specific_character > ::=
  <every letter that occurs in a Northern, Central, or Southern European language
    and is not included in the < letter > list>
| <for UNICODE-enabled databases: every character that is not included in the ASCII code list from 0 to 127>


letter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation letter

< letter > ::=
  A | B | C | D | E | F | G | H | I | J | K | L | M
| N | O | P | Q | R | S | T | U | V | W | X | Y | Z
| a | b | c | d | e | f | g | h | i | j | k | l | m
| n | o | p | q | r | s | t | u | v | w | x | y | z


like_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation like_expression

< like_expression > ::=
  < expression >
| '< pattern_element >...'


like_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation like_predicate

< like_predicate > ::=
  < expression > [NOT] LIKE < like_expression > [ESCAPE <expression>]


literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation literal

< literal > ::=
  < string_literal >
| < numeric_literal >


local_variable (SAP Library - SAP DB)

 Entering content frame

Syntax documentation local_variable

< local_variable > ::=
  < variable_name > < data_type >


local_variable_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation local_variable_list

< local_variable_list > ::=
  < local_variable >
| <local_variable_list>;<local_variable>


local_variables (SAP Library - SAP DB)

 Entering content frame

Syntax documentation local_variables

< local_variables > ::=
  VAR < local_variable_list >;


lock_option (SAP Library - SAP DB)

 Entering content frame

Syntax documentation lock_option

< lock_option > ::=
  WITH LOCK [(IGNORE)|(NOWAIT)] [EXCLUSIVE | OPTIMISTIC] [ISOLATION LEVEL < unsigned_integer >]


lock_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation lock_spec

< lock_spec > ::=
  TABLE < table_name >,...
| < row_spec >...
| TABLE <table_name>,... <row_spec>...


lock_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation lock_statement

< lock_statement > ::=
  LOCK [(WAIT)|(NOWAIT)] < lock_spec > IN SHARE MODE
| LOCK [(WAIT)|(NOWAIT)] <lock_spec> IN EXCLUSIVE MODE
| LOCK [(WAIT)|(NOWAIT)] < row_spec >... OPTIMISTIC
| LOCK [(WAIT)|(NOWAIT)] <lock_spec> IN SHARE MODE <lock_spec> IN EXCLUSIVE MODE


mantissa (SAP Library - SAP DB)

 Entering content frame

Syntax documentation mantissa

< mantissa > ::=
  < fixed_point_literal >


mapchar_set_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation mapchar_set_name

< mapchar_set_name > ::=
  < identifier >


match_char (SAP Library - SAP DB)

 Entering content frame

Syntax documentation match_char

< match_char > ::=
  Every character except
    %
  | *
  | X'1F'
  | < underscore >
  | ?
  | X'1E'
  | (


Match set (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Match set

< match_set > ::=
  < underscore >
| ?
| X'1E'
| < match_char >
| ([<
      Ù (only for code type EBCDIC)
    | ~ (only for code type ASCII)
    | ¬
        >]<match_class>...)


match_string (SAP Library - SAP DB)

 Entering content frame

Syntax documentation match_string

<match_string> ::=
  %
| X'1F'


minutes (SAP Library - SAP DB)

 Entering content frame

Syntax documentation minutes

< minutes > ::=
  < expression >


modify_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation modify_definition

< modify_definition > ::=
  MODIFY (< column_name > [< data_type >] [< column_attributes >]...)


monitor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation monitor_statement

< monitor_statement > ::=
  MONITOR INIT


named_query_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation named_query_expression

< named_query_expression > ::=
  < named_query_term >
| <named_query_expression> UNION [ALL] < query_term >
| <named_query_expression> EXCEPT [ALL] <query_term>


named_query_primary (SAP Library - SAP DB)

 Entering content frame

Syntax documentation named_query_primary

< named_query_primary > ::=
  < named_query_spec >
| (< named_query_expression >)


named_query_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation named_query_spec

< named_query_spec > ::=
  SELECT [< distinct_spec >] < result_table_name > (< select_column >,...) < table_expression >


named_query_term (SAP Library - SAP DB)

 Entering content frame

Syntax documentation named_query_term

< named_query_term > ::=
  < named_query_primary >
| <named_query_term> INTERSECT [ALL] < query_primary >


named_select_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation named_select_statement

< named_select_statement > ::=
  < named_query_expression > [< order_clause >] [< update_clause >] [< lock_option >] [FOR REUSE]


new_index_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation new_index_name

< new_index_name > ::=
  < index_name >


new_table_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation new_table_name

< new_table_name > ::=
  < table_name >


next_stamp_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation next_stamp_statement

< next_stamp_statement > ::=
  NEXT STAMP [INTO] < parameter_name >


not_reserved_key_word (SAP Library - SAP DB)

 Entering content frame

Syntax documentation not_reserved_key_word

<not_reserved_key_word> ::=

A CTION | ACTIVATE | ADABAS | ADD | ADDRESS
ADD_MONTHS | AFTER | ANALYZE | AND | ANSI
APPEND | ARCHIVE | AS | ASC | AT
AUTO | AUTOSAVE |  |  |
B ACKUP_PAGES | BAD | BEFORE | BEGIN | BEGINLOAD
BEGINPROC | BETWEEN | BLOCK | BLOCKSIZE | BOTH
BREAK | BUFFER | BUFFERPOOL | BWHIERACHY | BY
C ACHE | CACHELIMIT | CACHES | CALL | CANCEL
CASCADE | CAST | CATALOG | CATCH | CHECKPOINT
CLEAR | CLOSE | CLUSTER | COMMENT | COMMIT
COMPLETE | COMPUTE | CONFIG | CONNECT | CONSTRAINTS
CONTAINER | CONTINUE | COSTLIMIT | COSTWARNING | CREATE
CURRENT_DATE | CURRENT_SCHEMA | CURRENT_TIME | CURRENT_TIMESTAMP | CURRVAL
CURSOR | CYCLE |  |  |
D ATA | DAYS | DB2 | DBA | DBFUNCTION
DBPROC | DBPROCEDURE | DB_ABOVE_LIMIT | DB_BELOW_LIMIT | DECLARE
DEFAULTCODE | DEGREE | DESC | DESCRIBE | DEVICE
DIAGNOSE | DIMENSION | DISABLE | DIV | DO
DOMAIN | DROP | DSETPASS | DUPLICATES | DYNAMIC
E DITPROC | ELSE | ENABLE | END | ENDLOAD
ENDPROC | ERROR | ESCAPE | ESTIMATE | EUR
EVENT | EXCLUSIVE | EXECUTE | EXPLAIN | EXPLICIT
EXTRACT |  |  |  |
F ACT | FALSE | FETCH | FILE | FLUSH
FORCE | FOREIGN | FORMAT | FREEPAGE | FVERSION
G ET | GRANT |  |  |
H IGH | HOLD | HOURS |  |
I DENTIFIED | IF | IMPLICIT | IN | INCREMENT
INDEXNAME | INDICATOR | INFO | INIT | INITRANS
INOUT | INPROC | INSTANCE | INSTR | IS
ISO | ISOLATION |  |  |
J AVA | JIS |  |  |
K EEP |  |  |  |
L ABEL | LANGUAGE | LAST_DAY | LEADING | LEVEL
LIKE | LOAD | LOCAL | LOCK | LOGFULL
LOGWRITER | LOG_ABOVE_LIMIT | LOW |  |
M AXTRANS | MAXVALUE | MEDIANAME | MEDIUM | MICROSECONDS
MIGRATE | MINUS | MINUTES | MINVALUE | MODE
MODIFY | MONITOR | MONTHS | MONTHS_BETWEEN |
N AME | NEW | NEW_TIME | NEXTVAL | NEXT_DAY
NLSSORT | NLS_DATE_FORMAT | NLS_DATE_LANGUAGE | NLS_LANGUAGE | NLS_SORT
NOCACHE | NOCYCLE | NOLOG | NOMAXVALUE | NOMINVALUE
NONE | NOORDER | NOREWIND | NORMAL | NOSORT
NOWAIT | NUMBER | NVL |  |
O BID | OFF | ONLY | OPEN | OPTIMISTIC
OPTIMIZE | OPTION | OR | ORACLE | OUT
OUTER | OVERWRITE |  |  |
P ACKAGE | PAGE | PAGES | PARAM | PARSE
PARSEID | PASSWORD | PCTFREE | PCTUSED | PERCENT
PING | PIPE | POS | PRECISION | PREPARE
PRIV | PRIVILEGES | PROC | PROCEDURE | PSM
PUBLIC |  |  |  |
Q UICK |  |  |  |
R ANGE | RAW | RAWTOHEX | READ | RECURSIVE
REFERENCES | REGISTER | RELEASE | REMOTE | REMOVE
RENAME | RESOURCE | RESTART | RESTORE | RESTRICT
RESUME | RETURN | RETURNS | REUSE | REVOKE
ROLE | ROLLBACK | ROW | ROWNUM | ROWS
S AME | SAMPLE | SAPR3 | SAVE | SAVEPOINT
SCHEMA | SECONDS | SEGMENT | SELECTIVITY | SEQUENCE
SERVERDB | SESSION | SHARE | SHUTDOWN | SIMILAR
SOUNDS | SQLID | SQLMODE | STANDARD | STANDBY
START | STARTPOS | STAT | STATE | STOP
STORAGE | SUBPAGES | SUBTRANS | SUSPEND | SWITCH
SYNCHRONIZE | SYNONYM | SYSDATE |  |
T ABID | TABLESPACE | TAKEOVER | TAPE | TEMP
THEN | TIMEOUT | TOPIC | TO_CHAR | TO_DATE
TO_NUMBER | TRACE | TRAILING | TRIGGER | TRUE
TRY | TYPE |  |  |
U NIQUE | UNKNOWN | UNLOAD | UNLOCK | UNTIL
UNUSED | USA | USAGE | USERID |
V ALIDPROC | VARCHAR2 | VARYING | VERIFY | VERSION
VIEW | VOLUME | VSIZE | VTRACE |
W AIT | WHENEVER | WHILE | WORK | WRITE
WRITER |  |  |  |
Y EARS |  |  |  |


null_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation null_predicate

< null_predicate > ::=
  < expression > IS [NOT] NULL


numeric_literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation numeric_literal

< numeric_literal > ::=
  < fixed_point_literal >
| < floating_point_literal >


object_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation object_spec

< object_spec > ::=
  COLUMN < table_name >.< column_name >
| DBPROC[EDURE] < dbproc_name >
| DOMAIN < domain_name >
| FOREIGN KEY <table_name>.< referential_constraint_name >
| INDEX < index_name > ON <table_name>
| SEQUENCE < sequence_name >
| [PUBLIC] SYNONYM < synonym_name >
| TABLE <table_name>
| TRIGGER < trigger_name >.<table_name>
| USER < user_name >
| USERGROUP < usergroup_name >
| < parameter_name >


old_index_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation old_index_name

< old_index_name > ::=
  < index_name >


old_table_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation old_table_name

< old_table_name > ::=
  < table_name >


open_cursor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation open_cursor_statement

< open_cursor_statement > ::=
  OPEN < result_table_name >


order_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation order_clause

< order_clause > ::=
  ORDER BY < sort_spec >,...


outer_join_inidicator (SAP Library - SAP DB)

 Entering content frame

Syntax documentation outer_join_inidicator

< outer_join_inidicator > ::=
  (+)


owner (SAP Library - SAP DB)

 Entering content frame

Syntax documentation owner

< owner > ::=
  < user_name >
| < usergroup_name >
| TEMP


parameter_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation parameter_name

< parameter_name > ::=
  :< identifier >
| :<identfier>(<identifier>)
| :<identfier>(.<identifier>.)


parameter_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation parameter_spec

< parameter_spec > ::=
  < parameter_name > [< indicator_name >]


password (SAP Library - SAP DB)

 Entering content frame

Syntax documentation password

< password > ::=
  < identifier >
| < first_password_character >[< identifier_tail_character >...]


pattern_element (SAP Library - SAP DB)

 Entering content frame

Syntax documentation pattern_element

< pattern_element > ::=
  < match_string >
| < match_set >


position (SAP Library - SAP DB)

 Entering content frame

Syntax documentation position

< position > ::=
  POS (< unsigned_integer >)
| POS (< parameter_spec >)
| ABSOLUTE < integer >
| ABSOLUTE <parameter_spec>
| RELATIVE <integer>
| RELATIVE <parameter_spec>


predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation predicate

< predicate > ::=
  < between_predicate >
| < bool_predicate >
| < comparison_predicate >
| < default_predicate >
| < exists_predicate >
| < in_predicate >
| < join_predicate >
| < like_predicate >
| < null_predicate >
| < quantified_predicate >
| < rowno_predicate >
| < sound_predicate >


priv_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation priv_spec

< priv_spec > ::=
  ALL [PRIV[ILEGES]] ON [TABLE] < table_name >,...
| < privilege >,... ON [TABLE] <table_name>,...
| < role_name >


privilege (SAP Library - SAP DB)

 Entering content frame

Syntax documentation privilege

< privilege > ::=
  INSERT
| UPDATE [(< column_name >,...)]
| SELECT [(<column_name>,...)]
| SELUPD [(<column_name>,...)]
| DELETE
| INDEX
| ALTER
| REFERENCES [(<column_name>,...)]


procedure_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation procedure_name

< procedure_name > ::=
  < identifier >


quantified_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation quantified_predicate

< quantified_predicate > ::=
  < expression > < comp_op > < quantifier > < expression_list >
| <expression> <comp_op> <quantifier> < subquery >
| <expression_list> < equal_or_not > <quantifier> (<expression_list>,...)
| <expression_list> <equal_or_not> <quantifier> <subquery>


quantifier (SAP Library - SAP DB)

 Entering content frame

Syntax documentation quantifier

< quantifier > ::=
  ALL
| SOME
| ANY


query_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation query_expression

< query_expression > ::=
  < query_term >
| <query_expression> UNION [ALL] <query_term>
| <query_expression> EXCEPT [ALL] <query_term>


query_primary (SAP Library - SAP DB)

 Entering content frame

Syntax documentation query_primary

< query_primary > ::=
  < query_spec >
| (< query_expression >)


query_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation query_spec

< query_spec > ::=
  SELECT [< distinct_spec >] < select_column >,... < table_expression >


query_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation query_statement

< query_statement > ::=
  < declare_cursor_statement >
| < recursive_declare_cursor_statement >
| < named_select_statement >
| < select_statement >


query_term (SAP Library - SAP DB)

 Entering content frame

Syntax documentation query_term

< query_term > ::=
  < query_primary >
| <query_term> INTERSECT [ALL] <query_primary>


recursive_declare_cursor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation recursive_declare_cursor_statement

< recursive_declare_cursor_statement > ::=
  DECLARE < result_table_name > CURSOR FOR WITH RECURSIVE < reference_name >
    (< alias_name >,...) AS (< initial_select > UNION ALL < recursive_select >) < final_select >


recursive_select (SAP Library - SAP DB)

 Entering content frame

Syntax documentation recursive_select

< recursive_select > ::=
  < query_spec >


reference_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation reference_name

< reference_name > ::=
  < identifier >


referenced_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation referenced_column

< referenced_column > ::=
  < column_name >


referenced_table (SAP Library - SAP DB)

 Entering content frame

Syntax documentation referenced_table

< referenced_table > ::=
  < table_name >


referencing_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation referencing_column

< referencing_column > ::=
  < column_name >


referential_constraint_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation referential_constraint_definition

< referential_constraint_definition > ::=
  FOREIGN KEY [< referential_constraint_name >] (< referencing_column >,...)
    REFERENCES < referenced_table > [(< referenced_column >,...)] [< delete_rule >]


referential_constraint_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation referential_constraint_name

< referential_constraint_name > ::=
  < identifier >


regular_token (SAP Library - SAP DB)

 Entering content frame

Syntax documentation regular_token

< regular_token > ::=
  < literal >
| < key_word >
| < identifier >
| < parameter_name >


release_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation release_statement

< release_statement > ::=
  COMMIT [WORK] RELEASE
| ROLLBACK [WORK] RELEASE


rename_column_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_column_statement

< rename_column_statement > ::=
  RENAME COLUMN < table_name >.< column_name > TO <column_name>


rename_index_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_index_statement

< rename_index_statement > ::=
  RENAME INDEX < old_index_name > [ON < table_name >] TO < new_index_name >


rename_synonym_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_synonym_statement

< rename_synonym_statement > ::=
  RENAME [PUBLIC] SYNONYM <old_ synonym_name > TO <new_synonym_name>


rename_table_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_table_statement

< rename_table_statement > ::=
  RENAME TABLE < old_table_name > TO < new_table_name >


rename_user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_user_statement

< rename_user_statement > ::=
  RENAME USER < user_name > TO <new_ user_name >


rename_usergroup_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_usergroup_statement

< rename_usergroup_statement > ::=
  RENAME USERGROUP < usergroup_name > TO <new_ usergroup_name >


rename_view_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rename_view_statement

< rename_view_statement > ::=
  RENAME VIEW < old_table_name > TO < new_table_name >


reserved_key_word (SAP Library - SAP DB)

 Entering content frame

Syntax documentation reserved_key_word

<reserved_key_word> ::=

A BS | ABSOLUTE | ACOS | ADDDATE | ADDTIME
ALL | ALPHA | ALTER | ANY | ASCII
ASIN | ATAN | ATAN2 | AVG |
B INARY | BIT | BOOLEAN | BYTE |
C ASE | CEIL | CEILING | CHAR | CHARACTER
CHECK | CHR | COLUMN | CONCAT | CONSTRAINT
COS | COSH | COT | COUNT | CROSS
CURDATE | CURRENT | CURTIME |  |
D ATABASE | DATE | DATEDIFF | DAY | DAYNAME
DAYOFMONTH | DAYOFWEEK | DAYOFYEAR | DBYTE | DEC
DECIMAL | DECODE | DEFAULT | DEGREES | DELETE
DIGITS | DISTINCT | DOUBLE |  |
E BCDIC | EXCEPT | EXISTS | EXP | EXPAND
F IRST | FIXED | FLOAT | FLOOR | FOR
FROM | FULL |  |  |
G ET_OBJECTNAME | GET_OWNER | GRAPHIC | GREATEST | GROUP
H AVING | HEX | HEXTORAW | HOUR |
I FNULL | IGNORE | INDEX | INITCAP | INNER
INSERT | INT | INTEGER | INTERNAL | INTERSECT
INTO |  |  |  |
J OIN |  |  |  |
K EY |  |  |  |
L AST | LCASE | LEAST | LEFT | LENGTH
LFILL | LINK | LIST | LN | LOCATE
LOG | LOG10 | LONG | LONGFILE | LOWER
LPAD | LTRIM |  |  |
M AKEDATE | MAKETIME | MAPCHAR | MAX | MBCS
MICROSECOND | MIN | MINUTE | MOD | MONTH
MONTHNAME |  |  |  |
N ATURAL | NCHAR | NEXT | NO | NOROUND
NOT | NOW | NULL | NUM | NUMERIC
O BJECT | OF | ON | ORDER |
P ACKED | PI | POWER | PREV | PRIMARY
R ADIANS | REAL | REJECT | RELATIVE | REPLACE
RFILL | RIGHT | ROUND | ROWID | ROWNO
RPAD | RTRIM |  |  |
S ECOND | SELECT | SELUPD | SERIAL | SET
SHOW | SIGN | SIN | SINH | SMALLINT
SOME | SOUNDEX | SPACE | SQRT | STAMP
STATISTICS | STDDEV | SUBDATE | SUBSTR | SUBSTRING
SUBTIME | SUM | SYSDBA |  |
T ABLE | TAN | TANH | TIME | TIMEDIFF
TIMESTAMP | TIMEZONE | TO | TOIDENTIFIER | TRANSACTION
TRANSLATE | TRIM | TRUNC | TRUNCATE |
U CASE | UID | UNICODE | UNION | UPDATE
UPPER | USER | USERGROUP | USING | UTCDATE
UTCDIFF |  |  |  |
V ALUE | VALUES | VARCHAR | VARGRAPHIC | VARIANCE
W EEK | WEEKOFYEAR | WHEN | WHERE | WITH
Y EAR |  |  |  |
Z ONED |  |  |  |


result_column_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation result_column_name

< result_column_name > ::=
  < identifier >


result_table_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation result_table_name

< result_table_name > ::=
  < identifier >


revoke_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation revoke_statement

< revoke_statement > ::=
  REVOKE < priv_spec >,... FROM < grantee >,... [< cascade_option >]
| REVOKE EXECUTE ON < dbproc_name > FROM <grantee>,...
| REVOKE SELECT ON < sequence_name > FROM <grantee>,... [<cascade_option>]


role_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation role_name

< role_name > ::=
  < identifier >


rollback_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rollback_statement

< rollback_statement > ::=
  ROLLBACK [WORK]


routine (SAP Library - SAP DB)

 Entering content frame

Syntax documentation routine

< routine > ::=
  [< local_variables >] < statement_list >;


routine_sql_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation routine_sql_statement

< routine_sql_statement > ::=
  < call_statement >
| < close_statement >
| < create_table_temp >
| < declare_cursor_statement >
| < delete_statement >
| < fetch_statement >
| < insert_statement >
| < lock_statement >
| < select_statement >
| < named_select_statement >
| < single_select_statement >
| < subtrans_statement >
| < update_statement >


row_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation row_spec

< row_spec > ::=
  ROW < table_name > KEY < key_spec >,...
| ROW <table_name> CURRENT OF < result_table_name >


rowno_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rowno_column

< rowno_column > ::=
  ROWNO [< result_column_name >]
| <result_column_name> = ROWNO


rowno_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rowno_predicate

< rowno_predicate > ::=
  ROWNO < < unsigned_integer >
| ROWNO < < parameter_spec >
| ROWNO <= < unsigned_integer >
| ROWNO <= < parameter_spec >


sample_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sample_definition

< sample_definition > ::=
  SAMPLE < unsigned_integer > ROWS
| SAMPLE <unsigned_integer> PERCENT


scalar_subquery (SAP Library - SAP DB)

 Entering content frame

Syntax documentation scalar_subquery

< scalar_subquery > ::=
  < subquery >


search_and_result_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation search_and_result_spec

< search_and_result_spec > ::=
  <search_ expression >, <result_expression>


search_condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation search_condition

< search_condition > ::=
  < boolean_term >
| <search_condition> OR <boolean_term>


searched_case_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation searched_case_function

< searched_case_function > ::=
  WHEN < search_condition > THEN <result_ expression >
    [...]
  [ELSE <default_expression>]
END


searched_case_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation searched_case_statement

< searched_case_statement > ::=
  CASE
    < searched_case_when_clause >…
    [< case_else_clause >]
  END [CASE]


searched_case_when_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation searched_case_when_clause

< searched_case_when_clause > ::=
  WHEN < search_condition > THEN < statement >


seconds (SAP Library - SAP DB)

 Entering content frame

Syntax documentation seconds

< seconds > ::=
  < expression >


select_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation select_column

< select_column > ::=
  < table_columns >
| < derived_column >
| < rowno_column >
| < stamp_column >


select_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation select_statement

< select_statement > ::=
  < query_expression > [< order_clause >] [< update_clause >] [< lock_option >]
    [FOR REUSE]


sequence_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sequence_name

< sequence_name > ::=
  < identifier >


set_function_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_function_name

< set_function_name > ::=
  COUNT
| MAX
| MIN
| SUM
| AVG
| STDDEV
| VARIANCE


set_function_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_function_spec

< set_function_spec > ::=
  COUNT (*)
| < distinct_function >
| < all_function >


set_insert_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_insert_clause

< set_insert_clause > ::=
  < column_name > = < extended_value_spec >


set_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_statement

< set_statement > ::=
  SET ROLE ALL [EXCEPT < role_name >]
| SET ROLE NONE
| SET ROLE <role_name> [IDENTIFIED BY < password >]
| SET ISOLATION LEVEL < unsigned_integer >


set_update_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_update_clause

< set_update_clause > ::=
  < column_name > = < extended_expression >
| <column_name>,... = (<extended_expression>,...)
| (<column_name>,...) = (<extended_expression>,...)
| <column_name> = < subquery >
| (<column_name>,...) = <subquery>


sign (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sign

< sign > ::=
  +
| -


simple_case_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_case_function

<simple_case_function> ::=
  CASE <check_expression>
    WHEN <search_expression> THEN <result_expression>
      [...]
    [ELSE <default_expression>]
  END


simple_case_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_case_statement

< simple_case_statement > ::=
  CASE < expression >
    < simple_case_when_clause >...
    [< case_else_clause >]
  END [CASE]


simple_case_when_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_case_when_clause

< simple_case_when_clause > ::=
  WHEN < literal >[, ...] THEN < statement >


simple_identifier (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_identifier

< simple_identifier > ::=
  < first_character >[< identifier_tail_character >...]


single_select_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation single_select_statement

< single_select_statement > ::=
  SELECT [< distinct_spec >] < select_column >,... INTO < parameter_spec >,...
    FROM < from_table_spec >,...[< where_clause >] [< group_clause >]
    [< having_clause >] [< lock_option >]


sort_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sort_spec

< sort_spec > ::=
  < unsigned_integer > [ASC | DESC]
| < expression > [ASC | DESC]


sound_predicate (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sound_predicate

< sound_predicate > ::=
  < expression > [NOT] SOUNDS [LIKE] <expression>


source_user (SAP Library - SAP DB)

 Entering content frame

Syntax documentation source_user

< source_user > ::=
  < user_name >


special_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation special_character

< special_character > ::=
  every character except
    < digit >
  | < letter >
  | < extended_letter >
  | < hex_digit >
  | < language_specific_character >
  | <character for the end of a line in a file>


special_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation special_function

< special_function > ::=
  VALUE (< expression >,<expression>,...)
| GREATEST (<expression>,<expression>,...)
| LEAST (<expression>,<expression>,...)
| DECODE (<check_ expression >,< search_and_result_spec >,...[,<default_expression>])
| case_function


special_identifier (SAP Library - SAP DB)

 Entering content frame

Syntax documentation special_identifier

< special_identifier > ::=
  < special_identifier_character >...


special_identifier_character (SAP Library - SAP DB)

 Entering content frame

Syntax documentation special_identifier_character

< special_identifier_character > ::=
  any character.


sql_comment (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sql_comment

< sql_comment > ::=
  /*<comment text>*/
| --<comment text>


stamp_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation stamp_column

< stamp_column > ::=
  STAMP [< result_column_name >]
| <result_column_name> = STAMP


statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation statement

<statement> ::=
  BEGIN <statement_list> END
| BREAK
| CONTINUE
| CONTINUE EXECUTE
| <if_statement>
| <while_statement>
| <assignment_statement>
| <case_statement>
| RETURN
| STOP (<expression> [,<expression>] )
| TRY <statement_list>; CATCH <statement>
| <routine_sql_statement>


statement_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation statement_list

< statement_list > ::=
  < statement >
| <statement_list> ; <statement>


string_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation string_function

< string_function > ::=
  < string_spec > || <string_spec>
| <string_spec> & <string_spec>
| SUBSTR (<string_spec>,< expression >[,<expression>])
| LFILL (<string_spec>,< string_literal >[,< unsigned_integer >])
| RFILL (<string_spec>,<string_literal>[,<unsigned_integer>])
| LPAD (<string_spec>,<expression>,<string_literal>[,<unsigned_integer>])
| RPAD (<string_spec>,<expression>,<string_literal>[,<unsigned_integer>])
| TRIM (<string_spec>[,<string_spec>])
| LTRIM (<string_spec>[,<string_spec>])
| RTRIM (<string_spec>[,<string_spec>])
| EXPAND (<string_spec>,<unsigned_integer>)
| UPPER (<string_spec>)
| LOWER (<string_spec>)
| INITCAP (<string_spec>)
| REPLACE (<string_spec>,<string_spec>[,<string_spec>])
| TRANSLATE (<string_spec>,<string_spec>,<string_spec>)
| MAPCHAR (<string_spec>[,<unsigned_integer>][,< mapchar_set_name >])
| ALPHA (<string_spec>[,<unsigned_integer>])
| ASCII (<string_spec>)
| EBCDIC (<string_spec>)
| SOUNDEX (<string_spec>)
| GET_OBJECTNAME (<string_literal)
| GET_OWNER (<string_literal>)


string_literal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation string_literal

< string_literal > ::=
  ''
| '< character >...'
| < hex_literal >


string_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation string_spec

< string_spec > ::=
  < expression >


subquery (SAP Library - SAP DB)

 Entering content frame

Syntax documentation subquery

< subquery > ::=
  (< query_expression >)


subtrans_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation subtrans_statement

< subtrans_statement > ::=
  SUBTRANS BEGIN
| SUBTRANS END
| SUBTRANS ROLLBACK


synonym_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation synonym_name

< synonym_name > ::=
  < identifier >


table_columns (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_columns

< table_columns > ::=
  *
| < table_name >.*
| < reference_name >.*


table_description_element (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_description_element

< table_description_element > ::=
  < column_definition >
| < constraint_definition >
| < referential_constraint_definition >
| < key_definition >
| < unique_definition >


table_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_expression

< table_expression > ::=
  < from_clause > [< where_clause >] [< group_clause >] [< having_clause >]


table_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_name

< table_name > ::=
  [< owner >.]< identifier >


term (SAP Library - SAP DB)

 Entering content frame

Syntax documentation term

< term > ::=
  < factor >
| <term> * <factor>
| <term> / <factor>
| <term> DIV <factor>
| <term> MOD <factor>


time_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation time_expression

< time_expression > ::=
  < expression >


time_or_timestamp_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation time_or_timestamp_expression

< time_or_timestamp_expresion > ::=
  < expression >


time_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation time_function

< time_function > ::=
  ADDTIME ( < time_or_timestamp_expression >, < time_expression > )
| SUBTIME ( <time_or_timestamp_expression>, <time_expression> )
| TIMEDIFF ( <time_or_timestamp_expression>, <time_or_timestamp_expression> )
| MAKETIME ( < hours >, < minutes >, < seconds > )


trigger_event (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trigger_event

< trigger_event > ::
  INSERT
| UPDATE [(< column_list >)]
| DELETE


trigger_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trigger_name

< trigger_name > ::=
  < identifier >


trigonometric_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trigonometric_function

< trigonometric_function > ::=
  COS ( < expression > )
| SIN ( <expression> )
| TAN ( <expression> )
| COT ( <expression> )
| COSH ( <expression> )
| SINH ( <expression> )
| TANH ( <expression> )
| ACOS ( <expression> )
| ASIN ( <expression> )
| ATAN ( <expression> )
| ATAN2 ( <expression>, <expression> )
| RADIANS ( <expression> )
| DEGREES ( <expression> )


underscore (SAP Library - SAP DB)

 Entering content frame

Syntax documentation underscore

< underscore > ::=
  _


unique_definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation unique_definition

< unique_definition > ::=
  [CONSTRAINT < index_name >] UNIQUE (< column_name >,...)


unlock_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation unlock_statement

< unlock_statement > ::=
  UNLOCK < row_spec >... IN SHARE MODE
| UNLOCK <row_spec>... IN EXCLUSIVE MODE
| UNLOCK <row_spec>... IN SHARE MODE <row_spec>... IN EXCLUSIVE MODE
| UNLOCK <row_spec>... OPTIMISTIC


unsigned_integer (SAP Library - SAP DB)

 Entering content frame

Syntax documentation unsigned_integer

< unsigned_integer > ::=
  < numeric_literal >


update_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation update_clause

<update_clause> ::=
  FOR UPDATE [OF <column_name>,...] [NOWAIT]


update_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation update_statement

< update_statement > ::=
  UPDATE [OF] < table_name > [< reference_name >] SET < set_update_clause >,...
    [KEY < key_spec >,...] [WHERE < search_condition >]
| UPDATE [OF] <table_name> [<reference_name>] (< column_name >,...)
    VALUES (< extended_value_spec >,...) [KEY <key_spec>,...]
    [WHERE <search_condition>]
| UPDATE [OF] <table_name> [<reference_name>] SET <set_update_clause>,...
    WHERE CURRENT OF < result_table_name >
| UPDATE [OF] <table_name> [<reference_name>] (<column_name>,...)
    VALUES (<extended_value_spec>,...) WHERE CURRENT OF <result_table_name>


update_statistics_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation update_statistics_statement

< update_statistics_statement > ::=
  UPDATE STAT[ISTICS] COLUMN < table_name >.< column_name >
    [ESTIMATE [< sample_definition >]]
| UPDATE STAT[ISTICS] COLUMN (<column_name>,...) FOR <table_name>
    [ESTIMATE [<sample_definition>]]
| UPDATE STAT[ISTICS] COLUMN (*) FOR <table_name>
    [ESTIMATE [<sample_definition>]]
| UPDATE STAT[ISTICS] <table_name> [ESTIMATE [<sample_definition>]]
| UPDATE STAT[ISTICS] [< owner >.][< identifier >]* [ESTIMATE [<sample_definition>]]


user_mode (SAP Library - SAP DB)

 Entering content frame

Syntax documentation user_mode

< user_mode > ::=
  DBA
| RESOURCE
| STANDARD


user_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation user_name

< user_name > ::=
  < identifier >


usergroup_mode (SAP Library - SAP DB)

 Entering content frame

Syntax documentation usergroup_mode

< usergroup_mode > ::=
  RESOURCE
| STANDARD


usergroup_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation usergroup_name

< usergroup_name > ::=
  < identifier >


value_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation value_spec

<value_spec> ::=
  <literal>
| <parameter_spec>
| NULL
| USER
| USERGROUP
| SYSDBA
| UID
| [<owner>.]<sequence_name>.NEXTVAL
| [<owner>.]<sequence_name>.CURRVAL
| <table_name>.CURRVAL
| DATE
| TIME
| TIMESTAMP
| UTCDATE
| TIMEZONE
| UTCDIFF
| TRUE
| FALSE
| TRANSACTION


variable_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation variable_name

< variable_name > ::=
  < identifier >


where_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation where_clause

< where_clause > ::=
  WHERE < search_condition >


while_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation while_statement

< while_statement > ::=
  WHILE < search_condition > DO < statement >


ORACLE SQL Mode (SAP Library - SAP DB)

 Entering content frame

Component documentation ORACLE SQL Mode

This documentation describes the differences in logical data storage and the definition of SQL syntax for the database systems Oracle Version 7 and SAP DB Version 7.4, ORACLE SQL mode.

For general information about the SAP DB database system, see the documentation The SAP DB Database System at the following Internet address: www.sapdb.org.

For information about the SQL syntax of the database system, see the Reference Manual: SAP DB 7.4.

The differences are described in the following sections:

· General Differences

· SQL Syntax Elements

· SQL Syntax Statements

· System Tables

· Error Messages


General Differences (SAP Library - SAP DB)

 Entering content frame

Background documentation General Differences

Logical database structure

There are basic differences between the logical database structures of the database systems Oracle Version 7 and SAP DB Version 7.4.

  • From a logical point of view, an Oracle database consists of tablespaces, segments, extents, blocks, tables, and data records.
  • From a logical point of view, SAP DB consists basically of the tables in the database catalog and the application data in the form of data records.

All Oracle statements referring to the administration of tablespaces, segments, extents, or blocks are therefore meaningless in SAP DB.

Consistent reading/locking

The consistent reading offered by Oracle can be achieved in SAP DB using locks in isolation level >= 2 ( Lock Strategy ).

Oracle allows an unlimited number of exclusive row locks. In SAP DB, an escalation takes effect from a certain number of row locks; i.e., the whole table will be locked. The time of escalation depends on the defined lock list size.

Database procedures/triggers

  • In Oracle, database procedures, DB functions, and triggers are defined in PL/SQL, a language similar to ADA.
  • In SAP DB, database procedures and triggers are defined in a language similar to C.

Database objects and their schemas

Database users can only create or delete SAP DB database objects in or from their own schemas, or create database objects that are not assigned to a particular user (index, for example). It is not possible to create database objects in the schema of another user.

DBA users and privileges

In contrast to Oracle, DBA users in SAP DB are also subject to the privileges concept and cannot execute DDL statements (such as CREATE INDEX) or DML statements (such as DELETE) for which they have not received the corresponding privileges.


SQL Syntax Elements (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Syntax Elements

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ in the following areas:

  • Schema Object
  • Name
  • Namespace
  • Access to Objects
  • Integer
  • Number
  • Data Type
  • Pseudo Column
  • Operator
  • Function
  • Format


Schema Object (SAP Library - SAP DB)

 Entering content frame

Background documentation Schema Object

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of possible schema objects.

The following schema objects are not supported in SAP DB:

  • Cluster
  • Database link
  • Package
  • Profile
  • Rollback segment
  • Snapshot
  • Snapshot log
  • Tablespace

The following schema objects are supported by SAP DB, but use a different syntax than Oracle:

Procedure (object in SAP DB: database procedure )


Name (SAP Library - SAP DB)

 Entering content frame

Background documentation Name

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of names for objects.

If SAP assigns names for objects, these names differ from the names generated by Oracle.

The following keywords are reserved in Oracle 7 but not in SAP DB:

ACCESS | COMPRESS | ELSE | FILE
IMMEDIATE | INCREMENT | INITIAL | MAXEXTENTS
NOAUDIT | NOCOMPRESS | OFFLINE | ONLINE
PRIOR | SIZE | START | SUCCESSFUL
THEN | VALIDATE |  |

If possible, these key words should not be used to designate objects in SAP DB.

You can find a list of all the keywords reserved in SAP DB in the section reserved_key_word of the Reference Manual.

You can find a list of all the keywords not reserved in SAP DB in the section not reserved_key_word of the Reference Manual.


Namespace (SAP Library - SAP DB)

 Entering content frame

Background documentation Namespace

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of namespaces.

Differences in the namespace

Oracle 7 | SAP DB 7.4
All indexes of a database instance form a namespace. | All indexes of a table form a namespace.
All constraints of a database instance form a namespace. | All constraints of a table form a namespace.
All triggers of a database instance form a namespace. | All triggers of a table form a namespace.
All sequences, together with the tables, views, synonyms, procedures, and further objects, form a namespace. | All sequences of a database instance form a separate namespace.
All procedures, together with the tables, views, sequences, synonyms, and further objects, form a namespace. | All database procedures of a database instance form a separate namespace.


Access to Objects (SAP Library - SAP DB)

 Entering content frame

Background documentation Access to Objects

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, with regard to object access.

If an owner is not specified when a database object is accessed, and no object belonging to the current user exists with this name, the following procedure, different to the Oracle procedure, applies when the database object is accessed:

  1. SAP DB searches for this object in the PUBLIC synonyms .
  2. If the object is not found here, SAP DB searches for this object in the part of the database catalog of the DBA that the current user generated.
  3. If the object is not found here, SAP DB searches for this object in SYSDBA ’s part of the database catalog.


Integer (SAP Library - SAP DB)

 Entering content frame

Background documentation Integer

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of integers.

In contrast to Oracle, an integer in SAP DB has 20 significant characters.


Number (SAP Library - SAP DB)

 Entering content frame

Background documentation Number

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of numbers.

  • For Oracle, the permitted value area for numbers covers values from 0.999E-128 to 0.999E126.
  • In SAP DB, the permitted value area for floating point numbers ( Number ) consists of the interval from -9.9999999999999999999999999999999999999E+62 to -1E-64, the value 0.0, and the interval from +1E-64 to +9.9999999999999999999999999999999999999E+62.


Data Type (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Type

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of data types.

· In contrast to Oracle, columns with the data type CHAR[ACTER] are only stored up to a length of 30 characters with fixed length in SAP DB.

· The Oracle data type VARCHAR2 does not differ from VARCHAR in SAP DB.

· The data types INT[EGER] and SMALLINT have 20 significant digits in SAP DB.

· In SAP DB, the data type FLOAT is always represented with 20 significant digits.

· In SAP DB, data types cannot be defined for numbers with a negative scale. It is not possible to specify a scale that is greater than the number of significant digits.

· In SAP DB, numbers are not implicitly converted into date values or vice versa.

· In Oracle, date values run from 1.1.4712 BC to 31.12.9999 AD.
In SAP DB, date values run from 1.1.0001 to 31.12.9999.

· SAP DB does not support the comparison of character strings denoted as "non padded comparison" in Oracle.

· The data types NCHAR, NVARCHAR2, MLSLABEL, BLOB, CLOB, NCLOB, BFILE, and UROWID, which are supported by Oracle, are not supported by SAP DB.


Pseudo Column (SAP Library - SAP DB)

 Entering content frame

Background documentation Pseudo Column

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of pseudo columns.

  • The pseudo column LEVEL is not supported in SAP DB.
  • Pseudo column ROWID can only be used if the option ROWID was specified in the CREATE TABLE statement . In contrast to Oracle, SAP DB produces a logical column identification of the data type RAW(8).
  • In SAP DB, pseudo column ROWNUM cannot be used in the UPDATE statement .
  • The pseudo column ROWNUM is entered into a selected column (select_column) after the result table has been sorted.


Operator (SAP Library - SAP DB)

 Entering content frame

Background documentation Operator

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of operators.

The Oracle operator PRIOR is not supported in SAP DB.


Function (SAP Library - SAP DB)

 Entering content frame

Background documentation Function

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of functions.

  • The following Oracle functions are not supported as functions in SAP DB:
    • CHARTOROWID
    • ROWIDTOCHAR
    • CONVERT
    • DUMP
    • USERENV
    • NLS_INITCAP
    • NLS_LOWER
    • NLS_UPPER
    • TO_MULTI_BYTE
    • TO_SINGLE_BYTE
    • INSTRB
    • LENGTHB
    • SUBSTRB
  • When string functions LPAD and RPAD is specified in SAP DB, the character string x cannot be longer than n.
  • When string function SUBSTR is specified in SAP DB, a cannot be less than 1.
  • When the function INSTR is specified, the parameter "n" must not be smaller than 1.
  • When functions TO_CHAR, TO_DATE, and TO_NUMBER are specified, the parameter "nlsparams" is not available.


Format (SAP Library - SAP DB)

 Entering content frame

Background documentation Format

The SQL syntax elements for Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE differ, among other things, in the definition of the date format.

If not specified otherwise in the ALTER SESSION statement, date format DD-MON-YY, language English, and BINARY sorting are assumed for a database session in SAP DB.


SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Statements

This section lists all the Oracle SQL statements with different behavior in Oracle Version 7 and SAP DB Version 7.4 in SQL mode ORACLE.

A detailed description of the syntax of the Oracle SQL statements can be found in the ORACLE7 Server SQL Reference Manual, and not in the sections below. The Oracle SQL statements are listed in the same order that is used in the ORACLE7 Server SQL Reference Manual.

To enable a better understanding of the system explanations, a reference to the syntax description of the relevant SAP DB-SQL statement in the Reference Manual has been provided where appropriate.

For SQL statements not listed below, it can be assumed that there are no differences other than those described in the section General Differences .


alter_cluster_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_cluster_statement

The schema object cluster is not supported by SAP DB. The SQL statement ALTER CLUSTER (alter_cluster_statement) is therefore not accepted by SAP DB.


alter_database_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_database_statement

The SQL statement ALTER DATABASE (alter_database_statement) is not accepted by SAP DB.


alter_function_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_function_statement

The SQL statement ALTER FUNCTION (alter_function_statement) is rejected by SAP DB.


alter_index_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_index_statement

Since SAP DB needs no reorganization, you do not have to modify the memory characteristics for indexes. The SQL statement ALTER INDEX (alter_index_statement) is known in SAP DB, but has different syntax and semantics to Oracle ( ALTER INDEX statement ).


alter_package_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_package_statement

The SQL statement ALTER PACKAGE (alter_package_statement) is not accepted by SAP DB.


alter_procedure_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_procedure_statement

The SQL statement ALTER PROCEDURE (alter_procedure_statement) is not accepted by SAP DB.


alter_profile_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_profile_statement

The schema object profile is not supported by SAP DB. The SQL statement ALTER PROFILE (alter_profile_statement) is therefore not accepted by SAP DB.


alter_resource_cost_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_resource_cost_statement

The SQL statement ALTER RESOURCE COST (alter_resource_cost_statement) is not accepted by SAP DB.


alter_role_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_role_statement

The SQL statement ALTER ROLE (alter_role_statement) is not accepted by SAP DB.


alter_rollback_segment_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_rollback_segment_statement

The schema object rollback segment is not supported by SAP DB. The SQL statement ALTER ROLLBACK SEGMENT (alter_rollback_segment_statement) is therefore not accepted by SAP DB.


alter_sequence_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_sequence_statement

The SQL statement ALTER SEQUENCE (alter_sequence_statement) is not accepted by SAP DB.


alter_snapshot_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_snapshot_statement

The schema object snapshot is not supported by SAP DB. The SQL statement ALTER SNAPSHOT (alter_snapshot_statement) is not accepted by SAP DB.


alter_snapshot_log_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_snapshot_log_statement

The schema object snapshot log is not supported by SAP DB. The SQL statement ALTER SNAPSHOT LOG (alter_snapshot_log_statement) is therefore not accepted by SAP DB.


alter_system_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_system_statement

The SQL statement ALTER SYSTEM (alter_system_statement) is not accepted by SAP DB.


alter_table_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_table_statement

The SQL statement ALTER TABLE (alter_table_statement) is known in SAP DB, but has different syntax and semantics to Oracle ( ALTER TABLE statement ).

  • The variants PCTFREE, PCTUSED, INITRANS, MAXTRANS, STORAGE, DROP, and ALLOCATE are meaningless in SAP DB and are rejected.
  • SAP DB cannot deactivate constraints . SAP DB therefore ignores the specification of DISABLE.
  • SAP DB cannot delete any UNIQUE constraints using the DROP clause. The DROP INDEX statement must be used for this instead.
  • When columns are inserted, SAP DB automatically inserts these columns in all view tables that use the "*" in the <select_list>, in order to identify all columns of the table.


alter_tablespace_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_tablespace_statement

The schema object tablespace is not supported by SAP DB. The SQL statement ALTER TABLESPACE (alter_tablespace_statement) is not accepted by SAP DB.


alter_trigger_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_trigger_statement

SAP DB cannot deactivate triggers . The SQL statement ALTER TRIGGER (alter_trigger_statement) is therefore not accepted by SAP DB.


alter_user_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_user_statement

The SQL statement ALTER USER (alter_user_statement) is rejected by SAP DB. In SAP DB, the ALTER USER- statement can only be used to change the user’s password. SAP DB rejects the specification of EXTERNALLY.

All other variants of the ALTER USER statement are rejected by SAP DB.


alter_view_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation alter_view_statement

SAP DB always keeps view tables in an executable state. The SQL statement ALTER VIEW (alter_view_statement) is therefore not necessary, and is not accepted.


analyze_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation analyze_statement

SAP DB only supports the variant ANALYZE TABLE for SQL statement ANALYZE (analyze_statement). The options DELETE, VALIDATE STRUCTURE, and LIST CHAINED ROWS are not valid in SAP DB.


audit_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation audit_statement

The SQL statement AUDIT (audit_statement) is not accepted by SAP DB.


commit_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation commit_statement

SAP DB does not accept the specification of FORCE or COMMENT for the SQL statement COMMIT (commit_statement).


constraint_clause (SAP Library - SAP DB)

 Entering content frame

Background documentation constraint_clause

The following restrictions exist for the syntax element CONSTRAINT clause used in SQL statements in SAP DB:

  • A constraint_name for a key or [NOT] NULL is not stored in the database catalog .
  • USING INDEX is allowed within the syntax, but meaningless in SAP DB.
  • SAP DB ignores the DISABLE option.


create_cluster_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_cluster_statement

The schema object cluster is not supported by SAP DB. The SQL statement CREATE CLUSTER (create_cluster_statement) is therefore not accepted by SAP DB.


create_controlfile_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_controlfile_statement

The SQL statement CREATE CONTROLFILE (create_controlfile_statement) is not accepted by SAP DB.


create_database_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_database_statement

The SQL statement CREATE DATABASE (create_database_statement) is not accepted by SAP DB.


create_database_link_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_database_link_statement

The schema object database link is not supported by SAP DB. The SQL statement CREATE DATABASE LINK (create_database_link_statement) is therefore not accepted by SAP DB.


create_function_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_function_statement

The SQL statement CREATE FUNCTION (create_function_statement) is not accepted by SAP DB.


create_index_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_index_statement

The SQL statement CREATE INDEX (create_index_statement) is known in SAP DB, but has different syntax and semantics to Oracle ( CREATE INDEX statement ).

  • The specification of CLUSTER <cluster>, INITRANS <integer>, MAXTRANS <integer>, TABLESPACE <tablespace>, STORAGE <storage_clause>, PCTFREE <integer>, and NOSORT is meaningless in SAP DB, but is accepted by the syntax.
  • The index is generated in descending order in SAP DB when DESC is specified.


create_package_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_package_statement

The SQL statement CREATE PACKAGE (create_package_statement) is not accepted by SAP DB.


create_package_body_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_package_body_statement

The SQL statement CREATE PACKAGE BODY (create_package_body_statement) is not accepted by SAP DB.


create_procedure_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_procedure_statement

The SQL statement CREATE PROCEDURE (create_procedure_statement) is not accepted by SAP DB.


create_profile_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_profile_statement

The schema object profile is not supported by SAP DB. The SQL statement CREATE PROFILE (create_profile_statement) is therefore not accepted by SAP DB.


create_rollback_segment_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_rollback_segment_statement

The schema object rollback segment is not supported by SAP DB. The SQL statement CREATE ROLLBACK SEGMENT (create_rollback_segment_statement) is therefore not accepted by SAP DB.


create_schema_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_schema_statement

The SQL statement CREATE SCHEMA (create_schema_statement) is not accepted by SAP DB.


create_sequence_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_sequence_statement

SAP DB accepts the SQL statement CREATE SEQUENCE (create_sequence_statement) with the following syntax restrictions: the options CACHE and ORDER are meaningless for SAP DB ( CREATE SEQUENCE statement ).


create_snapshot_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_snapshot_statement

The schema object snapshot is not supported by SAP DB. The SQL statement CREATE SNAPSHOT (create_snapshot_statement) is therefore not accepted by SAP DB.


create_snapshot_log_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_snapshot_log_statement

The schema object snapshot log is not supported by SAP DB. The SQL statement CREATE SNAPSHOT LOG (create_snapshot_log_statement) is therefore not accepted by SAP DB.


create_synonym_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_synonym_statement

SAP DB does not permit any synonyms for sequences , database procedures or synonyms.

At the time of execution of the SQL statement CREATE SYNONYM (create_synonym_statement), the object for which the synonym is defined must exist. The current user must have at least one privilege for this object.


create_table_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_table_statement

The SQL statement CREATE TABLE (create_table_statement) is known in SAP DB, but has different syntax and semantics to Oracle ( CREATE TABLE statement ).

  • The specification of PCTFREE <integer>, PCTUSED <integer>, INITRANS <integer>, MAXTRANS <integer>, TABLESPACE <tablespace>, STORAGE <storage clause>, and CLUSTER <cluster> is allowed by the syntax, but all are meaningless in SAP DB.
  • SAP DB ignores the specification of DISABLE.
  • If a subquery is specified, SAP DB does not generate NOT NULL constraints .
  • In Oracle, each table row has a unique address that can be accessed as ROWID. The row can be addressed directly by using the ROWID. The ROWID also exists if the table has a key. Such an address is not available in SAP DB, because the rows are always addressed using the key.
    Table option ROWID can be used to better imitate Oracle behavior. This has the following effect: The table implicitly received key column ROWID from data type RAW(8). This column is usually invisible and can only be selected using the ROWID function.
    - If the CREATE TABLE statement contains a     key_definition , an index with the UNIQUE attribute that corresponds to the key definition is generated.

    In this way, a row has a ROWID and can be selected with the ROWID and the key.


create_tablespace_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_tablespace_statement

The schema object tablespace is not supported by SAP DB. Nevertheless, SAP DB still accept the SQL statement CREATE TABLESPACE (create_tablespace_statement), even though it has no effect.


create_trigger_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_trigger_statement

In SAP DB, SQL statement CREATE TRIGGER (create_trigger_statement) can only be used to define the triggers described in Oracle as "after row trigger".


create_user_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_user_statement

The SQL statement CREATE USER (create_user_statement) is supported in SAP DB with restricted syntax. In the CREATE USER_statement , SAP DB does not accept the specification of IDENTIFIED EXTERNALLY, GLOBALLY AS <external_name>, DEFAULT TABLESPACE <tablespace>, TEMPORARY TABLESPACE <tablespace>, QUOTA, and PROFILE <profile>.

The created user has RESOURCE status.


create_view_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation create_view_statement

The SQL statement CREATE VIEW (create_view_statement) is supported in SAP DB with restricted syntax. The following restrictions exist in SAP DB for the syntax of the CREATE VIEW statement :

  • SAP DB rejects the specification of FORCE or NOFORCE.
  • A constraint_name given to the CHECK OPTION is not stored in the database catalog . If no constraint name is specified, SAP DB does not generate a name.
  • View tables that are updatable in Oracle are not necessarily updatable in SAP DB. This is especially true for view tables whose definition contains subqueries .


declare_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation declare_statement

In SAP DB, it is possible to specify the SQL statement DECLARE (declare_statement) with the following syntax restriction: the specification of a PL/SQL block is not accepted.


declare_table_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation declare_table_statement

The SQL statement DECLARE TABLE (declare_table_statement) is accepted by SAP DB, even though it is meaningless for SAP DB.


delete_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation delete_statement

The SQL statement DELETE (delete_statement) is supported in SAP DB with restricted syntax ( DELETE statement ).

  • If CURRENT OF <cursor> is specified, the result table must be based on an updatable table.
  • A cursor built by a join or join view table is rejected.


describe_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation describe_statement

In SAP DB, it is possible to specify the SQL statement DESCRIBE (describe_statement) with the following syntax restriction: the specification of a PL/SQL block is not accepted.


drop_cluster_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_cluster_statement

The schema object cluster is not supported by SAP DB. The SQL statement DROP CLUSTER (drop_cluster_statement) is therefore not accepted by SAP DB.


drop_database_link_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_database_link_statement

The schema object database link is not supported by SAP DB. The SQL statement DROP DATABASE LINK (drop_database_link_statement) is therefore not accepted by SAP DB.


drop_function_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_function_statement

The SQL statement DROP FUNCTION (drop_function_statement) is not accepted by SAP DB.


drop_index_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_index_statement

The SQL statement DROP INDEX (drop_index_statement) is accepted by SAP DB with the following restriction: because of the different namespaces for indexes, the specification of an index name does not always uniquely identify an index. In such a case, the table to which the index refers must be explicitly specified.


drop_procedure_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_procedure_statement

The SQL statement DROP PROCEDURE (drop_procedure_statement) is not accepted by SAP DB.


drop_profile_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_profile_statement

The schema object profile is not supported by SAP DB. The SQL statement DROP PROFILE (drop_profile_statement) is therefore not accepted by SAP DB.


drop_rollback_segment_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_rollback_segment_statement

The schema object rollback segment is not supported by SAP DB. The SQL statement DROP ROLLBACK SEGMENT (drop_rollback_segment_statement) is therefore not accepted by SAP DB.


drop_snapshot_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_snapshot_statement

The schema object snapshot is not supported by SAP DB. The SQL statement DROP SNAPSHOT (drop_snapshot_statement) is therefore not accepted by SAP DB.


drop_snapshot_log_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_snapshot_log_statement

The schema object snapshot log is not supported by SAP DB. The SQL statement DROP SNAPSHOT LOG (drop_snapshot_log_statement) is therefore not accepted by SAP DB.


drop_table_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_table_statement

The SQL statement DROP TABLE (drop_table_statement) is known in SAP DB but with the following syntax restrictions:

  • All synonyms and view tables based on the table are dropped.
  • Specifying CASCADE CONSTRAINTS has no effect.


drop_tablespace_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_tablespace_statement

The schema object tablespace is not supported by SAP DB. The SQL statement DROP TABLESPACE (drop_tablespace_statement) is therefore not accepted by SAP DB.


drop_trigger_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_trigger_statement

Because of the different namespaces for triggers , specification of a trigger name in SAP DB does not uniquely identify the trigger.

Therefore, SAP DB only accepts the SQL statement DROP TRIGGER (drop_trigger_statement) with the following restriction: the table that the trigger relates to must be explicitly specified.


drop_view_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation drop_view_statement

In SAP DB, the SQL statement DROP VIEW (drop_view_statement) is used to drop all the view tables and synonyms based on the view table.


execute_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation execute_statement

In SAP DB, it is possible to specify the SQL statement EXECUTE (execute_statement) with the following syntax restriction: the specification of a PL/SQL block is not accepted.


explain_plan_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation explain_plan_statement

The SQL statement EXPLAIN PLAN (explain_plan_statement) is not accepted by SAP DB.

However, there is a similar SQL statement in SAP DB: EXPLAIN statement .


grant_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation grant_statement

The SQL statement GRANT (grant_statement) is known in SAP DB, but behaves differently to Oracle in the following areas ( GRANT statement ):

  • SAP DB does not accept the granting of system privileges.
  • The schema object package cannot be specified when object privileges are granted.


insert_statement (embedded SQL) (SAP Library - SAP DB)

 Entering content frame

Background documentation insert_statement (embedded SQL)

The SQL statement INSERT (insert_statement) is accepted in SAP DB with the following restriction ( INSERT statement ) does not accept the specification of array host variables in the WHERE clause.


lock_table_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation lock_table_statement

The SQL statement LOCK TABLE (lock_table_statement) is accepted by SAP DB with the following syntax restrictions: if ROW EXCLUSIVE, SHARE ROW EXCLUSIVE or EXCLUSIVE are specified, SAP DB assigns an exclusive table lock. Concurrent requests on the table are therefore not possible.


noaudit_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation noaudit_statement

The SQL statement NOAUDIT (noaudit_statement) is not accepted by SAP DB.


rename_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation rename_statement

The SQL statement RENAME (rename_statement) is known in SAP DB, but behaves differently to Oracle: in SAP DB, only Basis tables can be renamed.


revoke_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation revoke_statement

The SQL statement REVOKE (revoke_statement) is known in SAP DB, but behaves differently to Oracle in the following areas ( REVOKE statement ):

  • SAP DB does not accept the revoking of system privileges.
  • The schema object package cannot be specified when object privileges are revoked.


rollback_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation rollback_statement

The SQL statement ROLLBACK (rollback_statement) is supported in SAP DB with restricted syntax ( ROLLBACK statement ).

  • SAP DB rejects the specification of FORCE.
  • SAP DB does not release any locks when ROLLBACK TO [SAVEPOINT] <savepoint> is specified.


select_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation select_statement

The SQL statement SELECT (select_statement) is supported in SAP DB with restricted syntax ( SELECT statement ).

  • SAP DB does not support the specification of START WITH <condition> or CONNECT BY <condition>.
  • SAP DB sometimes rejects outer joins with more than two tables in the FROM clause valid in Oracle.


set_transaction_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation set_transaction_statement

The SQL statement SET TRANSACTION (set_transaction_statement) is not accepted by SAP DB.


truncate_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation truncate_statement

The SQL statement TRUNCATE (truncate_statement) is supported in SAP DB with restricted syntax only.

  • The statement TRUNCATE CLUSTER [<schema>.]<cluster> is not accepted.
  • The syntax elements DROP / REUSE STORAGE are accepted. They do not have any semantic meaning, however, since they trigger a response that is standard in SAP DB.


update_statement (SAP Library - SAP DB)

 Entering content frame

Background documentation update_statement

The SQL statement UPDATE (update_statement) is supported in SAP DB with restricted syntax ( UPDATE statement ).

  • A correlated subquery is not permitted as a subquery of a SET UPDATE clause in SAP DB.
  • If CURRENT OF <cursor> is specified, the result table must be based on an updatable table. A cursor built by a join or join view table is rejected.


System Tables (SAP Library - SAP DB)

 Entering content frame

Background documentation System Tables

The following system tables are known in SAP DB, but they are empty because the corresponding objects or information does not exist in SAP DB:

ALL_ERRORS
ALL_SOURCE
ALL_SNAPSHOTS
ALL_TRIGGER_COLS

DBA_2PC_NEIGHBORS
DBA_2PC_PENDING
DBA_AUDIT_EXISTS
DBA_AUDIT_OBJECT
DBA_AUDIT_SESSION
DBA_AUDIT_STATEMENT
DBA_AUDIT_TRAIL
DBA_BLOCKERS
DBA_CLUSTERS
DBA_CLU_COLUMNS
DBA_DATA_FILES
DBA_DDL_LOCKS
DBA_DML_LOCKS
DBA_ERRORS
DBA_EXP_FILES
DBA_EXP_OBJECTS
DBA_EXTENTS
DBA_LOCKS
DBA_OBJECT_SIZE
DBA_PRIV_AUDIT_OPTS
DBA_PROFILES
DBA_ROLLBACK_SEGS
DBA_SNAPSHOTS
DBA_SNAPSHOT_LOGS
DBA_SOURCE
DBA_STMT_AUDIT_OPTS
DBA_SYS_PRIVS
DBA_TABLESPACES
DBA_TRIGGER_COLS
DBA_TS_QUOTAS

RESOURCE_COST
ROLE_SYS_PRIVS
ROLE_TAB_PRIVS

USER_AUDIT_OBJECT
USER_AUDIT_SESSION
USER_AUDIT_TRAIL
USER_CLUSTERS
USER_CLU_COLUMNS
USER_ERRORS
USER_EXTENTS
USER_OBJECT_SIZE
USER_SNAPSHOTS
USER_SNAPSHOT_LOGS
USER_SOURCE
USER_SYS_PRIVS
USER_TABLESPACES
USER_TRIGGER_COLS
USER_TS_QUOTAS

The following system table columns always contain a NULL value because the information is not available in the format required in SAP DB:

System table(s) | Column(s)
ALL_CONSTRAINT, USER_CONSTRAINTS, DBA_CONSTRAINTS | R_CONSTRAINT_NAME
ALL_DEPENDENCIES, USER_DEPENDENCIES, DBA_DEPENDENCIES | REFERENCED_LINK_NAME
ALL_INDEXES, USER_INDEXES, DBA_INDEXES | PREFIX_LENGTH INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENT MAX_EXTENTS PCT_INCREASE PCT_FREE BLEVEL LEAF_BLOCKS AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY CLUSTERING_FACTOR NUM_ROWS SAMPLE_SIZE LAST_ANALYZED DEGREE INSTANCES BUFFER_POOL DUARTION PCT_DIRECT_ACCESS ITYP_OWNER ITYP_NAME PARAMETERS GLOBAL_STATS
ALL_OBJECTS, USER_OBJECTS, DBA_OBJECTS | SUBOBJECT_NAME DATA_OBJECT_ID
ALL_SYNONYMS, USER_SYNONYMS, DBA_SYNONYMS | DB_LINK
ALL_TABLES, USER_TABLES, DBA_TABLES | CLUSTER_NAME IOT_NAME PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENT MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES IOT_TYPE BUFFER_POOL ROW_MOVEMENT GLOBAL_STATS DUARTION SKIP_CORRUPT MONITORING
ALL_TAB_COLUMNS, USER_TAB_COLUMNS, DBA_TAB_COLUMNS | DATA_TYPE_MOD DATA_TYPE_OWNER LOW_VALUE HIGH_VALUE DENSITY NUM_NULLS NUM_BUCKETS LAST_ANALYZED SAMPLE_SIZE GLOBAL_STATS AVG_COL_LENGTH
ALL_TRIGGERS, USER_TRIGGERS, DBA_TRIGGERS | COLUMN_NAME REFERENCING_NAME WHEN_CLAUSE ACTION_TYPE
ALL_VIEWS, USER_VIEWS, DBA_VIEWS | TYPE_TEXT_LENGTH TYPE_TEXT OID_TEXT_LENGTH OID_TEXT VIEW_TYPE_OWNER VIEW_TYPE
DBA_IND_COLUMNS | COLUMN_EXPRESSION
USER_FREE_SPACE, DBA_FREE_SPACE | RELATIVE_FNO
USER_RESOURCE_LIMITS | RESOURCE_NAME LIMIT
USER_SEGMENTS, DBA_SEGMENTS | BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT IN_EXTENT MAX_EXTENTS PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_POOL RESOURCE_NAME
USER_SYS_PRIVS | PRIVILEGE
USER_USERS, DBA_USERS | ACCOUNT_STATUS LOCK_DATE EXPIRY_DATE PROFILE INITIAL_RSRC_CONSUMER_GROUP EXTERNAL_NAME


Error Messages (SAP Library - SAP DB)

 Entering content frame

Background documentation Error Messages

When some errors occur, SAP DB produces the same error number as Oracle Version 7:

Message number | Message text
1403 | Row not found
-1 | Duplicate key in index
-51 | Lock request timeout
-54 | Lock collision
-602 | System error
-942 | Unknown table name
-955 | Duplicate name
-1007 | Parameter is too long
-1008 | Too many or too few host variables for output
-1034 | Serverdb must be restarted
-1400 | Input parameter cannot be NULL value
-1402 | Integrity violation
-1405 | Missing indicator variable
-1452 | Duplicate secondary key
-1556 | Data space full (emergency shutdown)

For all other errors, SAP DB produces the error numbers described in the manual Messages 7.4. These are different from the numbers for the corresponding Oracle errors.


System Tables (SAP Library - SAP DB)

 Entering content frame

Component documentation System Tables

The SAP DB database system contains a series of system tables that contain information about the database objects and their connection to each other, statistics system tables, and monitor system tables.

The following examples show you how to evaluate the system tables.

· When you specify SELECT statements for the system tables, you have to bear in mind some general information.

· If you want to find out which system table contains information for a particular database term, consult the list of database terms.

· If you want to find out which information a particular system table can provide, see the section Evaluating System Tables.

For a complete definition of the most important system tables, see Definition of the System Tables.

For general information about the SAP DB database system, see the documentation The SAP DB Database System, and also the following Internet address: www.sapdb.org.


General Information (SAP Library - SAP DB)

 Entering content frame

Background documentation General Information

If you want to evaluate system tables, note the following information:

· When system tables are evaluated, the system only outputs information for objects of which the current user is the owner, or for which the user has at least a privilege (the user therefore knows the object). This authorization concept may mean that the table definition visible for the current user differs from the actual definition.
The definition of a view table is only visible for the owner of the view table.

· When you query the system table(s), you should enter conditions that describe the required object as precisely as possible. Entering the object owner considerably speeds up the search for the relevant information.

· When you specify search commands, you should specify equivalence conditions where possible. Specifying LIKE conditions is less effective.

· For performance reasons, when you query information from system tables, you should use not only the SQL statement SELECT * but also limit the number of output columns to those columns that you actually require.
When you query statistical information from system tables, in particular, additional actions are performed to determine column values in the database system when certain output columns are requested. As a result, you should only have the system determine this column information if you really need it.

· Simple identifiers are always created in the database instance in capital letters, regardless of how they were entered during definition of the data.
If you use simple identifiers in a search condition, you must enter the single quotes typically used when specifying literals.
For performance reasons, you should not leave the conversion of the simple identifier to capital letters to the database system at the execution of the SQL statement; you should enter the simple identifier directly in capital letters in the search condition.

CREATE TABLE mytab (…)
SELECT … FROM … WHERE … = 'MYTAB'

· Special identifiers are always specified in double quotes in the data definition. In the database instance, these are stored as they were entered, meaning they are not converted to capital letters.
If you use special identifiers in a search condition, you must enter the single quotes typical for specifying literals.

CREATE TABLE "this is mytab" (…)
SELECT … FROM … WHERE … = 'this is mytab'


Database Terms (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Terms

To determine information about your SAP DB database system, its objects, structures, status information, and so on, you have to evaluate the relevant system tables.

A list of database terms and references to the system tables that can provide the information on the terms is provided below. The terms are listed in alphabetical order.


A-C (SAP Library - SAP DB)

 Entering content frame

Background documentation A-C

Database terms from A-C

 | Term | Explanation | System table
C | char set (character set) | MapChar set | MAPCHARSETS
 | column | definition domain for definition default value inverted primary key privilege in referential constraint of a table in view definition | COLUMNS COLUMNS COLUMNS INDEXCOLUMNS COLUMNS COLUMNS FOREIGNKEYCOLUMNS VIEWCOLUMNS
 | constraint | of a column or table of a domain referential NOT-NULL columns primary key UNIQUE |


D-H (SAP Library - SAP DB)

 Entering content frame

Background documentation D-H

Database terms from D-H

 | Term | Explanation | System table
D | database instance | in the current database session | USERS
 | database procedure | database procedure parameter | DBPROCEDURES DBPROCPARAMS
 | database session | own all active active roles in the current database session | CONNECTPARAMETERS CONNECTEDUSERS SESSION_ROLES
 | default | of a column of a domain default role | COLUMNS DOMAINS ROLES
 | domain | domain constraint of a domain during column definition | DOMAINS DOMAINCONSTRAINTS COLUMNS
F | foreign key (referential constraint) | referential constraint columns in the referential constraint |


I-R (SAP Library - SAP DB)

 Entering content frame

Background documentation I-R

Database terms from I-R

 | Term | Explanation | System table
I | identification | internal identification of a table internal identification of a user | TABLES USERS
 | index | indexes column UNIQUE | INDEXES INDEXCOLUMNS INDEXES
 | isolation level | of the current database session | CONNECTPARAMETERS
K | key | primary key secondary key foreign key (referential constraint) | COLUMNS FOREIGNKEYCOLUMNS FOREIGNKEYS
L | lock | currently held | LOCKS
M | MapChar set | MapChar set | MAPCHARSETS
O | Operating System | on which the current database instance instance is running | VERSIONS
P | parameter | of a database procedure | DBPROCPARAMS
 | privilege | of a role of a column of a table | ROLEPRIVILEGES COLUMNS TABLES TABLEPRIVILEGES
R | referential constraint | referential constraint columns | FOREIGNKEYS FOREIGNKEYCOLUMNS
 | release (version) | of the database software | VERSIONS
 | result table | existence | TABLES
 | role | role, default role role privilege active roles in the current database session |


S (SAP Library - SAP DB)

 Entering content frame

Background documentation S

Database terms

Term | Explanation | System table
sequence | current value | SEQUENCES
server node | server node used in the current database session | USERS
session (database session) | own all active active roles in the current database session | CONNECTPARAMETERS CONNECTEDUSERS SESSION_ROLES
SQL mode | of the current database session | CONNECTPARAMETERS
statistics | time of last update-statistics run for a table sample values of the update-statistics run of a table | TABLES
synonym | synonyms existence |


T (SAP Library - SAP DB)

 Entering content frame

Background documentation T

Database terms

Term | Explanation | System table
table | tables, existence table definition synonym privilege in view definition constraint referential constraint index view table primary key secondary key trigger | TABLES COLUMNS SYNONYMS TABLES , TABLEPRIVILEGES VIEWCOLUMNS CONSTRAINTS FOREIGNKEYS INDEXES VIEWS COLUMNS FOREIGNKEYCOLUMNS TRIGGERS
timeout | of the current database session | CONNECTPARAMETERS
trigger | trigger | TRIGGERS


U-Z (SAP Library - SAP DB)

 Entering content frame

Background documentation U-Z

Database terms from U-Z

 | Term | Explanation | System table
U | UNIQUE | index | INDEXES
 | user | defined currently active | USERS CONNECTEDUSERS
V | version | of the database software | VERSIONS
 | view table | view tables definition text existence synonym underlying tables and columns |


Evaluating System Tables (SAP Library - SAP DB)

 Entering content frame

Background documentation Evaluating System Tables

The following sections contain examples of how to evaluate information in the system tables:

COLUMNS

CONNECTEDUSERS

CONNECTPARAMETERS

CONSTRAINTS

DBPROCEDURES

DBPROCPARAMS

DOMAINCONSTRAINTS

DOMAINS

FOREIGNKEYCOLUMNS

FOREIGNKEYS

INDEXCOLUMNS

INDEXES

LOCKS

MAPCHARSETS

ROLEPRIVILEGES

ROLES

SEQUENCES

SESSION_ROLES

SYNONYMS

TABLEPRIVILEGES

TABLES

TRIGGERS

USERS

VERSIONS

VIEWCOLUMNS

VIEWDEFS

VIEWS


COLUMNS (SAP Library - SAP DB)

 Entering content frame

COLUMNS

Using the system table COLUMNS, you can determine the following database information, among other things:

· Columns of table RESERVATION in the sequence in which they were defined, together with the relevant comments
SELECT columnname, comment
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'RESERVATION' ORDER BY pos

· Data types of all columns of table CUSTOMER
SELECT columnname, datatype, len, dec, codetype
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'CUSTOMER'

· All columns of your own Basis tables that have the data type DATE
SELECT tablename,columnname
  FROM DOMAIN.COLUMNS
    WHERE owner = user
      AND tabletype = 'TABLE'
      AND datatype = 'DATE'

· All columns of your own table HOTEL for which a default value was defined, plus this default value
SELECT columnname, default
  FROM DOMAIN.COLUMNS
    WHERE owner = user
      AND tablename = 'HOTEL'
      AND default IS NOT NULL

· All primary table columns of table ROOM, sorted according to their sequence in the primary key
SELECT columnname
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'ROOM' AND mode = 'KEY' ORDER BY keypos

· All columns defined with NOT NULL of table CUSTOMER
SELECT columnname
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'CUSTOMER' AND mode = 'MAN'

· All columns of table RESERVATION that can be changed by the current user
SELECT columnname
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'RESERVATION' AND columnprivileges LIKE '*UPD*'

· All columns of table RESERVATION that can be changed by the current user and for which the user can pass on this privilege
SELECT columnname
  FROM DOMAIN.COLUMNS
    WHERE tablename = 'RESERVATION' AND columnprivileges LIKE '*UPD+*'

· All table columns that were specified as MYDOMAIN during definition of the domain
SELECT owner, tablename, columnname
  FROM DOMAIN.COLUMNS
    WHERE domainname = 'MYDOMAIN'

Columns in the index: see INDEXCOLUMNS

Columns in the referential constraint: see FOREIGNKEYCOLUMNS

Primary table or view table columns in the view table: see VIEWCOLUMNS


CONNECTEDUSERS (SAP Library - SAP DB)

 Entering content frame

Background documentation CONNECTEDUSERS

Using the system table CONNECTEDUSERS, you can determine the following database information, among other things:

· All currently logged-on users and the terminal used by the user in question
SELECT username, termid
  FROM DOMAIN.CONNECTEDUSERS

· Name of the terminal that the user logged on to
SELECT termid
  FROM DOMAIN.CONNECTEDUSERS cu, DOMAIN.CONNECTPARAMETERS cp
    WHERE cu.session = cp.session

All defined users: see USERS


CONNECTPARAMETERS (SAP Library - SAP DB)

 Entering content frame

Background documentation CONNECTPARAMETERS

Using the system table CONNECTPARAMETERS, you can determine the following database information, among other things:

Parameters of your own database session
SELECT sqlmode, isolevel, timeout, session
  FROM DOMAIN.CONNECTPARAMETERS


CONSTRAINTS (SAP Library - SAP DB)

 Entering content frame

Background documentation CONSTRAINTS

Using the system table CONSTRAINTS, you can determine the following database information, among other things:

All conditions of the columns of table CUSTOMER that represent explicit value checks
SELECT definition
  FROM DOMAIN.CONSTRAINTS
    WHERE tablename = 'CUSTOMER'

Constraints (integrity conditions) that relate to NOT NULL definitions, primary keys, UNIQUE definitions or referential constrains are not found with this SELECT statement.

NOT-NULL columns: see COLUMNS

Primary keys: see COLUMNS

UNIQUE columns: see INDEXES

Referential constraint: see FOREIGNKEYS

Columns in a referential constraint: see FOREIGNKEYCOLUMNS

Constraint of a domain: see DOMAINCONSTRAINTS


DBPROCEDURES (SAP Library - SAP DB)

 Entering content frame

Background documentation DBPROCEDURES

Using the system table DBPROCEDURES, you can determine the following database information, among other things:

All database procedures and their comments generated in the last 10 days
SELECT owner, dbprocname, comment
  FROM DOMAIN.DBPROCEDURES
    WHERE createdate >= subdate(date,10)

Parameters of a database procedure: see DBPROCPARAMS


DBPROCPARAMS (SAP Library - SAP DB)

 Entering content frame

Background documentation DBPROCPARAMS

Using the system table DBPROCPARAMS, you can determine the following database information, among other things:

· All input parameters of your own database procedure MYPROC and the following parameter information: data type, length and specification of which number in the sequence the parameter has within the database procedure
SELECT parametername, datatype, len, dec, pos
  FROM DOMAIN.DBPROCPARAMS
    WHERE owner = user
      AND dbprocname = 'MYPROC'
      AND "IN/OUT-TYPE" = 'IN'

· Total number of parameters in your own database procedure MYPROC
SELECT COUNT(*)
  FROM DOMAIN.DBPROCPARAMS
    WHERE owner = user
      AND dbprocname = 'MYPROC'

Database procedures: see DBPROCEDURES


DOMAINCONSTRAINTS (SAP Library - SAP DB)

 Entering content frame

Background documentation DOMAINCONSTRAINTS

Using the system table DOMAINCONSTRAINTS, you can determine the following database information, among other things:

All domains for which a restriction of the permitted values was defined, and this definition
SELECT domainname, definition
  FROM DOMAIN.DOMAINCONSTRAINTS

All domains: see DOMAINS


DOMAINS (SAP Library - SAP DB)

 Entering content frame

Background documentation DOMAINS

Using the system table DOMAINS, you can determine the following database information, among other things:

· All domains and their comments defined for data type DATE
SELECT owner, domainname, comment
  FROM DOMAIN.DOMAINS
    datatype = 'DATE'

· All your own domains in which a default value was agreed
SELECT domainname, datatype, len, dec, default
  FROM DOMAIN.DOMAINS
    WHERE owner = user
      AND default IS NOT NULL

Constraint of a domain: see DOMAINCONSTRAINTS

Domain for column definition: see COLUMNS


FOREIGNKEYCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation FOREIGNKEYCOLUMNS

Using the system table FOREIGNKEYCOLUMNS, you can determine the following database information, among other things:

· All referential constraints in which the column CNO of table CUSTOMER is the referenced column
SELECT owner, tablename, columnname, fkeyname, rule
  FROM DOMAIN.FOREIGNKEYCOLUMNS
    WHERE reftablename = 'CUSTOMER'
      AND refcolumnname = 'CNO'

· All referential constraints in which the column HNO of table RESERVATION is the referencing column
SELECT fkeyname, rule
  FROM DOMAIN.FOREIGNKEYCOLUMNS
    WHERE tablename = 'RESERVATION'
      AND columnname = 'HNO'

· All referential constraints in which the referencing columns come from table RESERVATION
SELECT DISTINCT fkeyname, rule, refowner, reftablename
  FROM DOMAIN.FOREIGNKEYCOLUMNS
    WHERE tablename = 'RESERVATION'

All referential constraints: see FOREIGNKEYS


FOREIGNKEYS (SAP Library - SAP DB)

 Entering content frame

Background documentation FOREIGNKEYS

Using the system table FOREIGNKEYS, you can determine the following database information, among other things:

All referential constraints in which table CUSTOMER is the referenced table
SELECT columnname, fkeyname, rule
  FROM DOMAIN.FOREIGNKEYS
    WHERE tablename = 'CUSTOMER'

Columns in referential constraints: see FOREIGNKEYCOLUMNS


INDEXCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation INDEXCOLUMNS

Using the system table INDEXCOLUMNS, you can determine the following database information, among other things:

· All inverted columns (those assigned an index) of table HOTEL
SELECT DISTINCT columnname
  FROM DOMAIN.INDEXCOLUMNS
    WHERE tablename = 'HOTEL'

· All inversions for table RESERVATION, sorted by index, and then by the column sequence specified during index definition
SELECT indexname, type, columnname, sort
  FROM DOMAIN.INDEXCOLUMNS
    WHERE tablename = 'RESERVATION' ORDER BY indexname, columnno

· Information about the columns that make up the index MYINDEX of your own table MYTABLE
SELECT columnname, sort, datatype, len
  FROM DOMAIN.INDEXCOLUMNS
    WHERE tablename = 'MYTAB'
      AND indexname ='MYINDEX' ORDER BY columnno

All indexes: see INDEXES


INDEXES (SAP Library - SAP DB)

 Entering content frame

Background documentation INDEXES

Using the system table INDEXES, you can determine the following database information, among other things:

· All indexes of the table ROOM and specification of which of the indexes currently has the status disabled
SELECT indexname, disabled
  FROM DOMAIN.INDEXES
    WHERE tablename = 'ROOM'

· All UNIQUE indexes (regardless of which of the possible SQL statements was used to generate these indexes: CREATE INDEX statement or UNIQUE definition)
SELECT owner, tablename, indexname
  FROM DOMAIN.INDEXES
    WHERE type = 'UNIQUE'

Columns of an index: see INDEXCOLUMNS


LOCKS (SAP Library - SAP DB)

 Entering content frame

Background documentation LOCKS

Using the system table LOCKS, you can determine the following database information, among other things:

· All locks that are currently held on the table ROOM
SELECT lockmode, lockstate, rowidlength, rowidhex, rowid
  FROM DOMAIN.LOCKS
    WHERE tablename = 'ROOM'

· All locks that the current user is holding in the database session on table ROOM
SELECT lockmode, lockstate, rowidlength, rowidhex, rowid
  FROM DOMAIN.LOCKS l DOMAIN.connectparameters cp
    WHERE tablename = 'ROOM'
      AND l.session = cp.session

· All locks that are currently being held on the table with the hexadecimal internal identification 0000000000D34BA8
SELECT lockmode, lockstate, rowidlength, rowidhex, rowid
  FROM DOMAIN.LOCKS
    WHERE tableid = X'0000000000D34BA8'

If the current user belongs to database user class DBA or SYSDBA, all locks that are held are displayed.

Users that belong to other user class only see the locks held by that one user.


MAPCHARSETS (SAP Library - SAP DB)

 Entering content frame

Background documentation MAPCHARSETS

Using the system table MAPCHARSETS, you can determine the following database information, among other things:

· Name of all MapChar sets
SELECT DISTINCT mapcharsetname
  FROM DOMAIN.MAPCHARSETS

· Conversion of hexadecimal value D6 in MapChar set DEFAULTMAP
SELECT map_code, map_character
  FROM DOMAIN.MAPCHARSETS
    WHERE mapcharsetname = 'DEFAULTMAP'
      AND intern = X'D6'


ROLEPRIVILEGES (SAP Library - SAP DB)

 Entering content frame

Background documentation ROLEPRIVILEGES

Using the system table ROLEPRIVILEGES, you can determine the following database information, among other things:

· All privileges that have been given to role NEW_ROLE directly for your own table MYTABLE. Privileges granted indirectly, that is, granted for table MYTABLE via a different role, are not displayed.
SELECT privileges
  FROM DOMAIN.ROLEPRIVILEGES
    WHERE grantee = 'NEW_ROLE'
      AND owner = user
      AND tablename = 'MYTABLE'

· All roles that were granted to role NEW_ROLE. Specification of who granted the role.
SELECT role, grantor
  FROM DOMAIN.ROLEPRIVILEGES
    WHERE grantee = 'NEW_ROLE'
      AND role IS NOT NULL

All roles: see ROLES

All roles that are used as a default value: see ROLES

All roles that are active in the current database session: see SESSION_ROLES


ROLES (SAP Library - SAP DB)

 Entering content frame

Background documentation ROLES

Using the system table ROLES, you can determine the following database information, among other things:

· All roles that require a password to be specified before they can be activated
SELECT owner, role
  FROM DOMAIN.ROLES
    WHERE password_required = 'YES'

· All roles that the current user uses as a default value
SELECT role
  FROM DOMAIN.ROLES
    WHERE defaultrole = 'YES'

All roles that are active in the current database session: see SESSION_ROLES

Role privilege: see ROLEPRIVILEGES


SEQUENCES (SAP Library - SAP DB)

 Entering content frame

Background documentation SEQUENCES

Using the system table SEQUENCES, you can determine the following database information, among other things:

· All sequences with an incremental value that is not +1 and the value limits of the sequences
SELECT owner, sequence_name, increment_by, min_value, max_value
  FROM DOMAIN.SEQUENCES
    WHERE increment_by <> 1

· All sequences with a positive incremental value. The values are not assigned cyclically, and there are, at most, only 1000 free values remaining.
SELECT owner, sequence_name, last_number, max_value
  FROM DOMAIN.SEQUENCES
    WHERE increment_by > 0
      AND cycle_flag = 'N'
      AND max_value - last_number <= 1000

· Current value of your own sequence MYSEQ
SELECT last_number
  FROM DOMAIN.SEQUENCES
    WHERE owner = user
      AND sequence_name = 'MYSEQ'

· Last value assigned by the current database session to the own sequence MYSEQ
SELECT user.myseq.currval
FROM DUAL


SESSION_ROLES (SAP Library - SAP DB)

 Entering content frame

Background documentation SESSION_ROLES

Using the system table SESSION_ROLES, you can determine the following database information, among other things:

All roles that are active in the current database session
SELECT role
FROM DOMAIN.SESSION_ROLES

All roles: see ROLES

All roles that are used as a default value: see ROLES

Role privilege: see ROLEPRIVILEGES


SYNONYMS (SAP Library - SAP DB)

 Entering content frame

Background documentation SYNONYMS

Using the system table SYNONYMS, you can determine the following database information, among other things:

· All tables (Basis tables, view tables) for which the PUBLIC synonym SHORT-TAB was defined
SELECT tableowner, tablename
  FROM DOMAIN.SYNONYMS
    WHERE public = 'YES'
      AND synonymname = 'SHORT_TAB'

· Private synonym for table HIS_TAB of user USER2
SELECT synonymname
  FROM DOMAIN.SYNONYMS
    WHERE owner = user
      AND tableowner = 'USER2'
      AND tablename = 'HIS_TAB'

Existence of a synonym: see TABLES


TABLEPRIVILEGES (SAP Library - SAP DB)

 Entering content frame

Background documentation TABLEPRIVILEGES

Using the system table TABLEPRIVILEGES, you can determine the following database information, among other things:

· All tables for which the current user has been given a privilege. Own tables are not output.
SELECT owner, tablename, privileges
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantee = user

· All tables for which the current user has been given the SELECT privilege and is allowed to pass this on. Own tables are not output.
SELECT owner, tablename
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantee = user
      AND privileges LIKE '*SEL*'
      AND is_grantable = 'YES'

· All privileges that the current user has passed on to user USER2
SELECT owner, tablename, privileges
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantor = user
      AND grantee = 'USER2'

All tables: see TABLES

Existence of a table: see TABLES

Table definition: see COLUMNS

Synonym for a table: see SYNONYMS

Table privilege: see TABLES

Table in a view definition: see VIEWCOLUMNS


TABLES (SAP Library - SAP DB)

 Entering content frame

Background documentation TABLES

Using the system table TABLES, you can determine the following database information, among other things:

· All tables, view tables and synonyms for which the current user can execute SELECT statements
SELECT owner, tablename
  FROM DOMAIN.TABLES
    WHERE privileges LIKE '*SEL*'

· All result tables of the current user
SELECT tablename
  FROM DOMAIN.TABLES
    WHERE type = 'RESULT'

· All the user’s own tables for which the last update statistics run is more than 30 days in the past
SELECT tablename, updstatdate
  FROM DOMAIN.TABLES
    WHERE updstatdate <= subdate (DATE,30)

· Information on which sample values are used to carry out an update statistics run on table CUSTOMER
SELECT sample_percent, sample_rows
  FROM DOMAIN.TABLES
    WHERE tablename = 'CUSTOMER'

· Internal identification of table HOTEL
SELECT tableid
  FROM DOMAIN.TABLES
    WHERE tablename = 'HOTEL'
If this relates to a Basis table, the internal identification of a table can be used, for example, during the lock query (see LOCKS).

Table definition: see COLUMNS

Primary key: COLUMNS

Synonym for a table: see SYNONYMS

Table privilege: see TABLEPRIVILEGES

Table in a view definition: see VIEWCOLUMNS

Constraint of a column or table: see CONSTRAINTS

Referential constraint: see FOREIGNKEYS

Index: see INDEXES

View table: VIEWS

Secondary key: see FOREIGNKEYCOLUMNS

Trigger: see TRIGGERS


TRIGGERS (SAP Library - SAP DB)

 Entering content frame

Background documentation TRIGGERS

Using the system table TRIGGERS, you can determine the following database information, among other things:

· Insert trigger for the table HOTEL
SELECT triggername, definition
  FROM DOMAIN.TRIGGERS
    WHERE tablename = 'HOTEL'
      AND INSERT = 'YES'

· Table and action for which the trigger MYTRIGGER was defined
SELECT owner, triggername, insert, update, delete
  FROM DOMAIN.TRIGGERS
    WHERE triggername = 'MYTRIGGER'


USERS (SAP Library - SAP DB)

 Entering content frame

Background documentation USERS

Using the system table USERS, you can determine the following database information, among other things:

· All defined users with the database user class STANDARD
SELECT username, groupname
  FROM DOMAIN.USERS
    WHERE usermode = 'STANDARD'

· All users who have not changed their password for over six months
SELECT username, pwcreatedate, pwcreatetime
  FROM DOMAIN.USERS
    WHERE pwcreatedate <= subdate (date,183)

· All users who are members of a user group and are allowed to log on to the database instance several times simultaneously
SELECT groupname, username, usermode
  FROMDOMAIN.USERS
    WHERE groupname <> username
      AND connectmode = 'MULTIPLE'

· Name of the database instance on which the current database session was opened. Name of the server on which this database instance is running.
SELECT DISTINCT serverdb, servernode
  FROM DOMAIN.USERS

Currently active user: see CONNECTEDUSERES


VERSIONS (SAP Library - SAP DB)

 Entering content frame

Background documentation VERSIONS

Using the system table VERSIONS, you can determine the following database information, among other things:

Version of the software with which the current database instance is running, and the operating system that the instance is running on
SELECT *
  FROM DOMAIN.VERSIONS


VIEWCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation VIEWCOLUMNS

Using the system table VIEWCOLUMNS, you can determine the following database information, among other things:

· All tables or view tables that form the basis for your own view table MYVIEW
SELECT tableowner, tablename
  FROM DOMAIN.VIEWCOLUMNS
    WHERE owner = user
      AND viewname = 'MYVIEW'

· Column of the table or view table that forms the basis for column V_COL of your own view table
SELECT tableowner, tablename, columnname
  FROM DOMAIN.VIEWCOLUMNS
    WHERE owner = user
      AND viewname = 'MYVIEW'
      AND viewcolumnname = 'V_COL'

· Determine whether the column TITLE of table CUSTOMER forms the basis of a view table
SELECT owner, viewname, viewcolumnname
  FROM DOMAIN.VIEWCOLUMNS
    WHERE tablename = 'CUSTOMER'
      AND columnname = 'TITLE'

All views: see VIEWS

Definition of a view: see VIEWDEFS

Existence of a view: see TABLES


VIEWDEFS (SAP Library - SAP DB)

 Entering content frame

Background documentation VIEWDEFS

Using the system table VIEWDEFS, you can determine the following database information, among other things:

Text that was entered for the definition of your own view table MYVIEW
SELECT definition
  FROM DOMAIN.VIEWDEFS
    WHERE owner = user
      AND viewname = 'MYVIEW'

Only the owner of a view table can select the definition. No output is provided for any other users.

All view tables: see VIEWS

Existence of a view table: see TABLES

Tables and columns forming the basis for a view table: see VIEWCOLUMNS


VIEWS (SAP Library - SAP DB)

 Entering content frame

Background documentation VIEWS

Using the system table VIEWS, you can determine the following database information, among other things:

  • All privileges of your own view table MYVIEW
    SELECT privileges
      FROM DOMAIN.VIEWS
        WHERE owner = user
          AND viewname = 'MYVIEW'
  • All view tables and their comments that the current user can see without being the owner
    SELECT owner, viewname, comment
      FROM DOMAIN.VIEWS
        WHERE owner <> user

Definition text of a view table: see VIEWDEFS

Existence of a view table: see TABLES

Synonym for a view table: see SYNONYMS

Tables and columns forming the basis for a view table: see VIEWCOLUMNS


Definitions of the System Tables (SAP Library - SAP DB)

 Entering content frame

Background documentation Definitions of the System Tables

System Tables with Information on Database Objects

The SAP DB database system contains a series of system tables that contain information about the database objects and their connection to each other. These system tables are available in every SQL mode. Their owner is the DOMAIN user. The owner has to be specified when accessing these tables in every SQL mode other than INTERNAL.

Definitions of the most important system tables:

COLUMNS | CONNECTEDUSERS | CONNECTPARAMETERS
CONSTRAINTS | DBPROCEDURES | DBPROCPARAMS
DOMAINCONSTRAINTS | DOMAINS | FOREIGNKEYCOLUMNS
FOREIGNKEYS | INDEXCOLUMNS | INDEXES
LOCKS | MAPCHARSETS | PACKAGES
ROLEPRIVILEGES | ROLES | SEQUENCES
SESSION ROLES | SYNONYMS | TABLEPRIVILEGES
TABLES | TRIGGERS | USERS
VERSIONS | VIEWCOLUMNS | VIEWDEFS
VIEWS |  |

System Tables with Information on Database States

The SAP DB database system contains a series of system tables that contain information about the system configuration and system load. These system tables are available in every SQL mode. Their owner is the SYSINFO user. You do not need to specify the owner when accessing these tables.

Definitions of the most important system tables:

ACTIVECONFIGURATION | CACHESTATISTICS | COMMANDCACHESTATISTICS
COMMANDSTATISTICS | DATAVOLUMES | HOTSTANDBYCOMPONENT
HOTSTANDBYGROUP | INSTANCE | LOGVOLUMES
MEMORYALLOCATORSTATISTICS | OPTIMIZERINFORMATION | VERSION

Statistics System Tables

The SAP DB database system contains a number of system tables that you can use to select information about the configuration, structures, and sizes of database objects. The owner of these statistics system tables is the SYSDBA user. You do not need to specify the owner when accessing these tables.

Statistics System Tables

DBPARAMETERS | INDEXSTATISTICS | LOCKLISTSTATISTICS
OPTIMIZERSTATISTICS | SERVERDBSTATISTICS | TABLESTATISTICS
TRANSACTIONS | USERSTATISTICS |

Monitor System Tables

The SAP DB database system contains a number of system tables that you can use to access monitor information. The owner of these monitor system tables is the SYSDBA user. You do not need to specify the owner when accessing these tables.

The monitor system tables return results for the SYSDBA user and for all users of the database user class DBA. Non-authorized users receive the error message 100 – Row not found.

The monitor system tables have the following structure:

DESCRIPTION | CHAR(40)
VALUE | FIXED(20)

Each row contains a counter value. The meaning of this value is in the DESCRIPTION column.

Monitor System Tables

MONITOR | MONITOR_CACHES | MONITOR_LOAD
MONITOR_LOCK | MONITOR_LOG | MONITOR_LONG
MONITOR_PAGES | MONITOR_ROW | MONITOR_TRANS

Loader System Tables

The SAP DB database system contains a range of system tables that are used by the loader. The owner of these loader system tables is the SYSDBA user. You do not need to specify the owner when accessing these tables.

Loader System Tables

TRANSFORMATIONMODEL | TRANSFORMATIONMONITOR | TRANSFORMATIONPACKAGES
TRANSFORMATIONRESOURCES | TRANSFORMATIONSTATISTICS | TRANSFORMATIONSTEPS


ACTIVECONFIGURATION (SAP Library - SAP DB)

 Entering content frame

Object documentation ACTIVECONFIGURATION

The system table ACTIVECONFIGURATION contains the names and values of the currently active database parameters.

ACTIVECONFIGURATION

PARAMETERNAME | CHAR(32) | Name of the database parameter
VALUE | CHAR(256) | Value of the database parameter


CACHESTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation CACHESTATISTICS

The system table CACHESTATISTICS contains information on accesses to caches since the last time the database instance was started.

CACHESTATISTICS

NAME | CHAR(20) | Name of the cache
ACCESSCOUNT | FIXED(20) | Number of accesses to the cache
SUCCESSFULACCESSCOUNT | FIXED(20) | Number of successful accesses to the cache
UNSUCCESSFULACCESSCOUNT | FIXED(20) | Number of unsuccessful accesses to the cache
HITRATE | FIXED(3) | Hit rate (successful cache accesses as a percentage of total cache accesses)


COLUMNS (SAP Library - SAP DB)

 Entering content frame

Object documentation COLUMNS

The system table COLUMNS contains the columns of all the tables, views, synonyms, and event tables for which the current user has privileges.

COLUMNS

OWNER | CHAR(32) | Name of owner of database object
TABLENAME | CHAR(32) | Name of database object
COLUMNNAME | CHAR(32) | Name of column
MODE | CHAR(3) | Type of column (KEY | MAN | OPT)
DATATYPE | CHAR(10) | Data type of column (BOOLEAN | CHAR | DATE | FIXED | FLOAT | INTEGER | LONG | SMALLINT | TIME | TIMESTAMP)
CODETYPE | CHAR(8) | Code attribute of column (ASCII | EBCDIC | BYTE | UNICODE)
LEN | FIXED(4) | Length or precision of column
DEC | FIXED(3) | Number of places after the comma for columns of data type FIXED
NULLABLE | CHAR(3) | Column can accept null values (YES | NO)
COLUMNPRIVILEGES | CHAR(8) | Privileges of current user for column
DEFAULT | CHAR(254) | Default value (DEFAULT) for column
DEFAULTFUNCTION | CHAR(12) | Name, if the DEFAULT value is one of the following value specifications: NULL | USER | USERGROUP | SYSDBA | UID | DATE | TIME | TIMESTAMP | UTCDATE | TIMEZONE | UTCDIFF | TRUE | FALSE | TRANSACTION Otherwise NULL value
DOMAINOWNER | CHAR(32) | Name of domain owner
DOMAINNAME | CHAR(32) | Name of domain
POS | FIXED(4) | Original position of column in table
KEYPOS | FIXED(4) | Original position of key column in table
PHYSICALPOS | FIXED(4) | Position of the column on the disk
CREATEDATE | DATE(10) | Creation date of column
CREATETIME | TIME(8) | Creation time of column
ALTERDATE | DATE(10) | Change date of column
ALTERTIME | TIME(8) | Change time of column
TABLETYPE | CHAR(8) | Type of table (SYSTEMS | TABLES)
COMMENT | LONG | Comment about column

See also:

Evaluating System Tables ® COLUMNS


COMMANDCACHESTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation COMMANDCACHESTATISTICS

The system table COMMANDCACHESTATISTICS contains the statistical information collected about the command cache activities since the last time the database instance was started. The command cache contains the SQL statements and their execution plans shared by different database sessions (the following refers to the SQL statement and execution plan collectively as a command).

COMMANDCACHESTATISTICS

USABLESIZE | FIXED(10) | Size of the command cache (KB)
USEDSIZE | FIXED(10) | Size of the area of the command cache that is actually used (KB)
USEDSIZEPERCENTAGE | FIXED(3) | Size of the area of the command cache that is actually used (%)
MAXUSEDSIZE | FIXED(10) | Maximum used area of the command cache (KB)
MAXUSEDSIZEPERCENTAGE | FIXED(3) | Maximum used area of the command cache (%)
COMMANDCOUNT | FIXED(10) | Number of stored commands
MAXCOMMANDCOUNT | FIXED(10) | Maximum number of stored commands
INSERTCOMMANDCOUNT | FIXED(10) | Number of inserts
DELETECOMMANDCOUNT | FIXED(10) | Number of deletes
FAILEDALLOCATECOUNT | FIXED(10) | Number of memory requests not fulfilled
CLEANUPCOUNT | FIXED(10) | Number of operations that encountered a lack of space in the main memory
CLEANUPCOMMANDCOUNT | FIXED(10) | Number of commands modified due to lack of space in the main memory
INVALIDDATECOUNT | FIXED(10) | Number of data definition statements that made execution plans invalid
UNLOADSTATEMENTCOUNT | FIXED(10) | Number of SQL statements displaced to disk
CURRENTUNLOADSTATEMENTCOUNT | FIXED(10) | Number of SQL statements currently displaced to disk
RELOADSTATEMENTCOUNT | FIXED(10) | Number of SQL statements reloaded to the main memory
DELETEPLANCOUNT | FIXED(10) | Number of execution plans deleted due to lack of space in the main memory
HASHTABLESLOTCOUNT | FIXED(5) | Number of slots in the hash table
USEDHASHTABLESLOTCOUNT | FIXED(5) | Number of used slots in the hash table
MAXUSEDHASHTABLESLOTCOUNT | FIXED(5) | Maximum number of used slots in the hash table
AVGHASHTABLECHAINENTRYCOUNT | FIXED(5) | Average length of the hash entry overflow chains
MAXHASHTABLECHAINENTRYCOUNT | FIXED(5) | Maximum length of the hash entry overflow chains


COMMANDSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation COMMANDSTATISTICS

The system table COMMANDSTATISTICS describes SQL statements that are stored in the command cache, and also contains statistical information on the activities of these SQL statements collected since the last time the database instance was started. The command cache contains the SQL statements and their execution plans shared by different database sessions

COMMANDSTATISTICS

COMMANDID | CHAR(8) BYTE | ID of the SQL statement
HASHVALUE | FIXED(10) | Hash value
HASHTABLESLOT | FIXED(5) | Slot in the hash table
STATUS | CHAR(10) | Status (PREPARING | PREPARED | INVALID)
USERNAME | CHAR(32) | Name of the database user
SQLMODE | CHAR(10) | SQL mode
ISOLATIONLEVEL | CHAR(3) | Isolation level
DATEFORMAT | CHAR(12) | Date and time format
MASSCOMAND | CHAR(3) | Command can be used as an array command (YES/NO)
STATEMENTSIZE | FIXED(10) | Length of the SQL statement (bytes)
STATEMENT | LONG | SQL statement
PLANSIZE | FIXED(10) | Memory requirements of the execution plan (bytes)
PREPARECOUNT | FIXED(10) | Number of execution preparations
REFERENCECOUNT | FIXED(5) | Number of database sessions for which the SQL statement has been prepared for execution
CURRENTEXECUTECOUNT | FIXED(10) | Current number of executions
EXECUTECOUNT | FIXED(5) | Number of executions
PREPARETIME | FIXED(20) | Parse time ( ms)
EXECUTETIME | FIXED(20) | Total duration of executions ( ms)
AVGEXECUTETIME | FIXED(20) | Average execution time ( ms)
MINEXECUTETIME | FIXED(20) | Minimum execution time ( ms)
MAXEXECUTETIME | FIXED(20) | Maximum execution time ( ms)
READROWCOUNT | FIXED(20) | Number of rows read
QUALIFIEDROWCOUNT | FIXED(20) | Number of qualified rows
VIRTUALREADCOUNT | FIXED(20) | Number of reads in the data cache
PHYSICALREADCOUNT | FIXED(20) | Number of reads in the data cache that triggered reads on the disk
FETCHROWCOUNT | FIXED(20) | Number of rows (in the result tables generated by the SQL statement) sent to the application
SUSPENDCOUNT | FIXED(20) | Number of suspends
WAITCOUNT | FIXED(20) | Number of waits caused by lock collisions


CONNECTEDUSERS (SAP Library - SAP DB)

 Entering content frame

Object documentation CONNECTEDUSERS

The system table CONNECTEDUSERS contains all the users who have logged on.

CONNECTEDUSERS

USERNAME | CHAR(32) | Name of user
TERMID | CHAR(18) | Terminal identification
SESSION | FIXED(10) | Session
CATALOG_CACHE_SIZE | FIXED(10) | Size of cache for catalog information of this database session

See also:

Evaluating System Tables ® CONNECTEDUSERS


CONNECTPARAMETERS (SAP Library - SAP DB)

 Entering content frame

Object documentation CONNECTPARAMETERS

The system table CONNECTPARAMETERS contains information about session-specific parameters.

CONNECTPARAMETERS

SQLMODE | CHAR(8) | SQL mode
ISOLEVEL | FIXED(10) | Isolation level
TIMEOUT | FIXED(10) | Value of the session timeout (timeout value)
SESSION | FIXED(10) | Database session

See also:

Evaluating System Tables ® CONNECTPARAMETERS


CONSTRAINTS (SAP Library - SAP DB)

 Entering content frame

Object documentation CONSTRAINTS

The system table CONSTRAINTS contains the CONSTRAINT definitions for all the tables for which the current user has privileges.

CONSTRAINTS

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of table with CONSTRAINT definition
CONSTRAINTNAME | CHAR(32) | Name of CONSTRAINT definition
DEFINITION | LONG | Text of CONSTRAINT definition

See also:

Evaluating System Tables ® CONSTRAINTS


DATAVOLUMES (SAP Library - SAP DB)

 Entering content frame

Object documentation DATAVOLUMES

The system table DATAVOLUMES describes the volumes in which data is stored (see Data Volumes).

DATAVOLUMES

ID | FIXED(5) | Number of the volume
PATH | CHAR(256) | Name of the volume
CONFIGUREDSIZE | FIXED(20) | Configured size of the volume (KB)
USABLESIZE | FIXED(20) | Area of the volume that can be used for data (KB)
USEDSIZE | FIXED(20) | Area of the volume used for data (KB)
USEDSIZEPERCENTAGE | FIXED(3) | Area of the volume used as a percentage of the total area that can be used for data


DBPARAMETERS (SAP Library - SAP DB)

 Entering content frame

Object documentation DBPARAMETERS

The statistics system table DBPARAMETERS contains the parameters that were defined for the database instance by using the Database Manager tool.

DBPARAMETERS

DESCRIPTION | CHAR(18) | Description of how to interpret the VALUE column
VALUE | CHAR(256) | Value


DBPROCEDURES (SAP Library - SAP DB)

 Entering content frame

Object documentation DBPROCEDURES

The system table DBPROCEDURES contains all the database procedures for which the current user has privileges.

DBPROCEDURES

OWNER | CHAR(32) | Name of owner of database procedure
DBPROCNAME | CHAR(32) | Name of database procedure
PACKAGE | CHAR(32) | Package that contains the database procedure
PARAMETER | FIXED(4) | Number of parameters of database procedure
CREATEDATE | DATE(10) | Creation date of database procedure
CREATETIME | TIME(8) | Creation time of database procedure
EXCECUTION_KIND | CHAR(6) | Execution location of database procedure (INPROC | LOCAL | REMOTE)
LANGUAGE | CHAR(32) | Implementation language of the database procedure (SPL | C++ | JAVA | ...)
SQL_SUPPORT | CHAR(3) | Database procedure may contain SQL statements (YES | NO)
WAIT_FOR_CHCKPT | CHAR(3) | Database procedure waits for a checkpoint (YES | NO)
REMOTE_LOCATION | CHAR(132) | Execution location
DEFINITION | LONG | SQL statement for defining the database procedure
COMMENT | LONG | Comment about database procedure

See also:

Evaluating System Tables ® DBPROCEDURES


DBPROCPARAMS (SAP Library - SAP DB)

 Entering content frame

Object documentation DBPROCPARAMS

The system table DBPROCPARAMS contains all the parameters of a database procedure for which the current user has privileges.

DBPROCPARAMS

OWNER | CHAR(32) | Name of owner of database procedure
DBPROCNAME | CHAR(32) | Name of database procedure
PARAMETERNAME | CHAR(32) | Name of parameter
POS | FIXED(4) | Original position of parameter in database procedure
IN/OUT-TYPE | CHAR(6) | Type of parameter (IN | OUT)
DATATYPE | CHAR(10) | Datatype of parameter (BOOLEAN | CHAR | DATE | FIXED | FLOAT | TIME | TIMESTAMP)
CODETYPE | CHAR(8) | Code attribute of column (ASCII | EBCDIC | BYTE | UNICODE)
LEN | FIXED(4) | Length or precision of parameter
DEC | FIXED(3) | Number of places after the comma for the parameter of data type FIXED
CREATEDATE | DATE(10) | Creation date of database procedure
CREATETIME | TIME(8) | Creation time of database procedure

See also:

Evaluating System Tables ® DBPROCPARAMS


DOMAINCONSTRAINTS (SAP Library - SAP DB)

 Entering content frame

Object documentation DOMAINCONSTRAINTS

The system table DOMAINCONSTRAINTS contains the CONSTRAINT definition of a domain.

DOMAINCONSTRAINTS

OWNER | CHAR(32) | Name of domain owner
DOMAINNAME | CHAR(32) | Name of domain
CONSTRAINTNAME | CHAR(32) | Name of CONSTRAINT definition
DEFINITION | LONG | Text of CONSTRAINT definition

See also:

Evaluating System Tables ® DOMAINCONSTRAINTS


DOMAINS (SAP Library - SAP DB)

 Entering content frame

Object documentation DOMAINS

The system table DOMAINS contains all domains.

DOMAINS

OWNER | CHAR(32) | Name of domain owner
DOMAINNAME | CHAR(32) | Name of domain
DATATYPE | CHAR(10) | Data type of domain (BOOLEAN | CHAR | DATE | FIXED | FLOAT | INTEGER | LONG | SMALLINT | TIME | TIMESTAMP)
CODETYPE | CHAR(8) | Code attribute of domain (ASCII | EBCDIC | BYTE | UNICODE)
LEN | FIXED(4) | Length or precision of domain
DEC | FIXED(3) | Number of places after the comma for domains of data type FIXED
DEFAULT | CHAR(254) | Default value for domain
DEFAULTFUNCTION | CHAR(12) | Name, if the DEFAULT value is one of the following value specifications: NULL | USER | USERGROUP | SYSDBA | UID | DATE | TIME | TIMESTAMP | UTCDATE | TIMEZONE | UTCDIFF | TRUE | FALSE | TRANSACTION Otherwise NULL value
DEFINITION | LONG | Text of domain definition
CREATEDATE | DATE(10) | Creation date of domain
CREATETIME | TIME(8) | Creation time of domain
COMMENT | LONG | Comment about domain

See also:

Evaluating System Tables ® DOMAINS


FOREIGNKEYCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Object documentation FOREIGNKEYCOLUMNS

The system table FOREIGNKEYCOLUMNS contains the columns of all the referential CONSTRAINT definitions for which the current user has privileges.

FOREIGNKEYCOLUMNS

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table
COLUMNNAME | CHAR(32) | Name of column
FKEYNAME | CHAR(32) | Name of referential CONSTRAINT definition
REFOWNER | CHAR(32) | Name of owner of referenced table
REFTABLENAME | CHAR(32) | Name of referenced table
REFCOLUMNNAME | CHAR(32) | Name of column of referenced table
RULE | CHAR(18) | Rules for deleting the table
CREATEDATE | DATE(10) | Creation date of referential CONSTRAINT definition
CREATETIME | TIME(8) | Creation time of referential CONSTRAINT definition
COMMENT | LONG | Comment about referential CONSTRAINT definition

See also:

Evaluating System Tables ® FOREIGNKEYCOLUMNS


FOREIGNKEYS (SAP Library - SAP DB)

 Entering content frame

Object documentation FOREIGNKEYS

The system table FOREIGNKEYS contains all the referential CONSTRAINT definitions for which the current user has privileges.

FOREIGNKEYS

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table
FKEYNAME | CHAR(32) | Name of referential CONSTRAINT definition
RULE | CHAR(18) | Rules for deleting the table
CREATEDATE | DATE(10) | Creation date of referential CONSTRAINT definition
CREATETIME | TIME(8) | Creation time of referential CONSTRAINT definition

See also:

Evaluating System Tables ® FOREIGNKEYS


HOTSTANDBYCOMPONENT (SAP Library - SAP DB)

 Entering content frame

Object documentation HOTSTANDBYCOMPONENT

The system table HOTSTANDBYCOMPONENT describes some of the details of the hot standby component in which the information of this system table is queried.

HOTSTANDBYCOMPONENT

LOCALNODE | CHAR(64) | Name with which the hot standby component can be addressed
MASTERLOCALNODE | CHAR(64) | Name with which the corresponding master hot standby component can be addressed
STANDBYROLE | CHAR(8) | Role within the hot standby configuration (MASTER | STANDBY | UNKNOWN)
TAKEOVERDATE | TIMESTAMP | Time at which the TAKEOVER statement was received
DELAYTIME | FIXED(10) | Minimum number of seconds that must pass between the change being made in the master hot standby component, and the change also being made in this hot standby component
STANDBYSTATEDATE | TIMESTAMP | Time at which the STANDBY state was reached
SYNCHRONIZERECEIVECOUNT | FIXED(10) | Number of received SYNCHRONIZE statements
FIRSTNEEDEDLOGOFFSET | FIXED(10) | Oldest position in the log area from which the log entries have to be redone
LASTVALIDLOGOFFSETRECEIVED | FIXED(10) | Position in the log area up to which the log entries can be redone by this hot standby component with the STANDBY role
INITSTANDBYDATE | TIMESTAMP | Time at which the INIT STANDBY statement was received
RESTARTSTANDBYDATE | TIMESTAMP | Time at which the RESTART STANDBY statement was sent
LASTSYNCHRONIZEDATE | TIMESTAMP | Time at which the last SYNCHRONIZE statement was received
PREPARESTANDBYDATE | TIMESTAMP | Time at which the PREPARE STANDBY statement was sent
REGISTERSTANDBYDATE | TIMESTAMP | Time at which the REGISTER STANDBY statement was sent


HOTSTANDBYGROUP (SAP Library - SAP DB)

 Entering content frame

Object documentation HOTSTANDBYGROUP

The system table HOTSTANDBYGROUP describes information that the hot standby component (that is, the hot standby component in which the information from this system table is queried) holds about the other hot standby components with the STANDBY role.

HOTSTANDBYGROUP

LOCALNODE | CHAR(64) | Name with which the hot standby component can be addressed
ADDNODEDATE | TIMESTAMP | Time at which the hot standby component was added to the hot standby configuration
REMOVENODEDATE | TIMESTAMP | Time at which the hot standby component was deleted from the hot standby configuration
STATE | CHAR(20) | Status of the hot standby component (UNKNOWN | BELIEVED TO BE DEAD | PREPARE PENDING | REGISTER PENDING | SYNC PENDING | STANDBY)
PREPARESTANDBYDATE | TIMESTAMP | Time at which the PREPARE STANDBY statement was received
REGISTERSTANDBYDATE | TIMESTAMP | Time at which the REGISTER STANDBY statement was received
SYNCHRONIZEDATE | TIMESTAMP | Time at which the last SYNCHRONIZE statement was sent
SUCCESSFULSYNCHRONIZEDATE | TIMESTAMP | Time at which the last successful SYNCHRONIZE statement was executed
LASTVALIDLOGOFFSETSENT | FIXED(10) | Last position sent by the master component in the log area, up to which the log entries can be redone by hot standby components with the STANDBY role
FIRSTNEEDELOGOFFSET | FIXED(10) | Oldest position in the log area from which the log entries have to be redone
SYNCHRONIZESENDCOUNT | FIXED(10) | Number of sent SYNCHRONIZE statements
SYNCHRONIZERETRYCOUNT | FIXED(10) | Number of SYNCHRONIZE statements sent repeatedly


INDEXCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Object documentation INDEXCOLUMNS

The system table INDEXCOLUMNS contains detailed information about the indexes for which the current user has privileges.

INDEXCOLUMNS

OWNER | CHAR(32) | Name of index owner
TABLENAME | CHAR(32) | Name of the table
INDEXNAME | CHAR(32) | Name of the index
TYPE | CHAR(6) | Type of index (UNIQUE | NULL)
COLUMNNAME | CHAR(32) | Name of column
SORT | CHAR(4) | Sort sequence for column (ASC | DESC)
COLUMNNO | FIXED(4) | Number of column in index
DATATYPE | CHAR(10) | Data type of domain (BOOLEAN | CHAR | DATE | FIXED | FLOAT | INTEGER | LONG | SMALLINT | TIME | TIMESTAMP)
LEN | FIXED(4) | Length or precision of column definition
CREATEDATE | DATE(10) | Creation date of index
CREATETIME | TIME(8) | Creation time of index
INDEX_USED | FIXED(10) | Usage frequency of index for searches
DISABLED | CHAR(3) | Index not activated for searches (YES | NO)
COMMENT | LONG | Comment about index

See also:

Evaluating System Tables ® INDEXCOLUMNS


INDEXES (SAP Library - SAP DB)

 Entering content frame

Object documentation INDEXES

The system table INDEXES contains all the indexes for which the current user has privileges.

INDEXES

OWNER | CHAR(32) | Name of index owner
TABLENAME | CHAR(32) | Name of the table
INDEXNAME | CHAR(32) | Name of the index
TYPE | CHAR(6) | Type of index (UNIQUE | NULL)
CREATEDATE | DATE(10) | Creation date of index
CREATETIME | TIME(8) | Creation time of index
INDEX_USED | FIXED(10) | Usage frequency of index for searches
DISABLED | CHAR(3) | Index not activated for searches (YES | NO)
COMMENT | LONG | Comment about index

See also:

Evaluating System Tables ® INDEXES


INDEXSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation INDEXSTATISTICS

The statistics system table INDEXSTATISTICS contains information about the structure and sizes of indexes.

INDEXSTATISTICS

OWNER | CHAR(32) | Table owner
TABLENAME | CHAR(32) | Table name
INDEXNAME | CHAR(32) | Index name (NULL for unknown indexes)
COLUMNNAME | CHAR(32) | Name of an inverted column
DESCRIPTION | CHAR(40) | Description (see table Column DESCRIPTION) of how to interpret following columns
CHAR_VALUE | CHAR(12) | Alphanumeric value
NUMERIC_VALUE | FIXED(10) | Numeric value

Column DESCRIPTION

Value | Explanation
Root pno | NUMERIC_VALUE contains the page number of the root of the B* tree
Filetype | CHAR_VALUE contains the type of the B* tree
Used pages | NUMERIC_VALUE indicates how many pages are used by the index
Index pages | NUMERIC_VALUE indicates how many pages are used by the index in the B* tree index
Leaf pages | NUMERIC_VALUE indicates how many leaf pages are used by the index
Index levels | NUMERIC_VALUE contains the number of index levels in the B* tree
Space used in all pages(%) | NUMERIC_VALUE contains the used space of all pages in the B* tree (as a percentage)
Space used in root page(%) | NUMERIC_VALUE contains the used space of the root page in the B* tree (as a percentage)
Space used in index pages(%) | NUMERIC_VALUE contains the used space of the index pages in the B* tree (as a percentage)
Space used in index pages(%) min | NUMERIC_VALUE contains the minimum used space of the index pages in the B* tree (as a percentage)
Space used in index pages(%) max | NUMERIC_VALUE contains the maximum used space of the index pages in the B* tree (as a percentage)
Space used in leaf pages(%) | NUMERIC_VALUE contains the used space of the leaf pages in the B* tree (as a percentage)
Space used in leaf pages(%) min | NUMERIC_VALUE contains the minimum used space of the leaf pages in the B* tree (as a percentage)
Space used in leaf pages(%) max | NUMERIC_VALUE contains the maximum used space of the leaf pages in the B* tree (as a percentage)
Secondary keys (index lists) | NUMERIC_VALUE contains the number of different values of the indexed columns
Avg secondary key length | NUMERIC_VALUE contains the average length of an index value
Min secondary key length | NUMERIC_VALUE contains the minimum length of an index value
Max secondary key length | NUMERIC_VALUE contains the maximum length of an index value
Avg separator length | NUMERIC_VALUE contains the average length of a separator in the B* tree
Min separator length | NUMERIC_VALUE contains the minimum length of a separator
Max separator length | NUMERIC_VALUE contains the maximum length of a separator
Primary keys | NUMERIC_VALUE contains the number of rows in the table identified by OWNER and TABLENAME
Avg primary keys per list | NUMERIC_VALUE contains the average number of keys for each invert list
Min primary keys per list | NUMERIC_VALUE contains the minimum number of keys for each invert list
Max primary keys per list | NUMERIC_VALUE contains the maximum number of keys for each invert list
Values with selectivity <= 1% | NUMERIC_VALUE contains the number of invert lists with a selectivity <= 1%
Values with selectivity <= 5% | NUMERIC_VALUE contains the number of invert lists with a selectivity between 1% and 5%
Values with selectivity <= 10% | NUMERIC_VALUE contains the number of invert lists with a selectivity between 5% and 10%
Values with selectivity <= 25% | NUMERIC_VALUE contains the number of invert lists with a selectivity between 10% and 25%
Values with selectivity > 25% | NUMERIC_VALUE contains the number of invert lists with a selectivity > 25%


INSTANCE (SAP Library - SAP DB)

 Entering content frame

Object documentation INSTANCE

The system table INSTANCE describes some details about the database instance.

INSTANCE

NODE | CHAR(64) | Name with which the database instance can be addressed
LOCALNODE | CHAR(64) | Name with which the hot standby component can be addressed (if you have a hot standby configuration)
ADMINSTATEDATE | TIMESTAMP | Time at which the ADMIN operational state was reached
ONLINESTATEDATE | TIMESTAMP | Time at which the ONLINE operational state was reached


LOCKLISTSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation LOCKLISTSTATISTICS

The statistics system table LOCKLISTSTATISTICS contains information about the used space in the lock list.

LOCKLISTSTATISTICS

DESCRIPTION | CHAR(40) | Description (see table Column DESCRIPTION) of how to interpret the content of the VALUE column
VALUE | CHAR(12) | Value

Column DESCRIPTION

Value | Explanation
MAX LOCKS | VALUE contains the number of available locks in the lock list
TRANS LIST REGIONS | VALUE contains the number of semaphores for transactions
TABLE LIST REGIONS | VALUE contains the number of semaphores for tables
ROW LIST REGIONS | VALUE contains the number of semaphores for rows
ENTRIES | VALUE contains an internal database measure (entries) for the size of the lock list
USED ENTRIES | VALUE contains the number of currently used entries for set and requested locks
USED ENTRIES (%) | VALUE contains the number of currently used entries for set and requested locks (as a percentage)
AVG USED ENTRIES | VALUE contains the average number of entries for set and requested locks
AVG USED ENTRIES (%) | VALUE contains the average number of entries for set and requested locks (as a percentage)
MAX USED ENTRIES | VALUE contains the maximum number of entries for set and requested locks
MAX USED ENTRIES(%) | VALUE contains the maximum number of entries for set and requested locks (as a percentage)
LOCK ESCALATION VALUE | VALUE contains the number of table rows from which point row locks are converted into a table lock (lock escalation)
LOCK ESCALATIONS | VALUE contains the number of lock escalations
LOCK COLLISIONS | VALUE contains the number of lock requests that could not be granted (immediately)
DEADLOCKS | VALUE contains the number of situations where at least two transactions collided with each other due to held and requested locks in such a way that this collision can be resolved only by implicitly ending a transaction
SQL REQUEST TIMEOUTS | VALUE contains the number of lock requests that could not be set because they exceeded the maximum waiting time
TRANSACTIONS HOLDING LOCKS | VALUE contains the number of transactions that have locks assigned to them
TRANSACTIONS REQUESTING LOCKS | VALUE contains the number of transactions that request locks
CHECKPOINT WANTED | If the VALUE column contains the value TRUE, the lock list is closed. This means that a transaction that does not yet have an exclusive lock cannot be assigned an exclusive lock because a checkpoint has been requested.
SHUTDOWN WANTED | If the VALUE column contains the value TRUE, the lock list is closed because a shutdown has been requested.


LOCKS (SAP Library - SAP DB)

 Entering content frame

Object documentation LOCKS

The system table LOCKS describes the current lock entries and entries for lock requests.

LOCKS

SESSION | FIXED(10) | ID of the database session
TRANSCOUNT | CHAR(20) | ID of the transaction in the database session
PROCESS | FIXED(10) | ID of the process in the database instance
USERNAME | CHAR(32) | Name of user
DATE | DATE(10) | Creation date of the lock
TIME | TIME(8) | Creation time of the lock
TERMID | CHAR(18) | ID of the user terminal
LASTWRITE | CHAR(10) | Time that has elapsed since the last SQL statement for data manipulation
LOCKMODE | CHAR(14) | Type of lock
LOCKSTATE | CHAR(10) | Status of lock
APPLPROCESS | FIXED(10) | ID of the process on the client hardware
APPLNODE | CHAR(64) | ID of the client hardware
OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Name of the table
TABLEID | CHAR(8) BYTE | Table ID
ROWIDLENGTH | FIXED(4) | Length of the key of the locked row
ROWIDHEX | CHAR(64) BYTE | Start of the key of the locked row in hexadecimal format
ROWID | CHAR(128) | Start of the key of the locked row

See also:

Evaluating System Tables ® LOCKS


LOGVOLUMES (SAP Library - SAP DB)

 Entering content frame

Object documentation LOGVOLUMES

The system table LOGVOLUMES describes the volumes in which log entries are stored (see Log Volume).

LOGVOLUMES

ID | FIXED(5) | Number of the volume
PATH | CHAR(256) | Name of the volume
CONFIGUREDSIZE | FIXED(20) | Configured size of the volume (KB)


MAPCHARSETS (SAP Library - SAP DB)

 Entering content frame

Object documentation MAPCHARSETS

The system table MAPCHARSETS contains all the MapChar sets.

MAPCHARSETS

MAPCHARSETNAME | CHAR(32) | Name of the MapChar set
CODE | CHAR(8) | Code attribute for which the MapChar set was defined (ASCII | EBCDIC)
INTERN | CHAR(1) BYTE | Original form in hexadecimal format
MAP_CODE | CHAR(2) BYTE | Target form in hexadecimal format
MAP_CHARACTER | CHAR(2) | Target form in plain text format

See also:

Evaluating System Tables ® MAPCHARSETS


MEMORYALLOCATORSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation MEMORYALLOCATORSTATISTICS

The system table MEMORYALLOCATORSTATISTICS contains information on accesses to allocators since the last time the database instance was started.

MEMORYALLOCATORSTATISTICS

ALLOCATORNAME | CHAR(40) | Name of the allocator
USEDSIZE | FIXED(20) | Reserved area of the memory (bytes)
MAXUSEDSIZE | FIXED(20) | Maximum reserved area of the memory (bytes)
ALLOCATEDSIZE | FIXED(20) | Used area of the memory (bytes)
ALLOCATECOUNT | FIXED(20) | Number of memory allocations
DEALLOCATECOUNT | FIXED(20) | Number of memory deallocations
FAILEDALLOCATECOUNT | FIXED(20) | Number of memory requests not fulfilled
BASEALLOCATORNAME | CHAR(40) | Name of the allocator that provides this allocator with memory
BASEALLOCATECOUNT | FIXED(20) | Number of memory reservations for the allocator BASEALLOCATORNAME
BASEDEALLOCATECOUNT | FIXED(20) | Number of memory deallocations sent to the allocator BASEALLOCATORNAME


MONITOR (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR

The table MONITOR combines the following monitor system tables: MONITOR_CACHES MONITOR_LOAD MONITOR_LOCK MONITOR_LOG MONITOR_LONG MONITOR_PAGES MONITOR_ROW MONITOR_TRANS

MONITOR

TYPE | CHAR(8)
DESCRIPTION | CHAR(40)
VALUE | FIXED(20)


MONITOR_CACHES (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_CACHES

This monitor system table MONITOR_CACHES contains information about operations on the various caches.

Column DESCRIPTION

Value | Explanation
Data cache accesses | Number of accesses to pages in the data cache (number of accesses to data pages and pages with rollback information)
Data cache accesses successful | Number of successful accesses to pages in the data cache
Data cache accesses unsuccessful | Number of unsuccessful accesses to pages in the data cache
Data cache hit rate (%) | Percentage of successful accesses to pages in the data cache
Catalog cache accesses | Number of accesses to the session-specific catalog cache
Catalog cache accesses successful | Number of successful accesses to the session-specific catalog cache
Catalog cache accesses unsuccessful | Number of unsuccessful accesses to the session-specific catalog cache
Catalog cache hit rate (%) | Percentage of successful accesses to the session-specific catalog cache
Sequence cache accesses | Number of accesses to the sequence cache
Sequence cache accesses successful | Number of successful accesses to the sequence cache
Sequence cache accesses unsuccessful | Number of unsuccessful accesses to the sequence cache
Sequence cache hit rate (%) | Percentage of successful accesses to the sequence cache
Data cache sqlpage accesses | Number of accesses to data pages in the data cache
Data cache sqlpage accesses successful | Number of successful accesses to data pages in the data cache
Data cache sqlpage accesses unsuccessful | Number of unsuccessful accesses to data pages in the data cache
Data cache sqlpage hit rate(%) | Percentage of successful accesses to pages in the data cache
Data history/undo accesses | Number of accesses to pages with rollback information in the data cache
Data history/undo accesses successful | Number of successful accesses to pages with rollback information in the data cache
Data history/undo accesses unsuccessful | Number of unsuccessful accesses to pages with rollback information in the data cache
Data history/undo hit rate (%) | Percentage of successful accesses to pages with rollback information in the data cache

If you run the operating system Windows NT/2000 with the Intel memory extension PSE36, the table contains the following additional information:

Column DESCRIPTION

Value | Explanation
PSE36 data cache accesses | Number of accesses to the PSE36 data cache
PSE36 data cache accesses successful | Number of successful accesses to the PSE36 data cache
PSE36 data cache accesses unsuccessful | Number of unsuccessful accesses to the PSE36 data cache
PSE36 data cache hit rate (%) | Percentage of successful accesses to the PSE36 data cache


MONITOR_LOAD (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_LOAD

This monitor system table MONITOR_LOAD contains information about executed SQL statements and access methods.

Column DESCRIPTION

Value | Explanation
SQL commands | Number of executed SQL statements
PREPAREs | Number of parsed SQL statements
PREPAREs repeated | Number of SQL statements that were parsed again after metadata was changed
EXECUTEs | Number of executions of SQL statements that have already been parsed
COMMITs | Number of executed COMMIT statements
ROLLBACKs | Number of executed ROLLBACK statements
LOCKs and UNLOCKs | Number of executed LOCK statements and UNLOCK statements
SUBTRANS BEGINs | Number of SQL statements for opening a subtransaction
SUBTRANS ENDs | Number of SQL statements for closing a subtransaction
SUBTRANS ROLLBACKs | Number of SQL statements for resetting a subtransaction
CREATEs | Number of SQL statements for creating database objects
ALTERs | Number of executed SQL statements for changing database objects
DROPs | Number of executed SQL statements for deleting database objects
SELECTs and FETCHes | Number of executed SQL statements for accessing data
SELECTs and FETCHes, rows read | Number of rows that were read when accessing data
SELECTs and FETCHes, rows qual | Number of rows that were read when accessing data and that fulfilled the conditions
INSERTs | Number of executed SQL statements for inserting rows
INSERTs, rows inserted | Number of inserted rows
UPDATEs | Number of executed SQL statements for changing rows
UPDATEs, rows read | Number of rows that were read when changing data
UPDATEs, rows updated | Number of changed rows
DELETEs | Number of executed SQL statements for deleting rows
DELETEs, rows read | Number of rows that were read when deleting data
DELETEs, rows deleted | Number of deleted rows
Internal DBPROC calls | Number of executions of database procedures
Internal trigger calls | Number of trigger executions
Primary key accesses | Number of searches with direct access by the key
Primary key accesses, rows read | Number of rows that were read by the direct key access
Primary key accesses, rows qual | Number of rows that were read by the direct key access and that fulfilled the conditions
Primary key range accesses | Number of searches with accesses within a key range
Primary key range accesses, rows read | Number of rows read within a key range
Primary key range accesses, rows qual | Number of rows read within a key range that fulfilled the condition
Index accesses | Number of searches with accesses to an index
Index accesses, rows read | Number of rows that were accessed indirectly by an index
Index accesses, rows qual | Number of rows that were accessed indirectly by an index and that fulfilled the condition
Index range accesses | Number of searches using an index range
Index range accesses, rows read | Number of rows that were accessed indirectly by an index using an index range
Index range accesses, rows qual | Number of rows that were accessed indirectly by an index using an index range and that fulfilled the condition
Isolated index accesses | Number of searches that could be successfully performed by an index either partly or completely and without accessing the rows of the base table
Isolated index accesses, rows read | Number of keys that were accessed in the searches described in ISOLATED INDEX ACCESSES
Isolated index accesses, rows qual | Number of keys that were accessed in the searches described in ISOLATED INDEX ACCESSES, and that fulfilled the condition
Isolated index range accesses | Number of searches in which a part of an index was used with values within a range without accessing the rows of the base table
Isolated index range accesses, rows read | Number of primary/secondary keys that were accessed in the searches described in ISOLATED INDEX RANGE ACCESSES
Isolated index range accesses, rows qual | Number of primary/secondary keys that were accessed in the searches described in ISOLATED INDEX RANGE ACCESSES, and that fulfilled the condition
Table scans | Number of searches in the whole base table
Table scans, rows read | Number of rows that were accessed in searches in the whole base table
Table scans, rows qual | Number of rows that were accessed in searches in the whole base table, and that fulfilled the condition
Isolated index scans | Number of searches in which a complete index was accessed without accessing rows in the base table
Isolated index scans, rows read | Number of index rows that were accessed in the searches described in ISOLATED INDEX SCANS
Isolated index scans, rows qual | Number of index rows that were accessed in the searches described in ISOLATED INDEX SCANS, and that fulfilled the condition
Memory sorts / sort&merge | Number of sort transactions in the main memory for creating temporary inversions
Memory sorts / sort&merge, rows read | Number of rows read for creating temporary inversions
Sorts by insertion | Number of sort transactions by inserting
Sorts by insertion, rows inserted | Number of rows that were inserted during the sort transaction


MONITOR_LOCK (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_LOCK

The monitor system table MONITOR_LOCK contains information about operations performed by the lock management functions of the database system.

Column DESCRIPTION

Value | Explanation
Lock list avg used entries | Average number of entries in the lock list
Lock list max used entries | Maximum number of entries in the lock list
Lock list collisions | Number of lock collisions
Lock list escalations | Number of lock escalations
Lock list inserted row entries | Number of inserted row locks
Lock list inserted table entries | Number of inserted table locks
Detected deadlocks | Number of situations where at least two transactions collided with each other due to held and requested locks in such a way that this collision can be resolved only by implicitly ending a transaction
Request timeouts | Number of lock requests that could not be set because they exceeded the maximum waiting time


MONITOR_LOG (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_LOG

The monitor system table MONITOR_LOG contains information about operations by the logging function (redo log management) of the database system.

Column DESCRIPTION

Value | Explanation
Log page physical reads | Number of physically read log pages
Log page physical writes | Number of physically read log pages
Log queue pages | Size of the log queue in pages
Log queue max used pages | Maximum number of pages used by log queue
Log queue inserts | Number of insert operations in the log queue
Log queue overflows | Number of overflows in the log queue
Log queue group commits | Number of group COMMITs
Log queue waits for log page write | Number of wait statuses for write operations to the log
Log queue max waits per log page | Maximum number of wait statuses for each log page
Log queue avg waits per log page | Average number of wait statuses for each log page


MONITOR_LONG (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_LONG

The monitor system table MONITOR_LONG contains information about read and write transactions for LONG columns.

Column DESCRIPTION

Value | Explanation
BD read long | Number of read transactions for LONG columns
BD write long | Number of write transactions for LONG columns


MONITOR_PAGES (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_PAGES

The monitor system table MONITOR_PAGES contains information about accesses to the pages.

Column DESCRIPTION

Value | Explanation
Virtual reads | Number of virtual read operations
Virtual writes | Number of virtual write operations
Physical reads | Number of physical read operations
Physical writes | Number of physical write operations
Catalog virtual read | Number of virtual catalog read operations
Catalog virtual writes | Number of virtual catalog write operations
Catalog physical reads | Number of physical catalog read operations
Catalog physical writes | Number of physical catalog write operations
Converter page physical reads | Number of physically read converter pages
Converter page physical writes | Number of physically written converter pages
Perm page virtual reads | Number of virtually read permanent pages
Perm page virtual writes | Number of virtually written permanent pages
Perm page physical reads | Number of physically read permanent pages
Perm page physical writes | Number of physically written permanent pages
Temp page virtual reads | Number of virtually read temporary pages
Temp page virtual writes | Number of virtually written temporary pages
Temp page physical reads | Number of physically read temporary pages
Temp page physical writes | Number of physically written temporary pages
LONG page virtual reads | Number of virtually read pages for LONG columns
LONG page virtual writes | Number of virtually written pages for LONG columns
LONG page physical reads | Number of physically read pages for LONG columns
LONG page physical writes | Number of physically written pages for LONG columns
Leaf page virtual reads | Number of virtually read leaf pages
Leaf page virtual writes | Number of virtually written leaf pages
Leaf page physical reads | Number of physically read leaf pages
Leaf page physical writes | Number of physically written leaf pages
Level1 page virtual reads | Number of virtually read index pages at level 1
Level1 page virtual writes | Number of virtually written index pages at level 1
Level1 page physical reads | Number of physically read index pages at level 1
Level1 page physical writes | Number of physically written index pages at level 1
Level2 page virtual reads | Number of virtually read index pages at level 2
Level2 page virtual writes | Number of virtually written index pages at level 2
Level2 page physical reads | Number of physically read index pages at level 2
Level2 page physical writes | Number of physically written index pages at level 2
Level3 page virtual reads | Number of virtually read index pages at level 3
Level3 page virtual writes | Number of virtually written index pages at level 3
Level3 page physical reads | Number of physically read index pages at level 3
Level3 page physical writes | Number of physically written index pages at level 3
Level4 page virtual reads | Number of virtually read index pages at level 4
Level4 page virtual writes | Number of virtually written index pages at level 4
Level4 page physical reads | Number of physically read index pages at level 4
Level4 page physical writes | Number of physically written index pages at level 4
Level5 page virtual reads | Number of virtually read index pages at level 5
Level5 page virtual writes | Number of virtually written index pages at level 5
Level5 page physical reads | Number of physically read index pages at level 5
Level5 page physical writes | Number of physically written index pages at level 5
Converter page virtual reads | Number of virtually read converter pages
Converter page virtual writes | Number of virtually written converter pages
Converter page physical reads | Number of physically read converter pages
Converter page physical writes | Number of physically written converter pages


MONITOR_ROW (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_ROW

The monitor system table MONITOR_ROW contains information about operations at row level.

Column DESCRIPTION

Value | Explanation
BD add record perm | Number of inserted rows in permanent tables
BD add record temp | Number of inserted rows in temporary tables
BD repl record perm | Number of changed rows in permanent tables
BD repl record temp | Number of changed rows in temporary tables
BD del record perm | Number of deleted rows in permanent tables
BD del record temp | Number of deleted rows in temporary tables
BD get record perm | Number of rows read in permanent tables by using a key
BD get record temp | Number of rows read in temporary tables by using a key
BD next record perm | Number of rows read in permanent tables by using the predecessor key
BD next record temp | Number of rows read in temporary tables by using the predecessor key
BD prev record perm | Number of rows read in permanent tables by using the successor key
BD prev record temp | Number of rows read in temporary tables by using the successor key
BD select direct record | Number of selected rows with key
BD select next record | Number of selected rows with predecessor key
BD select prev record | Number of selected rows with successor key
BD add to index list perm | Number of insert operations in permanent indexes
BD add to index list temp | Number of insert operations in temporary indexes
BD del from index list perm | Number of delete operations in permanent indexes
BD del from index list temp | Number of delete operations in temporary indexes
BD get index list perm | Number of accesses to permanent indexes
BD get index list temp | Number of accesses to temporary indexes


MONITOR_TRANS (SAP Library - SAP DB)

 Entering content frame

Object documentation MONITOR_TRANS

The monitor system table MONITOR_TRANS contains information about transactions.

Column DESCRIPTION

Value | Explanation
SQL commands | Number of SQL statements
Write transactions | Number of transactions with change operations
KB calls | Number of calls using the internal communication base interface


OPTIMIZERINFORMATION (SAP Library - SAP DB)

 Entering content frame

Object documentation OPTIMIZERINFORMATION

The system table OPTIMIZERINFORMATION contains the information about value distributions that is determined by the UPDATE STATISTICS statement, and used by the optimizer.

OPTIMIZERINFORMATION

OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Name of the table
COLUMNNAME | CHAR(32) | Name of a single non-inverted column
INDEXNAME | CHAR(32) | Name of the index
DISTINCTVALUECOUNT | FIXED(10) | Number of distinct values in the column, index, or primary key
CALCULATEDSIZE | FIXED(10) | Memory requirements of the (primary key) index calculated by the last UPDATE STATISTICS (KB)


OPTIMIZERSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation OPTIMIZERSTATISTICS

You can select the system table OPTIMIZERSTATISTICS to query those statistical values stored in the database catalog that were generated by an UPDATE STATISTICS statement. Each row in the table describes statistics about indexes, columns, or the size of a table.

OPTIMIZERSTATISTICS

OWNER

CHAR(32)

Owner of a table for which statistics exist

TABLENAME

CHAR(32)

Table name of a table for which statistics exist

INDEXNAME

CHAR(32)

Index name of an index for which statistics exist

COLUMNNAME

CHAR(32)

Name of a column for which statistics exist

DISTINCTVALUES

FIXED(10)

Number of different values if the current row describes a column or an index with one column;
otherwise the number of rows in a table

PAGECOUNT

FIXED(10)

Number of pages used by an index if the current row describes an index;
number of pages of a base table if the current row describes a table;
otherwise NULL


PACKAGES (SAP Library - SAP DB)

 Entering content frame

Object documentation PACKAGES

The system table PACKAGES describes all the packages for which the current user has privileges.

PACKAGES

OWNER | CHAR(32) | Name of package owner
PACKAGE | CHAR(32) | Name of package
CREATEDATE | DATE | Creation date of package
CREATETIME | TIME | Creation time of package
EXCECUTION_KIND | CHAR(6) | Execution location of database procedure (INPROC | LOCAL | REMOTE)
SQL_SUPPORT | CHAR(3) | Database procedure may contain SQL statements (YES | NO)
REMOTE_LOCATION | CHAR(132) | Execution location
COMMENT | LONG | Comment about package


ROLEPRIVILEGES (SAP Library - SAP DB)

 Entering content frame

Object documentation ROLEPRIVILEGES

The system table ROLEPRIVILEGES describes the privileges and roles that are granted to roles for which the current user has privileges.

ROLEPRIVILEGES

OWNER | CHAR(32) | Name of the owner of the object that was granted for the role
TABLENAME | CHAR(32) | Name of the table for which privileges were granted for the role
ROLE | CHAR(32) | Name of the role that was granted
GRANTEE | CHAR(32) | Name of the role to which has been granted
PRIVILEGES | CHAR(30) | Privileges that were granted
GRANTOR | CHAR(32) | Name of the user who granted the privileges or the role
CREATEDATE | DATE(10) | Date when the privileges were granted
CREATETIME | TIME(8) | Time when the privileges were granted

See also:

Evaluating System Tables ® ROLEPRIVILEGES


ROLES (SAP Library - SAP DB)

 Entering content frame

Object documentation ROLES

The system table ROLES describes the roles for which the current user has privileges.

ROLES

OWNER | CHAR(32) | Name of role owner
ROLE | CHAR(32) | Name of role
PASSWORD_REQUIRED | CHAR(3) | Password required for activating the role (YES | NO)
GRANTED | CHAR(3) | Role was granted for the current user (YES | NO)
DEFAULTROLE | CHAR(3) | Role is the default role for the current user (YES | NO)
CREATEDATE | DATE(10) | Creation date of the role
CREATETIME | TIME(8) | Creation time of the role

See also:

Evaluating System Tables ® ROLES


SEQUENCES (SAP Library - SAP DB)

 Entering content frame

Object documentation SEQUENCES

The system table SEQUENCES contains all sequences for which the current user has privileges.

SEQUENCES

OWNER | CHAR(32) | Name of sequence owner
SEQUENCE_NAME | CHAR(32) | Name of the sequence
MIN_VALUE | FIXED(38) | Minimum value of the sequence
MAX_VALUE | FIXED(38) | Maximum value of the sequence
INCREMENT_BY | FIXED(38) | Value by which the sequence is increased
CYCLE_FLAG | CHAR(1) | Does the sequence begin again with the minimum value once the maximum value has been reached?
ORDER_FLAG | CHAR(1) | Are the sequence values granted in the order of the request?
CACHE_SIZE | FIXED(38) | Number of sequence values that are loaded into the cache simultaneously
LAST_NUMBER | FIXED(38) | Last sequence value that was saved
CREATEDATE | DATE(10) | Creation date of the sequence
CREATETIME | TIME(8) | Creation time of the sequence
COMMENT | LONG | Comment about the sequence

See also:

Evaluating System Tables ® SEQUENCES


SERVERDBSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation SERVERDBSTATISTICS

The statistics system table SERVERDBSTATISTICS contains information about the used space in the database instance.

SERVERDBSTATISTICS

SERVERDBSIZE | FIXED(10) | Size of the database instance in pages
MAXDATAPAGENO | FIXED(10) | Highest page number of the database instance
MAXPERM | FIXED(10) | Number of pages of the database instance that can be used for non-temporary objects
MAXUSEDPAGES | FIXED(10) | Maximum number of used pages for a synchronization point (restart or savepoint)
USEDPERM | FIXED(10) | Number of pages of the database instance that are used for non-temporary objects
PCTUSEDPERM | FIXED(10) | Percentage of pages for non-temporary objects
USEDTMP | FIXED(10) | Number of pages of the database instance that are used for temporary objects
PCTUSEDTMP | FIXED(10) | Percentage of pages for temporary objects
UNUSED | FIXED(10) | Number of unused pages
PCTUNUSED | FIXED(10) | Percentage of unused pages
UPDATEDPERM | FIXED(10) | Number of changed pages for permanent objects
SERVERDBFULL | CHAR(3) | YES: maximum fill level of the database instance has been reached NO: maximum fill level of the database instance has not been reached
USEDBLOCKS | FIXED(10) | Number of blocks on data volumes that are used by pages
LOGSIZE | FIXED(10) | Size of the log area in pages
USEDLOG | FIXED(10) | Number of used log pages
PCTUSEDLOG | FIXED(10) | Percentage of used log pages
LOGNOTSAVED | FIXED(10) | Number of unsaved log pages
PCTLOGNOTSAVED | FIXED(10) | Percentage of unsaved log pages
LOGSINCEBACKUP | FIXED(10) | Number of written log pages since the last complete or incremental data backup
LOGSEGMENTSIZE | FIXED(10) | Size of a log segment in pages
SAVEPOINTS | FIXED(10) | Number of executed savepoints


SESSION_ROLES (SAP Library - SAP DB)

 Entering content frame

Object documentation SESSION_ROLES

The system table SESSION_ROLES contains the roles that are active in the current database session.

SESSION_ROLES

ROLE

CHAR(32)

Name of role

See also:

Evaluating System Tables ® SESSION_ROLES


SYNONYMS (SAP Library - SAP DB)

 Entering content frame

Object documentation SYNONYMS

The system table SYNONYMS contains all synonyms for which the current user has privileges.

SYNONYMS

OWNER | CHAR(32) | Name of synonym owner
SYNONYMNAME | CHAR(32) | Name of synonym
PUBLIC | CHAR(3) | Synonym is PUBLIC (YES | NO)
TABLEOWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table
CREATEDATE | DATE(10) | Creation date of the synonym
CREATETIME | TIME(8) | Creation time of the synonym
COMMENT | LONG | Comment about synonym

See also:

Evaluating System Tables ® SYNONYMS


TABLEPRIVILEGES (SAP Library - SAP DB)

 Entering content frame

Object documentation TABLEPRIVILEGES

The system table TABLEPRIVILEGES describes the privileges that the current user has for tables.

TABLEPRIVILEGES

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table
GRANTOR | CHAR(32) | Name of the user who granted the privileges
GRANTEE | CHAR(32) | Name of the user or the role that was granted the privilege
PRIVILEGES | CHAR(30) | Privileges that were granted
IS_GRANTABLE | CHAR(3) | Privilege to grant the received privilege to another user/role (YES | NO)

See also:

Evaluating System Tables ® TABLEPRIVILEGES


TABLES (SAP Library - SAP DB)

 Entering content frame

Object documentation TABLES

The system table TABLES contains all the tables (base tables, view tables, synonyms, and event tables) for which the current user has privileges.

TABLES

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table
PRIVILEGES | CHAR(30) | Privileges of current user for the table
TYPE | CHAR(8) | Type of table (SYSTEMS | TABLES)
TABLETYPE | CHAR(8) | Table type (TABLE | VIEW | SYNONYM | RESULT)
CREATEDATE | DATE(10) | Creation date of the table
CREATETIME | TIME(8) | Creation time of the table
UPDSTATDATE | DATE(10) | Date of the last UPDATE STATISTICS statement for the table
UPDSTATTIME | TIME(8) | Time of the last UPDATE STATISTICS statement for the table
ALTERDATE | DATE(10) | Change date of the table
ALTERTIME | TIME(8) | Change time of the table
UNLOADED | CHAR(3) | Table is unloaded (YES | NO)
SAMPLE_PERCENT | FIXED(3) | Percentage of the table that is updated when updating statistics
SAMPLE_ROWS | FIXED(10) | Number of rows in the table that are updated when updating statistics
COMMENT | LONG | Comment about the table
TABLEID | CHAR(8) BYTE | Table ID in hexadecimal format

See also:

Evaluating System Tables ® TABLES


TABLESTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation TABLESTATISTICS

The statistics system table TABLESTATISTICS contains information about the structure and sizes of base tables.

TABLESTATISTICS

OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Table name
DESCRIPTION | CHAR(40) | Description (see table Column DESCRIPTION) of how to interpret following columns
CHAR_VALUE | CHAR(12) | Alphanumeric value
NUMERIC_VALUE | FIXED(10) | Numeric value

Column DESCRIPTION

Value | Explanation
Root pno | NUMERIC_VALUE contains the page number of the root of the B* tree
Filetype | CHAR_VALUE contains the type of the B* tree
Used pages | NUMERIC_VALUE indicates how many pages are used by the table
Index pages | NUMERIC_VALUE indicates how many pages are used by the table in the B* tree index
Leaf pages | NUMERIC_VALUE indicates how many leaf pages are used by the table
Index levels | NUMERIC_VALUE contains the number of index levels of the B* tree
Space used in all pages(%) | NUMERIC_VALUE contains the used space of all pages in the B* tree (as a percentage)
Space used in root page(%) | NUMERIC_VALUE contains the used space of the root page in the B* tree (as a percentage)
Space used in index pages(%) | NUMERIC_VALUE contains the used space of the index pages in the B* tree (as a percentage)
Space used in index pages(%) min | NUMERIC_VALUE contains the minimum used space of the index pages in the B* tree (as a percentage)
Space used in index pages(%) max | NUMERIC_VALUE contains the maximum used space of the index pages in the B* tree (as a percentage)
Space used in leaf pages(%) | NUMERIC_VALUE contains the used space of the leaf pages in the B* tree (as a percentage)
Space used in leaf pages(%) min | NUMERIC_VALUE contains the minimum used space of the leaf pages in the B* tree (as a percentage)
Space used in leaf pages(%) max | NUMERIC_VALUE contains the maximum used space of the leaf pages in the B* tree (as a percentage)
Rows | NUMERIC_VALUE contains the number of rows in the table
Avg rows per page | NUMERIC_VALUE contains the average number of rows for each page
Min rows per page | NUMERIC_VALUE contains the minimum number of rows for each page
Max rows per page | NUMERIC_VALUE contains the maximum number of rows for each page
Avg row length | NUMERIC_VALUE contains the average length of a row
Min row length | NUMERIC_VALUE contains the minimum length of a row
Max row length | NUMERIC_VALUE contains the maximum length of a row
Avg key length | NUMERIC_VALUE contains the average length of a key
Min key length | NUMERIC_VALUE contains the minimum length of a key
Max key length | NUMERIC_VALUE contains the maximum length of a key
Avg separator length | NUMERIC_VALUE contains the average length of a separator
Min separator length | NUMERIC_VALUE contains the minimum length of a separator
Max separator length | NUMERIC_VALUE contains the maximum length of a separator
Defined LONG columns | NUMERIC_VALUE contains the number of defined LONG columns
Avg LONG column length | NUMERIC_VALUE contains the average length of a LONG column
Min LONG column length | NUMERIC_VALUE contains the minimum length of a LONG column
Max LONG column length | NUMERIC_VALUE contains the maximum length of a LONG column
LONG column pages | NUMERIC_VALUE contains the number of pages of all the LONG columns in the table
Avg pages per LONG column | NUMERIC_VALUE contains the average number of pages in the table for each LONG column
Min pages per LONG column | NUMERIC_VALUE contains the smallest LONG column in the table (in pages)
Max pages per LONG column | NUMERIC_VALUE contains the largest LONG column in the table (in pages)


TRANSACTIONS (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSACTIONS

The statistics system table TRANSACTIONS contains information about active transactions of a database instance.

TRANSACTIONS

SESSION | FIXED(10) | ID of the database session
TRANSCOUNT | CHAR(20) | ID of the transaction
SUB_TRANS | FIXED(10) | Number of the current subtransaction
WRITE_TRANS | CHAR(6) BYTE | ID of the current write transaction if the transaction has made changes
PROCESS | FIXED(10) | ID of the user process
USERNAME | CHAR(32) | User name
CONNECTDATE | DATE | Date when the session started
CONNECTTIME | TIME | Time when the session started
TERMID | CHAR(18) | Terminal ID
REQTIMEOUT | CHAR(10) | Time remaining until REQUEST_TIMEOUT in seconds
LASTWRITE | CHAR(10) | Time elapsed since the last write request in timeout intervals
LOCKMODE | CHAR(14) | Type of lock
LOCKSTATE | CHAR(10) | Status of lock
REQMODE | CHAR(14) | Type of lock request
REQSTATE | CHAR(10) | Status of the lock request
CONSISTENTVIEW | CHAR(6) | For future use
APPLPROCESS | FIXED(10) | ID of the application process
APPLNODEID | CHAR(64) | ID of the client host of the application process


TRIGGERS (SAP Library - SAP DB)

 Entering content frame

Object documentation TRIGGERS

The system table TRIGGERS contains all triggers for which the current user has privileges.

TRIGGERS

OWNER | CHAR(32) | Name of table owner
TABLENAME | CHAR(32) | Name of the table for which the trigger was defined
TRIGGERNAME | CHAR(32) | Name of the trigger
INSERT | CHAR(3) | Type of trigger
UPDATE | CHAR(3) | Type of trigger
DELETE | CHAR(3) | Type of trigger
CREATEDATE | DATE(10) | Creation date of the trigger
CREATETIME | TIME(8) | Creation time of the trigger
DEFINITION | LONG | Text of the trigger definition
COMMENT | LONG | Comment about the trigger

See also:

Evaluating System Tables ® TRIGGERS


USERS (SAP Library - SAP DB)

 Entering content frame

Object documentation USERS

The system table USERS contains all users.

USERS

OWNER | CHAR(32) | Name of user owner
GROUPNAME | CHAR(32) | Name of the group
USERNAME | CHAR(32) | Name of user
USERMODE | CHAR(8) | Class of the user (SYSDBA | DBA | RESOURCE | STANDARD)
CONNECTMODE | CHAR(8) | Type of connection (MULTIPLE | SINGLE)
MAXTIMEOUT | FIXED(10) | Value of the TIMEOUT
COSTWARNING | FIXED(10) | Value of the COSTWARNING
COSTLIMIT | FIXED(10) | Value of the COSTLIMIT
DEFAULTCODE | CHAR(8) | Default value for code attribute
CREATEDATE | DATE(10) | Creation date of user
CREATETIME | TIME(8) | Creation time of user
ALTERDATE | DATE(10) | Change date of user
ALTERTIME | TIME(8) | Change time of user
PWCREADATE | DATE(10) | Creation date of password
PWCREATIME | TIME(8) | Creation time of password
SERVERDB | CHAR(18) | Name of the database instance
SERVERNODE | CHAR(64) | Host node name of database instance
USER_ID | FIXED(10) | ID of the user
COMMENT | LONG | Comment about user

See also:

Evaluating System Tables ® USERS


USERSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation USERSTATISTICS

The statistics system table USERSTATISTICS contains information about the resource consumption of users.

USERSTATISTICS

USERNAME | CHAR(32) | User name
USERMODE | CHAR(8) | User class
PERMCOUNT | FIXED(10) | Pages currently used for permanent objects
TEMPCOUNT | FIXED(10) | Pages currently used for temporary objects


VERSION (SAP Library - SAP DB)

 Entering content frame

Object documentation VERSION

The system table VERSION describes the version of the SAP DB database software (kernel and runtime environment).

VERSIONS

OPERATINGSYSTEM | CHAR(64) | Name of the operating system
PROCESSORTYPE | CHAR(64) | Name of the processor vendor
ADDRESSINGMODE | FIXED(2) | Specifies whether a 32 bit or 64 bit platform is being used
ID | CHAR(40) | Current version, including build level
MAJORVERSION | FIXED(2) | Number of the major version
MINORVERSION | FIXED(2) | Number of the minor version
CORRECTIONLEVEL | FIXED(2) | Number of the correction level
BUILD | FIXED(2) | Build level
KERNELVARIANT | CHAR(8) | Variant of the kernel (SLOW | QUICK | FAST)


VERSIONS (SAP Library - SAP DB)

 Entering content frame

Object documentation VERSIONS

The system table VERSIONS describes the versions of the SAP DB database software.

VERSIONS

KERNEL | CHAR(40) | Version of the SAP DB database software
RUNTIMEENVIRONMENT | CHAR(40) | Version of the runtime environment

See also:

Evaluating System Tables ® VERSIONS


VIEWCOLUMNS (SAP Library - SAP DB)

 Entering content frame

Object documentation VIEWCOLUMNS

The system table VIEWCOLUMNS contains all the columns of the view tables for which the current user has privileges.

VIEWCOLUMNS

OWNER | CHAR(32) | Name of the owner of the view table
VIEWNAME | CHAR(32) | Name of the view table
VIEWCOLUMNNAME | CHAR(32) | Name of the column in the view table
TABLEOWNER | CHAR(32) | Name of the owner of the table that the used column belongs to
TABLENAME | CHAR(32) | Name of the table that the used column belongs to
COLUMNNAME | CHAR(32) | Original name of the column in the table
CREATEDATE | DATE(10) | Creation date of the view table
CREATETIME | TIME(8) | Creation time of the view table

See also:

Evaluating System Tables ® VIEWCOLUMNS


VIEWDEFS (SAP Library - SAP DB)

 Entering content frame

Object documentation VIEWDEFS

The system table VIEWDEFS contains the definitions of the view tables for which the current user has privileges.

VIEWDEFS

OWNER | CHAR(32) | Name of the owner of the view table
VIEWNAME | CHAR(32) | Name of the view table
LEN | FIXED(5) | Length of the definition of the view table
DEFINITION | LONG | Text of the definition of the view table

See also:

Evaluating System Tables ® VIEWDEFS


VIEWS (SAP Library - SAP DB)

 Entering content frame

Object documentation VIEWS

The system table VIEWS contains all view tables for which the current user has privileges.

VIEWS

OWNER | CHAR(32) | Name of the owner of the view table
VIEWNAME | CHAR(32) | Name of the view table
PRIVILEGES | CHAR(30) | Privileges of the user for the view table
TYPE | CHAR(8) | Table type
CREATEDATE | DATE(10) | Creation date of the view table
CREATETIME | TIME(8) | Creation time of the view table
UPDSTATDATE | DATE(10) | Date of the last UPDATE STATISTICS statement for the view table
UPDSTATTIME | TIME(8) | Date of the last UPDATE STATISTICS statement for the view table
ALTERDATE | DATE(10) | Change date of the view table
ALTERTIME | TIME(8) | Change time of the view table
UNLOADED | CHAR(3) | View table is unloaded (YES | NO)
COMMENT | LONG | Comment about the view table

See also:

Evaluating System Tables ® VIEWS


Optimizer (SAP Library - SAP DB)

 Entering content frame

Component documentation Optimizer

This documentation describes how the SAP DB Optimizer processes SQL statements. It provides information about the meaning and possibilities of creating optimal SQL statements for your application.

For general information about the SAP DB database system, see the documentation The SAP DB Database System at the following Internet address: www.sapdb.org ® Documentation.

For information about the syntax of the SQL statements that can be entered in SAP DB, see the Reference Manual: SAP DB 7.4.

Optimizing SQL Statements

Determining the optimal SQL statements for a SAP DB application is an important task. Optimal SQL statements significantly influence the performance of the entire SAP DB application. An SQL statement is optimal if it is written in such a way that it can be processed in as short a time as possible with a minimal storage area requirement.

To process SQL statements optimally, the factors that influence the processing of an SQL statement must be considered. In particular, you should consider the influence of the search conditions on the processing of an SQL statement. There are a series of additional possibilities for runtime improvement for SQL applications.

The SQL statements should be written in such a way that search strategies can be used. The following goals should be achieved in doing so:

· Search only those lines that it is necessary to search

· Restrict results tables and temporary results tables to the smallest possible size

· Postponement of the Search to the FETCH Time

If a large number of changes has been made in a table, you should run the UPDATE STATISTICS statement. This statement updates the details about the tables that are necessary for the work of the Optimizer (such as value distribution, size of tables, and inversions).

If you consider all of these hints, you can write optimal SQL statements.

Checking SQL Statements

...

Check your SQL statements for correctness, for example, with the help of the SAP DB tool SQL Studio.

Analyze your SQL statements with regard to the performance that can be achieved through them. To do this, use the appropriate EXPLAIN statements.

Only after you have completed these checks of your SQL statements should you insert them into your application program.


Factors that Influence the Processing of an SQL Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation Factors that Influence the Processing of an SQL Statement

The following factors play a role during the processing of an SQL statement:

  • Type of physical storage of a table
  • Size of the tables (Number of lines and B* tree pages)
  • Definition of the table (especially the key columns)
  • Definition of indexes
  • Type of SQL statement (SELECT, INSERT, UPDATE, DELETE)
  • Elements of a SELECT statement ( ORDER clause , UPDATE clause , DISTINCT specification , and specification of FOR REUSE)
  • Changes that are specified in the UPDATE statement
  • Search conditions

These factors especially influence the processing of an SQL statement if the SQL statement triggers a search of a large quantity of data. This generally happens with the following SQL statements:

SELECT ...
INSERT ... SELECT ...
UPDATE ... WHERE <search_condition>
DELETE ... WHERE <search_condition>


Runtime Improvement for SQL Applications (SAP Library - SAP DB)

 Entering content frame

Background documentation Runtime Improvement for SQL Applications

The following are general hints that can contribute to an improved runtime for SQL applications.

  • When you are building a database, you should derive the definition of the tables from a previously performed examination of the structures. When defining the key columns, you should ensure that the columns that are especially selective, and for which search conditions are specified especially often, are placed at the beginning of the key. This creates the possibility of only having to consider a very small part of the table when processing a SELECT statement.
  • Only columns with as high a selectivity as possible should be inverted . Do not choose columns such as gender or marital status as index keys, due to their low number of different values. These columns can only be used very rarely for a non-sequential search, as these would usually be more costly than a sequential search .
  • In the case of relatively static datasets, a large number of columns can be inverted. In doing so, you must ensure, as with the definition of the key columns, that you specify columns that are as selective as possible, and that are often used in equality conditions at the beginning of the index.
  • You should never invert all of the columns that are used in search conditions. The space for the indexes and the cost for their maintenance is considerable.
  • If a large number of changes has been made in a table, you should run the UPDATE STATISTICS statement .
  • You should only formulate search conditions that cannot be fulfilled by all lines. Applications are often written so that the user determines the values of a search condition. If the user does not enter any values, standard values are inserted into the search condition, so that it always returns "true". The database system must now evaluate this ineffective search condition for every line that is to be searched. It is better to execute different SELECT statements depending on a user entry.
  • You should place the most selective search conditions at the beginning of the condition, as it may be possible to terminate the check earlier.
  • The specification
    columnx IN (1,13,24,...)
    is better than
    columnx=1 OR columnx=13 OR columnx=24 OR ...


Search Condition (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Condition

Search conditions (< search_condition >) are often specified in SQL statements. However, not all of the search conditions that can be entered are used by the Optimizer to determine an optimal search strategy , but rather only a few of these possible search conditions. To be able to write optimal SQL statements, you should have a detailed knowledge of the search conditions that can be evaluated by the Optimizer.

The search conditions that the Optimizer can use to determine the optimal search strategy are the following:

  • Equality Condition
  • Area Condition
  • IN Condition
  • LIKE Condition

If the search conditions in an SQL statement cannot be converted into one of the forms listed above, they cannot be used when selecting a search strategy.

The order of search conditions that are linked by equal Boolean operators has no influence on the selection of a search strategy.

If you use UPDATE statements, you can only use the search conditions with restrictions ( Search Conditions for UPDATE Statements ).


Equality Condition (SAP Library - SAP DB)

 Entering content frame

Background documentation Equality Condition

Equality conditions are search conditions with a comparison predicate , to which the following rules apply:

  • The only operator is the relational operator =.
  • Equality conditions have one of the following forms:
    < column_spec > = < extended_value_spec >
    <column_spec> = <     subquery >

Only equality conditions that satisfy these prerequisites can use the Optimizer to determine an optimal search strategy .

Conditions in the format ...NOT (<column_spec> <> <extended_value_spec>) or ...NOT (<column_spec> <> <subquery>) are, where possible, converted into an expression without NOT, with a correspondingly negated operator =. The system then continues processing the condition in this converted format.


Area Condition (SAP Library - SAP DB)

 Entering content frame

Background documentation Area Condition

Area conditions are search conditions with a comparison predicate or a BETWEEN predicate , to which the following prerequisites apply:

  • The only valid operators are the relational operators < | <= | => | > and the operator BETWEEN.
  • Area conditions have one of the following formats:
    < column_spec > < < | <= | => | > > < extended_value_spec >
    <column_spec> BETWEEN <extended_value_spec> AND <extended_value_spec>

Only area conditions that satisfy these prerequisites can use the Optimizer to determine an optimal search strategy .

Whether the area is defined using a BETWEEN operator or using a combination of the relational operators <= and => is irrelevant to the search strategy.

Conditions in the format ...NOT (<column_spec> < < | <= | => | > > <extended_value_spec>) or. ...NOT (<column_spec> NOT BETWEEN <extended_value_spec> AND <extended_value_spec>)are, where possible, converted to an expression without NOT, with a correspondingly negated operator. The system then continues processing the condition in this converted format.


IN Condition (SAP Library - SAP DB)

 Entering content frame

Background documentation IN Condition

IN conditions are search conditions with an IN predicate , to which the following rules apply:

  • The operator is the operator IN.
  • IN conditions have one of the following formats:
    < column_spec > IN (< extended_value_spec >,...)
    <column_spec> IN <     subquery >

Only IN conditions that satisfy these prerequisites can use the Optimizer to determine an optimal search strategy .

Conditions in the format ...NOT (<column_spec> NOT IN (<extended_value_spec>,...)) or. ...NOT (<column_spec> NOT IN <subquery>) are, where possible, converted to an expression without NOT, and with a correspondingly negated operator. The system then continues processing the condition in this converted format.


LIKE Condition (SAP Library - SAP DB)

 Entering content frame

Background documentation LIKE Condition

LIKE conditions are search conditions with a LIKE predicate , to which the following rules apply:

  • The operator is the operator LIKE.
  • LIKE conditions have the following format:
    < column_spec > LIKE < extended_value_spec >
  • The value specification used (extended_value_spec) may not begin with the SQL syntax elements match_string or match_set .

Only LIKE conditions that satisfy these prerequisites can use the Optimizer to determine an optimal search strategy .

Conditions with the format ...NOT (<column_spec> NOT LIKE <extended_value_spec>) are, where possible, converted into an expression <column_spec> LIKE <extended_value_spec>. The system then continues processing the condition in this converted format.


Search Strategy (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Strategy

SQL statements should be written in such a way that the following aims for the processing of an SQL statement are achieved when a search strategy is selected:

  • Search only those lines that it is necessary to search
  • Restrict results tables and temporary results tables to the smallest possible size

The search strategy that is selected is largely dependent upon the form of the search condition specified in the SQL statement. The search strategy is also selected so that the costs for the processing of the SQL statement are minimized.

For more detailed information about the selection of the search strategy, see the following sections:

  • Sequential Search
  • Search Conditions for Key Columns
  • Search Conditions for Inverted Columns
  • Search Conditions for UPDATE Statements
  • Cost Determination
  • Search Conditions Linked with OR
  • Postponement of the Search to the FETCH Time
  • Join
  • List of All Search Strategies

You can display the search strategy used for an SQL statement with the help of the EXPLAIN statement .


Sequential Search (SAP Library - SAP DB)

 Entering content frame

Background documentation Sequential Search

In principle, every search can be performed sequentially through the entire table. This is necessary in the following cases:

  • No search conditions have been specified
  • No search condition has been specified either for key columns or for inverted columns.

If the possible non-sequential search strategies would be more costly than the sequential search, the table is processed sequentially.


Search Conditions for Key Columns (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Conditions for Key Columns

If search conditions are specified for key columns, the search is limited to the corresponding part of the table, that is, the search strategy is determined as specified in the table.

Search Condition | Search Strategy
Equality condition for every key column | The system accesses the appropriate table line(s) directly.
IN condition for one key column and an equality condition for all other key columns | The system accesses the appropriate table line(s) directly.
Any other search condition for the key columns | Upper and lower limits are created for the key columns for the valid search area. All search strategies, including strategies through inversions, use the knowledge of this valid search area.


Search Conditions for Inverted Columns (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Conditions for Inverted Columns

If you specify search conditions for inverted columns , the search strategy is determined by the system as specified in the table.

Search Condition | Search Strategy
Equality condition for all inverted columns | Only those lines whose keys are contained in the associated inversion list are accessed.
IN condition for inverted columns | The system accesses the lines whose keys are contained in the inversion lists.
Area Conditions There is only one condition ( <, <=, >, >=) for one of the two area limits (upper or lower limit). | The system accesses the lines whose keys are contained in the inversion lists that were determined by the area.
Area conditions Both area limits are specified. It is irrelevant to the selection of the search strategy whether this specification is made using a BETWEEN operator or using two conditions ( <= or >=) for the same column linked by AND. | The system accesses the lines whose keys are contained in the inversion lists that were determined by the area.

In the case of the equality/IN conditions and the area conditions, there are also queries for which it is not necessary to access the lines, as all required values are contained in the inversion list(s).

See also:

Examples: Search Conditions for Inverted Columns


Examples: Search Conditions for Inverted Columns (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Examples: Search Conditions for Inverted Columns

Search conditions for inverted columns of the example table.

Excerpt from SQL Statement

Search Strategy

... where firstkey >= 123

The table is searched sequentially from the line with the key ‘123’.

... where invcolumn1 = 'Miller' and firstkey >= 123

The inversion list with the value ‘Miller’ is searched from the key ‘123’ to the end of the list.

... where invcolumn1 = 'Miller' and invcolumn2 < 'C'

The system creates a logical inversion list that contains all inversion lists of invcolumn 2 that begin with a value smaller than 'C' (' ', 'A', 'B').

The intersection of the logical inversion list and the inversion list with the value ‘Miller’ is determined and the entirety of this intersection is processed.

... where invcolumn1 = 'Miller' and invcolumn2 = 'Don'

The intersection of both inversion lists is determined and processed completely.

... where invcolumn1 IN ('Miller', 'Smith', 'Hawk')

The entirety of three inversion lists are processed.

... where invcolumn2 > 8965 and firstkey = 34 and secondkey between 12 and 18

All inversion lists of invcolumn2 whose values are greater than 8965 are processed. However, they are only considered within the key limits ’34, 12’ and ’34, 18’.

... where
multinvcolumn1 = 'Düsseldorf' and
multinvcolumn2 = '40223' and
multinvcolumn3 = 10000

The entirety of the named index ind with the values ‘Düsseldorf’, ‘40223’ and 10000 is processed.

... where
multinvcolumn1 = 'Düsseldorf' and
multinvcolumn2 between '40221' and '40238'

The inversion list within and including the values ‘Düsseldorf’, ‘40221’ (binary zeros), and ‘Düsseldorf’, ‘40238’ (binary ones) is processed.


Search Conditions for UPDATE Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Conditions for UPDATE Statements

If you use UPDATE statements, the following restrictions apply to the use of search conditions .

If the new value of a column is calculated in an arithmetical expression, an inversion of this column, that is, the corresponding index, cannot be used during the search.

UPDATE <table_name> SET columnx = columnx + 3 WHERE columnx IN (100, 103, 106, 109, 112)

This SQL statement can lead to erroneous results, if the inversion lists were gradually processed with the values 100, 103, 106, 109, and 112.

You should also consider this factor when using FOR UPDATE in the SELECT statement.


Cost Determination (SAP Library - SAP DB)

 Entering content frame

Background documentation Cost Determination

The system determines the cost of every possible search strategy .

This is necessary for the following reasons:

  • There can be several search strategies, of which the best must be determined
  • There are cases, in which searching with the help of an index would be more costly than a sequential search .

The costs relate to the expected number of I/O processes that would have to be executed due to the chosen search strategy.

These costs are also output as a result of the EXPLAIN statement .


Search Conditions Linked with OR (SAP Library - SAP DB)

 Entering content frame

Background documentation Search Conditions Linked with OR

There are search conditions linked with OR. The system analyzes the individual search conditions.

If the system finds an equality condition for key columns, it ignores the other search conditions linked with OR.

If the system does not find any equality conditions for key columns, the other search conditions linked with OR, that the system has not considered until then, are analyzed.

Procedure

  1. Conversion of the search condition into the disjunctive normal form
    Example:
    b1 and b2 and (b3 or b4 and b5)
    results in the disjunctive normal form
    (b1 and b2 and b3) or (b1 and b2 and b4 and b5)
  2. Analysis of the new expression
    Every bracketed expression is analyzed separately. If the analysis of the first expression results in the best search strategy, this is used. However, if the analysis of each bracketed expression provides a better search strategy, there are usually as many search strategies as there are bracketed expressions to be analyzed.
  3. Cost determination
    The costs of the various search strategies are added together. If the total is lower than the determined cost for the search strategy without consideration of the search conditions linked with OR, the various search strategies are used.

If applicable, the EXPLAIN statement displays the search strategy DIFFERENT STRATEGIES FOR OR-TERMS .


Postponement of the Search to the FETCH Time (SAP Library - SAP DB)

 Entering content frame

Background documentation Postponement of the Search to the FETCH Time

A goal of optimization is to save storage area; that is, the creation of results tables should be avoided. Except for the cases in which the syntax element FOR REUSE or the existence of a join forces the creation of results tables, the creation of a results table is avoided where possible.

A possible search strategy is therefore the postponement of the search to the FETCH time ( FETCH statement ), without the creation of a results table. In this way, no memory is used for results, quick access to the first results is possible, and a quicker comparison can be made of the received and the desired results.

The postponement of the search to the FETCH time is not possible for all SQL statements. The following is an overview of a number of SQL statements for which a postponement is not permissible:

SELECT for multiple tables (Join)
SELECT ... FOR REUSE
SELECT DISTINCT ... (in most cases)
SELECT ... ORDER BY ... (in most cases)

SELECT ... ORDER BY

If the ORDER clause was specified, it is only possible to avoid the creation of a results table, if all of the following conditions are met:

  • Neither a DISTINCT specification (< distinct spec >) (with a few exceptions), nor the syntax element FOR REUSE, are specified.
  • The columns by which the system is to sort form an index in the specified order and with the specified sorting (ascending or descending).

You can use the EXPLAIN statement to display whether a results table is created (RESULT IS COPIED) or not (RESULT IS NOT COPIED).


Join (SAP Library - SAP DB)

 Entering content frame

Background documentation Join

Some background information about the processing of joins is required to understand how search strategies are found for joins.

Creating a Results Table for All Tables Linked by a Join

You can use a join to link up to 64 tables with each other. The system links the tables in steps; that is, one join is created from two tables. An additional table is then linked with the join result to form a new join.

  1. The first table is searched.
  2. The result is stored in a temporary results table.
  3. The temporary results table is sorted by the join columns of the following join step.
  4. The next table that still exists is searched.
  5. The existing temporary results table is linked with the new table.
  6. The result is stored in a new temporary results table.
  7. This temporary results table is sorted by the join columns of the following join step.
  8. The old temporary results table is deleted.
  9. If there are more tables, the procedure is repeated from step 4.

The last temporary results table is the results table that the user wants.

Optimization of the Tables Linked by a Join

You can only save time or space during the processing of tables linked by a join if the temporary results tables are as small as possible and that the system can access the lines of each of the new tables to be linked as directly as possible.

The Optimizer therefore attempts to place small tables with restrictive search conditions at the beginning of the series of tables to be processed, in order to maintain small temporary results tables.

The order in which the tables are specified in the FROM clause of the SELECT statement has no influence on the order of processing. The Optimizer determines the order of processing itself.

Search Strategies

You can display the search strategies using the EXPLAIN statement ( EXPLAIN Statement for Joins ).

The following search strategies can be used to access lines in the new table, starting from the join column values of the old temporary results table.

JOIN VIA INDEXED COLUMN

JOIN VIA KEY COLUMN

JOIN VIA KEY RANGE

JOIN VIA MULTIPLE INDEXED COLUMNS

JOIN VIA MULTIPLE KEY COLUMNS

JOIN VIA RANGE OF MULTIPLE INDEXED COL.

JOIN VIA RANGE OF MULTIPLE KEY COLUMNS

Multi-Column Key and Index Strategies

If two columns to be compared in a join step are not of the same length, not all of the search strategies can be used. We recommend that you define columns that are to be linked using a join with the same domain to avoid this restriction.


List of All Search Strategies (SAP Library - SAP DB)

 Entering content frame

Background documentation List of All Search Strategies

You can use the EXPLAIN statement to display the selected search strategy .

List of All Possible Search Strategies

CATALOG KEY ACCESS

CATALOG SCAN

CATALOG SCAN USING USER EQUAL CONDITION

DIFFERENT STRATEGIES FOR OR-TERMS

EQUAL CONDITION FOR INDEX

EQUAL CONDITION FOR INDEX (SUBQ)

EQUAL CONDITION FOR KEY COLUMN

EQUAL CONDITION FOR KEY COLUMN (SUBQ)

IN CONDITION FOR INDEX

IN CONDITION FOR KEY COLUMN

JOIN VIA INDEXED COLUMN

JOIN VIA KEY COLUMN

JOIN VIA KEY RANGE

JOIN VIA MULTIPLE INDEXED COLUMNS

JOIN VIA MULTIPLE KEY COLUMNS

JOIN VIA RANGE OF MULTIPLE INDEXED COL.

JOIN VIA RANGE OF MULTIPLE KEY COLUMNS

NO RESULT SET POSSIBLE

NO STRATEGY NOW (ONLY AT EXECUTION TIME)

RANGE CONDITION FOR KEY COLUMN

RANGE CONDITION FOR KEY COLUMN (SUBQ)

RANGE CONDITION FOR INDEX

RANGE CONDITION FOR INDEX (SUBQ)

INDEX SCAN

TABLE SCAN


CATALOG KEY ACCESS (SAP Library - SAP DB)

 Entering content frame

Background documentation CATALOG KEY ACCESS

CATALOG KEY ACCESS is a search strategy . The SQL statement contains equality conditions , so that the query can be processed using an access to key columns in the database catalog (for example, equality conditions for OWNER and TABLENAME for queries for DOMAIN.TABLES).

See also:

List of All Search Strategies


CATALOG SCAN (SAP Library - SAP DB)

 Entering content frame

Background documentation CATALOG SCAN

CATALOG SCAN is a search strategy . The system performs a sequential search of the database catalog.

See also:

List of All Search Strategies


CATALOG SCAN USING USER EQUAL CONDITION (SAP Library - SAP DB)

 Entering content frame

Background documentation CATALOG SCAN USING USER EQUAL CONDITION

CATALOG SCAN USING USER EQUAL CONDITION is a search strategy . The system performs a sequential search of the database catalog entries that describe objects of the identified user.

See also:

List of All Search Strategies


DIFFERENT STRATEGIES FOR OR-TERMS (SAP Library - SAP DB)

 Entering content frame

Background documentation DIFFERENT STRATEGIES FOR OR-TERMS

DIFFERENT STRATEGIES FOR OR-TERMS is a search strategy . The system converted and analyzed search conditions linked with OR . If the system finds an equality condition for key fields, it ignores the other search conditions linked with OR. If the system does not find an equality condition, the system determines different search strategies for the different parts of the search conditions linked with OR.

See also:

List of All Search Strategies


EQUAL CONDITION FOR INDEX (SAP Library - SAP DB)

 Entering content frame

Background documentation EQUAL CONDITION FOR INDEX

EQUAL CONDITION FOR INDEX is a search strategy . An equality condition was specified for all columns of an index. The system accesses the corresponding table lines directly, with the help of the appropriate inversion list .

See also:

List of All Search Strategies


EQUAL CONDITION FOR INDEX (SUBQ) (SAP Library - SAP DB)

 Entering content frame

Background documentation EQUAL CONDITION FOR INDEX (SUBQ)

EQUAL CONDITION FOR INDEX (SUBQ) is a search strategy . An equality condition was specified for all columns of an index. The system accesses the corresponding table lines for each hit line of the subquery directly, with the help of the appropriate inversion list .

See also:

List of All Search Strategies


EQUAL CONDITION FOR KEY COLUMN (SAP Library - SAP DB)

 Entering content frame

Background documentation EQUAL CONDITION FOR KEY COLUMN

EQUAL CONDITION FOR KEY COLUMN is a search strategy . The table has only one key column, for which an equality condition was specified. The system accesses the appropriate table lines directly.

See also:

List of All Search Strategies


EQUAL CONDITION FOR KEY COLUMN (SUBQ) (SAP Library - SAP DB)

 Entering content frame

Background documentation EQUAL CONDITION FOR KEY COLUMN (SUBQ)

EQUAL CONDITION FOR KEY COLUMN (SUBQ) is a search strategy . The table has only one key column, for which an equality condition was specified. The system accesses the appropriate table line directly for each hit line of the subquery.

See also:

List of All Search Strategies


IN CONDITION FOR INDEX (SAP Library - SAP DB)

 Entering content frame

Background documentation IN CONDITION FOR INDEX

IN CONDITION FOR INDEX is a search strategy . An IN condition was specified for the first column of an index that consists of multiple columns, or equality conditions were specified for the first k-1 columns of an index of this type and an IN condition was specified for the k-th column. The system accesses the corresponding table lines directly, with the help of the appropriate inversion lists .

See also:

List of All Search Strategies


IN CONDITION FOR KEY COLUMN (SAP Library - SAP DB)

 Entering content frame

Background documentation IN CONDITION FOR KEY COLUMN

IN CONDITION FOR KEY COLUMN is a search strategy . The table has only one key column, for which an IN condition was specified. The system directly accesses the table lines concerned.

See also:

List of All Search Strategies


JOIN VIA INDEXED COLUMN (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA INDEXED COLUMN

JOIN VIA INDEXED COLUMN is a search strategy for joins . An index was created for the join column that contains only this column. The system accesses the data through the index of the column whose name is displayed.

See also:

List of All Search Strategies


JOIN VIA KEY COLUMN (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA KEY COLUMN

JOIN VIA KEYCOLUMN is a search strategy for joins . The join column is the only key column. The system accesses the table lines in the new table directly.

See also:

List of All Search Strategies


JOIN VIA KEY RANGE (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA KEY RANGE

JOIN VIA KEY RANGE is a search strategy for joins . The join column whose name is displayed is the first key column. Within the key area, the system accesses the table lines in the new table sequentially.

See also:

List of All Search Strategies


JOIN VIA MULTIPLE INDEXED COLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA MULTIPLE INDEXED COLUMNS

JOIN VIA MULTIPLE INDEXED COLUMNS is a search strategy for joins . The specified join columns can be combined into a complete index that incorporates multiple columns. The system accesses the data through this index.

See also:

List of All Search Strategies


JOIN VIA MULTIPLE KEY COLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA MULTIPLE KEY COLUMNS

JOIN VIA MULTIPLE KEY COLUMNS is a search strategy for joins . The specified join columns can be combined into a multi-column key for the new table. The system accesses the table lines in the new table directly.

See also:

List of All Search Strategies


JOIN VIA RANGE OF MULTIPLE INDEXED COL. (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA RANGE OF MULTIPLE INDEXED COL.

JOIN VIA RANGE MULTIPLE INDEXED COL. is a search strategy for joins . The specified join columns can be combined to form the start of a complete index that incorporates multiple columns. Within the index area, the system accesses the lines of the table.

See also:

List of All Search Strategies


JOIN VIA RANGE OF MULTIPLE KEY COLUMNS (SAP Library - SAP DB)

 Entering content frame

Background documentation JOIN VIA RANGE OF MULTIPLE KEY COLUMNS

JOIN VIA RANGE MULTIPLE KEY COLUMNS is a search strategy for joins . The specified join columns can be combined to form the start of a multi-column key for the new table. Within the key area, the system accesses the table lines in the new table sequentially.

See also:

List of All Search Strategies


NO RESULT SET POSSIBLE (SAP Library - SAP DB)

 Entering content frame

Background documentation NO RESULT SET POSSIBLE

The Optimizer identifies search conditions that logically cannot have a result (NO RESULT SET POSSIBLE). In this case, no search is performed.

See also:

List of All Search Strategies


NO STRATEGY NOW (ONLY AT EXECUTION TIME) (SAP Library - SAP DB)

 Entering content frame

Background documentation NO STRATEGY NOW (ONLY AT EXECUTION TIME)

NO STRATEGY NOW (ONLY AT EXECUTION TIME) is a search strategy . In a subquery, the corresponding column values are only known at the execution time for the subquery. The search strategy for the most effective access to the corresponding table for the subquery is only determined when these values are available.

See also:

List of All Search Strategies


RANGE CONDITION FOR KEY COLUMN (SAP Library - SAP DB)

 Entering content frame

Background documentation RANGE CONDITION FOR KEY COLUMN

RANGE CONDITION FOR KEY COLUMN is a search strategy , with which a sequential search is performed in part of the table.

See also:

List of All Search Strategies


RANGE CONDITION FOR KEY COLUMN (SUBQ) (SAP Library - SAP DB)

 Entering content frame

Background documentation RANGE CONDITION FOR KEY COLUMN (SUBQ)

RANGE CONDITION FOR KEY COLUMN (SUBQ) is a search strategy , with which a sequential search is performed in part of the table with every hit line of the subquery.

See also:

List of All Search Strategies


RANGE CONDITION FOR INDEX (SAP Library - SAP DB)

 Entering content frame

Background documentation RANGE CONDITION FOR INDEX

RANGE CONDITION FOR INDEX is a search strategy . Equality or area conditions have been specified for the first k columns of an index. The system accesses the corresponding table lines directly, with the help of the inversion lists in the area.

See also:

List of All Search Strategies


RANGE CONDITION FOR INDEX (SUBQ) (SAP Library - SAP DB)

 Entering content frame

Background documentation RANGE CONDITION FOR INDEX (SUBQ)

RANGE CONDITION FOR INDEX (SUBQ) is a search strategy . Equality or area conditions have been specified for the first k columns of an index. The system accesses the corresponding table lines for each hit line of the subquery directly, with the help of the appropriate inversion lists in the area.

See also:

List of All Search Strategies


INDEX SCAN (SAP Library - SAP DB)

 Entering content frame

Background documentation INDEX SCAN

INDEX SCAN is a search strategy , with which a sequential search is performed in the entire specified index.

See also:

List of All Search Strategies


TABLE SCAN (SAP Library - SAP DB)

 Entering content frame

Background documentation TABLE SCAN

TABLE SCAN is a search strategy , with which a sequential search is performed in the entire table.

See also:

List of All Search Strategies


EXPLAIN Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation EXPLAIN Statement

The user can use EXPLAIN statements to find out which search strategy the system is using to perform the specified SELECT statement. For an explanation of all search strategies, see the List of All Search Strategies.

Information about the EXPLAIN Statement

· For a complete syntax description for the EXPLAIN statement, see the Reference Manual, under EXPLAIN Statement.

· Result of the cost determination for a search strategy: You can find this in the PAGECOUNT column of the EXPLAIN statement output

· Special features for an EXPLAIN statement for joins

· Special features for an EXPLAIN statement for complicated SELECT statements

· Special features for an EXPLAIN statement for SELECT statements with subqueries

· Entries in the column STRATEGY in the output of the EXPLAIN statement


EXPLAIN Statement for Joins (SAP Library - SAP DB)

 Entering content frame

Background documentation EXPLAIN Statement for Joins

You can also use the EXPLAIN statement for joins .

Result of the EXPLAIN Statement

  • Display of the order in which the tables are processed when the SELECT statement is executed
  • Display of whether the join column values of the old temporary results table can be accessed directly or through an inversion to the lines of a new table
  • Display of the strategy used to search in the new table, if the lines of this table cannot be accessed directly or using an inversion

EXEC SQL EXPLAIN SELECT one .key ten1 .keyft1, ten2 .keyft2
FROM one, ten1, ten2
WHERE ten1.keyft1 < 100
  AND ten1.ft1    = one.keyf
  AND one. indf     = ten2.keyft2
  AND ten2.keyft2 < 100;

These EXPLAIN statement produces the following output:

TABLE NAME

COLUMN_
OR_INDEX

STRATEGY

PAGE COUNT

TEN1

ONE

TEN2

KEF

KEYFT2

RANGE CONDITION FOR KEY COLUMN

JOIN VIA KEY COLUMN

JOIN VIA KEY COLUMN

RESULT IS COPIED, COSTVALUE IS

1250

125

1463

97


EXPLAIN Statement for Complicated SELECT Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation EXPLAIN Statement for Complicated SELECT Statements

Certain SELECT statements are so complicated that they are separated into several internal SELECT steps.

For SELECT statements of this type, the EXPLAIN statement outputs several search strategies . In this output, INTERNAL TEMPORARY RESULT is given as the table name. Searches through internal temporary results of this type can only ever be performed sequentially.


EXPLAIN Statement for SELECT Statements with Subqueries (SAP Library - SAP DB)

 Entering content frame

Background documentation EXPLAIN Statement for SELECT Statements with Subqueries

To determine the cost of search strategies with which, the value of a column is compared with the hit lines of a subquery , you must know the number of hit lines. You can therefore only determine the cost of the search strategy after the subquery has been processed.

For a SELECT statement with subqueries, the EXPLAIN statement determines the possible search strategies, but does not execute the contained subqueries. Therefore, the search strategy NO STRATEGY NOW (ONLY AT EXECUTION TIME) is usually displayed for the outer SQL statement.

SQL statements that can only be processed on an index are an exception to this rule.


Entries in the Column STRATEGY (SAP Library - SAP DB)

 Entering content frame

Background documentation Entries in the Column STRATEGY

The following table explains the possible entries in the column STRATEGY of the result table EXPLAIN.

For information on the structure of this result table, see the Reference Manual under EXPLAIN Statement.

Entry | Meaning
ONLY INDEX ACCESSED | This strategy uses only the specified index to process the command. The system does not access the basis table data. To enable this, only columns that are contained in the index structure can be addressed in the sequence of selected columns (<select_column>) or in a WHERE clause, if one exists.
DISTINCT OPTIMIZATION (C) | Complete Secondary Key All columns of an index (and only these) are specified as a result of selected columns (<select_column>), after the keyword DISTINCT (DISTINCT specification (distinct_spec)), in any order. The system accesses the values for each index column only once. The system does not create a results table (such as SELECT DISTINCT <all_columns_of_the_index> FROM ...).
DISTINCT OPTIMIZATION (P) | Partial Secondary Key The first k (k < Total number of index columns) columns of an index are specified are specified in any order as a result of selected columns (<select_column>), after the key word DISTINCT. The system accesses the values for each index column only once. The system does not create a results table (such as SELECT DISTINCT <first_k_columns_of_the_index> FROM ...).
DISTINCT OPTIMIZATION (K) | Primary Key All columns of an index, and the first k (k <= total number of columns in the key) columns of the key are specified in any order as a result of selected columns (<select_column>), after the keyword DISTINCT. The system accesses the values for the corresponding index and key columns only once. The system does not create a results table (such as SELECT DISTINCT <all_columns_of_the_index_+_first_k_columns_of_the_key> FROM ...).
TEMPORARY INDEX CREATED | A temporary index is created internally, in which the keys of the hit lines determined through the corresponding index are stored in ascending order. The system accesses the basis table using this temporary index.
ADDNL. QUALIFICATION ON INDEX | There are search conditions for index or key columns that cannot be used for the direct containment of the area for an index access (for example, in the case of an equality /IN condition, for the first and third columns of a multi-column index, only the first search condition of the search strategy is used for access). These search conditions flow into the corresponding index strategy. They are used to restrict accesses to the basis table.


Terms and Examples (SAP Library - SAP DB)

 Entering content frame

Background documentation Terms and Examples

Inverted Column

Inversion List

Examples


Inverted Column (SAP Library - SAP DB)

 Entering content frame

Background documentation Inverted Column

An inverted column is a column that is part of at least one index .


Inversion List (SAP Library - SAP DB)

 Entering content frame

Background documentation Inversion List

An inversion list is a list of keys that belong to an index . In each column of the index, all table lines whose keys are specified in the list contain the same value for this column.


Examples (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Examples

  • Definition of tables ( example , one , ten1 , ten2 ).
  • Definition of indexes ( invcolumn1 , invcolumn2 , indf , ind ).


example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text example

Definition of the table example

EXEC SQL CREATE TABLE example
  (firstkey         FIXED (3) KEY,
   secondkey        FIXED (4) KEY,
   normalcolumn     FIXED (5),
   invcolumn1       CHAR (15),
   invcolumn2       CHAR (9),
   multinvcolumn1   CHAR (22),
   multinvcolumn2   CHAR (5,
   multinvcolumn3   CHAR (8,
   PRIMARY KEY (firstkey, secondkey));

Two single-column indexes ( invcolumn1 and invcolumn2 ), and one multi-column index ind are defined for the example table.


ind (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text ind

Definition of the index ind

EXEC SQL CREATE INDEX ind ON example (multinvcolumn1, multinvcolumn2, multinvcolumn3);


indf (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text indf

Definition of the index indf

EXEC SQL CREATE INDEX indf on one (indf);


invcolumn1 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text invcolumn1

Definition of the index invcolumn1

EXEC SQL CREATE INDEX invcolumn1 ON example (invcolumn1);


invcolumn2 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text invcolumn2

Definition of the index invcolumn2

EXEC SQL CREATE INDEX invcolumn2 ON example (invcolumn2);


one (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text one

Definition of the table one

EXEC SQL CREATE TABLE one
  (keyf         FIXED (6),
   indf         FIXED (3),
   ...,
   PRIMARY KEY (keyf)); /*1000 rows*/

The index indf is created for the table one.


ten1 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text ten1

Definition of the table ten1

EXEC SQL CREATE TABLE ten1
  (keyft1         FIXED (6),
   ft1            FIXED (3),
   ...,
   PRIMARY KEY (keyft1)); /*10000 rows*/


ten2 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text ten2

Definition of the table ten2

EXEC SQL CREATE TABLE ten2
  (keyft2         FIXED (6),
   ...,
   PRIMARY KEY (keyft2)); /*10000 rows*/


Messages (SAP Library - SAP DB)

 Entering content frame

Messages

The following is a list and explanation of all messages issued by the database system SAP DB, Version 7.4.


Introduction (SAP Library - SAP DB)

 Entering content frame

Introduction

This manual contains general system and error messages of the database kernel, the tool components and the precompiler. Short explanations of their possible causes and hints for troubleshooting are provided.

The system messages are sorted in ascending order (from 0 to 25999 ).

The error messages are sorted in descending order (from -1 to -28999 ).


System messages (SAP Library - SAP DB)

 Entering content frame

System messages

System messages provide feedback for the user. They are output even if requests are syntactically correct or the program is running smoothly.

Database Kernel System Messages

From 0 to 1999

System Messages of the Loader Program

From 25000 to 25999


Error messages (SAP Library - SAP DB)

 Entering content frame

Error messages

Error messages are meant to indicate that an error has occurred which requires action by the user as described.

Error Messages from the Database Kernel / the Precompiler

From -1 to -699

From -700 to -899

From -900 to -999

From -1000 to -1999

From -2000 to -2999

From -3000 to -3999

From -4000 to -4999

From -5000 to -5999

From -6000 to -6999

From -7000 to -7999

From -8000 to -9799

From -9800 to -9999

Error Messages of the ODBC Program

From -22000 to -22999

Error Messages of the SQL Studio Program

From -23000 to -23999

Error Messages of the Database Manager Program

From -24000 to -24999

Error Messages of the Loader Program

From -25000 to -25999

Error Messages of the liveCache

From -27000 to -28999


Number Ranges (SAP Library - SAP DB)

 Entering content frame

Number Ranges

Component | Message Type | Number Range
Database kernel | System message Error message | 0 to 1999 -1 to -699 -900 to -999 -1000 to -1999 –2000 to –2999 -3000 to -3999 –4000 to –4999 -5000 to -5999 –6000 to –6999 -7000 to -7999 -8000 to -9799
Precompiler | Error message Error message | -700 to -899 -9800 to -9999
ODBC | Error message | -22000 to -22999
SQL Studio | Error message | -23000 to -23999
Database Manager | Error messages | -24000 to -24999
Loader | System messages Error messages | 25000 to 25999 -25000 to -25999
liveCache | Error messages | -27000 to -28999


From -1 to -699 (SAP Library - SAP DB)

 Entering content frame

From -1 to -699

Database Kernel Error Messages

-1 | Duplicate key in index
-8 | Execution failed, parse again
-20 | Duplicate key
-25 | Duplicate secondary key
-30 | Integrity violation
-32 | View violation
-35 | Referential integrity violated
-36 | Foreign key integrity violation
-40 | Lock collision
-50 | Lock request timeout
-51 | Lock request timeout
-54 | Lock collision
-60 | Work rolled back
-65 | Work rolled back
-70 | Session inactivity timeout (Work rolled back)
-71 | Session terminated by shutdown (Work rolled back)
-75 | Too many SQL statements (Work rolled back)
-101 | SQL statement not available in this DB mode
-102 | SQL statement canceled
-103 | SQL statement not available for this application
-104 | DBM command impossible at this time
-106 | Table unloaded or content deleted
-107 | SQL statement not allowed for this instance
-108 | Table or index dropped or content deleted
-111 | Incompatible incremental backup
-115 | Table is read only
-123 | No more log to save
-530 | Referential integrity violated
-602 | System error


-1: Duplicate key in index (SAP Library - SAP DB)

 Entering content frame

-1: Duplicate key in index

Explanation:

There is already a table row with the specified secondary key. UNIQUE was specified for the secondary key.

User Action:

To avoid a key value collision, correct the value of the key to be inserted in the SQL statement.

The error message specifies the column or multiple-column index already containing the specified values.


-8: Execution failed, parse again (SAP Library - SAP DB)

 Entering content frame

-8: Execution failed, parse again

Explanation:

The parse identification (parsid) became invalid by modifications made to the database catalog during parsing and executing a statement.

User Action:

Reparse the statement.


-20: Duplicat key (SAP Library - SAP DB)

 Entering content frame

-20: Duplicate key

Explanation:

There is already a table row with the key to be inserted.

User Action:

Check whether the existing table row contains the desired values. If this is not the case, check whether values in the existing table row can be replaced with the desired values. If a new table row must be inserted, change the value of the key to be inserted in the SQL statement in order to prevent key collisions.


-25: Duplicate secondary key (SAP Library - SAP DB)

 Entering content frame

-25: Duplicate secondary key

Explanation:

There is already a table row with the specified secondary key. UNIQUE was specified for the secondary key.

User Action:

To avoid a key value collision, correct the value of the key to be inserted in the SQL statement.

The error message specifies the column or multiple-column index already containing the specified values.


-30: Integrity violation (SAP Library - SAP DB)

 Entering content frame

-30: Integrity violation

Explanation:

Insertions or updates would violate integrity constraints specified in the definition of the base or view table.

User Action:

The error message specifies the column which would violate the integrity constraints.

Correct the input value for the corresponding column.


-32: View violation (SAP Library - SAP DB)

 Entering content frame

-32: View violation

Explanation:

An INSERT or UPDATE statement was issued for a view table. At least one of the rows specified in the SQL statement does not satisfy the SEARCH CONDITIONs of all underlying view tables defined 'WITH CHECK OPTION'.

User Action:

Display the definition of the view table using a QUERY statement issued on the system table DOMAIN.VIEWDEFS. Correct the INSERT or UPDATE statement according to this definition.


-35: Referential integrity violated (SAP Library - SAP DB)

 Entering content frame

-35: Referential integrity violated

Explanation:

This may be caused by one of the following:

  1. An INSERT or UPDATE statement issued on a table that is the referencing table in a REFERENTIAL CONSTRAINT DEFINITION produces a row that is not a matching row of the CONSTRAINT definition. When deleting rows from a REFERENCED TABLE of a REFERENTIAL CONSTRAINT DEFINITION with ON DELETE RESTRICT in the DELETE RULE, a matching row exists.
  2. When executing a REFERENTIAL CONSTRAINT DEFINITION, the REFERENCED TABLE or referencing table contains rows which conflict with the CONSTRAINT definition.

User Action:

  1. Display the definition of the REFERENTIAL CONSTRAINT DEFINITION using a QUERY statement issued on the system table DOMAIN.COL_REFS_COL. Correct the INSERT or UPDATE statement according to this definition.
  2. Use an appropriate QUERY statement to find out which row of the referencing table prevents the desired REFERENCED TABLE rows from being deleted.
  3. Use an appropriate QUERY statement to find out which row of the REFERENCED TABLE or referencing table conflicts with the REFERENTIAL CONSTRAINT DEFINITION. Change or delete this row, or correct the CONSTRAINT definition.


-36: Foreign key integrity violation (SAP Library - SAP DB)

 Entering content frame

-36: Foreign key integrity violation

Explanation:

Where there is an INSERT or <UPDATE statement> issued on a join view table, the column values functionally depending on the <REFERENCING COLUMN>s of the referencing table conflict with the existing column values.

User Action:

This conflict may be solved by changing either the column values specified in the INSERT or <UPDATE statement>, or the existing values.


-40: Lock collision (SAP Library - SAP DB)

 Entering content frame

-40: Lock collision

Explanation:

When the option (NOWAIT) is specified in the LOCK statement or in the LOCK option, this message signals that the lock request conflicts with the locks of other users.

User Action:

  1. In interactive mode, another job can be activated which does not require the desired lock.
  2. As an alternative, you can wait for the lock to be released by specifying the same SQL statement without the '(NOWAIT)' option.


-50: Lock request timeout (SAP Library - SAP DB)

 Entering content frame

-50: Lock request timeout

Explanation:

The lock request or an implicit lock request conflicts with the locks of another user. The maximum waiting time for being granted the lock has elapsed (installation parameter REQUEST_TIMEOUT).

User Action:

In some cases, the error message contains a more detailed description of the error.

The lock request can be reissued, but to avoid possible deadlock situations, it is advisable to roll back the transaction using the ROLLBACK statement.


-51: Lock request timeout (SAP Library - SAP DB)

 Entering content frame

-51: Lock request timeout

Explanation:

The lock request or an implicit lock request conflicts with the locks of another user. The maximum waiting time for granting the lock has elapsed (installation parameter REQUEST_TIMEOUT).

User Action:

In some cases, the error message contains a more detailed description of the error.

The lock request can be reissued, but to avoid possible deadlock situations, it is advisable to roll back the transaction using the <ROLLBACK statement>.


-54: Lock collision (SAP Library - SAP DB)

 Entering content frame

-54: Lock collision

Explanation:

When the option (NOWAIT) is specified in the LOCK statement or in the LOCK option, this message signals that the lock request conflicts with the locks of other users.

User Action:

  1. In interactive mode, another job can be activated which does not require the desired lock.
  2. As an alternative, you can wait for the lock to be released by specifying the same SQL statement without the '(NOWAIT)' option.


-60: Work rolled back (SAP Library - SAP DB)

 Entering content frame

-60: Work rolled back

Explanation:

The user's transaction was implicitly cancelled and reset by a ROLLBACK statement. for the following possible reasons:

  1. The user failed to carry out any operations in the database system within a certain period of time (installation parameter LOCK_TIMEOUT), but was holding locks which other users were waiting for.
  2. The database server was in a deadlocked situation, that is, a situation in which two or more users are holding locks and request further locks that are being held by other users. In the simplest case of two users, one user holds one lock at least and requests another lock. But this lock is held by another user who is himself waiting for the lock held by the first user. This situation can only be resolved if one of the users releases the lock already obtained.

User Action:

In some cases, the error message contains a more detailed description of the error.

In both cases, the lock requests must be checked and modified, if necessary. Repeat the last transaction.

It may also be necessary to check and modify the value of the installation parameter LOCK_TIMEOUT.


-65: Work rolled back (SAP Library - SAP DB)

 Entering content frame

-65: Work rolled back

Explanation:

The user transaction was canceled implicitly and reset with an implicit ROLLBACK statement because the log AREA is full.

User Action:

The error text contains a precise description of the error.

Save the log. Details can be found in the database administration guide.


-70: Session inactivity timeout (work rolled back) (SAP Library - SAP DB)

 Entering content frame

-70: Session inactivity timeout (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was implicitly terminated, since you failed to carry out any database operations within a certain period of time (installation parameter SESSION_TIMEOUT or TIMEOUT value specified with the <CONNECT statement>).

User Action:

Repeat the CONNECT statement, possibly specifying a higher TIMEOUT value.

It may also be necessary to check and modify the value of the SESSION TIMEOUT installation parameter.


-71: Session terminated by shutdown (work rolled back) (SAP Library - SAP DB)

 Entering content frame

-71: Session terminated by shutdown (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was canceled implicitly because a database shutdown was forced in parallel by the database administration tool. To speed up a later restart, the database tries to reset and not just terminate open transactions within a short period.

User Action:

Repeat the CONNECT statement and the transaction when the serverdb is ready for operation.


-75: Too many SQL statements (work rolled back) (SAP Library - SAP DB)

 Entering content frame

-75: Too many SQL statements (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was implicitly terminated, since you had issued too many SQL statements or had performed too many transactions within a session.

User Action:

After a new CONNECT statement the transaction may be repeated.


-101: SQL statement not available in this DB mode (SAP Library - SAP DB)

 Entering content frame

-101: SQL statement not available in this DB mode

Explanation

In order to execute the SQL statement, the database must be in OFFLINE or ONLINE mode .

User action

Ensure that the database instance is in the required mode.

If a system error has occurred and the system has performed a SHUTDOWN, correct the error and re-start the database instance.


-102: SQL statement cancelled (SAP Library - SAP DB)

 Entering content frame

-102: SQL statement canceled

Explanation:

The SQL statement currently executed was terminated by user or operator intervention.

User Action:

No user action is required in interactive operation. In other cases, reset the transaction with a ROLLBACK statement.


-103: SQL statement not available for this application (SAP Library - SAP DB)

 Entering content frame

Background documentation -103: SQL statement not available for this application

Explanation:

You have attempted to use an application to execute an SQL statement. This application has no privileges for this statement.

User Action:

Use the correct application, or check the syntax of the statement.


-104: DBM command impossible at this time (SAP Library - SAP DB)

 Entering content frame

Background documentation -104: DBM command impossible at this time

Explanation:

You have attempted to execute a database management statement.

You cannot execute this statement if another database statement is already running.

User Action:

Execute the statement again later.


-106: Table unloaded or content deleted (SAP Library - SAP DB)

 Entering content frame

-106: Table unloaded or content deleted

Explanation:

The table cannot currently be accessed. The following reasons are possible:

  1. The table was extracted from the serverdb using the TABLEEXTRACT statement.
  2. Another user simultaneously performed a DELETE statement either for a great part of the table or for the whole table. The specified table was not accessible for a short period of time. This error message can only occur if you work with ISOLATION LEVEL 0.

User Action:

  1. Reload the table into the dataset using the TABLELOAD statement.
  2. Wait till the processing of the DELETE statements is finished.

Execute the SQL statement.


-107: SQL statement not allowed for this instance (SAP Library - SAP DB)

 Entering content frame

Background documentation -107: SQL statement not allowed for this instance

Explanation:

The database instance is unable to execute this SQL statement.

User Action:

You must do without the SQL statement for this database instance.


-108: Table or index dropped or content deleted (SAP Library - SAP DB)

 Entering content frame

-108: Table or index dropped or content deleted

Explanation:

While an SQL statement was processed without any read locks, another database user deleted a table. The execution of the SQL statement was therefore cancelled.

User Action:

Clarify the organizational error in the user environment.


-111: Incompatible incremental backup (SAP Library - SAP DB)

 Entering content frame

-111: Incompatible incremental backup

Explanation:

The database version to be loaded is not the follow-up version of the current database state.

User Action:

Choose the correct database version.


-115: Table is read only (SAP Library - SAP DB)

 Entering content frame

-115: Table is read only

Explanation:

The attempt was made to perform an <INSERT>, <UPDATE> OR <DELETE statement>. But the specified table only allows reading SQL statements because it was previously loaded with the NOLOG option.

User Action:

The read-only mode can be implicitly cancelled saving data or pages using the database administration tool.


-123: No more log to save (SAP Library - SAP DB)

 Entering content frame

-123: No more log to save

Explanation:

You tried to save the log AREA. This is not possible or necessary since the database system wrote no or very few entries to the log AREA since the log AREA was last saved.

User Action:

No user action is required.


-530: Referential integrity violated (SAP Library - SAP DB)

 Entering content frame

-530: Referential integrity violated

Explanation:

The following reasons are possible:

  1. An INSERT or <UPDATE statement> issued on a table that is the referencing table in a <REFERENTIAL CONSTRAINT DEFINITION> produces a row that is not a matching row of the <CONSTRAINT definition>.
  2. When deleting rows from a <REFERENCED TABLE> of a <REFERENTIAL CONSTRAINT DEFINITION> with ON DELETE RESTRICT in the <DELETE RULE>, a matching row exists.

User Action:

  1. Display the definition of the <REFERENTIAL CONSTRAINT DEFINITION> using a <QUERY statement> issued on the system table DOMAIN.COL_REFS_COL. Correct the <INSERT> or <UPDATE statement> according to this definition.
  2. Use an appropriate <QUERY statement> to find out which row of the referencing table prevents the desired <REFERENCED TABLE> rows from being deleted.


-602: System error (SAP Library - SAP DB)

 Entering content frame

-602: System error

Explanation:

Normal database operations were disrupted. Possibly the database is no longer consistent. An implicit SHUTDOWN may have been performed.

User Action:

Shut down the database and inform your local support organization.

Create a trace of the last database activities and copy them to, for example, a tape. Send the trace to your local support organization so the error can be traced and rectified.


From -700 to -899 (SAP Library - SAP DB)

 Entering content frame

From -700 to -899

Precompiler error messages

-702 | Missing variable address in SQLDA
-703 | Duplicate FETCH statement with MFETCH option not allowed
-706 | SQL statement too long (buffer overflow)
-707 | Invalid CONNECT statement syntax
-708 | SERVERDB system not available
-709 | CONNECT failed, check SERVERDB
-710 | Missing SELECT PARSID
-711 | Implicit CONNECT: missing user of SERVERDB
-712 | Too many parameters, SQLMAX too small
-715 | Missing username or password for CONNECT
-719 | Unknown LOCALSYSUSER.SYSPROFILE table
-720 | SQLCODE <no> comes from SYSPROFILE command
-721 | Macro not initiated, no SQLCHECK
-724 | Duplicate substructure name
-729 | Source code may be truncated
-730 | Nested comment not closed
-731 | Component name too long
-732 | Index of component out of range
-733 | Variable is declared as a pointer
-734 | Pointer bariable not allowed here
-735 | No syntax check for CONNECT command
-740 | Array size mismatch
-743 | Input string too long
-750 | FFETCH or ARRAY-FETCH and FETCH mix not allowed
-751 | Numeric input parameter overflow
-752 | Session already connected
-753 | Output parameter with CONST type
-756 | Different SQLMODEs not allowed
-758 | Include file exists on disk
-759 | Include file produced by user
-760 | Memory allocation failed
-762 | EXEC ORACLE command has been deleted
-763 | Variable not allowed as ARRAY
-767 | Unterminated C string
-768 | Invalid escape value
-769 | Pointer component not allowed
-770 | Macro in FETCH set SQLOPT="-B 0"
-771 | LONG column exists in table definition
-772 | Multibyte char set not allowed
-773 | Datafile open error
-774 | Datafile write error
-775 | Datafile read error
-776 | Datafile close error
-777 | Convertion from UNICODE impossible
-778 | Convertion to UNICODE impossible
-801 | Input parameter cannot be NULL value
-802 | Invalid numeric input parameter value
-804 | Parameter list to long
-805 | Program must be precompiled
-806 | DB session numer not allowed
-807 | Connection down, session released
-808 | Not yet implemented
-809 | Missing indicator variable, output parameter with NULL value
-811 | Numeric output parameter overflow
-812 | Parameter list too short
-813 | SERVERDB must be restarted
-814 | Trace file close error
-815 | Trace file open error
-816 | Trace file write error
-817 | Incompatible data types
-818 | Missing macro parameter initialization
-819 | Parameter in SQL statement not allowed
-820 | Invalid declare statement
-822 | Invalid constant definition
-823 | Integer too large, greater than 32767
-824 | Statement in conflict with COMPATIBLE option
-825 | Duplicate field name in record
-826 | Duplicate statement name
-827 | Duplicate type definition
-828 | Duplicate variable name
-829 | File close error
-830 | File open error
-831 | File read error
-832 | File write error
-833 | Illegal INCLUDE position
-834 | INCLUDEs must not be nested
-835 | INCLUDE file open error
-836 | Invalid C preprocessor command
-837 | Data definition not allowed
-838 | Invalid declarator
-839 | Invalid macro value
-840 | Invalid numeric macro value
-841 | Invalid precompiler option
-842 | Parameter and indicator structures do not match
-843 | Invalid parameter name
-844 | Invalid record name
-845 | Invalid SQL statement
-846 | Invalid statement in section
-847 | Invalid type definition
-848 | Invalid unsigned integer
-849 | Invalid variable definition
-850 | Statement termination expected
-851 | Missing input file name
-852 | Missing program file
-853 | Precompiler syntax check only
-854 | Parameters must be question marks
-855 | SQL variable must be an array
-856 | Invalid loop parameter value
-857 | Missing SERVERDB
-858 | Storage class not allowed
-859 | Number of columns < numer of parameters
-860 | To many constants declared
-870 | Too many type definitions
-871 | Too many variable definitions
-872 | Number of columns > numer of parameters
-873 | Unknown constant name
-874 | Unknown cursor name
-876 | Unknown macro number
-877 | Unknown parameter name
-878 | Unknown record name
-879 | Unknown precompiler statement
-880 | Unknown statement name
-881 | Unknown type name
-882 | Missing user name for CONNECT
-883 | Invalid runtime options
-884 | Missing indicator variabeI
-885 | Variable may be truncated
-886 | DECLARE SECTION BEGIN or END missing
-887 | Too long WHENEVER ACTION
-889 | Input line longer than 512 characters
-890 | Input line longer than right margin
-892 | Variable may overflow
-893 | Too many hostvariables
-894 | Trace parameter structure not allowed
-895 | Whole table may be deleted or updated
-899 | Error unknown


-702: Missing variable address in SQLDA (SAP Library - SAP DB)

 Entering content frame

-702: Missing variable address in SQLDA

Explanation:

The address of a program variable was not set in the SQLDA.

User Action:

Write the address into the SQLDA at the HOSTVARADDR position.


-703: Duplicate FETCH statement for same select in program (SAP Library - SAP DB)

 Entering content frame

-703: Duplicate FETCH statement for same select in program

Explanation:

When the MFETCH option is set, only one FETCH statement is allowed per result table.

The execution of such a FETCH statement can be repeated within a loop.

User Action:

Modify the application or run it without MFETCH option.


-706: SQL statement too long (buffer overflow) (SAP Library - SAP DB)

 Entering content frame

-706: SQL statement too long (buffer overflow)

Explanation:

The SQL statement does not fit the buffer used for communication between the application program and the database system.

User Action:

Change the statement or break down the SQL statement into two or more SQL statements.


-707: Invalid CONNECT statement syntax (SAP Library - SAP DB)

 Entering content frame

-707: Invalid CONNECT statement syntax

Explanation:

There is an error in the CONNECT statement syntax.

User Action:

Take the exact syntax description from the Reference manual. Correct the statement accordingly.


-708: SERVERDB system not available (SAP Library - SAP DB)

 Entering content frame

-708: SERVERDB system not available

Explanation:

The database exists, but it is in the startup or shutdown phase, with the result that a connection cannot be established at the moment.

User Action:

Repeat the CONNECT at a later time.


-709: Connect failed, check SERVERDB (SAP Library - SAP DB)

 Entering content frame

-709: Connect failed, check SERVERDB

Explanation:

An error was detected while processing the CONNECT statement.

User Action:

  1. Check the name of the database and correct if necessary.
  2. Check whether the database is running. If not, start the database server.
  3. If the data transfer to the database has been interrupted, you must restore it.


-710: Missing select PARSID (SAP Library - SAP DB)

 Entering content frame

-710: Missing select PARSID

Explanation:

The parsing information of a FETCH/CLOSE command cannot be assigned to any result set.

User Action:

Contact your local support organization.


-711: Implicit CONNECT: missing user or SERVERDB (SAP Library - SAP DB)

 Entering content frame

-711: Implicit CONNECT: missing user or SERVERDB

Explanation:

During execution of an implicit CONNECT, the user entries or the database name could not be found.

User Action:

Open an XUSER file, or enter the CONNECT parameters using runtime options.


-712: Too many parameters, SQLMAX too small (SAP Library - SAP DB)

 Entering content frame

-712: Too many parameters, SQLMAX too small

Explanation:

In an SQLDA area, an SQLVAR entry was accessed which is no longer available (maximum number of SQLVAR entries < index of the SQLVAR entry).

User Action:

Update the maximum number of SQLVAR elements or correct the index.


-715: Missing username or password for connect (SAP Library - SAP DB)

 Entering content frame

-715: Missing username or password for connect

Explanation:

A username or password specification is missing in a CONNECT statement, or there is no XUSER file for an implicit CONNECT.

User Action:

Enter the user name and password for the CONNECT statement via Options, or open an XUSER file.


-719: Unknown LOCALSYSUSER.SYSPROFILE table (SAP Library - SAP DB)

 Entering content frame

-719: Unknown LOCALSYSUSER.SYSPROFILE table

Explanation:

When enabling the PROFILE option, no SYSPROFILE table could be found.

User Action:

The LOCALSYSUSER must create this table, or the application program must be started without the PROFILE option.


-720: SQLCODE <no> comes from SYSPROFILE command (SAP Library - SAP DB)

 Entering content frame

-720: SQLCODE <no> comes from SYSPROFILE command

Explanation:

The database error <no> occurred when writing the SYSPROFILE.

User Action:

For error analysis and correction refer to the instructions given under the corresponding number.

The application program may also be started without the PROFILE option.


-721: Macro not initiated, no SQLCHECK (SAP Library - SAP DB)

 Entering content frame

-721: Macro not initiated, no SQLCHECK

Explanation:

No SET MACRO was performed. Therefore the SQL statement cannot be checked.

User Action:

Ensure that SET MACRO is performed before the SQL statement within the program flow.


-724: Duplicate substructure name (SAP Library - SAP DB)

 Entering content frame

-724: Duplicate substructure name

Explanation:

The name specified for the search for an SQL variable is not unique, because it identifies a substructure.

User Action:

Specify the name of the complete structure with the SQL variable.


-729: Source code may be truncated (SAP Library - SAP DB)

 Entering content frame

-729: Source code may be truncated

Explanation:

The precompiler only recognizes text that is placed within the line delimiters. The line delimiters depend on the programming language. The warning means that text outside the line delimiters was discovered. This text is ignored by the precompiler.

User Action:

If this effect is desired, the warning may be ignored. Otherwise, the text must be written to the next line or the line delimiters must be modified.


-730: Nested comment not closed (SAP Library - SAP DB)

 Entering content frame

-730: Nested comment not closed

Explanation:

Nested comments are not regularly closed in the source program.

User Action:

The number of opening commentary symbols must equal the number of closing commentary symbols.


-731: Component name too (SAP Library - SAP DB)

 Entering content frame

-731: Component name too

Explanation:

Structure names become longer than 18 bytes by expansion.

User Action:

Shorten the structure names in the table definition. If this is not possible, specify the column names separately.


-732: Index of component out of (SAP Library - SAP DB)

 Entering content frame

-732: Index of component out of

Explanation:

The specified index is not in the range of values of the array.

User Action:

Specify an index which is within the range of values.


-733: Variable is declared as a pointer (SAP Library - SAP DB)

 Entering content frame

-733: Variable is declared as a pointer

Explanation:

The SQL variable was defined as a pointer in the DECLARE SECTION.

User Action:

As no fixed size is specified for a pointer, the name of the variable and COLLENGTH are indicated in the next error line. COLLENGTH is the maximum size of the SQL pointer variables. This size is needed for data conversion.


-734: Pointer variable not allowed here (SAP Library - SAP DB)

 Entering content frame

-734: Pointer variable not allowed here

Explanation:

SQL variables defined as pointers are not allowed in Long columns because the maximum length of these variables is not known.

User Action:

Specify the SQL variable as a CHARACTER ARRAY.


-735: No syntax check for CONNECT command (SAP Library - SAP DB)

 Entering content frame

-735: No syntax check for CONNECT command

Explanation:

CONNECT statements that are not used to establish the connection for the check run are not checked for syntax errors during precompilation.

User Action:

Pay special attention to the correct spelling when entering the statement.


-740: Array size mismatch (SAP Library - SAP DB)

 Entering content frame

-740: Array size mismatch

Explanation:

In mass statements the parameters have different sizes.

User Action:

The smallest size of all the parameters is set. If this is not desired, set all the sizes to the same value.


-743: Input string too long (SAP Library - SAP DB)

 Entering content frame

-743: Input string too long

Explanation:

The contents of a character string are longer than the database is capable of storing.

In ANSI mode, the error message TRUNCATED is output for floating point numbers which were truncated.

User Action:

Set the input variable to a string which corresponds to the length of the database variable or adapt the input variable to the format used in the database.

In ANSI mode, change either the variable values or the external data type.


-750: FFETCH or ARRAY-FETCH and FETCH mix not allo (SAP Library - SAP DB)

 Entering content frame

-750: FFETCH or ARRAY-FETCH and FETCH mix not allowed

Explanation:

ARRAY FETCH and FETCH statements cannot be issued on the same result set.

User Action:

All statements which refer to the same result set must be specified either as ARRAY FETCH or FETCH.


-751: Numeric input parameter overflow (SAP Library - SAP DB)

 Entering content frame

-751: Numeric input parameter overflow

Explanation:

The numeric input value is too large for the database.

User Action:

Check the size of the input value and of the range of values valid for the database and modify them, if necessary.


-752: Session already connected (SAP Library - SAP DB)

 Entering content frame

-752: Session already connected

Explanation:

A database session has already been opened with this number.

User Action:

Either close the previous database session or remove the CONNECT from the application program.


-753: Output parameter with CONST type (SAP Library - SAP DB)

 Entering content frame

-753: Output parameter with CONST type

Explanation:

An output parameter must not be declared as CONST type in C.

User Action:

Declare another parameter in the application program.


-756: Different SQLMODEs not allowed (SAP Library - SAP DB)

 Entering content frame

-756: Different SQLMODEs not allowed

Explanation:

An application program may only run in one SQLMODE.

User Action:

Change the CONNECT statement. Implicit CONNECTs only function in INTERNAL mode. The specifications made in the XUSER file are not applied in this case.


-758: Include file exists on disk (SAP Library - SAP DB)

 Entering content frame

-758: Include file exists on disk

Explanation:

The DECLARE SECTION is not generated during the precompiler run. The file is already available.

User Action:

Check whether the used file is the current one.


-759: Include file produced by user (SAP Library - SAP DB)

 Entering content frame

-759: Include file produced by user

Explanation:

During the precompiler run, the DECLARE SECTION is newly created by a CONNECT of the user <user>.

User Action:

Check whether the table of this user is the correct one.


-760: Memory allocation failed (SAP Library - SAP DB)

 Entering content frame

-760: Memory allocation failed

Explanation:

The available main memory is too small or write-protected.

User Action:

Check the program for a possible programming error. Increase the main memory or contact your local support organization.


-762: EXEC ORACLE command has been deleted (SAP Library - SAP DB)

 Entering content frame

-762: EXEC ORACLE command has been deleted

Explanation:

The precompiler removes all statements that are preceded by EXEC ORACLE.

User Action:

This is a warning which may provide indications to possible compiler errors.


-763: Variable not allowed as ARRAY (SAP Library - SAP DB)

 Entering content frame

-763: Variable not allowed as ARRAY

Explanation:

Scalar host variables are used in an ARRAY statement.

User Action:

Instead of scalar variables, use arrays only; otherwise do without the ARRAY statement.


-767: Unterminated C string (SAP Library - SAP DB)

 Entering content frame

-767: Unterminated C string

Explanation:

The zero byte delimiter is missing.

User Action:

Insert a zero byte.


-768: Invalid escape value (SAP Library - SAP DB)

 Entering content frame

-768: Invalid escape value

Explanation:

The input host variable is longer than one character.

User Action:

Use a correct host variable.


-769: Pointer component not allowed (SAP Library - SAP DB)

 Entering content frame

-769: Pointer component not allowed

Explanation:

Pointers are not allowed within structures.

User Action:

Do not specify components as pointers.


-770: Macro in FETCH set SQLOPT="-B 0" (SAP Library - SAP DB)

 Entering content frame

-770: Macro in FETCH set SQLOPT="-B 0"

Explanation:

FETCH statements are executed as array statements, whenever possible. If macros are used in the FETCH statement, errors may occur and records be lost.

User Action:

When using macros within FETCH statements, set the runtime option MFETCH(0). This option prevents FETCH statements from being executed as array statements.


-771: LONG column exists in table definition (SAP Library - SAP DB)

 Entering content frame

-771: LONG column exists in table definition

Explanation:

The table from which the host variables are generated contains a Long column.

User Action:

The user can change the host variable generated for this column.


-772: Multibyte char set not allowed (SAP Library - SAP DB)

 Entering content frame

-772: Multibyte char set not allowed

Explanation:

The CONNECT statement received an unknown multibyte specification.

User action:

Correct the CONNECT statement. Please see the reference manual for more information.


-773: Datafile open error (SAP Library - SAP DB)

 Entering content frame

-773: Datafile open error

Explanation:

An error occurred when opening a datafile for the processing of Long columns.

User Action:

Look up in the trace file *.pct in which column the error occurred. Then check the datafile.


-774: Datafile write error (SAP Library - SAP DB)

 Entering content frame

-774: Datafile write error

Explanation:

An error occurred when writing a datafile for the processing of Long columns.

User Action:

Look up in the trace file *.pct in which column the error occurred. Then check the datafile.


-775: Datafile read error (SAP Library - SAP DB)

 Entering content frame

-775: Datafile read error

Explanation:

An error occurred when reading a datafile for the processing of Long columns.

User Action:

Look up in the trace file *.pct in which column the error occurred. Then check the datafile.


-776: Datafile close error (SAP Library - SAP DB)

 Entering content frame

-776: Datafile close error

Explanation:

An error occurred when closing a datafile for the processing of Long columns.

User Action:

Look up in the trace file *.pct in which column the error occurred. Then check the datafile.


-777: Conversion from UNICODE impossible (SAP Library - SAP DB)

 Entering content frame

-777: Conversion from UNICODE impossible

Explanation:

An error occurred when converting Unicode data into char data.

User action:

Check whether a conversion such as this is really needed. You may have to change the declaration of the host variables for the char data.


-778: Conversion to UNICODE impossible (SAP Library - SAP DB)

 Entering content frame

-778: Conversion to UNICODE impossible

Explanation:

An error occurred when converting char data into Unicode data.

User action:

Check whether a conversion such as this is really needed. You may have to change the declaration of the host variables for the char data.


-801: Input parameter cannot be NULL value (SAP Library - SAP DB)

 Entering content frame

-801: Input parameter cannot be NULL value

Explanation:

The value of an input parameter must not be a null value because null values are not permitted in the column.

User Action:

Modify the program or change the column definition in the CREATE TABLE statement.


-802: Invalid numeric input parameter value (SAP Library - SAP DB)

 Entering content frame

-802: Invalid numeric input parameter value

Explanation:

The input value cannot be converted.

User Action:

Specify the value in a valid notation (see the Precompiler manuals).


-804: Parameter list too long (SAP Library - SAP DB)

 Entering content frame

-804: Parameter list too long

Explanation:

More parameters have been specified in a statement than are permitted in the pertinent EXECUTE statement.

User Action:

Modify the number of parameters in such a way that it corresponds to the specifications made in the column list.


-805: Program must be precompiled (SAP Library - SAP DB)

 Entering content frame

-805: Program must be precompiled

Explanation:

The common type definitions of the precompiler runtime system or of the include files no longer correspond to the precompiler types.

User Action:

Check the release numbers of precompiler, precompiler runtime system, and include files and precompile again, if necessary.


-806: DB session number not allowed (SAP Library - SAP DB)

 Entering content frame

-806: DB session number not allowed

Explanation:

The specified database session number is invalid.

User Action:

Insert a database session number between 1 and 8 into the application program.


-807: Connection down, session released (SAP Library - SAP DB)

 Entering content frame

-807: Connection down, session released

Explanation:

All database connections were closed with RELEASE.

User Action:

Establish a new connection using CONNECT.


-808: Not yet implemented (SAP Library - SAP DB)

 Entering content frame

-808: Not yet implemented

Explanation:

The function has not yet been implemented.

User Action:

Please consult the release information.


-809: Missing indicator variable, output parameter (SAP Library - SAP DB)

 Entering content frame

-809: Missing indicator variable, output parameter with NULL value

Explanation:

The indicator variable required for returning the NULL value to the SQL variable is missing.

User Action:

Specify the indicator variable with the parameter.


-811: Numeric output parameter overflow (SAP Library - SAP DB)

 Entering content frame

-811: Numeric output parameter overflow

Explanation:

An database value is too large for the SQL variable or the parameter.

User Action:

Enlarge the value range for the SQL variable or parameter.


-812: Parameter list too short (SAP Library - SAP DB)

 Entering content frame

-812: Parameter list too short

Explanation:

Fewer parameters have been specified in a statement than are needed in the pertinent EXECUTE statement.

User Action:

Modify the number of parameters in such a way that it corresponds to the specifications made in the column list.


-813: SERVERDB must be restarted (SAP Library - SAP DB)

 Entering content frame

-813: SERVERDB must be restarted

Explanation:

The database system is not running, or an invalid database name was specified in the program.

User Action:

The DB administrator must start the database, or the user must modify the program or XUSER file.


-814: Trace file close error (SAP Library - SAP DB)

 Entering content frame

-814: Trace file close error

Explanation:

The trace file could not be closed. The error in the program was ignored.

User Action:

Modify the file attributes (characteristics). For the exact error description, see the file appldiag .


-815: Trace file open error (SAP Library - SAP DB)

 Entering content frame

-815: Trace file open error

Explanation:

The trace file could not be opened. Writing of the trace file was disabled. The statement in which the error occurred was not executed.

User Action:

Check the file attributes and change them, if necessary. For the exact error description, see the file appldiag .


-816: Trace file write error (SAP Library - SAP DB)

 Entering content frame

-816: Trace file write error

Explanation:

An error occurred when writing into the trace file. Writing of the trace file was cancelled. The statement in which the error occurred was not executed.

User Action:

Check the file attributes and change them, if necessary. For the exact error description, see the file appldiag .


-817: Incompatible data types (SAP Library - SAP DB)

 Entering content frame

-817: Incompatible data types

Explanation:

The data type of the SQL variable or parameter is not compatible with the database data type.

User Action:

Change the data type of the SQL variable or parameter to match the data type of the database table column.

If this message is returned during precompilation and the data types are compatible, precompile with NOCHECK option (see the Precompiler manuals).


-818: Missing macro parameter initialization (SAP Library - SAP DB)

 Entering content frame

-818: Missing macro parameter initialization

Explanation:

The macro was not initialized.

User Action:

Insert the SQL statement SET MACRO into the application program.


-819: Paramter in SQL statement not allowed (SAP Library - SAP DB)

 Entering content frame

-819: Paramter in SQL statement not allowed

Explanation:

Only an SQL statement without parameter specifications is permitted. Either an SQL statement with parameters but without a USING part was passed with an EXECUTE, or an error occurred in the parameter list.

User Action:

Add the USING clause, or use an SQL statement without parameters, or correct the parameter list.


-820: Invalid declare statement (SAP Library - SAP DB)

 Entering content frame

-820: Invalid declare statement

Explanation:

The keyword FOR was not found in the DECLARE CURSOR statement.

User Action:

Insert the keyword FOR into the DECLARE CURSOR statement.


-822: Invalid constant definition (SAP Library - SAP DB)

 Entering content frame

-822: Invalid constant definition

Explanation:

The constant definition is invalid.

User Action:

Correct the constant definition within the DECLARE SECTION.


-823: Integer too large, greater than 32767 (SAP Library - SAP DB)

 Entering content frame

-823: Integer too large, greater than 32767

Explanation:

The constant must not be greater than 32767 (two bytes).

User Action:

Choose a smaller constant value.


-824: Statement in conflict with COMPATIBLE option (SAP Library - SAP DB)

 Entering content frame

-824: Statement in conflict with COMPATIBLE option

Explanation:

The option COMPATIBLE is set, and an SQL array statement was specified with the keyword FOR. The option COMPATIBLE was used in conjunction with array statements. Array statements are only supported from Release 3.1 onwards.

User Action:

Remove the COMPATIBLE option or change the array statement.


-825: Duplicate field name in record (SAP Library - SAP DB)

 Entering content frame

-825: Duplicate field name in record

Explanation:

A name is used twice in an SQL record definition to specify components.

User Action:

Rename one of the record components.


-826: Duplicate statement name (SAP Library - SAP DB)

 Entering content frame

-826: Duplicate statement name

Explanation:

The name was already specified for a statement.

User Action:

Rename the statement.


-827: Duplicate type definition (SAP Library - SAP DB)

 Entering content frame

-827: Duplicate type definition

Explanation:

The name was already specified for an SQL type definition.

User Action:

Rename the SQL type.


-828: Duplicate variable name (SAP Library - SAP DB)

 Entering content frame

-828: Duplicate variable name

Explanation:

The name was already specified for an SQL variable.

User Action:

Rename the SQL variable.


-829: File close error (SAP Library - SAP DB)

 Entering content frame

-829: File close error

Explanation:

An error occurred when closing a file. This is a device failure or system error.

User Action:

Try again to close the file. For the exact error description, see the file appldiag .


-830: File open error (SAP Library - SAP DB)

 Entering content frame

-830: File open error

Explanation:

A file could not be opened.

User Action:

Check whether the file is available or the spelling of the filename is correct. For the exact error description, see the file appldiag .


-831: File read error (SAP Library - SAP DB)

 Entering content frame

-831: File read error

Explanation:

A file could not be read. This may be a device failure.

User Action:

Check whether the file is available or the spelling of the filename is correct. For the exact error description, see the file appldiag .


-832: File write error (SAP Library - SAP DB)

 Entering content frame

-832: File write error

Explanation:

A file could not be written. This may be a device failure.

User Action:

Check whether the file is available or the spelling of the filename is correct. For the exact error description, see the file appldiag .


-833: Illegal INCLUDE position (SAP Library - SAP DB)

 Entering content frame

-833: Illegal INCLUDE position

Explanation:

An INCLUDE statement is not at the correct position in the module.

User Action:

Place the INCLUDE statement in the correct position.


-834: INCLUDEs must not be nested (SAP Library - SAP DB)

 Entering content frame

-834: INCLUDEs must not be nested

Explanation:

Another INCLUDE statement was found within an INCLUDE file.

User Action:

Remove the inner INCLUDE statement.


-835: INCLUDE file open error (SAP Library - SAP DB)

 Entering content frame

-835: INCLUDE file open error

Explanation:

The INCLUDE file could not be opened.

User Action:

Check whether the file is available or the spelling of the filename is correct. For the exact error description, see the file appldiag .


-836: Invalid C preprocessor command (SAP Library - SAP DB)

 Entering content frame

-836: Invalid C preprocessor command

Explanation:

The C preprocessor command line is incorrect.

User Action:

Correct the command in accordance with the C rules.


-837: Data definition not allowed (SAP Library - SAP DB)

 Entering content frame

-837: Data definition not allowed

Explanation:

The syntax of the SQL data type is incorrect or the SQL data type is invalid.

User Action:

Correct the data definition or construct a valid alternative.


-838: Invalid declarator (SAP Library - SAP DB)

 Entering content frame

-838: Invalid declarator

Explanation:

The declarator is invalid.

User Action:

Correct the declarator within the DECLARE SECTION.


-839: Invalid macro value (SAP Library - SAP DB)

 Entering content frame

-839: Invalid macro value

Explanation:

An error occurred when substituting the macro.

User Action:

Specify the macro value in accordance with the syntax.


-840: Invalid numeric macro value (SAP Library - SAP DB)

 Entering content frame

-840: Invalid numeric macro value

Explanation:

The macro number is invalid.

User Action:

Specify a number between 1 and 128 for the macro.


-841: Invalid precompiler option (SAP Library - SAP DB)

 Entering content frame

-841: Invalid precompiler option

Explanation:

A precompiler option is invalid or unknown.

User Action:

For the exact error description, see the precompiler listing or the SQLERROR file. Check the options and specify them correctly.


-842: Parameter and indicator do not match (SAP Library - SAP DB)

 Entering content frame

-842: Parameter and indicator do not match

Explanation:

Parameters and indicators are defined with different types ( Record - Scalar ). Valid combinations of SQL variables and indicator variables are Record - Record , Record - Integerarray and Scalar - Scalar .

User Action:

Use indicator variables which have another type.


-843: Invalid parameter name (SAP Library - SAP DB)

 Entering content frame

-843: Invalid parameter name

Explanation:

The parameter name is not an identifier.

User Action:

Correct the name in accordance with the notation of identifiers.


-844: Invalid record name (SAP Library - SAP DB)

 Entering content frame

-844: Invalid record name

Explanation:

The record name is invalid or unknown.

User Action:

Declare a record or use another SQL variable.


-845: Invalid SQL statement (SAP Library - SAP DB)

 Entering content frame

-845: Invalid SQL statement

Explanation:

The SQL statement is invalid or unknown.

User Action:

Correct the SQL statement or use another SQL statement.


-846: Invalid statement in section (SAP Library - SAP DB)

 Entering content frame

-846: Invalid statement in section

Explanation:

A statement in the section is invalid.

User Action:

Correct the statement or use another SQL statement.


-847: Invalid type definition (SAP Library - SAP DB)

 Entering content frame

-847: Invalid type definition

Explanation:

The type definition or clause is invalid or not allowed.

User Action:

Correct the definition or clause, or remove it from the DECLARE SECTION.


-848: Invalid unsigned integer (SAP Library - SAP DB)

 Entering content frame

-848: Invalid unsigned integer

Explanation:

An unsigned integer was expected but not found.

User Action:

Correct the SQL statement.


-849: Invalid data definition (SAP Library - SAP DB)

 Entering content frame

-849: Invalid data definition

Explanation:

The SQL variable or data definition is invalid or not allowed. The variable definition is not known as an SQL variable.

User Action:

Declare the SQL variable name or the data in the DECLARE SECTION, or correct the name or data.


-850: Statement termination expected (SAP Library - SAP DB)

 Entering content frame

-850: Statement termination expected

Explanation:

The termination symbol is missing in the preceding SQL statement. It is set by the precompiler.

User Action:

If there are no side effects, insert the termination symbol into the statement.


-851: Missing input file name (SAP Library - SAP DB)

 Entering content frame

-851: Missing input file name

Explanation:

A name specified for an INCLUDE file is unknown.

User Action:

Check whether the file is available or the spelling of the filename is correct.


-852: Missing program file (SAP Library - SAP DB)

 Entering content frame

-852: Missing program file

Explanation:

The source file is unknown.

User Action:

Check whether the file is available or the spelling of the filename is correct.


-853: Precompiler syntax check only (SAP Library - SAP DB)

 Entering content frame

-853: Precompiler syntax check only

Explanation:

Although the option CHECK was specified, the syntax of this statement could only be checked for the precompiler run. No entries were made to the data dictionary of the database.

User Action:

To obtain information about possible errors, run the application with the TRACE option.


-854: Parameters must be question marks (SAP Library - SAP DB)

 Entering content frame

-854: Parameters must be question marks

Explanation:

In PREPARE statements, only question marks are allowed for parameter specifications.

User Action:

Replace the SQL variable with a question mark.


-855: SQL variable must be an array (SAP Library - SAP DB)

 Entering content frame

-855: SQL variable must be an array

Explanation:

SQL variables must be array structures in an SQL array statement.

User Action:

Define and specify the SQL variable correctly.


-856: Invalid loop parameter value (SAP Library - SAP DB)

 Entering content frame

-856: Invalid loop parameter value

Explanation:

In an SQL array statement, the value of the <LOOP PARAMETER> is set to <= 0.

User Action:

Set the <LOOP PARAMETER> to a value > 0.


-857: Missing SERVERDB (SAP Library - SAP DB)

 Entering content frame

-857: Missing SERVERDB

Explanation:

No SET SERVERDB statement was issued for the second or any following database connection.

User Action:

Specify SET SERVERDB before the CONNECT statement or in the XUSER file.


-858: Storage class not allowed (SAP Library - SAP DB)

 Entering content frame

-858: Storage class not allowed

Explanation:

The C storage class is not allowed.

User Action:

Choose another storage class.


-859: Number of columns < number of parameters (SAP Library - SAP DB)

 Entering content frame

-859: Number of columns < number of parameters

Explanation:

More SQL variables are specified in the statement than columns are available in the table.

User Action:

If this is not desired, add columns to the table or reduce the number of SQL variables.


-860: Too many constants declared (SAP Library - SAP DB)

 Entering content frame

-860: Too many constants declared

Explanation:

Too many SQL constants are declared.

User Action:

The database application should be modularized. The maximum number of constants is 100.


-870: Too many type definitions (SAP Library - SAP DB)

 Entering content frame

-870: Too many type definitions

Explanation

The number of type definitions is too great.

User Action

Break down the SQL statements into several modules or reduce the number of type definitions. The maximum number is 500.


-871: Too many variable definitions (SAP Library - SAP DB)

 Entering content frame

-871: Too many variable definitions

Explanation

The number of SQL variable definitions is too great.

User Action

Break down the SQL statements into several modules or reduce the number of SQL variable declarations. The maximum number is 10000.


-872: Number of columns > number of parameters (SAP Library - SAP DB)

 Entering content frame

-872: Number of columns > number of parameters

Explanation

Fewer SQL variables were specified in the statement than columns existed in the table.

User Action

If this is not desired, either add SQL variables or reduce the number of columns in the table.


-873: Unknown constant name (SAP Library - SAP DB)

 Entering content frame

-873: Unknown constant name

Explanation

The name of the constant is not known.

User Action

Correct or declare the name.


-874: Unknown cursor name (SAP Library - SAP DB)

 Entering content frame

-874: Unknown cursor name

Explanation

The name of the cursor is not known.

User Action

Correct the name or define a cursor.


-876: Unknown macro number (SAP Library - SAP DB)

 Entering content frame

-876: Unknown macro number

Explanation

The macro number is not known. The SET MACRO statement was not executed for the specified macro number.

User Action

Enter the correct number or define an appropriate macro.


-877: Unknown parameter name (SAP Library - SAP DB)

 Entering content frame

-877: Unknown parameter name

Explanation

The name of the parameter is not known.

User Action

Correct the name or declare an indicator.


-878: Unknown record name (SAP Library - SAP DB)

 Entering content frame

-878: Unknown record name

Explanation

The name of the record is not known.

User Action

Correct the name or declare a record.


-879: Unknown precompiler statement (SAP Library - SAP DB)

 Entering content frame

-879: Unknown precompiler statement

Explanation

The precompiler statement is unknown or incorrect.

User Action

Ignore the precompiler statement or correct it.


-880: Unknown statement name (SAP Library - SAP DB)

 Entering content frame

-880: Unknown statement name

Explanation

The name of the statement is not known.

User Action

Ignore the PREPARE statement or correct it.


-881: Unknown type name (SAP Library - SAP DB)

 Entering content frame

-881: Unknown type name

Explanation

The type definition is not known.

User Action

Correct the type name or define a type.


-882: Missing user name for connect (SAP Library - SAP DB)

 Entering content frame

-882: Missing user name for connect

Explanation

No user/password combination was found for an implicit CONNECT initiated by the CHECK option.

User Action

Write a static CONNECT statement as the first SQL statement in the program, apply the USER option or create an XUSER file for an implicit CONNECT.


-883: Invalid runtime options (SAP Library - SAP DB)

 Entering content frame

-883: Invalid runtime options

Explanation

The precompiler or runtime options are incorrect.

User Action

Correct the options.


-884: Missing indicator variable (SAP Library - SAP DB)

 Entering content frame

-884: Missing indicator variable

Explanation

The database system permits null values for the variable. For this it requires an indicator variable.

User Action

In addition to the SQL variable you must specify an indicator variable. This specification is not necessary when it is ensured that null values will not occur.


-885: Variable may be truncated (SAP Library - SAP DB)

 Entering content frame

-885: Variable may be truncated

Explanation

The range of values for the database column is smaller than that of the SQL variables. When the value is inserted into the column or when values are compared, the value of the SQL variables may be truncated and consequently be incorrect.

User Action

If this is not desired, you must change the format of the column or SQL variables.


-886: DECLARE SECTION BEGIN or END missing (SAP Library - SAP DB)

 Entering content frame

-886: DECLARE SECTION BEGIN or END missing

Explanation

The DECLARE SECTION has an incorrect delimiter statement.

User Action

Every DECLARE SECTION must be enclosed in BEGIN DECLARE SECTION and END DECLARE SECTION.


-887: Too long WHENEVER action (SAP Library - SAP DB)

 Entering content frame

-887: Too long WHENEVER action

Explanation

A maximum of 50 bytes are available to define the WHENEVER action.

User Action

Reduce the number of characters, e.g. by shortening the names.


-889: Input line longer than 512 characters (SAP Library - SAP DB)

 Entering content frame

-889: Input line longer than 512 characters

Explanation:

A line of a precompiler input file must not exceed 512 characters.

User Action:

Shorten the line concerned.


-890: Input line longer than right margin (SAP Library - SAP DB)

 Entering content frame

-890: Input line longer than right margin

Explanation:

A line of the source file is longer than the right margin.

User Action:

If allowed, adjust the right margin using the option MARGINS. Otherwise shorten the line.


-892: Variable may be overflow (SAP Library - SAP DB)

 Entering content frame

-892: Variable may be overflow

Explanation:

This warning is set if a numeric value greater than allowed by the column definition can be transferred to a table. At runtime, the error -751 can be returned; i.e. the SQL statement will not be executed then.

User action:

To avoid error -751 check the size of the value before transferring it into the table.

The handling of this error must be programmed.


-893: Too many hostvariables (SAP Library - SAP DB)

 Entering content frame

-893: Too many hostvariables

Explanation:

  1. Too many parameters are specified in an SQL statement with descriptor.
  2. In an SQLDA area, an SQLVAR entry was accessed which is no longer available (maximum number of SQLVAR entries < index of the SQLVAR entry).

User Action:

Reduce the number of parameters in the SQL statement to 300 or less.


-894: Trace parameter structure not allowed (SAP Library - SAP DB)

 Entering content frame

-894: Trace parameter structure not allowed

Explanation:

There is a syntax error in SET TRACE LINE.

User Action:

Correct the SET TRACE LINE statement.


-895: Whole table my be deleted or updated (SAP Library - SAP DB)

 Entering content frame

-895: Whole table my be deleted or updated

Explanation:

Precompiler warning that all entries of the table will be deleted or updated.

User Action:

Check whether this is the desired effect. Otherwise, insert a WHERE clause into the statement.


-899: Error unknown (SAP Library - SAP DB)

 Entering content frame

-899: Error unknown

Explanation:

An unknown error has occurred.

User Action:

Contact your local support organization.


From -900 to -999 (SAP Library - SAP DB)

 Entering content frame

From -900 to -999

Database Kernel Error Messages

-900 | Data area full
-901 | Log full
-902 | I/O error
-903 | Hostfile I/O error
-904 | Space for result tables exhausted
-907 | Space for user session exhausted
-910 | COSTLIMIT for this user exhausted
-911 | Work rolled back
-913 | Lock request timeout
-914 | New volume not accessible
-915 | No more memory
-917 | Save/Restore write process crash - I/O error
-918 | Stack overflow
-942 | Unknown table name
-955 | Duplicate name


-900: Data area full (SAP Library - SAP DB)

 Entering content frame

-900: Data area full

Explanation:

The data devspace of the server DB is full.

User Action:

You must increase the server DB by assigning it additional volumes. The SQL statements started beforehand will be finished afterwards.


-901: Log full (SAP Library - SAP DB)

 Entering content frame

-901: Log full

Explanation:

The log area is full. The following reasons are possible:

  1. The log area is not backed up continuously. The database administration tool makes modifications which together with modifications of other transactions result in a log devspace overflow.
  2. The log area is backed up continuously, but the backups are not performed fast enough or there is a very long transaction whose modifications together with the modifications of transactions running in parallel result in a log area overflow. The database administration tool performs modifications.

The issued SQL statement fails.

User Action:

  1. Save the log.

    2. Save the log area using the database administration tool.

    Repeat the SQL statement.

  2. The database system saves the log area needed by the very long transaction in other database area. The command can then be repeated.

Check whether this state occurs frequently, that is whether the log area is too small for the number of users and average transaction length. In this case you should enlarge the log area using the database administration tool.

You should also check whether there is an error in the application programming which results in the very long or endless transaction and correct this if necessary.


-902: I/O error (SAP Library - SAP DB)

 Entering content frame

-902: I/O error

Explanation:

During the processing of an SQL statement a read or write operation had to be performed on the data devspace or log devspace. This operation could not be executed successfully. The following reasons are possible:

  1. A SHUTDOWN was performed in the meantime.
  2. A disk is defective.

User Action:

In some cases, the error message contains an additional description of the error which must be interpreted according to the operating system being used.

  1. Use the database administration tool to start the database.
  2. Once the disk error has been corrected, the serverdb must be restored (add backup copies and start up log information).


-903: Host file I/O error (SAP Library - SAP DB)

 Entering content frame

-903: Host file I/O error

Explanation:

An error occurred while operating a command file or host file or a backup device.

User Action:

The error message contains an additional error description which must be interpreted according to the operating system being used.

To find out and remove the error cause, consult the documentation on the operating system.

Check whether a typing error or the specification of a directory instead of a file could have caused the error.


-904: Space for result tables exhausted (SAP Library - SAP DB)

 Entering content frame

-904: Space for result tables exhausted

Explanation:

The following reasons are possible:

  1. The storage space available for result tables is too small or
  2. The database application generated too much temporary information.

In both cases, the execution of the SQL statement was terminated and the user was disconnected from the database by an implicit <RELEASE statement> in the format ROLLBACK WORK RELEASE.

User Action:

  1. Reissue the SQL statement after a new CONNECT statement. At this time another user may have defined fewer result tables or generated less temporary information.
  2. A larger disk space can be defined using the database administration tool.
  3. To make space, tables can be extracted using the <TABLEEXTRACT statement>.


-907: Space for user session exhausted (SAP Library - SAP DB)

 Entering content frame

-907: Space for user session exhausted

Explanation:

You have not been connected to the database system, because there is not sufficient free temporary disk space for the CONNECT of a normal database session.

User Action:

  1. You can connect soon as another user has disconnected, or when deletion of other users’ result tables frees up sufficient storage space again.
  2. With the database administration tool you can connect to the database system and reconfigure the serverdb.


-910: COSTLIMIT for this user exhausted (SAP Library - SAP DB)

 Entering content frame

-910: COSTLIMIT for this user exhausted

Explanation:

Execution of the SQL statement would exceed the permissible maximum limit for the processing of the SQL statement (COSTLIMIT value of the user) because of the necessary selection of rows. The COSTLIMIT value is defined in the <CREATE USER>, <CREATE USERGROUP>, <ALTER USER> or <ALTER USERGROUP statement>.

User Action:

You should check whether the SQL statement is needed in the specified format. You should check whether for example the set of data to be processed could be decreased by specifying more conditions in the <SEARCH CONDITION>; thus decreasing the costs.

Should this not be possible, try to achieve the effect of the SQL statement by several less costly SQL statements.

Display the definition of the COSTLIMIT value using a <QUERY statement> issued on the system table DOMAIN.USERS.

The database administrator who is owner of the usergroup or user may increase the COSTLIMIT value by using an <ALTER USER> or <ALTER USERGROUP statement>.


-911: Work rolled back (SAP Library - SAP DB)

 Entering content frame

-911: Work rolled back

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The following reasons are possible:

  1. You failed to carry out any database operations within a certain period of time (installation parameter LOCK_TIMEOUT) but held locks which other users were waiting for, or because
  2. The serverdb was in a deadlock situation.

Deadlock situation: This is a situation in which two or more users hold locks and request further locks that are held by the other users. In the simplest case of two users, one user holds one lock at least and requests another lock. But this lock is held by another user who is himself waiting for the lock held by the first user. This situation can only be resolved if one of the users releases the lock already obtained.

User Action:

In some cases, the error message contains a more detailed description of the error.

In both cases, the lock requests must be checked and modified, if necessary. Repeat the last transaction.

It may also be necessary to check and modify the value of the LOCK_TIMEOUT installation parameter.


-913: Lock request timeout (SAP Library - SAP DB)

 Entering content frame

-913: Lock request timeout

Explanation:

The lock request or an implicit lock conflicts with the locks of another user. The maximum waiting time for granting the lock has elapsed (installation parameter REQUEST_TIMEOUT).

User Action:

In some cases, the error message contains a more detailed description of the error.

The lock request can be reissued. To avoid possible deadlock situations, it is advisable to roll back the transaction using the <ROLLBACK statement>.


-914: New volume not accessible (SAP Library - SAP DB)

 Entering content frame

-914: New volume not accessible

Explanation:

You tried to define an additional disk for the data devspace. However, you were unable to do so because there is no disk with the specified name and size which could be accessed.

User Action:

The error message contains an additional error description which must be interpreted according to the operating system being used.

Check the name and size of the disk as well as the installation. Repeat the command with changed specifications.


-915: No more memory (SAP Library - SAP DB)

 Entering content frame

-915: No more memory

Explanation:

  1. The available main memory is not sufficient to open a user session. The maximum main memory available is determined by the parameter CAT_CACHE_SUPPLY when installing the serverdb.
  2. The available main memory is not sufficient to execute the desired database procedure.

User Action:

  1. You can only open a session when at least one other user has terminated his session. A check should be made as to whether the value of the installation parameter CAT_CACHE_SUPPLY is large enough.
  2. Try to execute the database procedure at a later time.
  3. Check whether the installation parameter DBPROC_DATA_CACHE can be increased.


-917: Save/restore write process crash - I/O error (SAP Library - SAP DB)

 Entering content frame

-917: Save/restore write process crash - I/O error

Explanation:

  1. An I/O error occurred while attempting to write to a backup device for a save statement.
  2. An I/O error occurred while attempting to write to a volume for a restore statement.

The restore or save statement was cancelled.

User Action:

The error message contains an additional error description which must be interpreted according to the operating system being used.

To find out and remove the error cause, consult the documentation on the operating system.


-918: Stack overflow (SAP Library - SAP DB)

 Entering content frame

-918: Stack overflow

Explanation:

Nested calls of DB procedures, triggers or subqueries or very complicated VALUE EXPRESSION resulted in the maximum stack usage allowed for a task. Further nesting is not possible. The execution of the command was cancelled.

User Action:

  1. Further limit the nesting depth of the calls with suitable queries in the DB procedures and triggers.
  2. Try to limit the nesting depth by dividing the SQL statement into several substatements.


-942: Unknown table name (SAP Library - SAP DB)

 Entering content frame

-942: Unknown table name

Explanation:

A table with the specified name is not known to you. This table may not exist; or this table exists but you have no privileges for it.

User Action:

Use a QUERY statement issued on the system table DOMAIN.TABLES to find out the names of the tables for which you have privileges. Then correct the table name. It may be sufficient to place the missing <OWNER> in front of it. If correction is not possible, create a table with this name. Check why you have no privileges for the existing table.


-955: Duplicate name (SAP Library - SAP DB)

 Entering content frame

-955: Duplicate name

Explanation:

There is already a data object with the specified name.

User Action:

Repeat the SQL statement with another name.


From -1000 to -1999 (SAP Library - SAP DB)

 Entering content frame

From -1000 to -1999

Database Kernel Error Messages

-1000 | Too many lock requests
-1001 | Too many lock objects specified
-1002 | Too many columns
-1003 | Too many buffers requested
-1004 | Too many correlated columns
-1005 | Too many monadic operators
-1006 | Too many variables
-1007 | Parameter list too long
-1008 | Too many or too few host variables for output
-1009 | Too many named indexes for this table
-1010 | Too many volumes
-1011 | Too many correlated tables
-1012 | Too many referential constraint definitions for this table
-1013 | Too many order columns
-1014 | Too many source tables
-1015 | Too many values
-1017 | Too many joins
-1023 | Too many nested subtransactions
-1025 | Too many asynchron requests
-1026 | Too many differences between old and new view definition
-1102 | Too complicated SQL statement (Too many Subqueries)
-1103 | Too complicated SQL statement
-1104 | Too complicated SQL statement (KB-stack overflow)
-1105 | Too complicated SQL statement (Too much data)
-1106 | Too complicated SQL statement (Too much strategy data)
-1107 | Too complicated SQL statement (Too many internal commands)
-1108 | Too complicated SQL statement (Correlated row too long)
-1110 | view definition Too long
-1111 | Too many savepoints
-1112 | Constraint too complicated
-1113 | Too many nested function calls
-1114 | Communication packet too small
-1115 | Too many intern columns
-1116 | Too long trigger parameters
-1117 | Too complicated trigger qualification
-1119 | Too many constraints for this table
-1120 | Too many statements in definition
-1200 | Too few values
-1201 | Too few columns
-1400 | Input parameter cannot be NULL value
-1402 | Integrity violation
-1403 | Row not found
-1405 | Missing indicator variable, output parameter
-1406 | Output value truncated
-1452 | Duplicate secondary key
-1556 | Data space full
-1755 | SQL statement will drop further objects (use CASCADE)


-1000: Too many lock requests (SAP Library - SAP DB)

 Entering content frame

-1000: Too many lock requests

Explanation:

There are too many locks or lock requests.

User Action:

You can try to repeat the SQL statement at a later time or cancel the transaction. Should this situation occur frequently, then the defined installation parameter MAXLOCKS is too small and should be increased.


-1001: Too many lock objects specified (SAP Library - SAP DB)

 Entering content frame

-1001: Too many lock objects specified

Explanation:

The LOCK statement or the option KEEP of a COMMIT statement or ROLLBACK statement contains too many tables or table rows to be locked.

User Action:

The SQL statement must be formulated using two successive LOCK statements.


-1002: Too many columns (SAP Library - SAP DB)

 Entering content frame

-1002: Too many columns

Explanation:

  1. The number of columns of a table that contains no (at least one) user-defined key column is limited to 254 (255).
  2. A named index can be created across a maximum of 16 columns of a table.
  3. In a REFERENTIAL CONSTRAINT definition more REFERENCING than REFERENCED COLUMNS were specified. The number of the specified columns in the referencing table must correspond to the number of the referenced columns of the REFERENCED TABLE specified implicitly or explicitly.

User Action:

  1. Use a QUERY-statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the table. You must not define any further columns.
  2. Correct the number of columns in the index definition.
  3. Use a QUERY-statement issued on the system table DOMAIN.COLUMNS to find out the complete definition and the key columns of the REFERENCED TABLE.


-1003: Too many buffers requested (SAP Library - SAP DB)

 Entering content frame

-1003: Too many buffers requested

Explanation:

The storage requirements of the buffers and areas defined by installation parameters are larger than the maximum virtual storage space available for the database system. The execution of the SQL statement was cancelled.

User Action:

Either decrease the size or number of buffers and areas (installation parameters) or increase the virtual storage space available to the database server. Restart the database.


-1004: Too many correlated columns (SAP Library - SAP DB)

 Entering content frame

-1004: Too many correlated columns

Explanation:

The SQL statement contains at least one correlated subquery. The attempt was made to use more than 64 correlated columns. At most 64 correlated columns can be used. Every single usage of a correlated column is counted.

User Action:

Rearrange the SQL statement in such a way that 64 correlated columns suffice. Alternatively you may want to try to achieve the effect of this SQL statement with several SQL statements.


-1005: Too many monadic operators (SAP Library - SAP DB)

 Entering content frame

-1005: Too many monadic operators

Explanation:

The issued SQL statement contains at least two monadic operators placed one after the other in an invalid manner.

User Action:

Correct the monadic operators in the SQL statement..


-1006: Too may variables (SAP Library - SAP DB)

 Entering content frame

-1006: Too many variables

Explanation:

A maximum of 2000 variables may be specified per SQL statement.

User Action:

Reduce the number of variables specified in the SQL statement. Some variables must be replaced with constant values. If this is not possible, split the SQL statement into several SQL statements.


-1007: Parameter list too long (SAP Library - SAP DB)

 Entering content frame

Background documentation -1007: Parameter list too long

Explanation:

More parameters have been specified in a statement than are permitted in the pertinent EXECUTE statement.

User Action:

Modify the number of parameters in such a way that it corresponds to the specifications made in the column list.


-1008: Too many or too few host variables for output (SAP Library - SAP DB)

 Entering content frame

Background documentation -1008: Too many or too few host variables for output

Explanation:

The SQL statement contains variables for selected columns.

The number of variables does not match the number of selected columns.

User Action:

Check the number and data types of the variables, and correct them.

In the SELECT statement, replace ‘*’ with a sequence of column names.


-1009: Too many named indexes for this table (SAP Library - SAP DB)

 Entering content frame

Background documentation -1009: Too many named indexes for this table

Explanation:

A maximum of 256 named indexes can be created for each table.

User Action:

Check whether you need this many indexes.

The amount of work needed to maintain indexes for change operations, and the amount of memory needed for the indexes, is usually out of proportion to the benefits.


-1010: Too many volumes (SAP Library - SAP DB)

 Entering content frame

-1010: Too many volumes

Explanation

The number of data volumes is limited during installation. This number was exceeded.

User action

Reduce the number of data volumes.

See also:

Technical Specifications for SAP DB Version 7.4


-1011: Too many correlated tables (SAP Library - SAP DB)

 Entering content frame

-1011: Too many correlated tables

Explanation:

The number of correlated tables used within the correlated subqueries must not exceed 16.

User Action:

Try to formulate the SQL statement in such a way that 16 correlated tables are sufficient. Should this not be possible you have to use several SQL statements to achieve the desired effect.


-1012: Too many referential constraint definitions for this tabl (SAP Library - SAP DB)

 Entering content frame

-1012: Too many referential constraint definitions for this table

Explanation:

Using the ALTER TABLE statement, the attempt was made to create more than 256 REFERENTIAL CONSTRAINT DEFINITIONS for a table that is the referencing table.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COL_REFS_COL to check the existing CONSTRAINT definitions. The ALTER TABLE statement can only be issued once an existing CONSTRAINT definition has been deleted. Otherwise, do without the new CONSTRAINT definition.


-1013: Too many order columns (SAP Library - SAP DB)

 Entering content frame

-1013: Too many order columns

Explanation:

The following causes of errors are possible:

  1. More than 16 columns were specified as sort criteria or group columns.
  2. The total length of the order or group columns exceeds 250 characters.
  3. The length of the longest result data type of a DISTINCT FUNCTION, together with the lengths of the group columns, exceeds 254 characters. The result data type is the data type which is assigned to the result of an EXPRESSION.

User Action:

Correct the SQL statement in such a way that you can do without one or more columns specified in the ORDER CLAUSE or GROUP CLAUSE respectively.


-1014: Too many source tables (SAP Library - SAP DB)

 Entering content frame

-1014: Too many source tables

Explanation:

The number of underlying tables of the FROM clause of the SQL statement exceeds 16. If a join view table was specified in the FROM clause, the number of base tables underlying the join view table is considered for the calculation.

User Action:

You can split the SQL statement into two successive SQL statements. It is also possible to bypass this restriction by using a QUERY EXPRESSION in the FROM clause.


-1015: Too many values (SAP Library - SAP DB)

 Entering content frame

-1015: Too many values

Explanation:

In case of an INSERT or UPDATE statement, the number of specified values exceeds the number of column names implicitly specified.

User Action:

Match the number of specified values in the SQL statement with the number of specified column names. Use a QUERY statement issued on the system table DOMAIN.COLUMNS for an INSERT statement without column name specification to determine the definition of the table used .


-1017: Too many joins (SAP Library - SAP DB)

 Entering content frame

-1017: Too many joins

Explanation:

The number of JOIN PREDICATES in a SEARCH CONDITION must not exceed 64.

User Action:

The expected result can be achieved by issuing several QUERY statements and creating the respective result tables as temporary results. It is also possible to change the SQL statement in such a way that temporary results are implicitly created when a QUERY EXPRESSION is used in a FROM clause.


-1023: Too many nested subtransactions (SAP Library - SAP DB)

 Entering content frame

-1023: Too many nested subtransactions

Explanation:

The maximum nesting level of subtransactions is 32767. This number was exceeded.

User Action:

Check which error in application programming generated such a nesting level of subtransactions and correct it.


-1025: Too many asynchron requests (SAP Library - SAP DB)

 Entering content frame

Background documentation -1025: Too many asynchron requests

Explanation

Your SQL statement will be executed asynchronously, but there are currently not enough resources available.

User action

Execute the SQL statement later.


-1026: Too many differences between old and new view definition (SAP Library - SAP DB)

 Entering content frame

-1026: Too many differences between old and new view definition

Explanation:

A CREATE VIEW statement was specified with the REPLACE option. A view table with the specified name already exists. The existing view definition differs so much from the specified view definition that the definitions depending on this view table can no longer be maintained in a consistent state. The CREATE VIEW therefore fails.

User Action:

Do not modify the specified view table or check which of the depending definitions, e.g., view tables, privileges, etc., do not match the new view definition. If there are some, delete them before re-executing the CREATE VIEW statement, and recreate them afterwards in an appropriate format.


-1102: Too complicated SQL statement (too many subqueries) (SAP Library - SAP DB)

 Entering content frame

-1102: Too complicated SQL statement (too many subqueries)

Explanation:

  1. The SQL statement contains too many subqueries. The number of permissible subqueries depends on the kind of SQL statement.
  2. Subqueries were specified in a TABLE EXPRESSION both in the WHERE clause and the HAVING clause of an SQL statement containing at least one corresponding subquery. This is not allowed.

User Action:

Simplify the SQL statement or split it into several SQL statements.


-1103: Too complicated SQL statement (SAP Library - SAP DB)

 Entering content frame

-1103: Too complicated SQL statement

Explanation:

The number of operations, functions, and conditions is too large.

User Action:

Simplify the SQL statement. You may also want to try to obtain the effect of the SQL statement with several SQL statements.


-1104: Too complicated SQL statement (KB-stack overflow) (SAP Library - SAP DB)

 Entering content frame

-1104: Too complicated SQL statement (KB-stack overflow)

Explanation:

Within the system, more elements of an internal structure are needed to represent the SQL statement than are available.

User Action:

Simplify the SQL statement or split it into several SQL statements. If this is not possible, check whether the installation parameter PACKET_SIZE can be increased, because the size of the internal structure depends on the size of that parameter. The structure size will be adapted from a certain limit value of PACKET_SIZE.


-1105: Too complicated SQL statement (too much data) (SAP Library - SAP DB)

 Entering content frame

-1105: Too complicated SQL statement (too much data)

Explanation:

Within the system, more space is needed to represent the data of the SQL statement than is available.

User Action:

Simplify the SQL statement or split it into several SQL statements. If this is not possible check whether the installation parameter PACKET_SIZE can be increased, because the amount of storage space available depends on that parameter. An increase in excess of 32 KB will not increase the amount of space any further.


-1106: Too complicated SQL statement (too much strategy data) (SAP Library - SAP DB)

 Entering content frame

Background documentation -1106: Too complicated SQL statement (too much strategy data)

Explanation

The search strategy used to process the SQL statement is greater than the space available.

User action

Delete some of the search strings containing an OR option.


-1107: Too complicated SQL statement (too many internal commands (SAP Library - SAP DB)

 Entering content frame

-1107: Too complicated SQL statement (too many internal commands)

Explanation:

The SQL statement is so complicated that more internal statements must be generated for it than can be administered for an SQL statement.

User Action:

Simplify the SQL statement or split it into several SQL statements.


-1108: Too complicated SQL statement (correlated row too long) (SAP Library - SAP DB)

 Entering content frame

-1108: Too complicated SQL statement (correlated row too long)

Explanation:

The processing of an SQL statement containing at least one correlated subquery requires the generation of an internal result whose rows would exceed the valid length.

User Action:

Check whether some columns within the SELECT LIST can be omitted or the SQL statement can be reformulated in such a way that less or no correlated columns are used.


-1110: View definition too long (SAP Library - SAP DB)

 Entering content frame

-1110: View definition too long

Explanation:

The text of a view definition is longer than the space available for it. This error may also occur with a RENAME COLUMN statement when the view definition maintained internally exceeds the maximum length because of the extension of the name.

User Action:

Shorten the viewdefinition, e.g. by using short REFERENCE names instead of long table names in SELECT LIST or the SEARCH condition.


-1111: Too many savepoints (SAP Library - SAP DB)

 Entering content frame

-1111: Too many savepoints

Explanation:

Within a transaction, too many savepoints were defined.

User Action:

Check how this uncommonly large number of savepoints occurred. Include the missing COMMIT or ROLLBACK statements in the application.


-1112: Constraint too complicated (SAP Library - SAP DB)

 Entering content frame

-1112: Constraint too complicated

Explanation:

The internal representation of the constraint is longer than the space available for it.

User Action:

The constraint should be simplified or split into several constraints.


-1113: Too many nested function calls (SAP Library - SAP DB)

 Entering content frame

-1113: Too many nested function calls

Explanation:

The SQL statement contains more nested function calls than can be processed.

User Action:

Check whether some of the functions within the nesting can be omitted. If this is not possible, check whether the desired effect can be obtained by using a QUERY EXPRESSION in the FROM clause or by generating and reusing a named result set containing a part of the functions.


-1114: Communication packet too small (SAP Library - SAP DB)

 Entering content frame

-1114: Communication packet too small

Explanation:

The SQL statement is so long that not all pieces of information to be exchanged between client and server can be stored in the communication packet provided for this purpose.

User Action:

Simplify the SQL statement or split it into several SQL statements. If this is not possible, check whether the installation parameter PACKET_SIZE can be increased. This parameter indicates the size of the communication packet.


-1115: Too many intern columns (SAP Library - SAP DB)

 Entering content frame

-1115: Too many intern columns

Explanation:

An ALTER TABLE statement or a CREATE VIEW statement generates a table description either containing more columns than allowed or whose rows exceed the maximum length. Under certain circumstances, this situation can occur because of columns that are invisible to the user.

User Action:

For a CREATE VIEW statement, check whether some output columns can be omitted. For an ALTER TABLE statement, check whether the specified column width can be decreased. Check also whether previous ALTER TABLE statements generated so many invisible columns that the MODIFY DEFINITION command should be used to remove invisible columns instead of the ALTER DEFINITION command. The effect would be the recopying of the table, a procedure which requires considerable space and time.


-1116: Too long trigger parameters (SAP Library - SAP DB)

 Entering content frame

-1116: Too long trigger parameters

Explanation:

A trigger was defined with parameters whose total length exceeds the possible length.

User Action:

Try and reduce the number of parameters.


-1117: Too complicated trigger qualification (SAP Library - SAP DB)

 Entering content frame

-1117: Too complicated trigger qualification

Explanation:

The internal representation of the trigger qualification is longer than the space available for this purpose.

User Action:

Simplify the trigger qualification.


-1119: Too many constraints for this table (SAP Library - SAP DB)

 Entering content frame

-1119: Too many constraints for this table

Explanation:

More conditions have been defined for this table than is permitted. This is either because you have used a specific range of values or because you have explicitly specified certain constraints.

User action:

Either check whether or not you really need all the constraints and get rid of any you do not need or group several constraints into one. Repeat the command using the new constraint definitions.


-1120: Too many statements in definition (SAP Library - SAP DB)

 Entering content frame

Background documentation -1120: Too many statements in definition

Explanation:

You specified more than 255 SQL statements within a CREATE TRIGGER or CREATE DBPROC statement.

User Action:

Delete some of your SQL statements and try to get the same effect using fewer statements.


-1200: Too few values (SAP Library - SAP DB)

 Entering content frame

-1200: Too few values

Explanation:

In an INSERT or UPDATE statement the number of specified values is less than the number of column names which may have been implicitly specified.

User Action:

Match the number of specified values in the SQL statement to the number of specified column names. Use a QUERY statement issued on the system table DOMAIN.COLUMNS for an INSERT statement without column name specification to determine the definition of the table used.


-1201: Too few columns (SAP Library - SAP DB)

 Entering content frame

-1201: Too few columns

Explanation:

In a REFERENTIAL CONSTRAINT DEFINITION fewer REFERENCING COLUMNS than REFERENCED COLUMNS were specified. The number of specified columns in the referencing table must correspond to the number of referenced columns of the REFERENCED TABLE specified implicitly or explicitly.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the key columns in the referenced table. Use a QUERY statement issued on the system table DOMAIN.IND_USES_COL to find out the indexes of the referenced table. The specification of the referencing table columns must be adapted accordingly.


-1400: Input parameter cannot be NULL value (SAP Library - SAP DB)

 Entering content frame

-1400: Input parameter cannot be NULL value

Explanation:

The value of an input parameter must not be a null value, because null values are not permitted for the column.

User Action:

Modify the program or change the column definition in the CREATE TABLE statement.


-1402: Integrity violation (SAP Library - SAP DB)

 Entering content frame

-1402: Integrity violation

Explanation:

Insertions or updates would violate integrity constraints specified in the definition of the base or view table.

User Action:

The error message specifies the column which would violate the integrity constraints. Correct the input value for the corresponding column.


-1403: Row not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -1403: Row not found

Explanation

There is no (further) table row which meets the specified criteria.

User action

No user action is required.


-1405: Missing indicator variable, output parameter with NULL va (SAP Library - SAP DB)

 Entering content frame

Background documentation -1405: Missing indicator variable, output parameter with NULL value

Explanation:

The indicator variable required for returning the NULL value to the SQL variable is missing.

User Action:

Specify the indicator variable with the parameter.


-1406: Output value truncated (SAP Library - SAP DB)

 Entering content frame

-1406: Output value truncated

Explanation:

The column's range of values is greater than that of the SQL variable. The value was truncated when being inserted into the SQL variable.

User Action:

Adapt the range of values of the SQL variable to that of the column.


-1452: Duplicate secondary key (SAP Library - SAP DB)

 Entering content frame

-1452: Duplicate secondary key

Explanation:

Several table rows already exist with the same values in the specified columns when a UNIQUE definition is specified, when the COLUMN ATTRIBUTE UNIQUE is used or when a UNIQUE definition is specified in the CREATE INDEX statement.

User Action:

Do not use the UNIQUE definition; otherwise ensure that only one table row contains a certain combination of values in the specified columns. The error message specifies the column or multiple-column index already containing the specified values.


-1556: Data space full (SAP Library - SAP DB)

 Entering content frame

Background documentation -1556: Data area full

Explanation

The data area of the database instance is full.

User action

You must increase the database's data area by adding extra data volumes . Any SQL statements that were started beforehand will be executed.


-1755: SQL statement will drop further objects (use CASCADE) (SAP Library - SAP DB)

 Entering content frame

-1755: SQL statement will drop further objects (use CASCADE)

Explanation:

A DROP USER, DROP TABLE, DROP VIEW or REVOKE statement was specified for which the CASCADE option had not been specified implicitly or explicitly. Other objects depend on the object to be deleted. These objects must be deleted as well but this is only possible with an implicit or explicit specification of the CASCADE option.

User Action:

Before specifying the same SQL statement with the CASCADE option, you should check which dependent objects exist.


From -2000 to -2999 (SAP Library - SAP DB)

 Entering content frame

From -2000 to -2999

Database Kernel Error Messages

-2000 | Row too long
-2001 | Key too long
-2002 | One output column too long
-2003 | Output columns too long
-2004 | Numeric constant too long
-2008 | Data area too small
-2009 | Join columns too long
-2010 | Assignment impossible, char value too long
-2012 | View column list too long
-2013 | Select column list too long
-2014 | Identifier too long
-2020 | Data buffer too small
-2025 | Invalid number of backup devices
-2027 | Space for converted value too small
-2028 | Sequence <sequence name> exhausted
-2029 | <sequence name>.CURRVAL is not yet defined in this session


-2000: Row too long (SAP Library - SAP DB)

 Entering content frame

-2000: Row too long

Explanation:

When (re-)defining a table, the length of a table row exceeds 8088 bytes.

User Action:

  1. One or more columns must be removed from a CREATE TABLE statement or their lengths must be reduced.
  2. One or more columns must be removed from an ALTER TABLE statement or their lengths must be reduced. Use a QUERY-statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the table.


-2001: Key too long (SAP Library - SAP DB)

 Entering content frame

-2001: Key too long

Explanation:

  1. The sum of the key column lengths must not exceed 254 characters when using a CREATE TABLE or ALTER TABLE statement.
  2. When defining a named index, the sum of the column lengths for the index must not exceed 254 characters.

User Action:

  1. Correct the definition of the lengths accordingly or try to use less key columns.
  2. Try to create the named index with less columns.


-2002: One output column too long (SAP Library - SAP DB)

 Entering content frame

-2002: One output column too long

Explanation:

The concatenation of values resulted in an excessively long alphanumeric value.

User Action:

Do without this kind of output. If it can be assumed that all values in a column are shorter than the maximum length defined for this column, the attempt can be made to reduce the result to less characters by applying the SUBSTR function. In any case, the columns and expressions involved in a concatenation can be output separately.


-2003: Output columns too long (SAP Library - SAP DB)

 Entering content frame

-2003: Output columns too long

Explanation:

The following reasons are possible:

  1. The total length of the output columns exceeds 8084.
  2. The total length of the output columns, together with the columns specified in the <ORDER clause> or <GROUP clause>, exceeds 8084.
  3. The total length of the output columns, together with the correlated columns and columns of <PREDICATE>s which contain a <SUBQUERY>, exceeds 4048 in an SQL statement with correlated subqueries.

User Action:

  1. The number of output columns must be reduced.
  2. The attempt should be made to do without sorting or grouping, or to perform the sorting or grouping across shorter or fewer columns.
  3. The attempt should be made to manage with fewer output columns or correlated columns or to achieve the desired effect using several SQL statements.


-2004: Numeric constant too long (SAP Library - SAP DB)

 Entering content frame

-2004: Numeric constant too long

Explanation:

  1. The number contains more than 38 digits.
  2. The number does not comply with the definition of the range of values.

User Action:

The number which was incorrectly entered may be determined from the position specification in the error message.

  1. The number must be reduced to 38 significant digits and be specified as a <FLOATING POINT LITERAL>, if necessary.
  2. Check the definition of the range of values and correct the specification of the number accordingly.


-2008: Data area too small (SAP Library - SAP DB)

 Entering content frame

-2008: Data area too small

Explanation:

· It was not possible to restore a database, as the database that is to be restored, is bigger than the target database specified for the restore operation.

· The installation of a database is not possible, as not enough space was defined for the storage of the data.

User Action:

· Increase the volume of the target database.

· Increase it to a value that is greater than 2000 pages.


-2009: Join columns too long (SAP Library - SAP DB)

 Entering content frame

-2009: Join columns too long

Explanation:

The internal length of a table's join columns must not exceed 250 characters. Join columns are the columns that are contained in a <JOIN PREDICATE>.

WHERE (S.A = T.V AND S.B < T.W)

The join columns of the table S are the columns S.A and S.B. The internal length of the join columns of S is the internal length of the column S.A plus the internal length of the column S.B. The internal length of the join columns of S must not exceed 250.

User Action:

You can attempt to achieve the expected result by issuing several <QUERY statement>s and creating tables as temporary results.


-2010: Assignment impossible, char value too long (SAP Library - SAP DB)

 Entering content frame

-2010: Assignment impossible, char value too long

Explanation:

In an <INSERT statement> with a <QUERY EXPRESSION> or in an <UPDATE statement>, the attempt was made to assign a character string to a column of data type CHAR. This character string was too long. The error message is returned for the first occurring value of excess length, not while analyzing the maximum column lengths.

User Action:

Use SELECT ... WHERE LENGTH (<column name>) > <unsigned integer> to find out the rows which are too long. The length of the corresponding column can be increased by an <ALTER TABLE statement>.


-2012: View column list too long (SAP Library - SAP DB)

 Entering content frame

-2012: View column list too long

Explanation:

In a <CREATE VIEW statement>, the number of view table columns to be defined must be equal to the number of columns issued as the <QUERY EXPRESSION> result. In the present case, the attempt was made to create more view table columns than columns are available in the <QUERY request> result.

User Action:

Reduce the number of view table columns specified in the SQL statement.


-2013: Select column list too long (SAP Library - SAP DB)

 Entering content frame

-2013: Select column list too long

Explanation:

The following reasons are possible:

  1. In a <CREATE VIEW statement>, the number of view table columns to be defined must be equal to the number of columns issued as the <QUERY EXPRESSION> result. In the present case, there are more columns in the <QUERY request> result than view table columns defined.
  2. The number of <SUBQUERY> output columns specified in a <SET UPDATE clause> must be precisely one. In some SQLMODEs, this restriction also applies to <COMPARISON PREDICATE>, <QUANTIFIED PREDICATE> and <IN PREDICATE>. In the present case, the <SUBQUERY> produced more than one output column.
  3. An SQL statement for data retrieval was issued. The number of output columns must be less than or equal to 254. This number was exceeded.

User Action:

  1. The number of view table columns specified in the <CREATE VIEW statement> must be increased or the number of output columns of the <QUERY EXPRESSION> must be reduced.
  2. The number of output columns of the <SUBQUERY> must be limited to one.
  3. The data retrieval statement must be corrected by removing one or more output columns.


-2014: Identifier too long (SAP Library - SAP DB)

 Entering content frame

-2014: Identifier too long

Explanation:

The specified identifier is too long for the SQLMODE used.

User Action:

Pay attention to the restrictions in the table when specifying the identifier.

SQLMODE | Length of identifier
ANSI | 18 characters maximum
DB2 | 18 characters maximum
ORACLE | 30 characters maximum
INTERNAL | 32 characters maximum


-2020: Data buffer too small (SAP Library - SAP DB)

 Entering content frame

-2020: Data buffer too small

Explanation:

There is no free data buffer space available at the time. The execution of the SQL statement was cancelled. The database system implicitly performs a SHUTDOWN.

User Action:

Perform a RESTART of the database with an expanded data buffer (installation parameter DATA_CACHE).


-2025: Invalid number of backup devices (SAP Library - SAP DB)

 Entering content frame

-2025: Invalid number of backup devices

Explanation:

The number of backup devices specified for a save or restore operation does not correspond to the installation parameter MAXBACKUPDEVS.

User Action:

Use the database administration tool to check the parameter and modify it, if necessary.


-2027: Space for converted value too small (SAP Library - SAP DB)

 Entering content frame

Background documentation -2027: Space for converted value too small

Explanation

You tried to convert data in ASCII or UCS-2 format (see also UNICODE ) into another format. This attempt has failed.

User action

Check whether the target column has been defined enough space. If you cannot increase the target column, you cannot carry out an explicit conversion. You can try to avoid this error by explicitly converting the data used, for example, for comparisons.


-2028: Sequence <sequence name> exhausted (SAP Library - SAP DB)

 Entering content frame

-2028: Sequence <sequence name> exhausted

Explanation:

You tried to find out the next value of the specified sequence with <sequence name>.NEXTVAL. This is impossible for one of the following reasons:

  1. The next value would not fit into the data type provided for sequences.
  2. The next value would be larger than the value defined by MAXVALUE in the <CREATE SEQUENCE statement>, and NOCYCLE was defined implicitly or explicitly.
  3. The next value would be smaller than the value defined by MINVALUE in the <CREATE SEQUENCE statement>, and NOCYCLE was defined implicitly or explicitly.

User Action:

  1. Specify the desired value explicitly.
  2. Delete and create the sequence again. By deleting and recreating the sequence you ensure that the values of the sequence are created cyclically or that a larger MAXVALUE or smaller MINVALUE is used. Define START WITH with the last assigned value if necessary. You may now use the SQL statement.


-2029: <sequence name>.CURRVAL is not yet defined in this sessio (SAP Library - SAP DB)

 Entering content frame

Background documentation -2029: <sequence name>.CURRVAL is not yet defined in this session

Explanation:

You attempted to execute <sequence name>.CURRVAL before using <sequence name>.NEXTVAL in the current session.

User Action:

Execute <sequence name>.NEXTVAL before executing <sequence name>.CURRVAL.


From -3000 to -3999 (SAP Library - SAP DB)

 Entering content frame

From -3000 to -3999

Database Kernel Error Messages

-3000 | Invalid host file content
-3002 | Invalid data type
-3003 | Invalid user name
-3004 | Invalid host file sequence
-3005 | Invalid SQL statement
-3007 | Invalid sequence for DML and DDL statements
-3008 | Invalid keyword or missing delimiter
-3009 | Invalid table name
-3010 | Invalid character value
-3011 | Invalid column name
-3014 | Invalids end of SQL statement
-3016 | Invalid numeric constant
-3017 | Invalid unsigned integer
-3018 | Invalid numeric parameter
-3019 | Invalid exponent
-3020 | Invalid length for this data type
-3021 | Invalid mixture of functions and columns
-3022 | Invalid number of tables for outer join
-3024 | Invalid numeric expression
-3030 | Invalid SESSION TIMEOUT
-3035 | Invalid date time format
-3037 | Invalid Volume name
-3038 | Invalid Volume size
-3046 | Invalid char position in string function
-3047 | Invalid table for RESTORE CATALOG
-3048 | Invalid date format
-3049 | Invalid time format
-3050 | Invalid timestamp format
-3054 | Invalid block size
-3059 | Invalid day of week
-3060 | Invalid escape sequence
-3061 | Invalid escape value
-3062 | Invalid month
-3063 | Invalid format code
-3064 | Date input value out of range
-3065 | Invalid date input value
-3066 | Date input value inconsistent
-3067 | Invalid timezone
-3102 | Invalid subtrans structure
-3103 | Invalid sequence definition
-3995 | Invalid pattern
-3998 | Wrong password
-3999 | Invalid parameter


-3000: Invalid host file content (SAP Library - SAP DB)

 Entering content frame

-3000: Invalid host file content

Explanation:

The host file or backup device has no contents that correspond to the command.

User Action:

Specify the host file or backup device that matches the menu function. In multi-volume processing, all versions loaded by then must be reloaded.


-3002: Invalid data type (SAP Library - SAP DB)

 Entering content frame

-3002: Invalid data type

Explanation:

The specified data type is unknown in the current SQLMODE.

User Action:

Use the valid data types described in the chapter <COLUMN DEFINITION> of the Reference manual.


-3003: Invalid user name (SAP Library - SAP DB)

 Entering content frame

-3003: Invalid user name

Explanation:

The specified user name does not comply with the syntax for the user <IDENTIFIER>.

User Action:

Correct the user name specified in the SQL statement.


-3004: Invalid host file sequence (SAP Library - SAP DB)

 Entering content frame

-3004: Invalid host file sequence

Explanation:

The host file or backup device specified in multi-volume processing to continue the restore function does not contain any items relating to the command executed up to then.

User Action:

The error message contains an additional error description which must be interpreted according to the operating system being used.

Specify the host file or backup device in order to continue.


-3005: Invalid SQL statement (SAP Library - SAP DB)

 Entering content frame

-3005: Invalid SQL statement

Explanation:

The SQL statement either contains a typing error within the first two keywords, is unknown in the current SQLMODE or is not permitted in the current database version.

User Action:

Correct the typing errors, or specify another SQL statement.


-3007: Invalid sequence for DML and DDL statements (SAP Library - SAP DB)

 Entering content frame

-3007: Invalid sequence for DML and DDL statements

Explanation:

Modifications were made to the catalog in the time between a <QUERY statement> which does not generate a result table and the corresponding <FETCH statement>s. These modifications concerned the underlying table of the <QUERY statement>.

User Action:

Repeat the QUERY and FETCH statement.


-3008: Invalid keyword or missing delimiter (SAP Library - SAP DB)

 Entering content frame

-3008: Invalid keyword or missing delimiter

Explanation:

The SQL statement contains an incorrect keyword, or a keyword unknown in the currently valid SQLMODE, or a keyword or delimiter is missing.

User Action:

Correct the SQL statement according to the syntax description and the current SQLMODE.


-3009: Invalid table name (SAP Library - SAP DB)

 Entering content frame

-3009: Invalid table name

Explanation:

The specified table name does not comply with the syntax for <identifier>s.

User Action:

Correct the table name specified in the SQL statement.


-3010: Invalid character value (SAP Library - SAP DB)

 Entering content frame

-3010: Invalid character value

Explanation:

When defining a terminal character set, you tried to perform a conversion for a digit, a letter of the 26-character alphabet or a special character (comma, colon, etc.). This is neither allowed nor necessary.

User Action:

Do not do this.


-3011: Invalid column name (SAP Library - SAP DB)

 Entering content frame

-3011: Invalid column name

Explanation:

The specified column name does not comply with the syntax for <identifier>s.

User Action:

Correct the column name specified in the SQL statement.


-3014: Invalid end of SQL statement (SAP Library - SAP DB)

 Entering content frame

-3014: Invalid end of SQL statement

Explanation:

According to the syntax, the specified SQL statement is not allowed in the SQLMODE which is currently valid.

User Action:

The error position shows the location where the specified SQL statement deviates from the permitted syntax.


-3016: Invalid numeric constant (SAP Library - SAP DB)

 Entering content frame

-3016: Invalid numeric constant

Explanation:

  1. The specified number does not match the column data type.
  2. The specified length of the function's result, e.g., LPAD, CHR, etc., is invalid. It must be between 1 and the maximum length valid for a CHAR-type column.

User Action:

  1. Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the data type of the affected column.
  2. Correct the specified length of the function’s result.


-3017: Invalid unsigned integer (SAP Library - SAP DB)

 Entering content frame

-3017: Invalid unsigned integer

Explanation:

No valid number was specified.

User Action:

Correct the SQL statement.


-3018: Invalid numeric parameter (SAP Library - SAP DB)

 Entering content frame

-3018: Invalid numeric parameter

Explanation:

The specified value is not a valid number.

User Action:

Check the numeric value entered as parameter.


-3019: Invalid exponent (SAP Library - SAP DB)

 Entering content frame

-3019: Invalid exponent

Explanation:

The following reasons are possible:

  1. A numeric final or temporary result is greater or less than the values which can be represented by a floating point number.
  2. A numeric value is greater or less than permitted by the data type of a specified column.

User Action:

  1. If a numeric intermediate result is too large or too small, the attempt can be made to prevent an overflow or underflow by rearranging the arithmetic operations.
  2. Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the data type of the affected column. Correct the parameter values accordingly.


-3020: Invalid length for this data type (SAP Library - SAP DB)

 Entering content frame

-3020: Invalid length for this data type

Explanation:

The specified length is not permitted for the data type.

User Action:

  1. Choose a value between 1 and 254 (SQLMODE ANSI) or between 1 and 8000 (SQLMODE INTERNAL and ORACLE or 1 and 4000 (SQLMODE DB2) for the length attribute of a CHAR-type column.
  2. Choose a value between 1 and 38 for the precision of a FIXED- or FLOAT-type column.


-3021: Invalid mixture of functions and columns (SAP Library - SAP DB)

 Entering content frame

-3021: Invalid mixture of functions and columns

Explanation:

  1. When quantity functions (COUNT, MAX, MIN, SUM, AVG, VARIANCE, STDDEV) occur in a <SELECT COLUMN>, non-group columns are not allowed in the <SELECT COLUMN>s.
  2. Quantity functions, e.g. AVG(SUM...), must not be nested.
  3. A corresponding subquery S contained in the <WHERE clause> of the <QUERY SPEC> Q must not contain quantity functions for columns of tables specified in the <FROM clause> of the <QUERY SPEC> Q.

User Action:

Correct the SQL statement.

Try to achieve the desired effect without nesting the quantity functions by using several QUERY statements each containing a quantity function.

Inside a QUERY statement the effect can be achieved by specifying a QUERY EXPRESSION in the FROM clause.


-3022: Invalid number of tables for outer join (SAP Library - SAP DB)

 Entering content frame

-3022: Invalid number of tables for outer join

Explanation:

If an <OUTER JOIN INDICATOR> was specified in at least one <JOIN PREDICATE> of the <QUERY SPEC>, the number of the underlying tables of the <QUERY SPEC> <FROM clause> must be precisely two or the following must apply:

  1. <OUTER JOIN indicator>s are only specified for one of the tables specified in the <FROM clause>.
  2. All JOIN PREDICATEs of this table related to just one other table contain the <OUTER JOIN INDICATOR>.
  3. All other joins do not contain an OUTER JOIN INDICATOR.

User Action:

The attempt should be made to add any missing OUTER JOIN indicators or to split the SQL statement into several SQL statements, or to achieve the desired effect by <QUERY EXPRESSION>s in the <FROM clause>.


-3024: Invalid numeric expression (SAP Library - SAP DB)

 Entering content frame

-3024: Invalid numeric expression

Explanation:

It was intended to perform a division by 0.

This division does not belong to a SELECT COLUMN of the outermost QUERY SPEC statement.

User Action:

Check whether this error can be prevented by suitable specifications (PREDICATEs).


-3030: Invalid SESSION TIMEOUT (SAP Library - SAP DB)

 Entering content frame

-3030: Invalid SESSION TIMEOUT

Explanation:

  1. The value specified for the SESSION_TIMEOUT in the <CREATE USER> or <CREATE USERGROUP statement> is invalid.
  2. If the CONNECT statement is specified with a TIMEOUT value, this value must be less than or equal to the maximum TIMEOUT value possible for the user concerned.

User Action:

  1. Choose a value between 30 and 32400 seconds for the SESSION_TIMEOUT.
  2. If no user-specific TIMEOUT value was defined in the <CREATE USER> or <CREATE USERGROUP statement> for the current user, this maximum value is equal to the installation parameter SESSION_TIMEOUT.

    3. If a user-specific TIMEOUT value was defined in the <CREATE USER> or <CREATE USERGROUP statement>, this is the maximum value.

  3. If 0 is specified for the TIMEOUT value in the CONNECT statement, periods of inactivity during a session are not checked.


-3035: Invalid date time format (SAP Library - SAP DB)

 Entering content frame

-3035: Invalid date time format

Explanation:

The DATE_TIME_FORMAT specified during installation is invalid.

User Action:

Specify EUR, INTERNAL, ISO, JIS or USA for the date and time format.


-3037: Invalid volume name (SAP Library - SAP DB)

 Entering content frame

-3037: Invalid volume name

Explanation

The volume name specified during installation is invalid. This name depends on the environment in which the database system is running. Usually, it is an operating system file name.

User action

The error message contains the incorrect volume name. Ensure that the name meets the conventions laid out for the environment in which the database system is running.


-3038: Invalid volume size (SAP Library - SAP DB)

 Entering content frame

-3038: Invalid volume size

Explanation

The value for the size of a volume specified during installation is not a valid number.

User action

Specify a valid number.


-3046: Invalid char position in string function (SAP Library - SAP DB)

 Entering content frame

-3046: Invalid char position in string function

Explanation:

An invalid value was specified for a position in a <STRING FUNCTION>.

User Action:

In the SQL statement, a value must be specified for a position which is greater than 0 and less than or equal to the defined column width.


-3047: Invalid table for RESTORE CATALOG (SAP Library - SAP DB)

 Entering content frame

Background documentation -3047: Invalid table for RESTORE CATALOG

Explanation:

A RESTORE CATALOG statement specified a table that contains none of the data generated by the SAVE CATALOG statement.

User Action:

Specify a table whose data was generated by the SAVE CATALOG statement.


-3048: Invalid date format (SAP Library - SAP DB)

 Entering content frame

-3048: Invalid date format

Explanation:

The specified value is not a valid date value or does not correspond to the date and time format chosen during installation or the current session.

User Action:

Correct the date value.


-3049: Invalid time format (SAP Library - SAP DB)

 Entering content frame

-3049: Invalid time format

Explanation:

The specified value is not a valid time value or does not correspond to the date and time format chosen during installation or the current session.

User Action:

Correct the time value.


-3050: Invalid timestamp format (SAP Library - SAP DB)

 Entering content frame

-3050: Invalid timestamp format

Explanation:

The specified value is not a valid timestamp value or does not correspond to the date and time format chosen during installation or the current session.

User Action:

Correct the timestamp value.


-3054: Invalid block size (SAP Library - SAP DB)

 Entering content frame

Background documentation -3054: Invalid block size

Explanation

...

1. The specified block size for backing up or restoring data is invalid.

2. (liveCache) When registering a container that already exists in the database, the specified length of the object is different to the one stored in the database catalog.

User action

...

1. Set the block size to a value >= 1.

2. Register the container using the length specifications stored in the database catalog.


-3059: Invalid day of week (SAP Library - SAP DB)

 Entering content frame

-3059: Invalid day of week

Explanation:

For a date specification, an invalid day of the week was specified in the chosen language or format.

User Action:

Check the chosen language and format and repeat the SQL statement with the correct day of the week.

For the format element DAY, the days of the week must be written in full; for DY they must be specified with their three-letter abbreviation.


-3060: Invalid escape sequence (SAP Library - SAP DB)

 Entering content frame

-3060: Invalid escape sequence

Explanation:

The escape character may only be placed before a <MATCH CHAR> which is identical to the escape character, before a <MATCH STRING>, or before a <MATCH SET> which is not a <MATCH CHAR>.

User Action:

Remove the surplus escape character.


-3061: Invalid escape value (SAP Library - SAP DB)

 Entering content frame

-3061: Invalid escape value

Explanation:

Exactly one character is valid for an escape value.

User Action:

Reduce the escape value to one character.


-3062: Invalid month (SAP Library - SAP DB)

 Entering content frame

-3062: Invalid month

Explanation:

For a date specification, an invalid month was specified in the chosen language or format.

User Action:

Check the chosen language and format and repeat the SQL statement with the correct day of the week.

For the format element MONTH, the months must be written in full; for MON, they must be specified with their three-letter abbreviation.


-3063: Invalid format code (SAP Library - SAP DB)

 Entering content frame

-3063: Invalid format code

Explanation:

The format specification in a function for date or number conversion contains an invalid format code.

User Action:

Remove the invalid format code.


-3064: Date input value out of range (SAP Library - SAP DB)

 Entering content frame

-3064: Date input value out of range

Explanation:

An invalid value was specified for a format element in a function that converts a value into a date value.

Limits for format elements

Year | YYYY | 1-4713
Day of the month | DD | 1-28/29/30/31
Day of the year | DDD | 1-365/366
Day of the week | D | 1-7
Hours | HH,HH12 | 1-12
Hours | HH24 | 0-23
Minutes | MI | 0-59
Seconds | SS | 0-59
Seconds of the day | SSSSS | 0-86399
Julian calendar date | J | 1-3442447

User Action:

Correct the value.


-3065: Invalid date input value (SAP Library - SAP DB)

 Entering content frame

-3065: Invalid date input value

Explanation:

The value to be converted into a date value contains an invalid element, or too many or too few elements.

User Action:

Correct the value according to the format.


-3066: Date input value inconsistent (SAP Library - SAP DB)

 Entering content frame

-3066: Date input value inconsistent

Explanation:

Data from two format elements was converted. The values of the data are contradictory. Perhaps a Julian calendar day was specified which does not lie within the specified year or month, or denotes another day of the month, or the seconds of the day were specified but do not correspond to the specified hours or minutes or seconds of the minute.

User Action:

  1. One of the format elements containing contradictory values should be omitted.
  2. The values of the two format elements should be matched.


-3067: Invalid timezone (SAP Library - SAP DB)

 Entering content frame

-3067: Invalid timezone

Explanation:

An invalid value for timezone was specified in the function NEW_TIME.

User Action:

Repeat the SQL statement with a correct timezone.


-3102: Invalid subtrans structure (SAP Library - SAP DB)

 Entering content frame

-3102: Invalid subtrans structure

Explanation:

In a DB procedure, more or less subtransactions were dynamically opened than closed. The subtransactions opened but not closed until the end of the DB procedure were rolled back.

User Action:

Check which error in the DB procedure generated such nesting of subtransactions. Correct the database procedure accordingly.


-3103: Invalid sequence definition (SAP Library - SAP DB)

 Entering content frame

-3103: Invalid sequence definition

Explanation:

The following reasons are possible:

  1. In the <CREATE SEQUENCE statement>, the value 0 was specified for the interval between two numbers to be created by the sequence. This is not allowed.
  2. In the <CREATE SEQUENCE statement>, a starting value was specified which is not within the range defined by the minimum and maximum value; or a minimum value was specified that is greater than the maximum value.

User Action:

  1. Repeat the command with a positive or negative integer.
  2. Change the starting value and/or the minimum and maximum values and repeat the command.


-3995: Invalid pattern (SAP Library - SAP DB)

 Entering content frame

-3995: Invalid pattern

Explanation:

The value specified in a <LIKE PREDICATE> does not comply with the syntax of <LIKE expression>s.

User Action:

The value must be corrected according to the syntax rules of a <LIKE EXPRESSION> in a <LIKE PREDICATE>.


-3998: Wrong password (SAP Library - SAP DB)

 Entering content frame

Background documentation -3998: Wrong password

Explanation

You want to activate a role , but the password is different to the one specified when the role was defined.

User action

Correct the password.


-3999: Invalid parameter (SAP Library - SAP DB)

 Entering content frame

-3999: Invalid parameter

Explanation:

  1. An invalid installation parameter was specified.
  2. An invalid parameter was specified in the sequence of parameters of a <CREATE TRIGGER statement>. The usage of OLD is invalid in an INSERT trigger, the usage of NEW is invalid in a DELETE trigger.

User Action:

  1. The error message contains a precise description of the error. Correct the parameter values accordingly.
  2. Correct the parameters accordingly.


From -4000 to -4999 (SAP Library - SAP DB)

 Entering content frame

From -4000 to -4999

Database Kernel Error Messages

-4000 | Unknown result table
-4002 | Unknown password
-4003 | Unknown user name
-4004 | Unknown table name
-4005 | Unknown column name
-4006 | Unknown domain name
-4007 | Unknown synonym name
-4008 | Unknown user name/password combination
-4009 | Unknown referential constraint name
-4010 | Unknown MAPCHARSET name
-4011 | Unknown index name
-4013 | Unknown usergroup name
-4014 | Unknown SERVERDB name
-4016 | Unknown procedure name
-4017 | Unknown constraint
-4018 | Unknown default
-4019 | Unknown trigger name
-4020 | Unknown sequence name
-4023 | Unknown function name
-4024 | Unknown name
-4025 | Unknown or not loaded character set
-4027 | Unknown session


-4000: Unknown result table (SAP Library - SAP DB)

 Entering content frame

-4000: Unknown result table

Explanation:

There is no result table (any more) with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TABLES to find out the names of the existing result tables. Correct the name of the result table or check why the result table with the specified name was deleted already.

A <COMMIT statement> issued in the SQLMODEs ANSI and DB2 implicitly closes all result tables. This behavior can be prevented in the SQLMODE DB2 by specifying "WITH HOLD".

Except for the SQLMODE ORACLE, a <ROLLBACK statement> implicitly closes all result tables generated within this transaction.


-4002: Unknown password (SAP Library - SAP DB)

 Entering content frame

-4002: Unknown password

Explanation:

The specified password is unknown.

User Action:

Repeat the ALTER PASSWORD statement using the correct password.


-4003: Unknown user name (SAP Library - SAP DB)

 Entering content frame

-4003: Unknown user name

Explanation:

There is no user with this name.

User Action:

A DBA or the SYSDBA can use a <QUERY statement> issued on the system table DOMAIN.USERS to find out the known user names. Other users can use a <QUERY statement> issued on the system table DOMAIN.USERS to find out the users which belong to the same DBA as they do. Repeat the SQL statement with a known user name.


-4004: Unknown table name (SAP Library - SAP DB)

 Entering content frame

-4004: Unknown table name

Explanation:

A table with the specified name is not known to you. This table may not exist; or this table exists but you have no privileges for it.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TABLES to find out the names of the tables for which you have privileges. Then correct the table name. It may be sufficient to place the missing <OWNER> in front of it. If this does not remove the error, create a table with the desired name or check why you have no privileges for the existing table.


-4005: Unknown column name (SAP Library - SAP DB)

 Entering content frame

-4005: Unknown column name

Explanation:

There is no column with the specified name in any of the specified tables.

User Action:

Use <QUERY statement>s issued on the system table DOMAIN.COLUMNS to find out the names of the columns existing in the tables. Correct the user name.


-4006: Unknown domain name (SAP Library - SAP DB)

 Entering content frame

-4006: Unknown domain name

Explanation:

There is no domain with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.DOMAINS to see a list of the known domains. Change the name of the domain in the SQL statement accordingly. It may be sufficient to place the missing <OWNER> in front of the statement.

A user with DBA status can create a domain with the desired name and features.


-4007: Unknown synonym name (SAP Library - SAP DB)

 Entering content frame

-4007: Unknown synonym name

Explanation:

There is no synonym with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.SYN_REFS_TAB to see a list of the existing synonym names. Change the name of the domain in the SQL statement accordingly.


-4008: Unknown user name/password combination (SAP Library - SAP DB)

 Entering content frame

-4008: Unknown user name/password combination

Explanation:

The specified combination of user name and password is unknown. The database system can only be accessed by a combination that is known to the database.

User Action:

Change the user or password specification in the SQL statement.


-4009: Unknown referential constraint name (SAP Library - SAP DB)

 Entering content frame

-4009: Unknown referential constraint name

Explanation:

There is no <REFERENTIAL CONSTRAINT DEFINITION> with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.COL_REFS_COL to find out which <CONSTRAINT definition>s are defined. Change the <REFERENTIAL CONSTRAINT NAME> in the SQL statement accordingly.


-4010: Unknown MAPCHAR SET name (SAP Library - SAP DB)

 Entering content frame

-4010: Unknown MAPCHAR SET name

Explanation:

There is no MAPCHAR SET with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.MAPCHARSETS to see a list of the available MAPCHAR SETs. Change the name in the SQL statement accordingly.


-4011: Unknown index name (SAP Library - SAP DB)

 Entering content frame

-4011: Unknown index name

Explanation:

There is no named index with the specified name for the table being used.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.IND_USES_COL to find out the existing indexes. Change the index name in the SQL statement accordingly.


-4013: Unknown usergroup name (SAP Library - SAP DB)

 Entering content frame

-4013: Unknown usergroup name

Explanation:

There is no usergroup with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.USERS to see a list of the existing usergroup names. Change the usergroup name in the SQL statement accordingly.


-4014: Unknown SERVERDB name (SAP Library - SAP DB)

 Entering content frame

-4014: Unknown SERVERDB name

Explanation:

There is no serverdb with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.SERVERDBS to see a list of the existing serverdb names. Change the name of the serverdb in the SQL statement accordingly.


-4016: Unknown procedure name (SAP Library - SAP DB)

 Entering content frame

-4016: Unknown procedure name

Explanation:

There is no DB procedure with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.DBPROCEDURES to see a list of the existing DB procedures. Change the procedure name in the SQL statement accordingly.


-4017: Unknown constraint (SAP Library - SAP DB)

 Entering content frame

-4017: Unknown constraint

Explanation:

There is no <CONSTRAINT DEFINITION> for the specified column.

User Action:

No user action is necessary.


-4018: Unknown default (SAP Library - SAP DB)

 Entering content frame

-4018: Unknown default

Explanation:

There is no default specified for a given column.

User Action:

Add a default value.


-4019: Unknown trigger name (SAP Library - SAP DB)

 Entering content frame

-4019: Unknown trigger name

Explanation:

There is no trigger with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TRIGGERS to find out the trigger names already used.


-4020: Unknown sequence name (SAP Library - SAP DB)

 Entering content frame

-4020: Unknown sequence name

Explanation:

There is no sequence with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.SEQUENCES to see a list of the existing sequences.


-4023: Unknown function name (SAP Library - SAP DB)

 Entering content frame

-4023: Unknown function name

Explanation:

  1. There is no function with the specified name.
  2. The attempt was made to use a <NAMED QUERY EXPRESSION> that was not valid here instead of a <QUERY EXPRESSION>.

User Action:

Replace the NAMED QUERY EXPRESSION with a QUERY EXPRESSION. If the error message occurs although there is no <NAMED QUERY EXPRESSION> in the SQL statement, check whether the specified function is only not offered in the SQLMODE being used.

  1. Do without the specified function.
  2. Open a session using the SQLMODE in which the function is available.
  3. Generate a DB function with the specified name and the desired functionality.


-4024: Unknown name (SAP Library - SAP DB)

 Entering content frame

-4024: Unknown name

Explanation:

There is no database object with the specified name.

User Action:

Use <QUERY statement>s issued on system tables to find out which objects you are authorized to see.


-4025: Unknown or not loaded character set (SAP Library - SAP DB)

 Entering content frame

-4025: Unknown or not loaded character set

Explanation:

The specified CHARACTER SET is unknown.

User Action:

Check the spelling of the character set. Use a <QUERY statement> issued on the system table DOMAIN.CHARSET to find out whether the specified character set has been loaded. Replace the specification by one of the loaded character sets or ensure that the character set needed will be loaded.


-4027: Unknown session (SAP Library - SAP DB)

 Entering content frame

Background documentation -4027: Unknown session

Explanation

You want to switch on the database trace for a special database session. The specified session number does not exist.

User action

Correct the session number.


From -5000 to -5999 (SAP Library - SAP DB)

 Entering content frame

From -5000 to -5999

Database Kernel Error Messages

-5001

Missing privilege

-5003

Missing key specification

-5004

Missing constant

-5005

Missing non-NULL value

-5006

Missing identifier

-5007

Missing numeric constant

-5008

Missing string constant

-5009

Missing integer

-5010

Missing value specification

-5012

Missing definite table name

-5013

Missing update column

-5014

Missing definite column name

-5015

Missing keyword

-5016

Missing delimiter


-5001: Missing privilege (SAP Library - SAP DB)

 Entering content frame

-5001: Missing privilege

Explanation:

  1. The user is not authorized to execute the SQL statement.
  2. The user is not authorized to execute this SQL statement for data definition. The privilege necessary for this SQL statement is only granted within a role. Such limited privileges are sufficient for other SQL statements, but not for those relating to data definitions.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.USR_USES_COL to find out the privileges you have for the specified table or its columns. You cannot execute the desired SQL statement.


-5003: Missing key specification (SAP Library - SAP DB)

 Entering content frame

-5003: Missing key specification

Explanation:

The SQL statement requires a primary key specification. The primary key was omitted or is incomplete.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the key columns of the table. Correct the key specified in the SQL statement, or insert a key specification into the SQL statement.


-5004: Missing constant (SAP Library - SAP DB)

 Entering content frame

-5004: Missing constant

Explanation:

A constant is missing in the SQL statement.

User Action:

Insert a constant into the SQL statement.


-5005: Missing non-NULL value (SAP Library - SAP DB)

 Entering content frame

-5005: Missing non-NULL value

Explanation:

The <INSERT> or <UPDATE statement> must contain non-NULL values for all mandatory columns. If <KEY SPEC> is specified, non-NULL values must be specified for all key columns.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the table's mandatory and key columns.


-5006: Missing identifier (SAP Library - SAP DB)

 Entering content frame

-5006: Missing identifier

Explanation:

An <identifier> is missing.

User Action:

The error position indicates the location of the missing <IDENTIFIER>. Insert an <identifier> into the SQL statement.


-5007: Missing numeric constant (SAP Library - SAP DB)

 Entering content frame

-5007: Missing numeric constant

Explanation:

A number is missing.

User Action:

The error position indicates the location of the missing number. Insert a number into the SQL statement.


-5008: Missing string constant (SAP Library - SAP DB)

 Entering content frame

-5008: Missing string constant

Explanation:

A string constant is missing in the issued SQL statement.

User Action:

Insert a <STRING LITERAL> into the SQL statement.


-5009: Missing integer (SAP Library - SAP DB)

 Entering content frame

-5009: Missing integer

Explanation:

An integer is missing.

User Action:

Insert an integer into the SQL statement.


-5010: Missing value specification (SAP Library - SAP DB)

 Entering content frame

-5010: Missing value specification

Explanation:

A value is missing, or the specified value is not allowed.

User Action:

Correct the value specified in the SQL statement, or insert a value into the SQL statement.


-5012: Missing definite table name (SAP Library - SAP DB)

 Entering content frame

-5012: Missing definite table name

Explanation:

If a table name in a <FROM clause> is used several times with different <OWNER>s, then the table name must always be specified with the desired <OWNER> within this SQL statement.

User Action:

Specify the OWNER with the table names.


-5013: Missing update column (SAP Library - SAP DB)

 Entering content frame

-5013: Missing update column

Explanation:

The attempt was made to update at least one column value of an updateable join view table column using an <UPDATE statement>. This column value can only be updated together with other column values. At least one of the required column values is missing in the <UPDATE statement>.

User Action:

Insert the missing column values into the <UPDATE statement> or execute <UPDATE statement>s for the underlying table(s) of the updateable join view table.


-5014: Missing definite column name (SAP Library - SAP DB)

 Entering content frame

-5014: Missing definite column name

Explanation:

The number of tables specified in a <FROM clause> of the SQL statement is greater than 1. A <COLUMN NAME> without preceding <TABLE SPEC> was used, and this <COLUMN NAME> occurs in more than one of the tables specified in the <FROM clause>.

User Action:

To ensure that the COLUMN NAME is unique, place the desired <TABLE SPEC> in front of it.


-5015: Missing keyword (SAP Library - SAP DB)

 Entering content frame

-5015: Missing keyword

Explanation:

The SQL statement contains a keyword that is incorrect or that is not known in the current SQLMODE; or a keyword is missing.

User Action:

Correct the SQL statement according to the syntax description and the current SQLMODE by using one of the specified keywords.


-5016: Missing delimiter (SAP Library - SAP DB)

 Entering content frame

-5016: Missing delimiter

Explanation:

The SQL statement contains an incorrect delimiter, or a delimiter is missing.

User Action:

Correct the SQL statement according to the syntax description and the current SQLMODE by using one of the specified delimiters.


From -6000 to -6999 (SAP Library - SAP DB)

 Entering content frame

From -6000 to -6999

Database Kernel Error Messages

-6000

Duplicate table name

-6001

Duplicate column name

-6002

Duplicate privilege

-6003

Duplicate result table name

-6006

Duplicate name

-6008

Duplicate index name

-6009

Duplicate reference name

-6011

Duplicate constraint

-6012

Duplicate default

-6013

Duplicate trigger definition

-6014

Duplicate value

-6016

Duplicate format code


-6000: Duplicate table name (SAP Library - SAP DB)

 Entering content frame

-6000: Duplicate table name

Explanation:

There is already a table with the specified name.

User Action:

Choose another name for the new table.


-6001: Duplicate column name (SAP Library - SAP DB)

 Entering content frame

-6001: Duplicate column name

Explanation:

  1. The column names of a table must differ from each other. Base tables without user-defined key columns and named result tables contain the implicitly created column SYSKEY.
  2. Named result tables with columns which have not been explicitly named and which do not inherit a column name from the underlying base table, implicitly get the column name EXPRESSION_. _ stands for a positive integer.
  3. A column must not be specified more than once in an <INSERT > or <UPDATE statement> or in a sequence of key specifications (KEY SPEC).

User Action:

  1. Use different column names.
  2. In a <CREATE VIEW> or <QUERY statement>, uniqueness of the column names can be achieved by <REFERENCE NAME> specifications in the selected columns (SELECT COLUMN). In a <CREATE VIEW statement>, uniqueness can also be obtained by <ALIAS NAME> specifications.
  3. Correct the repeated specification of the same column.


-6002: Duplicate privilege (SAP Library - SAP DB)

 Entering content frame

-6002: Duplicate privilege

Explanation:

A privilege to be granted was listed twice in the SQL statement.

User Action:

Remove one of these privileges from the SQL statement.


-6003: Duplicate result table name (SAP Library - SAP DB)

 Entering content frame

-6003: Duplicate result table name

Explanation:

The SQLMODEs ANSI and DB2 require that a result table generated by DECLARE CURSOR is closed using a <CLOSE statement>, before the result table name can be used to open a new result table within the same transaction.

User Action:

Insert a CLOSE statement into the application.


-6006: Duplicate name (SAP Library - SAP DB)

 Entering content frame

-6006: Duplicate name

Explanation:

There is already a data object with the specified name.

User Action:

Repeat the SQL statement with another name.


-6008: Duplicate index name (SAP Library - SAP DB)

 Entering content frame

-6008: Duplicate index name

Explanation:

There is already an index with the specified name.

User Action:

Use another name for the index or delete the existing one.


-6009: Duplicate reference name (SAP Library - SAP DB)

 Entering content frame

-6009: Duplicate reference name

Explanation:

A reference name was selected twice in the FROM clause of a QUERY SPEC. This violates the requirement that each table must have a unique reference name.

User Action:

Change one of the reference names.


-6011: Duplicate constraint (SAP Library - SAP DB)

 Entering content frame

-6011: Duplicate constraint

Explanation:

There is already a <CONSTRAINT DEFINITION> for the specified column.

User Action:

Do without a <CONSTRAINT DEFINITION> specification, or attempt to obtain the desired effect by changing the existing <CONSTRAINT definition>. Use a QUERY statement issued on the system table DOMAIN.CONSTRAINTS to check the existing CONSTRAINT definitions.


-6012: Duplicate default (SAP Library - SAP DB)

 Entering content frame

-6012: Duplicate default

Explanation:

There is already a default specification for the specified column.

User Action:

Do without a default specification, or attempt to obtain the desired effect by changing the existing default. Use a <QUERY statement> issued on the system table DOMAIN.COLUMNS to find out the definition of the existing default.


-6013: Duplicate trigger definition (SAP Library - SAP DB)

 Entering content frame

-6013: Duplicate trigger definition

Explanation:

There is already a trigger with the specified name.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TRIGGERS to find out the trigger names already used. Use another name.

Use a <QUERY statement> issued on the system table DOMAIN.TRIGGERS to find out whether the existing trigger has the desired definition and you therefore need not define another trigger.


-6014: Duplicate value (SAP Library - SAP DB)

 Entering content frame

-6014: Duplicate value

Explanation:

  1. When defining a TERMCHAR SET, an internal or external value was specified more than once. There must be a 1:1 relation between the internal and external values.
  2. When defining a MAPCHAR SET, an internal value was specified more than once.

User Action:

  1. Change the definition of the TERMCHAR SET in such a way that the 1:1 relation is not violated.
  2. Change the definition of the MAPCHAR SET in such a way that it is not necessary to specify several mappings for an internal value.


-6016: Duplicate format code (SAP Library - SAP DB)

 Entering content frame

-6016: Duplicate format code

Explanation:

  1. A format element was specified several times in the function TO_DATE.
  2. In the format specification of the TO_DATE function, format elements were specified which must not occur together. For example, day of year (DDD) and Julian calendar date must not occur together. There must not be several specifications denoting the year, e.g. YYYY and YY, or the month, e.g. MM and MONTH.

User Action:

  1. Remove the format elements that are specified too often.
  2. Remove one of the format elements that cannot occur together.


From -7000 to -7999 (SAP Library - SAP DB)

 Entering content frame

From -7000 to -7999

Database Kernel Error Messages

-7002 | KEY not allowed
-7003 | NOT NULL not allowed
-7004 | DEFAULT not allowed
-7005 | Lower bound greater than upper bound not allowed
-7006 | Reserved identifier not allowed
-7007 | Key column not allowed
-7008 | Updates of this table not allowed
-7009 | NULL value in key column not allowed
-7011 | Correlated subquery not allowed
-7012 | More than one update row not allowed
-7015 | More than one result row not allowed
-7016 | Parameter spec not allowed in this context
-7017 | User not allowed
-7018 | Variable not allowed in view definition
-7019 | Feature not allowed in view definition
-7021 | View column derived from function not allowed
-7022 | Columns from more than one table not allowed
-7023 | Dropping of all columns not allowed
-7024 | Alter column not allowed, constraint violation
-7026 | SQL statement not allowed without previous FETCH
-7029 | Function not allowed for this data type
-7032 | SQL statement not allowed for column of data type LONG
-7035 | DEFAULT specification not allowed for this column
-7036 | ROWNO specification not allowed in this context
-7037 | NULL value for NOT NULL column not allowed
-7038 | Foreign key column not allowed
-7039 | Cycle in referential constraint definition not allowed
-7040 | Referential constraint not allowed
-7041 | Result table name not allowed
-7042 | Key update not allowed
-7043 | Group member not allowed
-7045 | Parameter spec not allowed
-7046 | Column with length greater than 254 not allowed
-7048 | DROP/ALTER USER not allowed while user is connected
-7050 | Fastload with indexed table not allowed
-7051 | Read only view WITH CHECK OPTION not allowed
-7055 | Column(s) already indexed
-7056 | Subquery not allowed
-7057 | View definition contradicts new table definition
-7058 | Correlated subquery with select in from clause not allowed
-7060 | Remote TABLE LOAD/UNLOAD not allowed
-7061 | LOCK ROW for this table not allowed
-7063 | Temp table not allowed
-7064 | Feature not allowed in temp table definition
-7065 | SUBTRANS COMMIT/ROLLBACK not allowed without SUBTRANS BEGIN
-7066 | Unique index referenced by foreign key not allowed
-7067 | Update without repeated read not allowed
-7068 | Outer join not allowed in this context
-7071 | AUTOSAVE LOG must be stopped
-7072 | More than one column with default SERIAL not allowed
-7074 | Cycle in granted roles not allowed
-7075 | Current SAVE SKIPPED, next is ready to take on this tape
-7076 | No more data to read from tape
-7077 | Synonym not allowed
-7078 | No backup is running
-7079 | A backup is already running
-7080 | Query in statement not allowed
-7506 | Parameter type not supported
-7503 | Constructor not found
-7501 | ProgramaticId not found
-7500 | DCOM HRESULT
-7078 | No backup is running
-7079 | A backup is already running
-7080 | Query in statement not allowed
-7900 | Different block sizes


-7002: KEY not allowed (SAP Library - SAP DB)

 Entering content frame

-7002: KEY not allowed

Explanation:

  1. The <CREATE TABLE statement> must list the key columns first if they are defined by a KEY specification in a <KEY OR NOT NULL SPEC>.
  2. In a <CREATE TABLE statement>, it is not allowed to specify KEY in a <KEY OR NOT NULL SPEC> and a <KEY DEFINITION>.

User Action:

Specify the key columns in the SQL statement correctly.


-7003: NOT NULL not allowed (SAP Library - SAP DB)

 Entering content frame

-7003: NOT NULL not allowed

Explanation:

Columns with NOT NULL specification cannot be added to a table with the <ALTER TABLE statement>.

User Action:

Repeat the SQL statement after removing the specification NOT NULL.


-7004: DEFAULT not allowed (SAP Library - SAP DB)

 Entering content frame

-7004: DEFAULT not allowed

Explanation:

  1. Columns with DEFAULT specification cannot be added to a table using the <ALTER TABLE statement>.
  2. The specification of NOT NULL DEFAULT NULL is not allowed.

User Action:

  1. To add a column to one with an <ALTER TABLE statement>, specify it without a DEFAULT specification. Then define the DEFAULT in another <ALTER TABLE statement>. The added column then implicitly receives the DEFAULT value in all table rows.
  2. Repeat the SQL statement after removing the DEFAULT specification.


-7005: Lower bound greater than upper bound not allowed (SAP Library - SAP DB)

 Entering content frame

-7005: Lower bound greater than upper bound not allowed

Explanation:

In the case of an upper and lower limit specification for a range of values, the lower limit is greater than the upper limit.

User Action:

Correct the values for the upper and lower limit in the SQL statement.


-7006: Reserved identifier not allowed (SAP Library - SAP DB)

 Entering content frame

-7006: Reserved identifier not allowed

Explanation:

In the current SQLMODE, the specified name is a reserved keyword and must not be used to identify database objects.

User Action:

Correct the SQL statement using another <identifier>.


-7007: Key column not allowed (SAP Library - SAP DB)

 Entering content frame

-7007: Key column not allowed

Explanation:

A key column specification is not allowed here.

User Action:

Remove the key column specification from the SQL statement.


-7008: Updates of this table not allowed (SAP Library - SAP DB)

 Entering content frame

-7008: Updates of this table not allowed

Explanation:

The specified table cannot be updated for the following possible reasons:

  1. The table specified in an SQL statement with CURRENT OF <RESULT TABLE NAME> is not the table indicated in the <FROM clause> of the <QUERY statement> which generated the result table.
  2. The SQL statement contains a correlated subquery which uses the table to be updated.
  3. The <QUERY expression> was specified with FOR UPDATE, but the <QUERY expression> contains statement parts which cannot be used together with a FOR UPDATE specification (DISTINCT, <GROUP CLAUSE>, UNION, INTERSECT, EXCEPT, <SUBQUERY>).
  4. In SQLMODE DB2 the QUERY EXPRESSION of an SQL statement with specification of CURRENT OF RESULT TABLE NAME contains the FOR FETCH ONLY statement.

User Action:

  1. Replace the table name with that used in the FROM clause of the QUERY statement or repeat the QUERY statement using the required table name.
  2. In the case of the correlated subquery, the desired effect can be achieved by generating a named result table which is then used in the <SUBQUERY>.
  3. You must remove the FOR UPDATE or DISTINCT specification, or similar.
  4. Repeat the QUERY expression without FOR FETCH ONLY, or omit the specification of CURRENT OF RESULT TABLE NAME in the SQL statement.


-7009: NULL value in key column not allowed (SAP Library - SAP DB)

 Entering content frame

-7009: NULL value in key column not allowed

Explanation:

Key columns must not be set to the NULL value.

User Action:

Use non-NULL values for key columns.


-7011: Correlated subquery not allowed (SAP Library - SAP DB)

 Entering content frame

-7011: Correlated subquery not allowed

Explanation:

A correlated subquery was used in a <QUERY EXPRESSION> containing at least a UNION, INTERSECT, or EXCEPT. This is not yet allowed.

User Action:

The desired effect can be achieved by splitting the <QUERY statement> into several SQL statements.


-7012: More than one update row not allowed (SAP Library - SAP DB)

 Entering content frame

-7012: More than one update row not allowed

Explanation:

The attempt was made to modify several rows with an <UPDATE statement>, specifying a new value for a LONG column. This is not allowed.

User Action:

Modify the <UPDATE statement> in such a way that only one row is updated, or do without the value modification for the LONG column.


-7015: More than one update row not allowed (SAP Library - SAP DB)

 Entering content frame

-7015: More than one update row not allowed

Explanation:

  1. This error may occur when a <SINGLE SELECT statement> is executed and more than one row complies with the <SEARCH CONDITION>.
  2. This error can also occur when a < SUBQUERY> specified in a <COMPARISON PREDICATE> or a <SET UPDATE CLAUSE> of an <UPDATE statement> is executed and more than one row complies with the <search condition>.

User Action:

  1. The <SINGLE SELECT statement> can be replaced with a <QUERY statement> and a sequence of <FETCH statement>s; or it can be ensured that at most one row complies with the conditions by expanding the <search condition>.
  2. Replace the COMPARISON PREDICATE with a QUANTIFIED PREDICATE statement. The attempt can be made to change the <SUBQUERY> in such a way that the <SUBQUERY> contains at most one row as the result by specifying DISTINCT or by expanding the <search condition>.


-7016: Parameter spec not allowed in this context (SAP Library - SAP DB)

 Entering content frame

-7016: Parameter spec not allowed in this context

Explanation:

  1. The attempt was made to specify a parameter in a <SELECT COLUMN>.
  2. A COMPARISON PREDICATE of the format <PARAMETER SPEC> <COMP OP> <PARAMETER SPEC> occurs within the SEARCH CONDITION.
  3. A COMPARISON PREDICATE, IN PREDICATE or QUANTIFIED PREDICATE specifies a comparison between a parameter and a SUBQUERY.

User Action:

  1. Replace the parameter with a constant.
  2. It is useful to check such a condition within the application. If this is not possible, replace one of the two parameters with a constant, a column name, or an <EXPRESSION> which does not solely contain parameters.
  3. Replace the parameter with a constant or integrate it into a function (e.g. SUBSTR) so that the data type of the parameter becomes clear.


-7017: User not allowed (SAP Library - SAP DB)

 Entering content frame

-7017: User not allowed

Explanation:

  1. You cannot grant privileges to yourself.
  2. The specified names must not be identical in a <GRANT USER statement>.

User Action:

Correct the user name.


-7018: Variable not allowed in view definition (SAP Library - SAP DB)

 Entering content frame

-7018: Variable not allowed in view definition

Explanation:

Parameters must not be specified in the <CREATE VIEW statement>.

User Action:

Use constants instead of variables.


-7019: Feature not allowed in view definition (SAP Library - SAP DB)

 Entering content frame

-7019: Feature not allowed in view definition

Explanation:

ROWNO specifications are not allowed in a view definition.

User Action:

Remove the ROWNO specification from the SQL statement.


-7021: View column derived from function not allowed (SAP Library - SAP DB)

 Entering content frame

-7021: View column derived from function not allowed

Explanation:

A view table column was specified which was the result of an arithmetic expression or of a set function. In the present case, it is not allowed to specify such a column.

User Action:

To achieve the desired effect try one or more other SQL statements.


-7022: Columns from more than one table not allowed (SAP Library - SAP DB)

 Entering content frame

-7022: Columns from more than one table not allowed

Explanation:

In certain cases, columns from more than one table may not be addressed within an <EXPRESSION>.

User Action:

Consider whether issuing other SQL statements could give the desired result.


-7023: Dropping of all columns (SAP Library - SAP DB)

 Entering content frame

-7023: Dropping of all columns not allowed

Explanation:

You have attempted to drop all the columns in a table. This is not allowed.

User Action:

Delete the table using the DROP TABLE statement. The DROP TABLE statement deletes all view tables, privileges, indexes, CONSTRAINT definitions (REFERENTIAL CONSTRAINT DEFINITION), etc. which depend on this table.

Afterwards, use the CREATE TABLE statement to create a new table with the same name.


-7024: Alter column not allowed, constraint violation (SAP Library - SAP DB)

 Entering content frame

-7024: Alter column not allowed, constraint violation

Explanation:

The attempt was made to redefine a <constraint definition> for a particular column. The SQL statement fails when the table contains rows which do not meet the <CONSTRAINT definition>.

User Action:

  1. Choose another CONSTRAINT DEFINITION or do not change the definition.
  2. Use a <QUERY statement> to find out the rows which do not meet the <CONSTRAINT DEFINITION>. You may change or delete them.


-7026: SQL Sstatement not allowed without previous FETCH (SAP Library - SAP DB)

 Entering content frame

-7026: SQL Sstatement not allowed without previous FETCH

Explanation:

The attempt was made to issue an SQL statement with CURRENT OF for the table (<RESULT TABLE NAME>) without having previously issued a successful <FETCH statement> on the specified result table.

User Action:

Issue a FETCH statement for this result table and repeat the SQL statement.


-7029: Function not allowed for this data type (SAP Library - SAP DB)

 Entering content frame

-7029: Function not allowed for this data type

Explanation:

  1. The attempt was made to use one of the functions DATE, TIME, TIMESTAMP, USER, USERGROUP, STAMP, or TRUE or FALSE for a default specification of a column having a data type not compatible with such a specification.
  2. The attempt was made to call a <FUNCTION SPEC> for a value which does not allow this function to be applied.
  3. The attempt was made to form a <DATETIME EXPRESSION> or <LABELED DURATION> with a value having a data type which is invalid for this purpose.

User Action:

  1. If a default is specified, another default must be chosen, or the default specification must be removed from the SQL statement.
  2. Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the data types of the specified columns. A check can be made as to whether the desired effect can be achieved by a function converting numbers into character strings or vice versa.


-7032: SQL statement not allowed for column of data type LONG (SAP Library - SAP DB)

 Entering content frame

-7032: SQL statement not allowed for column of data type LONG

Explanation:

The command cannot be applied to LONG columns.

User Action:

Use one of the operations allowed for the data type LONG (see Reference manual).


-7035: DEFAULT specification allowed for this column (SAP Library - SAP DB)

 Entering content frame

-7035: DEFAULT specification allowed for this column

Explanation:

An <INSERT> or <UPDATE statement> or a <DEFAULT PREDICATE> was issued with a DEFAULT specification for a column for which no <DEFAULT SPEC> had been defined in the <CREATE TABLE> or any subsequent <ALTER TABLE statement>.

User Action:

Specify the desired value instead of DEFAULT.


-7036: ROWNO specification not allowed in this context (SAP Library - SAP DB)

 Entering content frame

-7036: ROWNO specification not allowed in this context

Explanation:

One of the following conditions was violated:

  1. The specification ROWNO may only be used in <QUERY statement>s. The <QUERY statement> must not contain a UNION, EXCEPT or INTERSECT specification.
  2. The <ROWNO PREDICATE> can be used within the <SEARCH CONDITION> in the form "ROWNO < <ROWNO SPEC>" or "ROWNO <= <ROWNO SPEC>"; i.e. ROWNO is placed on the left of the operator.
  3. The <ROWNO PREDICATE> may occur only once in a <SEARCH CONDITION>. It must be connected with other predicates by a logical AND.

User Action:

  1. In the case of UNION, EXCEPT or INTERSECT, the effect can be achieved by two successive <QUERY statement>s.
  2. Correct the SEARCH condition of the SQL statement accordingly.


-7037: NULL value for NOT NULL column not allowed (SAP Library - SAP DB)

 Entering content frame

-7037: NULL value for NOT NULL column not allowed

Explanation:

The error message is returned for a <REFERENTIAL CONSTRAINT DEFINITION> with ON DELETE SET NULL specification, if a REFERENCING COLUMN does not allow the NULL value.

User Action:

Choose another <ACTION> in the <DELETE RULE> or admit the NULL value for the corresponding column(s) in the referencing table.


-7038: Foreign key column not allowed (SAP Library - SAP DB)

 Entering content frame

-7038: Foreign key column not allowed

Explanation:

A foreign key column is a column which was specified in the <REFERENCING COLUMN> of a <REFERENTIAL CONSTRAINT DEFINITION>.

  1. The attempt was made to delete a table column which was specified as a <REFERENCING COLUMN> of a <CONSTRAINT definition>.
  2. The attempt was made to delete the key of a table. The columns of the key were specified implicitly or explicitly as <REFERENCING COLUMN>s of a <CONSTRAINT definition>.

User Action:

Delete the REFERENTIAL CONSTRAINT DEFINITION and then the column or key.


-7039: Cycle in referential constraint definition invalid (SAP Library - SAP DB)

 Entering content frame

-7039: Cycle in referential constraint definition invalid

Explanation:

An attempt has been made to generate a CONSTRAINT definition (REFERENTIAL CONSTRAINT DEFINITION) which would produce an invalid reference cycle. This CONSTRAINT definition would lead to discrepancies so the database system has rejected it.

User action:

Delete the cycle dependencies.


-7040: Referential constraint not allowed (SAP Library - SAP DB)

 Entering content frame

-7040: Referential constraint not allowed

Explanation:

There is already a REFERENTIAL CONSTRAINT DEFINITION with the specified referencing table. Moreover, CASCADE dependency arises. Under these conditions, all <CONSTRAINT definition>s with the indicated referencing table must specify either CASCADE or RESTRICT.

User Action:

Rethink the desired effect, because it would result in basically contesting situations. The user may see information about the existing REFERENTIAL CONSTRAINT DEFINITIONs using a <QUERY statement> issued on the system table DOMAIN.COL_REFS_COL.


-7041: Result table name not allowed (SAP Library - SAP DB)

 Entering content frame

-7041: Result table name not allowed

Explanation:

In the CREATE VIEW statement a named result table was specified in a FROM condition of the QUERY EXPRESSION. But only base or view tables may be specified.

User Action:

Specify a base or view table in the SQL statement and expand the SEARCH CONDITION to include conditions used when generating the result table.


-7042: Key update not allowed (SAP Library - SAP DB)

 Entering content frame

-7042: Key update not allowed

Explanation:

The attempt was made to change the value of a key column in a temporary table to a new value. This is not allowed. Key columns can only be changed in permanent tables.

User Action:

If another key value is wanted, delete the row with the old key value and insert a row with the new key value.


-7043: Group member not allowed (SAP Library - SAP DB)

 Entering content frame

-7043: Group member not allowed

Explanation:

The following reasons are possible:

  1. The attempt was made to grant privileges to a user of a usergroup.
  2. The attempt was made to alter the characteristics of a user who is a member of a usergroup using an <ALTER USER statement>. User characteristics and privileges cannot be altered for members of a usergroup, but only for the usergroup itself.

User Action:

A database administrator can use a <QUERY statement> issued on the system table DOMAIN.USERS to find out the usergroup to which the respective user belongs. Other users only see the users and usergroups which belong to the same database administrator as they do.

  1. Grant the privileges to the usergroup to which the user belongs.
  2. Replace the ALTER USER with an ALTER USERGROUP statement.


-7045: Parameter spec not allowed (SAP Library - SAP DB)

 Entering content frame

-7045: Parameter spec not allowed

Explanation:

A parameter was specified, although this database component or this kind of application programming only allows the use of constants.

User Action:

Replace the parameter with a constant.


-7046: Column with length greater than 254 not allowed (SAP Library - SAP DB)

 Entering content frame

-7046: Column with length greater than 254 not allowed

Explanation:

The attempt was made to use a CHAR-type column with a length greater than 254 in a statement part that does not allow for such a column. This could have happened, for example, if the attempt was made to change a column with a defined length less than 254 into a column with a defined length greater than 254.

User Action:

Do not use this column in the statement part. Try to achieve the desired effect by application programming. For a change in the defined length, the desired effect could be achieved by replacing the <ALTER definition> with a <MODIFY definition>. However, this is likely to take substantially longer depending on the data records in the accessed table and the indexes defined for it.


-7048: DROP/ALTER USER not allowed while user is connected (SAP Library - SAP DB)

 Entering content frame

-7048: DROP/ALTER USER not allowed while user is connected

Explanation:

The attempt was made to drop a user or to alter the characteristics of a user who was connected. This is only permitted for a user who is not connected.

User Action:

Repeat the SQL statement when the user to be dropped or altered is not connected.


-7050: Fastload with indexed table not allowed (SAP Library - SAP DB)

 Entering content frame

-7050: Fastload with indexed table not allowed

Explanation:

An index is on the table to be loaded. In this case, a fast load is not possible.

User Action:

Delete the index or do without fast loading.


-7051: Read only view WITH CHECK OPTION not allowed (SAP Library - SAP DB)

 Entering content frame

-7051: Read only view WITH CHECK OPTION not allowed

Explanation:

The view table to be created is not updateable. The specification WITH CHECK OPTION is not allowed for non-updateable view tables.

User Action:

Repeat the SQL statement without the WITH CHECK OPTION.


-7055: Column(s) already indexed (SAP Library - SAP DB)

 Entering content frame

-7055: Column(s) already indexed

Explanation:

There is already an index for the specified column(s).

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.IND_USES_COL to check whether the index values are stored in ascending or descending order. No user action is required.


-7056: Subquery not allowed (SAP Library - SAP DB)

 Entering content frame

-7056: Subquery not allowed

Explanation:

A <SUBQUERY> specification in a <CONSTRAINT DEFINITION> is not allowed.

User Action:

  1. The attempt can be made to formulate the <SEARCH CONDITION> in such a way that the <SUBQUERY> is not necessary.
  2. The attempt can be made to achieve the desired effect by defining a trigger that checks the condition.


-7057: View definition contradicts new table definition (SAP Library - SAP DB)

 Entering content frame

-7057: View definition contradicts new table definition

Explanation:

  1. The attempt was made to add a column to a table or to drop a column from a table. When creating the specified view table, SELECT * was used and new names were assigned to the view table columns. After table modification, the number of names would no longer coincide with the number of table columns.
  2. The attempt was made to drop a REFERENTIAL CONSTRAINT DEFINITION which is the prerequisite for an updateable join view table.

User Action:

  1. Delete the view table and define it again. Specify the required columns individually in the SELECT COLUMN of the QUERY EXPRESSION.
  2. It is only possible to delete the REFERENTIAL CONSTRAINT DEFINITION by deleting the modifiable view table first.


-7058: Correlated subquery with select in from clause not allowe (SAP Library - SAP DB)

 Entering content frame

-7058: Correlated subquery with select in from clause not allowed

Explanation:

A <QUERY EXPRESSION> specification in the <FROM clause> of a correlated subquery is not allowed.

User Action:

Formulate the corresponding subquery to leave out the QUERY EXPRESSION. If this is not possible, split the SQL statement into at least two SQL statements and generate a named result table that can be used in the <FROM clause>.


-7060: Remote TABLE LOAD/UNLOAD not allowed (SAP Library - SAP DB)

 Entering content frame

-7060: Remote TABLE LOAD/UNLOAD not allowed

Explanation:

DATALOAD with NOLOG option or UNLOAD cannot be performed for a table stored on a serverdb other than that to which you are connected.

User Action:

The SQL statement can be repeated if the NOLOG option is not specified or if you connect to the serverdb where the table is stored.


-7061: LOCK ROW for this table not allowed (SAP Library - SAP DB)

 Entering content frame

-7061: LOCK ROW for this table not allowed

Explanation:

A <LOCK statement> with <ROW LOCK SPEC> specification can only be performed for an updateable join view table. But not even updateable join view tables allow a <ROW LOCK SPEC> with OPTIMISTIC specification.

User Action:

The effect can be achieved by several <ROW LOCK SPEC> specifications issued on the underlying base tables.


-7063: Temp table not allowed (SAP Library - SAP DB)

 Entering content frame

-7063: Temp table not allowed

Explanation:

Only a subset of data definition statements is allowed for temporary tables; among them, the SQL statements for creating and deleting tables and for making the existence check.

User Action:

Decide whether the SQL data definition statement can be removed or whether a permanent table is to be created instead of the temporary table.


-7064: Feature not allowed in temp table definition (SAP Library - SAP DB)

 Entering content frame

-7064: Feature not allowed in temp table definition

Explanation:

It is not possible to specify a REFERENTIAL CONSTRAINT DEFINITION for a temporary table.

User Action:

Repeat the SQL statement without the invalid specification, or create a permanent table instead of the temporary table.


-7065: SUBTRANS COMMIT/ROLLBACK not allowed wthout SUBTRANS BEGI (SAP Library - SAP DB)

 Entering content frame

-7065: SUBTRANS COMMIT/ROLLBACK not allowed without SUBTRANS BEGIN

Explanation:

The corresponding SQL statement SUBTRANS BEGIN must have been called for each subtransaction to be closed.

User Action:

Check the database application for the dynamic behavior of the <SUBTRANS statement>.


-7066: Unique index referenced by foreign key not allowed (SAP Library - SAP DB)

 Entering content frame

-7066: Unique index referenced by foreign key not allowed

Explanation:

The specified index cannot be deleted, because the columns contained in it were specified as referenced columns of the REFERENCED TABLE in a REFERENTIAL CONSTRAINT DEFINITION.

User Action:

The index can only be deleted after deleting the corresponding REFERENTIAL CONSTRAINT DEFINITION. Use a <QUERY statement> issued on the system table DOMAIN.COL_REFS_COL to find out which <CONSTRAINT definition>s are defined.


-7067: Update without repeated read not allowed (SAP Library - SAP DB)

 Entering content frame

-7067: Update without repeated read not allowed

Explanation:

An optimistic lock was set to at least one table row by a previous SQL statement. Afterwards, another database user updated at least one of these rows. The database user who set the optimistic lock can make new changes to this row only after reading it with an (optimistic) lock.

User Action:

The row to be updated must be read again with an (optimistic) lock.


-7068: Outer join not allowed in this context (SAP Library - SAP DB)

 Entering content frame

-7068: Outer join not allowed in this context

Explanation:

An <OUTER JOIN INDICATOR> was used in a <COMPARISON PREDICATE> in which no table column was specified in one of the two EXPRESSIONs. An <OUTER JOIN INDICATOR> is only allowed in a <JOIN PREDICATE>.

User Action:

You can repeat the SQL statement without the OUTER JOIN INDICATOR.


-7071: AUTOSAVE LOG must be stopped (SAP Library - SAP DB)

 Entering content frame

-7071: AUTOSAVE LOG must be stopped

Explanation:

The attempt was made to perform a SHUTDOWN. This is not possible as long as the autosave is active.

User Action:

First stop Autosave and then perform the SHUTDOWN.


-7072: More than one column with default SERIAL not allowed (SAP Library - SAP DB)

 Entering content frame

-7072: More than one column with default SERIAL not allowed

Explanation:

You tried to assign the DEFAULT SPEC DEFAULT SERIAL more than once when a base table was defined. No more than one column may exist in each base table with the <default spec> DEFAULT SERIAL.

User Action:

Decide on the column in which you want to leave out this definition. Then repeat the modified SQL statement.


-7074: Cycle in granted roles not allowed (SAP Library - SAP DB)

 Entering content frame

-7074: Cycle in granted roles not allowed

Explanation:

The following reasons are possible:

  1. You tried to assign a role to itself.
  2. You tried to assign role definitions cyclically.

User Action:

Check whether there is a typing error. If this is not so, check whether the roles which would result in the cycle can be combined to one role.


-7075: Current SAVE SKIPPED, next is ready to take on this tape (SAP Library - SAP DB)

 Entering content frame

-7075: Current SAVE SKIPPED, next is ready to take on this tape

Explanation:

You tried to restore a log backup from a no rewind tape. The given backup is older than the one required. It could still be saved on this tape.

User Action:

Try to carry out the RESTORE with the next backup on this tape.


-7076: No more data to read from tape (SAP Library - SAP DB)

 Entering content frame

-7076: No more data to read from tape

Explanation:

You tried to restore a log backup from a no rewind tape. The given backup is older than the one required. There is no other backup on this tape.

User Action:

You no longer need the current tape. Insert the tape with the required backup and repeat the command.


-7077: Synonym not allowed (SAP Library - SAP DB)

 Entering content frame

Background documentation -7077: Synonym not allowed

Explanation:

You have used an invalid synonym name within a CREATE TRIGGER or CREATE DBPROC statement.

User Action:

Instead of using the synonym name, use the full name for which the synonym was originally defined.


-7078: No backup is running (SAP Library - SAP DB)

 Entering content frame

Background documentation -7078: No backup is running

Explanation:

An attempt was made to cancel a backup but no backup was running.

User Action:

No user action required.


-7079: A backup is already running (SAP Library - SAP DB)

 Entering content frame

Background documentation -7079: A backup is already running

Explanation:

An attempt was made to start a backup while another backup is running. You can only run one backup at a time.

User Action:

No user action is possible.


-7080: Query in statement not allowed (SAP Library - SAP DB)

 Entering content frame

Background documentation -7080: Query in statement not allowed

Explanation:

The search condition of an IF or WHILE statement contains a query statement.

This is not allowed.

User Action:

Execute the query statement outside of the IF or WHILE statement, and save the results in program variables.

Then use these results in the IF or WHILE statement.


-7500: DCOM HRESULT (SAP Library - SAP DB)

 Entering content frame

Background documentation -7500: DCOM HRESULT

Explanation

An unexpected error occurred during the CREATE PACKAGE statement. The exact cause of the error is signified by a numerical value (HRESULT) in the error message.

User action

This type of error suggests that certain entries in the registration database are incorrect or missing.

Ensure that the reference to the relevant library in the programatic ID is correct. Also make sure that this library exists in the given location and that the appropriate privileges are assigned.

If this fails to solve the problem, inform your SAP DB support team of the error number (HRESULT) so they can analyze the error.


-7501: ProgramaticId not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -7501: ProgramaticId not found

Explanation

The programatic ID specified in a CREATE PACKAGE statement could not be found in the registration database.

This could be due to a spelling mistake or the relevant library has not been registered correctly.

User action

Correct the spelling mistake or register the library.


-7503: Constructor not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -7503: Constructor not found

Explanation

The CREATE DBPROC statement of an external C++ database procedure contains a database procedure name that does not match any of the C++ method names in the library identified by the package.

User action

Correct the spelling of the database procedure name.


-7506: Parameter type not supported (SAP Library - SAP DB)

 Entering content frame

Background documentation -7506: Parameter type not supported

Explanation

In a CREATE DBPROC statement , you have specified a C++ method that contains at least one parameter that is not supported. For example, IN parameters with the signature int* are not supported.

User action

Rewrite the C++ method so that it only contains parameters that are supported.


-7900: Different block sizes (SAP Library - SAP DB)

 Entering content frame

-7900: Different block sizes

Explanation:

The block sizes specified for the restore and used for the backup differ from each other. The restore cannot be terminated successfully.

User Action:

The block size used for the corresponding save must also be used for the restore operation.


From -8000 to -9799 (SAP Library - SAP DB)

 Entering content frame

From -8000 to -9799

Database Kernel Error Messages

-8000 | SERVERDB must be restarted
-8001 | User must be connected
-8002 | User already connected to this user task
-8003 | Log and data must be compatible
-8004 | Constant must be compatible with column type and length
-8005 | Value expression must be parameter name
-8006 | Data types must be compatible
-8007 | Column must be key column
-8009 | DEFAULT value must be in constraint specification
-8010 | Table name must be in from list
-8013 | Order column must be output column
-8014 | Result table must be FOR REUSE
-8015 | Table must be a base table
-8016 | Table must be a view table
-8017 | Column must be group column
-8018 | Index name must be unique
-8020 | Next volume required
-8021 | Column must have DEFAULT specification
-8022 | User already connected
-8023 | COSTLIMIT must be greater than COSTWARNING
-8024 | RESTORE CATALOG failed
-8025 | Table must be temp table
-8028 | UNION columns must be compatible
-8030 | Column must be indexed
-8031 | Owner must be specified
-8033 | Imcomplete log segment
-8034 | Order column must be number
-8035 | Foreign key must exist
-8037 | DB procedure must be recompiled
-8040 | Key does not exist
-8044 | Conversion for character set value impossible
-8045 | Conversion to UNICODE impossible
-8046 | Conversion from UNICODE impossible
-8047 | Password required
-8048 | Version of component must be compatible with kernel version
-8050 | Migration error
-8888 | SERVERDB not accessible
-9000 | System error: Not yet implemented
-9001 to -9799 | System error


-8000: Serverdb must be restarted (SAP Library - SAP DB)

 Entering content frame

-8000: Serverdb must be restarted

Explanation:

It is not possible to work on the serverdb because it was shut down.

User Action:

You can now warmstart the database.


-8001: User must be connected (SAP Library - SAP DB)

 Entering content frame

-8001: User must be connected

Explanation:

An database session can only be opened with a <CONNECT statement>.

User Action:

Specify a CONNECT statement.


-8002: User already connected (SAP Library - SAP DB)

 Entering content frame

-8002: User already connected

Explanation:

A user already connected to the database entered another <CONNECT statement>.

User Action:

If the user wants to continue working under another user name, he must specify first a <RELEASE statement> and then a <CONNECT statement>.


-8003: The log and data area must be compatible (SAP Library - SAP DB)

 Entering content frame

-8003: The log and data area must be compatible

Explanation:

  1. If you start the serverdb while it is WARM, the result of the check will be that the data area of the serverdb and the current log have a different status.
  2. When the log segments are imported, the result of the check is that the import sequence is incorrect.

User action:

  1. Restore the database system by specifying the correct backup version.
  2. Import all the necessary log segments in the correct order.

You can now warmstart the database.


-8004: Constant must be compatible with column type and length (SAP Library - SAP DB)

 Entering content frame

-8004: Constant must be compatible with column type and length

Explanation:

The specified constant does not match the data type for this column.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the definition of the affected column. Specify a constant with the correct data type.


-8005: Value expression must be parameter name (SAP Library - SAP DB)

 Entering content frame

-8005: Value expression must be parameter name

Explanation:

When calling a DB procedure, not a parameter but a constant value was specified for an OUT or IN/OUT parameter.

User Action:

Replace the specified constant with a parameter.


-8006: Data types must be compatible (SAP Library - SAP DB)

 Entering content frame

-8006: Data types must be compatible

Explanation:

  1. A <function> was applied to a non-permitted argument.
  2. A two-digit operation was applied to non-comparable values.
  3. A <predicate> contains non-comparable data types.

Each data type can be compared to itself. Columns of data type CHAR with the different code attributes ASCII and EBCDIC can be compared to each other; they are implicitly adapted. Columns with the code attribute ASCII and EBCDIC can be compared to date, time and timestamp specifications.

All numbers can be compared to each other.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the affected columns. If need be, the attempt can be made to achieve comparability by applying a <CONVERSION function>.


-8007: Column must be key column (SAP Library - SAP DB)

 Entering content frame

-8007: Column must be key column

Explanation:

The specification of a non-key column is not allowed here.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.COLUMNS to find out the columns which belong to the table key. Only these columns can be specified at this position within the SQL statement.


-8009: DEFAULT value must be in constraint specification (SAP Library - SAP DB)

 Entering content frame

-8009: DEFAULT value must be in constraint specification

Explanation:

The specified DEFAULT value would violate the <CONSTRAINT DEFINITION>.

User Action:

  1. The corresponding <CONSTRAINT definition> must be reconsidered and modified, if necessary.
  2. Use another DEFAULT value, or do not specify a default value at all.


-8010: Table name must be in from list (SAP Library - SAP DB)

 Entering content frame

-8010: Table name must be in from list

Explanation:

A table name which was not listed in the <FROM clause> was specified in a <SELECT COLUMN>, <SEARCH CONDITION> or <ORDER CLAUSE>.

User Action:

  1. If a reference name was specified for a table name, use this reference name in the SQL statement.
  2. If the <FROM clause> contains the specification of a table which does not belong to the current user, to this user's user class or DBA, and which is not a system table, the <OWNER> must be specified for the table throughout the SQL statement.


-8013: Order column must be output column (SAP Library - SAP DB)

 Entering content frame

-8013: Order column must be output column

Explanation:

  1. Only column names which are also specified as <SELECT COLUMN> can be specified in the <ORDER CLAUSE> of a <QUERY statement> with DISTINCT specification.
  2. If a column number is specified, you must ensure that this number is not greater than the number of specified output columns.
  3. The number of output columns may have decreased in case of a SELECT * as a result of an <ALTER TABLE statement> with <DROP DEFINITION>.

User Action:

  1. Do not use the DISTINCT specification or specify the column of the <ORDER CLAUSE> in a <SELECT COLUMN>.
  2. Correct the number in the <ORDER CLAUSE> accordingly.


-8014: Result table must be FOR REUSE (SAP Library - SAP DB)

 Entering content frame

-8014: Result table must be FOR REUSE

Explanation:

A named result table which was not created with FOR REUSE was used in the <FROM clause> of a <QUERY statement> or SINGLE SELECT statement.

User Action:

Create the named result table with FOR REUSE and reissue the SQL statement.


-8015: Table must be base table (SAP Library - SAP DB)

 Entering content frame

-8015: Table must be base table

Explanation:

The specification of a base table is expected. This specification is missing or the specified table is not a base table.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TABLES to find out whether the specified table is a view table or result table. If it is a view table, use a <QUERY statement> issued on the system table DOMAIN.VIEWDEFS to find out the pertinent base table. The desired SQL statement can then be issued for the base table, if you have the corresponding privileges.


-8016: Table must be a view table (SAP Library - SAP DB)

 Entering content frame

-8016: Table must be a view table

Explanation:

In a <RENAME VIEW> or <DROP VIEW statement>, a table was specified which is not a view table.

User Action:

Specify a view table in the SQL statement or replace the SQL statement with a <RENAME TABLE > or <DROP TABLE statement>.


-8017: Column must be group column (SAP Library - SAP DB)

 Entering content frame

-8017: Column must be group column

Explanation:

A column which is not a group column, i.e., which is not contained in the <GROUP CLAUSE>, was specified in a <SELECT COLUMN> or in the <HAVING CLAUSE>. Columns which are not group columns may only occur in arguments of the functions COUNT, SUM, AVG, MAX, MIN, STDDEV and VARIANCE.

User Action:

Insert the specified column into the <group clause> as a further group column or remove it from the <SELECT COLUMN> or <HAVING CLAUSE>.


-8018: Index name must be unique (SAP Library - SAP DB)

 Entering content frame

-8018: Index name must be unique

Explanation:

  1. This error message can occur when a <DROP INDEX statement> is executed. Indexes with identical names were created for separate tables. Therefore the name of the index to be deleted is not unique.
  2. There is only a named single-column index for this column. The attempt was made to delete the index for this column without specifying its name.

User Action:

  1. Specify the name of the table to which the index to be deleted refers in the <DROP INDEX statement>.
  2. Delete the index specifying its name.


-8020: Next volume required (SAP Library - SAP DB)

 Entering content frame

Background documentation -8020: Next volume required

Explanation

1. The current backup medium has no space left.

2. Not all backup media for this backup were specified when the data backup was imported.

3. The next log backup medium is requested for the log backup import.

User action

...

1. Specify another backup medium.

2. Complete the list of backup media.

3. Specify the next log backup medium, if it exists, or terminate the import of the log backup manually.


-8021: Column must have DEFAULT specification (SAP Library - SAP DB)

 Entering content frame

-8021: Column must have DEFAULT specification

Explanation:

The attempt was made to specify the <action> SET DEFAULT as <DELETE RULE> in a REFERENTIAL CONSTRAINT DEFINITION, although no DEFAULT value had been defined for at least one section of the <REFERENCING COLUMN>.

User Action:

  1. If the error occurred during the execution of a <CREATE TABLE statement>, either define a DEFAULT value for the column(s) or choose another <ACTION>.
  2. If the error occurred during the execution of an <ALTER TABLE statement>, issue another <ALTER TABLE statement> to assign a DEFAULT value to all columns (REFERENCING COLUMN) without a DEFAULT value and then repeat the previous <ALTER TABLE statement>. Alternatively, you may choose another ACTION.


-8022: User already connected (SAP Library - SAP DB)

 Entering content frame

-8022: User already connected

Explanation:

A user attempts to connect to the database system under a user name which was defined with EXCLUSIVE in a <CREATE USER>, <CREATE USERGROUP>, <ALTER USER>, or <ALTER USERGROUP statement>. Another user has connected using this name.

User Action:

Wait until the other user has disconnected using a <RELEASE statement>.

To enable a user to have various simultaneous connects, NOT EXCLUSIVE must be specified for this user with the <ALTER USER> or <ALTER USERGROUP statement>. These SQL statements may only be executed by the owner of the user or usergroup.


-8023: COSTLIMIT must be greater than COSTWARNING (SAP Library - SAP DB)

 Entering content frame

-8023: COSTLIMIT must be greater than COSTWARNING

Explanation:

A COSTLIMIT value was specified which was less than or equal to the specified COSTWARNING value. The COSTLIMIT value, however, must be greater than the COSTWARNING value.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.USERS to find out the COSTWARNING value for existing users.


-8024: RESTORE CATALOG failed (SAP Library - SAP DB)

 Entering content frame

Background documentation -8024: RESTORE CATALOG failed

Explanation

Parts of the database catalog are deleted and then restored during certain data definition statements .

If an unexpected error occurs, error -8024 is displayed.

User action

Create a database trace of the last database activities and save it.

Send the database trace to your SAP DB support team so they can trace and rectify the error.


-8025: Table must be temp table (SAP Library - SAP DB)

 Entering content frame

-8025: Table must be temp table

Explanation:

In a <CREATE TABLE statement>, the option IGNORE ROLLBACK was specified for a permanent table. This is not allowed.

User Action:

You can repeat the SQL statement. To do this you either need to deselect the option IGNORE ROLLBACK or a create temporary table, by specifying TEMP as <OWNER> of the table to be created.


-8028: UNION columns must be compatible (SAP Library - SAP DB)

 Entering content frame

-8028: UNION columns must be compatible

Explanation:

In a <QUERY EXPRESSION> with at least a UNION, INTERSECT or EXCEPT specification, all sequences of SELECT COLUMNS must designate the same number of columns. The data types of the corresponding columns must thereby comply with the conditions valid for comparability.

Each data type can be compared to itself. Columns of data type CHAR with the different code attributes ASCII and EBCDIC can be compared to each other; they are implicitly adapted. Columns with the code attribute ASCII and EBCDIC can be compared to date, time, and timestamp specifications.

All numbers can be compared to each other.

In SQLMODE ANSI, it is not sufficient that the data types and lengths of the specified columns are compatible; they must be equal. Moreover, only <COLUMN SPEC> or * may be specified in the SELECT COLUMNs of the QUERY specs connected by UNION. The specification of LITERALs is not allowed.

User Action:

Use a QUERY statement issued on the system table DOMAIN.COLUMNS to find out the current definition of the affected columns. It may be attempted to achieve comparability by applying a <CONVERSION function>.

This request cannot be made in SQLMODE ANSI.


-8030: Column must be indexed (SAP Library - SAP DB)

 Entering content frame

-8030: Column must be indexed

Explanation:

No index was created on the specified column.

In a REFERENTIAL CONSTRAINT DEFINITION, the columns (REFERENCED COLUMN) must either designate the key of the table or columns which form an index defined with UNIQUE.

User Action:

You can display a list of existing indexes using a QUERY statement based on the system table SYSODBCINDEXES. Create the desired index, or do without the index.


-8031: Owner must be specified (SAP Library - SAP DB)

 Entering content frame

-8031: Owner must be specified

Explanation:

In a database procedure the OWNER must be specified for each TABLE NAME.

User Action:

Correct the database procedure accordingly.


-8032: Table must be a snapshot table (SAP Library - SAP DB)

 Entering content frame

-8032: Table must be a snapshot table

Explanation:

A <DROP SNAPSHOT statement> or <REFRESH statement> was specified. The specified name does not denote a snapshot table.

User Action:

Use a <QUERY statement> issued on the system table DOMAIN.TABLES to find out the existing snapshot tables.


-8033: Incomplete log segment (SAP Library - SAP DB)

 Entering content frame

Background documentation -8033: Incomplete log segment

Explanation:

You tried to save the log. However, the log is smaller than defined in the installation parameter LOG_SEGMENT_SIZE.

User Action:

No action required.


-8034: Order column must be number (SAP Library - SAP DB)

 Entering content frame

-8034: Order column must be number

Explanation:

In a QUERY EXPRESSION with at least a UNION, INTERSECT or EXCEPT specification, the ORDER CLAUSE must not contain any COLUMN SPECs.

User Action:

Replace the column specifications by the corresponding numbers of the output columns.


-8035: Foreign key must exist (SAP Library - SAP DB)

 Entering content frame

-8035: Foreign key must exist

Explanation:

An <UPDATE statement> was performed for an updatable join view table. This <UPDATE statement> leads to an internal insert into one of the underlying base tables. The specifications made in the <UPDATE statement> are not sufficient to form all mandatory columns which are needed for the implicit <INSERT statement>.

User Action:

Issue an <INSERT statement> on the underlying base table. This can prevent the necessity of inserting when performing the <UPDATE statement> on the join view table.


-8037: DB procedure must be recompiled (SAP Library - SAP DB)

 Entering content frame

-8037: DB procedure must be recompiled

Explanation:

SQL statements for data definition were performed which concern tables used in the DB procedure. Check by compilation whether the DB procedure is still executable.

User Action:

This check can only be made by the owner of the DB procedure by restoring the DB procedure.


-8039: Snapshot log does not exist (SAP Library - SAP DB)

 Entering content frame

-8039: Snapshot log does not exist

Explanation:

The attempt was made to delete the snapshot log for the specified table. The specified table has no snapshot log.

User Action:

The SQL statement is not needed because there is already the desired result.


-8040: Key does not exist (SAP Library - SAP DB)

 Entering content frame

-8040: Key does not exist

Explanation:

The attempt was made to delete the key for the specified table. The specified table has no user-defined key. The key implicitly generated with the column SYSKEY cannot be deleted.

User Action:

The SQL statement is not needed because there is already the desired table definition.


-8044: Conversion for character set value impossible (SAP Library - SAP DB)

 Entering content frame

Background documentation -8044: Conversion for character set value impossible

Explanation

You tried to convert data in ASCII or UCS-2 format (see also UNICODE ) into another format. This attempt has failed.

User action

You cannot perform a conversion explicitly. You can try to avoid this error by explicitly converting the data used, for example, for comparisons.


-8045: Conversion to UNICODE impossible (SAP Library - SAP DB)

 Entering content frame

Background documentation -8045: Conversion to UNICODE impossible

Explanation

You tried to convert data in ASCII format (see also UNICODE ) into UCS-2 format. This attempt has failed.

User action

You cannot perform a conversion explicitly. You can try to avoid this error by explicitly converting the UCS-2 data used, for example, for comparisons.


-8046: Conversion from UNICODE impossible (SAP Library - SAP DB)

 Entering content frame

Background documentation -8046: Conversion from UNICODE impossible

Explanation

You tried to convert data in UCS-2 format (see also UNICODE ) into an ASCII format. This is not possible because the data contains characters other than Latin1 characters.

User action

Check whether the data is correct.

You cannot perform a conversion explicitly. You can try to avoid this error by explicitly converting the ASCII data used, for example, for comparisons.


-8047: Password required (SAP Library - SAP DB)

 Entering content frame

-8047: Password required

Explanation:

With a <SET statement> you tried to activate a role which requires the definition of a password.

User Action:

Repeat the SQL statement, also specifying the password.


-8048: Version of component must be compatible with kernel versi (SAP Library - SAP DB)

 Entering content frame

-8048: Version of component must be compatible with kernel version

Explanation:

You tried to use a component whose release number is much smaller than that of the database kernel used. Since the interface between the components and the database kernel has changed significantly, this is not possible.

User Action:

Use a component whose release number corresponds to that of the database kernel used.


-8049: Prepare migration required (SAP Library - SAP DB)

 Entering content frame

Background documentation -8049: Prepare migration required

Explanation

Once you had imported SAP DB Version 7.4, you were not able to start the INPLACE migration because no preparations had been made in the original database version for migration.

User action

...

1. Import the original database version again.

2. Switch the database to ONLINE mode.

3. Shut down the database instance.

4. Run the Database Manager CLI command migrate in a utility session while the database is in ADMIN mode.

This deletes data that is no longer support in Version 7.4.

5. Import Version 7.4 again and restart the INPLACE migration.


-8050: Migration error (SAP Library - SAP DB)

 Entering content frame

Background documentation -8050: Migration error

Explanation

An error has occurred while migrating a database instance with a database catalog stored in ASCII format (database parameter _UNICODE = NO) to a UNICODE-enabled database instance (database parameter _UNICODE = YES). The cause of the error is logged in the file knldiag or knldiag.err.

User action

The action you need to take depends on what caused the error:

  • "RESTART REQUIRED BEFORE MIGRATION"
    The database instance and its current software needs to have been in ONLINE mode at least once before the migration can start.
  • "UNHANDLED ENTRY TYPE: " + number of record type
    The database catalog contains a record type that will not be migrated. All unhandled records are collected and an entry written for each one. Please inform the     SAP DB support team.
  • "ERROR HANDLING TYPE " + number of record type
    An error has occurred while processing a database catalog record of the type shown in the message. Migration is cancelled. The record is saved in the     work directory under the name MIGERRORREC.BIN. Please inform the SAP DB support team.
  • "ERROR WHEN RECREATING VIEW" + initial text of the defined view
    An error has occurred while restoring a view table.
    Depending which error has occurred, you must delete the relevant view table and, if necessary, regenerate it after the migration.
  • "MIGRATION FAILED FOR TRIGGER:" or "MIGRATION FAILED FOR DBPROC:"
     Database procedures or triggers have been defined based on tables. However, the tables, columns, or users have since been renamed. These cannot be recreated. The system generates a list of all the database procedures and triggers that cannot be recreated. Migration is then cancelled.
    The database procedures/triggers could no longer be used at the time of migration, so have to be deleted.
  • "CONSTRAINTTEXT IS TOO LONG:" + name of constraint
    A constraint's definition text would exceed the maximum length if it were converted to     UNICODE during migration. You must either delete or modify the constraint.
  • "CATALOG IS UNICODE ALREADY"
    The database instance already appears to be UNICODE-enabled.
  • "_UNICODE has to be YES for migration"
    The migration was started even though the database parameter _UNICODE was set as NO.


-8888: SERVERDB not accessible (SAP Library - SAP DB)

 Entering content frame

-8888: SERVERDB not accessible

Explanation

The attempt was made to start a session. This is impossible for one of the following reasons:

  1. The serverdb name was incorrectly specified.
  2. The database server was not started.

User Action:

  1. Check the serverdb name.
  2. Start the database server. Pay attention to errors that might occur.


-9000: SYSTEM ERROR: NOT YET IMPLEMENTED (SAP Library - SAP DB)

 Entering content frame

-9000: SYSTEM ERROR: NOT YET IMPLEMENTED

Explanation:

This SQL statement is not yet implemented. It will be available in future releases.

User Action:

To achieve the desired effect try one or more other SQL statements.


-9001 to -9799: System error (SAP Library - SAP DB)

 Entering content frame

-9001 to -9799: System error

Explanation:

These error messages should not occur during normal operation on a consistent database. With some errors, an implicit SHUTDOWN is performed.

User Action:

As a rule, the database should be shut down and you should contact your local support organization. Create a trace of the last database activities and save it. Send the trace to your local support organization so they can trace and rectify the error.


From -9800 to -9999 (SAP Library - SAP DB)

 Entering content frame

From -9800 to -9999

Precompiler error messages

-9801 | Invalid command state
-9803 | Unknown data type
-9805 | Option CHECK usage on or off error
-9806 | Invalid output value
-9807 | Too many users
-9808 | SET FORMAT error
-9809 | Option CHECK usage add error


-9801: Invalid command state (SAP Library - SAP DB)

 Entering content frame

-9801: Invalid command state

Explanation:

The command state is invalid.

This is a runtime error of the precompiler.

User Action:

Please inform your local support organization.


-9803: Unknown data type (SAP Library - SAP DB)

 Entering content frame

-9803: Unknown data type

Explanation:

The data type is not known in the database.

User Action:

Please inform your local support organization.


-9805: Option CHECK usage on or off error (SAP Library - SAP DB)

 Entering content frame

-9805: Option CHECK usage on or off error

Explanation:

When the option CHECK is specified, the SYSUSAGE entries are maintained at the end of a precompiler run. An error occurred in this case.

User Action:

For error analysis and correction, pay attention to all error messages output during the precompiler run. For further information refer to the corresponding error numbers in this manual.


-9806: Invalid output value (SAP Library - SAP DB)

 Entering content frame

-9806: Invalid output value

Explanation:

The define byte in the command buffer is set to an invalid value.

User Action:

Check whether the kernel and the precompiler used for translating the application have the same version number. If the version numbers agree, notify your database administrator.

If the error occurs during the execution of a SELECT DIRECT statement, it might be remedied by setting the runtime option NO SELECT DIRECT FAST (optimizing the statement is disabled). If the error still occurs, notify your database administrator.


-9807: Too many users (SAP Library - SAP DB)

 Entering content frame

-9807: Too many users

Explanation:

All sessions of the database are occupied.

User Action:

Wait until a session is released. If this problem arises frequently, the configuration of the database must be checked and modified by the database administrator.


-9808: SET FORMAT error (SAP Library - SAP DB)

 Entering content frame

-9808: SET FORMAT error

Explanation:

An implicit SET FORMAT is issued to the database after every CONNECT. This determines which date and time formats are used. If an error occurs at the SET FORMAT command, the database standard format is taken as default.

User Action:

Restart the program and thereby avoid the error. If the SET FORMAT error occurs repeatedly, notify the database administrator.


-9809: Option CHECK usage add error (SAP Library - SAP DB)

 Entering content frame

-9809: Option CHECK usage add error

Explanation:

When the option CHECK is specified, the SYSUSAGE entries for SQL-PL, FORM, REPORT, PROC, QUERY, COMMAND and PREPARE are maintained at the end of a precompiler run. An error occurred in this case.

User Action:

For error analysis and correction, pay attention to all error messages output during the precompiler run. For further information refer to the corresponding error numbers in this manual.


From -22000 to -22999 (SAP Library - SAP DB)

 Entering content frame

From -22000 to -22999

Error messages of the ODBC program

-22000 | Null values not allowed on more than one long column
-22005 | Connection timeout occured. Session reconnected


-22000: Null values not allowed on more than one long column (SAP Library - SAP DB)

 Entering content frame

-22000: Null values not allowed on more than one long column

Explanation:

In an INSERT or UPDATE command, at most one long column may have the value NULL if long columns are inserted with the functions SQLParamData and SQLPutData .

User Action:

Only include one long column in the command or use empty strings instead of NULL values.


-22005: Connection timeout occurred. Session reconnected (SAP Library - SAP DB)

 Entering content frame

-22005: Connection timeout occurred. Session reconnected

Explanation:

The user transaction was terminated and rolled back by an implicit ROLLBACK statement. The database session was terminated because the user failed to carry out any operations during a certain period of time (installation parameter SESSION_TIMEOUT or the TIMEOUT value specified in the <CONNECT statement>).

The ODBC driver recognizes the timeout in this type of instance and logs the user back on to the database automatically using the original parameters (user name, password, DB server, server node, etc.). Each command of the relevant session signals this with return code SQL_SUCCESS_WITH_INFO and SQLCode -22005.

User action:

All commands having a result set (CURSOR) must be executed again in order to ensure that the result sets are built up again. If the connection is set to SQL_AUTOCOMMIT_OFF, all the other commands that were in an open transaction must also be executed again.


From -23000 to -23999 (SAP Library - SAP DB)

 Entering content frame

From -23000 to -23999

Error Messages of the SQL Studio Program

-23050 | Unknown error
-23051 | Could not load system tables for SQL Studio
-23052 | Could not save object data
-23053 | Cannot load suppose list
-23054 | Maximum numbers of windows reached
-23055 | Connection failed
-23056 | User is exclusive
-23057 | Reconnect failed
-23058 | No database connection
-23059 | You do not have the permission to modify this object
-23060 | You do not have the permission to delete this object
-23061 | Cannot analyze error
-23062 | Could not open connection
-23063 | Could not create Global Com Object
-23064 | Import failed
-23070 | Cannot open object created by newer SQL Studio Version
-23071 | Convert object created by older SQL Studio Version
-23072 | Representation of null value too long
-23100 | OLE Error Please restart SQL Studio
-23101 | Data in clipboard truncated
-23102 | Failed to create DBC Pool
-23103 | Failed to create DBC Handle
-23104 | Could not load table definition
-23200 | No data sources
-23201 | No ODBC driver
-23202 | Could not load object description
-23203 | Cannot show tables of users, wrong database version


-23050: Unknown error (SAP Library - SAP DB)

 Entering content frame

-23050: Unknown error

Explanation:

An unknown error has occurred.

User Action:

Contact your local support organization.


-23051: Could not load system tables for SQL Studio (SAP Library - SAP DB)

 Entering content frame

-23051: Could not load system tables for SQL Studio

Explanation:

The database does not contain the system tables needed for the SQL Studio.

User Action:

Reload the system tables using the tools dbmcli or dbmgui.

If you receive the same error message again, contact your local support organization.


-23052: Could not save object data (SAP Library - SAP DB)

 Entering content frame

-23052: Could not save object data

Explanation:

An SQL Studio object could not be saved.

User Action:

Reload the system tables using the tools dbmcli or dbmgui.

If you receive the same error message again, contact your local support organization.


-23053: Cannot load suppose list (SAP Library - SAP DB)

 Entering content frame

-23053: Cannot load suppose list

Explanation:

The SQL support could not be loaded.

User Action:

Reload the system tables using the tools dbmcli or dbmgui.

If you receive the same error message again, contact your local support organization.


-23054: Maximum numbers of windows reached (SAP Library - SAP DB)

 Entering content frame

-23054: Maximum numbers of windows reached

Explanation:

The maximum number of windows have been opened.

User Action:

Close some windows.


-23055: Connection failed (SAP Library - SAP DB)

 Entering content frame

-23055: Connection failed

Explanation:

You were unable to connect to the database.

User Action:

Check the status of the database using the tools dbmcli and dbmgui.


-23056: User is exclusive (SAP Library - SAP DB)

 Entering content frame

-23056: User is exclusive

Explanation:

An attempt has been made to connect to the database several times using an exclusive user.

User Action:

If the user really needs to connect to the database more than once, use the SQL Studio tools to change the user to a not-exclusive user.


-23057: Reconnect failed (SAP Library - SAP DB)

 Entering content frame

-23057: Reconnect failed

Explanation:

An attempt to restore an interrupted connection to the database has failed.

User Action:

Check the status of the database using the tools dbmcli and dbmgui.

End the session and log on to the database again.


-23058: No database connection (SAP Library - SAP DB)

 Entering content frame

-23058: No database connection

Explanation:

The connection to the database has been broken.

User Action:

Check the status of the database using the tools dbmcli and dbmgui.

End the session and log on to the database again.


-23059: You do not have the permission to modify this object (SAP Library - SAP DB)

 Entering content frame

-23059: You do not have the permission to modify this object

Explanation:

You cannot modify an object from the SQL Studio that has been released by someone else.

User Action:

Contact the owner of the object.


-23060: You do not have the permission to delete this object (SAP Library - SAP DB)

 Entering content frame

-23060: You do not have the permission to delete this object

Explanation:

You cannot delete an object from the SQL Studio that has been released by someone else.

User Action:

Contact the owner of the object.


-23061: Cannot analyze error (SAP Library - SAP DB)

 Entering content frame

-23061: Cannot analyze error

Explanation:

An ODBC error has occurred that could not be analyzed.

User Action:

Check which version of the ODBC driver you are using and install a more recent version if necessary.


-23062: Could not open connection (SAP Library - SAP DB)

 Entering content frame

Background documentation -23062: Could not open connection

Explanation:

An attempt to connect to the database has failed.

User Action:

Check the state of the database using the tools dbmcli and dbmgui.

End the SQL Studio session and connect to the database again.


-23063: Could not create Global Com Object (SAP Library - SAP DB)

 Entering content frame

Background documentation -23063: Could not create Global Com Object

Explanation:

An SQL Studio object could not be created.

User Action:

Exit the SQL Studio.

Check whether the system has enough memory.

Restart the SQL Studio.


-23064: Import failed (SAP Library - SAP DB)

 Entering content frame

Background documentation -23064: Import failed

Explanation:

Could not load exported SQL Studio objects.

User Action:

Contact your local support organization.


-23070: Cannot open object created by newer SQL Studio Version (SAP Library - SAP DB)

 Entering content frame

-23070: Cannot open object created by newer SQL Studio Version

Explanation:

You attempted to open an SQL Studio object that was created with a newer version of the software.

User Action:

You can only modify this object using a newer version of the software. Install the most up-to-date version of the SQL Studio.


-23071: Convert object created by older SQL Studio Version (SAP Library - SAP DB)

 Entering content frame

-23071: Convert object created by older SQL Studio Version

Explanation:

You can convert the object from the SQL Studio into the format of a newer program version.

User Action:

Choose Yes if you want to convert the object. Saving the object gives it the same format as the newer version of the SQL Studio. Once the object has been converted, you can no longer process it with an older version.

Choose No if you do not want to convert the object.


-23072: Representation of null value too long (SAP Library - SAP DB)

 Entering content frame

Background documentation -23072: Representation of null value too long

Explanation:

The NULL value display contains more than 16 characters.

User Action:

Choose a NULL value display with less than 16 characters.


-23100: OLE Error! Please restart SQL Studio (SAP Library - SAP DB)

 Entering content frame

-23100: OLE Error! Please restart SQL Studio

Explanation:

An automation error occurred in the Windows operating system during an OLE operation.

User Action:

End and restart SQL Studio.


-23101: Data in clipboard truncated (SAP Library - SAP DB)

 Entering content frame

-23101: Data in clipboard truncated

Explanation:

When the contents of a LONG column are exported into the clipboard, a maximum of 1048576 bytes are transferred. If there is more data than this in the results, it will be ignored.

User Action:

To export all contents of a LONG column, that is, even if it amounts to more than 1048576 bytes, use the export in a file.


-23102: Failed to create DBC Pool (SAP Library - SAP DB)

 Entering content frame

Background documentation -23102: Failed to create DBC Pool

Explanation:

Could not create a database connection pool.

User Action:

Contact your local support organization.


-23103: Failed to create DBC Handle (SAP Library - SAP DB)

 Entering content frame

Background documentation -23103: Failed to create DBC Handle

Explanation:

Could not create a database connection pool.

User Action:

Contact your local support organization.


-23104: Could not load table definition (SAP Library - SAP DB)

 Entering content frame

Background documentation -23104: Could not load table definition

Explanation:

The definition of a table could not be loaded.

User Action:

Contact your local support organization.


-23200: No data sources (SAP Library - SAP DB)

 Entering content frame

-23200: No data sources

Explanation:

No ODBC data sources have been installed on the operating system with the database’s ODBC driver.

User Action:

Install a data source with the ODBC administrator.


-23201: No ODBC driver (SAP Library - SAP DB)

 Entering content frame

Background documentation -23201: No ODBC driver

Explanation:

There is no ODBC driver (sqlod32.dll, sqlsp32.dll) in the SQL Studio directory.

User Action:

Uninstall SQL Studio and reinstall it again.

If you receive the same error message again, contact your local support organization.


-23202: Could not load object description (SAP Library - SAP DB)

 Entering content frame

Background documentation -23202: Could not load object description

Explanation:

The SQL Studio objects could not be loaded.

User Action:

Load the system tables with the database tools DBMGui or DBMCli.

If you receive the same error message again, contact your local support organization.


-23203: Cannot show tables of users, wrong database version! (SAP Library - SAP DB)

 Entering content frame

Background documentation -23203: Cannot show tables of users, wrong database version!

Explanation:

The system table DOMAIN.TABLES does not contain all the columns required to display the tables in the catalog tree structure.

User Action:

Use a newer version of SQL Studio.


From -24000 to -24999 (SAP Library - SAP DB)

 Entering content frame

From -24000 to -24999

Error Messages of the Database Manager Program

-25905 | ERR_NOEBIDLIST: no information about external backup IDs available
-25906 | ERR_EBFDIRTY: invalid format of external backup history
-24907 | ERR_DBAWRONG - wrong SYSDBA
-24908 | ERR_DOMPUNKNOWN – DOMAIN password unknown
-24909 | ERR_DBAUNKNOWN - SYSDBA unknown
-24910 | ERR_PARAMVER - wrong version of param help file (cserv.pcf) <version>
-24911 | ERR_INVDBNAME - database name <dbname> is reserved
-24912 | ERR_WRONGINST - DBM Server instroot is <instroot>
-24913 | ERR_SERVICEDB - cannot register service kernel for <instroot>
-24914 | ERR_KEYEXISTS - installation key <key> exists
-24915 | ERR_NOADDD - configuration update not allowed (param file is inactive)
-24916 | ERR_MAXDEVCNT - max device count exceeded
-24917 | ERR_MAXDATA - max data size exceeded
-24918 | ERR_MISSMIRR - missing data for mirror devspace
-24919 | ERR_CLEANUP: cannot free all operational resources after backup operation
-24920 | ERR_BACKUPOP: backup operation was unsuccessful
-24921 | ERR_POSTOP: error while finishing backup operation
-24922 | ERR_OPCHK: cannot check state of backup operation
-24923 | ERR_TOOLREQ: error while starting external backup tool
-24924 | ERR_DBREQ: cannot start database kernel request
-24925 | ERR_PREPARE: preparation of backup operation failed
-24926 | ERR_MEDIUMCHK: medium cannot be used with this external backup tool
-24927 | ERR_TOOLCHK: external backup tool not found
-24928 | ERR_NOREPLY - no reply available
-24929 | ERR_USRFRM - invalid user record format
-24930 | ERR_XPVALUESET - parameter value not in valueset
-24931 | ERR_XPMAX - parameter value higher than maximum allowed
-24932 | ERR_XPMIN - parameter value smaller than minimum allowed
-24933 | ERR_NOSERVICESESSION - no service kernel session available
-24934 | ERR_VERSION - incompatible versions (param and kernel)
-24935 | ERR_NOUSERS - no users found
-24936 | ERR_DBNORUN - database is not running
-24937 | ERR_MISSRIGHT - no server rights for this command
-24938 | ERR_NOENTRY - no entry found
-24939 | ERR_LASTREG - cannot delete last registration of instance
-24940 | ERR_NEEDSYSLOGON - system logon required
-24941 | ERR_NEEDLOGON - DBMServer logon required
-24942 | ERR_USRDELSDBA - cannot delete sysdba
-24943 | ERR_USRDELCOLD - cannot delete DBM user
-24944 | ERR_USRDELSELF - cannot delete current user
-24945 | ERR_TOFEWPARAM - too few parameters
-24946 | ERR_TOMANYPARAM - too many parameters
-24947 | ERR_DBNAME - do not use dbname
-24948 | ERR_NODBNAME - database name required
-24949 | ERR_USREXISTS - user entry already exists
-24950 | ERR_USRFAIL - user authorization failed
-24951 | ERR_USRREAD - could not read user data
-24952 | ERR_USRSAVE - could not save user data
-24953 | ERR_DBEXIST - database instance already exists
-24954 | ERR_BANOAUTOMED - no autolog medium found in media list
-24955 | ERR_BANOSAVETYPE - backup type not defined
-24956 | ERR_BASAVETYPECON – backup type conflicts with media definition
-24957 | ERR_NOUSER – required user not set
-24958 | ERR_BAOVERWRITE - file already exists, cannot overwrite
-24959 | ERR_XPOVERFLOW - value out of margin
-24960 | ERR_DBRUN – database is running
-24961 | ERR_STATE – cannot determine current db state
-24962 | ERR_DEVTYPE – wrong devspace type
-24963 | ERR_DEVCHECK – error while checking devspace
-24964 | ERR_EXECUTE – error in program execution
-24965 | ERR_SYSLOGON – logon to system failed
-24966 | ERR_LOGON – logon to DBM Server failed
-24967 | ERR_SYSTEM – system call error
-24968 | ERR_XPREADONLY – parameter is read only
-24969 | ERR_XPDIRTY – param file is dirty
-24970 | ERR_XPNOMODIFY –parameter must not be modified
-24971 | ERR_XPNOCHECK - no running parameter check
-24972 | ERR_XPINVCONF – invalid value
-24973 | ERR_XPCHECK – param check failure/request
-24974 | ERR_XPSESSION – param session active
-24975 | ERR_NOXPSESSION – param session inactive
-24976 | ERR_PARAMEXIST – param file of database already exists
-24977 | ERR_COMMAND - unknown command <command>
-24978 | ERR_XPSYNTAX – xparam syntax error
-24979 | ERR_XPNOTFOUND – parameter not found
-24980 | ERR_NOHELP - xparam help file not found
-24981 | ERR_HIENTRYNOTFOUND – backup history entry not found
-24982 | ERR_ERR_NOHISTORY - backup history file not found
-24983 | ERR_BANOVALIDTYPE - invalid backup type
-24984 | ERR_MENOVALID - invalid medium definition
-24985 | ERR_MENOTFOUND – medium not found
-24986 | ERR_NOMEDIA - media file not found
-24987 | ERR_TOSMALL – packet size too small for answer
-24988 | ERR_SQL – SQL error
-24989 | ERR_NOHISTORYSESSION – no backup history session available
-24990 | ERR_ NOBACKUPSESSION – no backup session available
-24991 | ERR_ NOSQLUSERSESSION– no SQL user session available
-24992 | ERR_NOUTILSESSION – no utility session available
-24993 | ERR_RTEEXT – runtime environment error
-24994 | ERR_RTE – runtime environment error
-24995 | ERR_MEM – memory allocation error
-24996 | ERR_PARAM – wrong parameters
-24997 | ERR_FILE – file handling error
-24998 | ERR_NOTIMPL – sorry, command not yet implemented
-24999 | ERR – common error


-24905: ERR_NOEBIDLIST: no information on external backup IDs av (SAP Library - SAP DB)

 Entering content frame

Background documentation -24905: ERR_NOEBIDLIST: no information on external backup IDs available

Explanation:

No information on external backup IDs is available, since this information was not requested from an external backup tool.

User Action:

Execute the backup_ext_ids_get command to request this information.


-24906: ERR_EBFDIRTY: invalid format of external backup history (SAP Library - SAP DB)

 Entering content frame

Background documentation -24906: ERR_EBFDIRTY: invalid format of external backup history

Explanation:

The External Backup History file is not in the expected format.

User Action:

Depending on whether you require the information in this file or not, either contact your local support organization or create a backup copy of this file and replace it with an empty file with the same name.


-24907: ERR_DBAWRONG - wrong SYSDBA (SAP Library - SAP DB)

 Entering content frame

Background documentation -24907: ERR_DBAWRONG - wrong SYSDBA

Explanation:

The user defined as database administrator in the DBM server does not have the required rights.

User Action:

Specify the correct database administrator.


-24908: ERR_DOMPUNKNOWN - DOMAIN password unknown (SAP Library - SAP DB)

 Entering content frame

Background documentation -24908: ERR_DOMPUNKNOWN - DOMAIN password unknown

Explanation:

The password of the DOMAIN user required to load the system tables is not known to the DBM server.

User Action:

Specify the password for the DOMAIN user.


-24909: ERR_DBAUNKNOWN - SYSDBA unknown (SAP Library - SAP DB)

 Entering content frame

Background documentation -24909: ERR_DBAUNKNOWN - SYSDBA unknown

Explanation:

The database administrator required to load the system tables is not known to the DBM server.

User Action:

Specify the database administrator.


ERR_PARAMVER - wrong version of param help file (cserv.pcf) <version>

 Entering content frame

Background documentation -24910: ERR_PARAMVER - wrong version of param help file (cserv.pcf) <version>

Explanation:

The version of the DBM server does not match the version of the parameter description file (cserv.pcf).

User Action:

Correct your installation. Remember to close all programs in your database system before starting an installation or upgrade.


-24911: ERR_INVDBNAME - database name <dbname> is reserved (SAP Library - SAP DB)

 Entering content frame

Background documentation -24911: ERR_INVDBNAME - database name <dbname> is reserved

Explanation:

You selected an invalid name for your database.

User Action:

Use a different name for your database.


-24912: ERR_WRONGINST – DBM server instroot is <instroot> (SAP Library - SAP DB)

 Entering content frame

Background documentation -24912: ERR_WRONGINST – DBM server instroot is <instroot>

Explanation:

You attempted to register an installation using a DBM server from a different installation. This is not possible.

User Action:

Use the correct DBM server. When using dbmcli, you can use the switch -R to force the use of a specific DBM server.


-24913: ERR_SERVICEDB - can not register service kernel for <ins (SAP Library - SAP DB)

 Entering content frame

Background documentation -24913: ERR_SERVICEDB - can not register service kernel for <instroot>

Explanation:

The service database cannot be registered. This could be because the files were incorrectly installed or the operating system user does not have the necessary authorizations.

User Action:

Correct or repeat the installation or provide your operating system user with the required authorizations.


-24914: ERR_KEYEXISTS - installation key <key> exists (SAP Library - SAP DB)

 Entering content frame

Background documentation -24914: ERR_KEYEXISTS - installation key <key> exists

Explanation:

You used a key for the DBM server command inst_reg that has already been used. If you did not specify a key, empty key is already used.

User Action:

Use a unique key after option -k in the DBM server statement inst_reg ( inst_reg -k <key>).


ERR_NOADDD - configuration update not allowed (param file is inactive)

 Entering content frame

Background documentation -24915: ERR_NOADDD - configuration update not allowed (param file is inactive)

Explanation:

The database configuration cannot be changed as changes were made to the parameter file, but these changes are not yet activated.

User Action:

To activate the changes to the parameter file, change the database state to OFFLINE and then to WARM.

To discard the changes to the parameter file, use the DBM server statement param_restore.


-24916: ERR_MAXDEVCNT - max device count exceeded (SAP Library - SAP DB)

 Entering content frame

Background documentation -24916: ERR_MAXDEVCNT - max device count exceeded

Explanation:

The number of devspaces of the type used exceeds the current maximum value.

User action:

Increase the value of the database instance parameters MAXARCHIVELOGS for the log devspaces, or the value for MAXDATADEVISES for the data devspaces. To activate the new value, restart the database.


-24917: ERR_MAXDATA - max data size exceeded (SAP Library - SAP DB)

 Entering content frame

Background documentation -24917: ERR_MAXDATA - max data size exceeded

Explanation:

The total size of the data devspaces exceeds the current maximum value.

User action:

Reduce the size of the devspaces to add.

Alternatively, you can increase the size of the database instance parameter MAXDATAPAGES. To activate the new value, restart the database.


-24918: ERR_MISSMIRR - missing data for mirror volume (SAP Library - SAP DB)

 Entering content frame

Background documentation -24918: ERR_MISSMIRR - missing data for mirror volume

Explanation:

The information for a mirror volume is missing.

User Action:

Correct your entry by specifying the data for the mirrored volume. Execute the command again.


-24919: ERR_CLEANUP: cannot free all operational resources after (SAP Library - SAP DB)

 Entering content frame

Background documentation -24919: ERR_CLEANUP: cannot free all operational resources after backup operation

Explanation:

It was not possible to free all of the temporary system resources that were used for a successful backup, check, or restore.

User Action:

Check which resources were not released using the external backup log. If the resources are temporary files or pipes, try to remove these manually. You should also attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact you local support organization.


-24920: ERR_BACKUPOP: backup operation was unsuccessful (SAP Library - SAP DB)

 Entering content frame

Background documentation -24920: ERR_BACKUPOP: backup operation was unsuccessful

Explanation:

The backup, check or restore action failed due to problems with either the database or the backup tool. If it is a backup check that has failed, this may have been caused by errors in the relevant backup.

User Action:

Attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact you local support organization.


-24921: ERR_POSTOP: error while finishing backup operation (SAP Library - SAP DB)

 Entering content frame

Background documentation -24921: ERR_POSTOP: error while finishing backup operation

Explanation:

It was not possible to perform the necessary postprocessing steps after a successful backup, check, or restore.

User Action:

Try to fix the problem with the help of the extended error description, and repeat the backup, check, or restore. If you cannot solve the problem, contact you local support organization.


-24922: ERR_OPCHK: cannot check state of backup operation (SAP Library - SAP DB)

 Entering content frame

Background documentation -24922: ERR_OPCHK: cannot check state of backup operation

Explanation:

You were unable to check the status of the database or the backup tool.

User Action:

Attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact you local support organization.


-24923: ERR_TOOLREQ: error while starting external backup tool (SAP Library - SAP DB)

 Entering content frame

Background documentation -24923: ERR_TOOLREQ: error while starting external backup tool

Explanation:

It was not possible to start a backup tool correctly.

User Action:

Attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact you local support organization.


-24924: ERR_DBREQ: cannot start database kernel request (SAP Library - SAP DB)

 Entering content frame

Background documentation -24924: ERR_DBREQ: cannot start database kernel request

Explanation:

The database was unable to start the backup, check, or restore process.

User Action:

Attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact you local support organization.


-24925: ERR_PREPARE: preparation of backup operation failed (SAP Library - SAP DB)

 Entering content frame

Background documentation -24925: ERR_PREPARE: preparation of backup operation failed

Explanation:

The preparations required to implement the backup tool could not be successfully completed.

User Action:

Attempt to fix the problem with the help of the extended error description. If you cannot solve the problem, contact your local support organization.


-24926: ERR_MEDIUMCHK: medium cannot be used with this external (SAP Library - SAP DB)

 Entering content frame

Background documentation -24926: ERR_MEDIUMCHK: medium cannot be used with this external backup tool

Explanation:

The specified medium cannot be used with the backup tool defined by the name of the medium.

User Action:

Attempt to fix the problem with the help of the detailed error description, by changing the medium appropriately. If you cannot solve the problem, contact your local support organization.


-24927: ERR_TOOLCHK: external backup tool not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -24927: ERR_TOOLCHK: external backup tool not found

Explanation:

The external backup tool was not found or is not correctly installed.

User Action:

Attempt to fix the problem with the help of the extended error description. If you do not want to use an external backup tool, change the medium definition accordingly. If you cannot solve the problem, contact your local support organization.


-24928: ERR_NOREPLY - no reply available (SAP Library - SAP DB)

 Entering content frame

Background documentation -24928: ERR_NOREPLY - no reply available

Explanation:

There is no response to an asynchronous request sent to the database instance.

User Action:

Repeat the statement until there is a response, and then use the statement that corresponds to the request to retrieve the response. Alternatively, you can immediately use the statement for retrieving the response. This statement waits until the response is provided.


-24929: ERR_USRFRM - invalid user record format (SAP Library - SAP DB)

 Entering content frame

Background documentation -24929: ERR_USRFRM - invalid user record format

Explanation:

The DBM server user data is inconsistent.

User Action:

If you are migrating data, check that all the migration steps have been executed correctly. If the error persists, contact your local support organization.


-24930: ERR_XPVALUESET - parameter value not in value set (SAP Library - SAP DB)

 Entering content frame

Background documentation -24930: ERR_XPVALUESET - parameter value not in value set

Explanation:

The entered database instance parameter value is not within the permitted value range.

User Action:

Correct your entry, and re-execute the DBM server statement.


-24931: ERR_XPMIN - parameter value smaller than minimum allowed (SAP Library - SAP DB)

 Entering content frame

Background documentation -24931: ERR_XPMIN - parameter value smaller than minimum allowed

Explanation:

The entered database instance parameter value exceeds the permitted maximum value.

User Action:

Correct your entry, and re-execute the DBM server statement.


-24932: ERR_XPMIN - parameter value smaller than minimum allowed (SAP Library - SAP DB)

 Entering content frame

Background documentation -24932: ERR_XPMIN - parameter value smaller than minimum allowed

Explanation:

The entered database instance parameter value is below the required minimum.

User Action:

Correct your entry, and re-execute the DBM server statement.


-24933: ERR_NOSERVICESESSION - no service kernel available (SAP Library - SAP DB)

 Entering content frame

Background documentation -24933: ERR_NOSERVICESESSION - no service kernel available

Explanation:

The DBM server statement requires a service session.

User Action:

Before you execute the DBM server statement, activate the service session with the DBM server statement service_connect or the switch -uSRV.


-24934: ERR_VERSION - incompatible versions (param and kernel) (SAP Library - SAP DB)

 Entering content frame

Background documentation -24934: ERR_VERSION - incompatible versions (param and kernel)

Explanation:

The version of the parameter file of the database instance does not match the executable database program.

User Action:

Update the entries in the parameter file by checking the parameters. To do this, use the DBM server statement param_checkall.


-24935: ERR_NOUSERS - no users found (SAP Library - SAP DB)

 Entering content frame

Background documentation -24935: ERR_NOUSERS - no users found

Explanation:

No user entries found.

User Action:

Generate the required user entries with the DBM server statement db_create.


-24936: ERR_DBNORUN - database is not running (SAP Library - SAP DB)

 Entering content frame

Background documentation -24936: ERR_DBNORUN - database is not running

Explanation:

The databank instance is not COLD or WARM.

User Action:

Make sure that the database is in the required state before using this DBM server statement. To do this, use the DBM server statement db_cold or db_warm.


-24937: ERR_MISSRIGHT - no server rights for this command (SAP Library - SAP DB)

 Entering content frame

Background documentation -24937: ERR_MISSRIGHT - no server rights for this command

Explanation:

The current DBM server user is not authorized to execute this command.

User Action:

Use a different DBM server user, or adjust the user rights of the current DBM server user appropriately. To do this, use the DBM server statement user_put.


-24938: ERR_NOENTRY - no entry found (SAP Library - SAP DB)

 Entering content frame

Background documentation -24938: ERR_NOENTRY - no entry found

Explanation:

The requested registration of the database instance was not found.

User Action:

Use an existing registration to execute the DBM server statement.


-24939: ERR_LASTREG - cannot delete last registration of instanc (SAP Library - SAP DB)

 Entering content frame

Background documentation -24939: ERR_LASTREG - cannot delete last registration of instance

Explanation:

The last registration of a database instance cannot be deleted using the DBM server statement.

User Action:

To delete the database instance, use the DBM server statement db_drop. When you delete a database instance, all of its data, including its configuration, is deleted.


-24940: ERR_NEEDSYSLOGON - system logon required (SAP Library - SAP DB)

 Entering content frame

Background documentation -24940: ERR_NEEDSYSLOGON - system logon required

Explanation:

This DBM server statement requires you to log on to the operating system.

User Action:

Assign an operating system user to the relevant DBM server user. To do this, use the DBM server statement user_put.

To activate the operating system user, log on to the DBM server again. To do this, use the DBM server statement user_logon, and note any warnings that are displayed indicating problems with the operating system logon.


-24941: ERR_NEEDLOGON - DBM server logon required (SAP Library - SAP DB)

 Entering content frame

Background documentation -24941: ERR_NEEDLOGON - DBM server logon required

Explanation:

This DBM server statement requires you to log on to the DBM server.

User Action:

Log on to the DBM server. To do this, use the DBM server statement user_logon or the switch -u.


-24942: ERR_USRDELSDBA - cannot delete sysdba (SAP Library - SAP DB)

 Entering content frame

Background documentation -24942: ERR_USRDELSDBA - cannot delete sysdba

Explanation:

The specified user has special properties and cannot be deleted.

User Action:

You are not allowed to delete this user. If unauthorized persons know the user name and password, change the user’s password. To do this, use the DBM server statement user_put.


-24943: ERR_USRDELCOLD - cannot delete DBM user (SAP Library - SAP DB)

 Entering content frame

Background documentation -24943: ERR_USRDELCOLD - cannot delete DBM user

Explanation:

The specified user has special properties and cannot be deleted.

User Action:

You are not allowed to delete this user. If unauthorized persons know the user name and password, change the user’s password. To do this, use the DBM server statement user_put.


-24944: ERR_USRDELSELF - cannot delete current user (SAP Library - SAP DB)

 Entering content frame

Background documentation -24944: ERR_USRDELSELF - cannot delete current user

Explanation:

The current user cannot be deleted.

User Action:

Log on to the DBM server with another user, and execute the DBM server statement again.


-24945: ERR_TOFEWPARAM - to few parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation -24945: ERR_TOFEWPARAM - to few parameters

Explanation:

The DBM server statement has too few parameters.

User Action:

Correct your entry according to the documentation for DBM server statements, and execute the statement again.


-24946: ERR_TOMANYPARAM - to many parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation -24946: ERR_TOMANYPARAM - to many parameters

Explanation:

The DBM server statement has too many parameters.

User Action:

Correct your entry according to the documentation for DBM server statements, and execute the statement again.


-24947: ERR_DBNAME - do not use dbname (SAP Library - SAP DB)

 Entering content frame

Background documentation -24947: ERR_DBNAME - do not use dbname

Explanation:

You cannot use this DBM statement on a database instance.

User Action:

Do not specify a database name when you execute the DBM server statement.


-24948: ERR_NODBNAME - database name required (SAP Library - SAP DB)

 Entering content frame

Background documentation -24948: ERR_NODBNAME - database name required

Explanation:

You can use this DBM statement on a database instance only.

User Action:

Use the switch -d to specify the name of the database instance for the DBM server.


-24949: ERR_USREXISTS - user entry already exists (SAP Library - SAP DB)

 Entering content frame

Background documentation -24949: ERR_USREXISTS - user entry already exists

Explanation:

This DBM server statement cannot be used, as the user name already exists.

User Action:

Use a name that has not already been used for a user, or delete the existing user. Only delete a user if you the user is no longer required. When you delete a user, you delete all of the saved settings for that user. To delete a user, use the DBM server statement user_delete.


-24950: ERR_USRFAIL - user authorization failed (SAP Library - SAP DB)

 Entering content frame

Background documentation -24950: ERR_USRFAIL - user authorization failed

Explanation:

Your user name or password is incorrect and you are not authorized to use the DBM server.

User Action:

Enter the correct user/password combination and log on to the DBM server again. You can correct the user data for the database instance in the DBMGUI.


-24951: ERR_USRREAD - could not read user data (SAP Library - SAP DB)

 Entering content frame

Background documentation -24951: ERR_USRREAD - could not read user data

Explanation:

The DBM server user data could not be read.

User Action:

Check the file system attributes and the operating system rights of the user profile container. This file has the name <dbname>.upc. On NT, you can find this file in the config directory of the database installation. On UNIX systems, this file is in /usr/spool/sql/config. Use the DBM server statement user_getall to check the existence of the user.


-24952: ERR_USRSAVE - could not save user data (SAP Library - SAP DB)

 Entering content frame

Background documentation -24952: ERR_USRSAVE - could not save user data

Explanation:

The DBM server user data could not be saved.

User Action:

Check the file system attributes and the operating system rights of the user profile container. This file has the name <dbname>.upc. On NT, you can find this file in the config directory of the database installation. On UNIX systems, this file is in /usr/spool/sql/config. Check that there is enough memory available on the relevant hard disk.


-24953: ERR_DBEXIST - database instance already exists (SAP Library - SAP DB)

 Entering content frame

Background documentation -24953: ERR_DBEXIST - database instance already exists

Explanation:

This DBM server statement cannot be used, since the database instance already exists.

User Action:

Use a name that has not already been used for a database instance, or delete the existing database instance. Only delete a database instance if you no longer need it. When you delete a database instance, all of its data, including its configuration, is deleted. To delete the database instance, use the DBM server statement db_drop.


-24954: ERR_BANOAUTOMED - no autolog medium found in media list (SAP Library - SAP DB)

 Entering content frame

-24954: ERR_BANOAUTOMED - no autolog medium found in media list

Explanation:

You have not defined an autosave medium to back up the log automatically.

User Action:

Correct the medium definition, or enter the backup medium explicitly for the failed command.


-24955: ERR_BANOSAVETYPE - backup type not defined (SAP Library - SAP DB)

 Entering content frame

-24955: ERR_BANOSAVETYPE - backup type not defined

Explanation:

The medium definition contains no backup type (LOG, DATA or PAGES).

User Action:

Correct the medium definition, or enter the backup type explicitly for the failed command.


-24956: ERR_BASAVETYPECON - backup type conflicts with medium de (SAP Library - SAP DB)

 Entering content frame

-24956: ERR_BASAVETYPECON - backup type conflicts with medium definition

Explanation:

An attempt has been made to Save or Restore using the defined medium. However, the predefined save type for the medium ( LOG , DATA or PAGES ) and the save type used for the Save or Restore clash.

User Action:

Correct your entry or the medium definition.

You may sometimes have to readjust your definition again to restore older backups.


-24957: ERR_NOUSER - required user not set (SAP Library - SAP DB)

 Entering content frame

-24957: ERR_NOUSER - required user not set

Explanation:

You tried to execute a DBM server statement relating to a set user. However, this standard user has not been set in the DBM server.

User Action:

First, set the required user using the DBM server statement dbm_userset. Alternatively, you can also specify a user/password combination explicitly when you re-execute the failed statement.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24958: ERR_BAOVERWRITE - file already exists, cannot overwrite (SAP Library - SAP DB)

 Entering content frame

-24958: ERR_BAOVERWRITE - file already exists, cannot overwrite

Explanation:

An attempt has been made to perform a Save. However, the medium that you specified has already been used for a Save, and has been defined as Not overwritable.

User Action:

Use a different save medium or delete the existing one using the operating system tools. Alternatively, you could also adjust the medium definition.

Overwriting or deleting a medium destroys all data stored there.


-24959: ERR_XPOVERFLOW - value out of margin (SAP Library - SAP DB)

 Entering content frame

-24959: ERR_XPOVERFLOW - value out of margin

Explanation:

The value used for a kernel parameter is invalid. You have either chosen an invalid data type (for example, you have used text for a numerical parameter) or you have exceeded the maximum values allowed for that data type (for example, you have used too large a number or too much text).

User Action:

Correct your entry.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24960: ERR_DBRUN - database is running (SAP Library - SAP DB)

 Entering content frame

-24960: ERR_DBRUN - database is running

Explanation:

The databank is either ONLINE or in the state ADMIN. This DBM server statement is not valid in this state.

User Action:

First of all, make sure the database is OFFLINE and then re-execute the statement.

Shutting down the database to OFFLINEbreaks the connection to all users logged on to the database or to all programs that are running on it.


-24961: ERR_STATE - cannot determine current db state (SAP Library - SAP DB)

 Entering content frame

-24961: ERR_STATE - cannot determine current db state

Explanation:

The status of the database (OFFLINE, COLD, or WARM) could not be determined properly. This means the validity of the DBM server commands can no longer be determined.

User Action:

Check the status of the database processes using the operating system tools. Try to connect to the database through a database application, for example, SQL Studio. If this succeeds, the database has the status WARM, and is ready for (maybe limited) use.

Use some of the other options available, for example, log files, to check the status of the database. Please contact your local support organization if necessary.

If your applications or users can no longer connect to the database, you should make sure the database has a proper status by restarting it.


-24962: ERR_DEVTYPE - wrong volume type (SAP Library - SAP DB)

 Entering content frame

-24962: ERR_DEVTYPE - wrong volume type

Explanation:

An unknown or invalid volume type has been used.

User Action:

Correct your entry.


-24963: ERR_DEVCHECK - error while checking volume (SAP Library - SAP DB)

 Entering content frame

-24963: ERR_DEVCHECK - error while checking volume

Explanation:

The volume you have tried to configure is invalid. The system was unable to find/create a volume with the parameters specified.

User Action:

Check your entries and the configuration of your operating system. Make corrections as appropriate and reconfigure the volume.


-24964: ERR_EXECUTE - error in program execution (SAP Library - SAP DB)

 Entering content frame

-24964: ERR_EXECUTE - error in program execution

Explanation:

An error occurred when a program or operating system command was called using the DBM server. The program/command was not found or it encountered an error when it was executed.

User Action:

Remember the exit code shipped with the system as well as the programs/command documentation that was delivered. Check whether the program/command is available on the server. Use the program/command documentation to help you find the error.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24965: ERR_SYSLOGON - logon to system failed (SAP Library - SAP DB)

 Entering content frame

-24965: ERR_SYSLOGON - logon to system failed

Explanation:

The DBM server could not log on to the operating system or the statement used requires it to be already logged on to the operating system.

User Action:

Check you entries as well as the authorizations assigned to the respective user. Under NT, the user must have the authorization logon as batch job. The current DBM server user must also have authorization to log on under a different user account.


-24966: ERR_LOGON - logon to DBM server failed (SAP Library - SAP DB)

 Entering content frame

-24966: ERR_LOGON - logon to DBM server failed

Explanation:

An invalid user/password combination was used or the statement used requires you to be already logged on.

User Action:

Enter the correct user/password combination or log on to the DBM server first.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24967: ERR_SYSTEM - system call error (SAP Library - SAP DB)

 Entering content frame

-24967: ERR_SYSTEM - system call error

Explanation:

An attempt to use an operating system function has failed.

User action:

Read the extended error text which describes operating system messages in more detail.


-24968: ERR_XPREADONLY - parameter is read only (SAP Library - SAP DB)

 Entering content frame

-24968: ERR_XPREADONLY - parameter is read only

Explanation:

The parameter used cannot be modified.

User Action:

Correct your entry.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24969: ERR_XPDIRTY - param file is dirty (SAP Library - SAP DB)

 Entering content frame

-24969: ERR_XPDIRTY - param file is dirty

Explanation:

An attempt has been made to make a change to the kernel parameters without first checking whether or not a previous change works properly by restarting the database.

User action:

Restart the database and change the parameters again.

Restarting the database breaks the connection to all users logged on to the database or ends all programs that are running on it.


-24970: ERR_XPNOMODIFY - parameter must not be modified (SAP Library - SAP DB)

 Entering content frame

-24970: ERR_XPNOMODIFY - parameter must not be modified

Explanation:

The kernel parameter used cannot be modified.

User Action:

Set the parameter back to its initial value.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24971: ERR_XPNOCHECK - no running parameter check (SAP Library - SAP DB)

 Entering content frame

-24971: ERR_XPNOCHECK - no running parameter check

Explanation:

A reset status was not possible after correcting a single parameter because no check run was active when the parameters were checked.

User Action:

Start the parameter check again.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24972: ERR_XPINVCONF - invalid value (SAP Library - SAP DB)

 Entering content frame

-24972: ERR_XPINVCONF - invalid value

Explanation:

An attempt has been made to confirm a parameter. You have either used an invalid value or a parameter for which there was no Request available.

User Action:

Correct your entries or restart the parameter check, for example, with the DBM server statement param_checkall.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24973: ERR_XPCHECK - param check failure/request (SAP Library - SAP DB)

 Entering content frame

-24973: ERR_XPCHECK - param check failure/request

Explanation:

The system was unable to check the kernel parameters using the rules and processes stored in the parameter help file. You will find more information on this in the extended message text.

User Action:

Correct the parameter value as stated in the documentation. If the system suggests any values to you, confirm one of them with the DBM server statement param_confirm.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24974: ERR_XPSESSION - param session active (SAP Library - SAP DB)

 Entering content frame

-24974: ERR_XPSESSION - param session active

Explanation:

If a parameter session is already active, you will not be able to start another session.

User Action:

Check the sequence of your DBM server statements. If necessary, terminate an existing parameter session using the statement param_commitsession or param_abortsession. Alternatively, you can also use the active parameter session to execute your statement.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24975: ERR_NOXPSESSION - param session inactive (SAP Library - SAP DB)

 Entering content frame

-24975: ERR_NOXPSESSION - param session inactive

Explanation:

Some DBM server statements in this application area require a parameter session. In this case, this session was inactive.

User Action:

Check the sequence of your DBM server statements. First of all, you must open a parameter session using the DBM server statement param_startsession before you can process a parameter.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24976: ERR_PARAMEXIST - param file of database already exists (SAP Library - SAP DB)

 Entering content frame

-24976: ERR_PARAMEXIST - param file of database already exists

Explanation:

A parameter file already exists for the specified database. The parameter file can be initialized only if no parameter file exists. This prevents the configuration from being lost.

User Action:

Delete the parameter file explicitly either at file-system level or using the DBM server statement param_rmfile. Note that this will mean the current database configuration will be lost.


-24977: ERR_COMMAND - unknown command <command> (SAP Library - SAP DB)

 Entering content frame

-24977: ERR_COMMAND - unknown command <command>

Explanation:

The specified DBM server statement has not been recognized.

User Action:

Enter a correct statement. Bear in mind that statements are case-sensitive.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24978: ERR_XPSYNTAX - xparam syntax error (SAP Library - SAP DB)

 Entering content frame

-24978: ERR_XPSYNTAX - xparam syntax error

Explanation:

The parameter description in the parameter help file is incorrect.

User Action:

Read the extended error text and correct the error in the file cserv.pcf , which you will find in the database installation’s env directory.


-24979: ERR_XPNOTFOUND - parameter not found (SAP Library - SAP DB)

 Entering content frame

-24979: ERR_XPNOTFOUND - parameter not found

Explanation:

The parameter specified does not exist in the parameter help file.

User Action:

Check that the parameter name is correct. Bear in mind that statements are case-sensitive.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24980: ERR_NOHELP - xparam help file not found (SAP Library - SAP DB)

 Entering content frame

-24980: ERR_NOHELP - xparam help file not found

Explanation:

The parameter help file that describes the kernel parameters could not be opened.

User Action:

Check that the cserv.pcf file in the database installation’s env directory exists and is correct. You should also check the DBM server’s access rights to this file.


-24981: ERR_HIENTRYNOTFOUND - backup history entry not found (SAP Library - SAP DB)

 Entering content frame

-24981: ERR_HIENTRYNOTFOUND - backup history entry not found

Explanation:

The required entry does not exist in the backup history.

User Action:

Correct the parameters of the DBM server statement you used to read the backup history.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24982: ERR_ERR_NOHISTORY - backup history file not found (SAP Library - SAP DB)

 Entering content frame

-24982: ERR_ERR_NOHISTORY - backup history file not found

Explanation:

No backup history exists.

User Action:

A backup history only exists if backup operations have already been executed. The backup history function cannot be used before this has been done.


-24983: ERR_BANOVALIDTYPE - invalid backup type (SAP Library - SAP DB)

 Entering content frame

-24983: ERR_BANOVALIDTYPE - invalid backup type

Explanation:

The backup type specified is invalid.

User Action:

Specify a valid backup type in your DBM server statement.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24984: ERR_MENOVALID - invalid medium definition (SAP Library - SAP DB)

 Entering content frame

-24984: ERR_MENOVALID - invalid medium definition

Explanation:

The medium you have defined is invalid.

User Action:

Check the parameters you have entered.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24985: ERR_MENOTFOUND - medium not found (SAP Library - SAP DB)

 Entering content frame

-24985: ERR_MENOTFOUND - medium not found

Explanation:

The medium you have specified has not been defined.

User Action:

Check your entries. Use another medium or create a new one with that name.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24986: ERR_NOMEDIA - media file not found (SAP Library - SAP DB)

 Entering content frame

-24986: ERR_NOMEDIA - media file not found

Explanation:

No backup medium has been defined yet for the database.

User Action:

Create backup mediums before using functions that need to have predefined backup mediums.

Check that the DBM server can access its configuration files. It may be that the DBM server has the wrong user authorizations.


-24987: ERR_TOSMALL - packet size too small for answer (SAP Library - SAP DB)

 Entering content frame

-24987: ERR_TOSMALL - packet size too small for answer

Explanation:

The client application has provided too little memory space for the DBM server’s response.

User Action:

Change the DBM server statement so that the response is smaller.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24988: ERR_SQL - sql error (SAP Library - SAP DB)

 Entering content frame

-24988: ERR_SQL - sql error

Explanation:

An error occurred when a command was issued to the database kernel.

User Action:

If necessary, consult the other database-kernel error message and correct your entries accordingly.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, please contact your local support organization.


-24989: ERR_NOHISTORYSESSION - no backup history session availab (SAP Library - SAP DB)

 Entering content frame

-24989: ERR_NOHISTORYSESSION - no backup history session available

Explanation:

You can only execute a DBM server statement when the backup history is open.

User Action:

First, open the backup history using this statement backup_history_open. Watch for any errors that might occur.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24990: ERR_ NOBACKUPSESSION - no backup session available (SAP Library - SAP DB)

 Entering content frame

-24990: ERR_ NOBACKUPSESSION - no backup session available

Explanation:

The DBM server statement is only permitted if the Save or Restore is active.

User Action:

First of all, start the backup session you require using the DBM server statements backup_save or backup_restore and execute further statements depending on how the Save/Restore runs.

Check whether the Save/Restore started properly.

Note that importing a database backup using Restore will override the current status of your database.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24991: ERR_ NOSQLUSERSESSION - no sql user session available (SAP Library - SAP DB)

 Entering content frame

-24991: ERR_ NOSQLUSERSESSION - no sql user session available

Explanation:

The DBM server statement you have chosen requires a session with a database kernel user task.

User Action:

Start the session using the DBM server statement sql_connect or using the Database Manager (CLI) option –uSQL.

Check whether a previous attempt to set up the session failed and read the error message issued for it.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24992: ERR_NOUTILSESSION - no utility session available (SAP Library - SAP DB)

 Entering content frame

-24992: ERR_NOUTILSESSION - no utility session available

Explanation:

The DBM server statement you have chosen requires a session with the database kernel's utility task.

User Action:

Start the session using the DBM server statement util_connect or using the Database Manager (CLI) option –uUTL.

Check whether a previous attempt to set up the session failed and read the error message issued for it.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24993: ERR_RTEEXT - runtime environment error (SAP Library - SAP DB)

 Entering content frame

-24993: ERR_RTEEXT - runtime environment error

Explanation:

The database runtime environment was unable to perform a function correctly.

User action:

Please read the additional runtime environment error message.


-24994: ERR_RTE - runtime environment error (SAP Library - SAP DB)

 Entering content frame

-24994: ERR_RTE - runtime environment error

Explanation:

The database runtime environment was unable to perform a function correctly.

User action:

Please read the additional runtime environment error message.


-24995: ERR_MEM - memory allocation error (SAP Library - SAP DB)

 Entering content frame

-24995: ERR_MEM - memory allocation error

Explanation:

The operating system was unable to provide the DBM server with enough main memory.

User Action:

Correct the limit on the DBM server’s user authorizations if one exists.

Check the overall condition of your operating system for any problems with main memory management.


-24996: ERR_PARAM - wrong parameters (SAP Library - SAP DB)

 Entering content frame

-24996: ERR_PARAM - wrong parameters

Explanation:

Your DBM server statement has been executed with the wrong parameters.

User Action:

Check your entries. You should also check whether or not the statement requires a database name or a special type of session.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24997: ERR_FILE - file handling error (SAP Library - SAP DB)

 Entering content frame

-24997: ERR_FILE - file handling error

Explanation:

A file was not accessed properly.

User Action:

This might happen because you do not have the user authorizations required. Check the DBM server installation and its current authorizations.

You should also check whether the file is damaged.


-24998: ERR_NOTIMPL - sorry, command not yet implemented (SAP Library - SAP DB)

 Entering content frame

-24998: ERR_NOTIMPL - sorry, command not yet implemented

Explanation:

The DBM server statement is not available in this version.

User Action:

Choose a different statement.

If the error occurs in the Database Manager GUI and there is no way in which you can correct it, contact your local support organization.


-24999: ERR - common error (SAP Library - SAP DB)

 Entering content frame

-24999: ERR - common error

Explanation:

An error has occurred that the Database Manager cannot analyze properly.

User Action:

Please inform your local support organization.


From -25000 to -25999 (SAP Library - SAP DB)

 Entering content frame

Background documentation From -25000 to -25999

SAP DB Loader error messages:

-25003 | Name of database host could not be determined
-25004 | Error when connecting to the database
-25005 | Error when logging user on to the database
-25006 | Error occurred when connecting to the database with specified userkey
-25007 | Error when executing the command; no connection to the database exists
-25008 | Error when logging on user; previous user's database connection has been restored
-25009 | Failure in db communication
-25010 | <SQL error text>
-25011 | Error when executing the internal SQL command
-25018 | Error when changing the authorizations for the log file; unable to change the file owner
-25019 | Error when opening the log file; temporary log file opened
-25020 | Memory space exhausted
-25021 | Error during user changeover
-25022 | Request to terminate operation received; processing of command terminated
-25109 | <command> not implemented
-25201 | Invalid length specification for INTEGER field
-25202 | Invalid length specification for REAL field
-25203 | Invalid length specification for DECIMAL field
-25204 | Invalid length specification for ZONED field
-25205 | Invalid specification for USAGE
-25206 | Invalid specification in lines for USAGE
-25207 | Number of lines specified for USAGE is too high
-25208 | Invalid position specification; specify a positive value
-25209 | Invalid value for FRACTION; specify a positive value
-25210 | Invalid value for SCALE; enter a value between -127 and 127
-25211 | Invalid ROUND specification; specify a value between 0 and 18
-25212 | Invalid TRUNC specification; enter a value between 0 and 18
-25213 | Invalid file format specification; FORMATTED and COMPRESSED exclude each other
-25214 | Invalid file format specification; Separator/Delimiter is not allowed together with FORMATTED
-25216 | File format specification FORMATTED required
-25218 | Invalid file format specification; no columns specified despite FORMATTED file format
-25219 | Columns must be specified in the command in ascending order according to their position
-25220 | Invalid separator/delimiter specification
-25221 | Invalid specification for representation of decimal numbers
-25222 | Invalid specification for representation of Boolean values
-25223 | Invalid specification for representation of NULL values
-25224 | Invalid specification for language of messages; specify ENG or DEU
-25225 | Invalid specification for the representation of thousand separator and decimal point in numerical values
-25226 | Maximum number of column specifications in a command has been exceeded
-25227 | Maximum number of conditions in a command has been exceeded
-25228 | Invalid specification for external representation of date or time values
-25229 | Incorrect comparison operator in condition
-25230 | Error in DATAEXTRACT command; specification for command file is missing
-25231 | Specification of ROUND, TRUNC, or SCALE not allowed for this column
-25232 | Unknown keyword
-25233 | Error in column description; file format is COMPRESSED, but some descriptions contain end positions
-25234 | Error in column description; file format is FORMATTED, but some descriptions do not contain end positions
-25235 | Error in column description; identical positions for different columns
-25236 | Error in column description; column positions overlap
-25237 | Error when executing the command; the columns that are to be updated are missing from the command
-25238 | Error when executing the command; the command does not contain any column specifications
-25239 | The value specified is not a integer number
-25281 | Syntax error at a certain position
-25301 | Invalid entry in Date or Time column
-25302 | The value entered is not a valid numerical value
-25303 | The values entered are not in the correct order
-25304 | Key field entries are missing
-25305 | The entries in the key fields are too long
-25306 | The value you have entered is not valid for hexadecimal display
-25308 | CONSTRAINT condition violated
-25309 | The value you entered was not recognized as a BOOLEAN entry
-25310 | Column does not permit NULL values
-25311 | Data missing for NOT NULL column
-25313 | Numerical value truncated
-25314 | Too few decimal places defined for column
-25315 | The data type of the column and the external data type are not compatible
-25316 | The FASTLOAD command cannot be executed; the table contains at least one column of data type LONG
-25317 | Entry for column is not compatible with the data type or the column length
-25318 | The generated system key has exceeded the maximum possible value
-25319 | Unable to find any data for the column in the data file
-25320 | The LONG value could not be loaded into column
-25321 | Error in the command; the constant you have entered is not a valid number
-25322 | Error in the command; the constant you entered was truncated during conversion
-25323 | Error in command; the data type of the constant in the column’s NULL condition is not compatible with the external column data type
-25324 | Error in the length specifications of the column descriptions; see log file for more detailed information
-25325 | Error in command; the external and internal data types are not compatible. For more detailed information, please consult the log file
-25326 | Error when executing the extract command; the number extracted was truncated during conversion
-25327 | Error when extracting data record
-25328 | Error when executing the DATAEXTRACT command; the server’s log file contains more detailed information
-25329 | Error when executing the TABLELOAD command; the data file is corrupt or was not created using TABLEEXTRACT
-25330 | Error when executing the TABLELOAD command; the page sizes of the source and target file are different
-25331 | This is a restricted statement, user must be SYSDBA
-25332 | Unable to extract table definition
-25333 | Unable to extract index definition
-25334 | The file counter exceeds the maximum of 9999 files
-25335 | Error when restoring the table; the data file specified was created with TABLEEXTRACT USER/ALL
-25336 | Error when restoring tables; the data file specified was created using TABLEEXTRACT TABLE
-25337 | Error when restoring table; the data file contains no data for the specified table
-25338 | Error when restarting the command; entry in assignment file not found
-25339 | Error when restarting the TABLELOAD command; unable to open restart
-25340 | UCS2 conversion error; character string contains invalid characters or character sequences
-25341 | Error when generating the CREATE TABLE/CREATE INDEX statement
-25342 | Error when restoring table <table name>; the structures of the source and target tables are different
-25343 | Error in command; the SELECT statement in the command does not contain the column name
-25344 | Error in command for downloading data; the output length specified is too small for the column. Minimum output length is:
-25351 | Error in command; the LONGFILE specification for the column is missing from the command
-25352 | Error when downloading data; several errors occurred when analyzing the LONGFILE specification in the command. For more information, please consult the log file
-25353 | Error when downloading data; the maximum number of LONG data files for the column has been exceeded
-25354 | Error in the command for uploading data; the LONG data file specification is missing
-25501 | Error when opening file
-25502 | Error when closing file
-25503 | Error when reading file
-25504 | Error when writing file
-25505 | Error when erasing file
-25507 | Error when shrinking file
-25801 | Internal program error


-25003: Name of database host could not be determined (SAP Library - SAP DB)

 Entering content frame

Background documentation -25003: Name of database host could not be determined

Explanation:

In a statement for opening a connection, no database host is specified. The database host could not be determined.

User Action:

In the statement for setting up a connection from the database instance to the Loader, enter the name of the host on which the database instance is running. Restart the Loader.


-25004: Error when connecting to the database (SAP Library - SAP DB)

 Entering content frame

Background documentation -25004: Error when connecting to the database

Explanation:

The system cannot open a connection to the database.

User Action:

Use the SQL error text to determine why the connection failed. Fix the cause of the problem, and restart the Loader.


-25005: Error when logging user on to the database (SAP Library - SAP DB)

 Entering content frame

Background documentation -25005: Error when logging user on to the database

Explanation:

The user specified could not be logged on to the database.

User Action:

Use the SQL error text to determine why the log on attempt failed. Fix the cause or the error and restart the Loader.


-25006: Error occurred when connecting to the database with spec (SAP Library - SAP DB)

 Entering content frame

Background documentation -25006: Error occurred when connecting to the database with specified user key

Explanation:

The system cannot create a connection to the database using the specified user data.

User Action:

Use the SQL error text to determine why the connection failed. Fix the cause or the error and restart the Loader.


-25007: Error when executing the command; no connection to the d (SAP Library - SAP DB)

 Entering content frame

Background documentation -25007: Error when executing the command; no connection to the database exists

Explanation:

During the execution of an upload or download command or an SQL command, the system was unable to find a connection to the database. This may be because you are not logged on to the correct database.

User Action:

Before you execute load, unload, or SQL statements, log on to the database using the command use user <user name> <password>.


-25008: Error when logging on user; previous user's database con (SAP Library - SAP DB)

 Entering content frame

Background documentation -25008: Error when logging on user; previous user's database connection has been restored

Explanation:

An error occurred when a user attempted to log on to the database. The last user to have logged on has been logged on again instead.

This error message only appears if a new user is unable log on to a database where another user who is processing upload and download commands is already logged on. This message precedes the error message –25005 .

User Action:

Since this message merely informs you that a previous connection has been restored, please proceed as described in message -25005 .


-25009: Failure in db communication (SAP Library - SAP DB)

 Entering content frame

Background documentation -25009: Failure in db communication

Explanation:

Communication between the Loader and the database takes place via the synchronous exchange of communication packages. The Loader sends a package containing the command that is to be processed to the database. This is known as a "request". While the database processes the command, the Loader waits for the package to be returned with the result. This is known as a "receive".

Errors may occur during this process if the connection from the Loader to the database is lost or if the database is no longer available.

User Action:

Use the error text to determine why the communication failed. Fix the cause or the error and restart the Loader.


-25010: <SQL error text> (SAP Library - SAP DB)

 Entering content frame

Background documentation -25010: <SQL error text>

Explanation:

The database reports SQL errors that occur while a user's SQL commands are being processed with this error number.

User Action:

Fix the cause of the error and restart the Loader.


-25011: Error when executing the internal SQL command (SAP Library - SAP DB)

 Entering content frame

Background documentation -25011: Error when executing the internal SQL command

Explanation:

An SQL command generated by the Loader to process an upload or download command could not be executed. This message also displays the cause of the error.

User Action:

Fix the cause of the error and restart the Loader.


-25018: Error when changing the authorizations for the log file; (SAP Library - SAP DB)

 Entering content frame

Background documentation -25018: Error when changing the authorizations for the log file; unable to change the file owner

Explanation:

This error only occurs when you execute the SET LOGOWNER <USERNAME> command on UNIX or Linux operating systems.

User Action:

Use the error text to determine why the modification failed. Rectify the error and re-execute the statement.


-25019: Error when opening the log file; temporary log file open (SAP Library - SAP DB)

 Entering content frame

Background documentation -25019: Error when opening the log file; temporary log file opened

Explanation:

Attempts to open the Loader's log file failed. This may have been caused by another Loader already running on the same computer. If more than one Loader is started on one computer at the same time, only one can access the log file at a time because log files can only be opened exclusively.

So the Loader can still process the statements, it opens a temporary log file, the name of which is stated in the message.

User Action:

No user action is required.


-25020: Memory full (SAP Library - SAP DB)

 Entering content frame

Background documentation -25020: Memory full

Explanation:

A statement cannot be executed because of limited memory space.

User Action:

No user action possible.


-25021: Error during user changeover (SAP Library - SAP DB)

 Entering content frame

Background documentation -25021: Error during user changeover

Explanation:

An error has occurred when downloading or uploading data using the commands TABLEEXTRACT ALL and TABLELOAD ALL.

To download or upload data using the statement above, the Loader must switch the user internally so it can process user-specific data. This internal changeover failed.

User Action:

Rectify the cause of the error and re-execute the command.


-25022: Request to terminate operation received; processing of c (SAP Library - SAP DB)

 Entering content frame

Background documentation -25022: Request to terminate operation received; processing of command terminated

Explanation:

Using Ctrl C, the user has sent a request to the Loader to cancel the processing of statements.

User Action:

No user action is required.


-25109: <command> not implemented (SAP Library - SAP DB)

 Entering content frame

Background documentation -25109: <command> not implemented

Explanation:

The specified statement could not be executed because the required functions have not been installed on the Loader.

User Action:

No user action possible.


-25201: Invalid length specification for INTEGER field; possible (SAP Library - SAP DB)

 Entering content frame

Background documentation -25201: Invalid length specification for INTEGER field

Explanation:

The command to upload or download data contains an error.

An explicit column description contains a file field of type INTEGER whose length does not correspond to the length stated here.

User Action:

Correct the data and re-execute the command.


-25202: Invalid length specification for REAL field; possible le (SAP Library - SAP DB)

 Entering content frame

Background documentation -25202: Invalid length specification for REAL field

Explanation:

The command to upload or download data contains an error.

A file field of type REAL is specified in an explicit column description. However, the length of the field does not match the length specified in the error message.

User Action:

Correct the file field type and re-execute the command.


-25203: Invalid length specification for DECIMAL field; possibl (SAP Library - SAP DB)

 Entering content frame

Background documentation -25203: Invalid length specification for DECIMAL field

Explanation:

The command to upload or download data contains an error.

A file field of type DECIMAL is specified in an explicit column description. However, the length of the field does not match the length specified in the error message.

User Action:

Correct your entries and re-execute the command.


-25204: Invalid length specification for ZONED field; possible (SAP Library - SAP DB)

 Entering content frame

Background documentation -25204: Invalid length specification for ZONED field; possible length is 20 bytes (40 bytes if hexadecimal)

Explanation:

The command to upload or download data contains an error.

An explicit column description contains a file field of type ZONED whose length does not correspond to the length specified in the error message.

User Action:

Correct the file field type and re-execute the command.


-25205: Invalid specification for USAGE; possible values are bet (SAP Library - SAP DB)

 Entering content frame

Background documentation -25205: Invalid specification for USAGE

Explanation:

An error has occurred in the FASTLOAD command.

The USAGE value specified in the command is not within the permitted number range, that is, between 50% and 100%.

User Action:

Correct the specified USAGE percentage and re-execute the command.


-25206: Invalid specification of lines for USAGE; value must be (SAP Library - SAP DB)

 Entering content frame

Background documentation -25206: Invalid specification of lines for USAGE

Explanation:

An error has occurred in the FASTLOAD command.

The value that has been specified for USAGE (0 rows) is not valid.

User Action:

Correct the number of rows you specified for USAGE and re-execute the command.


-25207: Number of lines specified for USAGE is too high (SAP Library - SAP DB)

 Entering content frame

Background documentation -25207: Number of lines specified for USAGE is too high

Explanation:

An error has occurred in the FASTLOAD command.

The row number specified for USAGE (rows per page of the database) is too large. The maximum number of lines allowed can be determined from the size of a database page and the size of a record in the table to be loaded.

User Action:

Correct your entries and re-execute the command.


-25208: Invalid position specification; enter positive values (SAP Library - SAP DB)

 Entering content frame

Background documentation -25208: Invalid position specification; specify a positive value

Explanation:

The command to upload or download data contains an error.

You cannot specify a negative value for a position.

User Action:

Correct the data and re-execute the command.


-25209: Invalid value for FRACTION; specify a positive value (SAP Library - SAP DB)

 Entering content frame

Background documentation -25209: Invalid value for FRACTION; specify a positive value

Explanation:

The command to upload or download data contains an error.

The value entered for FRACTION cannot be a negative value.

User Action:

Correct the entry you made for FRACTION and re-execute the command.


-25210: Invalid value for SCALE; enter a value between -127 and (SAP Library - SAP DB)

 Entering content frame

Background documentation -25210: Invalid value for SCALE; enter a value between -127 and 127

Explanation:

The command to upload or download data contains an error.

A number specified for SCALE must be between -127 and +127.

User Action:

Correct the entry you made for SCALE and re-execute the command.


-25211: Invalid ROUND specification; specify a value between 0 a (SAP Library - SAP DB)

 Entering content frame

Background documentation -25211: Invalid ROUND specification; specify a value between 0 and 18

Explanation:

The command to upload or download data contains an error.

A number specified for ROUND must be between 0 and 18.

User Action:

Correct the number of rows you specified for ROUND and re-execute the command.


-25212: Invalid TRUNC specification; enter a value between 0 and (SAP Library - SAP DB)

 Entering content frame

Background documentation -25212: Invalid TRUNC specification; enter a value between 0 and 18

Explanation:

The command to upload or download data contains an error.

A number specified for TRUNC must be between 0 and 18.

User Action:

Correct the number of rows you specified for TRUNC and re-execute the command.


-25213: Invalid file format specification; FORMATTED and COMPRES (SAP Library - SAP DB)

 Entering content frame

Background documentation -25213: Invalid file format specification; FORMATTED and COMPRESSED exclude each other

Explanation:

The command to upload or download data contains an error.

You cannot enter both COMPRESSED and FORMATTED as the format of a data file. These formats are mutually exclusive to one another.

User Action:

Correct the format and re-execute the command.


-25214: Invalid file format specification; Separator/Delimiter i (SAP Library - SAP DB)

 Entering content frame

Background documentation -25214: Invalid file format specification; Separator/Delimiter is not allowed together with FORMATTED

Explanation:

The command to upload or download data contains an error.

When FORMATTED is specified as the format of a data file in a command, you cannot also specify separators or delimiters in the statement.

User Action:

Correct the entries and re-execute the command.


-25216: File format FORMATTED required (SAP Library - SAP DB)

 Entering content frame

Background documentation -25216: File format specification FORMATTED required

Explanation:

The command to upload or download data contains an error.

The formats INTEGER, REAL, DECIMAL, and ZONED for individual columns to be loaded or extracted are only allowed if the data file format is set to FORMATTED.

User Action:

Correct the format and re-execute the command.


-25218: Invalid file format specification; no columns specified (SAP Library - SAP DB)

 Entering content frame

Background documentation -25218: Invalid file format specification; no columns specified despite FORMATTED file format

Explanation:

The command to upload or download data contains an error.

FORMATTED is specified as the data file format in a command. However, no columns are specified. FORMATTED requires that every column to be downloaded or uploaded be specified in the command.

User Action:

Correct the statement and re-execute it.


-25219: Columns must be specified in the command in ascending or (SAP Library - SAP DB)

 Entering content frame

Background documentation -25219: Columns must be specified in the command in ascending order according to their position

Explanation:

Error in the command for uploading data.

COMPRESSED was specified in the command as a data file format. If this is the case, the columns must be specified in the command in ascending order according to their position.

User Action:

Correct the entries and re-execute the command.


-25220: Invalid separator/delimiter specification (SAP Library - SAP DB)

 Entering content frame

Background documentation -25220: Invalid separator/delimiter specification

Explanation:

The command to upload or download data contains an error.

Separators and delimiters must not contain more than one character.

User Action:

Correct the format and re-execute the command.


-25221: Invalid specification for representation of decimal numb (SAP Library - SAP DB)

 Entering content frame

Background documentation -25221: Invalid specification for representation of decimal numbers

Explanation:

The command to upload or download data contains an error.

The data file format specification in a command includes a character string to be used for decimal numbers to arrange thousands and separate whole numbers from decimal places. The syntax of the character string is incorrect.

User Action:

Correct the entries and re-execute the command.


-25222: Invalid specification for Boolean display (SAP Library - SAP DB)

 Entering content frame

Background documentation -25222: Invalid specification for representation of decimal numbers

Explanation:

The command to upload or download data contains an error.

The data file format specification in a command includes a character string that specifies how BOOLEAN values loaded to or from the database instance are displayed. The syntax of the character string is incorrect.

User Action:

Correct the entries and re-execute the command.


-25223: Invalid specification for representation of NULL values (SAP Library - SAP DB)

 Entering content frame

Background documentation -25223: Invalid specification for representation of NULL values

Explanation:

The command to upload or download data contains an error.

The specification of the character string with which NULL values are represented, or are to be represented, externally in data files does not have the correct syntax. Character strings representing NULL values can be a maximum of 20 characters long.

User Action:

Correct the file field type and re-execute the command.


-25224: Invalid specification for language of messages; specify (SAP Library - SAP DB)

 Entering content frame

Background documentation -25224: Invalid specification for language of messages; specify ENG or DEU

Explanation:

The command to upload or download data contains an error.

German (DEU) and English (ENG) are supported as languages for messages (error, status, and warning messages).

User Action:

Correct the file field type and re-execute the command.


-25225: Invalid specification for the representation of thousand (SAP Library - SAP DB)

 Entering content frame

Background documentation -25225: Invalid specification for the representation of thousand separator and decimal point in numerical values

Explanation:

The command to upload or download data contains an error.

The specification of the thousand separator and the decimal point to be used when loading or unloading numerical values from the Loader does not have the correct syntax.

User Action:

Correct the file field type and re-execute the command.


-25226: Maximum number of column specifications in a command has (SAP Library - SAP DB)

 Entering content frame

Background documentation -25226: Maximum number of column specifications in a command has been exceeded

Explanation:

The command to upload or download data contains an error.

In a command to upload or download data, you cannot specify more columns than the database allows per table. This value of 1024 columns was exceeded in the command to be executed.

User Action:

Correct the file information and re-execute the command.


-25227: Maximum number of conditions in a command has been excee (SAP Library - SAP DB)

 Entering content frame

Background documentation -25227: Maximum number of conditions in a command has been exceeded

Explanation:

The command to upload or download data contains an error.

In a command to upload or download data, you cannot specify more than 254 conditions in total for all columns. This value was exceeded in the command to be executed.

User Action:

Correct the file field type and re-execute the command.


-25228: Invalid specification for external representation of dat (SAP Library - SAP DB)

 Entering content frame

Background documentation -25228: Invalid specification for external representation of date or time values

Explanation:

The command to upload or download data contains an error.

The specification for the representation of date or time values (specified template) is invalid.

Valid template representations are as follows:

HH.MM.SS | (ISO or EUR)
HH:MM AM (PM) | (USA)
HH:MM:SS | (JIS)
HHHHMMSS | (INTERNAL)
Freely definable templates. These must use the symbols H (for hours), M (for minutes), and S (for seconds). |

For more information, please see the SAP DB Loader user manual.

User Action:

Correct the file field type and re-execute the command.


-25229: Invalid relational operator in condition (SAP Library - SAP DB)

 Entering content frame

Background documentation -25229: Incorrect comparison operator in condition

Explanation:

The command to upload or download data contains an error.

The relational operator specified in the condition is not supported. Possible relational operators are:

< | smaller
<= | smaller or equal to
> | greater
>= | greater or equal to
<> | not equal to
= | equal to

User Action:

Correct the file information and re-execute the command.


-25230: Error in DATAEXTRACT command; specification for command (SAP Library - SAP DB)

 Entering content frame

Background documentation -25230: Error in DATAEXTRACT command; specification for command file is missing

Explanation:

Error when downloading data using the DATAEXTRACT command.

The command DATAEXTRACT FOR DATALOAD/FASTLOAD/DATAUPDATE must contain specifications for at least 2 output files – one file for data and one file for the commands to be created. The second of these files is missing in the command.

User Action:

Correct the file information and re-execute the command.


-25231: Specification of ROUND, TRUNC, or SCALE not allowed for (SAP Library - SAP DB)

 Entering content frame

Background documentation -25231: Specification of ROUND, TRUNC, or SCALE not allowed for this column

Explanation:

Error when uploading or downloading data.

The ROUND, TRUNC, or SCALE specification is only possible for numerical table columns, that is for table columns of type INTEGER, SMALLINT, FLOAT, or FIXED.

User Action:

Correct the file information and re-execute the command.


-25232: Unknown keyword (SAP Library - SAP DB)

 Entering content frame

Background documentation -25232: Unknown keyword

Explanation:

The command to upload or download data contains an error.

The entered command contains an unknown keyword.

User Action:

Correct the statement and re-execute it.


-25233: Error in column description; file format is COMPRESSED, (SAP Library - SAP DB)

 Entering content frame

Background documentation -25233: Error in column description; file format is COMPRESSED, but some descriptions contain end positions

Explanation:

An error has occurred in the command for uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

The file format for source files is specified in the command as COMPRESSED. With this format, the positions in the column descriptions specify the number of the current field to be uploaded in a data line of the source file. End positions are not allowed in this format.

User Action:

Correct the positions you entered and re-execute the command.


-25234: Error in column description; file format is FORMATTED, b (SAP Library - SAP DB)

 Entering content frame

Background documentation -25234: Error in column description; file format is FORMATTED, but some descriptions do not contain end positions

Explanation:

An error has occurred in the command for uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

The file format for source files is specified in the command as FORMATTED. With this format, position specifications in the form start position - end position are required.

User Action:

Correct the positions you entered and re-execute the command.


-25235: Error in column description; identical positions for dif (SAP Library - SAP DB)

 Entering content frame

Background documentation -25235: Error in column description; identical positions for different columns

Explanation:

Error when downloading data using the DATAEXTRACT command.

The file format for the target file is specified in the command as COMPRESSED. All values to be downloaded must be specified using different position specifications. Otherwise, downloaded values will be overwritten.

User Action:

Correct the data and re-execute the command.


-25236: Error in column description; column positions overlap (SAP Library - SAP DB)

 Entering content frame

Background documentation -25236: Error in column description; column positions overlap

Explanation:

Error when downloading data using the DATAEXTRACT command.

The file format for the target file is specified in the command as FORMATTED. You must specify all the values to be unloaded using non-overlapping column position references in the command. Otherwise, any values that have already been unloaded will be overwritten.

User Action:

Correct the data and re-execute the command.


-25237: Error when executing the command; the columns that are t (SAP Library - SAP DB)

 Entering content frame

Background documentation -25237: Error when executing the command; the columns that are to be updated are missing from the command

Explanation:

Error when updating data using the DATAUPDATE command.

The specifications required to execute the column update are missing from the command. The column specification must begin with the keyword SET.

For more information, see the description of the syntax of the DATAUPDATE command in the SAP DB Loader manual.

User Action:

Correct the statement and re-execute it.


-25238: Error when executing the command; the command does not c (SAP Library - SAP DB)

 Entering content frame

Background documentation -25238: Error when executing the command; the command does not contain any column specifications

Explanation:

Error when updating data using the DATAUPDATE command.

The column specifications required to execute the command are missing. The values specified in the columns represent the row in the target table that should be updated.

User Action:

Correct the statement and re-execute it.


-25239: The value specified is not a integer number (SAP Library - SAP DB)

 Entering content frame

Background documentation -25239: The value specified is not a integer number

Explanation:

An error has occurred in the command for uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

The value specified in a command is not recognized as an integer number (the range of values for integer numbers is 0 <= 2147483647).

User Action:

Correct the statement and re-execute it.


-25281: Syntax error at a certain position (SAP Library - SAP DB)

 Entering content frame

Background documentation -25281: Syntax error at a certain position

Explanation:

The Loader discovered a syntax error in the command when it was parsed.

User Action:

Correct the statement and re-execute it.


-25301: Invalid entry in Date or Time column (SAP Library - SAP DB)

 Entering content frame

Background documentation -25301: Invalid entry in Date or Time column

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

When you enter values in columns of data type Date or Time, there are various formats you can use (INTERNAL, EUR, ISO, USA, JIS). The Loader converts these values into the internal database format for each data type.

This error occurs if a value that you have specified is supposed to be inserted into a column of data type Date or Time but it cannot be converted into the correct internal database format.

User Action:

Correct the values and re-execute the command.


-25302: The value entered is not a valid numerical value: <value (SAP Library - SAP DB)

 Entering content frame

Background documentation -25302: The value entered is not a valid numerical value

Explanation:

An error has occurred in the command for uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

This error can have several causes depending on the context in which it occurs.

  • A value that is to be uploaded into a column with a numerical data type (INTEGER, FIXED (n,m), ...) cannot be converted into the internal format. The value is either too high or is not recognized as a number.
  • A value that is to be downloaded from a column with a numerical data type (INTEGER, FIXED (n,m), ...) cannot be converted into the external display format. The value is either too high or the data types are not compatible (for example, if you try to extract a value from a column of data type FLOAT and to display it externally as data type INTEGER BINARY).
  • Commands for uploading or downloading data contain certain conditions, for example, for downloading or uploading NULL values. If you have defined conditions for columns with a numerical data type, the values in these conditions must be recognized as a numerical value.

User Action:

Correct the values and re-execute the command.


-25303: The values entered are not in the correct order (SAP Library - SAP DB)

 Entering content frame

Background documentation -25303: The values entered are not in the correct order

Explanation:

Error when uploading data using the FASTLOAD command.

All values that are to be uploaded must be saved in key sequence in the data file. The order is disrupted either by the data record in the row (format of the file entered: COMPRESSED or FORMATTED without binary data) or the position specified (format of the file entered: FORMATTED with binary data).

User Action:

Correct the data and re-execute the command.


-25304: Key field entries are missing (SAP Library - SAP DB)

 Entering content frame

Background documentation -25304: Key field entries are missing

Explanation:

Error when uploading data using the FASTLOAD command.

No entries were made in one or more of the key fields of a table that is to be uploaded. The data record affected is specified in the next message.

User Action:

Correct the data and re-execute the command.


-25305: The entries in the key fields are too long (SAP Library - SAP DB)

 Entering content frame

Background documentation -25305: The entries in the key fields are too long

Explanation:

Error when uploading data using the FASTLOAD command.

User Action:

Correct the data and re-execute the command.


-25306: The value you have entered is not valid for hexadecimal (SAP Library - SAP DB)

 Entering content frame

Background documentation -25306: The value you have entered is not valid for hexadecimal display

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

You have specified in the command that the values to be uploaded in plain text are available in hexadecimal coding for one or more columns.

The values you have entered are not valid for hexadecimal display.

User Action:

Correct the values and re-execute the command.


-25308: CONSTRAINT condition violated (SAP Library - SAP DB)

 Entering content frame

Background documentation -25308: CONSTRAINT condition violated

Explanation:

Error when uploading data using the FASTLOAD command.

The data record specified does not meet the requirements defined in the CONSTRAINT condition for this table.

User Action:

Correct the data and re-execute the command.


-25309: The value you entered was not recognized as a BOOLEAN en (SAP Library - SAP DB)

 Entering content frame

Background documentation -25309: The value you entered was not recognized as a BOOLEAN entry

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

You can define how BOOLEAN values are displayed externally either in each individual command or in a command file for all commands.

The value to be uploaded is not compatible with this display type.

User Action:

Correct the data and re-execute the command.


-25310: Column <column name> does not permit NULL values (SAP Library - SAP DB)

 Entering content frame

Background documentation -25310: Column does not permit NULL values

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

You cannot upload NULL values into columns that have been defined as NOT NULL columns and that have no system default value.

User Action:

Correct the data and re-execute the command.


-25311: Data missing for NOT NULL column <column name> (SAP Library - SAP DB)

 Entering content frame

Background documentation -25311: Data missing for NOT NULL column

Explanation:

Error when uploading data using the FASTLOAD command.

This error occurs if no data is found in the data file for a column that has been defined as NOT NULL and that has no system default value or if the column is not specified in the command.

User Action:

Correct the values or the command and re-execute the command.


-25313: Numerical value has been truncated (SAP Library - SAP DB)

 Entering content frame

Background documentation -25313: Numerical value truncated

Explanation:

Error when downloading data using the DATAEXTRACT command.

A numerical value that is supposed to be downloaded and displayed in the format specified in the command cannot be extracted. This error occurs if, for example, you try to download the value 2147483647 from data type INTEGER into an external binary INTEGER value that is only 2 bytes long.

In this case, you will only see an error message, and instead of numerical data, the data file will only contain the same number of asterisks (*). This error does not interrupt the data download.

User Action:

Check the data once it has been downloaded.


-25314: Too few decimal places defined for column <column name>; (SAP Library - SAP DB)

 Entering content frame

Background documentation -25314: Too few decimal places defined for column

Explanation:

Error when downloading data using the DATAEXTRACT command.

The format you have defined for the external display of the specified column’s values (DECIMAL or ZONED format) contains too few decimal places. The number required is determined by the column definition in the database and/or the operations that are performed on the column values when they are downloaded.

User Action:

Correct the specifications you made for the external display of this column and re-execute the command.


-25315: The data type of the column <column name> and the extern (SAP Library - SAP DB)

 Entering content frame

Background documentation -25315: The data type of the column and the external data type are not compatible

Explanation:

Error when downloading data using the DATAEXTRACT command.

User Action:

Select another external data type and re-execute the command.


-25316: The FASTLOAD command cannot be executed; the table conta (SAP Library - SAP DB)

 Entering content frame

Background documentation -25316: The FASTLOAD command cannot be executed; the table contains at least one column of data type LONG

Explanation:

Error when uploading data using the FASTLOAD command.

The table that is supposed to be uploaded must not contain any columns of data type LONG. This also applies even if the column affected does not need to be uploaded, that is, even if the command does not list the column in the column description.

User Action:

Load the table with the DATALOAD command instead.


-25317: Entry for column <column name> is not compatible with th (SAP Library - SAP DB)

 Entering content frame

Background documentation -25317: Entry for column is not compatible with the data type or the column length

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

The value you have entered cannot be loaded into the column because it is either too long or the external data type and the column data type are incompatible.

User Action:

Correct the data and re-execute the command.


-25318: The generated system key has exceeded the maximum possib (SAP Library - SAP DB)

 Entering content frame

Background documentation -25318: The generated system key has exceeded the maximum possible value

Explanation:

Error when uploading data using the FASTLOAD command.

Data is being loaded into a table containing no user-defined keys. If this is the case, the database generates its own internal key.

The key that is generated exceeds the maximum possible value. However, this error only occurs if the number of data records in the table exceeds 2E48.

User Action:

No user action is possible.


-25319: Unable to find any data for the column in the data file (SAP Library - SAP DB)

 Entering content frame

Background documentation -25319: Unable to find any data for the column in the data file

Explanation:

Error when uploading data using the DATALOAD or FASTLOAD command.

When you load data, you must specify data in the data file for all columns included in the command. The only exceptions to this rule are columns that permit system default or NULL values.

The Loader was unable to find any data in the data file for the column specified.

In addition to displaying this error message, the Loader also logs which row (text data file) or which position in the file (binary data file) the error occurred in.

User Action:

Check the data in the data file and re-execute the command.


-25320: The LONG value could not be loaded into column <column n (SAP Library - SAP DB)

 Entering content frame

Background documentation -25320: The LONG value could not be loaded into column

Explanation:

An error has occurred while uploading (DATALOAD) or updating data (DATAUPDATE).

An error occurred when loading a value into a column of data type LONG. The error message contains extra text outlining the cause of the failed upload.

User Action:

Correct the cause of the error and re-execute the command.


-25321: Error in the command; the constant you have entered <val (SAP Library - SAP DB)

 Entering content frame

Background documentation -25321: Error in the command; the constant you have entered is not a valid number

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

You can specify conditions for individual columns in your commands, which then govern how the values are loaded/updated. The system must be able to identify the constants in conditions for numerical columns as numbers.

If you see this error message, it means that the value you have entered as a constant is not recognized as a number.

User Action:

Correct the statement and re-execute it.


-25322: Error in the command; the constant you entered was trunc (SAP Library - SAP DB)

 Entering content frame

Background documentation -25322: Error in the command; the constant you entered was truncated during conversion

Explanation:

An error has occurred while uploading (DATALOAD or FASTLOAD) or updating data (DATAUPDATE).

You can specify conditions for individual columns in your commands, which then govern how the values are loaded/updated. The system must be able to identify the constants in conditions for numerical columns as numbers.

If you see this error message, it means that the value you have entered as a constant is recognized as a number. However, it was truncated by a few decimal places during conversion and therefore can no longer be used.

User Action:

Correct the statement and re-execute it.


-25323: Error in command; the data type of the constant in the c (SAP Library - SAP DB)

 Entering content frame

Background documentation -25323: Error in command; the data type of the constant in the column’s NULL condition is not compatible with the external column data type

Explanation:

Error when downloading data using the DATAEXTRACT command.

You can specify in your command a NULL value for individual columns so that if a NULL value is downloaded, the constant specified in your command is entered in the data file.

The data type of the constant value you specified and the external data type of the column to be extracted must be compatible. If you do not specify a data type in the command, the default data type CHAR is used.

User Action:

Correct the statement and re-execute it.


-25324: Error in the length specifications of the column descrip (SAP Library - SAP DB)

 Entering content frame

Background documentation -25324: Error in the length specifications of the column descriptions; see log file for more detailed information

Explanation:

Error when downloading data using the DATAEXTRACT command.

You can specify in your command the length of the values in the data file for individual columns. Some of the lengths you specify may be shorter than the column lengths defined in the database. If this is the case, these values may be extracted incorrectly.

This error message is only a summary of the error. The error messages –25203 , -25204 , and -25315 specify which column descriptions contain errors and are listed in the log file.

User Action:

Correct the statement and re-execute it.


-25325: Error in command; the external and internal data types a (SAP Library - SAP DB)

 Entering content frame

Background documentation -25325: Error in command; the external and internal data types are not compatible. For more detailed information, please consult the log file

Explanation:

Error when downloading data using the DATAEXTRACT command.

You can specify in your command the external data type of the values in the data file for individual columns.

This error message is only a summary of the error. The error messages -25315 and -25323 specify which column descriptions contain errors and they are only listed in the log file.

User Action:

Correct the statement and re-execute it.


-25326: Error when executing the download command. The number ex (SAP Library - SAP DB)

 Entering content frame

Background documentation -25326: Error when executing the extract command; the number extracted was truncated during conversion

Explanation:

Error when downloading data using the DATAEXTRACT command.

The number that was downloaded was truncated by a few decimal places when it was converted into an external data type.

This error does not cause the command to terminate.

User Action:

No user action required.


-25327: Error when extracting data record <number of data record (SAP Library - SAP DB)

 Entering content frame

Background documentation -25327: Error when extracting data record

Explanation:

Error when downloading data using the DATAEXTRACT command.

The data record included in the error message was downloaded incorrectly.

The position specified is only relevant for binary data files because they state the exact position of the incorrect data record in the data file. When dealing with text data files, the position is always 1.

This error message was preceded by other error messages which describe in more detail the error and the incorrect values in the data record.

This error does not cause the command to terminate if it was executed with error tolerance greater than 1.

User Action:

Check the incorrect data records.

If the command terminates, correct the statement and re-execute it.


-25328: Error when executing the DATAEXTRACT command; the server (SAP Library - SAP DB)

 Entering content frame

Background documentation -25328: Error when executing the DATAEXTRACT command; the server’s log file contains more detailed information

Explanation:

Error when downloading data using the DATAEXTRACT command.

Only the client (for example, repmcli) displays this error message.

User Action:

Check the problems that have occurred using the entries in the server's log file.

Correct the statement if necessary and re-execute it.


-25329: Error when executing the command; the data file is corru (SAP Library - SAP DB)

 Entering content frame

Background documentation -25329: Error when executing the TABLELOAD command; the data file is corrupt or was not created using TABLEEXTRACT

Explanation:

Error when uploading data using the TABLELOAD command.

The data files for the TABLELOAD command must be binary files containing database structures and special information on executing the subsequent TABLELOAD command. These files are created using the TABLEEXTRACT command and must not be modified in any way.

The data file specified in the command was modified after TABLEEXTRACT was executed or it was not created using TABLEEXTRACT. The <cause of the error> section states which information in the data file cannot be evaluated.

User Action:

Create the data file using the TABLEEXTRACT command and re-execute the command.


-25330: Error when executing the command; the page sizes of the (SAP Library - SAP DB)

 Entering content frame

Background documentation -25330: Error when executing the TABLELOAD command; the page sizes of the source and target file are different

Explanation:

Error when uploading data using the TABLELOAD command.

The data generated with the TABLEEXTRACT command is a binary structure of the downloaded database. If you want to load the data back into another database, it must have the same page size as the source database.

This error occurs when the page size of the database from where the table(s) were downloaded is different to the page size of the target database.

User Action:

No user action is possible. The data can only be loaded into a database with the same page size as the source database.


-25331: This is a restricted statement, user must be SYSDBA (SAP Library - SAP DB)

 Entering content frame

Background documentation -25331: This is a restricted statement, user must be SYSDBA

Explanation:

The commands TABLEEXTRACT ALL, TABLELOAD ALL, CATALOGEXTRACT ALL, and CATALOGLOAD ALL affect the whole database catalog and can therefore only be executed by a system administrator.

User Action:

Call the SAP DB Loader using the correct user ID or execute a USE-USER command with the correct user ID beforehand.


-25332: Unable to extract table definition <SQL error text> (SAP Library - SAP DB)

 Entering content frame

Background documentation -25332: Unable to extract table definition

Explanation:

Error when downloading data using the TABLEEXTRACT command.

When you execute a TABLEEXTRACT command, all table data as well as the table’s structure is downloaded for each table. This means that the downloaded table can be completely restored when you call the TABLELOAD command.

An error occurred when the table’s structure was downloaded. You can find the cause of the error in the SQL error text.

User Action:

Analyze the cause of the error and re-execute the command.


-25333: Unable to extract index definition <SQL error text> (SAP Library - SAP DB)

 Entering content frame

Background documentation -25333: Unable to extract index definition

Explanation:

Error when downloading data using the TABLEEXTRACT command.

When you execute a TABLEEXTRACT command, all table data as well as the table’s index definitions are downloaded for each table. This means that the downloaded table can be completely restored when you call the TABLELOAD command.

An error occurred when the table’s index definitions were downloaded. You can find the cause of the error in the SQL error text.

User Action:

Analyze the cause of the error and re-execute the command.


-25334: The file counter exceeds the maximum of 9999 files (SAP Library - SAP DB)

 Entering content frame

Background documentation -25334: The file counter exceeds the maximum of 9999 files

Explanation:

Error when downloading data using the TABLEEXTRACT command.

To ensure that data files generated during a TABLEEXTRACT command do not exceed the default size, a series of data files will be automatically generated on the basis of the data file name specified in the statement.

The maximum number of data files that can be generated is 9999.

User Action:

Correct the default size for one single data file in the TABLEEXTRACT command and re-execute the command.


-25335: Error when restoring the table <table name>; the data fi (SAP Library - SAP DB)

 Entering content frame

Background documentation -25335: Error when restoring the table <table name>; the data file specified was created with TABLEEXTRACT USER/ALL

Explanation:

Error when uploading data using the TABLELOAD TABLE command.

The data generated using the TABLEEXTRACT command was created with the option USER or ALL. The tables that were downloaded in this way can only be restored with the TABLELOAD USER or the TABLELOAD ALL command. You cannot restore one particular table using this data.

User Action:

If you want to restore one particular table, you must download it using the TABLEEXTRACT command.

If you want to restore all the data from the data file, correct the command and re-execute it.


-25336: Error when restoring tables; the data file specified was (SAP Library - SAP DB)

 Entering content frame

Background documentation -25336: Error when restoring tables; the data file specified was created using TABLEEXTRACT TABLE

Explanation:

Error when uploading data using the TABLELOAD ALL or the TABLELOAD USER command.

The data generated using the TABLEEXTRACT command was created with the option TABLE. If you use this command, only one table is downloaded. This can only be restored using the relevant TABLELOAD TABLE command.

You cannot restore more than one table using this data.

User Action:

If you want to restore tables, first of all you must download them using the correct TABLEEXTRACT command (use the option ALL or USER):

  • Use the option ALL or USER for more than one table
  • Use the option TABLE for a single table


-25337: Error when restoring table <table name>; the data file < (SAP Library - SAP DB)

 Entering content frame

Background documentation -25337: Error when restoring table; the data file contains no data for the specified table

Explanation:

Error when uploading data using the TABLELOAD command.

The specified data file does not contain any data with which to restore the table. Before a table can be restored, it must be unloaded using the TABLEEXTRACT command.

User Action:

Download the table before you restore it.


-25338: Error when restarting the command; entry in assignment f (SAP Library - SAP DB)

 Entering content frame

Background documentation -25338: Error when restarting the command; entry in assignment file not found

Explanation:

Error when re-executing the TABLELOAD command for uploading data.

You can restart cancelled uploads using the TABLELOAD command. To enable you to do this, the Replication Manager writes a restart file containing the name of the last table to be uploaded successfully when it executes the TABLELOAD command.

This error occurs if the SAP DB Loader is unable to find the name of the table written to the restart file in the assignment file. One possible cause may be that the assignment file was modified after the upload was cancelled.

User Action:

If possible, restore the assignment file to its original state. If this is not possible, you need to download and upload all the data again to ensure your data is consistent.


-25339: Error when restarting the command; unable to open restar (SAP Library - SAP DB)

 Entering content frame

Background documentation -25339: Error when restarting the command; unable to open restart

Explanation:

Error when re-executing the TABLELOAD command for uploading data.

The system was unable to open the restart file.

User Action:

Analyze and rectify the cause of the error. Execute the command again.


-25340: UCS2 conversion error; character string contains invalid (SAP Library - SAP DB)

 Entering content frame

Background documentation -25340: UCS2 conversion error; character string contains invalid characters or character sequences

Explanation:

Error uploading or updating data using the DATALOAD, FASTLOAD, or DATAUPDATE command on a UNICODE database.

If data on a UNICODE database is uploaded into columns of a character-based data type (CHAR), the SAP DB Loader converts it into a format the database recognizes (UCS2). In this case, an error has occurred during the conversion. The data that is to be uploaded contains characters that cannot be converted into UCS2.

User Action:

Correct the rejected data and re-execute the command.


-25341: Error when generating the CREATE TABLE/CREATE INDEX stat (SAP Library - SAP DB)

 Entering content frame

Background documentation -25341: Error when generating the CREATE TABLE/CREATE INDEX statement

Explanation:

Error when downloading data using the DATAEXTRACT FOR DATALOAD command.

When you execute the DATAEXTRACT FOR DATALOAD command, data is downloaded and commands for creating tables (CREATE TABLE) and indexes (CREATE INDEX) are generated.

In this case, an error has occurred during the conversion. The error is described in more detail in the error message text specified in the error message.

User Action:

Rectify the cause of the error and re-execute the command.


-25342: Error when restoring table <table name>; the structures (SAP Library - SAP DB)

 Entering content frame

Background documentation -25342: Error when restoring table <table name>; the structures of the source and target tables are different

Explanation:

Error when uploading data using the TABLELOAD command.

The specified table already exists in the database. The Loader has established that the structures of the source and target table are different. This means that the data cannot be uploaded.

User Action:

Change the structure of the target table so that it matches that of the source table. Execute the command again.


-25343: Error in command; the SELECT statement in the command do (SAP Library - SAP DB)

 Entering content frame

Background documentation -25343: Error in command; the SELECT statement in the command does not contain the column name

Explanation:

Error when downloading data using the DATAEXTRACT command.

The column names are present in the column list but are missing from the SELECT command. These will not be unloaded and therefore cannot be backed up in the data file.

User Action:

If you want to download these columns as well, you must include them in the SELECT command. If you do not want to download them, delete the column names from the column list.

Execute the command again.


-25344: Error in command; the output length specified for column (SAP Library - SAP DB)

 Entering content frame

Background documentation -25344: Error in command for downloading data; the output length specified is too small for column. Minimum output length is:

Explanation:

Error when downloading data using the DATAEXTRACT command.

The length specified for output is too small and not all values that are possible based on the column definition in the database can be output.

User Action:

Correct the output length for the column specified and re-execute the command.


-25351: Error in command; the LONGFILE specification for the col (SAP Library - SAP DB)

 Entering content frame

Background documentation -25351: Error in command; the LONGFILE specification for the column is missing from the command

Explanation:

Error when downloading data using the DATAEXTRACT command.

The column specified in the DATAEXTRACT command's SELECT statement is data type LONG. To download it, you must include a LONGFILE specification in the command for this column.

For more information, please see the SAP DB Loader user manual.

User Action:

Correct the statement and re-execute it.


-25352: Error when downloading data; several errors occurred whe (SAP Library - SAP DB)

 Entering content frame

Background documentation -25352: Error when downloading data; several errors occurred when analyzing the LONGFILE specification in the command. For more information, please consult the log file

Explanation:

Error when downloading data using the DATAEXTRACT command.

This error message is only a summary of the error. The error messages that preceded this message are listed in the log file.

User Action:

Check the other error messages and correct the command and re-execute it.


-25353: Error when downloading data; the maximum number of LONG (SAP Library - SAP DB)

 Entering content frame

Background documentation -25353: Error when downloading data; the maximum number of LONG data files for the column has been exceeded

Explanation:

Error when downloading data using the DATAEXTRACT command.

You can set the LONGFILE specification in your command for columns of data type LONG so that each value that is downloaded is written to a single file. Placeholders ("#" – see the SAP DB Loader manual) in the file name determine the maximum number of files that can be generated. For example, <file name>### would mean that up to 1000 files can be generated.

This error occurs if the table contains more data records than the number of files that can be generated.

User Action:

Correct the statement and re-execute it.


-25354: Error in the command for uploading data; the LONG data f (SAP Library - SAP DB)

 Entering content frame

Background documentation -25354: Error in the command for uploading data; the LONG data file specification is missing

Explanation:

This error occurs when uploading or updating data with the DATALOAD or DATAUPDATE command if all LONG values of a column that are to be inserted are in a LONG data file.

The SAP DB Loader was unable to find any specifications in the source file stating where the values are located in the LONG data file.

User Action:

Correct the data file and re-execute the command.


-25501: Error when opening the file <file name>: <operating syst (SAP Library - SAP DB)

 Entering content frame

Background documentation -25501: Error when opening file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred. Reasons for the error may be that there is no file of this name or that the specified disk is write-protected, etc.

User Action:

Specify a different filename or correct the error (at operating system level).


-25502: Error when closing the file <file name>: <operating syst (SAP Library - SAP DB)

 Entering content frame

Background documentation -25502: Error when closing file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred.

User Action:

No user action is required.


-25503: Error when reading file (SAP Library - SAP DB)

 Entering content frame

Background documentation -25503: Error when reading file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred.

User Action:

Fix the cause of the error and restart the Loader to process the terminated command.


-25504: Error when writing file (SAP Library - SAP DB)

 Entering content frame

Background documentation -25504: Error when writing file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred.

User Action:

Fix the cause of the error and restart the Loader to process the terminated command.


-25505: Error when deleting the file <file name>: <operating sys (SAP Library - SAP DB)

 Entering content frame

Background documentation -25505: Error when erasing file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred.

User Action:

No user action is required.


-25507: Error when reducing the file <file name>: <operating sys (SAP Library - SAP DB)

 Entering content frame

Background documentation -25507: Error when shrinking file

Explanation:

An operating system-dependent text appears in the operating system error message, indicating the error that occurred. Reasons for the error may be that there is no file of this name or that the specified disk is write-protected, etc.

User Action:

Specify a different filename or correct the error at operating system level.


-25801: Internal program error (SAP Library - SAP DB)

 Entering content frame

Background documentation -25801: Internal program error

Explanation:

An internal program error has occurred.

User Action:

Notify your local support organization and give them the details contained in the error message.


From -27000 to -28999 (SAP Library - SAP DB)

 Entering content frame

From -27000 to -28999

Error Messages of the liveCache

-27000 | Unknown error
-27003 | Numeric input parameter overflow
-27006 | Incompatible data types
-27009 | Command too long
-27014 | Connect not ok
-27015 | Connection down
-27016 | DB shut down
-27017 | Too many users
-27018 | Connection error
-27019 | Unicode/ASCII conversion failed
-28001 | Access via NIL OID
-28002 | Invalid OID
-28003 | Unknown GUID
-28005 | Duplicate object
-28006 | Object not locked
-28007 | OID not compatible with given class
-28501 | Error reading OMS input stream
-28502 | Error writing OMS output stream
-28503 | Crash in DB-Procedure
-28505 | No component object found
-28508 | Unsupported parameter type
-28514 | Unknown OMS version
-28515 | OMS Version already open
-28516 | Commit or Rollback required
-28517 | Already in Critical Section
-28518 | Not in Critical Section
-28521 | Already in version
-28522 | Missing before image
-28523 | Unknown schema
-28524 | Duplicate schema
-28525 | Procedure Address not found
-28527 | Directory not found
-28529 | Too small name buffer
-28530 | omsTerminate called
-28531 | OMS read only
-28532 | Version bound by transaction
-28533 | Integer out of packed range
-28534 | Package must be recreated
-28801 | Wrong class id
-28802 | Wrong object version
-28803 | Wrong object state
-28804 | Too old OID
-28806 | Nil page pointer
-28808 | Hash not found
-28810 | Duplicate hash key
-28813 | Unknown consistent version
-28814 | Object not found
-28815 | Object history not found
-28817 | Wrong object length
-28818 | Wrong object position
-28819 | Object has been updated by other transactions
-28902 | Too many nested try/catch statements
-28903 | DBFunction $1 must return a value
-28822 to -28999 | Internal Error


-27000: Unknown error (SAP Library - SAP DB)

 Entering content frame

-27000: Unknown error

Explanation:

A system error has occurred.

User Action:

Contact your local support organization.


-27003: Numeric input parameter overflow (SAP Library - SAP DB)

 Entering content frame

Background documentation -27003: Numeric input parameter overflow

Explanation:

An overflow occurred in one of the following situations:

  • An SQL read command:

When transferring a numerical value from the database to a host variable

or

  • An SQL write command:

When transferring a numerical value from a host variable to the database

User Action:

Contact your local support organization.


-27006: Incompatible data types (SAP Library - SAP DB)

 Entering content frame

Background documentation -27006: Incompatible data types

Explanation:

One of the following situations occurred:

An SQL read command attempted to read a value from the database to an incompatible host variable.

or

An SQL write command attempted to write the value of an incompatible host variable to the database.

User Action:

Contact your local support organization.


-27009: Command too long (SAP Library - SAP DB)

 Entering content frame

Background documentation -27009: Command too long

Explanation:

An attempt was made to prepare or execute an SQL command that is too long.

User Action:

Contact your local support organization.


-27014: Connect not ok (SAP Library - SAP DB)

 Entering content frame

Background documentation -27014: Connect not ok

Explanation:

An unspecified connection error occurred.

User Action:

Contact your local support organization.


-27015: Connection down (SAP Library - SAP DB)

 Entering content frame

Background documentation -27015: Connection down

Explanation:

The liveCache connection has been broken.

User Action:

Contact your local support organization.


-27016: DB shut down (SAP Library - SAP DB)

 Entering content frame

Background documentation -27016: DB shut down

Explanation:

An external SQL class attempted to set up a connection to a database that has been shut down.

User Action:

Contact your local support organization.


-27017: Too many volumes (SAP Library - SAP DB)

 Entering content frame

Background documentation -27017: Too many volumes

Explanation:

The maximum possible number of database connections has been exceeded.

User Action:

Contact your local support organization.


-27018: Connection error (SAP Library - SAP DB)

 Entering content frame

Background documentation -27018: Connection error

Explanation:

An unspecified error occurred when an SQL command was executed in liveCache.

User Action:

Contact your local support organization.


-27019: Unicode/ASCII conversion failed (SAP Library - SAP DB)

 Entering content frame

Background documentation -27019: Unicode/ASCII conversion failed

Explanation:

The database wants to read a Unicode character string to an Ascii variable. However, at least one character is a real Unicode character, which cannot be converted to Ascii.

User Action:

Contact your local support organization.


-28001: Access via NIL OID (SAP Library - SAP DB)

 Entering content frame

Background documentation -28001: Access via NIL OID

Explanation:

Invalid OMS operation, for example, dereferencing ( omsDeref) when specifying the NIL Oid.

User Action:

Contact your local support organization.


-28002: Invalid OID (SAP Library - SAP DB)

 Entering content frame

Background documentation -28002: Invalid OID

Explanation:

Invalid OID specified for an OMS operation.

This is the case if the page number or position part of the OID falls outside of the permitted limits.

User Action:

Contact your local support organization.


-28003: Unknown GUID (SAP Library - SAP DB)

 Entering content frame

Background documentation -28003: Unknown GUID

Explanation:

A non-registered class was addressed.

A persistent class must be registered with omsRegClass before it is accessed for the first time.

User Action:

Contact your local support organization.


-28005: Duplicate object (SAP Library - SAP DB)

 Entering content frame

Background documentation -28005: Duplicate object

Explanation:

An attempt was made to generate a copy of a variable object ( omsLoadVarObject), even though the caller already owns a copy.

This copy must first be released with omsReleaseVarObject.

User Action:

Contact your local support organization.


-28006: Object not locked (SAP Library - SAP DB)

 Entering content frame

Background documentation -28006: Object not locked

Explanation:

When it attempted to change or delete an instance of a persistent class, liveCache determined that the current transaction does not have a lock for this instance.

This is not allowed.

User Action:

Contact your local support organization.


-28007: OID not compatible with given class (SAP Library - SAP DB)

 Entering content frame

Background documentation -28007: OID not compatible with given class

Explanation:

An attempt was made to dereference an object whose OID does not match the specified class.

The types of the OID and object are not compatible.

User Action:

Contact your local support organization.


-28501: Error reading OMS input stream (SAP Library - SAP DB)

 Entering content frame

Background documentation -28501: Error reading OMS input stream

Explanation:

A read error occurred in an internal ABAP table or in a stream.

For more information, see the liveCache file knldiag.

User Action:

Contact your local support organization.


-28502: Error writing OMS output stream (SAP Library - SAP DB)

 Entering content frame

Background documentation -28502: Error writing OMS output stream

Explanation:

A write error occurred in an internal ABAP table or in a stream. For more information, see the liveCache file knldiag.

User Action:

Contact your local support organization.


-28503: Crash in DB-Procedure (SAP Library - SAP DB)

 Entering content frame

Background documentation -28503: Crash in DB-Procedure

Explanation:

When a database procedure was called, a non-handled exception occurred in the method code of the corresponding component instance.

For more information, see the liveCache file knldiag.

User Action:

Contact your local support organization.


-28505: No Component Object found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28505: No Component Object found

Explanation:

The OMS library could not be loaded when liveCache was started.

liveCache cannot run.

User Action:

Contact your local support organization.


-28508: Unsupported parameter type (SAP Library - SAP DB)

 Entering content frame

Background documentation -28508: Unsupported parameter type

Explanation:

liveCache cannot assign an SQL data type to a parameter in a method of a component class.

User Action:

Contact your local support organization.


-28514: Unknown OMS Version (SAP Library - SAP DB)

 Entering content frame

Background documentation -28514: Unknown OMS Version

Explanation:

When liveCache called omsOpenVersion, OmsCloseVersion, omsDropVersion or omsRenameVersion, it established that the specified version does not exist.

User Action:

Contact your local support organization.


-28515: OMS Version already open (SAP Library - SAP DB)

 Entering content frame

Background documentation -28515: OMS Version already open

Explanation:

When liveCache called omsOpenVersion, it established that the addressed version has already been opened by a competing task.

This version cannot be opened until the task closes this version and ends the transaction.

User Action:

Contact your local support organization.


-28516: Commit or Rollback required (SAP Library - SAP DB)

 Entering content frame

Background documentation -28516: Commit or Rollback required

Explanation:

When liveCache called omsCreateVersion, omsOpenVersion or omsDropVersion, it established that changes have already been made to instances in persistent classes in the current transaction.

This is not allowed, since the current transaction must already have ended.

User Action:

Contact your local support organization.


-28517: Already in Critical Section (SAP Library - SAP DB)

 Entering content frame

Background documentation -28517: Already in Critical Section

Explanation:

The function omsEnter was called for an instance of OmsCriticalSection although this instance is already in the critical section.

This is not allowed.

User Action:

Contact your local support organization.


-28518: Not in Critical Section (SAP Library - SAP DB)

 Entering content frame

Background documentation -28518: Not in Critical Section

Explanation:

The function omsLeave was called for an instance of OmsCriticalSection although this instance is not in the critical section.

This is not allowed.

User Action:

Contact your local support organization.


-28521: Already in version (SAP Library - SAP DB)

 Entering content frame

Background documentation -28521: Already in version

Explanation:

When liveCache called the function omsOpenVersion, it established that the caller is already in a version.

This is not allowed.

User Action:

Contact your local support organization.


-28522: Missing before image (SAP Library - SAP DB)

 Entering content frame

Background documentation -28522: Missing before image

Explanation:

The function omsStore established that no before-image exists of the object that needs to be changed.

In this case, no ForUpd pointer is requested for the object.

No changes can be made to the object.

User Action:

Contact your local support organization.


-28523: Unknown schema (SAP Library - SAP DB)

 Entering content frame

Background documentation -28523: Unknown schema

Explanation:

An attempt was made to access a non-existent schema.

This can occur when registering or deleting a container, or when resolving a schema.

User Action:

Contact your local support organization.


-28524: Duplicate schema (SAP Library - SAP DB)

 Entering content frame

Background documentation -28524: Duplicate schema

Explanation:

When liveCache called the function omsCreateSchema, it established that a schema with the specified name already exists.

This is not allowed.

User Action:

Contact your local support organization.


-28525: Procedure Address not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28525: Procedure Address not found

Explanation:

The function specified when dbpGetProcAddress was called could not be localized.

User Action:

Contact your local support organization.


-28527: Directory not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28527: Directory not found

Explanation:

The path name could not be retrieved for dbpGetDbrootSapPath or dbpGetWorkingDirectory.

The buffer for the name is too small.

User Action:

Contact your local support organization.


-28529: Too small name buffer (SAP Library - SAP DB)

 Entering content frame

Background documentation -28529: Too small name buffer

Explanation:

The buffer for the return values is too small for omsGetLiveCacheVersion, omsGetLocalDateTime, omsGetLocalDateTime or omsGetSchemaName.

User Action:

Contact your local support organization.


-28530: omsTerminate called (SAP Library - SAP DB)

 Entering content frame

Background documentation -28530: omsTerminate called

Explanation:

The method omsTerminate was called.

This resolved all component instances in the relevant session, and reset the current transaction.

User Action:

Contact your local support organization.


-28531: OMS read only (SAP Library - SAP DB)

 Entering content frame

Background documentation -28531: OMS read only

Explanation:

An attempt was made to lock an object, although the calling session is in read-only mode. This is not allowed.

User Action:

Contact your local support organization.


-28532: Version bound by transaction (SAP Library - SAP DB)

 Entering content frame

Background documentation -28532: Version bound by transaction

Explanation:

When liveCache called omsOpenVersion, it established that the addressed version is already linked to a competing task, but has not been opened.

The version cannot be opened until the task has ended its transaction.

User Action:

Contact your local support organization.


-28533: Integer out of packed range (SAP Library - SAP DB)

 Entering content frame

Background documentation -28533: Integer out of packed range

Explanation:

An 8 byte integer value needs to be converted into a value with the type OmsTypePacked_8_3 that is outside the permitted range.

User Action:

Contact your local support organization.


-28534: Package must be recreated (SAP Library - SAP DB)

 Entering content frame

Background documentation -28534: Package must be recreated

Explanation:

The library assigned to the package was changed after the package was created.

User Action:

Delete the package and create it again.


-28801: Wrong class id (SAP Library - SAP DB)

 Entering content frame

Background documentation -28801: Wrong class id

Explanation:

An incorrect container ID was used to access an object.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28802: Wrong object version (SAP Library - SAP DB)

 Entering content frame

Background documentation -28802: Wrong object version

Explanation:

An attempt was made to lock a deleted or reused object.

This error is translated as and OmsOutOfDate Exception, but can be logged as an error in the knldiag file.

User Action:

Contact your local support organization.


-28803: Wrong object version (SAP Library - SAP DB)

 Entering content frame

Background documentation -28803: Wrong object version

Explanation:

An attempt was made to access a deleted object. This error is translated as and OmsOutOfDate Exception, but can be logged as an error in the knldiag file.

User Action:

Contact your local support organization.


-28804: Too old OID (SAP Library - SAP DB)

 Entering content frame

Background documentation -28804: Too old OID

Explanation:

When liveCache dereferenced an OID, it could not decide whether the OID ever existed.

See also error message –28815.

This error is translated as an OmsOutOfDate Exception.

User Action:

Contact your local support organization.


-28806: Nil page pointer (SAP Library - SAP DB)

 Entering content frame

Background documentation -28806: Nil page pointer

Explanation:

The container directory is inconsistent.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28808: Hash not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28808: Hash not found

Explanation:

A B* tree of a keyed object container could not be found.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28810: Duplicate hash key (SAP Library - SAP DB)

 Entering content frame

Background documentation -28810: Duplicate hash key

Explanation:

A duplicate entry was found in the global container directory.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28813: Unknown consistent version (SAP Library - SAP DB)

 Entering content frame

Background documentation -28813: Unknown consistent version

Explanation:

An attempt was made to access an object in a view that liveCache no longer recognizes.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28814: Object not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28814: Object not found

Explanation:

A non-existent OID was dereferenced.

User Action:

Contact your local support organization.


-28815: Object history not found (SAP Library - SAP DB)

 Entering content frame

Background documentation -28815: Object history not found

Explanation:

When an object is dereferenced, the liveCache data area that contains the before-images of persistent objects must satisfy the consistent view of the instance.

Before-images are sorted according to their age, from old to new.

Normally, only those before-images that are no longer accessed by a consistent view are deleted.

In exceptional cases, memory problems can cause before-images that could still be accessed to be deleted.

In these cases, liveCache can no longer retrieve the requested view of the instance.

The older the consistent view, the greater the likelihood of this phenomenon-

User Action:

Contact your local support organization.


-28817: Wrong object length (SAP Library - SAP DB)

 Entering content frame

Background documentation -28817: Wrong object length

Explanation:

An object does not fit in the memory.

This is an internal liveCache error that cannot be caused by incorrect handling of the OMS API.

User Action:

Contact your local support organization.


-28818: Wrong object position (SAP Library - SAP DB)

 Entering content frame

Background documentation -28818: Wrong object position

Explanation:

An OID contains an invalid position.

User Action:

Contact your local support organization.


-28819: Object has been updated by other transactions (SAP Library - SAP DB)

 Entering content frame

Background documentation -28819: Object has been updated by other transactions

Explanation:

An instance with the type OmsOutOfDate was captured as a DbpError.

User Action:

Contact your local support organization.


-28902: Too many nested try/catch statements (SAP Library - SAP DB)

 Entering content frame

Background documentation -28902: Too many nested try/catch statements

Explanation:

A maximum of 16 nested TRY/CATCH blocks is permitted in a database procedure.

User Action:

Do not exceed the upper limit of 16 nested TRY/CATCH blocks when you code the database procedure.


-28903: DBFunction$1 must return a value (SAP Library - SAP DB)

 Entering content frame

Background documentation -28903: DBFunction$1 must return a value

Explanation:

A database function does not contain a RETURN statement, which means that it cannot return a result. This is not allowed.

User Action:

Add a RETURN statement to the database function.


-28822 to -28999: Internal Error (SAP Library - SAP DB)

 Entering content frame

Background documentation -28822 to -28999: Internal Error

Explanation:

Internal liveCache system errors.

User Action:

Contact your local support organization.


From 0 to 1999 (SAP Library - SAP DB)

 Entering content frame

From 0 to 1999

Database Kernel System Messages

0 | Success
100 | Row not found
200 | Duplicate key
250 | Duplicate secondary key
300 | Integrity violation
320 | View violation
350 | Referential integrity violated
360 | Foreign key integrity violated
400 | Lock collision
450 | Lock collision caused by pending locks
500 | Lock request timeout
600 | Work rolled back
650 | Work rolled back
700 | Session inactivity timeout (work rolled back)
710 | Session terminated by shutdown (work rolled back)
750 | Too many SQL statements (work rolled back)
1403 | Row not found


0: Success (SAP Library - SAP DB)

 Entering content frame

0: Success

Explanation:

The SQL statement was successfully executed.

The desired effect was produced.

User Action:

No user action is required.


100: Row not found (SAP Library - SAP DB)

 Entering content frame

100: Row not found

Explanation:

There is no (further) table row which meets the criterion.

User Action:

No user action is required.


200: Duplicate secondary key (SAP Library - SAP DB)

 Entering content frame

200: Duplicate key

Explanation:

There is already a table row with the key to be inserted.

User Action:

Check whether the existing table row contains the desired values. If this is not the case, check whether values in the existing table row can be replaced with the desired values. If a new table row must be inserted, change the value of the key to be inserted in the SQL statement in order to prevent key collisions.


250: Duplicate secondary key (SAP Library - SAP DB)

 Entering content frame

250: Duplicate secondary key

Explanation:

There is already a table row with the specified secondary key. UNIQUE was specified for the secondary key.

User Action:

To avoid a key value collision, correct the value of the key to be inserted in the SQL statement.

The error message specifies the column or multiple-column index already containing the specified values.


300: Integrity violation (SAP Library - SAP DB)

 Entering content frame

300: Integrity violation

Explanation:

Insertions or updates would violate integrity constraints specified in the definition of the base or view table.

User Action:

The error message specifies the column which would violate the integrity constraints.

Correct the input value for the corresponding column.


320: View violation (SAP Library - SAP DB)

 Entering content frame

320: View violation

Explanation:

An INSERT or <UPDATE statement> was issued for a view table. At least one of the rows specified in the SQL statement does not satisfy the SEARCH CONDITIONs of all underlying view tables defined 'WITH CHECK OPTION'.

User Action:

Display the definition of the view table using a <QUERY statement> issued on the system table DOMAIN.VIEWDEFS. Correct the INSERT or <UPDATE statement> according to this definition.


350: Referential integrity violated (SAP Library - SAP DB)

 Entering content frame

350: Referential integrity violated

Explanation:

The following causes are possible:

  1. An INSERT or <UPDATE statement> issued on a table that is the referencing table in a <REFERENTIAL CONSTRAINT DEFINITION> produces a row that is not a matching row of the <CONSTRAINT definition>.
  2. When deleting rows from a <REFERENCED TABLE> of a <REFERENTIAL CONSTRAINT DEFINITION> with ON DELETE RESTRICT in the <DELETE RULE>, a matching row exists.
  3. When executing a <REFERENTIAL CONSTRAINT DEFINITION>, the <REFERENCED TABLE> or referencing table contains rows which conflict with the <CONSTRAINT definition>.

User Action:

  1. Display the definition of the <REFERENTIAL CONSTRAINT DEFINITION> using a <QUERY statement> issued on the system table DOMAIN.COL_REFS_COL. Correct the INSERT or <UPDATE statement> according to this definition.
  2. Use an appropriate <QUERY statement> to find out which row of the referencing table prevents the desired <REFERENCED TABLE> rows from being deleted.
  3. Use an appropriate QUERY statement to find out which row of the REFERENCED TABLE or referencing table conflicts with the REFERENTIAL CONSTRAINT DEFINITION. Modify or delete the row concerned, or correct the <CONSTRAINT definition> to be created.


360: Foreign key integrity violation (SAP Library - SAP DB)

 Entering content frame

360: Foreign key integrity violated

Explanation:

In an INSERT or UPDATE statement issued on a join view table, the column values functionally depending on the <REFERENCING COLUMN>s of the referencing table conflict with the existing column values.

User Action:

This conflict may be solved by changing either the column values specified in the INSERT or UPDATE statement, or the existing values.


400: Lock collision (SAP Library - SAP DB)

 Entering content frame

400: Lock collision

Explanation:

When the option (NOWAIT) is specified in the LOCK statement or in the LOCK option, this message signals that the lock request conflicts with the locks of other users.

User Action:

  1. In interactive mode, another job can be activated which does not require the desired lock.
  2. As an alternative, you can wait for the lock to be released by specifying the same SQL statement without the '(NOWAIT)' option.


450: Lock collision caused by pending locks (SAP Library - SAP DB)

 Entering content frame

450: Lock collision caused by pending locks

Explanation:

The lock request made by the SQL statement conflicts with locks which cannot be resolved at present because they belong to a pending transaction. The pending transaction cannot be concluded because there is no connection to the releasing serverdb.

User Action:

The SQL statement should not be reissued until the pending transaction has been resolved; i.e. until it has been possible to reconnect to the particular serverdb.


500: Lock request timeout (SAP Library - SAP DB)

 Entering content frame

500: Lock request timeout

Explanation:

  1. The lock request or an implicit lock conflicts with the locks of another user. The maximum waiting time for granting the lock has elapsed (installation parameter REQUEST_TIMEOUT).
  2. SHUTDOWN could not be performed in a certain period of time (installation parameter LOCK_TIMEOUT) because transactions with SQL statements for data modification are still open. The serverdb has not been shut down.

User Action:

  1. In some cases, the error message contains a more detailed description of the error. The lock request can be reissued. To avoid possible deadlock situations, it is advisable to roll back the transaction using the <ROLLBACK statement>.
  2. Do without the SHUTDOWN or force a shutdown of the serverdb using the QUICK option.


600: Work rolled back (SAP Library - SAP DB)

 Entering content frame

600: Work rolled back

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>

  1. because you failed to carry out any operations within a certain period of time (installation parameter LOCK_TIMEOUT) but held locks which other users were waiting for, or because
  2. the serverdb was in a deadlock situation. A deadlock situation is a situation in which two or more users hold locks and request further locks that are held by the other users. In the simplest case of two users, one user holds one lock at least and requests another lock. But this lock is held by another user who is himself waiting for the lock held by the first user. This situation can only be resolved if one of the users releases the lock already obtained.

User Action:

In some cases, the error message contains a more detailed description of the error.

In both cases, the lock requests must be checked and modified, if necessary. The last transaction must be repeated.

It may also be necessary to check and modify the value of the installation parameter LOCK_TIMEOUT.


650: Work rolled back (SAP Library - SAP DB)

 Entering content frame

650: Work rolled back

Explanation:

The user transaction was canceled implicitly and reset with an implicit <ROLLBACK statement> because the log devspace is full.

User Action:

The error text contains a precise description of the error.

Save the log. Details can be found in the database administration guide.


700: Session inactivity timeout (work rolled back) (SAP Library - SAP DB)

 Entering content frame

700: Session inactivity timeout (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was implicitly terminated, since you failed to carry out any operations within a certain period of time (installation parameter SESSION_TIMEOUT or TIMEOUT value specified with the <CONNECT statement>).

User Action:

Repeat the <CONNECT statement> and specify a larger TIMEOUT value, if necessary.

It may also be necessary to check and modify the value of the SESSION TIMEOUT installation parameter .


710:Session terminated by shutdown (work rolled back) (SAP Library - SAP DB)

 Entering content frame

710: Session terminated by shutdown (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was terminated because the database administration tool shut the database down. To speed up a later restart, the database system tries to reset and not just terminate open transactions within a short period.

User Action:

Once the database is ready, repeat the CONNECT statement and the transaction.


750: Too many SQL statements (work rolled back) (SAP Library - SAP DB)

 Entering content frame

750: Too many SQL statements (work rolled back)

Explanation:

Your transaction was implicitly cancelled and rolled back by an implicit <ROLLBACK statement>. The database session was implicitly terminated, since you had issued too many SQL statements or had performed too many transactions within a session.

User Action:

The transaction can be repeated after a new <CONNECT statement>.


1403: Row not found (SAP Library - SAP DB)

 Entering content frame

Background documentation 1403: Row not found

Explanation:

There is no (other) table row that meets the specified criteria.

User Action:

No user action is required.


From 25000 to 25999 (SAP Library - SAP DB)

 Entering content frame

Background documentation From 25000 to 25999

Replication Manager System Messages

25601 | Warning when downloading data; character string for the value NULL in the column will be truncated
25602 | Warning when downloading data; integer values of column may become to large for output
25603 | Warning when downloading data; literal will be truncated
25604 | Warning when downloading data; supernumerary specifications for the LONG data file will be ignored
25605 | Warning when downloading data; neither the header nor the record length was found in the data file or command. The <N> value that was calculated will be used as a record length
25606 | Warning when uploading data; different byte swap of source and target computer. Check LONG values
25607 | The USAGE value is too low and will be ignored
25608 | No restart file found. Upload will restart


25601: Character string for the NULL value in column <column nam (SAP Library - SAP DB)

 Entering content frame

Background documentation 25601: Warning when downloading data; character string for the value NULL in the column will be truncated

Explanation:

Warning when downloading data using the DATAEXTRACT command.

The character string for the value NULL is longer than the output length that has been defined for a column. The character string has only been partially output.

This warning does not cause the command to terminate.

User Action:

No user action is required.


25602: Integer values of column <column name> may become to larg (SAP Library - SAP DB)

 Entering content frame

Background documentation 25602: Warning when downloading data; integer values of column may become too large for output

Explanation:

Warning when downloading data using the DATAEXTRACT command.

The length specified for output is too small and not all INTEGER values that are possible based on the column definition in the database can be output.

This warning does not cause the command to terminate.

User Action:

No user action is required.


25603: Literal <literal> will be truncated (SAP Library - SAP DB)

 Entering content frame

Background documentation 25603: Warning when downloading data; literal will be truncated

Explanation:

Warning when downloading data using the DATAEXTRACT command.

The length of the literal exceeds the output length that has been defined. The literal will only be partially output.

This warning does not cause the command to terminate.

User Action:

No user action is required.


25604: Supernumerary specifications for the LONG data file will (SAP Library - SAP DB)

 Entering content frame

Background documentation 25604: Warning when downloading data; supernumerary specifications for the LONG data file will be ignored

Explanation:

This warning appears if you are downloading data using the DATAEXTRACT command and you want to download LONG columns.

In your command, you have specified LONG data files that cannot be assigned to a column in the command's column. Any supernumerary LONG data files will be ignored during the data download.

This warning does not cause the command to terminate.

User Action:

No user action is required.


25605: Warning when downloading data; neither the header nor the (SAP Library - SAP DB)

 Entering content frame

Background documentation 25605: Warning when downloading data; neither the header nor the record length was found in the data file or command. The <N> value that was calculated will be used as a record length

Explanation:

Warning when uploading or updating data from binary data files using the commands FASTLOAD, DATALOAD, or DATAUPDATE.

If the data that is to be uploaded was downloaded using the SAP DB Loader, the binary data file contains a header that is the same length as an individual data record in the file. The system was unable to find this header. The length of an individual data record was not specified in the command either.

For this reason, the SAP DB Loader calculates the record length based on the column lengths defined in the command.

This warning does not cause the command to terminate.

User Action:

No user action is required.


25606: Different byte swap of source and target computer. Check (SAP Library - SAP DB)

 Entering content frame

Background documentation 25606: Warning when uploading data; different byte swap of source and target computer. Check LONG values

Explanation:

Warning when uploading data using the TABLELOAD command.

The table to be uploaded contains LONG values. The byte swap of the source and target computer is different. For this reason, LONG values may be incorrect or corrupt once they have been uploaded.

This warning does not cause the command to terminate.

User Action:

Check the LONG values in the database after they have been uploaded:

  • If they have been uploaded without any errors, you do not need to take any action.
  • If the LONG values contain any errors, they must be re-loaded.


25607: The USAGE value is too low and will be ignored (SAP Library - SAP DB)

 Entering content frame

Background documentation 25607: The USAGE value is too low and will be ignored

Explanation:

Warning when uploading data using the FASTLOAD command.

The table that is supposed to be uploaded has been defined in the database in such a way that a single data record is greater than the value specified for USAGE. For this reason, the SAP DB Loader ignores the USAGE value.

This warning does not cause the command to terminate.

User Action:

No user action required.


25608: No restart file found. Upload will restart (SAP Library - SAP DB)

 Entering content frame

Background documentation 25608: No restart file found. Upload will restart

Explanation:

Warning when uploading data using the TABLELOAD ALL or the TABLELOAD USER command.

The RESTART option was specified in the command. The SAP DB Loader is unable to find the restart file specified in the command. It starts the load process from the beginning.

This warning does not cause the command to terminate.

User Action:

No user action required.


Background Knowledge: SAP DB 7.4 (SAP Library - SAP DB)

 Entering content frame

Component documentation Background Knowledge: SAP DB 7.4

This manual gives you background knowledge about the database system SAP DB, and covers the following topics:

· Log concept of SAP DB

· Data Management Using B* Trees

· Creating a Homogeneous System Copy

· Standby databases

For a general introduction to the SAP DB database system, see the documentation The SAP DB Database System (www.sapdb.org ® Documentation).


Log Concept (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Concept

One of the main internal functions of the SAP DB database system is logging.

In normal database operation (operational state ONLINE), the modifying SQL statements of every transaction must be logged, meaning that log entries (redo and undo log entries) are written. These log entries are required so that the database system can ensure transaction consistency and so that individual SQL statements can be reversed if required. In addition, the undo log entries are needed to enable consistent reading when no locks are set.

The task of online logging is to store the log entries so that they are constantly available for normal database operation.

In the case of a restart or restore, the required log entries must be made available and processed in the correct time-based sequence.


Log Entry (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Entry

The log concept includes the writing of log entries. The SAP DB database system differentiates between the following log entries:

· Redo log entry

· Undo log entry


Redo Log Entry (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo Log Entry

Redoing (rolling forward) a transaction means that the modifications of a successful transaction are repeated, that is to say, the database is set to the consistent state that it had after the transaction had ended. The redo measure means that additional, redundant data management is required.

For each transaction, the values of the changed objects are therefore recorded. These logged values are described as redo log entries (or after-image entries).

Redo log entries do not need to be saved permanently in the log area until the COMMIT is executed for the transaction (Redo Log Management).

The redo log entries are also required for the redo when the database system is restarted or recovered.

See also: Undo log entry


Undo Log Entry (SAP Library - SAP DB)

 Entering content frame

Background documentation Undo Log Entry

Undoing (rolling back) a transaction means that the transaction is reset, that is to say, the database is set to the consistent state that it had before the transaction was started. The undo measure means that additional, redundant data management is required.

Therefore, for each transaction, the original values of the data objects that are to be changed by the transaction, that is, the values that were available before the transaction was started, are stored. These logged values are described as undo log entries (or before-image entries).

Undo log entries are permanently stored in the stored in the data area before an SQL statement is executed (Undo Log Management). Each transaction can access its undo log entries without any locks being set.

In addition, the undo log entries are needed for the undo if the database is restarted or recovered and are used for History Management.

See also: Redo Log Entry


Online Logging (SAP Library - SAP DB)

 Entering content frame

Background documentation Online Logging

The log concept for the SAP DB database system includes online logging, which is required for normal database operation.

· The redo log entries of the transactions are managed: Redo Log Management

· The undo log entries of the transactions are managed: Undo Log Management

· For the database instance type liveCache, History Management is carried out for the undo log entries.


Redo Log Management (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo Log Management

During online logging, the redo log entries are written and managed.

· Active components: Transactions in user tasks, log writer

· Storage units: log queue, log area

Use

Redo log management plays a part in the following actions:

· During execution of a modifying transaction, the redo log entries are included in the log queue. The log writer writes the log pages from the log queue to the log area.

· During a log backup, information is obtained on whether entries from the log area are to be backed up, and if so, how many.

· For display on the monitor, information is obtained on waiting periods, and the type of access to the entries in the log queue.

· In the case of a restart or recovery, the required redo log entries are read from the log area.

· The database parameters and other internal information that controls logging are stored in the log area and updated at regular intervals.

In very special situations, you can deactivate redo log management temporarily.

See also: Log Settings


Log Queue (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Queue

The area of the main memory required for redo log management is called the log queue. The size of a log queue (in log pages) is determined by the special database parameter LOG_IO_QUEUE.

A transaction uses a log queue to obtain a main memory area for a redo log entry. The transaction writes the redo log entry to the log pages of the log queues.

Writing of the log pages to the log area is carried out by the log writer.

Process Flow

1. The user task of the transaction reserves main memory space for a redo log entry in the log queue.

2. The transaction writes the redo log entry to the reserved area of the log queue.

The time at which the redo log entry is written to the log queue is assigned to the relevant log page (log queue sequence number).

3. The transaction releases the reserved area of the log queue for processing by the log writer, and provides information on whether it wants to wait for the log page from the log queue to be written to the log area. This behavior is always required for COMMIT and ROLLBACK operations.

If a transaction does wait for the redo log entry to be written, the log writer notifies the transaction once the relevant page has been written from the log queue to the log area, and informs the transaction of the log sequence number that was assigned when the log page was written to the log area.


Log Page (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Page

The main storage units required for redo log management are the log pages. The size of the log pages is 8 KB.

· A transaction writes redo log entries to the log pages of the log queues.

Each log page is assigned a log queue sequence number, which specifies the time at which the redo log entries are written to the log queue.

· If a log page is to be written to the log area, the log writer is notified. The log writer fetches the log pages in question from the log queue, and writes them to the log area.

When each log page is written from the log queue to the log area, the log writer assigns it a log sequence number and a time stamp. These log sequence numbers can then be used to determine the unique sequence of the log pages in the log area. The time stamp is needed for a point-in-time recovery.

A log page that was written by the log writer, but was not full, remains in the log queue and can be filled with further redo log entries.


Log Writer (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Writer

One active task of the redo log management is the log writer.

The log writer is a task in the user kernel thread. When the database system is started, it is initialized using permanently stored, internal configuration information. This configuration information is written to the log area at regular intervals at a savepoint.

· A log queue is assigned to the log writer.

· The log writer writes the log pages that are full, or have to be written as a result of a COMMIT or ROLLBACK, from the log queue to the log area. The log pages are numbered (log sequence number), so that it is possible to check that all log pages were written, and to ensure the correct working sequence in the case of a restart or a recovery. The log writer then notifies the transactions that were waiting for their redo log entries to be written.

· Log pages of the log queue that were not full when a write operation was performed remain in the log queue and continue to be filled, and are written to the log area in a subsequent write operation. The log writer is configured so that it always writes one and the same log page to the same physical place.

· The log writer regularly checks the state of the log area.
If the log area is full, the log writer locks the log queue so that all transactions that want to enter redo log entries into the log queue are stopped.
When the automatic log backup is active, the log writer ensures that the redo log entries from the log area are backed up automatically.
When a certain number of log entries have been written, the administrative information is copied to the log area, and savepoints are requested, if required. In the case of a restart, this reduces the restart time.


Activating or Deactivating Redo Log Management (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating or Deactivating Redo Log Management

One possible log setting that you can make is activating or deactivating redo log management.

Deactivate redo log management only rarely and in special cases, and then only for a fixed period of time.

Activating Redo Log Management

Redo log management is activated by default.

If you deactivate redo log management, and then reactivate it, you must then make a complete data backup.

Deactivating Redo Log Management

When you deactivate redo log management, the Log Writer no longer writes any redo log entries to the log area. Disabling redo log management means that the log backup history is interrupted, so if a recovery is necessary, no log entries are available for this period. You should minimize this security risk, that is to say, you should keep the period in which there is no active redo log management as short as possible.

This setting is particularly useful, for example, when you are initializing a database instance, and the conditions are exceptionally critical for performance.

Procedure

You can activate or deactivate the redo log management in the ADMIN operational state of the database instance. Use the Database Manager GUI, for example, as described in Changing Log Settings (Configuration Wizard).


Undo Log Management (SAP Library - SAP DB)

 Entering content frame

Background documentation Undo Log Management

During online logging, the undo log entries are managed. The modifying transactions store the undo log entries in undo log files.

Use

Undo log management plays a part in the following actions:

· The database can create a transaction-consistent database state that reflects the state of the database system at the time of the last savepoint. The information in the undo log files is sufficient for this.

· In a restart or recovery, the required undo log entries are determined.

· For the database instance type liveCache, History Management is carried out for the undo log entries.


Undo Log File (SAP Library - SAP DB)

 Entering content frame

Background documentation Undo Log File

During undo log management, each modifying transaction creates its own undo log file, in which the undo log entries are written. Every undo log entry is assigned an undo log sequence number starting with 0.

Undo log files are internal database storage structures, which are stored in the data area.

Storage of the undo log files in the data area means that the information in the data area can be used to create a transaction-consistent database state that reflects the state of the database system at the time of the last savepoint.

Deleting Undo Log Files

· SAP DB OLTP: At the end of a transaction, the transaction itself deletes the undo log files.

· SAP liveCache: At the end of the transaction, the undo log files are transferred to history management, because they are needed for unlocked, consistent reading. The undo log files are deleted at a later point in time by the garbage collector.

In exceptional circumstances, storage of the undo log files in the data area can lead to a full data area. In this case, increase the size of the data area.


History Management (SAP Library - SAP DB)

 Entering content frame

Background documentation History Management

History management, as a task during online logging, is currently only used for the database instance type liveCache.

During history management, all information that is needed by the garbage collectors is made available, so that the deleted objects can be completely removed, that is to say, so that the undo log files can be deleted. In particular, information from the history files is written to and managed in the history list.


History File (SAP Library - SAP DB)

 Entering content frame

Background documentation History File

History files are used during history management. A history file is an internal database file, which contains the access and statistical information about the undo log files of transactions that have ended.

When a database instance is created, the initial history files are stored in the data area. The number of history files is defined by the database parameter MAXUSERTASKS. Once a transaction has ended, it writes an entry to its history file. This entry identifies the undo log file that is assigned to the transaction. With each savepoint, the history file is saved to the data area.

The history list is used to assign the history files to the garbage collectors.


History List (SAP Library - SAP DB)

 Entering content frame

Background documentation History List

The main storage area required for history management is the history list.

The history list is an internal database list of all history files. The history list is used to assign a suitable history file to the garbage collectors for processing.

The history list is written to the data area on each savepoint. In the case of a restart, the history list is rebuilt on the basis of the data stored in the data area.


Garbage Collector (SAP Library - SAP DB)

 Entering content frame

Background documentation Garbage Collector

The garbage collectors are active components during history management.

The garbage collectors belong to the user kernel threads. When the database system is started, they are initialized using permanently stored, internal configuration information.

During history management, the history list is used to determine the history file that is to be processed by the garbage collector. In the undo log files that were determined using the history files, the system searches for delete operations for objects. If it finds a delete operation, the garbage collector deletes the object.


Restart or Recovery (SAP Library - SAP DB)

 Entering content frame

Background documentation Restart or Recovery

The log concept for the SAP DB database system includes the import of the required log entries, if the database instance is restarted or recovered.

The redo log manager ensures that the required log entries are made available and processed in the correct, time-based sequence.

· For each transaction, the available redo log entries are stored by the log reader in a redo log file.

· Transactions for which a redo is actually required are stored by the log reader in a redo list.

· The redo tasks evaluate the redo list, and import the required redo and undo log entries for each transaction they find.

See also Example: Restart


Redo Log Manager (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo Log Manager

The redo log manager is the component that manages all the resources required for actions during a restart or recovery.

Actions

· The redo log manager starts the log reader and several redo tasks.

· The redo log manager can cancel any of the tasks it starts.

· At the end of an action, the redo log manager collects all error messages, and may then terminate the restart or recovery, if required.

· The redo log manager generates the redo list.


Log Reader (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Reader

The log reader is an active component during a restart or recovery. The log reader is a server task.

Actions

From the data that was stored at the time of the last savepoint, the log reader determines the transaction file, and uses this transaction file to re-generate the transaction list.

The log reader determines the required information from redo log management or from the backup manager, so that all the redo log entries written since the last savepoint can be made available.

· If transactions in the transaction list are marked as ended at the time of the savepoint, the log reader enters these transactions in the redo list immediately.

· The log reader creates a redo log file for each further transaction found in the redo log entries.

· If a COMMIT is found for the whole transaction, the log reader enters the transaction in the redo list.

· If a ROLLBACK is found for the whole transaction, the log reader enters the transaction in the redo list.

· ROLLBACK in subtransactions: If a ROLLBACK is found within a transaction, the log reader removes the corresponding redo log entries from the redo log file. This means that these log entries are not processed unnecessarily.

· If uncompleted transactions are found after all redo log entries are read, the log reader flags these transactions with a ROLLBACK and enters them in the redo list. These transactions are then treated as ROLLBACK transactions.

Further processing of the transactions is performed by the redo tasks.

See also Example: Restart


Redo Log File (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo Log File

When a restart or recovery is carried out, a redo log file is created for each transaction found in the redo log entries. Redo log files are internal database storage structures, which are stored in the data area.

The log reader copies exactly those redo log entries that belong to a transaction to each redo log file.


Redo List (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo List

The redo list is an internal database list of transactions, which is in the main memory. The redo list is created by the redo log manager.

If, during a restart or recovery, the log reader finds a COMMIT in a redo log file for the whole transaction, this transaction is entered in the redo list.

The redo tasks use the redo list to determine the transactions that need to be repeated, and the sequence in which they are to be executed. The sequence for executing the transactions, defined in the redo list, is important to ensure that the same data is not changed simultaneously.


Redo Task (SAP Library - SAP DB)

 Entering content frame

Background documentation Redo Task

Redo tasks are active components during a restart or recovery. Redo tasks are server tasks.

Actions

COMMIT transactions

...

1. In the redo list, the redo tasks look for transactions that were completed with a COMMIT, and are therefore ready to be re-imported. In the redo list, the transactions are sorted by the log sequence numbers of their COMMIT.

2. The redo task starts by processing the transaction with the lowest COMMIT log sequence number.

The redo log files that belong to this transaction are processed in sequence. If a redo log entry of this redo log file has a higher log sequence number than the lowest COMMIT log sequence number, it cannot be processed. In this case, the redo task waits for the COMMIT of the other transaction. Only then can the redo task continue processing the redo log file. This mechanism ensures consistent data.

3. Once a COMMIT transaction has been processed in full, the redo task deletes the redo log file and the undo log file of the transaction. The transaction is removed from the redo list.

ROLLBACK transactions

...

1. In the redo list, the redo tasks look for transactions that were completed with a ROLLBACK.

2. The redo tasks delete the relevant redo log files. This prevents the transaction being redone unnecessarily.

3. If the ROLLBACK transaction started before the savepoint, the redo task evaluates the undo log file of the transaction, in order to set the transaction to the state before the savepoint. Once the ROLLBACK transaction has been fully processed, the redo task deletes the undo log file of the transaction.

If the ROLLBACK transaction started after the savepoint, the redo task does not process the transaction further.

See also Example: Restart


Savepoint on Restart (SAP Library - SAP DB)

 Entering content frame

Background documentation Savepoint on Restart

Savepoints are also written during a restart (redo of a redo).

In this case, the positions of the log reader and the state of all open redo transactions are saved to the data area, and reused for the next restart.

In this way, a terminated restart can be started again.


Example: Restart (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example: Restart

The database crashed.

For the subsequent restart, the database instance is recovered starting from the time of the last savepoint.

This graphic is explained in the accompanying text

No recovery measures are required for transactions T1 and T5. The changes for transaction T1 were recorded in full by the last savepoint. The changes for T5 were rolled back before the crash, and are not yet stored in the data area.

For transactions T4 and T6, the log reader creates the redo log files and relevant entries in the redo list. The redo tasks import the required redo log entries for these transactions.

No recovery measures are required for transactions T2 and T3. However, the modifications made before the savepoint must be reversed. The redo tasks therefore evaluate the relevant undo log files.


Transaction File (SAP Library - SAP DB)

 Entering content frame

Background documentation Transaction File

The transaction file is an internal database file to which the data of all open transactions is written at the time of a savepoint. The transaction file is stored in the data area.

During a restart, the log reader uses this transaction file to regenerate the transaction list.


Transaction List (SAP Library - SAP DB)

 Entering content frame

Background documentation Transaction List

The transaction list is an internal database list of all open modifying transactions. The transaction list is located in the main memory.

All modifying transactions are globally available in the database via this transaction list. The transaction list contains a transaction entry for each transaction. This transaction entry contains, among other things, references to any redo log entries and undo log entries that may exist.

During a restart, the log reader uses the transaction file to regenerate the transaction list.


Data Management Using B* Trees (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Management Using B* Trees

The SAP DB data management architecture ensures efficient data storage on disks and fast data access. The SAP DB database system performs automatic load balancing, which makes reorganizations unnecessary. The data areas can be extended online.

Structures and algorithms are available that are required for realizing an efficient I/O strategy, and that make reorganizations unnecessary. The data management algorithms have the following characteristics:

· Sort data on SELECT (Table Access (SELECT) using B* Trees)

· Sort data on INSERT (Table Access (INSERT) using B* Trees)

· UPDATE data in place (Table Access (UPDATE) using B* Trees)

· DELETE data in place (Table Access (DELETE) using B* Trees)

For this data management, the database system uses the following logical storage structures:

· Primary tables (with primary keys and secondary keys)

· Secondary key tables (data of the secondary keys)

· B* tree

B* trees are created for the following tables (see B* Trees for Tables): Primary tables and secondary key tables.

For tables with LONG columns (data type LONG, also known as BLOBs = Binary Large Objects), a special data processing procedure takes place by using the B* trees.


Concepts (SAP Library - SAP DB)

 Entering content frame

Background documentation Concepts

· Primary Key

· Secondary Key

· B* tree

· Table ID


Primary Key (SAP Library - SAP DB)

 Entering content frame

Background documentation Primary Key

Each SAP DB table has a primary key. The primary key is either defined by the database user or generated internally. A user-defined primary key can consist of multiple columns.


Secondary Key (SAP Library - SAP DB)

 Entering content frame

Background documentation Secondary Key

Secondary keys can be defined for each table to optimize the data access via SQL statements. They can refer to any column combination and they help to prevent sequential scans over the table. Like the primary key, the secondary key can consist of multiple columns.

A secondary key is often called an index (not to be confused with B* index).


B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation B* Tree

As far as is possible, all SAP DB data is stored in structures called B* trees. B* trees give much more efficient access to table rows than other access methods (such as sequential searches).

A B* tree spans several levels from the root level at the top, to the index levels, through to the lowest leaf level (one root level, n index levels (n>=1), one leaf level).

The storage units are the pages.

In SAP DB Version 7.4, all subsequent comparisons in a B* tree use ASCII code (each character is assigned a numerical value between 0 and 255). The comparisons are performed for all values on a character-by-character basis.

The sort criterion for building a B* tree is the primary key.

This graphic is explained in the accompanying text

See also:

· Root/Index Page

· Leaf Page

· Table Access

· B* Trees for Tables


Root/Index Page (SAP Library - SAP DB)

 Entering content frame

Background documentation Root/Index Page

Entries in root pages and index pages in a B* tree contain two sections.

· First section: This section contains an initial segment of the key fields of a table row. This section is called the separator. SAP DB uses only that part of the primary key that is needed to differentiate the following entries. This minimizes the memory needed by these pages.

The first separator in the leftmost page of each level (including the root level) contains only the pointer to the leftmost page of the next level down.

The average length of the separators depends on the structure and the selectivity of the primary key. If a very large number of key fields have to be evaluated to enable the entries (records) to be distinguished from each other, but the characteristics in the front key fields are often the same, then this results in longer separators.

· Second section: This section contains the logical address of a page at a lower index level or at the leaf level. The number of entries in this section depends on the length of the separators.


Leaf Page (SAP Library - SAP DB)

 Entering content frame

Background documentation Leaf Page

Leaf pages in a B* tree contain the content of table rows, that is the application data. The number of entries in a leaf page depends on the total length of the table rows.

The leaf pages in the B* tree are sorted from left to right in ascending order. In other words, each leaf page contains only the table rows that fit its sort area.

The table rows are located in the first section (data section) of the leaf page. The rows in the data section are not sorted by default. The last section of the leaf page contains a position list with addresses that point to the corresponding table rows within the leaf list. The position list is always sorted in ascending order.

The storage space required to store the entire table depends on the length of the separators and on the total length of table rows.


Table Access (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access

The logical term tabledenotes primary data, including data in columns of type LONG and data in secondary key structures.

· As specified by its schema definition, a table has exactly one B* tree for the primary data, and exactly one B* tree for each secondary key.

· If the table definition contains columns of data type LONG, an additional B* tree is created to accommodate all data of this type that does not exceed a specified length (data of type short LONG). Data items of type LONG that exceed this specific length are each stored in separate B* trees (data of type long LONG).

All searches and changes in the table are executed in the computer’s main memory via SQL statements (SELECT, INSERT, UPDATE, DELETE,...), which means that they are carried out very quickly. The B* tree structure changes itself for all INSERT, UPDATE and DELETE statements whenever there is not enough space in the target page for the new information, or whenever the fill level of a page falls below the predefined fill level.

See also: B* Trees for Tables and Table Access by Using a B* Tree


Table ID (SAP Library - SAP DB)

 Entering content frame

Background documentation Table ID

The database user specifies a table by entering its name. The table is accessed internally using a table ID of a fixed length.

The relationship between the table name and this table ID is stored in the database catalog.

In addition, SAP DB has a special management structure (file directory), in which the root pages of B* trees are assigned to table IDs.

The Table IDs are stored in the file directory together with a type flag and other information. The type flag specifies whether the table contains primary data, secondary key , or LONG data. The type flag specification enables one table ID to be used for all the B* trees required for the logical structures of the same table.


B* Trees for Tables (SAP Library - SAP DB)

 Entering content frame

Background documentation B* Trees for Tables

B* trees are set up for the following kinds of table:

· Tables with primary data

· Tables with secondary keys

· Tables with LONG columns

See also: Table Access

You can find some examples for creating B* trees here:

· B* Trees for Tables with LONG Columns

· B* Trees for Tables with Secondary Keys

· B* Trees for Tables with LONG Columns and Secondary Keys


B* Trees for Table with LONG Columns (SAP Library - SAP DB)

 Entering content frame

Background documentation B* Trees for Table with LONG Columns

An example of B* trees for tables is a B* tree structure in which the table has primary data and data of data type LONG.

This graphic is explained in the accompanying text

The primary table contains a LONG column. The numerical column defines the length of the LONG field for each line. There is one B* tree for the primary data, another for data of type short LONG and multiple B* trees for other data of type long LONG.

The primary table contains a fixed-length reference to the contents of the LONG field in each row. This reference points uniquely to the storage location of the content of the LONG field, either as a key to a B* tree (short LONG) or as the table ID of one of the multiple B* trees (long LONG).


B* Trees for Tables with Secondary Key (SAP Library - SAP DB)

 Entering content frame

Background documentation B* Trees for Tables with Secondary Key

An example of B* trees for tables is a B* tree structure in which the table has primary data and a secondary key.

This graphic is explained in the accompanying text

The table has a two-column multiple secondary key. There is one B* tree for the primary data and a second B* tree for the data of the secondary key table.


B* Trees for Tables with LONG Columns and Secondary Key (SAP Library - SAP DB)

 Entering content frame

Background documentation B* Trees for Tables with LONG Columns and Secondary Key

An example of B* trees for tables is a B* tree structure in which the table has primary data, a secondary key, and data of data type LONG.

This graphic is explained in the accompanying text


Table Access Using B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access Using B* Tree

For all SELECT and DML (data manipulation language) statements, the database system uses the same search algorithm to determine the leaf page in which a table entry can be found or has to be changed.

Here you find some examples for accessing tables by using B* trees:

· Table Access (SELECT) Using B* Tree

· Table Access (INSERT) Using B* Tree

· Table Access (DELETE) Using B* Tree

· Table Access (UPDATE) Using B* Tree


Table Access (SELECT) Using B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access (SELECT) Using B* Tree

Table Access Using B* Tree is illustrated using the example of a SELECT statement.

This graphic is explained in the accompanying text

The address table is defined via the city primary key column. In the table, the system searches for an entry with value Athens for the city primary key field.

1. The search starts at the root level of the B* tree. The database system compares the value of Athenswith the value of the first entry in the root page, which is Ba.

As the value of Athens is smaller than the value of Ba, the corresponding address information is evaluated. This points to an index page.

2. The search continues at the index level. The value Athens is greater than the value of the first entry in the data page, An. The next value in the page is evaluated. As the value of Athens is smaller than the value of Au, the corresponding address information is evaluated. This points to a leaf page.

This graphic is explained in the accompanying text

3. The search continues at the leaf level. In the position list of the leaf page a binary search algorithm is used. The corresponding address information for the table entry with the key value Athens is evaluated.

4. The database system scans the data section in the leaf page until it has found the corresponding table entries. The search is then complete.


Table Access (INSERT) Using B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access (INSERT) Using B* Tree

Table Access Using B* Tree is illustrated using the example of a INSERT statement.

This graphic is explained in the accompanying text

The address table is defined via the city primary key column. In the address table, insert an entry with the value Arbon for the city primary key field.

If there is enough space in the leaf page of the B* tree for the new entry, SAP DB inserts the entry at the end of the data section and updates the position list. The address of the new entry is written to the correct position in the position list. In the example above, this is position 4. Position 4 points to the new table entry number 7.

The position list and data section converge when data is inserted in a data page.


Table Access (DELETE) Using B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access (DELETE) Using B* Tree

Table Access Using B* Tree is illustrated using the example of a DELETE statement.

This graphic is explained in the accompanying text

The address table is defined via the city primary key column. In the table, delete an entry with the value Apach for the cityprimary key field.

If an entry is deleted from the table, gaps appear in the data section and in the position list of the leaf page in the B* tree. The database system closes these gaps and updates the position list to save storage space.


Table Access (UPDATE) Using B* Tree (SAP Library - SAP DB)

 Entering content frame

Background documentation Table Access (UPDATE) Using B* Tree

Table Access Using B* Tree is illustrated using the example of an UPDATE statement.

· If an UPDATE is performed and the primary key remains unchanged, only the contents of the table row are changed.

· If the data length changes, the positions of subsequent entries and their addresses in the position list of the leaf page in the B* tree are changed.

· If the key field changes, the UPDATE is executed as a DELETE (Table Access (DELETE) Using B* Tree) with a subsequent INSERT (Table Access (INSERT) Using B* Tree).


Changes in the B* Tree Structure (SAP Library - SAP DB)

 Entering content frame

Background documentation Changes in the B* Tree Structure

The B* tree structure changes in all cases of INSERT, UPDATE, and DELETE when there is either not enough space in the target page or the fill level falls below the predefined fill level.

This graphic is explained in the accompanying text

The address table is defined via the city primary key column. In the table, insert an entry with the value Albas for the city primary key field. The new table row is too large for the corresponding leaf page in the B* tree.

· A new leaf page is created. The new row of the table is incorporated in this leaf page. In other words, the beginning of the sort area of the new leaf page is specified by this row of the table. The sort sequence of the individual leaf pages must be restored. To do so, it may be necessary to copy the table rows that belong in the new sort area from the leaf page with the next smallest sort area to the new leaf page, and then delete them from the previous leaf page. This procedure is called page split.

· Pointers to consecutive pages are updated whenever required.

· Address and separator information on the new page is also inserted in the corresponding root or index page one level higher. If the index page is too small to accommodate this information, a new index page is inserted at this index level as well. If the root page at the uppermost level is too small to accommodate a new entry, a new index level is created.

A chain of page splits can result in the B* tree being rebalanced.

See also: Non-Uniform Distribution of Data Pages


Non-Uniform Distributions of Data Pages (SAP Library - SAP DB)

 Entering content frame

Background documentation Non-Uniform Distributions of Data Pages

Changes in the B* tree structure can lead to a non-uniform distribution of the data pages. If certain branches of the B* tree have more pages than others, data page distribution is not uniform. This can affect performance, because more accesses are generally required to find data.

Non-uniform distributions are detected by SAP DB when INSERT, UPDATE, or DELETE statements are performed, and the tree is rebalanced when the current operation is carried out. This means that the tree is constantly maintained for optimum operation. During this procedure, page entries are moved to new locations and page pointers are redirected. As a result, data pages are used more efficiently.

Uniform distribution of data prevents individual data regions from overflowing. The only restriction on the size of tables is the storage space available in the database system.


Creating a Homogeneous System Copy (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Homogeneous System Copy

Use

You want to create a copy of your database instance, for example, for test or development purposes, or to set up a standby database.

Prerequisites

· The database instance that you want to copy has the database instance type OLTP, document server, OLAP, or E Catalog, and the processor architectures of the source and target hosts are compatible.

· The database instance that you want to copy has the database instance type liveCache. Both the processor architectures and the operating systems of the source and target hosts are identical, and you are using the same DB procedures on both hosts.

Procedure

Use the Database Manager for the following steps:

...

1. Make a complete data backup of the original instance.

2. Initialize an existing target instance, or install a new target instance for recovery.
The target instance must have the same database instance type as the original instance, and the same software version 7.x.

The target instance must not switch to the operational state ONLINE before you import the data backup from the original instance (step 5). If the target instance has already been ONLINE, reinitialize it.

3. Configure the data volumes of the target instance so that they have enough space for the import of the complete data backup of the original instance (10% larger than the complete data backup of the original instance, for example).

4. In the target instance, create a backup medium for importing data backups. The medium you use must be compatible with the medium that you used to create the complete data backup of the original instance.

5. Import the complete data backup of the original instance into the target instance.

If using the Database Manager GUI, proceed as described under Restoring Without a Backup History.

6. Start the target instance.

7. Update the system tables in the target instance.

8. In the target instance, restore any indexes that are no longer up-to-date ( BAD INDEXES).

Example

Homogeneous System Copy with the Database Manager CLI


Operating System Compatibility for Homogeneous System Copies (SAP Library - SAP DB)

 Entering content frame

Background documentation Operating System Compatibility for Homogeneous System Copies

If you want to create a homogeneous system copy of your SAP DB database instance, the processor architectures of the source and target hosts must be compatible. The following compatibility matrix is valid for the database instance types OLTP, Document Server, OLAP, and E-Catalog:

 | Win32 | Win64 | Linux 32 | Linux 64 | Tru64 | AIX | HP-UX | Solaris
Win32 | . | . | . | . | . |  |  |
Win64 | . | . | . | . | . |  |  |
Linux 32 | . | . | . | . | . |  |  |
Linux 64 | . | . | . | . | . |  |  |
Tru64 | . | . | . | . | . |  |  |
AIX |  |  |  |  |  | . | . | .
HP-UX |  |  |  |  |  | . | . | .
Solaris |  |  |  |  |  | . | . | .

The media that you use for creating and importing the data backup must also be compatible.


Homogeneous System Copy with the Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Homogeneous System Copy with the Database Manager CLI

You can generate a homogeneous system copy of your database instance by using the following DBM commands:

Creating a backup medium for complete data backups in the original instance:

dbmcli -d TST -u dbm,dbm medium_put databasecopy /usr/sapdb/dbcopy FILE DATA 0 0 NO

Creating a complete data backup of the original instance:

dbmcli -d TST -u dbm,dbm -uUTL -c backup_start databasecopy

Installing the target instance:

dbmcli -s –R <dependent_path> db_create TST1 dbm,dbm

Copying and modifying database parameters from the original instance:

dbmcli -d TST1 -u dbm,dbm -uSRV -c recover_config databasecopy
dbmcli -d TST1 -u dbm,dbm
  > param_startsession
  > param_put RUNDIRECTORY <newrundirectory>
  > param_put DIAG_HISTORY_PATH <newdiaghistorypath>
  > param_checkall
  > param_commitsession

Configuring data volumes of the target instance:

dbmcli -d TST1 -u dbm,dbm param_addvolume DATA <newdatavolume> <datatype> <datasize>
dbmcli -d TST1 -u dbm,dbm param_addvolume LOG <newlogvolume> <logtype> <logsize>

Creating the backup medium in the target instance:

dbmcli -d TST1 -u dbm,dbm medium_put databasecopy /usr/sapdb/dbcopy FILE DATA 0 0 NO

Switching the target instance to the operational state ADMIN:

dbmcli -d TST1 -u dbm,dbm db_admin

Initializing the target instance:

dbmcli -d TST1 -u dbm,dbm util_execute INIT CONFIG

Importing the complete data backup of the original instance into the target instance:

dbmcli -d TST1 -u dbm,dbm -uUTL -c recover_start databasecopy

Switching the target instance to the operational state ONLINE:

dbmcli -d TST1 -u dbm,dbm db_online

Loading the system tables, assigning passwords for SYSDBA and DOMAIN users:

dbmcli –d TST1 –u dbm,dbm load_systab –u <sysdba>,<password> -ud <password2>


Standby Databases with SAP DB (SAP Library - SAP DB)

 Entering content frame

Component documentation Standby Databases with SAP DB

SAP DB gives you additional downtime security by supporting the setup of standby databases.

A standby instance is a copy of the active database instance (original instance). To keep the contents of your database up-to-date, the log backups of the original instance are imported at regular intervals. The standby instance always has the operational state ADMIN.

If you experience problems with the original instance, you start operating the standby instance immediately, and carry on working without a lengthy period of downtime.

Depending on the configuration, you can also restore the standby instance to a specified state in the past.

See also: Example


Setting Up a Standby Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Up a Standby Instance

This section describes how you set up a standby database with SAP DB.

Procedure

Use the Database Manager for the following steps:

...

1. Create the standby instance by making a copy of your original instance. Proceed as described in Creating a Homogeneous System Copy (points 1-5). However, do not start the copy in the operational state ONLINE; instead, keep it in the operational state ADMIN.

Set up the original instance and standby instance on different hosts.

2. In the standby instance, create a backup medium for importing log backups.

3. Make log backups in your active original instance at regular intervals.

4. Import these log backups into your standby instance with the time delay of your choice.

In the Database Manager GUI, import the backups as described under Restoring Without a Backup History.

In the Database Manager CLI, use the restore commands recover_start and recover_replace.

Notes

Keep the following points in mind:

· The data volumes and log volumes of the standby instance must be configured with enough space to import the log backups of the original instance.

· The two instances cannot access the same files. This means that their run directories must be physically separate.

· You can use pipes to transport the data backup. You can transport log backups with ftp, or copy them with an exported file system (such as NFS or a shared file system).

You can start the standby instance in the operational state ONLINE, if you want it to replace the original instance as the active instance (see Starting the Standby Instance as an Active Instance). If the standby instance has been in the state ONLINE, but you still want to use it as a standby instance, then you must initialize the instance, and import a complete data backup of the original instance.


Starting the Standby Instance as an Active Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting the Standby Instance as an Active Instance

If you experience problems with your original instance, then you can stop it, and switch the operational state of the standby instance to ONLINE. The standby instance can then take over the role of the active instance immediately.

Loss of Data

Remember that in this procedure, the standby instance does not contain any data changes that have not yet been imported in log backups from the original instance.

If you want to start the standby instance without losing any data, or you want to start it in a state from the past, you have the following options, depending on the configuration and state of your original instance:

· Importing Log Backups up to a Specific Time

· Importing Another Manual Log Backup

· Copying the Log Volumes of the Original Instance

Prerequisites

· You have set up a standby instance.

· The standby instance has not been in the operational state ONLINE since it was last initialized.

Procedure

Use the Database Manager for the following steps:

1. Make sure that the original instance is in the operational state OFFLINE.

2. Start the standby instance in the operational state ONLINE.

3. In this standby instance, restore any indexes that are no longer up-to-date ( BAD INDEXES).

In the Database Manager GUI, proceed as described in Restoring the Indexes After a Database Restore.

In the Database Manager CLI, use the command sql_recreateindex to recreate a damaged index.

4. Make a complete data backup of the standby instance.

Result

You can now operate the former standby instance as an active database instance. The original instance can become the standby instance. To do this, initialize the original instance, and proceed as described in Setting Up a Standby Instance.


Importing Log Backups up to a Specific Time (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Importing Log Backups up to a Specific Time

You can start the standby instance in a state from the past. You may need to do this if, for example, you lose data during an operation in the original instance, and want to restore a state.

Prerequisites

· You have set up a standby instance.

· The standby instance has not been in the operational state ONLINE since it was last initialized.

· You have imported the log backups from the original instance only up to a point in time before your chosen restore time.

Procedure

If the log backups are imported automatically from the original instance into the standby instance, then cancel the imports (recover_cancel), and import manually any log backups that are missing, up until your chosen time. Proceed as follows:

· When you import the relevant log backup in the Database Manager GUI, choose the option Restore until a specific time (see also Restoring Without a Backup History).

· When you import the relevant log backup in the Database Manager CLI, use the command recover_start with the option UNTIL <date> <time> (see also Commands for Restoring).

Result

The log entries are imported into the standby instance up to the chosen time. Any changes you have made after this time in the original instance are ignored by the standby instance.

You can now start operating the standby instance as an active instance.


Importing Another Manual Log Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Importing Another Manual Log Backup

If it is possible to create another manual log backup in the original instance, then you can start the standby instance without losing data, which means that it is in the same state as the original instance.

Prerequisites

· You have set up a standby instance.

· The standby instance has not been in the operational state ONLINE since it was last initialized.

· The log volumes of the original instance are not damaged.

· You can create a manual log backup in the original instance in the operational state ADMIN.

Procedure

...

1. Create a manual log backup in the original instance.

2. Import this log backup into the standby instance.

Result

You can now start operating the standby instance as an active instance.


Copying the Log Volumes of the Original Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Copying the Log Volumes of the Original Instance

If the log volumes of the original instance are not damaged, and you can use operating system tools to copy their content to the log volumes of the standby instance, then you can start the standby instance without losing data and in a state from the past.

Prerequisites

· You have set up a standby instance.

· The shadow instance has not been in the operational state ONLINE since it was last initialized.

· The log volumes of the original instance are not damaged.

· The number of log volumes and their size are the same in both instances.

· The original instance is in the operational state OFFLINE.

Procedure

...

1. If the log backups are imported automatically from the original instance into the standby instance, then cancel the imports (recover_cancel).

2. Use operating system tools to copy the log volumes from the original instance to the standby instance.

3. Import any missing log backups from the original instance into the standby instance.

Result

You can now start operating the standby instance as an active instance.

You can also start the standby instance in a state from a time chosen in the past.

To do this in the Database Manager GUI, choose Instance ® Restart Until.

To do this in the Database Manager CLI, use the command db_online –u.


Example: Standby Database (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example: Standby Database

This example of an input script shows you how to use the Database Manager CLI to set up a standby instance and start operating it as an active instance.

For more detailed information on working with the Database Manager CLI administration tool, and the meaning of the DBM commands, see Database Manager CLI: SAP DB 7.4.

This example is valid for database instances with a database version lower than 7.4.04.

Input Script

Initializing an existing standby instance:
 db_offline
db_admin
util_connect
util_execute init config
util_release

The command init_config deletes all data in the database instance permanently.

Creating a backup medium in the standby instance for importing a complete data backup from the original instance:
medium_put <medium_name_data> <path_data> <medium_type> DATA

Importing the data backup:
util_connect
recover_start <medium_name_data>
util_release

Creating a backup medium in the standby instance for importing the log backups from the original instance:
medium_put <medium_name_log> <path_log>\save.log FILE LOG

The log backups are numbered automatically and saved in the file save.log <nnn> in the path <path_log>.

Importing the log backups:
 util_connect
 recover_start <medium_name_log> LOG 001
 recover_replace <medium_name_log> <path_log>\save.log 002
 recover_replace <medium_name_log> <path_log>\save.log 003
…

The return code is –8020 (another medium is needed).

Starting the standby instance as an active instance:
recover_ignore

In this case, the standby instance does not include the changes that have not yet been imported with the log backups from the original instance.

You can also terminate the import of the log backups without starting the standby instance in the operational state ONLINE at the same time. To do this, use the command recover_cancel.

As of Version 7.4.03, this command switches the state of a database instance to OFFLINE. Before you can specify other commands, you must first use the command db_admin to switch the operational state of the standby instance to ADMIN.


Installation (SAP Library - SAP DB)

 Entering content frame

Component documentation Installation

Title of the Documentation | Contents
Database Software Installation Guide | Standard installation and uninstallation of all SAP DB software
Web Tools Installation Guide | Installation of SAP DB Web Tools
Connecting External Backup Tools | Configuring the SAP DB software to use various external backup tools
Installation Manual | Installation, update, and uninstallation of installation profiles and individual SAP DB software components, updates of database instances, including software


Database Software Installation Guide (SAP Library - SAP DB)

 Entering content frame

Component documentation Database Software Installation Guide 7.4

Purpose

This documentation describes the installation and uninstallation of all SAP DB software; in the following, these processes are called a standard installation and standard uninstallation.

This Database Software Installation Guide is an extract from the Installation Manual: SAP DB , and only describes some of the possible installation procedures. It is only intended for those users who want to perform a complete installation or complete uninstallation of the SAP DB database software outside an SAP system.

You also have the option of installing or uninstalling individual SAP DB software components. When you do this you must take into account the dependencies between the components, and how they might affect the way your software installation works.

You also have the option of updating SAP DB software installations with or without database instances.

You can also use the Red Hat Package Manager to install the software on Linux.

For more information, see the Installation Manual.

You can download this SAP DB software from the Software section of the SAP DB Homepage at http://www.sapdb.org. The Downloads section contains a quick download area for experienced SAP DB users.
At regular intervals, an updated CD-ROM with the material number 50061824 is produced that contains the SAP DB software. You can order this CD-ROM free of charge on the SAP DB Homepage.

Supported Operating Systems and Platforms

Constraints

This guide does not apply for installing and uninstalling the SAP DB database software in SAP systems.

The installation or uninstallation of the SAP DB software required for SAP systems is described in SAP-specific installation guides. SAP customers can find these guides on the SAP Service Marketplace at http://service.sap.com. If you want to update database instances, including database software, in SAP systems, use the Installation Manual.

Implementation Considerations

You use the SDBINST program for installing the SAP DB software and the SDBUNINST program for uninstalling the SAP DB software. These programs are part of the SAP DB software version 7.4.

For general information on the SAP DB database system, see The SAP DB Database System under Documentation on the SAP DB website http://www.sapdb.org.

Standard Installation with SDBINST

Standard Uninstallation with SDBUNINST


Standard Installation with SDBINST (SAP Library - SAP DB)

 Entering content frame

Background documentation Standard Installation with SDBINST

The program SDBINST for installing the SAP DB software is an interactive enhancement to the standard installation described in this documentation.

You can also use SDBINST for installations in the background. This procedure is described in the Installation Manual: SAP DB.

Standard Installation on UNIX

Standard Installation on Linux (Intel)

Standard Installation on Microsoft Windows


Standard Installation on UNIX (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Standard Installation on UNIX

Use

You are installing the installation profile all of the SAP DB software on the operating system UNIX. All necessary information is queried by the program during the installation.

The installation process is logged by the system.

Conventions

Variables

Prerequisites

· You are in a root shell.

· You have downloaded and unpacked the installation package (Downloading and Unpacking the Database Software on UNIX).

Preparations

If the following conditions apply to your system, you must perform the specified steps before the installation:

· The installation program enters the required services sql6, sql30 and sapdb ni 72 in the file /etc/services if they do not already exist there. If these services are managed centrally for your system on the network (NIS), you must enter them there as follows.  7210/tcp
sql30  7200/tcp
sapdbni72 7269/tcp

· When you install the software, the SAP DB software must be assigned to a special operating system user (as owner of the software), and to operating system user groups. Groups and owners must be defined in advance. Only users with the correct authorizations can generate the SAP DB database instances afterwards (see also Authorization for UNIX Operating Systems for software versions from 7.4.04 in Installation Manual: SAP DB).

If you manage user groups and owners locally on your server, then we recommend that you register the names of the user groups and the owner on the operating system before you start the installation. However, you can also specify them during the installation.

If you manage user groups and owners for your system at a central location in the network, then you must create them here before you start the installation. For more information on creating operating system users and user groups, see your operating system documentation.

· If the path <independent_program_path>/bin is not yet entered in your environment variable PATH, enter it now.

Procedure

...

1. Go to the directory
sapdb-all-<os>-32|64bit-<arch>-<version>_<build>,
into which you unpacked the installation package.
Enter /SDBINST, to start the installation program.

2. The system proposes the installation profile all. Confirm this installation profile.

3. The system prompts you to enter the following information:

¡ Special operating system user <sapdb_user> (owner of the SAP DB database software)

¡ Administrator group <sapdb_admin>

¡ Support group <sapdb_support>

If you are installing an older software version, the system prompts you to specify the group <group>and the owner <owner> of the SAP DB database software.

If you have already created the groups and the owner, enter and confirm them. The system compares this information with the values stored locally or elsewhere in the network. If they do not match, the installation terminates.

If the group and the owner have not yet been created, the system asks whether you want to create them. Enter your chosen values or confirm the system default values. This creates the group and the owner locally on your server.

4. The system now checks whether there are SAP DB installations already on your server.

¡ If SAP DB software installations already exist on your server, a list of these installations is displayed.
If you want to install new database software in parallel with an existing installation, enter none. You then have the option of specifying an installation path that is different from the existing installations. Define an installation path in parallel with the existing installation paths.

¡ If there are no SAP DB installations on your host, the SAP DB components contained in the installation profile are now installed. The system prompts you to specify the following paths:

· Path for storing the data, configuration, and run directories of SAP DB database instances and SAP DB applications (the system default value is /var/opt/sapdb/indep_data)

· Path for storing the programs and libraries shared by the SAP DB database instances and SAP DB applications (the system default value is /opt/sapdb/indep_prog)

· Path for storing the server software that depends on the database version
This path must be unique. Multiple directories with different versions can exist alongside each other (the system default value is /opt/sapdb/depend)

Enter your chosen paths or confirm the system default values.

5. If there were no SAP DB installations on your host until now, add the following entry to the PATH environment variable for all users who want to use SAP DB: <independent_program_path>/bin.

You see a success message about the installation.

Result

The installation profile all of the SAP DB software is now installed and registered on your host. You can use the log to check the result of the installation (Logging on UNIX).

You can now create new database instances using the Database Manager

(See:

· Creating a Database Instance in the Database Manager CLI: SAP DB 7.4 documentation

· The Web DBM documentation)


Downloading and Unpacking the Software on UNIX (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Downloading and Unpacking the Software on UNIX

Use

Download the newest SAP DB database software for your operating system from the SAP DB website (http://www.sapdb.org) under Software.

Take account of the relevant notes about disk capacity and the tested operating system versions.

Procedure

...

1. Choose the SAP DB software package that matches your operating system architecture for the installation profile all
SAPDB-all-<os>-32|64bit-<arch>-<version>_<build>.<tgz>

2. Download the software package and unpack it to a local directory of your choice with the following command:
tar xvzf sapdb-all-<os>-32|64bit-<arch>-<version>_<build>

In this local directory, the system creates a subdirectory
sapdb-all-<os>-<32|64>bit-<arch>-<version>
and stores the SAP DB software there.


Logging on UNIX (SAP Library - SAP DB)

 Entering content frame

Background documentation Logging on UNIX

The entire installation process is logged. The system stores this log under the following path:

<independent_data_path>/wrk/SAPDBall_install-<date>-<time>.log

If the installation terminates, and the directory <independent_data_path> cannot be found, then the log is created in the current directory.

Standard Installation on UNIX


Standard Installation on Linux (Intel) (SAP Library - SAP DB)

 Entering content frame

Background documentation Standard Installation on Linux (Intel)

Use

You are installing or updating all components of the SAP DB Software on the Linux operating system.
If you only want to install or update individual components, you must consider the dependencies between SAP DB components to ensure that the software installation can function. For more information, see the Installation Manual: SAP DB.

If you already have a SAP DB installation on your host that was installed using the Red Hat Package Manager (installation with an rpm package), you can only perform additional installations using this program. It is no longer possible to perform additional installations using the SDBINST program (installation with a tgz package).

See the Installation Manual: SAP DB, section Installations/Updates with the Red Hat Package Manager.

Procedure

Follow the procedure described in the section Standard Installation on UNIX.


Standard Installation on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Standard Installation on Microsoft Windows

Use

You are installing the installation profile all of the SAP DB software on the operating system Microsoft Windows. All necessary information is queried by the program during the installation.

The installation process is logged by the system.

Conventions

Variables

Prerequisites

· You have administration rights for your host.

· You have downloaded and unpacked the installation package (see Downloading and Unpacking the Software on Microsoft Windows).

Procedure

...

1. Open the Command Prompt and navigate to the local directory that contains the installation files:
 sapdb-all-win-<32|64>bit-<arch>-<version>

2. Enter sdbinst to call the installation program.

3. The system proposes the installation profile all. Confirm this installation profile.

4. The system now checks whether there are SAP DB installations already on your server.

¡ If SAP DB installations already exist on your server, a list of these installations is displayed.
If you want to install new database software in parallel with the existing installation, enter none. You then have the option of specifying a new installation path. Define an installation path in parallel with the existing installation paths.

¡ If there are no SAP DB installations on your host, the SAP DB components contained in the installation profile are now installed. Depending on the installation profile that you have chosen, the system may prompt you to specify the following paths:

§ Path for storing the data, configurations, and run directories of SAP DB database instances and SAP DB applications (the system default value is C:\Program Files\sapdb\indep_data)

§ Path for storing the programs and libraries used in common by the SAP DB database instances and SAP DB applications (the system default value is C:\Program Files\sapdb\indep_prog)

§ Path for storing the server software that depends on the database version
This path must be unique. Multiple directories with different versions can exist alongside each other (the system default value is C:\Program Files\sapdb\depend)

Enter your chosen paths or confirm the system default values.

You see a success message about the installation.

5. If there was no SAP DB installation on your host until now, we recommend that you now shutdown and restart your host to make the <independent_program_path> known to the system.

Result

The installation profile all of the SAP DB software is now installed and registered on your host. You can use the log to check the result of the installation (Logging on Microsoft Windows).

You can now create new database instances using the Database Manager

(See:

· Creating or Initializing a Database Instance in the Database Manager GUI: SAP DB 7.4 documentation

· Creating a Database Instance in the Database Manager CLI: SAP DB 7.4 documentation

· The Web DBM documentation)


Downloading and Unpacking the Software on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Downloading and Unpacking the Software on Microsoft Windows

Use

Download the newest SAP DB database software for your operating system from the SAP DB website (http://www.sapdb.org) under Software.

Take account of the relevant notes about disk capacity and the tested operating system versions.

Procedure

...

1. Choose the SAP DB software package that matches your operating system architecture for the installation profile all
sapdb-all-<win>-<32|64>bit-<arch>-<version>_<build>.<zip>

2. Use WinZip to unpack the software package to a local directory of your choice.

3. In this local directory, the system creates a subdirectory
sapdb-all-<win>-<32|64>bit-<arch>-<version>
and stores the SAP DB software there.


Logging on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Background documentation Logging on Microsoft Windows

The entire installation process is logged. The system stores this log under the following path:

<independent_data_path>\wrk\SAPDBall_install-<date>-<time>.log

If the <independent_data_path> directory is not known when the system crashes, the log will be created in the current directory.

Standard Installation on Microsoft Windows


Standard Uninstallation with SDBUNINST (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Standard Uninstallation with SDBUNINST

Use

You use the uninstall program SDBUNINST to uninstall all SAP DB software on your server. It is included in the SAP DB software from Version 7.4.

You can use this program to uninstall SAP DB software from Version 7.2.

Prerequisites

· One or more SAP DB software versions are installed on your host. There is at least one installation of version 7.4 among these, which contains the SDBUNINST program.

· You have administration rights for your host.

Procedure on Microsoft Windows, UNIX, and Linux

...

1. On UNIX/Linux, switch to the rootshell.
On Microsoft Windows, open the command prompt on your server.

2. Stop every SAP DB database instance on your host with the following command:
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

3. Delete every SAP DB database instance on your host with the following command:
dbmcli –d <database_name> -u <dbm_user>,<password> db_drop

4. Call the uninstall program with the option for uninstalling all SAP DB software:
sdbuninst –all
The system displays a list of all existing SAP DB software components.

5. Start the uninstallation by entering y.

You see a success message about the uninstallation.

Result

All SAP DB software was deleted from your host.


Web Tools Installation Guide (SAP Library - SAP DB)

 Entering content frame

Component documentation Web Tools Installation Guide 7.4

Purpose

This documentation describes how you install the SAP DB Web Tools.

This installation guide is not relevant for a standard installation of an SAP system. The installation of the SAP DB software required for SAP systems is described in SAP-specific installation guidelines. SAP customers can find these guidelines in the SAP Service Marketplace, under http://service.sap.com.

Introduction

· Variables Used

· Supported Operating Systems and Browsers

Installation Description

You can install the SAP DB Web Tools on the following operating systems:

· Installation on Linux

· Installation on UNIX

· Installation on Microsoft Windows

Additional Information

· Calling the SAP DB Web Tools

· Using the SAP DB Web Tools with the Apache Web Server

· Setting Up the SAP DB WebDAV Service

· Deinstalling the SAP DB Web Tools

You can download the SAP DB Web Tools free of charge from the following Internet address: www.sapdb.org.

For general information about the SAP DB database system, see the documentation The SAP DB Database System at the following Internet address: www.sapdb.org ® Documentation.


Variables Used (SAP Library - SAP DB)

 Entering content frame

Object documentation Variables Used

The table below contains a list of the special variables used in the installation descriptions.

<installation_path_web_tools> | Installation directory of the SAP DB Web Tools; <independent_program_path>/web
<log_path> | Directory of the web tools logs
<registry_path> | Registry path (Microsoft Windows NT/Microsoft Windows 2000)
<web_server> | Name of the host on which the SAP DB Web Server is installed
<port> | Port address of the SAP DB Web Server

For explanations of the other variables used, see the documentation The SAP DB Database System: SAP DB under Variables.


Supported Operating Systems and Browsers (SAP Library - SAP DB)

 Entering content frame

Object documentation Supported Operating Systems and Browsers

This table shows you with which operating systems, platforms, and browsers the current version of the SAP DB Web Tools has been tested.

<os> | <arch> | Browser
aix | ppc | Mozilla 1.3, Netscape 7.0
linux | i386 | Mozilla 1.3, Netscape 7.0, Konqueror 3.1.1
solaris | sparc | Mozilla 1.3, Netscape 7.0
tru64 | alpha | Mozilla 1.3, Netscape 7.0
hpux | hppa | Mozilla 1.3, Netscape 7.0
win | i386, ia64 | Internet Explorer 6.0, Mozilla 1.3, Netscape 7.0, Opera 7.0


Installation Steps (SAP Library - SAP DB)

 Entering content frame

Object documentation Installation Steps

You can install the SAP DB Web Tools on the following operating systems:

  • Installation on Linux
  • Installation on UNIX
  • Installation on Microsoft Windows

If you want to install the SAP DB Web Tools 7.4 and the database version SAP DB 7.3 on your host, first install the database software and then the Web Tools.


Linux: Installing the SAP DB Web Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linux: Installing the SAP DB Web Tools

Procedure

...

...

1. Installing the SAP DB Web Tools Software

2. Configuring the SAP DB Web Server

3. Starting the SAP DB Web Server

4. Configuring the Web Browser

Additional Information

· Calling the SAP DB Web Tools

· Using the SAP DB Web Tools with the Apache Web Server

· Setting Up the SAP DB WebDAV Service

· Deinstalling the SAP DB Web Tools


Linux: Installing the SAP DB Web Tools Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linux: Installing the SAP DB Web Tools Software

Use

When you install the SAP DB Web Tools 7.4 software package, the SAP DB Web Tools and the SAP DB Web Server are installed.

If the SAP DB Web Tools 7.3 are already installed on your host, stop the Web server before installing SAP DB Web Tools 7.4.
If you are using the tgz package, SAP DB Web Tools 7.4 are installed in parallel to the SAP DB Web Tools 7.3. You can manually delete SAP DB Web Tools 7.3 from your host by deleting the relevant program path and the configuration file /usr/spool/sql/ini/WebAgent73.ini.

See also: Variables Used, Supported Operating Systems and Browser

Procedure when Using the rpm Package

...

...

1. Log onto your computer as the root user.

2. Copy the software package
SAP DB Web Tools ( sapdb-web-<os>-<arch>-<version>.rpm)
to a local directory of your choice.

3. Install the SAP DB Web Tools. To do this, enter the following command:
rpm –U sapdb-web-<os>-<arch>-<version>.rpm

Procedure when Using the tgz Package

...

...

1. Log onto your computer as the root user.

2. Copy the software package
SAP DB Web Tools ( sapdb-webtools-<os>-<arch>-<version>.tgz)
to a local directory of your choice.

3. Install the SAP DB Web Tools. To do this, enter the following command:
gzip -d sapdb-webtools-<os>-<arch>-<version>.tgz tar xf sapdb-webtools-<os>-<arch>-<version>.tar ./SDBINST

4. Follow the instructions provided by the installation program.

Result

The SAP DB Web Tools and the SAP DB Web Server were installed in the directory <installation_path_web_tools> or <independent_program_path>/web.

Next Installation Step

Configuring the SAP DB Web Server


Linux: Configuring the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linux: Configuring the SAP DB Web Server

Use

You can configure the SAP DB Web Server in the configuration file /usr/spool/sql/ini/WebAgent74.ini.

When you start the SAP DB Web Server, you can specify which configuration file the system should use. This means that you can also specify a configuration file other than WebAgent74.ini.

See also: Variables Used, Supported Operating Systems and Browser

Prerequisites

You are logged on as the root user.

Procedure

Section [HTTP] of the WebAgent74.ini configuration file contains the following entries:

Browsable=0
DefaultDocument=index.html
DocumentRoot=<installation_path_web_tools>/Documents
LogDirectory=<installation_path_web_tools>/Log
LogRequests=1
MaxThreads=10
MimeTypeFile=<installation_path_web_tools>/config/mime.types
Port=9999

Browsable

Set whether the contents of the directories under DocumentRoot should be visible using a browser.

· 0: The contents are not visible

· 1: The contents are visible

DefaultDocument

Change the start page of the Web Server, if necessary.

DocumentRoot

Change the path for the root directory of the web pages, if necessary.

LogDirectory

If you set LogRequest so that HTTP accesses are logged, accesses to the SAP DB Web Server are logged in the files httperr.log and httpreq.log.
These log files are written in the directory specified in LogDirectory.

LogRequests

You can determine whether each HTTP access should be logged or not.

· 1: HTTP accesses are logged.

· 0: HTTP accesses are not logged.

MaxThreads

You can determine the maximum number of threads that can be used to process the accesses to the SAP DB Web Server. When the SAP DB Web Server is started, the threads are also started as a thread pool.

MimeTypeFile

Specify the MIME type file, if necessary.

Port

Change the port address for the SAP DB Web Server, if necessary.

Next Installation Step

Starting the SAP DB Web Server


Linux: Starting the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linux: Starting the SAP DB Web Server

See also: Variables Used, Supported Operating Systems and Browser

Procedure (rpm Package)

If you have performed an rpm installation of the SAP DB Web Tools software, start the SAP DB Web Server with the command
/etc/rc.d/sapdb-web start

To stop the server, use the command
/etc/rc.d/sapdb-web stop

Procedure (tgz Package)

Start the SAP DB Web Server as follows:

...

1. Set the environment variable LD_LIBRARY_PATH. To do this, enter the following command:
export LD_LIBRARY_PATH=<installation_path_web_tools>/lib:
<independent_program_path>/lib:$LD_LIBRARY_PATH

2. Go to directory <installation_path_web_tools>/pgm

3. Enter the following command: ./wahttp

Call Options

wahttp [-f <file>] [&] [-h]

· You can use the call parameter -f <file> to specify a configuration file other than the file WebAgent74.ini. For <file>, specify the path and file name of the desired configuration file.

· You can use the call parameter & to start the SAP DB Web Server in the background.

· You can use the call parameter -h to display all call options.

To use a configuration file other than the file WebAgent74.ini, you can also change the specification of the configuration file in the file <installation_path_web_tools>/pgm/wahttp.conf.

Result

When you start the SAP DB Web Server, the SAP DB Web Tools are automatically made available as Web Server Services.

Accesses to the SAP DB Web Server are logged if you have enabled logging when configuring the SAP DB Web Server.

Next Installation Step

Configuring the Web Browser


UNIX: Installing the SAP DB Web Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation UNIX: Installing the SAP DB Web Tools

Procedure

...

1. Installing the SAP DB Web Tools Software

2. Configuring the SAP DB Web Server

3. Starting the SAP DB Web Server

4. Configuring the Web Browser

Additional Information

· Calling the SAP DB Web Tools

· Using the SAP DB Web Tools with the Apache Web Server

· Setting Up the SAP DB WebDAV Service

· Deinstalling the SAP DB Web Tools


UNIX: Installing the SAP DB Web Tools Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation UNIX: Installing the SAP DB Web Tools Software

Use

When you install the SAP DB Web Tools 7.4 software package, the SAP DB Web Tools and the SAP DB Web Server are installed.

If the SAP DB Web Tools 7.3 are already installed on your host, stop the Web server before installing SAP DB Web Tools 7.4.
The SAP DB Web Tools 7.4 are installed in parallel to the SAP DB Web Tools 7.3. You can manually delete SAP DB Web Tools 7.3 from your host by deleting the relevant program path and the configuration file /usr/spool/sql/ini/WebAgent73.ini.

See also: Variables Used, Supported Operating Systems and Browsers

Procedure

...

...

1. Log onto your computer as the root user.

2. Copy the software package
SAP DB Web Tools ( sapdb-webtools-<os>-<arch>-<version>.tgz)
to a local directory of your choice.

3. Install the SAP DB Web Tools. To do this, enter the following command:
gzip -d sapdb-webtools-<os>-<arch>-<version>.tgz tar xf sapdb-webtools-<os>-<arch>-<version>.tar ./SDBINST

4. Follow the instructions provided by the installation program.

Result

The SAP DB Web Tools and the SAP DB Web Server were installed in the directory <installation_path_web_tools> or <independent_program_path>/web.

Next Installation Step

Configuring the SAP DB Web Server


UNIX: Configuring the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation UNIX: Configuring the SAP DB Web Server

Use

You can configure the SAP DB Web Server in the configuration file /usr/spool/sql/ini/WebAgent74.ini.

When you start the SAP DB Web Server, you can specify which configuration file the system should use. This means that you can also specify a configuration file other than WebAgent74.ini.

See also: Variables Used, Supported Operating Systems and Browsers

Prerequisites

You are logged on as the root user.

Procedure

Section [HTTP] of the WebAgent74.ini configuration file contains the following entries:

Browsable=0
DefaultDocument=index.html
DocumentRoot=<installation_path_web_tools>/Documents
LogDirectory=<installation_path_web_tools>/Log
LogRequests=1
MaxThreads=10
MimeTypeFile=<installation_path_web_tools>/config/mime.types
Port=9999

Browsable

Set whether the contents of the directories under DocumentRoot should be visible using a browser.

· 0: The contents are not visible

· 1: The contents are visible

DefaultDocument

Change the start page of the Web Server, if necessary.

DocumentRoot

Change the path for the root directory of the web pages, if necessary.

LogDirectory

If you set LogRequest so that HTTP accesses are logged, accesses to the SAP DB Web Server are logged in the files httperr.log and httpreq.log.
These log files are written in the directory specified in LogDirectory.

LogRequests

You can determine whether each HTTP access should be logged or not.

· 1: HTTP accesses are logged.

· 0: HTTP accesses are not logged.

MaxThreads

You can determine the maximum number of threads that can be used to process the accesses to the SAP DB Web Server. When the SAP DB Web Server is started, the threads are also started as a thread pool.

MimeTypeFile

Specify the MIME type file, if necessary.

Port

Change the port address for the SAP DB Web Server, if necessary.

Next Installation Step

Starting the SAP DB Web Server


UNIX: Starting the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation UNIX: Starting the SAP DB Web Server

See also: Variables Used, Supported Operating Systems and Browsers

Procedure

Start the SAP DB Web Server as follows:

...

...

    1.      Set the environment variable LD_LIBRARY_PATH. To do this, enter the following command:
export LD_LIBRARY_PATH=<installation_path_web_tools>/lib:
<independent_program_path>/lib:$LD_LIBRARY_PATH

If you have installed the Web Tools software for hp-ux (32 Bit), enter SHLIB_PATH instead of LD_LIBRARY_PATH.
If you are working with a 64 bit platform (with the exception of tru64), enter /lib/lib64 instead of /lib.

2. Go to directory <installation_path_web_tools>/pgm

3. Enter the following command: ./wahttp

Call Options

wahttp [-f <file>] [&] [-h]

· You can use the call parameter -f <file> to specify a configuration file other than the file WebAgent74.ini. For <file>, specify the path and file name of the chosen configuration file.

· You can use the call parameter & to start the SAP DB Web Server in the background.

· You can use the call parameter -h to display all call options.

To use a configuration file other than the file WebAgent74.ini, you can also change the specification of the configuration file in the file <installation_path_web_tools>/pgm/wahttp.conf.

Result

When you start the SAP DB Web Server, the SAP DB Web Tools are automatically made available as Web Server Services.

Accesses to the SAP DB Web Server are logged if you have enabled logging (see Configuring the SAP DB Web Server).

Next Installation Step

Configuring the Web Browser


Microsoft Windows: Installing the SAP DB Web Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Microsoft Windows: Installing the SAP DB Web Tools

Procedure

...

1. Installing the SAP DB Web Tools Software

2. Configuring the SAP DB Web Server

3. Starting the SAP DB Web Server

4. Configuring the Web Browser

Additional Information

· Calling the SAP DB Web Tools

· Using the SAP DB Web Tools with the Apache Web Server

· Setting Up the SAP DB WebDAV Service

· Deinstalling the SAP DB Web Tools


Microsoft Windows: Installing the SAP DB Web Tools Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Microsoft Windows: Installing the SAP DB Web Tools Software

Use

When you install the SAP DB Web Tools 7.4 software package, the SAP DB Web Tools and the SAP DB Web Server are installed.

If the SAP DB Web Tools 7.3 are already installed on your host, stop the SAP DB Web Server before installing SAP DB Web Tools 7.4.
The SAP DB Web Tools 7.4 are installed in parallel to the SAP DB Web Tools 7.3. You can manually delete the SAP DB Web Tools 7.3 from your host by deleting the relevant program files and the corresponding registry key.

See also: Variables Used, Supported Operating Systems and Browsers

Prerequisites

You have administrator rights for your host.

Procedure

...

...

1. Copy the software package
SAP DB Web Tools ( sapdb-webtools-<os>-<arch>-<version>.tgz)
to a local directory of your choice.

2. Use the WinZip program to unpack the file sapdb-webtools-<os>-<arch>-<version>.tgz to a local directory of your choice.

3. Open a command prompt.

4. Go to the directory to which you unpacked the files.

5. Start the installation procedure. To do this, enter the following command:
SDBINST.exe

6. Follow the instructions provided by the installation program.

Result

The SAP DB Web Tools and the SAP DB Web Server were installed in the directory <installation_path_web_tools> or <independent_program_path>\web.

Next Installation Step:

Configuring the SAP DB Web Server


Microsoft Windows: Configuring the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Microsoft Windows: Configuring the SAP DB Web Server

Use

You can configure the SAP DB Web Server in the registry, in the registry path HKEY_LOCAL_MACHINE\SOFTWARE\SAP\SAP DBTech\WebAgent74\HTTP.

See also: Variables Used, Supported Operating Systems and Browser

Prerequisites

You have administrator rights for your host.

Procedure

The registry path HKEY_LOCAL_MACHINE\ SOFTWARE\SAP\SAP DBTech\WebAgent74\HTTP contains the following entries:

Browsable=0
DefaultDocument=index.html
DocumentRoot=<installation_path_web_tools>\Documents
LogDirectory=<installation_path_web_tools>\Log
LogRequests=1
MaxThreads=10
MimeTypeFile=<installation_path_web_tools>\config\mime.types
Port=9999

Browsable

Set whether the contents of the directories under DocumentRoot should be visible using a browser.

· 0: The contents are not visible

· 1: The contents are visible

DefaultDocument

Change the start page of the Web Server, if necessary.

DocumentRoot

Change the path for the root directory of the web pages, if necessary.

LogDirectory

If you set LogRequest so that HTTP accesses are logged, accesses to the SAP DB Web Server are logged in the files httperr.log and httpreq.log.
These log files are written in the directory specified in LogDirectory.

LogRequests

You can determine whether each HTTP access should be logged or not.

· 1: HTTP accesses are logged.

· 0: HTTP accesses are not logged.

MaxThreads

You can determine the maximum number of threads that can be used to process the accesses to the SAP DB Web Server. When the SAP DB Web Server is started, the threads are also started as a thread pool.

MimeTypeFile

Specify the MIME type file, if necessary.

Port

Change the port address for the SAP DB Web Server, if necessary.

Next Installation Step

Starting the SAP DB Web Server


Microsoft Windows: Starting the SAP DB Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Microsoft Windows: Starting the SAP DB Web Server

Use

During the installation of the SAP DB Web Tools software, the SAP DB Web Server is automatically entered as the Service SAP DB WWW with manual start (Startup Type manual). You can start and stop the server using Services or at the command prompt.

Procedure

· To start the SAP DB Web Server at the command prompt, enter the following command: net start sapdbwww

· To stop the SAP DB Web Server at the command prompt, enter the following command: net stop sapdbwww

To start the SAP DB Web Server with a configuration other than WebAgent74, change the specification of the registry path in the file <installation_path_web_tools>\pgm\wahttp.conf, or call the server directly.

When you start the SAP DB Web Server, the SAP DB Web Tools are automatically made available as Web Server Services.

SAP DB Web Server accesses are logged if you have enabled logging (Configuring the SAP DB Web Server).

Next Installation Step

Configuring the Web Browser


Calling the SAP DB Web Server Directly (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Calling the SAP DB Web Server Directly

Use

You can call the SAP DB Web Server directly, to, for example, start it with a configuration other than WebAgent74.

Procedure

1. Go to directory <installation_path_web_tools>\pgm

2. To start the SAP DB Web Server, enter the following command: wahttp.exe -d

Call Options

wahttp.exe [-i] [-u] [-d] [-f <file>] [-h]

· Use the call parameter -i to register the SAP DB Web Server as a service.

· Use the call parameter -u to delete the service entry for the SAP DB Web Server.

· Use the call parameter -d to start the SAP DB Web Server directly.

· Use the call parameter -f <registry path> to specify the registry path of a configuration other than WebAgent74.

· Use the call parameter -h to display all call parameters.

To start the SAP DB Web Server with a configuration other than WebAgent74, you can also change the specification of the registry path in the file <installation_path_web_tools>\pgm\wahttp.conf.


Configuring the Web Browser (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Configuring the Web Browser

Procedure

Ensure that your browser supports JavaScript, Style Sheets, and Cookies. If necessary, change the relevant settings of your browser.

Additional Information

· Calling the SAP DB Web Tools

· Setting Up the SAP DB WebDAV Service


Calling the SAP DB Web Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Calling the SAP DB Web Tools

After the installation of the SAP DB Web Tools, the following database tools are available for you to use:

· The Database Manager Web DBM for managing SAP DB database instances

· The query tool Web SQL Studio for easy access to the data of a SAP DB database instance

· An administration tool for managing Web services and Web tools

Calling the Web DBM

Open the Web browser and enter the following URL:

http://<web_server>:<port>/webdbm

For more information about using this database tool, see Web DBM 7.4.

Calling the Web SQL Studio

Open the Web browser and enter the following URL:

http://<web_server>:<port>/websql

For more information about using this database tool, see Web SQL Studio 7.4.

See also: Notes on Using Web SQL Studio.

Calling the Administration Tool

Open the Web browser and enter the following URL:

http://<web_server>:<port>/waadmin.wa

Specify the user name and the password of the Web tools administrator. The system defaults are as follows:

· The default user name is admin.

· The default password is init.

You can change the user name and password for the Web tools administrator with the administration tool under Global Settings ® General Settings.


Notes on Using the Web SQL Studio (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Notes on Using the Web SQL Studio

If your database instance was set up using a SAP DB version below 7.2.05, take the following notes into account.

Customizing the Database Instance

So that you can use the full scope of the Web SQL Studio, you must perform the following actions in the database instance that you want to access with the Web SQL Studio:

...

1. Copy the file <installation_path_web_tools>/env/QP.ins to the directory <dependent_path>/env.

2. Reload the system tables. Enter the following command:
dbmcli –u <dbm_user>,<password> -d <database_name> load_systab

You only need to perform these steps once.

Access to Stored Statements with Changed User Name

If a user name is changed in the database instance that you access with Web SQL Studio, this user can no longer access his or her Stored Statements in the same way as before.

To enable the user to access his or her Stored Statements again, perform the following steps:

...

...

1. Start the Web SQL Studio as a DBA user.

2. Enter the following SQL statements:
UPDATE sysdba.wa_inode SET "VIEWOWNER" = ’<new_user_name>’ WHERE "VIEWOWNER" = ’<old_user_name>’
UPDATE sysdba.wa_container SET "VIEWOWNER" = ’<new_user_name>’  WHERE "VIEWOWNER" = ’<old_user_name>’

Deleting Stored Statements of a Deleted User Name

If a user name is deleted in the database instance that you access with the Web SQL Studio, the Stored Statements of this user are not automatically deleted too.

To delete the Stored Statements in this situation, you have to carry out the following steps:

...

1. Start the Web SQL Studio as a DBA user.

2. Enter the following SQL statements:
DELETE sysdba.wa_inode WHERE "VIEWOWNER" = ’<deleted_user>’
DELETE sysdba.wa_container WHERE "VIEWOWNER" = ’<deleted_user>’


Setting Up the SAP DB WebDAV Service (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Up the SAP DB WebDAV Service

Use

A SAP DB-based WebDAV service is installed along during the installation of the SAP DB Web Tools. A SAP DB database instance is used to store all WebDAV-related data, including the Web resources. Stored XML documents can be indexed; the SAP DB WebDAV GUI provides a range of easy to use functions for handling documents and indexing services.

Before you can use the WebDAV service, you must set up the connection to the desired database instance.

If you are working with a SAP DB database instance with a software version below 7.4.03.09, you must also load additional catalog information into the database before you set up the WebDAV service (see Inserting the WebDAV Schema).

Procedure

...

1. Start the database instance with the Database Manager.

2. Start the SAP DB Web Server.

3. Call the administration tool for the SAP DB Web Tools (see Calling the SAP DB Web Tools).

4. Choose Session Pools ® WebDAV.

5. Specify the following parameters: the name of the database instance, the name of the host on which the database instance is installed, the name of the SYSDBA user and its password.

If you are working with a SAP DB database instance with a software version below 7.4.03.09, instead of the SYSDBA user, use the name of the user with which you inserted the WebDAV schema.

6. If desired, adjust the size of the Pool Size value. This specifies the maximum number of parallel database sessions that the WebDAV service can open.

7. Choose Services ® WebDAV and then Reload Service. The WebDAV service is restarted.

Result

The WebDAV service is now set up with the SAP DB connection. The WebDAV server is automatically started every time the SAP DB Web Server is started.

If you want to use the options for indexing XML documents, you must now configure the index engine.


Inserting the WebDAV Schema (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Inserting the WebDAV Schema

Use

If you want to use the WebDAV service, but are working with a SAP DB database instance with a software version below 7.4.03.09, perform the following steps before Setting Up the WebDAV Service.

Procedure

...

1. Start the Web SQL Studio or the SQL Studio.

2. Open a database session with the desired SAP DB database instance. You can log on using any user name to do this.

3. Copy or import the contents of the file <installation_path_web_tools>\env\webdav.ins to the SQL dialog window, and choose Execute.

The file webdav.ins was stored on your host during the installation of the SAP DB Web Tools software.

Result

You can now set up the WebDAV service.


Information About WebDAV (SAP Library - SAP DB)

 Entering content frame

Background documentation Information About WebDAV

WebDAV is an abbreviation of “Web-based Distributed Authoring and Versioning”. WebDAV is a standard of the Internet Engineering Task Force (IETF), and is an HTTP 1.1 extension.

The WebDAV protocol allows collaborative editing of documents over the Internet. As in familiar file systems, you can create directories, and store, move, rename, and delete objects. The WebDAV service assigns attributes such as creation date or file type to the stored objects ‑ known as Web resources. Among other things, you can use the attributes to control write locks.

The SAP DB WebDAV service fulfills class 2 of the WebDAV specifications, but does not support the WebDAV Access Control Protocol (ACL) and the Versioning Extension (DeltaV).

See also Setting Up the SAP DB WebDAV Service.

For more information, see www.webdav.org.


Configuring the Index Engine for XML Indexing (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Configuring the Index Engine for XML Indexing

Use

Along with the SAP DB Web Tools, an index engine for indexing XML documents in the WebDAV store (document store) is also installed. Before you can use the index engine effectively with the SAP DB WebDAV GUI tool, you need to configure it with information on the database instance you are using.

Procedure

1. Complete the entries for the index engine that the system made in the Registry (Microsoft Windows) or the file sapdbxie.ini (UNIX) during the installation. To edit these entries, proceed as follows:

¡ On Microsoft Windows operating systems, open the registry path
 \HKEY_LOCAL_MACHINE\SOFTWARE\SAP\SAP DBTech\XIE\default

¡ On UNIX operating systems, open the file
 /usr/spool/sql/ini/sapdbxie.ini and search for the [default] section

You see the following entries:

Description=WebDAV Asynchronous Indexing
EngineNode=<web_server>
IndexingLibraryDescription=WebDAV Asynchronous Indexing Service
IndexingLibraryFile=<installation_path_web_tools>/pgm/sapdbxis
IndexingLibraryVersion=<version>
IndexingServiceName=MediaStore
LogFilename=<log_path>/sapdbxie.log
MaxThreads=10
RegistryName=WebDAV
RegistryNode=
RegistryPassword=DBA
RegistryTraceFilename=
RegistryUser=DBA

For information on the meaning of the variables, see Variables Used.

2. Under IndexingServiceName, specify the indexing service definitions that you want the index engine to work with.

3. Under RegistryName, RegistryNode, RegistryPassword, and RegistryUser, enter the connection parameters to the database instance that you are using as the WebDAV store. Enter the following information:

RegistryName | Name of the database instance
RegistryNode | Name of the host on which the database instance is installed You do not need to enter anything here if your database instance is installed locally.
RegistryPassword | Password of the database user
RegistryUser | Name of the database user

4. Close the Registry or the registration file.

5. Now register the index engine in the specified database instance by entering the following command in the command line:
sapdbxie –r <registration_name>

Result

You have set up and registered a fully functioning index engine. You can use the SAP DB WebDAV GUI to monitor the registered index engines, navigate simply through the document store, index XML documents, and search for indexed documents.


Using the SAP DB Web Tools with the Apache Web Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Using the SAP DB Web Tools with the Apache Web Server

Use

You can also use the SAP DB Web Tools in combination with the Apache Web Server as a proxy, for example if you do not want to change your existing Apache environment.

Procedure

1. Make the following entries in the file httpd.conf of the Apache Web Server :
 LoadModule proxy_module modules/mod_proxy.so
AddModule mod_proxy.c

2. Remove the commenting # for the proxy server directives and add the following statements to the directives:
 ProxyPass /webdbm http://<web_server:port>/webdbm
ProxyPassReverse /webdbm http://<web_server:port>/webdbm

ProxyPass /sapdb http://<web_server:port>
ProxyPassReverse /sapdb http://<web_server:port>

ProxyPass /WARoot http://<web_server:port>/WARoot
ProxyPassReverse /WARoot http://<web_server:port>/WARoot

ProxyPass /websql http://<web_server:port>/websql
ProxyPassReverse /websql http://<web_server:port>/websql


Deinstalling the SAP DB Web Tools 7.4 (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deinstalling the SAP DB Web Tools 7.4

Use

You can uninstall SAP DB Web Tools 7.4 using the SDBUNINST program.

  • Deinstallation Under UNIX/Linux
  • Deinstallation Under Microsoft Windows

If you installed SAP DB Web Tools 7.4 on Linux using the rpm package, perform the deinstallation with rpm .


Deinstallation Under UNIX/Linux (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deinstallation Under UNIX/Linux

Prerequisites

You are logged on as user root on your host.

Procedure

1. Stop the SAP DB Web Server.

2. Start the deinstallation by entering the command
 sdbuninst –package Webtools


Linux: Deinstalling the SAP DB Web Tools (rpm) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linux: Deinstalling the SAP DB Web Tools (rpm)

Prerequisites

You are logged on as user root.

Procedure

1. Go to the directory /usr/sapdb-web.

2. Enter the following command: rpm –e sapdb-web


Deinstallation Under Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deinstallation Under Microsoft Windows

Prerequisites

You have administrator rights for your host.

Procedure

1. Stop the SAP DB Web Server.

2. Start the deinstallation by executing the SDBUNINST program at the command prompt, using the following command:
 sdbuninst.exe -package Webtools


Connecting External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Component documentation Connecting External Backup Tools

Implementation Considerations

To manage SAP DB database instances and, in particular, to guarantee data security, SAP provides you with easy-to-use database tools. You can use these tools together with external backup tools.

To back up and restore SAP DB database instances, use the Database Manager. To load and unload data into or from SAP DB database instances, use the SAP DB Loader.

For general information on the SAP DB database system, see the documentation The SAP DB Database System. The section External Backup Tools contains a list of external backup tools that are supported by SAP DB.

Content of the Documentation

This document describes the configuration of the SAP DB software for use with various external backup tools. The documentation gives you an overview of which SAP DB database versions can be connected to which external backup tools, and for which database versions you can create parallel backups or restores.

Use

If, for example, you want to save the dataset of a database instance, or load data from the database instance, you can save this data directly in files, pipes, or, by using a tape device, on tapes. However, you can also save data on a permanent medium by using an external backup tool. In this case, you also use the SAP DB database tools to control the necessary actions. The external backup tool provides the tapes on which you can save or load the data. To be able to use the SAP DB database tool together with the external backup tool, you have to configure the SAP DB software accordingly.

You can use external backup tools for the following actions:

· Save on external backup media

¡ Incremental data backups

¡ Complete data backups

¡ Log backups

¡ Archive version files

· Restore external backup media

¡ Restore the database instance by using data backups, log backups, and archived log backups

· Unload data to external backup media

¡ Unload the whole database instance

¡ Unload the whole database catalog

· Load data from external backup media

¡ Load the whole database instance

¡ Load the whole database catalog

The procedures for backups and restores after the relevant configuration are contained in the following documents (depending on which tool you use):
Database Manager CLI, sections Using External Backup Tools for Backups and Using External Backup Tools for Restores
Database Manager GUI, sections Backing Up Data and Restoring Data, or the documentation Web DBM.

The procedures for loading and unloading data after the relevant configuration are described in the documentation Loader, sections Unloading with External Backup Tools and Loading with External Backup Tools.

Switching the Operating System

When you backup or restore, you can switch from Microsoft Windows to Linux and the other way round only. This means that a backup created on the operating system Microsoft Windows can be restored only on the same operating system or on Linux. A backup created on Linux can be restored only on the same operating system or on Microsoft Windows.

If you are planning to migrate data between different operating systems, SAP recommends that you use the SAP DB Loader. When you load or unload data, there are no restrictions for switching the operating system as far as this SAP DB database tool is concerned. A switch is restricted only by the various backup devices being independent of operating systems only to a limited extent. If, for example, you want to switch from Microsoft Windows to UNIX, a tape device or an external backup tool would have to be compatible with both operating systems. Check this in the documentation on your backup device.


Block Diagram: Backup and Restore (SAP Library - SAP DB)

 Entering content frame

Background documentation Block Diagram: Backup and Restore

The following block diagram illustrates the SAP DB components that are involved when you back up and restore data, and shows how they work together with an external backup tool.

This graphic is explained in the accompanying text

Description of the Backup Process

By using the Database Manager client, you enter the command for saving data and in doing so you call the program DBM server. If you are using a UNIX operating system, the DBM server creates one or more pipes. If you use Microsoft Windows, the pipes are created by the database kernel. The DBM server transfers the information to the database kernel to start the backup process. As soon as the data is written to the pipes, the program DBM server calls the external backup tool. The backup tool reads the data from the pipes and saves it on a permanent medium.

Description of the Restore Process

By using the Database Manager client, you enter the command for restoring data and in doing so you call the program DBM server. If you are using a UNIX operating system, the DBM server creates one or more pipes. If you use Microsoft Windows, the pipes are created by the database kernel. The program DBM server transfers the information to the database kernel to start the restore process. The program then calls the external backup tool and transfers the information about which backup has to be restored. The client of the backup tool requests the specified backup medium from the backup server. The server gets the medium, reads the data of the backup, and transfers the data to the client of the backup tool. The client writes the data into the pipes. There the data is read by the database kernel and transferred to the database system.


Block Diagram: Loading and Unloading Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Block Diagram: Loading and Unloading Data

The following block diagram illustrates the SAP DB components that are involved when you load and unload data, and shows how they work together with an external backup tool.

This graphic is explained in the accompanying text

Description of the Load Process

By using the SAP DB Loader client, you enter the command for loading data and in doing so you call the program loader server. The loader server then creates the pipes. At the same time, the server calls the external backup tool and tells it from which external backup tool to load the data. The client of the external backup tool requests the specified backup medium from the backup server. The server gets the medium, reads the data to be loaded from the backup medium, and transfers the data to the client of the external backup medium. The client writes the data sequentially into the pipes. There the loader server reads them and loads them into the database instance.

Description of the Unload Process

By using the SAP DB Loader client, you enter the command for unloading data and in doing so you call the program loader server. The loader server then creates the pipes. The server starts to unload the data and write it sequentially into the pipes. At the same time, the server calls the external backup tool. The backup tool reads the data sequentially from the pipes and saves it on a permanent medium.


Connecting to a Backint for Oracle Interface (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Connecting to a Backint for Oracle Interface

Many external backup tools have a Backint for Oracle interface. The program Backint for Oracle can backup any files in the file system, regardless of whether the Oracle database system is installed on the server or not. The following description of how to connect SAP DB to a Backint for Oracle interface assumes that this feature is guaranteed by the vendor of the external backup tool with the Backint for Oracle interface.

After the SAP DB software has been configured accordingly, the SAP DB database tools can be connected to the Backint for Oracle interface of an external backup tool for backup, restore, unload, and reload purposes.

The connection is made by using an adapter program that implements a Backint for SAP DB as well as the Backint for Oracle of the external backup tool. This adapter program is part of your SAP DB installation.

After you have triggered the relevant action by using the SAP DB database tool, the SAP DB adapter program copies the dataset bit by bit into temporary files. The SAP DB adapter program calls the Backint for Oracle program several times in succession to save these temporary files by using the external backup tool.

See also:

Restrictions for Using Backint for Oracle

Functions of the SAP DB Adapter Program

Configuring the Backint for Oracle Connection


Limitations in the Use of Backint for Oracle (SAP Library - SAP DB)

 Entering content frame

Background documentation Restrictions for Using Backint for Oracle

The following SAP DB versions are valid as of the specified build numbers for connecting SAP DB to an external backup tool by using a Backint for Oracle interface. The specified SAP DB tools are available.

The database versions listed are valid for each database instance type.

SAP DB Versions and Tools for Creating Backups and Restoring by Using a Backint for Oracle Interface

Version | Build No. | Available SAP DB Tools
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 000 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.4.01 | from 003 | DBMCLI, DBMGUI
7.3.32 | from 000 | DBMCLI, DBMGUI
7.3.00 | from 015 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 008 | DBMCLI, DBMGUI (for backup only)*

* You can use this version of the Database Manager GUI only for creating backups and not for restore purposes. However, if you have installed a newer version of the Database Manager GUI that supports the restore function (7.4.03, for example), you can also restore databases that have an older version (7.2.05, for example), since this database tool is downward compatible.


Functions of the SAP DB Adapter Program (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions of the SAP DB Adapter Program

To enable you to connect Backint for Oracle to SAP DB, an adapter program is delivered with the SAP DB software. This program meets the Backint for SAP DB specification if it is used with a Backint for Oracle program.

Backup Function

...

The backup data of the database system is received by one or more pipes and saved in temporary files. You can define the number and size of these files in the parameter file of the SAP DB adapter program.

The SAP DB adapter program calls the external backup tool, and saves the temporary files by using the Backint for Oracle program. The temporary files are then deleted. This step is repeated until all data has been saved.

To speed up the backup process, you need to configure the SAP DB adapter program to enable parallel backups. To do this, you define a group of parallel backup media and a separate staging area for each pipe. In this way, new temporary files are created, and existing temporary files are saved by using Backint for Oracle.

Administrative information is saved in a backup history, a backup of which is created by Backint for Oracle after each backup.

Restore Function

...

The information about the backup history is evaluated by the SAP DB adapter program.

The SAP DB adapter program uses the backup history and Backint for Oracle to restore the required temporary files in the correct sequence. The temporary files are transferred by the SAP DB adapter program to the database system by using one or more pipes.

If an error occurs and the backup history is no longer available, you have to manually restore the last version of the backup history by using Backint for Oracle. Make sure that you are familiar with Backint for Oracle and the handling of your backup tool in case this is necessary.


Configuring the Backint for Oracle Connection (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Configuring the Backint for Oracle Connection

Use

You configure the SAP DB software with the aim of connecting the SAP DB database tools for saving, restoring, unloading, or loading data to the Backint for Oracle interface of an external backup tool.

Prerequisites

· Your external backup tool has a Backint for Oracle interface.

· The version of your SAP DB database system supports the connection of a Backint for Oracle interface (see: Restrictions for Using Backint for Oracle).

· Your Backint for Oracle program is able to save any files in a file system, even if you do not have an Oracle database system installed on your host.

Procedure

To connect the SAP DB to the Backint for Oracle interface, perform the following steps:

...

1. Configure the Backint for Oracle interface of the external backup tool according to the instructions of the vendor. If you have to create a configuration file for this, you have to specify its name in the parameter file of the adapter program (see step 2).

2. Create the parameter file for the SAP DB adapter program
This file connects the SAP DB with the external backup tool. If necessary, also enter the name of the configuration file of the external backup tool in this file (see step 1).

Example

3. Create the configuration file for Backint for SAP DB (case 1)
This file connects the Database Manager with the SAP DB adapter program. Also enter the name of the parameter file of the SAP DB adapter program in this file (see step 1).

Example

4. Set the environment variables BSI_ENV for the program DBM server.

5. Export the environment variables of the external backup tool if this is allowed by the vendor of the external backup tool.


Creating the Parameter File for the SAP DB Adapter Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating the Parameter File for the SAP DB Adapter Program

Use

If you want to use an external backup tool with a Backint for Oracle interface for a SAP DB database system, you first have to configure the connection between the SAP DB and the Backint for Oracle (see Configuring the Backint for Oracle Connection). Creating the parameter file for the SAP DB adapter program is one of the required steps for this configuration.

In the parameter file you determine where the SAP DB adapter program generates the required temporary files, and where the interface program Backint for Oracle is located.

You define the name of this parameter file in the configuration file of the Backint for SAP DB (keyword PARAMETERFILE) when you configure Backint for SAP DB.

Procedure

On every line in the parameter file you determine a parameter of the SAP DB adapter program. When you do this, at the beginning of each line you have to specify the keyword for the parameter and then the relevant value(s). Lines that do not begin with keywords are ignored by the system.

Syntax

<key_string> <value_string>

<key_string> | Keyword for a parameter; can consist of one or more words
<value_string> | Value(s) of the parameter

You can define the following parameters for the SAP DB adapter program:

Parameter

Syntax

Description

Absolute path and size of a temporary file

STAGING AREA: <absolute_path>/<file_name> <size> [KB|MB|GB]

You can define up to 256 temporary files.
If you do not specify a unit for the size, the size is configured in bytes.
The program uses exactly one temporary file for each pipe.

Maximum number of temporary files that are to be processed by Backint for Oracle concurrently.

FILES PER BACKINT CALL: <number>

Default value: 1
The program can save temporary files and generate other temporary files simultaneously, provided you have configured more pipes than temporary files.

Absolute path and name of the Backint for Oracle program

BACKINT: <absolute_path>/<file_name>

Absolute path and name of the configuration file for the Backint for Oracle program

PARAMETERFILE OF BACKINT: <absolute_path>/<file_name>h>

Define this parameter only if you want to create a configuration file for the external backup tool. Otherwise, do not use this keyword.

Absolute path and name of the backup history

HISTORY FILE: <absolute_path>/<file_name>

The backup history contains the information that is required for the restore function.

Absolute path and name of the standard input file

INPUTFILE FOR BACKINT: <absolute_path>/<file_name>

These files must differ from the files that are configured for the Backint for SAP DB connection (see INPUT, OUTPUT, ERROROUTPUT in Creating the Configuration File for Backint for SAP DB).

Absolute path and name of the standard output file

OUTPUT FILE FOR BACKINT: <absolute_path>/<file_name>

Absolute path and name of the standard error output file

ERRORFILE FOR BACKINT: <absolute_path>/<file_name>

Maximum waiting time in seconds between creating a temporary file and starting to save it by using Backint for Oracle

MAXIMAL DELAY OF BACKINT CALL: <number>

Default value: 10
This value prevents deadlocks in exceptional situations during a parallel backup or a restore.

If the temporary files are created at different speeds and one temporary file is already complete, the adapter program waits a maximum of the time specified here for another temporary file to be completely created. If no other file is created within the specified time, the existing temporary file is saved.

Specify enough time to save the configured number of temporary files ( FILES PER BACKINT CALL:). However, you must also make sure that the end of the backup process is not delayed for too long.

Specifies whether the SAP DB adapter program ignores the closing slash (/ or \) of an absolute directory name for Backint for Oracle.

OMIT LAST DIRECTORY DELIMITER ON RESTORE:<YES | NO>

NO: Default value
The slash is not ignored.
YES: The slash is ignored.
Use this option to avoid problems with Backint for Oracle implementations that do not expect a closing slash (/ or \) at the end of a directory name.
This parameter is supported for the following SAP DB versions as of the specified build numbers:
7.4.03 from build 000, 7.4.02 from build 002, 7.3.00 from build 021, 7.2.05 from build 016

Value of the environment variables BI_CALLER

BI_CALLER_VALUE: <value>

Set this parameter only if required to do so by the vendor of the backup tool. In accordance with the system default, the variable BI_CALLER is removed from the environment before Backint for Oracle is called. For most Backint for Oracle implementations you do not need to set this value since these implementations allow the environment variables BI_CALLER to be missing. This parameter is supported for the following SAP DB versions as of the specified build numbers:
All versions from 7.4.04 build 000, 7.4.03 from build 006, 7.4.02 from build 016, 7.3.0 from build 029, 7.2.05 from build 025.

See also:

Example of a Parameter File for the SAP DB Adapter Program


Example of a Parameter File for the SAP DB Adapter Program (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of a Parameter File for the SAP DB Adapter Program

Use

You can simplify the creation of the parameter file for the SAP DB adapter program if you use the following example and adjust it to suit your needs. If you do not want to set a certain parameter by using the parameter file, you have to invalidate or delete the relevant keyword.

File Content

STAGING AREA:                  D:\TEMP\STAGE1 1 GB
STAGING AREA:                  E:\TEMP\STAGE2 1024 MB
STAGING AREA:                  F:\TEMP\STAGE3 1048576 KB
STAGING AREA:                  G:\TEMP\STAGE4 1073741824

FILES PER BACKINT CALL:        2

BACKINT:                       C:\BackupTool\BIN\backint.exe
PARAMETERFILE OF BACKINT:      C:\BackupTool\CONF\backintoraconfig.utl

HISTORY FILE:                  C:\SAPDB\BackintHistory

INPUTFILE FOR BACKINT:         C:\TEMP\backint4Oracle.in
OUTPUTFILE FOR BACKINT:        C:\TEMP\backint4Oracle.out
ERRORFILE FOR BACKINT:         C:\TEMP\backint4Oracle.err

MAXIMAL DELAY OF BACKINT CALL: 30

Explanation

Keyword

Value(s)

Explanation

STAGING AREA:

D:\TEMP\STAGE1 1 GB
E:\TEMP\STAGE2 1024 MB
F:\TEMP\STAGE3 1048576 KB
G:\TEMP\STAGE4 1073741824

The adapter program (if configured in this way) can backup or restore a maximum of four pipes at the same time. The temporary files created in doing this can reach a size of a Gigabyte, as long as the end of the pipe is not reached.

FILES PER BACKINT CALL:

2

As soon as two of the four temporary files have been completely created, they are saved by calling the Backint for Oracle program.

BACKINT:

C:\Backuptool\BIN\backint.exe

The absolute path of the Backint for Oracle program is: C:\Backuptool\BIN\backint.exe.

PARAMETERFILE OF BACKINT:

C:\BackupTool\CONF\backint
oraconfig.utl

The absolute path of the configuration file of the Backint for Oracle program is: C:\Backuptool\CONF\backintoraconfig.utl.

HISTORY FILE:

C:\SAPDB\BackintHistory

The adapter program stores the backup history at the end of each backup under the path C:\SAPDB\BackintHistory and saves the history by calling the Backint for Oracle program again.

INPUTFILE FOR BACKINT:

C:\TEMP\backint4Oracle.in

Standard input for Backint for Oracle: C:\TEMP\backint4Oracle.in

OUTPUTFILE FOR BACKINT:

C:\TEMP\backint4Oracle.out

Standard output for Backint for Oracle: C:\TEMP\backint4Oracle.out

ERRORFILE FOR BACKINT:

C:\TEMP\backint4Oracle.err

Standard error output for Backint for Oracle: C:\TEMP\backint4Oracle.err

MAXIMAL DELAY OF BACKINT CALL:

30

If the temporary files are created at different speeds and one temporary file is already complete, the adapter program waits a maximum of 30 seconds for another of the temporary files to be completely created. If none of the other files is created within 30 seconds, the temporary file that already exists is backed up using Backint for Oracle.


Creating the Configuration File for Backint for SAP DB (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating the Configuration File for Backint for SAP DB

Use

You configure the SAP DB software with the aim of connecting the SAP DB database tools for saving, restoring, unloading, or loading data to an external backup tool.

You use the configuration file for Backint for SAP DB to inform the Database Manager where the Backint for SAP DB program is located, and how to communicate with it.

Case 1: Connecting to Backint for Oracle by Using the SAP DB Adapter Program

(See also: Functions of the SAP DB Adapter Program.)

If you want to use an external backup tool with a Backint for Oracle interface for a SAP DB database system, you first have to configure the connection between the SAP DB and the Backint for Oracle program (see Configuring the Backint for Oracle Connection). Creating the configuration file for the Backint for SAP DB is one of the required steps for this configuration.

Case 2: Connecting to the Backint for SAP DB Interface of an External Backup Tool (Third-Party Vendor)

If you want to use an external backup tool with a Backint for SAP DB interface for a SAP DB database system, you have to create a configuration file. For the most part, this corresponds to the configuration file in case 1. The differences are explained in the following description.

Here we can assume that the Backint for SAP DB interface of the vendor of the external backup tool corresponds to the Backint for SAP DB specification (see also the documentation Backup and Restore Interface for SAP DB Systems).

Procedure

On every line in the configuration file you determine a parameter of the SAP DB adapter program. When you do this, at the beginning of each line you have to specify the keyword for the parameter and then the relevant value(s). Lines that do not begin with keywords are ignored by the system.

Syntax

<key_string> <value_string>

<key_string> | Keyword for a parameter; can consist of one or more words
<value_string> | Value(s) of the parameter

You can define the following parameters for connecting Backint for SAP DB to the DBM server program:

Parameter

Syntax

Description

Absolute path and name of the Backint program

BACKINT <absolute_path>/<file_name>

Case 1: Connecting to a Backint for Oracle interface by using a SAP DB adapter program
Specify the absolute path and name of the adapter program that was delivered with SAP DB.

Case 2: Connecting to the Backint for SAP DB interface of an external backup tool (third-party vendor)
Specify the absolute path and name of the Backint for SAP DB program.

Absolute path and name of the standard input file

INPUT <absolute_path>/<file_name>

The Database Manager creates these files temporarily and uses them for standard input, output, and error output for Backint for SAP DB.

Absolute path and name of the standard output file

OUTPUT <absolute_path>/<file_name>

Absolute path and name of the standard error output file

ERROROUTPUT <absolute_path>/<file_name>

Absolute path and name of the configuration file of the Backint for SAP DB program

PARAMETERFILE <absolute_path>/<file_name>

Case 1: Connecting to a Backint for Oracle interface by using a SAP DB adapter program
Specify the absolute path and name of the parameter file of the adapter program.

Case 2: Connecting to the Backint for SAP DB interface of an external backup tool (third-party vendor)
Specify the absolute path and name of a configuration file to be defined for the Backint for SAP DB program.

Time in seconds

Time that the Database Manager waits for the end of the started Backint for SAP DB if action is successful

TIMEOUT_SUCCESS <number>

Default value: 300

Case 1: Connecting to a Backint for Oracle interface by using a SAP DB adapter program
Make sure that you allow enough time so that Backint for Oracle can save the temporary files in the configured size to a tape.

Case 2: Connecting to the Backint for SAP DB interface of an external backup tool (third-party vendor)
Length of time in which Backint for SAP DB has to end the backup after all data has been transferred to the pipe(s).

Time in seconds

Time that the Database Manager waits for the end of the started Backint for SAP DB if errors occur

TIMEOUT_FAILURE <number>

Default value: 300

If an error occurs, the process terminates after this time, even if not all data was transferred. This ensures, for example, that during automatic night runs additional backup processes can start.

Absolute path of the run directory of the source database

ORIGINAL_RUNDIRECTORY <absolute_path>

Default value: Run directory of the current database instance

Specify this parameter only for a migration.
The prerequisite for the migration from one server to another is that the version of Backint for SAP DB that you are using can make backups from the source server available on the target server.

Pay attention to upper- and lowercase spelling when you specify this value.

See also:

Example of a Configuration File for Backint for SAP DB


Example of a Configuration File for Backint for SAP DB

 Entering content frame

This graphic is explained in the accompanying text Example of a Configuration File for Backint for SAP DB

Use

You can simplify the creation of the configuration file for the Backint for SAP DB if you use the following example and adjust it to suit your needs. If you do not want to set a certain parameter by using the parameter file, you have to invalidate or delete the relevant keyword.

File Content

Case 1: Connecting to a Backint for Oracle Interface by Using the SAP DB Adapter Program

BACKINT               C:\SAPDB\P1\db\bin\backint.exe
INPUT                 C:\TEMP\backint4SAPDB.in
OUTPUT                C:\TEMP\backint4SAPDB.out
ERROROUTPUT           C:\TEMP\backint4SAPDB.err
PARAMETERFILE         C:\SAPDB\WRK\TST\backintoraconfig.par
TIMEOUT_SUCCESS       600
TIMEOUT_FAILURE       300
ORIGINAL_RUNDIRECTORY C:\SAPDB\wrk\P1

Case 2: Connecting to the Backint for SAP DB Interface of an External Backup Tool (Third-Party Vendor)

BACKINT               C:\Backuptool\backint.exe
INPUT                 C:\TEMP\backint4SAPDB.in
OUTPUT                C:\TEMP\backint4SAPDB.out
ERROROUTPUT           C:\TEMP\backint4SAPDB.err
PARAMETERFILE         C:\SAPDB\WRK\TST\backintoraconfig.par
TIMEOUT_SUCCESS       600
TIMEOUT_FAILURE       300
ORIGINAL_RUNDIRECTORY C:\SAPDB\wrk\P1

Explanation

Keyword | Value | Explanation
BACKINT | C:\Backuptool\backint.exe | The absolute path of the Backint for SAP DB program is: C:\Backuptool\backintsapdb.exe.
INPUT | C:\TEMP\backint4SAPDB.in | The absolute path of the standard input is: C:\TEMP\backint4SAPDB.in.
OUTPUT | C:\TEMP\backint4SAPDB.out | The absolute path of the standard output is: C:\TEMP\backint4SAPDB.out.
ERROROUTPUT | C:\TEMP\backint4SAPDB.err | The absolute path of the standard error output is: C:\TEMP\backint4SAPDB.err.
PARAMETERFILE | C:\SAPDB\WRK\TST\adaptprog.par | The absolute path of the parameter file of the adapter program is: C:\SAPDB\WRK\TST\adaptprog.par.
TIMEOUT_SUCCESS | 600 | In the case of success, the Database Manager waits a maximum of ten minutes for Backint for SAP DB to terminate.
TIMEOUT_FAILURE | 300 | In the case of failure, the Database Manager waits a maximum of five minutes for Backint for SAP DB to terminate.
ORIGINAL_RUNDIRECTORY | C:\SAPDB\wrk\P1 | Run directory of the original database instance: C:\SAPDB\wrk\P1.


Setting the Environment Variables BSI_ENV (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting the Environment Variables BSI_ENV

Use

So that the Database Manager or SAP DB Loader on the database host can access the configuration file for Backint for SAP DB, you have to explicitly define the absolute path of the file in the environment variables BSI_ENV by using the Database Manager.

If you do not do this, instead of the configuration file, the system uses the file specified in the following table:

Operating System | File
UNIX | <run_directory>/bsi.env
Microsoft Windows | <run_directory>\bsi.env

Syntax

dbmcli -d <database_name> -n <database_server> -u <dbm_user>,<password> dbm_configset -raw <variable> <value>

<variable> | Environment Variable
<value> | Value of the environment variables

See also:

Database Manager CLI , section Changing a Configuration Parameter of the Database Manager


Exporting Environment Variables of the External Backup Tool (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Exporting Environment Variables of the External Backup Tool

Use

If the vendor of the external backup tool stipulates the export of environment variables, you can export them into the environment by using the Database Manager before you call the external backup tool.

The export of environment variables is supported for the following SAP DB versions as of the specified build numbers:
7.2.05 from build 016, 7.3.00 from build 021, 7.4.02 from build 002, 7.4.03 from build 000

Syntax

dbmcli -d <database_name> -n <database_server> -u <dbm_user>,<password> dbm_configset -raw set_variable_<number> <variable>=<value>

<number> | Your choice of numbering for the variables that have to be set (0<= number <=100)
<variable> | Environment Variable
<value> | Value of the environment variables

Even if you define multiple values for one environment variable, only the smallest of these values is exported for this environment variable.
Example:
You have entered the following DBM commands:

dbmcli ... dbm_configset -raw set_variable_<number1> <variable>=<value1>
dbmcli ... dbm_configset -raw set_variable_<number2> <variable>=<value2>

If number1 < number2, the Database Manager exports only the <value1> for the environment variable <variable>, otherwise only the value <value2>.

If you publish one of the environment variables TEMP, TMP, ADINT, ADA_OPT, NSR_ENV, NSR_POOL, NSR_EXPIRE, or BSI_ENV with
dbmcli ... dbm_configset -raw <variable> <value>
and export it with
dbmcli ... dbm_configset -raw set_variable_<number> <variable>=<value>,
the environment variable is exported with the value before an external backup tool is called.


Connecting to a Backint for SAP DB Interface (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Connecting to a Backint for SAP DB Interface

Use

External backup tools that have their own Backint for SAP DB interface are still being developed. The requirements of such an interface are described in the documentation Backup and Restore Interface for SAP DB Systems.

The section Connecting to a Backint for Oracle Interface describes the use of a Backint for SAP DB implementation with an adapter program. This implementation is a program developed by SAP DB and delivered with the SAP DB software package and is intended for connecting to Backint for Oracle. The configuration file that has to be created, however, corresponds to the configuration file that would have to be created for an external backup medium with its own Backint for SAP DB interface. This is the case if the requirements in the documentation Backup and Restore Interface for SAP DB Systems are met by the vendor.

Prerequisites

The version of your SAP DB database system supports the connection of a Backint for SAP DB interface (see Restrictions for Using Backint for SAP DB).

Procedure

To connect to a Backint for SAP DB interface, perform the following steps:

...

1. Create the configuration file for Backint for SAP DB, case 2.

2. Set the environment variables BSI_ENV for the Database Manager.

3. Export the environment variables of the external backup tool if this is allowed by the vendor of the external backup tool.


Limitations in the Use of Backint for SAP DB (SAP Library - SAP DB)

 Entering content frame

Background documentation Restrictions for Using Backint for SAP DB

The following SAP DB versions are valid as of the specified build numbers for connecting SAP DB to an external backup tool by using a Backint for SAP DB interface. The specified SAP DB tools are available.

The database versions listed are valid for each database instance type.

SAP DB Versions and Tools for Creating Backups and Restoring by Using a Backint for SAP DB Interface

Version | Build No. | Available SAP DB Tools
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 000 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.4.01 | from 003 | DBMCLI, DBMGUI
7.3.32 | from 000 | DBMCLI, DBMGUI
7.3.00 | from 015 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 008 | DBMCLI, DBMGUI (for backup only)*

* You can use this version of the Database Manager GUI only for creating backups and not for restore purposes. However, if you have installed a newer version of the Database Manager GUI that supports the restore function (7.4.03, for example), you can also restore databases that have an older version (7.2.05, for example), since this database tool is downward compatible.


Connecting to TSM (SAP Library - SAP DB)

 Entering content frame

Background documentation Connecting to TSM

SAP DB supports connections to the external backup tool TSM by the company IBM/Tivoli for backing up, restoring, loading, and unloading data after the SAP DB software has been configured accordingly.

Note that there are version-specific restrictions for using TSM or for creating parallel backups or restores.

See also:

Restrictions for Using TSM

Restrictions for Creating Parallel Backups and Restores with TSM

Configuring the TSM Connection


Restrictions for Using TSM (SAP Library - SAP DB)

 Entering content frame

Background documentation Restrictions for Using TSM

The following SAP DB versions are valid as of the specified build numbers for connecting SAP DB to the external backup tool TSM. The specified SAP DB tools are available.

The database versions listed are valid for each database instance type.

SAP DB Versions and Tools for Backups and Restores with TSM

Version | Build No. | Available SAP DB Tools
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 000 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.3.32 | from 000 | DBMCLI, DBMGUI (for backup only)*
7.3.00 | from 000 | DBMCLI, DBMGUI (for backup only)*
 | from 015 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 000 | DBMCLI, DBMGUI (for backup only)*

* You can use this version of the Database Manager GUI only for creating backups and not for restore purposes. However, if you have installed a newer version of the Database Manager GUI that supports the restore function (7.4.03, for example), you can also restore databases that have an older version (7.2.05, for example), since this database tool is downward compatible.


Restrictions for Creating Parallel Backups and Restores with TSM

 Entering content frame

Procedure documentation Restrictions for Creating Parallel Backups and Restores with TSM

Parallel backups can be performed for data backups (complete and incremental) only.

Parallel backups and restores with TSM can be performed for the following SAP DB versions as of the specified build numbers. The specified SAP DB tools are available.

SAP DB Versions and Tools for Performing Parallel Backups and Restores with TSM

SAP DB version | Build No. | Available SAP DB Tools
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 003 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.3.00 | from 021 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 017 | DBMCLI, DBMGUI


Configuring the TSM Connection (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Configuring the TSM Connection

Use

You configure the SAP DB software with the aim of connecting the SAP DB database tools for saving, restoring, unloading, or loading data to the external backup tool TSM. For this you use the TSM client adint2.

The adint2 program is provided separately by IBM. It is not contained in a standard installation of the TSM client.

Prerequisites

· The version of your SAP DB database system supports the connection of TSM (see: Restrictions for Using TSM).

· You have the TSM client adint2.

Procedure

...

1. If you want to create a parallel backup or restore, check whether the version of your SAP DB database system supports this action (see Restrictions for Creating Parallel Backups and Restores with TSM).

2. Set the environment variables ADINT and ADA_OPT.


Setting the Environment Variables ADINT and ADA_OPT (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting the Environment Variables ADINT and ADA_OPT

Use

So that the Database Manager and the SAP DB Loader on the database host can access the required environment variables ADINT and ADA_OPT, you have to explicitly define them by using the Database Manager.

Environment Variable | Description
ADINT | Specifies the directory in which the program adint2 (UNIX) or adint2.exe (Microsoft Windows) is stored. Specify this directory as an absolute path – without a closing slash (/) or backslash (\).
ADA_OPT | Absolute name of the adint2 configuration file. An example configuration file initSID.utl is located in the directory of the adint2 program.

Syntax

dbmcli -d <database_name> -n <database_server> -u <dbm_user>,<password> dbm_configset -raw <variable> <value>

<variable> | Environment Variable
<value> | Value of the environment variables

See also:

Database Manager CLI , section Changing a Configuration Parameter of the Database Manager


Connecting to NetWorker (SAP Library - SAP DB)

 Entering content frame

Background documentation Connecting to NetWorker

SAP DB supports connections to the external backup tool NetWorker by the company Legato for backing up, restoring, loading, and unloading data after the SAP DB software has been configured accordingly.

Note that there are version-specific restrictions for using NetWorker or for creating parallel backups or restores.

See also:

Restrictions for Using NetWorker

Restrictions for Creating Parallel Backups and Restores with NetWorker

Configuring the NetWorker Connection


Restrictions for Using NetWorker (SAP Library - SAP DB)

 Entering content frame

Background documentation Restrictions for Using NetWorker

The following SAP DB versions are valid as of the specified build numbers for connecting SAP DB to the external backup tool NetWorker by the company Legato. The specified SAP DB tools are available.

The database versions listed are valid for each database instance type.

SAP DB Versions and Tools for Backups and Restores with NetWorker

Version | Build No. | Available SAP DB Tools
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 000 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.3.32 | from 000 | DBMCLI, DBMGUI
7.3.00 | from 005 | DBMCLI, DBMGUI (for backup only)*
 | from 015 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 001 | DBMCLI, DBMGUI (for backup only)*

* You can use this version of the Database Manager GUI only for creating backups and not for restore purposes. However, if you have installed a newer version of the Database Manager GUI that supports the restore function (7.4.03, for example), you can also restore databases that have an older version (7.2.05, for example), since this database tool is downward compatible.

The following NetWorker versions are the minimum required:

Operating System | NetWorker Version
UNIX | 5.5
Microsoft Windows | 5.7


Restrictions for Creating Parallel Backups and Restores with NetWorker

 Entering content frame

Procedure documentation Restrictions for Creating Parallel Backups and Restores with NetWorker

Parallel backups can be performed for data backups (complete and incremental) only.

Parallel backups and restores with NetWorker can be performed for the following SAP DB versions as of the specified build numbers: The specified SAP DB tools are available.

SAP DB Versions and Tools for Performing Parallel Backups and Restores with NetWorker

SAP DB version | Build No. | Parallel Backup and Restore
7.4.03 | from 000 | DBMCLI, DBMGUI
 | from 002 | Also Web DBM
7.4.02 | from 000 | DBMCLI, DBMGUI
 | from 011 | Also Web DBM
7.3.32 | from 000 | DBMCLI, DBMGUI
7.3.00 | from 009 | DBMCLI, DBMGUI (for backup only)*
 | from 015 | DBMCLI, DBMGUI
 | from 025 | Also Web DBM
7.2.05 | from 004 | DBMCLI

* You can use this version of the Database Manager GUI only for creating backups and not for restore purposes. However, if you have installed a newer version of the Database Manager GUI that supports the restore function (7.4.03, for example), you can also restore databases that have an older version (7.2.05, for example), since this database tool is downward compatible.


Configuring the NetWorker Connection (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Configuring the NetWorker Connection

Use

You configure the SAP DB software with the aim of connecting the SAP DB database tools for saving, restoring, unloading, or loading data to the external backup tool NetWorker.

Prerequisites

The version of your SAP DB database system supports the connection of NetWorker (see: Restrictions for Using NetWorker).

Procedure

...

1. If you want to create a parallel backup or restore, check whether the version of your SAP DB database system supports this action (see Restrictions for Creating Parallel Backups and Restores with NetWorker).

2. Set the environment variables NSR_ENV.

3. Create the configuration file for NetWorker.

4. Set the NetWorker parameter Target Sessions for each tape drive to 1. (See the vendor’s documentation.)


Setting the Environment Variables NSR_ENV (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting the Environment Variables NSR_ENV

So that the Database Manager or SAP DB Loader on the database host can access the configuration file for NetWorker, you have to explicitly define the absolute path of the file in the environment variables NSR_ENV by using the Database Manager.

If you do not do this, instead of the configuration file, the system uses the file specified in the following table:

Operating System | File
UNIX | /nsr/sapdb/env
Microsoft Windows | C:\Program Files\nsr\sapdb\env

Syntax

dbmcli -d <database_name> -n <database_server> -u <dbm_user>,<password> dbm_configset -raw <variable> <value>

<variable> | Environment Variable
<value> | Value of the environment variables

See also:

Database Manager CLI , section Changing a Configuration Parameter of the Database Manager


Creating the Configuration File for NetWorker (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating the Configuration File for NetWorker

You configure the SAP DB software with the aim of connecting the SAP DB database tools for saving, restoring, unloading, or loading data to the external backup tool NetWorker.

Procedure

On every line in the configuration file you determine a parameter of the SAP DB adapter program. When you do this, at the beginning of each line you have to specify the keyword for the parameter and then the relevant value(s). Lines that do not begin with keywords are ignored by the system.

Syntax

<key_string> <value_string>

<key_string> | Keyword for a parameter; can consist of one or more words
<value_string> | Value(s) of the parameter

You can define the following parameters for connecting NetWorker to the DBM server program:

Parameter

Syntax

Description

Absolute path of the directory where NetWorker is installed

NSR_HOME <absolute_path>

The NetWorker programs SAVE, MMINFO, and RECOVER are in this directory.

Name of the NetWorker server

NSR_HOST <name>

Name of the NetWorker tape pool

NSR_POOL <name>

If you specify a name, it overwrites the default value for the tape pool that was configured in NetWorker.

Expiration date or period of the backup

NSR_EXPIRE <value>

This value is transferred to the NetWorker program SAVE and overwrites the default value for the date or period that was configured in NetWorker.

See the NetWorker documentation for the allowed entries.

Specifies which of the NetWorker programs SAVE and RECOVER is started with the -v option

NSR_NOTVERBOSE <NONE | SAVE | RECOVER | "SAVE AND RECOVER">

This value is required in case the NetWorker programs do not support the –v option.

NONE: Default value
SAVE and RECOVER are started with the -v option.

SAVE: SAVE is started without and RECOVER is started with the -v option.

RECOVER: SAVE is started with and RECOVER is started without the -v option.

"SAVE AND RECOVER": SAVE and RECOVER are started without the -v option.

Specifies whether the output of the NetWorker program SAVE is analyzed when backups take place

NSR_USEOUTPUT <SAVE | NONE>

SAVE: Default value
The output of SAVE is checked for error messages.

NONE: The output of SAVE is not checked for error messages. Only the return code of SAVE is used. Since SAVE can return the value 0 even if errors occur, do not use NONE.

Error messages of the NetWorker program SAVE that can be ignored

NSR_IGNOREERROR <error_text>

All error messages of the form <pipe_name>:<error_text> are ignored.

Repeat this parameter definition for each error message that can be ignored.

Specifies whether the Database Manager uses (for recoveries) the backup times or the NetWorker save set identifiers

NSR_EBIDTYPE <NSAVETIME | SSID>

NSAVETIME: Default value
Backups are identified by their backup time.
This is the recommended value since no particular authorization is required for the operating system user by the NetWorker program RECOVER.

SSID: Backups are identified using the NetWorker Save Set Identifier.

Waiting time (in seconds) between two SAVE calls during parallel backups

NSR_SAVEINTERVAL <time>

Default value: 60

Name under which you want to save the backup in NetWorker

NSR_BACKUPNAME <name>

Default value: Name of the database instance

Any string of characters, which can contain the placeholders <database_name> and <server_node>. When backing up or restoring with NetWorker, the placeholders are replaced with the name of the database instance or the database server.

Avoiding a NetWorker software error

NSR_AVOIDPSSIDBUG <YES | NO>

A software error in the MMINFO program when using the option -q pssid=0 (PSSIDBUG) is known as of NetWorker 6.0. You can avoid this error by setting this parameter.
 NO: Default value
Calls the NetWorker MMINFO program with the option -q pssid=0
 YES: Avoids the software error in the MMINFO program (only NetWorker versions as of 6.0)

Date format for analyzing the output of the NetWorker program MMINFO

NSR_SAVETIMEFORMAT <mm/dd/yy HH:MM:SS AM | mm/dd/yyyy HH:MM:SS AM>

Required if current default value does not correspond to NetWorker output.

Only one of the possible values can be configured.

mm/dd/yy HH:MM:SS AM: For date output from NetWorker that is more than 8 characters long

mm/dd/yyyy HH:MM:SS AM: For date output from NetWorker that is more than 10 characters long

yy/yyyy year, mm month, dd day, HH hour, MM minute, SS second, AM a.m. or p.m.

Specifies how the size specification for backups transferred with the NetWorker SAVE program is to be used.

NSR_SIZEROUNDUP <NOROUNDUP | FIRSTDECIMAL | NORMAL | LASTINTEGER>

Required if the size that was transferred by SAVE for the backup is rounded off.

This parameter can be used for the following SAP DB versions as of the specified build numbers only: 7.2.05 from build 017, 7.3.00 from build 021, 7.4.03 from build 000.

NOROUNDUP: Default value
The size specification is used unchanged.

FIRSTDECIMAL: The size specification is increased by 0.1 (For example: Backup size 14 GB is used with 14.1 GB).

NORMAL: The size specification is increased by 0.5.

LASTINTEGER: The size specification is increased by 1.

Character string that is used as the value for the MMINFO option –t

NSR_AVOIDTIMEDEBUG <value>

Required if MMINFO from NetWorker does not work without option –t

This parameter can be used for the following SAP DB versions as of the specified build numbers only: 7.2.05 from build 018, 7.3.00 from build 022, 7.4.02 from build 004, 7.4.03 from build 000.

The character string must match the format expected by MMINFO. If the character string consists of multiple words, you have to set them in quotation marks.
Note that backups that are not within the time span specified by the character string are regarded by SAP DB as no longer available for a restore.

See also:

Example of a Configuration File


Example of a Configuration File for NetWorker (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of a Configuration File for NetWorker

Use

You can simplify the creation of the configuration file for NetWorker if you use the following example and adjust it to suit your needs. If you do not want to set a certain parameter by using the parameter file, you have to invalidate or delete the relevant keyword.

File Content

NSR_HOST           p47579
NSR_HOME           "C:\Program Files\nsr\bin"
NSR_POOL           SAPDBPOOL
NSR_EXPIRE         year

NSR_NOTVERBOSE     RECOVER
NSR_EBIDTYPE       NSAVETIME

NSR_USEOUTPUT      SAVE
NSR_IGNOREERROR    "unknown error 109 (0x6d)"
NSR_IGNOREERROR    "using unlocked access"
NSR_IGNOREERROR    "The pipe has been ended.”

NSR_SAVEINTERVAL   60
NSR_BACKUPNAME     SAPDB:<database_name>_on_<node>

NSR_AVOIDPSSIDBUG  YES
NSR_SAVETIMEFORMAT "yyyy/mm/dd HH:MM:SS AM"

Explanation

Keyword | Value | Explanation
NSR_HOST | p47579 | The NetWorker server is running on server p47579.
NSR_HOME | "C:\Program Files\nsr\bin" | The NetWorker client is installed on the database server in the directory C:\Program Files\nsr\bin
NSR_POOL | SAPDBPOOL | Backups are stored in the NetWorker pool SAPDBPOOL.
NSR_EXPIRE | year | The backups have an expiration time of one year.
NSR_NOTVERBOSE | RECOVERY | The NetWorker RECOVER program is run without the -v option.
NSR_EDITTYPE | NSAVETIME | The backup time is used to identify backups.
NSR_USEOUTPUT | SAVE | The output of the NetWorker SAVE program is searched for errors during every backup.
NSR_IGNOREERROR | " unknown error 109 (0x6d)" " using unlocked access" | The messages <pipe_name>: unknown error 109 (0x6d) and <pipe_name>: using unlocked access are ignored for the corresponding pipes.
NSR_SAVEINTERVAL | 60 | The system waits 60 seconds between two SAVE calls during parallel backups.
NSR_BACKUPNAME | SAPDB:<database_name>_on_<node> | If the name of the database instance is DB72, the backups are created with the name SAPDB:DB72_on_p47579 in NetWorker.
NSR_AVOIDPSSIDBUG | YES | The PSSID bug of the NetWorker MMINFO program is avoided (only for NetWorker as of Version 6.0).
NSR_SAVETIMEFORMAT | "yyyy/mm/dd HH:MM:SS AM" | The NetWorker MMINFO program delivers date specifications in the specified format. Example: 2001/12/31 11:59:58 AM


Installation Manual (SAP Library - SAP DB)

 Entering content frame

Component documentation Installation Manual

Purpose

This documentation describes the installation/upgrade and uninstallation of SAP DB software, as well as the upgrade of database instances on operating system platforms supported by SAP DB.

It is particularly concerned with the following programs:

· SDBINST for the installation/update of installation profiles and individual SAP DB software components, while taking into account dependencies between the components

· SDBUNINST for uninstalling SAP DB software components, while taking into account dependencies between the components

· SDBUPD for upgrading database instances and their software

.

For a short description of the standard installation/update, and standard uninstallation, of the entire SAP DB software package outside of SAP systems, see the documentation Database Software Installation Guide.

For general information on the SAP DB database system, see the documentation The SAP DB Database System on the SAP DB Homepage http://www.sapdb.org under Documentation.

The description of upgrading database instances and their software also applies to SAP DB database instances in SAP systems.

Constraints

This documentation is not relevant for installing or uninstalling SAP DB software in SAP systems. The installation or uninstallation of the SAP DB software required for SAP systems is described in SAP-specific guides. SAP customers can find these guidelines in the SAP Service Marketplace, under http://service.sap.com.

Implementation Considerations

The programs SDBINST, SDBUNINST and SDBUPD are part of the SAP DB software.

Open source users can download the entire SAP DB software free of charge from the SAP DB Homepage http://www.sapdb.org under Software, or order a free SAP DB CD-ROM, at the same address.

SAP customers receive the SAP DB software with the SAP installation CD or in the Service Marketplace at http://service.sap.com.

The following description is based on using the software available online on the SAP DB Homepage and the SAP Service Marketplace.

Installing and Updating SAP DB Software

Uninstalling the SAP DB Software

Upgrading Database Instances and Their Software


Installing and Updating SAP DB Software (SAP Library - SAP DB)

 Entering content frame

Background documentation Installing and Updating SAP DB Software

Implementation Considerations

You can install or update SAP DB software either interactively, or in the background.

You can install complete installation profiles, or just install or update individual SAP DB software components. The installation program itself decides whether it is dealing with a new installation or an update.

The system logs the installation process.

Before you start the installation or upgrade of the SAP DB software:

· Make sure you have taken precautions against the most common errors that can cause an installation or update to terminate (Troubleshooting).

· Inform yourself about the advantages and disadvantages of interactive and background installations.

· Decide whether you need one or more database instances.

If you plan to run multiple database instances, we recommend a separate (parallel) software installation for each database instance. This makes subsequent updates easier, since any errors will only affect one database instance.

· Choose an appropriate installation profile, or decide whether, in special cases, you only need to install or update one or more individual SAP SB software components. You can install individual components in the background only.

We recommend that you perform your installation or update with installation profiles. This is a simple and secure way of choosing the SAP DB software installation that meets your needs.

Conventions

See Variables, Supported Operating Systems and Platforms, Authorization Concept for UNIX Operating Systems

Interactive Installation/Update

You install complete installation profiles in an interactive installation or update. The installation program SDBINST queries all necessary information, and offers you defaults and options for the installation profiles and installation paths. The program then installs the software package and registers it.

Background Installation/Update

In a background installation or update, you use options to specify the information needed by SDBINST. The actual installation process then runs in the background.

Advantages of Installation in the Background

· Performing an installation or an upgrade in the background takes less time.

· You have the option of installing or updating individual SAP DB software components (parts of installation profiles).

· You can use an embedding in a call script to generate identical software installations on different servers.

Disadvantages of Installation in the Background

· You must enter all the required options in the call script correctly and completely.

· The system determines some options from the software packages only at runtime. This means that the system cannot check the completeness of the information at the start of the installation. It starts the installation, and then interrupts it only if any information is missing.

Installation/Update with Installation Profiles

You can choose between various combinations of software components. Each individual combination fulfils a different purpose. You choose the installation profile that is appropriate for your needs, and do not need to worry about the sequence of the installation, or any dependencies between software components, to obtain a fully functioning software installation.

To perform a standard installation or update of the entire SAP DB software package, choose the installation profile all.

For a short description of the standard installation or update of the entire SAP DB software package, see the documentation Database Software Installation Guide

Installation/Update of Software Components

You install individual components of the SAP DB software to update parts of your SAP DB software installation. We recommend this installation procedure in special cases only.

In this procedure, you must take into account the dependencies between the individual software components. Otherwise, you see an error message that tells you about this, and the system terminates the installation.

Background Installation of the SAP DB Software Component Precompiler (CPC <version>)

You want to update only the C++ Precompiler in your existing software installation. You start the installation of the software component CPC SDK <version>. The system recognizes that this component requires a new version of the software component CPC Base. You are reminded that the package CPC SDK <version> depends on the package CPC Base, which must be installed first. The installation terminates.

This means that, if there are many dependencies, you would have to restart the installation many times (each time with a different installation package).

You can avoid this problem by using, for example, the installation profile C Precompiler.

Installing/Updating Software on UNIX

Installing/Updating Software on Linux

Installing/Updating Software on Microsoft Windows


Installing/Updating Software on UNIX (SAP Library - SAP DB)

 Entering content frame

Background documentation Installing/Updating Software on UNIX

Use

You are installing or updating a chosen installation profile or SAP DB software component. Use the following procedure for updates only if no database instances refer to the installation path of the software that you want to update.

If database instances refer to the installation path of the software, you must upgrade the database instances together with the software (Upgrading Database Instances and Their Software). Otherwise, you risk making the database instances incompatible with the database software, and you will not be able to restart them.

The system logs the installation process.

Procedure

...

1. First, unpack the SAP DB software to a local directory.

Unpacking the Software on UNIX

2. Now decide whether you want to perform an interactive installation (only possible for installation profiles) or a background installation.

¡ Interactive Installations/Updates on UNIX

¡ Background Installations/Updates on UNIX

For the advantages and disadvantages of these installation procedures, see
Installing and Updating SAP DB Software.


Unpacking the Software on UNIX (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Unpacking the Software on UNIX

Conventions

Variables

Procedure

...

1. Choose the appropriate software package for your operating system architecture, your database instance type, and the installation profile.

If you want to install or update an individual SAP DB software component only, then select an installation profile that contains this software component.

Installation from the SAP Service Marketplace (service.sap.com, for SAP customers only)

¡ For the SAP DB OLTP database instance type, choose
SAP Software ® Download ® SAP Support Packages & Patches ® SAP DB ® SAP DB OLTP 64-BIT ® SAP DB <version> OLTP ® <os> ®
SAPDB<version>_<build>-<GUID>.SAR

¡ For liveCache database instance type (SAP APO system), choose
SAP Software ® Download ® SAP Support Packages & Patches ® SAP APO ® SAP APO <apo_version> ® Binary Patches ® APO LC<version>/LCAPPS<apo_version> ® <os> ®
LC<version>A<apo_version>_<apo_build>-<GUID>.SAR

Installation from the SAP DB Homepage (www.sapdb.org)

¡ For the SAP DB OLTP database instance type only
Go to Software, choose your operating system, and follow the instructions for downloading the software package
SAPDB-<inst_profile>-<os>-64bit-<arch>-<version>_<build>.tgz

2. Copy the software package to a local directory of your choice.

3. Unpack the software with the following command:

For an installation from the SAP Service Marketplace (service.sap.com):

SAPCAR –xvf SAPDB7300_32-<GUID>.SAR

For an installation from the SAP DB Homepage (www.sapdb.org)

tar xvzf sapdb-<inst_profile>-<os>-64bit-<arch>-<version>_<build>

Result

· for SAP DB-OLTP, the subdirectory
 sapdb-<inst_profile>-<os>-64bit-<arch>-<version>

· for SAP DB liveCache, the subdirectory
 sapdb-apo<apo_version>_livecache-<os>-64bit-<arch>-<version>

and saves the software to it.


Interactive Installations/Updates on UNIX (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Interactive Installations/Updates on UNIX

Use

You are using the program SDBINST to install or update installation profiles of the SAP DB software on UNIX. The program queries all necessary information during the installation process.

You must stop the program X Server before you update the database software. Remember that this interrupts the communication between the clients and all local database instances.

Conventions

Variables

Prerequisites

· You are in a root shell.

· You have downloaded the installation package, and unpacked it in a local directory of your choice (Unpacking the Software on UNIX).

Preparations

If the following conditions apply to your system, you must perform the specified steps before a new installation:

· The installation program enters the services sql6, sql30 and sapdb ni 72 in the file /etc/services, if they do not already exist there. If these services are managed centrally for your system on your network (NIS), you must enter them there as follow:
 sql6         7210/tcp
sql30        7200/tcp
sapdbni72    7269/tcp

· When you install the SAP DB software, it must be assigned to a special operating system user (the owner of the software) and to operating system user groups. The group and the owner must have been defined in advance. Only users with the correct authorizations can generate the SAP DB database instances later (see also Authorization Concept for UNIX Operating Systems for software versions from 7.4.04).
If you manage user groups and owners locally on your host, we recommend that you register the names of the user groups and the owner in the operating system before you start the installation. However, you can also specify this information during the installation process.
If you manage user groups and owners for your system centrally in the network, you must create them here before you start the installation. For more information on creating operating system users and user groups, see your operating system documentation.

· If the path <independent_program_path>/bin is not yet entered in the environment variable PATH, enter it now.

Procedure

...

1. If you want to update an existing SAP DB installation,

¡ Stop each SAP DB database instance assigned to the installation directory that you want to update with the command
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

¡ Stop the X Server program ( vserverprocess) with the command
x_server stop

For a new installation, start at step 2.

2. Switch to the directory
sapdb-<inst_profile>-<os>-64bit-<arch>-<version>_<build>,
which contains the installation software for your chosen installation profile.
Enter ./SDBINST to start the installation/update program.

3. The system proposes your chosen installation profile.
If your chosen installation profile (all, for example) contains other installation profiles, you can also select one of these profiles. Specify the appropriate ID. Confirm your selection.

4. If you are installing the software for the first time, or if you are updating the software to Version 7.4.04, then the system prompts you to enter the following details:

¡ the special operating system user <sapdb_user> (the owner of the SAP DB database software)

¡ the administrator group <sapdb_admin>

¡ depending on the selected installation profile, the support group <sapdb_support>

If you are installing or updating older software versions, the system prompts you to enter the group <group> and owner <owner> of the SAP DB database software.

If the groups and owner have already been created, enter and confirm the correct values. The system compares this information with the values stored locally or in the network. If your information does not match these values, then the installation terminates.

If the group and owner have not yet been created, the system asks you whether you want to create them. Specify your chosen values, or confirm the defaults. When you specify these values, the groups and owner are created locally on your host.

5. The system now checks your server for SAP DB installations that can be updated.

It lists any relevant installations.

¡ If you want to update an existing installation, specify its ID.
The system then updates the software in <independent_data_path> and <independent_program_path>. Depending on your chosen profile, the software in <dependent_path> is also updated, if the installation package contains newer versions of the files.

¡ If you want to perform a new installation of the database software in parallel with the existing installation, specify none. You then have the option of specifying a new installation path. Define an installation path in parallel with the existing installation path.

If no SAP DB installation exists yet on your server, the SAP DB components in the installation profile are now installed, one by one. Depending on your chosen installation profile, the system prompts you for the following paths:

¡ Path for saving data, configurations, and run directories of SAP DB database instances and SAP DB applications (system default is /var/opt/sapdb/indep_data)

¡ Path for saving programs and libraries shared by SAP DB database instances and SAP DB applications (system default is /opt/sapdb/indep_prog)

¡ Path for saving the server software that is dependent on the database version.
The specified path must be unique. Multiple directories containing different versions can exist simultaneously (system default is /opt/sapdb/depend)

Specify paths, or confirm the defaults.

6. If there has not been a SAP DB installation on your server up to now, add the entry <independent_program_path>/bin to the environment variable PATH for each user that wants to use SAP DB.

You see a message about the successful completion of the installation.

Result

The chosen installation profile of the SAP DB software has been installed and registered in the new version on your server. You can check the result of your installation using the log (Logging).

You can now create new database instances with the Database Manager

(See:

· Creating a Database Instance in Database Manager CLI or

· the Web DBM documentation.)


Background Installations/Updates on UNIX (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Background Installations/Updates on UNIX

Use

You are using the program SDBINST to install/update installation profiles or individual components of the SAP DB software on UNIX. You specify all required information on the command line, together with the command for starting the installation program.

You must stop the program X Server before you update the database software. Remember that this interrupts the communication between the clients and all local database instances.

Conventions

See Variables

Prerequisites

· You are logged on to your server as the root user.

· You have unpacked the required software (Unpacking the Software on UNIX).

Preparations

If the following conditions apply to your system, you must perform the specified steps before a new installation:

· The installation program enters the services sql6, sql30 and sapdbni72 in the file /etc/services, if they do not already exist there. If these services are managed centrally for your system on your network (NIS), you must enter them there as follow:
 sql6      7210/tcp
sql30     7200/tcp
sapdbni72 7269/tcp

· When you install the SAP DB software, it must be assigned to a special operating system user (the owner of the software) and to operating system user groups. The group and the owner must have been defined in advance. Only users with the correct authorizations can generate the SAP DB database instances later (see also Authorization Concept for UNIX Operating Systems for software versions from 7.4.04).

· If the path <independent_program_path>/bin is not yet entered in the environment variable PATH, enter it now.

Procedure

1. If you want to update an existing SAP DB installation,

¡ Stop each SAP DB database instance assigned to the installation directory that you want to update with the command
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

¡ Stop the X Server program ( vserverprocess) with the command
x_server stop

For a new installation, start at step 2.

2. Start the installation/update process for the SAP DB OLTP software with the following command:
./SDBINST [-b] -profile <inst_profile> [,<inst_profile2>...]| -package <package_name>[,<package_name2>...] -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path> [-o <sapdb_user> -g <sapdb_admin>
[-gs <sapdb_support>]]

Start the installation/update process for the liveCache software (in SAP APO systems only) with the following command:

¡ For the installation profile APO liveCache
./SDBINST [-b] -profile "APO LiveCache" -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path> [-o <sapdb_user> -g <sapdb_admin>
[-gs <sapdb_support>]]

¡ For the SAP DB software component APO LC APPS (from APO Version 4.0) or APO COM
./SDBINST [-b] -package "APO LC APPS" | "APOCOM" -depend <dependent_path>

You only need to specify the special operating system user <sapdb_user> and the groups <sapdb_admin> and <sapdb_support> when you install the software for the first time, or if you are upgrading the software to Version 7.4.04.

You only need to specify <sapdb_support> if you are also installing the database kernel.

If you are installing a software version lower than 7.4.04, then you must specify the owner and the group of the database software with the options –o and -g.

For an explanation of the options, see Overview of the Options for the Program SDBINST.

You must place any names of installation profiles and SAP DB software components that contain blanks in double quotation marks.

For certain installation profiles or SAP DB components you do not need to specify the options –indep_prog, -indep_data and –depend. If you do specify them, the system ignores them. See the overview of the options for more information.

You see a message about the successful completion of the installation.

Result

The software packages are installed and registered. You can check the result of your installation in the log (Logging).

You can now create new database instances with the Database Manager

(See:

· Creating a Database Instance in Database Manager CLI or

· the Web DBM documentation.)


Installing/Updating Software on Linux (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Installing/Updating Software on Linux

Use

You choose a SAP DB software component, and install it.

Use the following procedure for updates only if no database instances refer to the installation path of the software that you want to update.

If database instances refer to the installation path of the software, you must upgrade the database instances together with the software (Upgrading Database Instances and Their Software). Otherwise, you risk making the database instances incompatible with the database software, and you will not be able to restart them.

Two programs are available for installations on Linux:

· Installations/Updates with the Red Hat Package Manager

· Installations/Updates with SDBINST


Installations/Updates with the Red Hat Package Manager (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Installations/Updates with the Red Hat Package Manager

Use

You install or update components of the SAP DB software on Linux. You specify all required information on the command line, together with the command for starting the installation program.

You must take into account the dependencies between the SAP DB components to guarantee that the software installation can function.

If you have already installed SAP DB software on your server with the Red Hat Package Manager (installation with rpm package), then you can now use this program only for subsequent installations and updates.
You cannot use the SDBINST program for installations and updates (installation with tgz package).

Prerequisites

· You are in a root shell.

· You can access the rpm packages that you want to install from your computer.

Procedure

First Installation of the SAP DB Software

...

1. Execute the installation command:
rpm -Uhv sapdb*.rpm

2. Add the entry /opt/sapdb/indep_prog/bin to the environment variable PATH for each user that wants to use SAP DB.

Updating the SAP DB Software

Stop all existing SAP DB software on the server where you want to update the SAP DB software version.

Stop the X Server program ( vserver process). Remember that this interrupts the communication between the clients and all local database instances.

...

1. Stop all SAP DB database instances assigned to the installation directory that you want to update with the command
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

2. Execute the installation command:
rpm -Uhv sapdb*.rpm

Result

The SAP DB software components in the installation directory have been installed and registered in their new version.

You can now create new database instances with the Database Manager

(See:

· Creating a Database Instance in Database Manager CLI or

· the Web DBM documentation.)


Installations/Updates with SDBINST (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Installations/Updates with SDBINST

Use

You install or update components of the SAP DB software on Linux. You specify all required information on the command line, together with the command for starting the installation program.

You must take into account the dependencies between the SAP DB components to guarantee that the software installation can function.

If you have already installed SAP DB software on your server with the Red Hat Package Manager (installation with rpm package), then you can now use this program only for subsequent installations and updates.
You cannot use the SDBINST program for installations and updates (installation with tgz package).

Procedure

Proceed as described under Installing/Updating the Software on UNIX.


Installing/Updating Software on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Background documentation Installing/Updating Software on Microsoft Windows

Use

You install or update a chosen installation profile or SAP DB software component. Use the following procedure for updates only if no database instances refer to the installation path of the software that you want to update.

If database instances refer to the installation path of the software, you must upgrade the database instances together with the software (Upgrading Database Instances and Their Software). Otherwise, you risk making the database instances incompatible with the database software, and you will not be able to restart them.

The system logs the installation process.

Procedure

...

1. First, unpack the SAP DB software to a local directory.

Unpacking the Software on Microsoft Windows

2. Now decide whether you want to perform an interactive installation (only possible for installation profiles) or a background installation.

¡ Interactive Installations/Updates on Microsoft Windows

¡ Background Installations/Updates on Microsoft Windows

For the advantages and disadvantages of these installation procedures, see
Installing and Updating SAP DB Software.


Unpacking the Software on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Unpacking the Software on Microsoft Windows

Conventions

Variables

Procedure

...

...

1. Select the SAP DB software package that is appropriate for your installation profile and operating system architecture.

If you want to install or update an individual SAP DB software component only, then select an installation profile that contains this software component.

Installation from the SAP Service Marketplace (service.sap.com, for SAP customers only)

¡ For the SAP DB OLTP instance type, choose

For the 32 bit version
SAP Software ® Download ® SAP Support Packages & Patches ® SAP DB ® SAP DB OLTP ® SAP DB <version> OLTP ® <os> ®
SAPDB<version>_<build>-<GUID>.SAR

For the 64 bit version
SAP Software ® Download ® SAP Support Packages & Patches ® SAP DB ® SAP DB OLTP 64-BIT ® SAP DB <version> OLTP ® <os> ®
SAPDB<version>_<build>-<GUID>.SAR

¡ For liveCache instance type (SAP APO system), choose
SAP Software ® Download ® SAP Support Packages & Patches ® SAP APO ® SAP APO <apo_version> ® Binary Patches ® APO LC<version>/LCAPPS<apo_version> ® <os> ®
LC<version>A<apo_version>_<apo_build>-<GUID>.SAR

Installation from the SAP DB Homepage (www.sapdb.org)

¡ SAP DB OLTP instance type only
Go to Software, choose your operating system, and follow the instructions for downloading the software package
SAPDB-<inst_profile>-win-<32|64>bit-<arch>-<version>_<build>.zip

2. Copy the software package to a local directory of your choice.

3. Unpack either

¡ a sar package with the program SAPCAR

¡ or a zip package with the program Winzip

to a local directory of your choice.

Result

The system creates the following subdirectories in this local directory

· For SAP DB OLTP software, the subdirectory
 sapdb-<inst_profile>-win-<32|64>bit-<arch>-<version>

· for SAP DB liveCache software, the subdirectory
sapdb-apo<apo_version>_livecache-win-<32|64>bit-<arch>-<version>

and saves the software to them.


Interactive Installations/Updates on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Interactive Installations/Updates on Microsoft Windows

Use

You use the program SDBINST to install/update installation profiles of the SAP DB software on Microsoft Windows. The program queries all necessary information during the installation process.

You must stop the program X Server before you update the database software. Remember that this interrupts the communication between the clients and all local database instances.

Conventions

Variables

Prerequisites

· You have administrator rights for your server.

· You have downloaded and unpacked the installation package (Unpacking the Software on Microsoft Windows).

Procedure

...

1. If you want to update an existing SAP DB installation,

¡ Stop each SAP DB database instance of all installed SAP DB versions with the command
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

¡ Stop the X Server program ( Xserverservice) with the command
x_server stop

For a new installation, start at step 2.

2. Open a command prompt and navigate to the local directory that contains the installation files:

¡ for SAP DB-OLTP software, the directory
 sapdb-<inst_profile>-win-<32|64>bit-<arch>-<version>

¡ for liveCache software, the directory
 sapdb-apo<apo_version>_<livecache>-win-<32|64>bit-<arch>-<version>

3. Enter sdbinst to start the installation/update program.

4. The system proposes your chosen installation profile. If your installation profile contains other installation profiles (all, for example), you can also select one of these profiles. Specify the appropriate ID. Confirm your selection.

5. The system now checks your server for SAP DB installations that can be updated.

It lists any relevant installations.

¡ If you want to update an existing installation, specify its ID.
The system then updates the software in <independent_data_path> and <independent_program_path>. Depending on your chosen profile, the software in <dependent_path> is also updated, if the installation package contains newer versions of the files.

¡ If you want to perform a new installation of the database software in parallel with the existing installation, specify none. You then have the option of specifying a new installation path. Define an installation path in parallel with the existing installation path.

If no SAP DB installation exists yet on your server, the SAP DB components in the installation profile are now installed, one by one. Depending on your chosen installation profile, the system prompts you for the following paths:

¡ Path for saving data, configurations, and run directories of SAP DB database instances and SAP DB applications (system default is C:\Program Files\sapdb\indep_data)

¡ Path for saving programs and libraries shared by SAP DB database instances and SAP DB applications (system default is C:\Program Files\sapdb\indep_prog)

¡ Path for saving the server software that is dependent on the database version.
The specified path must be unique. Multiple directories containing different versions can exist simultaneously (system default is C:\Program Files\sapdb\depend)

Specify paths, or confirm the defaults.

You see a message about the successful completion of the installation.

6. If there has not been a SAP DB installation on your server up to now, we recommend that you shut down your server, and restart it, so that the system can recognize the <independent_program_path>.

This is not necessary if you are updating database software.

Result

The chosen installation profile of the SAP DB software has been installed and registered in its new version. You can check the result of your installation using the log (Logging).

You can create new database instances with the Database Manager

(See:

· Creating or Initializing a Database Instance in Database Manager GUI

· Creating a Database Instance in Database Manager CLI 7.4

· or the Web DBM documentation.)


Background Installations/Updates on Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Background Installations/Updates on Microsoft Windows

Use

You use the program SDBINST to install/update installation profiles or individual components of the SAP DB software on Microsoft Windows. You specify all required information on the command line, together with the command for starting the installation program.

You must stop the program X Server before you update the database software. Remember that this interrupts the communication between the clients and all local database instances.

Conventions

Variables

Prerequisites

· You have administrator rights for your server.

· You have downloaded and unpacked the installation package (Unpacking the Software on Microsoft Windows).

Procedure

1. If you want to update an existing SAP DB installation,

¡ Stop each SAP DB database instance assigned to the installation directory that you want to update with the command
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

¡ Stop the X Server program ( Xserverservice) with the command
x_server stop

For a new installation, start at step 2.

2. Start the installation/update process for the SAP DB OLTP software with the following command:
sdbinst [-b] -profile <inst_profile> [,<inst_profile2>...]| -package <package_name>[,<package_name2>...] -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path>

Start the installation/update process for the liveCache software (in SAP APO systems only) with the following command:

¡ For the installation profile APO liveCache
sdbinst [-b] -profile "APO LiveCache" -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path

¡ For the SAP DB software component APO LC APPS (from APO Version 4.0) or APO COM
sdbinst [-b] -package "APO LC APPS" | "APO COM" -depend <dependent_path>

For an explanation of the options, see Overview of the Options for the Program SDBINST.

You must place any names of installation profiles and SAP DB software components that contain blanks in double quotation marks.

For certain installation profiles or SAP DB components you do not need to specify the options –indep_prog, -indep_data and –depend. If you do specify them, the system ignores them. See the overview of the options for more information.

You see a message about the successful completion of the installation.

Result

The software packages are installed and registered. You can check the result of your installation in the log (Logging).

You can create new database instances with the Database Manager

(See:

· Creating or Initializing a Database Instance in Database Manager GUI

· Creating a Database Instance in Database Manager CLI 7.4

· or the Web DBM documentation.)


Uninstalling the SAP DB Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Uninstalling the SAP DB Software

Implementation Considerations

You use the uninstall program SDBUNINST to uninstall some or all of the SAP DB software components, while taking into account the dependencies between them. It is included in the SAP DB software from Version 7.4.

You can use it to uninstall SAP DB software as of Version 7.2.

Overview of Options for the Program SDBUNINST

For a short description of the standard uninstallation of all the SAP DB software, see the documentation Database Software Installation Guide

Conventions

See Variables, Supported Operating Systems and Platforms

Prerequisites

· One or more SAP DB software versions are installed on your server. These include at least one installation of Version 7.4, which includes SDBUNINST.

· You have administrator rights for your server.

Procedure

...

1. On UNIX/Linux: Switch to the rootshell.

On Microsoft Windows: Open the command prompt on your server.

2. Stop the SAP DB database instances on your server one by one with the command:
dbmcli –d <database_name> -u <dbm_user>,<password> db_offline

3. Delete the SAP DB database instances on your server one by one with the command:
dbmcli –d <database_name> -u <dbm_user>,<password> db_drop

4. Call the uninstall program with your chosen options:

¡ If you want to uninstall all SAP DB software components, specify the option –all; otherwise, specify your chosen component with the option –package.

¡ If there is more than one software package with the same name on your server, specify the option -package_dir in addition to the package name. You can determine the directory of a software package (<package_directory>) with the option -l|-list.

¡ If you want to uninstall a software component that is still needed by another component, specify the option -autoresolve. The system then uninstalls all those software components that are dependent on the specified component.
Otherwise, the uninstall process terminates with the following message:
cannot delete package \"<package>\" (<package_directory>) - other package (s) are dependent

sdbuninst -all | -package <package_name>[-package_dir <package_directory>] [-autoresolve]

5. Start the uninstallation by entering y.

The specified SAP DB software components are uninstalled. At the same time, the system checks the dependencies between the components.

If the name of the specified software package is not unique, the system shows you a list of packages with the same name. Choose a package ID and confirm.

You see a message about the successful completion of the uninstallation.

Result

The specified SAP DB software component is uninstalled, along with all dependent components.


Upgrading Database Instances and Their Software (SAP Library - SAP DB)

 Entering content frame

Background documentation Upgrading Database Instances and Their Software

Implementation Considerations

You upgrade database instances from one version to another, and update their database software at the same time. The following information refers to this procedure as an upgrade.

The strategy you choose depends on the database instance type and the source and target versions. For help on choosing a suitable upgrade strategy, see the tables under Selection of the Upgrade Strategy.

Each time you upgrade database instances, we recommend that you watch out for any errors. Make sure that you have made complete backups of all data in the relevant database instances, and also have the database software of the source version. Only then can you return to the source version straight away, if necessary, and avoid long periods of system downtime.

Before you start, make sure that you have taken precautions against the most common sources of errors in the upgrade (Troubleshooting).

Whenever possible, use the SDBUPD program to perform the upgrade. This program gives you comprehensive support for an upgrade without problems. However, you can only use it if you fulfill certain prerequisites. Otherwise, you must use a different upgrade strategy.

Prerequisites for Using SDBUPD

SAP customers can use the program SDBUPD for upgrading database instances in SAP systems. The SDBUPD program makes all required checks during the upgrade process.

You can also use this program to upgrade database instances that are not part of an SAP system. To do this, however, the following prerequisites must be fulfilled:

· The program SDBINST was used to install the existing software.

· Each of the existing database instances refers to a separate software installation.

Conventions

See Variables, Supported Operating Systems and Platforms


Selection of the Upgrade Strategy (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Selection of the Upgrade Strategy

Procedure

Select an upgrade strategy that is appropriate to the instance type of the database instance, and the source and target versions of the database software. Proceed as described for your chosen upgrade strategy.

If your database instance fulfills the necessary prerequisites, we recommend that you use the program SDBUPD, since an upgrade with this program removes the need for most of the user interaction, and is quicker and safer.

Update Strategies for SAP DB OLTP Database Instances

 | Target Version 7.3
Source Version 7.3 | Patch Installation with SDBUPD or* Patch Installation with SDBINST

 | Target Version 7.4.03 | Target Version 7.4.04
Source Version from 7.3.00 Build 025 | In-Place Migration with SDBUPD or* In-Place Migration with SDBINST | In-Place Migration with SDBUPD or* In-Place Migration with SDBINST
Source Version 7.4.03 | Patch Installation with SDBUPD or* Patch Installation with SDBINST | Proceed as described in Patch Installation with SDBUPD or* Patch Installation with SDBINST.
Source Version 7.4.04 | not possible | Patch Installation with SDBUPD or* Patch Installation with SDBINST

* Use the SDBUPD program if your database instance is part of an SAP system.
In special cases, you can use SDBUPD even if the database instance is not part of an SAP system. See Prerequisites for Using SDBUPD under Upgrading Database Instances and Their Software.

Update Strategies for liveCache Database Instances

 | Target Version 7.4.02/30A | Target Version 7.4.02/310 | Target Version 7.4.03/400 | Target Version 7.4.04/410
Source Version 7.2.05/30A | Upgrade with Backup and Recovery | Upgrade with APO Extract/Load | Upgrade with APO Extract/Load | Upgrade with APO Extract/Load
Source Version 7.4.02/30A | Patch Installation with SDBUPD | Upgrade with APO Extract/Load | Upgrade with APO Extract/Load | Upgrade with APO Extract/Load
Source Version 7.4.02/310 | not possible | Patch Installation with SDBUPD | Upgrade with APO Extract/Load | Upgrade with APO Extract/Load
Source Version 7.4.03/400 | not possible | not possible | Patch Installation with SDBUPD | Upgrade with APO Extract/Load
Source Version 7.4.04/410 | not possible | not possible | not possible | Patch Installation with SDBUPD


Patch Installation with SDBUPD (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Patch Installation with SDBUPD

Use

You use the program SDBUPD to upgrade the database instance. This substitutes the SAP DB software only.

You can use this procedure if only the build number of the version has changed between the source and target version, and also for upgrades from 7.4.03 to 7.4.04 (see also Selection of the Upgrade Strategy).

You use this upgrade strategy if your database instance is part of an SAP system.

You can use this procedure even if the database instance is not combined with an SAP system. To do this, however, the following prerequisites must be fulfilled:

· The program SDBINST was used to install the existing software (that is, with a tgz package or a zip file, and not an rpm package)

· Each database instance refers to a separate software installation.

There can not be any remote communication between the database instances and applications during the upgrade, since the X Server software may need to be substituted, depending on the source and target version of the upgrade. Therefore, stop all database instances, so that SDBUPD can stop any X Servers that are still running. Alternatively, you can stop the X Server program yourself, before the upgrade.

Prerequisites

Before you start upgrading a database instance, make sure that you have up-to-date log backups and/or data backups for recovering this database instance in the event of errors.

The database parameters of the database instance you want to upgrade must not have been changed since the last restart.

· The database instance that you want to upgrade is the only instance that refers to the installation path of the software you want to update.

· The database instances is in one of the three defined operational states, which means that there are no errors.

· You have stopped all database instances, or, alternatively, the X Server program.

Procedure

...

Start the SDBUPD program with the following command:

UNIX, Linux:

Microsoft Windows:

./SDBUPD –d <database_name> -u <dbm_user>,<password>
[-o <sapdb_user>
-g <sapdb_admin>
-gs <sapdb_support>]

sdbupd –d <database_name> -u <dbm_user>,<password>

You only need to specify the special operating system user <sapdb_user>, the administrator group <sapdb_admin>, and the support group <sapdb_support> (according to the Authorization Concept for UNIX Operating Systems) if you are upgrading to software version 7.4.04.

SDBUPD performs the upgrade, and displays a success message if the upgrade is completed successfully. It then flags the installation as complete.

Result

The database instance and its software have been upgraded.

If you have upgraded a liveCache database instance, it is now in the operational state OFFLINE.

If you have upgraded a SAP DB OLTP database instance, it is now in the operational state ONLINE.


Patch Installation with SDBINST and Follow-Up Actions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Patch Installation with SDBINST and Follow-Up Actions

Use

You use the program SDBINST to upgrade database instances. This substitutes the SAP DB software only. You must then perform the necessary follow-up actions in the command line with the Database Manager CLI.

This upgrade strategy is valid for database instances of the type SAP DB OLTP only (Selection of the Upgrade Strategy). It is valid for all supported operating system platforms.

Prerequisites

Before you start the upgrade process, make sure that you have up-to-date log backups and/or data backups for recovering the database instances in the event of errors.

· All database instances that you want to upgrade refer to the same software installation.

Procedure

...

1. Stop the X Server.

x_server stop

2. On UNIX/Linux, stop the database instances that you want to upgrade.
On Microsoft Windows, stop all database instances.

To do this, execute the following commands for logging on to the Database Manager CLI, stopping the database instance, and exiting the Database Manager CLI for each database instance in the order that you want to upgrade the instances:

dbmcli –d <database_name> -u <dbm_user>, <password> db_offline

exit | release | quit | bye

3. Start the SDBINST program with the options for installing the installation profile Server. Make sure that, for the <dependent_path>, you enter the correct software installation path of the database instance or instances that you want to upgrade.

UNIX/Linux:

Microsoft Windows:

./SDBINST [-b] -profile server -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path>
[-o <sapdb_user> -g <sapdb_admin>
[-gs <sapdb_support>]]

sdbinst [-b] -profile server -indep_data <independent_data_path> -indep_prog <independent_program_path> -depend <dependent_path>

When you upgrade the software to Version 7.4.04, specify the special operating system user <sapdb_user>, and the groups <sapdb_admin> and <sapdb_support> according to the authorization concept for UNIX operating systems.

If you are upgrading the software to a version lower than 7.4.04, then use the options –o and -g to specify the owner and group of the database software.

4. Start the X Server with the following command:

x_server start

5. Log on to each of the database instances in sequence as the DBM operator, and perform the specified actions:

Procedure

Command

...

1.

Log on to the Database Manager CLI with the data of the database instance that you want to upgrade.

dbmcli –d <database_name> -u <dbm_user>, <password>

2.

Upgrade the software version of the database instance.

db_register

3.

Upgrade the parameters of the database instance.

param_checkall

4.

If you are upgrading to database version 7.4.04 on a UNIX operating system, then perform the following steps:

a. Log off from the Database Manager CLI.

b. Call the program chvolperm. This program changes the owner, group, and access rights to the volumes of the database instance according to the authorization concept for UNIX operating systems.

c. Log on to the Database Manager CLI again.

exit | release | quit | bye

<dependent_path>/bin/chvolperm <database_name>

dbmcli –d <database_name> -u <dbm_user>, <password>

5.

Transfer the database instance to the operational state WARM (up to Version 7.3) or ONLINE (from Version 7.4).

db_online | db_warm

6.

Load the system tables.

You see a message about the successful completion of the procedure.

load_systab

7.

Exit the Database Manager CLI.

exit | release | quit | bye

Result

The specified OLTP database instance and its software have been updated.

It is in the operational state ONLINE.


In-Place Migration with SDBUPD (SAP Library - SAP DB)

 Entering content frame

Procedure documentation In-Place Migration with SDBUPD

Use

You use the program SDBUPD to upgrade the database instance.

The source version of the database software is Version 7.3 Build 025 or higher, the target version is 7.4.03 or higher (Selection of the Upgrade Strategy).

Use this procedure if the database instance is part of an SAP system.

This upgrade strategy is valid for database instances of the type SAP DB OLTP only. It is valid for all supported operating system platforms.

There can not be any remote communication between the database instances and applications during the upgrade, since the X Server software may need to be substituted, depending on the source and target version of the upgrade. Therefore, stop all database instances, so that SDBUPD can stop any X Servers that are still running. Alternatively, you can stop the X Server program yourself, before the upgrade.

Prerequisites

· The database instance you want to upgrade is part of an SAP system.

· The database instance is in the operational state ONLINE.

· The database instance is the only instance that refers to the installation path of the software version you want to update.

· The database parameters of the database instance you want to upgrade have not changed since the last restart.

Procedure

Description

Command

1.

Call the Database Manager CLI as the DBM operator and connect to the database instance.

dbmcli –d <database_name> -u <dbm_user>,<password>

2.

Transfer the database instance to the operational state OFFLINE.

db_offline

3.

Transfer the database instance to the operational state COLD (up to Version 7.3) or ADMIN (from Version 7.4).

db_cold | db_admin

4.

If you have a newer data backup, make an incremental data backup and a log backup. Otherwise, make a complete data backup (see Backing Up the Database Instance).

backup_start <medium> [<type>] [AUTOIGNORE]

5.

Exit the Database Manager CLI.

exit | release | quit | bye

6.

Stop the X Server.

x_server stop

7.

Start SDBUPD.

SDBUPD performs the upgrade, and displays a success message if completed successfully. It then flags the installation as complete.

The execution of this command can take a long time. Never terminate it. If you do, you risk losing all your data. Your only option in this event is to use data backups to go back to the state of the database instance that is stored in these backups.

UNIX/Linux:

./SDBUPD –d <database_name> -u <dbm_user>,<password>
[-o <sapdb_user>
-g <sapdb_admin>
-gs <sapdb_support>]

You only need to specify the special operating system user <sapdb_user>, the administrator group <sapdb_admin>, and the support group <sapdb_support> (according to the Authorization Concept for UNIX Operating Systems) if you are upgrading to software version 7.4.04.

Microsoft Windows:

sdbupd –d <database_name> -u <dbm_user>,<password>

Result

The specified OLTP database instance and its software has been updated.

The database instance is in the operational state ONLINE.


In-Place Migration with SDBINST and Follow-Up Actions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation In-Place Migration with SDBINST and Follow-Up Actions

Use

You use the program SDBINST to upgrade database instances. First you install the new version of the SAP DB software. Then you migrate the database instance(s).

The source version of the database software is Version 7.3.00 Build 025 or higher, the target version is 7.4.03 or higher (see also Selection of the Upgrade Strategy).

Use this procedure for database systems that are not part of an SAP system, particularly if multiple database instances refer to the same installation path.

This upgrade strategy is valid for database instances of the type SAP DB OLTP only. It is valid for all supported operating system platforms.

Prerequisites

· The database instance you want to upgrade is not part of an SAP system.

· You have a backup medium for a complete data backup.

Procedure

To guarantee the security of your data if any errors occur in the migration, we recommend that you make a complete data backup of the instance in step 6, in the operational state COLD. This causes downtime because the database instance has to stop. However, in the event of an error, the resulting data backup can be used to recover the database instance in both Version 7.3 and Version 7.4.

Alternatively, you can make a complete data backup in the operational state WARM before you start the migration. However, in the event of an error, you can use this backup to recover a Version 7.3 database instance only. Therefore, it is not equivalent to a data backup in the operational state COLD during the migration process.

...

1. Install Version 7.4 of the software with SDBINST ( zip file or tgz package) in the installation path <dependent_path><7.4> in parallel with Version 7.3.

or

Install Version 7.4 with the Red Hat Package Manager ( rpm package).

If you have installed the SAP DB Version 7.3 on your server with the Red Hat Package Manager, you can now perform subsequent installations with this program only. You can not use the SDBINST program for subsequent installations.

2. Perform the following migration steps for each of your database instances with Version 7.3.

Procedure

Command

...

1.

Call the Database Manager CLI as the DBM operator and connect to the database instance that you want to migrate.

dbmcli –d <database_name> -u <dbm_user>,<password>

2.

Stop the database instance correctly

Use the command db_offline and not db_stop. This is the only way of making sure you can restart the database instance if an error occurs.

db_offline

3.

Transfer the database instance to the operational state COLD.

db_cold

4.

Execute the command that prepares the migration.

util_execute migrate

5.

Open a utility session.

util_connect

6.

Make a complete data backup in the operational state COLD.

backup_start <medium>

7.

Exit the utility session.

util_release

8.

Transfer the database instance to the operational state OFFLINE.

db_offline

9.

UNIX:

Assign the database instance to Version 7.4 of the software.

Microsoft Windows:

Delete the registration of the database instance. Use Version 7.4 of the DBMCLI software to recreate the database instance.

UNIX:

db_register –R <dependent_path><7.4>

Microsoft Windows:

db_drop WITHOUTFILES

10.

Exit the Database Manager CLI.

exit | release | quit | bye

11.

Log on to the Database Manager CLI again.
You connect to Version 7.4 of the DBM server. Previously, you communicated with Version 7.3 of the DBM server.

dbmcli –d <database_name> -u <dbm_user>,<password>

12.

Start the migration of the database parameters.

param_checkall

13.

If you are upgrading to database version 7.4.04 on a UNIX operating system, then perform the following steps:

a. Log off from the Database Manager CLI.

b. Call the program chvolperm. This program changes the owner, group, and access rights to the volumes of the database instance according to the authorization concept for UNIX operating systems.

c. Log on to the Database Manager CLI again.

exit | release | quit | bye

<dependent_path>/bin/chvolperm <database_name>

dbmcli –d <database_name> -u <dbm_user>, <password>

14.

Transfer the database instance to the operational state ADMIN.

db_admin

15.

Execute the migration command.

The execution of this command may take some time, depending on the size of the database instance. Do not terminate it.

util_execute migrate database

16.

Transfer the database instance to the operational state OFFLINE.

db_offline

17.

Restart the database instance. The database catalog migrates from 7.3 to 7.4.

db_online

18.

Reload the system tables.

You see a message about the successful completion of the procedure.

load_systab

Result

You have migrated your database instance from Version 7.3 of the software to Version 7.4.

It is in the operational state ONLINE.


Upgrade with Backup and Recovery (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Upgrade with Backup and Recovery

Use

You use the program SDBUPD to upgrade the database instance. First you make a complete data backup for the database instance that you want to upgrade. Then you use the SDBUPD program to substitute the software.

You use this upgrade strategy if your database instance is part of an SAP system. This strategy is currently valid only for the instance type liveCache in the SAP APO system, when you are changing the version of the database software without changing the APO release (Selection of the Upgrade Strategy).

It is valid for all supported operating system platforms.

There can not be any remote communication between the database instances and applications during the upgrade, since the X Server software may need to be substituted, depending on the source and target version of the upgrade. Therefore, stop all database instances, so that SDBUPD can stop any X Servers that are still running. Alternatively, you can stop the X Server program yourself, before the upgrade.

Prerequisites

· You have stopped all database instances, or, alternatively, the X Server program ( Xserver service).

· The database parameters of the database instance you want to upgrade have not changed since the last restart.

· You have made a complete data backup in the operational state COLD (up to Version 7.3) or ADMIN (from Version 7.4), and have not transferred the database instance to the operational state ONLINE.

Procedure

...

1. Start the SDBUPD program with the following command:

UNIX, Linux:

Microsoft Windows:

./SDBUPD –d <database_name> -u <dbm_user>,<password>
[-o <sapdb_user>
-g <sapdb_admin>
-gs <sapdb_support>]

sdbupd –d <database_name> -u <dbm_user>,<password>

You only need to specify the special operating system user <sapdb_user>, the administrator group <sapdb_admin>, and the support group <sapdb_support> (according to the Authorization Concept for UNIX Operating Systems) if you are upgrading to software version 7.4.04.

SDBUPD updates the software. You see a message about the successful installation of the software, and you are prompted to recover the database instance from the backup.

2. Log on to the Database Manager CLI with the data from the database instance that you want to recover, and start the database instance recovery.

3. Exit the Database Manager CLI with the command
exit | release | quit | bye.

4. Restart the SDBUPD program with the following command:

UNIX, Linux: | Microsoft Windows:
./SDBUPD –d <database_name> -u <dbm_user>,<password> | sdbupd –d <database_name> -u <dbm_user>,<password>

SDBUPD loads the system tables, and displays a success message if completed successfully. It then flags the installation as complete.

5. Now start liveCache, so that the system can update it ( Structure link Starting liveCache).

Result

The specified liveCache database instance in the SAP APO system and its software have been upgraded.

liveCache is in the operational state ONLINE.


Upgrade with APO Extract/Load (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Upgrade with APO Extract/Load

Use

You use the SDBUPD program for an upgrade with APO Extract/Load. You must first back up the transaction data of the application system from the liveCache database instance to the APO database, and then substitute the software (Selection of the Upgrade Strategy).

This procedure is currently valid only for the instance type liveCache in the SAP APO system. It is valid for all operating system platforms supported by SAP DB.

There cannot be any remote communication between the database instances and applications during the upgrade, since the X Server software may need to be substituted, depending on the source and target version of the upgrade. Therefore, stop all database instances, so that SDBUPD can stop any X Servers that are still running. Alternatively, you can stop the X Server program yourself, before the upgrade.

Prerequisites

· You have backed up the liveCache transactions to the APO database.

SAP customers can find information on this in the Service Marketplace under http://service.sap.com/instguides ® Installation ® Installation & Upgrade Guides ® mySAP SCM ® Using SAP APO 3.1SR1... ® Upgrade Information ® Upgrade for SAP APO 3.1: SAP liveCache 7.4 ® Upgrade Preparations.

· You have stopped all database instances, or, alternatively, the X Server program as well.

· The database parameters of the database instance you want to upgrade have not changed since the last restart.

· The database instance can be in any operational state.

Procedure

...

1. Start the SDBUPD program with the following command:

UNIX, Linux:

Microsoft Windows:

./SDBUPD –d <database_name> -u <dbm_user>,<password>
[-o <sapdb_user>
-g <sapdb_admin>
-gs <sapdb_support>]

sdbupd –d <database_name> -u <dbm_user>,<password>

You only need to specify the special operating system user <sapdb_user>, the administrator group <sapdb_admin>, and the support group <sapdb_support> (according to the Authorization Concept for UNIX Operating Systems) if you are upgrading to software version 7.4.04.

2. SDBUPD performs the upgrade, and displays a success message if completed successfully. You are prompted to start liveCache.

3. Start liveCache ( Structure link Starting liveCache).

4. Recover the data from the APO system to liveCache (see the above link to Upgrade for SAP APO 3.1: SAP liveCache 7.4.).

Result

The specified liveCache database instance in the SAP APO system and its software have been upgraded.

liveCache is in the operational state ONLINE.


Authorization Concept for UNIX Operating Systems (SAP Library - SAP DB)

 Entering content frame

Background documentation Authorization Concept for UNIX Operating Systems

Use

To protect the execution of SAP DB programs and the access to database files, the SAP DB software package contains a preconfigured authorization concept as of Version 7.4.04. This concept applies to both installations within SAP systems, and to open source installations.

The concept includes a special operating system user, <sapdb_user>, and two operating system user groups, <sapdb_admin> and <sapdb_support>, which have different levels of authorization.

If you manage operating system users and user groups locally on your host, we recommend that you register the names of the special operating system user and the user groups in the operating system before you start the installation. However, you can also do this during the installation process.

If you manage operating system users and user groups for your system centrally in the network, you must create them here before you start the installation.

For more information on creating operating system users and user groups, see your operating system documentation.

Special Operating System User

The special operating system user is the owner of all the SAP DB software and database processes, which also makes this user the owner of, for example, the volumes, database trace, and the log files. This user is created once on a server when the SAP DB software is installed for the first time. The system default for the user name is sapdb.

The special operating system user is a member of the administrator group, and does not log on to the operating system interactively.

This special operating system user cannot have the authorization to log on to the operating system interactively.

Administrator Group

The programs and libraries used by both the SAP DB database instances and SAP DB applications are assigned to the administrator group once when the software is installed. The system default for the name of the administrator group is sapdb.

Operating system users who belong to this group have access to the log files. These users can manage all database instances that refer to this software installation, as well as execute the required programs (such as the Database Manager).

Support Group

When the database kernel is installed, the support group is assigned to the server software that is dependent on the database version. This means that you can create a different support group for each installed database kernel. The system default for the name of the first support group is sapdbsupport.

The support group must include those users who need direct access to the volumes of SAP DB database instances, to perform diagnoses, for example.

The authorizations of the administrator group are enough for normal database operations. Only add users to the support group if you need to perform detailed diagnoses for support purposes.


Troubleshooting (SAP Library - SAP DB)

 Entering content frame

Background documentation Troubleshooting

When you install or update your database software, or when you upgrade database instances and their software, you can sometimes experience errors that cause the program to terminate. In the event of these errors, you can use the available programs, your data backups, and the source version software to return temporarily to the original version. This gives you time for troubleshooting, and keeps downtime as short as possible.

Never delete installed files from the file system manually. Even in the event of terminated installations, use only the program SDBUNINST for uninstalling software. Otherwise, unexpected problems may occur in your next installation or upgrade.

Errors in the Execution of the Program SDBINST

Errors in the Execution of the Program SDBUPD


Errors in the Execution of the Program SDBINST (SAP Library - SAP DB)

 Entering content frame

Background documentation Errors in the Execution of the Program SDBINST

If errors occur when you execute the program SDBINST, the program terminates with a message about the cause of the error.

Frequent Causes of Errors

...

1. Files of the software you want to update are still being used.

¡ Administration sessions are still running, which means that the Database Manager CLI is still active.

¡ Applications that use SAP DB Runtime or SAP DB Scripting Interfaces are still running.

2. There is not enough disk space for the new software.

3. You have attempted to update a 64 bit database kernel with software for a 32 bit kernel. This is not possible.

4. You are attempting to update the software with SDBINST. However, you are ignoring the dependencies regarding the installation order and the versions of SAP DB software components.

User Action

Remove the cause of the error and execute the program again.


Errors in the Execution of the Program SDBUPD (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Errors in the Execution of the Program SDBUPD

If errors occur when you execute the program SDBUPD, the program terminates with a message about the cause of the error.

Frequent Causes of Errors

...

1. An unexpected error occurred when you executed SDBUPD.

2. You are attempting to use SDBUPD to switch to a software version that is lower than your current version (in the following called a downgrade). Examples of this situation:

¡ You have selected the wrong software version by mistake.

¡ The upgrade of the database instance terminated with an error. You then tried to use SDBUPD to return to the original software version.

¡ The database instance upgrade was successful, however, you want to return to a lower software version for other reasons.

You cannot use SDBUPD to downgrade software. If you want to use SDBUPD, the new software must have at least a higher build number (SAP DB Version Notation).

User Action

Proceed as follows in each case.

Case 1:

No database instances exist that refer to a higher software version.

Case 2:

Database instances exist that refer to a higher software version. You want to downgrade the software that is used exclusively by the database instance (Dependent Software).

Case 3:

Database instances exist that refer to a higher software version. You want to downgrade the software that is not used by the database instance, or whose version is not relevant for the database instance (Independent Software).


Case 1: No database instances exist yet (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Case 1: No database instances exist yet

Use

No database instances exist that refer to a higher software version.

Procedure

Either uninstall the entire SAP DB software with SDBUNINST

or

uninstall only those SAP DB software components that you want to install in a lower version. Take into account the dependencies between the components.

Uninstalling the SAP DB Software


Case 2: Downgrade for Dependent Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Case 2: Downgrade for Dependent Software

Use

Database instances exist that refer to a higher software version. You want to downgrade the software that is used exclusively by the database instance (Dependent Software).

If you want to use this procedure in SAP systems, do not accept the system defaults. Specify the following settings instead:

<group> | sapsys
<owner> | For SAP DB OLTP database instances: sqdsid For liveCache database instances: sidadm
<independent_data_path> | UNIX/Linux: /sapdb/data Microsoft Windows: <drive>:\sapdb\data
<independent_program_path> | UNIX/Linux: /sapdb/programs Microsoft Windows: <drive>:\sapdb\programs
<dependent_path> | UNIX/Linux: /sapdb/<SID>/db Microsoft Windows: <drive>:\sapdb\<SID>\db

Procedure

Delete the existing database instances before a downgrade.

· If you want to perform the downgrade at build level only, there will be no incompatibilities between the database instances of the higher version and the software of the lower version you want to install. Proceed as follows for each database instance:

Procedure

Command

...

1.

Call the Database Manager CLI as the DBM user and connect to the database instance.

dbmcli –d <database_name> -u <dbm_user>,<password>

2.

Delete the registration of the database instance.

db_drop WITHOUTFILES

3.

Exit the Database Manager CLI.

exit | release | quit | bye

4.

Uninstall at least the database kernel and the chosen SAP DB software component(s) with the higher version.

sdbuninst –package "Database Kernel" [, <package_name2>…]

5.

Install your chosen installation profile with the lower version (for SAP DB-OLTP database instances at least Server, for liveCache database instances at least APO liveCache).

sdbinst –profile Server | "APO LiveCache" [, <inst_profile2>…]

6.

Register the database instance again. Enter the name and DBM user of the old database instance, and the path of the newly installed lower software version.

Unix/Linux:

<dependent_path>\bin
\dbmcli –s –R <dependent_path> db_create <database_name> -u <dbm_user>,<password>

Microsoft Windows:

"<dependent_path>\pgm
\dbmcli" –s –R "<dependent_path>" db_create <database_name> -u <dbm_user>,<password>

· If the downgrade is combined with a change of version (minor or major release, see also: SAP DB Version Notation) of the database software, proceed as follows:

 | Procedure | Command
 | Call the Database Manager CLI as the DBM user and connect to the database instance. | dbmcli –d <database_name> -u <dbm_user>,<password>
1. | Delete the database instance | db_drop
2. | Exit the Database Manager CLI. | exit | release | quit | bye
3. | Uninstall at least the database kernel and the chosen SAP DB software component(s) with the higher version. | sdbuninst –package "Database Kernel" [, <package_name2>…]
4. | Install your chosen installation profile with the lower version (for SAP DB-OLTP database instances at least Server, for liveCache database instances at least APO liveCache). | sdbinst –profile Server | "APO LiveCache" [, <inst_profile2>…]
5. | Start the Database Manager GUI. Use the Database Wizard to install a new database instance by using the parameter file from a backup. | Choose Instance ® Install. Follow the instructions for creating or initializing a database instance. For the new database instance, specify the database administrator that is saved in the backup parameter file.
6. | Exit the Database Manager GUI. | Choose File ® Exit.


Case 3: Downgrade for Independent Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Case 3: Downgrade for Independent Software

Use

Database instances exist that refer to a higher software version. You want to downgrade the software that is not used by the database instance, or whose version is not relevant for the database instance (Independent Software).

If you want to use this procedure in SAP systems, do not accept the system defaults. Specify the following settings instead:

<group> | sapsys
<owner> | For SAP DB OLTP database instances: sqdsid For liveCache database instances: sidadm
<independent_data_path> | UNIX/Linux: /sapdb/data Microsoft Windows: <drive>:\sapdb\data
<independent_program_path> | UNIX/Linux: /sapdb/programs Microsoft Windows: <drive>:\sapdb\programs
<dependent_path> | UNIX/Linux: /sapdb/<SIS>/db Microsoft Windows: <drive>:\sapdb\<SID>\db

Procedure

 | Action | Command
... 1. | Uninstall at least the database kernel and the chosen SAP DB software component(s) with the higher version. | sdbuninst –package "Database Kernel" [, <package_name2>…]
2. | Install your chosen installation profile with the lower version (for SAP DB-OLTP database instances at least Server, for liveCache database instances at least APO liveCache). | sdbinst –profile Server | "APO LiveCache" [, <inst_profile2>…]


Detailed Information (SAP Library - SAP DB)

 Entering content frame

Background documentation Detailed Information

Installation Profiles

SAP DB Software Components

Logging

Overview of Options for the Program SDBINST

Overview of Options for the Program SDBUNINST

Overview of Options for the Program SDBUPD


Installation Profiles (SAP Library - SAP DB)

 Entering content frame

Background documentation Installation Profiles

Installation profiles are different combinations of individual SAP DB software components, which meet different requirements. An installation profile provides you with a fully functioning software installation, regardless of which profile you choose.

If you install individual SAP DB software components (parts of installation profiles), you must take into account the dependencies between the components to guarantee that the software installation can function.

Choose from the following installation profiles:

Name | Included SAP Software Components | Installation/Update of
all | All SAP DB software components | Complete SAP DB software package
Server | Base, multiple PCR <version>, server utilities, ODBC, DB Analyzer, database kernel | Server software and client software of the OLTP database system
Web Tools | Base, ODBC, Web Tools | SAP DB Web Tools
DB Analyzer | Base, ODBC (for MS Windows only), DB Analyzer | Database Analyzer
Runtime for SAP AS | Base, multiple PCR <version> | Client software for the SAP application server
APO LiveCache | For liveCache in the SAP APO system only Base, multiple PCR <version>, Server Utilities, ODBC (MS Windows only), DB Analyzer, Database Kernel, APO LC APPS or APO COM (up to APO Version 4.0) | Server software and client software of the liveCache database system
C Precompiler | Base, multiple PCR <version>, CPC Base, CPC SDK <version> | Software required for developing precompiler applications
Script Interface | Base, Perl Interface, Python Interface | Runtimes for applications that user SAP DB Script Interfaces

You must place any names of software components that contain blanks in double quotation marks.


SAP DB Software Components (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Software Components

Use

You are installing installation packages that contain only individual SAP DB software components. You can do this to install missing components without having to update components that you do not need.

The installation of software components is more complex than the installation of installation profiles, and demands that the user understands and takes into account the dependencies that exist between the content or versions of the software.

Since this installation is not interactive and can run in the background only, you must in advance determine any other components you need to install first, and in which order. The installation program terminates the installation as soon as it recognizes that a dependency has been ignored. For this reason, use this installation type in special cases only.

The SAP DB software is divided into the following components:

Name | Description
Base | Programs for registering the installation, uninstallation tool, InstallRegistryViewer, and programs that the SAP application server needs to access the SAP DB Database System
PCR<version> | SAP DB Precompiler Runtime Package Contains runtime libraries for applications created with the SAP DB C/C++ Precompiler for Embedded SQL Can exist in multiple versions in the local installation directory
Server Utilities | Tools for administering the database kernel
Database Kernel | Database kernel with runtime environment
CPC Base | C++ Precompiler base (call programs for the precompiler)
CPC SDK <version> | C++ Precompiler
ODBC | SAP DB ODBC driver
DB Analyzer | Database Analyzer: Tool for analyzing database performance
Web Tools | Web-based database tools
Python Interface | Python interface
Perl Interface | Perl interface
APO LC APPS (from APO Version 4.0) or APO COM | For liveCache in the SAP APO system only: Libraries with APO liveCache routines

You must place any names of software components that contain blanks in double quotation marks.

Dependencies

The following dependencies exist between SAP DB software components:

Base ® PCR <version>
Base ®Server Utilities ® Database Kernel ® APO LC APPS | APO COM
Base [ ® ODBC]* ® DB Analyzer
Base ®ODBC ® Web Tools
Base ® CPC Base
Base ® CPC Base ® CPC SDK <version>
Base ®Perl
Base ®Python

* Required for DB Analyzer on Microsoft Windows only

Explanation of Dependencies

· The Base software component is independent of all other packages.

· PCR <version>cannot be installed until Base has been installed.

· Server Utilities cannot be installed until Base has been installed.

¡ Database Kernel cannot be installed until Server Utilities has been installed.

¡ APO LC APPS or APO COM cannot be installed until Database Kernel has been installed

· DB Analyzer cannot be installed until you have installed Base (on UNIX) or Base and ODBC (on Microsoft Windows).

· ODBC cannot be installed until Base has been installed.

¡ Web Tools cannot be installed until ODBC has been installed.

· CPC Bases cannot be installed until Base has been installed.

¡ CPC SDK <version> cannot be installed until CPC Base has been installed.

· Perl cannot be installed until Base has been installed.

· Python cannot be installed until Base has been installed.


Logging (SAP Library - SAP DB)

 Entering content frame

Background documentation Logging

Use

All installation/update steps and the steps involved in upgrading database instances and their software are saved in log files.

Conventions

Variables

Location of Log Files for Installations/Updates

· UNIX/Linux ( tgz package):
<independent_data_path>/wrk/SAPDB<profile>_install-<date>-<time>.log

· Windows:
<independent_data_path>\wrk\SAPDB<profile>_install-<date>-<time>.log

If the <independent_data_path> directory is not yet known when the installation process is terminated, the log will be created in the current directory.

If you have installed/updated individual SAP DB software components, the steps are logged in the file
SAPDBSoftware_install-<date>-<time>.log

Location of the Log File for Updates of Database Instances and Their Software (Upgrades)

· UNIX/Linux ( tgz package):
<independent_data_path>/wrk/SAPDBUpgrade_install-<date>-<time>.log

· Windows:
<independent_data_path>\wrk\SAPDBUpgrade_install-<date>-<time>.log


Overview of Options for the Program SDBINST (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of Options for the Program SDBINST

You can specify the following options when you use the program SDBINST to install or update SAP DB software:

Option

Description

-b | -batch

Use installation program in the background

If you specify this option, the installation program terminates with an error if any information is missing.

If you do not specify this option, the program stops if any information is missing, and prompts you to act.

-profile

Installation profile

You must place any names that contain blanks in double quotation marks.

-package

Logical name of the SAP DB software component (not file name)

You must place any names that contain blanks in double quotation marks.

-indep_data

Can be specified for an initial SAP DB installation only. Otherwise, the system ignores it. You can change this path only after completely uninstalling the SAP DB software.
See also: Variables

-indep_prog

Can be specified for an initial SAP DB installation only. Otherwise, the system ignores it. You can change this path only after completely uninstalling the SAP DB software.
See also: Variables

-depend

Can be specified for a new installation only, and only for the installation profiles all, Server and APO LiveCache and the SAP DB software components Database Kernel and APO LC APPS (from APO Version 4) or APO COM. Otherwise, the system ignores it.

See also: Variables

-o | -owner

Software owner (UNIX)

-g | -group

Group of the software (UNIX only), administrator group for software versions from 7.4.04

-gs

Support group for software versions from 7.4.04 (UNIX only), see also Authorization Concept for software versions from 7.4.04

-h | -help

List of options and descriptions

-v | -version

Version number of the SDBINST installation program

-l | -list

Displays all possible installation profiles and SAP DB software components


Overview of Options for the Program SDBUNINST (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of Options for the Program SDBUNINST

You can specify the following options when you use the program SDBUNINST to uninstall SAP DB software:

Option | Description
-all | Uninstalls all software registered for SAP DB
-package <package> | Logical name of the SAP DB software component (not file name) that you want to uninstall
-package_dir <package_directory> | Directory of the specified software component, if there are multiple software packages with the same name
-autoresolve | As well as the specified SAP DB software component, the system also uninstalls all dependent components. -package ODBC –autoresolve On Microsoft Windows, the component ODBC and its dependent component Web Tools are uninstalled.
-h | -help | List of options and descriptions
-v | -version | Version number of the uninstallation program SDBUNINST
-l | -list | Displays all possible SAP DB software components


Overview of Options for the Program SDBUPD (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of Options for the Program SDBUPD

You can specify the following options when you use the program SDBUPD to upgrade SAP DB database instances from Version 7.3 to Version 7.4:

Option

Description

-b | -batch

Use SDBUPD in the background

If you specify this option, the installation program terminates with an error if any information is missing.

If you do not specify this option, the program stops if any information is missing, and prompts you to act.

-d <database_name>

Name of the database instance

-u <dbm_user>,<password>

Name and password of the DBM operator

-h | -help

List of options and descriptions

-v | -version

Version number of SDBUPD

-l | -list

Displays all possible installation profiles and SAP DB software components

-o <sapdb_user>

Owner of the software (UNIX only) when you upgrade the software to Version 7.4.04, according to the authorization concept

-g <sapdb_admin>

Administrator group (UNIX only) when you upgrade the software to Version 7.4.04

-gs <sapdb_support>

Support group (UNIX only) when you upgrade the software to Version 7.4.04


Tools (SAP Library - SAP DB)

 Entering content frame

Component documentation Tools

Title of the Documentation | Explanation
Database Manager · Database Manager GUI: SAP DB 7.4 · Web DBM 7.4 · Database Manager CLI: SAP DB 7.4 | Creating and managing database instances · Graphical user interface · Web-based user interface · Command line-oriented user interface
Database Analyzer | Analysis of the performance of database instances
Loader 7.4 | Loading and unloading data
Query Tools · SQL Studio 7.4 · Web SQL Studio 7.4 | Data queries and data processing · Graphical user interface · Web-based user interface
SAP DB WebDAV GUI | Web-based application for indexing XML documents in the SAP DB WebDAV service


Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Component documentation Database Manager GUI

The Database Manager is the administration tool for SAP DB database instances. You can use this tool to create and monitor database instances on local or remote hosts. You can back up the data of database instances and, if necessary, recover it.

Implementation Considerations

The Database Manager can be called as a command line-oriented tool (Database Manager CLI), as a Web-based tool (Web DBM), or as a graphical user interface (Database Manager GUI). All three versions of this program offer the same functions.

The Database Manager CLI and the Web DBM can be installed on every operating system that is supported by the database system SAP DB. The Database Manager GUI runs on Microsoft Windows only.

Each different type of the Database Manager can manage SAP DB database instances on every operating system that is supported by the SAP DB database system.

To work with the Database Manager, a sound knowledge of database administration is required.

You can download the program Database Manager GUI free of charge from the Internet address www.sapdb.org . An installation wizard guides you through the installation process.

For general information about the database system SAP DB, see the documentation The SAP DB Database System. You can find this documentation, for example, on the SAP DB homepage under Documentation.

The Database Manager GUI, Version 7.4, is described here. You can use this version 7.4 of the Database Manager for all SAP DB database systems as of version 7.1.

· Calling the Database Manager GUI

· Installing or Initializing a Database Instance (Installation Wizard)

· Managing Database Manager Operators

· Managing Database Instances

· Backing Up Data

· Restoring Data

· Displaying Information

· Options for Diagnosing Problems

· Updating the Database Software

· Accessing the SQL Studio Program

· Screen Areas of the Database Manager GUI


Calling the Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Calling the Database Manager GUI

To call the Database Manager GUI program, choose Start ® Programs ® SAP DB ® Database Manager Second Edition.

You can also call the Database Manager GUI ( dbmgui.exe) from the command line.

To do this, go to the directory of the program dbmgui.exe and enter the following command:

dbmgui [<options>]

Options

Display all command line options | -?
Name of the database instance | -d <database_name>
Name of the database server | -n <database_server>
Opening a database session specifying operator data (operator name and password) | -u <user_name>,[<password>]
Open the configuration file | -f <file_name>
Window for entering connection details | -prompt
Database Manager GUI version | -version
Call the Database Manager without initial screen display | -nologo
Activate the database trace | -trace


Installing or Initializing a Database Instance (Installation Wizard)

 Entering content frame

Procedure documentation Installing or Initializing a Database Instance (Installation Wizard)

You use the Installation Wizard in the Database Manager GUI to install or initialize database instances on a local or remote server. The Installation Wizard guides you through the entire process.

Prerequisites

Local Installation or Initialization

For a local installation, you must have the administration authorizations of an operating system user for this server.

To initialize a local database instance, you also need the administration authorizations for this database instance.

Remote Installation or Initialization

For an installation on a remote server, you must specify an operating system user for this server that has administration authorizations, and also the authorization log on as batch job, or a similar authorization. (For more information on the administration of operating system users, see your operating system documentation.)

To initialize a database instance on a remote server, you also need the administration authorizations for this database instance.

Procedure

...

Start the Installation Wizard. To do this, choose Start ® Programs ® SAP DB ® Installation Wizard or choose Instance ® Installation Wizard in the Database Manager GUI.

Choose Next to start each of the required steps.

1. Select the appropriate template for the installation.
If you want to install or initialize a new database instance, choose New.
If you want to install a preconfigured database instance, select one of the installed templates (such as Demo), or a template of your own. If you use a template for the installation, you can install the database instance in the background. To do this, choose Unattended Installation.

2. Enter the following details:
Database instance on your local server:
Database Server: <local>: Do not change this entry.
Database name
- Installation of a database instance: Enter the name of the new database.
- Initialization of a database instance: Enter the name of the database instance that you want to initialize.

Database instance on a remote server:
Database Server: Enter the name of the server.
Database Name
- Installation of a database instance: Enter the name of the new database.
- Initialization of a database instance: Enter the name of the database instance that you want to initialize.
Login Name: Enter the operating system user for this server.
Password: Enter the password for this operating system user.

3. There may be more than one installation of the database software on the same server. Select the appropriate installation.

4. Specify the Database Manager operator. Do not use any special characters. The default name is DBM. Enter and confirm the password.

The Database Manager saves the name and password of the DBM operator in uppercase letters.

5. Decide how you want to give the database parameters initial values.

Initialize parameters with default values
The initial values of the database parameters are taken from the standard configuration used for the installation of the database software.

Copy parameters from existing database
The initial values of the database parameters are taken from their configuration in an existing database instance.
Select the database instance from which you want to copy the parameter file.

Restore parameters from a backup medium
The initial values of the database parameters are taken from their configuration in a complete data backup.
Select the complete data backup that you want to use.

Use current parameters
You can take the current database parameter values from an existing database instance.

6. Select a database instance type.
If you chose Use current parameters, the system uses the instance type of the existing database instance.

7. Adjust the database parameters to your requirements.
Select the database parameters you want.
New Value: Enter and confirm the new value of the database parameter.
The value of the database parameter is stored in the internal data structures and becomes effective when the database instance is next restarted.

The database parameters are checked when you exit the input screen. You may be prompted to make and confirm changes before you can leave this screen.

8. Define your data volumes and log volumes.

Choose New Volume for both.
Enter the size and ID or the absolute path of the volume and confirm your entries.

9. Define any backup media that you need.

10. Choose from the following options:

In stall and start instance
Specify the SYSDBA (database system administrator). The default name is DBA. Enter and confirm the password.
The database instance is installed or initialized and transferred to the operational state ONLINE.

Install instance for recovery
The database instance is installed or initialized and transferred to the operational state ADMIN. You can use this database instance for a recovery only.
The Installation Wizard starts the Recovery Wizard. The details of the SYSDBA user are taken from the data backup.

11. Choose Start to install or initialize the database instance.

If any errors occur, the process is stopped immediately. However, the state reached when the error occurred is preserved.

12. Close the Installation Wizard.

Creating a Template

You can save the details you enter when you install or initialize a database instance in a template. The Installation Wizard proposes a path and name for the template. You can use this template to install and initialize other database instances.


Managing Database Manager Operators (SAP Library - SAP DB)

 Entering content frame

Background documentation Managing Database Manager Operators

The SAP DB database system differentiates between two main user classes:

· Database Manager operators (DBM operators)

· Database users

When you create new database instances, you must first create the first user of each of these classes for each instance. These are the first Database Manager operator and the database system administrator (SYSDBA).

Each of these users then has the authorization to create additional users of the specified main classes.

See also: The SAP DB Database System under User Concept

Note that a Database Manager operator can manage a database instance but cannot work with the database objects.
A database system administrator, on the other hand, can work with the database objects and also has the authorizations of the first Database Manager operator. This means that he or she can also perform all Database Manager functions.

You can perform the following administration tasks with the Database Manager GUI:

· Changing a User Password

· Changing Server Authorizations


Changing a User Password (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing a User Password

You can change the passwords of all DBM operators and the user SYSDBA with the Database Manager in various operational states of the database instance:

User Class

User

Operational State of Database Instance

Database Manager operator

First Database Manager operator

All other DBM operators

OFFLINE

Operator password can be changed in any operational state

Database user

SYSDBA

ONLINE

Prerequisites

Starting the Database Instance , Stopping the Database Instance ).

Procedure

...

1. Choose Instance ® Configuration ® Users.

2. Select the user you want.

3. Choose Properties.

4. Select the tab page General and then choose Password Change.

5. Enter the old and new passwords and save your entries.


Changing the Operator Authorizations (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing the Operator Authorizations

An operator authorization is an authorization to execute certain commands in the Database Manager.

An authorization may cover more than one command and one command may have more than one authorization assigned to it.

Database Manager has the following operator authorizations:

Request status data | Requesting status information
Execute the LOAD program | Running the LOAD program
Execute operating system commands | Executing operating system commands
User management | User Management
File access (read and write) | File access (read and write)
File access (read only) | File access (read only)
Database file access (read only) | Database file access (read only)
Saving backups | Performing backups
Installation management | Installation management
Load the system tables | Loading system tables
Parameter access (checked write) | Parameter access (checked write)
Parameter access (read and write) | Parameter access (read and write)
Parameter access (read only) | Parameter access (read only)
Start database instance | Starting the database instance
Stop database instance | Stopping the database instance
Restoring backups | Restoring backups
Access to SQL session | Accessing SQL session
Access to utility session | Accessing a utility session

Prerequisites

You have the User Management operator authorization.

Procedure

1. Choose Instance ® Configuration ® Users.

2. Select the user you want.

3. Choose Properties.

4. On the User Rights tab page, you can now add or remove authorizations for the selected operator.


Managing Database Instances (SAP Library - SAP DB)

 Entering content frame

Background documentation Managing Database Instances

Monitoring the Operational State

Registering the Database Instance

Displaying and Changing Database Parameters

Closing a Database Session Manually

Activating, Deactivating, or Deleting Indexes

Changing Log Settings (Configuration Wizard)

Creating Mapchar Sets

Displaying, Changing, and Deleting Mapchar Sets

Starting the Database Instance (Restart)

Updating the Statistics Information

Stopping the Database Instance (Shutdown)

Connection to the DBM Server

Creating Volumes

Displaying, Changing, and Deleting Volumes

Changing Database Parameters for Volumes


Monitoring the Operational State (SAP Library - SAP DB)

 Entering content frame

Background documentation Monitoring the Operational State

You can use the Database Manager GUI to monitor the operational state of each database instance.

Prerequisites

1. Make sure that the database instance has been registered.

2. Set up the connection to the DBM server.

Displaying the Operational State

Check the indicators assigned to the general icons for the registered database instances.

You can use the displays View ® Large Icons/Small Icons/List .

This graphic is explained in the accompanying text | General icon for a database instance
This graphic is explained in the accompanying text | Database instance is in the operational state OFFLINE
This graphic is explained in the accompanying text | Database instance is in the operational state ADMIN
This graphic is explained in the accompanying text | Database instance is in the operational state ONLINE

Changing the Operational State

Double-click a database instance.

Choose Actions ® OFFLINE/ADMIN/ONLINE to change to the relevant operational state.

See also:

Starting the Database Instance (Restart)

Stopping the Database Instance (Shutdown)


Registering the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Registering the Database Instance

If you want to manage database instances with the Database Manager GUI, then they have to be registered.

Prerequisites

If you want to access a remote database instance with the Database Manager, you have to start the X Server on the relevant database server.

Procedure

...

1. Choose Instance ® Register Instance.

2. Enter the name of the database server.
Confirm this by choosing Add Server.

3. Select the database instances that you want to register, and confirm.

Result

The database instance has been registered and from now on it appears on the list of registered databases.

You can organize the way in which the database instances are stored and appear in the Database Manager GUI according to your requirements.

To be able to manage a database instance, you must set up a connection to the DBM server.


Displaying and Changing Database Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying and Changing Database Parameters

You can use the Database Manager GUI to display and change the database parameters of the current database instance. You can do this in any operational state of the database instance.

The changes are stored in the parameter file but only become effective after the database has been restarted (see Starting the Database Instance (Restart)).

Procedure

1. Choose Instance ® Configuration ® Parameters. The system displays the general database parameters (General).

2. If you also want to display the special and support database parameters, choose Actions ® Show Extended and Support Parameters.

3. Select the database parameters you want.

Name | Name of the database parameter
Value | Value of the database parameter currently being used in the kernel of the database instance
New value | No entry: The database parameter has not been changed since the database instance was last started. New value entered: The database parameter has been changed since the database instance was last started. However, no changes are saved to the parameter file and none of them become active until the next time the database instance is restarted (see Starting the Database Instance (Restart)).
Description | Help text on the selected parameter

4. Choose Action ® Properties.

5. Enter the new value of the database parameter under New Value.

6. Save your entries.

The new value of the database parameter is stored in the internal data structures and becomes effective when the database instance is next restarted.


Closing a Database Session Manually (SAP Library - SAP DB)

 Entering content frame

Background documentation Closing a Database Session Manually

In certain cases, you may need to close a specific database session. You can do this with the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

1. Choose Instance ® Sessions.

2. Select the database session that you want to close.

3. Choose Actions ® Kill Selected Sessions to close the database session.


Activating, Deactivating, or Deleting Indexes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating, Deactivating, or Deleting Indexes

You can use the Database Manager GUI to determine which of the existing indexes of a database instance have been used.

You can also activate, deactivate, or delete selected indexes.

Prerequisites

The database instance is in the ONLINE operational state.

Procedure

1. Choose Instance ® Tuning ® Index Use.

2. You can choose which indexes you want to display by entering appropriate search arguments:

Owner | Owner
Table Name | Name of the table
Index Name | Name of the index

You can also choose between the following options:

Disabled indexes only | Only indexes that have been deactivated
Unused indexes only | Only indexes that have not been used

3. Choose Actions ® Search. The system displays a list of the indexes that match your criteria.

4. Select the indexes that you want to activate.
If you want to activate all of the indexes displayed, choose Actions ® Mark All.
Deselect the indexes that you want to deactivate.

5. Choose Actions and the action you want to perform.


Changing Log Settings (Configuration Wizard) (SAP Library - SAP DB)

 Entering content frame

Background documentation Changing Log Settings (Configuration Wizard)

You can use the Database Manager GUI to change log settings. To do this, use the Configuration Wizard, which guides you through the entire process.

Prerequisites

Check the log area and log writer information in the Database Manager GUI.

Procedure

Start the Configuration Wizard. To do this, choose Instance ® Configuration ®Configuration Wizard in the Database Manager GUI.

Choose Next to start each of the required steps.

Decide which log settings you want to change. You can change multiple log settings, one after the other. To do this, choose Back each time you complete your changes.

· Log mode
If you want to mirror the log area by setting the log mode, then you must use the Configuration Wizard to create only the required mirrors of the log volumes.
- Choose Properties.
- Specify the location of the mirror under Location.
- Start the process.
After this operation has been completed, the database instance is transferred to the operational state ONLINE.

· Overwrite mode for the log area
After a standard installation, normal log backup operations are activated, which means that the overwrite mode is deactivated. The database instance must be in the operational state ADMIN or ONLINE before you can change the overwrite mode.
You can use the Configuration Wizard to activate the overwrite mode. This setting remains active even after you restart the database instance.
You must activate normal log backup operations (and deactivate the overwrite mode) explicitly with the Configuration Wizard. Afterwards, you are prompted to make a complete data backup to guarantee the integrity of your data.

· Activating or deactivating redo log management
Redo log management is activated after a standard installation. The database instance must be in the operational state ADMIN before you can change this setting.
You can use the Configuration Wizard to deactivate redo log management. This setting remains active even after you restart the database instance.
You must activate redo log management explicitly with the Configuration Wizard. Afterwards, you are prompted to make a complete data backup to guarantee the integrity of your data.


Defining MapChar Sets (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining MapChar Sets

You can use the Database Manager GUI to create Mapchar sets.

You cannot use this command for Unicode databases.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

...

1. Choose Instance ® Configuration ® MapChar Sets.

2. Choose Actions ® New. Enter the following information:

Name | Name of the MapChar set, a maximum of 18 bytes in length
Code type | The code underlying the MapChar set Valid codes are ASCII code in accordance with ISO 8859/1.2 or EBCDIC code CCSID 500, codepage 500.
Mapchar | Define the conversions for the characters required. Each one-byte character to be converted must be specified in its original form and in the target form with a maximum length of two bytes. Intern: Original form in hexadecimal format Extern Hex: New form in hexadecimal format Ext. ASCII: New form in printable characters

3. Save your entries.

See also:

Displaying, Changing, and Deleting Mapchar Sets


Displaying, Changing, and Deleting MapChar Sets (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying, Changing, and Deleting MapChar Sets

You can use the Database Manager GUI to display, change, and delete Mapchar sets.

You do not have this option for UNICODE databases.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

...

1. Choose Instance ® Configuration ® MapChar Sets.
You see all available Mapchar sets.

2. Select the MapChar set you want.

3. Choose Actions ® Properties or Delete.
You can change the following details:

Code type | The code on which the Mapchar set is based. The valid codes are the ASCII code in accordance with ISO 8859/1.2 or the EBCDIC code CCSID 500, codepage 500.
Mapchar | Define the conversions for the characters required. Each one-byte character to be converted must be specified in its original form and also in its target form with a maximum length of two bytes. Intern: Original form in hexadecimal format Extern Hex: New form in hexadecimal format Ext. ASCII: New form in printable characters

4. Save your entries.

See also:

Creating Mapchar Sets


Starting the Database Instance (Restart) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting the Database Instance (Restart)

You can use the Database Manager GUI to start a database instance.

Prerequisites

1. Make sure that the database instance has been registered.

2. Set up the connection to the DBM server.

3. Determine the operational state of the database instance (see Monitoring the Operational State).

Procedure

Double-click a database instance.

The database instance is in the operational state OFFLINE.

· Transferring the database instance to the operational state ONLINE
Choose Actions ® Online.
The database instance starts.

· Transferring the database instance to the operational state ADMIN
Choose Actions ® Admin.
The database instance is transferred to the operational state ADMIN.

The database instance is in the operational state ADMIN.

· Transferring the database instance to the operational state ONLINE
Choose Actions ® Online.
The database instance starts.

Each time you start the database instance, a copy of the log file knldiag is made under the name knldiag.old. The file knldiag is overwritten. Use this log file to analyze any errors that occurred when you started or stopped the database instance.

See also:

Stopping the Database Instance (Shutdown)


Updating the Statistics Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating the Statistics Information

Various statistics are compiled for each database instance, such as the number of table entries, the size of the tables and indexes, and the value distribution (various values) of indexes and columns. This information is required by the SAP DB Optimizer to define the best strategy for executing complex SQL statements.
The statistics information is stored in the database catalog.

If the database size or the values it contains have changed considerably, you have to update the statistics. Do this about once a week.

The statistics values can be updated for certain tables, columns, or for all base tables.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Tuning ® Optimizer Statistics.

The database system contains an internal list of the tables whose statistics need to be updated.

· Updating statistics entries for all tables
You can update the statistics entries for all tables in this internal list. To do this, do not enter a search argument under Search; instead, just enter *.
Updating statistics entries for selected tables
You can update the statistics entries for selected tables in this internal list. To do this, enter appropriate search arguments for the owner, table name, and column name under Search.

· You can determine the size of a sample. To do this, enter appropriate information under Estimate.

Estimate Rows | Number of rows checked
Estimate Percent | Percentage of rows checked

The update is only performed across the number of rows or the specified percentage, based on the total number of database tables. This option, therefore, is faster.

The significance of the random sample depends on the size of the tables and the physical position of the data. Measurements have shown that for large tables, random samples of between 1000 and 5000 rows have short response times and produce high-quality results.

· Independently of the internal list, you can display all tables for which statistics can be updated. To do this, select Select from tables under Advanced.

1. Choose Actions ® Search.

2. A list of the tables is displayed that matches your criteria under Search or Advanced. From the Update Statistics Dateand Update Statistics Time, you can tell when the statistics for this table were last updated.
If you want to update the statistics for one of the tables in the list, simply select the relevant entry. If you want to update the statistics for all of the tables, choose Actions ® Mark All.
Select Include update columns for marked tables (under Advanced) if you want to update column statistics as well as the table statistics.

3. Choose Actions ® Execute to update the statistics for the selected tables.
If you have not selected any tables, the statistics of those tables are updated that are in the internal list of the database system.


Stopping the Database Instance (Shutdown) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Stopping the Database Instance (Shutdown)

You can use the Database Manager GUI to stop (shut down) a database instance.

Prerequisites

1. Make sure that the database instance has been registered.

2. Set up the connection to the DBM server.

3. The database instance is in the operational state ONLINE (see Monitoring the Operational State).

Procedure

Double-click a database instance.

· Transferring the database instance to the operational state ADMIN
Choose Actions ® Admin.
The database instance is transferred to the operational state OFFLINE and then to the operational state ADMIN. Any changes made to the database parameters take effect.

· Transferring the database instance to the operational state OFFLINE
Choose Actions ® Offline.
The database instance is stopped.

If a data backup or log backup is running, the Database Manager waits until the backup is complete before stopping the database instance.

Use the log file knldiag to analyze any errors that occurred when you started or stopped the database instance.

See also:

Starting the Database Instance (Restart)


Connection to the DBM Server (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Connection to the DBM Server

Before you can manage database instances using the Database Manager GUI program, a connection must be set up between the database instance that you want to manage and your DBM Server.

You can set up the connection to the DBM Server for one, more than one, or all registered database instances, depending on the performance of your system. Similarly, you can terminate the connection between individual database instances and your DBM Server to reduce the load on your system.

Prerequisite

You must register the database instance.

Setting Up a Connection Between a Database Instance and the DBM Server

The database instance state is Not connected.

1. Select a database instance.

2. Choose Instance ® Connect.

3. Enter the name and password of the Database Manager operator, if necessary. You can save this information.

The Database Manager can now determine the current operational state of the selected database instance.

Terminating a Connection Between a Database Instance and the DBM Server

1. Select a database instance.

2. Choose Instance ® Disconnect.

The state of this database instance is now Not connected.

The connection to the DBM Server has been terminated. The Database Manager now no longer determine the current operational state of the database instance.


Creating Volumes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating Volumes

You want to user the Database Manager GUI to increase the storage capacity of your data area or log area.

· The maximum number of data volumes you can create is defined in MAXDATAVOLUMES.

· The maximum number of log volumes you can create is defined in MAXLOGVOLUMES.

Prerequisites

The database instance is in the operational state ONLINE.

The value of the database parameter MAXDATAVOLUMES or MAXLOGVOLUMES is at least as great as the total number of existing volumes plus the volumes you want to define.

The system checks that there is enough space available for at least one volume of each type before each start of the database instance. If there is not enough space available, it automatically increases the setting of the appropriate database parameter by 1.

If necessary, change the database parameter MAXDATAVOLUMES or MAXLOGVOLUMES accordingly (see Changing Database Parameters for Volumes). Later on, when the database instance is in the operational state ONLINE, this enables you to add a volume of a given type a number of times in succession without having to stop the database instance.

Procedure

...

1. Choose Instance ® Configuration ® Volumes.
The system displays all existing volumes of the selected type and their data, as well as the maximum number of volumes still possible according to the parameter value.

Name | Name of the volume
Size | Size of the volume
Type | File, raw device, or symbolic link
Location | Path of the volume
M. Type | File, raw device, or symbolic link (mirrored volume)
M. Location | Path of the mirrored volume

2. Choose one of the default volume names.

3. Choose Actions ® New. Define the new volume by entering the size and path.

4. Save your entries.

See also:

Displaying, Changing, and Deleting Volumes


Displaying, Changing, and Deleting Volumes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying, Changing, and Deleting Volumes

You can use the Database Manager GUI to display volumes, and to change or delete their paths.

Prerequisites

You have copied the log volume or data volume to its new path and you want to inform the Database Manager GUI of this new path.

The database instance is in the OFFLINE operational state.

Procedure

...

1. Choose Instance ® Configuration ® Volumes.
You are shown all the existing volumes of the selected type.

Name | Name of the volume
Size | Size of the volume
Type | File, raw device, or symbolic link
Location | Path of the volume
M. Type | File, raw device, or symbolic link (mirrored volume)
M. Location | Path of the mirrored volume

2. Select the log volume or data volume that you want to change.

3. Choose Action ® Properties.

4. Enter the new path of the volume under Location.

5. Save your entries.

When you now restart the database instance the database system recognizes the new path.

See also:

Creating Volumes


Changing Database Parameters for Volumes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing Database Parameters for Volumes

You can use the Database Manager GUI to define database parameters, including those that define the maximum number of volumes in a database instance: MAXDATAVOLUMES and MAXLOGVOLUMES.

You can change the settings of both database parameters at a later time, regardless of the operational state of the database instance. Like all database parameter changes, these changes take effect the next time the database instance is restarted.

Procedure

...

1. For the database parameters MAXDATAVOLUMES and MAXLOGVOLUMES, proceed as described in Displaying and Changing Database Parameters .

2. Transfer the database instance to the operational state ADMIN.

3. Start the database instance.
The Database Manager GUI transfers the database instance to the operational state OFFLINE and then to the operational state ONLINE, and saves the new value of the database parameter in the parameter file.
The Database Manager GUI reserves the memory required by this number of volumes, plus reserve memory large enough for the largest volume of this type. This reserve allows you to create an additional volume of this type while the database is running if the original number of volumes is not enough.


Backing Up Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Backing Up Data

You can perform both data backups and log backups with the Database Manager.

· Interactive backups
Use the Backup Wizard.

· Background backups
Use the Database Manager CLI.
For more information, see Database Manager CLI, section Backing Up and Recovering Database Instances

You can manage the backup media with the Database Manager.

The Database Manager supports a range of backup procedures.

Make note of the recommended strategies for backing up data.

For SAP applications, the scheduling and automation of Database Manager backups and media management can be optimized by using the DBA Planning Calendar of the Computing Center Management System (CCMS). For more information, see Database Management in CCMS OLTP under DBA Planning Calendar.


Backup Wizard (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backup Wizard

You can use the Backup Wizard to guide you through the entire process of backing up the data of your database instance.

You can start the Backup Wizard on a Windows-based server to back up data on either a local or remote server.

Procedure

Start the Backup Wizard. To do this, either use the call Backup Wizard or choose File ® Backup Wizard in the Database Manager GUI.

Choose Next to start each of the required backup steps.

1. You can back up the data of a database instance either locally, or on a remote host.
Choose your database instance, or enter the following information directly:
Information about the database instance
Database Server: Enter the server name.
 Database Name: Enter the database name.
Information about the Database Manager user
User Name: Enter the name of the Database Manager user.
 Password: Enter the password.

2. You can switch the database instance to the operational state of your choice. When you back up data, you require the operational states ADMIN or ONLINE.

3. Choose a backup type:
Complete Data Backup
Incremental Data Backup
Log Backup: Interactive log backup
Activate/Deactivate Automatic Log Backup: Automatic Log Backup

Also take note of the information about completed backups in the Backup Wizard.
Inform yourself about the backup procedures, and choose a suitable backup strategy for backing up your data.

4. Select a backup medium.
If you do not yet have a backup medium, you can create one, or create a group of parallel backup media.
For more information on this, see Managing the Backup Media.

5. Start the backup.

6. Close the Backup Wizard.


Managing the Backup Media (SAP Library - SAP DB)

 Entering content frame

Background documentation Managing the Backup Media

You must define the backup media before you can back up data. You can create and manage backup media interactively with the Database Manager GUI or the Backup Wizard.

· Creating a Single Backup Medium

· Creating a Group of Parallel Backup Media

· Changing Backup Media

· Deleting Backup Media


Creating a Single Backup Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Single Backup Medium

You can create backup media interactively with the Database Manager GUI or the Backup Wizard.

Procedure

· Database Manager GUI
Choose Instance ® Backup ® Backup Medium.
Choose Actions ® New Medium.

· Backup Wizard
Choose New Medium in the window Media for Backup.

...

General

Choose General and enter the following information:

Name | Name of the backup medium Follow the naming conventions for backup media.
Backup Type | Choose your preferred backup type: Complete data backup Incremental data backup Log backup
Device Type | Select the type of backup medium: File: If you back up the log area to a file, the Database Manager generates version files automatically. Tape: You cannot make log backups to tape. Pipe: Always specify Pipe if you are using an external backup tool.
Location/Device | Specify the location to which you want to make the backups. With files and pipes, we recommend specifying the absolute path to the backup medium. UNIX: If you are backing up to tapes, you must communicate with the device driver correctly. Use rewind tapes for data backups. Windows NT/Windows 2000: The system sets the device driver automatically.

Extended

Choose Extended and enter the following information:

Size | Size of the backup medium
Overwrite | Select Overwrite if you want to use the overwrite mode for the backup medium.
Blocksize | Select Blocksize if you want to make backups in blocks of up to eight pages
Autoloader | Select Autoloader to use a tape device with autoload facilities (Backups with Automatic Tape Loaders).
OS Command | When you back up to tape, you can specify operating system commands.


Creating a Group of Parallel Backup Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Group of Parallel Backup Media

To improve backup speed, you can back up data to multiple backup media in parallel. To do this, define a group of parallel backup media under a single medium name. A backup made to multiple media in parallel must have the name of the group of parallel media assigned to it. When you restore data, you can import the data from this type of backup in parallel.

You can change backup media interactively with the Database Manager GUI or the Backup Wizard.

Procedure

· Database Manager GUI
Choose Instance ® Backup ® Backup Medium.
Wählen Sie Actions ® New Parallel Medium.

· Backup Wizard
Choose New Parallel Medium in the window Media for Backup.

General

Choose General and enter the following information:

Name | Name for the group of parallel backup media Follow the naming conventions for backup media.
Backup Type | Choose your preferred backup type: Complete data backup Incremental data backup
Device Type | Select a backup medium: File Tape Pipe Always specify Pipe if you are using an external backup tool.
Name/Location | Name and path for backup media that you want to include in the group of parallel backup media. Change the defaults, or add new locations, depending on where you want to make the backups. For files and pipes, we recommend that you specify the absolute path to the backup medium. UNIX: If you are backing up to tapes, you must communicate with the device driver correctly. Use rewind tapes for data backups. Windows NT/Windows 2000: The system sets the device driver automatically.

Extended

Choose Extended and enter the following information:

Unit | Unit of measurement for specifying the size of backup media
Overwrite | Select Overwrite if you want to use the overwrite mode for backup media
Blocksize | Select Blocksize if you want to make backups in blocks of up to eight pages
Autoloader | Select Autoloader to use a tape device with autoload facilities (Backups with Automatic Tape Loaders).
Name/Size/OS Command | You can specify the size of each backup medium in the group. When you back up to tape, you can specify operating system commands.

...


Changing Backup Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing Backup Media

You can change backup media interactively with the Database Manager GUI or the Backup Wizard.

Procedure

· Database Manager GUI
Choose Instance ® Backup ® Backup Medium.
Choose a backup medium or group of parallel backup media.

· Backup Wizard
In the window Media for Backup, choose a backup medium or group of parallel backup media.

...

Changing the Name of the Backup Medium or Group of Parallel Backup Media

1. Choose Action ® Rename or Rename and make your changes.

2. Choose Enter to save your changes.

Changing the Properties of a Backup Medium

1. Choose Action ® Propertiesor Properties and make your changes.

2. For information on the properties that you can change under General and Extended, see Creating a Single Backup Medium.

3. To display the backup ID or external backup ID, choose Label.


Deleting Backup Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting Backup Media

You can delete backup media interactively with the Database Manager GUI or the Backup Wizard.

Procedure

· Database Manager GUI
Choose Instance ® Backup ® Backup Medium.
Choose a backup medium or group of parallel backup media.

· Backup Wizard
In the window Media for Backup, choose a backup medium or group of parallel backup media.

To delete the chosen backup medium, choose Action ® Delete or Delete.


Backup Processes (SAP Library - SAP DB)

 Entering content frame

Background documentation Backup Procedures

You can use the Backup Wizard to back up data interactively. Depending on the technical requirements, the following backup procedures are possible:

· Backing Up to a Single Backup Medium

· Backing Up to a Group of Parallel Backup Media

If the capacity of the selected backup medium is sufficient for the total quantity of data that needs to be backed up, then the database administrator does not need to intervene during the backup process.

If the capacity of the selected backup medium is not sufficient for the backup, succeeding media must be used, meaning that when one backup medium is full, it must be automatically or manually replaced by an empty medium:

· Backups with Automatic Tape Loaders

· Backups with Manually Changed Media

The Backup Wizard requests additional backup media when a medium has been completely filled but the backup has not yet been completed. To allow it to do this, the media size must be stated when defining the medium, or the tape device must detect the end of the tape.

You also have the option of using an external backup tool:

· Backing Up with External Backup Tools

There is an automatic backup function for backing up the log entries:

· Activating and Deactivating the Automatic Log Backup


Backing Up to a Single Backup Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up to a Single Backup Medium

You can use the Backup Wizard to back up data interactively. You can save the data to a single backup medium.

If possible, we recommend that you back up data to a group of parallel backup media, rather than backing up the data to a single backup medium with succeeding media. You cannot make log backups in parallel.

Always check the database structure before each complete data backup (see Checking Database Structures).

Prerequisites

Only one backup device is available.

You have created the required backup medium.
If you want to perform a backup using an automatic tape loader (Backups to Automatic Tape Loader), or with the help of external backup tools (Backups with External Backup Tools), then you must state this specifically when defining the backup media.

Under normal circumstances, you should backup database instances if the ONLINE operational state.
You can also backup database instances in the ADMINoperational state, but only in exceptional circumstances.

Procedure

Use the Backup Wizard.

1. If you have not yet created a backup medium, do this now as described in Creating a Single Backup Medium. Select a backup medium in the window Media for Backup.

2. Check the information, and change it, if necessary (Changing Backup Media).

3. Only for database systems up to version 7.3 (inclusive):
If you want to perform a data backup, now choose whether the backup is to be performed for Recovery orMigration.
Recovery : Data backup for restoring the database instance if errors occur
Migration: Data backup with checkpoint; that is, to migrate the database instance
For more information about checkpoints, see the User Manual 7.3.

4. Start the backup, or activate automatic log backups.
If the capacity of the specified backup medium is not large enough for the backup and you are not using an automatic tape loader, the Backup Wizard asks you to specify and insert a new backup medium as soon as the previous medium has been filled (see Backups with Manually Changed Media).


Backing Up to a Group of Parallel Backup Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up to a Group of Parallel Backup Media

You can use the Backup Wizard to back up data interactively. To maximize the speed of the backup, you can back up data to a group of parallel backup media. You can use up to 32 tape devices to reduce backup times significantly.

If possible, we recommend that you back up data to a group of parallel backup media, rather than backing up the data to a single backup medium with succeeding media. You cannot make log backups in parallel.

Always check the database structure before each complete data backup (see Checking Database Structures).

Prerequisites

There are multiple backup devices available.

You have created the required backup media.
If you want to perform a backup using an automatic tape loader (Backups to Automatic Tape Loader), or with the help of external backup tools(Backups with External Backup Tools), then you must state this specifically when defining the media.

Under normal circumstances, you should backup database instances in the ONLINE operational state.
You can also backup database instances in the ADMINoperational state, but only in exceptional circumstances.

Procedure

Use the Backup Wizard.

1. If you have not yet created a group of parallel backup media, do this now as described in Creating a Group of Parallel Backup Media. Select a group of parallel backup media in the window Media for Backup.

2. Check the information, and change it, if necessary ( Changing Backup Media).

3. Only for database systems up to version 7.3 (inclusive):
If you want to perform a data backup, now choose whether the backup is to be performed for Recovery orMigration.
Recovery : Data backup for restoring the database instance if errors occur
Migration: Data backup with checkpoint; that is, to migrate the database instance
For more information about checkpoints, see the User Manual 7.3.

4. Start the backup.
If the capacity of the specified group is not large enough for the backup and you are not using an automatic tape loader, the Backup Wizard asks you to specify and insert a new backup medium as soon as the previous medium has been filled (see Backups with Manually Changed Media).


Backups with Automatic Tape Loaders (SAP Library - SAP DB)

 Entering content frame

Background documentation Backups with Automatic Tape Loaders

You can use the Backup Wizard to back up data interactively. The Backup Wizard also supports automatic tape loaders.

Alternatively, you can back up data with an external backup tool (Backing Up with External Backup Tools).

If you want to use an automatic tape loader, choose the following settings when you create the backup media (see Creating a Single Backup Medium, Creating a Group of Parallel Backup Media or Changing Backup Media):

· General
Choose the device type Tape.

· Extended
Select Autoloader.
This defines the automatic loading of tapes on Microsoft Windows NT/Windows 2000.
If you are using any other operating system, use the appropriate command for loading tapes. Enter the operating system command in the field OS Command.

After you insert the tape cartridge in the autoloader, the first tape must be selected manually.
When the end of this tape is reached, the autoloader will then take the next tape available.

For a backup to be successful, you will need to ensure an adequate supply of tapes.

At the end of the backup, the tape device shows the number of tapes written. The tapes should be marked with the backup ID that was displayed and confirmed at the start of the backup.

Before a backup, you must check that none of the tapes is write-protected since this terminates the entire backup.


Backups with Manually Changed Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backups with Manually Changed Media

You can use the Backup Wizard to back up data interactively. The Backup Wizard may prompt you to change the backup medium.

Prerequisites

You have started a backup to a single backup medium or a backup to a group of parallel backup media.

The capacity of the backup medium or backup media inserted is not sufficient for the selected backup. The bar that shows the progress of the backup stops before reaching 100%.

The Backup Wizard prompts you to insert the succeeding medium.

Succeeding Medium is Tape

...

1. Insert the next tape.

2. Ensure that the tape that has just been written is stored in a safe place and that the right tape has been inserted.

3. Continue with the backup.

We recommend you specify the exact capacity of the medium when defining the medium. As long as the tape device driver gives a reliable indication of when the end of the tape is reached, the Database Manager GUI reacts as described even when Size = 0.
If the end of the tape is not recognized correctly, the message Writing Error is displayed. Even when this happens you can continue as described in steps 1-3.

Succeeding Medium is a File

...

1. Under New Location, enter the name and full path of the file to which you want to make the backup.

2. Continue with the backup.

Repeat the procedure until the backup has been completed.

You cannot start a new backup while another backup is running.


Backing Up with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up with External Backup Tools

You can back up data interactively with the Backup Wizard, which also supports backups to tapes and succeeding tapes with external backup tools.

Prerequisites

Under normal circumstances, you should backup database instances if the ONLINE operational state. You can also backup database instances in the ADMIN operational state, but only in exceptional circumstances.

Procedure

If you want to use external backup tools, choose the following settings when you create the backup media (see Creating a Single Backup Medium, Creating a Group of Parallel Backup Media or Changing Backup Media):

General

· Follow the naming conventions for backup media.

· Choose the device type Pipe.

· Specify the operating system path of this pipe under Location.

When you back up the data, proceed as described under Backing Up to a Single Backup Medium or Backing Up to a Group of Parallel Backup Media.


Activating and Deactivating the Automatic Log Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating and Deactivating the Automatic Log Backup

You can activate or deactivate automatic log backups either interactively with the Backup Wizard, or directly with the Database Manager GUI. These settings allow you to maximize the security of the data in production systems.

Prerequisites

The database instance is in the ONLINE operational state .

Using the Backup Wizard

1. Start the Backup Wizard.

2. If you have not yet created a backup medium, do this now. Proceed as described in Creating a Single Backup Medium. Select a backup medium in the window Media for Backup.

3. Check the information, and change it, if necessary (see Changing Backup Media).

4. You can activate or deactivate automatic log backups, depending on the status of your system.
Once you activate automatic log backups for your system, this setting remains active until you deactivate automatic log backups again. Automatic log backups also remain active when you restart the database instance.

Using the Database Manager GUI

If you have created backup media, you can also use the Instance menu to activate (Set Auto Log ON) or deactivate (Set Auto Log OFF) automatic log backups.


Restoring Data (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring Data

The Database Manager supports the recovery of the database instance by importing backups. You can recover either the last database state or an earlier one.

The Database Manager also supports the recovery of indexes and defective mirror log volumes.

If the automatic log backup function was not activated before the recovery of the database instance started, this function is not automatically reactivated after the recovery.

To reactivate the log backup function, proceed as described under Activating the Automatic Log Backup.

Procedure

You can usually use the Recovery Wizard to perform interactive recoveries of data. The Recovery Wizard proposes the optimal recovery strategy for your purposes. You can choose from the following procedures:

· Restoring the Last Backup in the Backup History

· Restoring a Backup from the Backup History

· Restoring Without a Backup History

· Continuing an Interrupted Restore

· Restoring with an Automatic Tape Loader

· Restoring with External Backup Tools

If you cannot use the Recovery Wizard to restore data (for example, because the database instance has been deleted), you must initialize the database instance with the Installation Wizard and then recover it with the Recovery Wizard. The initialization process makes this a much lengthier procedure. Use it only if absolutely necessary.

· Recovery After Initializing a Database Instance

You can use the Database Manager GUI to restore indexes and mirrored volumes.

· Restoring the Indexes After a Database Restore

· Restoring a Mirrored Volume


Recovery Wizard (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recovery Wizard

You can use the Recovery Wizard to guide you through the entire process of recovering the data of your database instance.

You can start the Recovery Wizard on a Windows-based server to recover data on either a local or remote server.

The Recovery Wizard always proposes the quickest procedure for recovering lost data. Any complete data backups are restored first, followed by, if necessary, an incremental data backup and log backups.

To make sure that the data is recovered as quickly as possible, data backups can be retrieved from multiple backup media at the same time. The number of media in a group of parallel backup media does not have to be the same as the number of parallel backup media used for the original backup. A backup made to single medium with succeeding media can also be restored in parallel. You can use up to 32 tape drives to reduce recovery times significantly.

Log backups cannot be restored in parallel.

Procedure

Start the Recovery Wizard. To do this, either use the call Recovery Wizard or choose Instance ® Recovery ® Recovery Wizard in the Database Manager GUI.

Choose Next to start each of the required recovery steps.

1. You can recover the data of a database instance either locally, or on a remote host.
Choose your database instance, or enter the following information directly:
Information about the database instance
Database Server: Enter the server name.
 Database Name: Enter the database name.
Information about the Database Manager user
User Name: Enter the name of the Database Manager user.
 Password: Enter the password.

2. You can switch the database instance to the operational state of your choice. When you recover data, you require the operational state ADMIN.

3. Choose a recovery type:
Restore last backup: Restore the last complete backup
Restore a specified backup from history: Restore a backup from the backup history
Restore a medium: Restoring without a backup history
Continue restoring pages/log: This setting is displayed if you need to continue an interrupted restore.
Restore database until a specified time: If you only want to restore the database to a specific time, select this setting, and enter a time.

4. The recovery strategy is displayed. The system prompts you to mount the required backup medium.

5. Start the recovery.

6. Close the Recovery Wizard.

Result

The database instance has been recovered to the state you specified.

If the recovery procedure offered by the Recovery Wizard does not deliver the results you need, use the procedure Recovery After Initializing a Database Instance.


Restoring the Last Backup in the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring the Last Backup in the Backup History

You can use the Recovery Wizard to recover data interactively. You can perform a recovery that uses the last backup made.

Prerequisites

The log files dbm.knl and dbm.mdf exist and are not damaged. This means that the backup history is complete.

If you are performing a restore using external backup tools, the log file dbm.ebf must also exist and not be damaged.

The database instance is in the operational state ADMIN.

Procedure

Use the Recovery Wizard.

...

1. Choose Restore last backup.
You can now choose a time up to which you want to restore data. In this case, select Restore database until a specified time and enter a time.
The system default is the current time. If you do not change the time proposed by the system, the database instance is restored completely, including all changes.

2. The last complete data backup, the corresponding incremental backup, and the required log backups are displayed.
You can remove the incremental data backup from the proposal. If you do this, the Recovery Wizard proposes the corresponding log backups, or another incremental data backup (if one exists).

3. The system prompts you to insert the specified backup medium.

4. Start the recovery.
If you are using external backup tools, the external backup IDs are displayed at this point.
The complete data backup is restored.

5. If you are restoring an incremental data backup, the Recovery Wizard prompts you to confirm this.

6. If you need to restore log backups, the Recovery Wizard prompts you to confirm that you want to restore all displayed log backups. After the log backups have been restored, the database instance is in the operational state ONLINE.
If no log backups need to be restored, the recovery is complete. You can also specify an UNTIL time. Choose Restart to start the database instance.

When you restore a series of backups, the Recovery Wizard prompts you to insert the next backup medium each time, unless you are restoring from an automatic tape loader.

If you want, you can stop the restore process and continue it at a later time (see Continuing an Interrupted Restore ).


Restoring a Backup from the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring a Backup from the Backup History

You can use the Recovery Wizard to recover data interactively. You can perform a recovery with a complete data backup from the backup history.

Prerequisites

The log files dbm.knl and dbm.mdf exist and are not damaged. This means that the backup history is complete.

If you are performing a restore using external backup tools, the log file dbm.ebf must also exist and not be damaged.

The database instance is in the operational state ADMIN.

Procedure

Use the Recovery Wizard.

...

1. Choose Restore a specified backup from history.
You can now choose a time up to which you want to restore data. In this case, select Restore database until a specified time and enter a time.
The system default is the current time. If you do not change the time proposed by the system, the database instance is restored completely, including all changes.

2. The backup history of the complete data backups is displayed.

3. Select the data backup you want.

4. The chosen data backup, the corresponding incremental data backup and the required log backups are displayed.
You can remove the incremental data backup from the proposal. If you do this, the Recovery Wizard proposes the corresponding log backups, or another incremental data backup (if one exists).

5. The system prompts you to insert the specified backup medium.

6. Start the recovery.
If you are using external backup tools, the external backup IDs are displayed at this point.
The complete data backup is restored.

7. If you are restoring an incremental data backup, the Recovery Wizard prompts you to confirm this.

8. If you need to restore log backups, the Recovery Wizard prompts you to confirm that you want to restore all displayed log backups. After the log backups have been restored, the database instance is in the operational state ONLINE.
If no log backups need to be restored, the recovery is complete. You can also specify an UNTIL time. Choose Restart to start the database instance.

When you restore a series of backups, the Recovery Wizard prompts you to insert the next backup medium each time, unless you are restoring from an automatic tape loader.

If you want, you can stop the restore process and continue it at a later time (see Continuing an Interrupted Restore ).


Restoring Without a Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring Without a Backup History

You can use the Recovery Wizard to recover data interactively. You can also perform a recovery if the backup history is not available.

Prerequisites

The database instance is in the operational state ADMIN.

The backup history contains errors or is no longer complete.

Procedure

Use the Recovery Wizard.

...

1. Choose Restore a medium.
You can now choose a time up to which you want to restore a backup medium. In this case, select Restore database until a specified time and enter a time.
The system default is the current time. If you do not change the time proposed by the system, the backups are restored completely, including all changes.

2. A list of all existing backup media is displayed.

3. Select the backup medium you want to restore.
If you are performing a restore with external backup tools, the system displays a list of backups. Select the required external backup IDs, if necessary.

4. The system prompts you to insert the specified backup medium. If you are performing a restore using external backup tools, the external backup IDs are displayed again at this point.

5. Start the recovery.
If you then want to recover more backup media without a backup history, repeat this procedure.

6. Choose Restart to start the database instance.

If you want, you can stop the restore process and continue it at a later time (see Continuing an Interrupted Restore ).


Continuing an Interrupted Restore (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Continuing an Interrupted Restore

You have the option of continuing an interrupted restore of data at a later time.

Prerequisites

The database instance is in the operational state ADMIN.

One of several possible restore procedures has been started but canceled before it had been completed.

· Restore last backup

· Restore a backup from the backup history

· Restore without a backup history

Procedure

Use the Recovery Wizard.

...

1. Choose Continue restoring pages/log.
You have the option of restoring the database up to a specific time. In this case, select Restore database until a specified time and enter a time.
The system default is the current time. If you do not change the time proposed by the system, the backups are restored completely, including all changes.

2. The system displays a list of all relevant log backups for data backups that have already been restored.

3. Continue with the restore process. You can follow the progress of the restore process and its completion on the screen display.

4. Choose Restart to start the database instance.

...

When you restore a series of backups, the Recovery Wizard prompts you to insert the next backup medium each time, unless you are restoring from an automatic tape loader.


Restoring from Automatic Tape Loader (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring with an Automatic Tape Loader

You can use the Recovery Wizard to recover data interactively. You can optimize this process by using an automatic tape loader.

Prerequisites

For the restore operation to be successful, all the tapes which form part of the backup must be present in the automatic tape loader.

Procedure

Use the same media definition as for backing up (Defining a Single Backup Medium). Follow the individual steps as described for the relevant recovery procedure:

· Restoring the Last Backup in the Backup History

· Restoring a Backup from the Backup History

· Restoring Without a Backup History


Restoring with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring with External Backup Tools

You can use the Recovery Wizard to recover data interactively. The Recovery Wizard supports the use of external backup tools.

Using the Backup Tools

Start the recovery from the Recovery Wizard. The naming conventions for backup media enable the program to recognize and start the external backup tool.

Procedure

When you use an external backup tool to restore backups, the external backup IDs of the required backups are automatically defined by the Recovery Wizard, displayed so that the operator can check them, and used during the restore process. The operator does not need to explicitly determine or specify the external backup IDs.

The number of media in a group of parallel backup media must correspond to the number of media used to create the backup.

Follow the procedure for the relevant restore process:

· Restoring the Last Backup in the Backup History

· Restoring a Backup from the Backup History

· Restoring Without a Backup History


Recovery After Initializing a Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recovery After Initializing a Database Instance

When you restore data, you may need to initialize the database instance to delete the log entries in the log area. You can then restore the required backups to recover the database instance to a specified state.

You need to use this type of recovery in the following situations:

· You want to recover a deleted database instance from a backup.

· You want to use backups from a point in time before you made a recovery with an UNTIL time. (For example, you want to repeat a recovery with an UNTIL time so that you can specify a different time.)

Any backups made before the interruption of the backup history can only be restored with the procedure described here.

This procedure involves the initialization of the database instance. This is a very lengthy process, which is why you should use this procedure only if absolutely necessary.

Prerequisites

The log files dbm.knl and dbm.mdf exist and are not damaged. This means that the backup history is complete.

The database instance is in the operational state OFFLINE.

Procedure

Open the Installation Wizard. The wizard guides you through the entire process of initializing an existing database instance.

1. Enter the name of the database instance. This can be a database instance registered in the Database Manager GUI. In this case, the Database Manager GUI displays a message saying that a database instance with this name already exists.

2. Select Reinstall database instance <database_name>. This installs an empty database instance under the existing name (the database instance is initialized).

3. Proceed as described under Installing or Initializing a Database Instance (Installation Wizard). Under Use current parameters, the Database Manager proposes the database parameters of this database instance as the parameters for the newly initialized database instance. All data from the old version is lost.

Afterwards, choose Install instance for recovery (not Install and start instance), since this is the only option that lets you recover the data.

The database instance is in the operational state ADMIN. The Database Manager opens the Recovery Wizard automatically.

The Recovery Wizard always proposes the quickest procedure for recovering lost data. You may need to choose a procedure that is adapted to your situation.

The wizard guides you through the entire process of recovering the database instance. The subsequent recovery steps are described under the relevant recovery procedure.


Restoring the Indexes After a Database Restore (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring the Indexes After a Database Restore

When you restore data, the process is optimized by not restoring the indexes in the log area. Indexes that have not been restored are marked BAD and can be restored with the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

1. Choose Instance ® Recovery ® Index.

2. You can choose the tables for which you want to display bad indexes. To do this, enter appropriate search arguments for the owner, table name, and index name.

3. Choose Actions ® Search. The system displays a list of the indexes that match your criteria.

4. Select the indexes that you want to activate.

5. Choose Actions ® Recreate to perform the action.

We recommend that you restore the indexes during periods where the load in the system is low.


Restoring a Mirrored Volume (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring a Mirrored Volume

If you use mirrored log volumes (see the log mode setting), volume mirrors can sometimes crash. In this case, the database continues to operate but only the part of the volume pair that is intact can be accessed. The defective mirror volume is shown as a BAD volume.

You can use the Database Manager GUI to restore a damaged mirror log volume.

· When you trigger the recovery of a log volume, it is reinitialized without the data being copied from the intact volume to the recovered volume.

· The system then writes to both log volumes sequentially.

· The volume originally marked BAD must be filled once before the contents of both volumes are identical again and both volumes can be read.

· The defective volume remains BADduring the entire reintegration phase.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

1. Choose Instance ® Recovery ® Volumes.
Select the BAD volumes that you want to recover.

2. Choose Actions ® Reintegrate to start the initialization of the mirror volume.


Displaying Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Information

To get a complete overview of all information and statistics for important database functions, select the desired database instance , and choose Instance ® View Details.

If you want to view detailed information about a particular area, choose Instance ® Information and then the desired area. Information is available for the following topics:

Displaying User Sessions

Displaying Cache Information

Displaying Data Area Information

Displaying Read and Write Operations

Displaying Log Area and Log Writer Information

Displaying the Backup History

Displaying Locks and Lock Requests

Displaying Versions


Displaying Cache Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Cache Information

You can display the hit rate of the caches in the Database Manager GUI. These hit rates show you whether the caches have been configured with enough space. The hit rates for the data cache and the converter are particularly important.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Caches.

Type | Cache type
Accesses | Total number of accesses
Successful | Number of successful accesses
Unsuccessful | Number of unsuccessful accesses
Hit Rate (%) | Hit rate (number of hits as a percentage of the total number of accesses)

The hit rate of the data cache should be at least 99% and the converter hit rate should be at least 98%.

Lower hit rates can occur for a short time, for example when tables are read for the first time, or when the table does not fit into 10% of the data cache in the case of repeated table scans.

If the values are permanently lower than the recommended percentage, this is a sign of poor performance and the database parameter CACHE_SIZE must be adjusted accordingly.


Displaying Database Sessions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Database Sessions

You can display all users that are currently connected to the database in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Sessions.

The following information is displayed:

Name | Name of the logged on user
Terminal ID | A terminal identification specific to the particular operating system.
Task ID | Number of the task
Session ID | Number of the database session
Node | Name of the database server
Catalog Cache Size | Size of catalog cache available for user

See also:

Closing a Database Session Manually


Displaying Data Area Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Data Area Information

You can display information on the size and current usage of the data area in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Data Area.

You see the following information for each data volume:

Volume Name | Name of the data volume
Total space (KB) | Total size of the data area in KB
Used space (KB) | Used data area in KB
Used space (%) | Used data area as a percentage
Free space (KB) | Free data area in KB
Free space (%) | Free data area as a percentage


Displaying Read and Write Operations (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Read and Write Operations

The database instance keeps statistics about the current number of the physical and logical reads and writes since the database instance was last started. You can display these statistics in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® I/O.

Name | Type of data area information
Logical Reads | Number of logical read requests
Logical Writes | Number of logical write requests
Physical Reads | Number of physical read requests
Physical Writes | Number of physical write requests

The following data area information is displayed:

Catalog | Data area occupied by the database catalog Frequent writes to this area indicate modifications to the data structure.
Permanent Data | Data area for permanent data.
Temporary Data | Data area on the hard disk that is used temporarily; required, for example, when constructing selected data sets.
Long Data | LONG columns
Leaf, Level n | Data tree structure The database system stores the SQL data as B* trees (see also Background Knowledge: SAP DB, Data Management Using B* Trees)
SUM | Total number of accesses
Converter | Data area occupied by the converter


Displaying Log Area and Log Writer Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Log Area and Log Writer Information

You can display information on redo log management in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Log Area.

Log writing | ON: Redo log management is activated. OFF: Redo log management is deactivated.
Log Automatic overwrite | OFF: Normal log backup operations ON: Overwrite the log area without log backups See also: Overwrite Mode
Max. size | Maximum available storage space in the log area
Backup Segment size | Size of a segment
Used size (KB) | Used space in KB
Used size in % | Used space as percentage
Not saved (KB) | Size of log area not yet saved, in KB
Not saved (%) | Size of log area not yet saved as a percentage
Log since last data backup (KB) | Number of log pages written since the last data backup
Savepoints | Number of savepoints written since last log backup
Checkpoints | Number of checkpoints written (for SAP DB versions < 7.4 only)
Physical reads | Read activities in the log area since the last restart of the database system
Physical writes | Write activities in the log area since the last restart of the database system
Queue size | Current size of the log queue
Queue overflows | Number of log queue overflows
Group commits | Number of group commits
Waits for logwriter | Number of waits for log write operations
Max. waits | Maximum number of wait states for each log page
Avg. Waits | Average number of wait states for each log page
OMS Log used | Log area used by the Object Management System (OMS)
OMS min. free pages | Minimum number of free pages for the Object Management System (OMS)

See also:

Changing Log Settings (Configuration Wizard)


Displaying the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Backup History

You can display a chronological list of all completed backup and restore operations (see also Backup History) in the Database Manager GUI.

Procedure

Choose Instance ® Information ® Backup History

You see the following information for each action:

Label | Backup ID
Action | The action (backup or restore) and the operational state in which it took place.
Beginning | Time when the action began
Result | Result
Media Name | Name of the backup medium
Log Required | Log backups required
Size (KB) | Size (KB)
Volumes | Volumes
Next Log Page | Log page
From Page | From page number
To Page | To page number

For more information, choose Actions and one of the following functions:

· ® Show details
The system displays media information. If you are using external backup tools, the system displays the external backup IDs and the availability of the backup media.

· ® Columns
You can create your own personal display variant of the backup history here.

· ® Refresh with External Backup Info
You update the backup history and the information about the backups that were performed with external backup tools.


Displaying Locks and Lock Requests (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Locks and Lock Requests

You can display information on the current locks and lock requests on the database server in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Locks.

The following information is displayed:

Max Entries | Maximum number of locks held and requested
Average Used Entries | Average number of locks held and requested
Collisions | Number of collisions
Escalations | Number of escalations
Row Locks | Row locks currently held
Table Locks | Table locks currently held
Request Timeout | This indicates the time a task may wait for the setting of a requested lock before it is canceled.


Displaying Versions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Versions

You can display the current versions of the database software and runtime environment in the Database Manager GUI.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

Choose Instance ® Information ® Versions. You see the details of the versions written in SAP DB version notation.

To display the current version of the Database Manager, choose Help ® About


Options for Diagnosing Problems (SAP Library - SAP DB)

 Entering content frame

Background documentation Options for Diagnosing Problems

In the event of errors or performance problems, the Database Manager GUI offers you the following options for diagnosing the problem.

· Reading Database Files

· Checking Database Servers

· Checking Database Structures

· Activating the Database Trace

· Using the Command Line Version of the Program

· Displaying OMS Caches

· Displaying OMS Class Containers

· Activating the OMS Monitor


Reading Database Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Reading Database Files

The SAP DB database system has a number of database files. These include the Database Manager files.

You can access the existing database files from the Database Manager GUI.

Procedure

Choose Instance ® Check ® Diagnosis Files.

Select the file you want.


Checking Database Servers (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Checking Database Servers

The Database Manager GUI provides you with an overview of the operating system resources that the database instance is using, how the database sessions have been distributed among the threads, and the status of the active database sessions.

Additional functions are available, but these are mainly reserved for support employees and developers.

Prerequisites

The database instance is in the operational state ONLINE or ADMIN.

Procedure

1. Choose Instance ® Check ® Database Server.

2. Select the type of information you want.

3. To display the details, choose Actions ® View.


Checking Database Structures (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Checking Database Structures

You can use the Database Manager GUI to check database structures. If there are serious inconsistencies, the database instance must be recovered in the same way as after a disk failure.

When you check the database structures in the operational state ADMIN, any free memory pages that are wrongly recorded as used because the database has been stopped incorrectly are released to free space management.

We recommend that you perform this action before each complete data backup.

Prerequisites

The database instance is the ONLINE or the ADMIN operational state.

Procedure

1. Choose Instance ® Check ® Database Structure.

2. Choose Actions ® Execute.

Result

The information supplied by the database kernel is written to the Database Errors file.

You can analyze this file as described in Reading Database Files.


Activating the Database Trace (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating the Database Trace

The Database Manager GUI gives you the option of activating the database trace function if errors occur.

Use this function when asked to do so by your SAP DB Support organization. Only activate the database trace function if it is really necessary, since it seriously affects the performance of the database instance.

Deactivate the database trace function as soon as the actions needed for the analysis have been logged.

Procedure

You can execute the log functions below either individually or in a combination that you can define yourself.

Logging Database Statements in General

1. Choose Instance ® Check ® Database Trace.

2. On the Options tab page, select the required database trace options in the list. If the options support the selection of a trace level, the system default value is displayed in the column Level.

3. Choose Actions ® Selected Items ON to activate the database trace for the chosen database trace options.

If you want to change the trace level for the selected database trace options, choose Actions ® Selected Items ON with Level... You can now select a different trace level. The higher the trace level, the greater amount of detail is provided in the information collected by the database trace.

Choose Actions ® Selected Items OFF to deactivate the database trace.

Logging Database Statements in a Specific User Session

The database trace is written for all user sessions by default. The default setting can be changed:

1. Choose Instance ® Check ® Database Trace.

2. Choose the Advanced tab page and select Trace session.

3. Decide whether the database trace is to be written for the current session or for a specific user session. In this case, enter the ID of the user session (see Displaying User Sessions).

4. Choose Actions ® Set Advanced Options.

Logging the Occurrence of Specific Errors

1. Choose Instance ® Check ® Database Trace.

2. On the Advanced tab page, select Stop on error. Enter the code of the error whose occurrence is to stop the creation of the database trace.

3. Then choose Actions ® Flush to write the information still contained in the buffer to the trace and therefore update the database trace before the log file is created.

Creating and Displaying the Database Trace Log

1. Choose Instance ® Check ® Database Trace.

2. On the Protocol tab page, select the required options.

3. Then choose Actions ® Flush to write the information still contained in the buffer to the trace and therefore update the database trace before the log file is created.

4. Choose Actions ® Make Protocol. The database trace is then converted to a legible format.

5. To open the log, choose Instance ® Check ® Diagnosis Files. Select the Kernel Trace Protocol file and choose Actions ® View.


Using the Command Line Version (Database Manager CLI) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Using the Command Line Version (Database Manager CLI)

You can call the command line version of the Database Manager, the Database Manager CLI, from the Database Manager GUI.

Procedure

1. Choose Instance ® Command Line.

2. Enter the required DBM commands in the line Command.

3. Choose Actions ® Execute.


Displaying OMS Caches (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying OMS Caches

This Database Manager GUI function supports liveCache performance analysis.

Prerequisites

The current database instance is a liveCache instance. You are in the operational state ONLINE.

Procedure

Choose Instance ® Information ® OMS Caches to display the OMS caches.


Displaying OMS Class Containers (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying OMS Class Containers

This Database Manager GUI function supports liveCache performance analysis.

Prerequisites

The current database instance is a liveCache instance. You are in the operational state ONLINE.

Procedure

Choose Instance ® Information ® OMS Class Containers to display the information about the class containers.


Activating the OMS Monitor (SAP Library - SAP DB)

 Entering content frame

Background documentation Activating the OMS Monitor

This Database Manager GUI function supports the liveCache performance analysis.

Prerequisites

The current database instance is a liveCache instance. You are in the operational state ONLINE.

Procedure

Choose Instance ® Information ® OMS Monitor to activate the OMS Monitor.


Updating the Database Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating the Database Software

After you have updated the database software, you can use the Database Manager GUI to make sure that the database instance recognizes the new software version.

Procedure

1. Update the SAP DB database software.

2. Start the database instance.
The first time the Database Manager is started after update of the database software, it automatically adjusts the kernel parameters of the database instance to this new version.

3. To update the system tables, choose Instance ® Configuration ® Upgrade System Tables.

Result

The Database Manager creates a copy of the parameter file each time a parameter is changed.

UNIX: /usr/spool/sql/config/<database_name>.<sequential_number>
Windows NT/Windows 95: %DBROOT%\CONFIG\<database_name>.<sequential_number>

<sequential number>: Version of the copy, starting with 01

If parameter errors occur, the operation can be undone by restoring the original parameter file. To do this, use the Database Manager CLI program to copy the file <database_name>.<sequential_number> (copy of parameter file) back to <database_name> (active parameter file).


Updating the System Tables (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating the System Tables

You can use the Database Manager GUI to update the system tables when you update the database software.

Prerequisites

The database instance is in the operational state ONLINE.

Procedure

1. Choose Instance ® Configuration ® Upgrade System Tables.

2. Start the update of the system tables. The Database Manager determines the required DBA users (SYSDBA and DOMAIN). If this is not possible, you are prompted to provide the users yourself.

Result

The system tables are loaded and updated. The log dbm.ins (Installation Protocol) is displayed.

If an error occurs, the ERRORstatus appears. In this case, analyze the Installation Protocol as described in Reading Database Files.


Accessing the SQL Studio Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Accessing the SQL Studio Program

You can call the query tool SQL Studio from the Database Manager GUI. This program enables you to access the data of a SAP DB database instance.

Prerequisites

You have the authorization of a database user of this database instance.

Procedure

Choose Tools ® SQL Studio.


Screen Areas of the Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation Screen Areas of the Database Manager GUI

The screen of the Database Manager GUI is structured into eight different areas. You can change the size of these screen areas.

1
2
3 | 4
5 | 6
7 |  | 8

Contents of the Screen Areas

No. | Name of the Window | Description
1 | Menu bar | Selection of functions and displays for the current database instance The menu bar dynamically adjusts to the selected functions.
2 | Icon bar | The icon bar contains icons you can use to call up functions shown on the menu bar for the current database instance.
3 | Directory structure of the registered database instances | Organization of the registered database instances (as in Windows Explorer) You can show or hide the directory structure. To do this, choose View ® Tree and select or deselect Tree.
4 | List of registered database instances | Database instances registered in the Database Manager, their logon status and operational states If a database instance has the operational state ONLINE, you also see an overview of its statistics and other important data.
5 | Menu list of the current database instance | The name of the chosen database instance is displayed. You can display or hide this menu list. To do this, choose View ® Menu and select or deselect Menu.
6 | Output area | Central screen area Contains input fields and output values.
7 | Message output area | Display of general and error messages
8 | Display of the database name | Name of the current database instance, possibly including the name of the database server and its operational state


Web DBM (SAP Library - SAP DB)

 Entering content frame

Component documentation Web DBM

The Database Manager is the database administration tool for SAP DB database instances. You can use this tool to create and monitor database instances on local or remote servers. You can back up the data in the database instances, and recover it, if necessary.

Implementation Considerations

You can operate the Database Manager as a command line tool (Database Manager CLI), as a graphical user interface (Database Manager GUI), or as a Web-based tool (Web DBM). All three types of this program offer the same range of functions.

You can install the Database Manager CLI and the Web DBM on all operating systems supported by the SAP DB database system. The Database Manager GUI can run on Microsoft Windows only.

Each type of the Database Manager can administer SAP DB database instances on all operating systems and platforms supported by the SAP DB database system.

You can use Version 7.4 of the Database Manager for all SAP DB database systems from Version 7.1.

Working with the Database Manager requires a thorough working knowledge of database administration.

You can download the Web DBM program free of charge from the SAP DB Homepage http://www.sapdb.org.

The Web Tools Installation Guide and general information about the SAP DB Database System is on the SAP DB Homepage, under Documentation.

Documentation

The screen settings and procedures in the Web DBM largely resemble those in the Database Manager GUI. For this reason, use the Database Manager GUI documentation when you work with the Web DBM. Always leave out the first menu option when you specify paths for executing commands in the Web DBM.

Differences Between the Web DBM and the Database Manager GUI

You can use the Database Manager GUI to monitor multiple database instances at the same time. The Web DBM only allows you to log on to one database instance at a time, however, you can still monitor multiple database instances simultaneously. To do this, open as many browser windows as you need with the Web DBM, and log on to each database instance in a different window.

Unlike the Database Manager GUI, you may experience timeouts when you work with the Web DBM. A timeout breaks the connection to the database instance, in which case you need to log on again.


Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager CLI

Purpose

The Database Manager is the administration tool for SAP DB database instances. You can use this tool to create and monitor database instances on local and remote hosts. You can back up the data from database instances, and recover the data, if necessary.

Implementation Considerations

The database management tool Database Manager can be called as a graphical user interface (Database Manager GUI), as a Web-based tool (Web DBM), or as a command-line oriented tool (Database Manager CLI).All three versions of this program offer the same range of functions.

The Database Manager CLI and the Web DBM can be installed on all operating systems supported by the SAP DB database system. The Database Manager GUI can run on Microsoft Windows only.

Each version of the Database Manager can be used for the administration of SAP DB database instances on all operating systems supported by the SAP DB database.

You can use Version 7.4 of the Database Manager for all SAP DB database systems from Version 7.1.

A sound knowledge of database administration is required to work with the Database Manager.

You can download the Database Manager CLI program free of charge from the SAP DB Homepage http://www.sapdb.org. It is a part of the software package for the database kernel, which means it is included in the installation profiles All and Server.

For general information on the SAP DB database system, see the documentation The SAP DB Database System on the SAP DB homepage under Documentation.

The Database Manager CLI, Version 7.4, is described in the following topics:

Accessing the Database Instance

Analyzing the Database Instance

Backing up and Restoring Database Instances

Configuring Database Instances

Configuring the Database Manager

Displaying the Version Information

Ending the Database Manager

Executing the liveCache Initialization Script

Functions for Database Operation

Installation and Registration Management

List of the DBM Commands

Logging On to the Operating System

Managing the DBM Operators

See also:

Overview of All DBM Commands


Functions of the Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions of the Database Manager CLI

The Database Manager CLI is an easy-to-use tool that can manage any number of local or remote database instances . These can be managed from the command line. The program is suitable for both interactive and background operation.

The Database Manager CLI is the client program of the Database Manager, which enables you to connect to the DBM Server and exchange data with it. The various functions of the program can be called both using options when calling the Database Manager CLI and using DBM commands .

Calling up the Database Manager CLI is equivalent to opening a session. Once the entered commands have been processed, the session with the Database Manager is closed.

A request is directed to the Database Manager using a DBM command and the corresponding options. This then forwards the reply relating to this command and the specified options. As well as information on the state of the database instance, the reply contains data in edited form ( Reply Format ).


Operator Management in the Database Manager (SAP Library - SAP DB)

 Entering content frame

Background documentation Operator Management in the Database Manager

Users who work with the database administration tool Database Manager are called Database Manager operators (DBM operators). Depending on their operator properties, they can start and stop database instances, perform backups, change database parameters, and so on.

DBM operators are not database users. You need to create database users in order to work on a database instance.

See also: The SAP DB Database System


Operator Properties (SAP Library - SAP DB)

 Entering content frame

Background documentation Operator Properties

You can assign operator properties to DBM operators . (See also: Changing DBM Operator Data .)

Properties that can be assigned to a DBM operator:

USERID, PASSWORD | Name and password for the identification of the operator.
SECONDPASSWORD | A second password used to allow other persons to work temporarily with an operator account, without needing to reveal or change the original password to do this (for example, for support purposes)
DISABLED | The operator is locked.
SERVERRIGHTS | Operator authorizations in the Database Manager
COMMENT | More detailed description of the operator


Operator Authorizations (SAP Library - SAP DB)

 Entering content frame

Background documentation Operator Authorizations

An operator authorization is an authorization to execute certain DBM commands in the Database Manager.

An operator authorization may cover more than one DBM command and one DBM command may have more than one authorization assigned to it.

The operator authorizations assigned to an operator are stored in the Database Manager as SERVERRIGHTS.

The Database Manager recognizes the following Operator Authorizations:

Displaying Status Information | DBInfoRead
Executing the LOAD Program | ExecLoad
Executing Operating System Commands | SystemCmd
Performing Backups | Backup
Installation Management | InstallMgm
Loading the System Tables | LoadSysTab
Starting the Database Instance | DBStart
Stopping the Database Instance | DBStop
Managing DBM Operators | UserMgm
Restoring Backups | Recovery
Accessing Database Files (Reading Only) | DBFileRead
Accessing Database Parameters (Checked Writing) | ParamCheckWrite
Accessing Database Parameters (Reading and Writing) | ParamFull
Accessing Database Parameters (Reading Only) | ParamRead
Access to SQL Session | AccessSQL
Access to Utility Session | AccessUtility


Displaying Status Data: DBInfoRead (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying Status Data: DBInfoRead

Operators who have been assigned the DBInfoRead operator authorization can execute the following DBM commands :

Activating a Database Event | event_set
Change Date of the Media Definition File | medium_date
Change Date of the Backup History | backup_history_date
Displaying the Automatic Log Backup Function | autolog_show
Displaying the Media Data | medium_get
Displaying the Backup History | backup_history_list
Displaying the Database Kernel Variant | db_speed
Displaying the Operational State of the Database Instance | db_state
Displaying External Backup IDs | backup_ext_ids_list
Displaying Information About the Database Instance | show
Displaying Status Information for the Database Instance | info
Terminating a Database Event Session | event_release
Terminating an SQL Session | sql_release
Scrolling in the External Backup IDs | backup_ext_ids_listnext
Scrolling in the Information About the Database Instance | show_next
Scrolling in the Status Information of the Database Instance | info_next
Scrolling in the Backup History | backup_history_listnext
Deactivating a Database Event | event_delete
Opening an SQL Session | sql_connect
Releasing the Memory Occupied by the External Backup IDs | backup_ext_ids_forget
Fetching the Backup History | backup_history_open
Fetching External Backup IDs | backup_ext_ids_get
List of All Defined Backup Media | medium_getall
List of Activated Database Events | event_list
List of the Information About the Database Instance | show_list
Closing the Backup History | backup_history_close
Copying an Existing Media Definition | medium_migrate
Waiting for a Database Event | event_wait


Executing the Program LOAD: ExecLoad (SAP Library - SAP DB)

 Entering content frame

Background documentation Executing the Program LOAD: ExecLoad

Operators who have been assigned the ExecLoad operator authorization can execute the following DBM commands:

Loading the System Tables | load_systab
Loading SAP-Specific Tables | load_r3tab
Starting the PythonLOAD Program | exec_load


Executing Operating System Commands: SystemCmd (SAP Library - SAP DB)

 Entering content frame

Background documentation Executing Operating System Commands: SystemCmd

Operators who have been assigned the SystemCmd operator authorization can execute the following DBM command :

Executing the liveCache Initialization Script

exec_lcinit


Performing Backups: Backup (SAP Library - SAP DB)

 Entering content frame

Background documentation Performing Backups: Backup

Operators who have been assigned the Backup operator authorization can execute the following DBM commands :

Change Date of the Media Definition File | medium_date
Change Date of the Backup History | backup_history_date
Defining or Changing a Backup Medium | medium_put
Displaying Current Information About the Database Instance | db_restartinfo
Displaying External Backup IDs | backup_ext_ids_list
Displaying the Automatic Log Backup Function | autolog_show
Displaying the Media Data | medium_get
Displaying the Backup History | backup_history_list
Displaying the Backup Information in the Operational State OFFLINE | medium_labeloffline
Displaying the Backup Information in the Operational State ONLINE or ADMIN | medium_label
Displaying the Current Status of a Backup Check | recover_state_check
Displaying the Current Backup Status | backup_state
Deactivating the Automatic Log Backup | autolog_off
Terminating a Service Session | service_release
Terminating an Interrupted Automatic Log Backup | autolog_cancel
Terminating an Interrupted Backup | backup_cancel
Terminating an Interrupted Restore or Backup Check | recover_cancel
Terminating a Utility Session | util_release
Scrolling in the External Backup IDs | backup_ext_ids_listnext
Scrolling in the Backup History | backup_history_listnext
Activating the Automatic Log Backup | autolog_on
Opening a Service Session | service_connect
Opening a Utility Session | util_connect
Continuing a Parallel Restore or Backup Check | recover_ignore
Continuing the Backup Without the Medium Last Reported as Full | backup_ignore
Releasing the Memory Occupied by the External Backup IDs | backup_ext_ids_forget
Fetching the Backup History | backup_history_open
Fetching External Backup IDs | backup_ext_ids_get
List of All Defined Media | medium_getall
Deleting a Backup Medium | medium_delete
Checking a Backup | recover_check
Closing the Backup History | backup_history_close
Backing Up to a Succeeding Medium | backup_replace
Backing Up the Database Instance | backup_start
Copying an Existing Media Definition | medium_migrate
Restoring or Checking a Backup with Succeeding Medium | recover_replace


Installation Management: InstallMgm (SAP Library - SAP DB)

 Entering content frame

Background documentation Installation Management: InstallMgm

Operators who have been assigned the InstallMgm operator authorization can execute the following DBM commands:

Changing a Configuration Parameter of the Database Manager | dbm_configset
Displaying a Configuration Parameter of the Database Manager | dbm_configget
Initializing the Database Parameters for a New Database Instance | param_init
Copying a Database Parameter File | param_copy
Deleting the Current Database Instance | db_drop
Deleting the Database Parameter File | param_rmfile
Registering the Current Database Instance | db_reg


Loading the System Tables: LoadSysTab (SAP Library - SAP DB)

 Entering content frame

Background documentation Loading the System Tables: LoadSysTab

Operators who have been assigned the LoadSysTab operator authorization can execute the following DBM commands :

Loading the System Tables | load_systab
Loading SAP-Specific Tables | load_r3tab


Starting the Database Instance: DBStart (SAP Library - SAP DB)

 Entering content frame

Background documentation Starting the Database Instance: DBStart

Operators who have been assigned the DBStart operator authorization can execute the following DBM commands :

Starting the Database Instance | db_start
Transferring to the ONLINE Operational State | db_online


Stopping the Database Instance: DBStop (SAP Library - SAP DB)

 Entering content frame

Background documentation Stopping the Database Instance: DBStop

Operators who have been assigned the DBStop operator authorization can execute the following DBM commands :

Restarting the Database Instance | db_restart
Stopping the Database Instance | db_stop
Transferring to the ADMIN Operational State | db_admin
Transferring to the OFFLINE Operational State | db_offline
Deleting Runtime Information After a Database Error | db_clear
Using the Database Console | db_cons


Managing DBM Operators: UserMgm (SAP Library - SAP DB)

 Entering content frame

Background documentation Managing DBM Operators: UserMgm

DBM operators who have been assigned the UserMgm operator authorization can execute the following DBM commands :

Changing DBM Operator Data | user_put
Creating DBM Operators | user_create
Displaying Operator Authorizations | user_getrights
Displaying Operator Data | user_get
List of Registered Database Users | user_getall
Deleting DBM Operators | user_delete


Restoring Backups: Recovery (SAP Library - SAP DB)

 Entering content frame

Background documentation Restoring Backups: Recovery

Operators that have been assigned the Recovery operator authorization can execute all of the commands listed under the Backup . They can additionally execute the following DBM commands :

Displaying the Current Recovery Status | recover_state
Displaying Information About the Database Instance | db_restart_info
Restoring the Database Instance | recover_start
Restoring a Database Parameter File | recover_config


Accessing Database Files (Reading Only): DBFileRead (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing Database Files (Reading Only): DBFileRead

Operators who have been assigned the DBFileRead operator authorization can execute the following DBM commands:

Scrolling Through the Further Contents of a Database File | file_getnext
Opening a Database File | file_getfirst
Packing Database Files | diag_pack
Backing Up a Database File | file_backup
Restoring a Database File | file_restore


Accessing Database Parameters (Checked Writing): ParamCheckWrite (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing Database Parameters (Checked Writing): ParamCheckWrite

Operators that have been assigned the ParamCheckWrite operator authorization can execute all of the commands listed under the ParamRead . They can additionally execute the following DBM commands :

Changing the Value of a Database Parameter | param_put
Changing Volume Parameters | param_addvolume
Confirming Changes to the Database Parameter File | param_commitsession
Correcting Parameters | param_putconfirm
Deleting Volume Parameters | param_delvolume
Checking All Database Parameters | param_checkall
Resetting the Parameter File to a Previous Version | param_restore


Accessing Database Parameters (Reading and Writing): ParamFull (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing Database Parameters (Reading and Writing): ParamFull

Operators that have been assigned the ParamFull operator authorization can execute all of the commands listed under the ParamRead and ParamCheckWrite operator authorizations. They can additionally execute the following DBM commands :

Directly Changing a Value in the Database Parameter File | param_directput
Adding a Volume | db_addvolume
Deleting a Parameter | param_directdel


Accessing Database Parameters (Reading Only): ParamRead (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing Database Parameters (Reading Only): ParamRead

Operators who have been assigned the ParamRead operator authorization can execute the following DBM commands :

Terminating a Parameter Session | param_abortsession
Displaying All Data for a Database Parameter | param_getfull
Displaying All Properties of a Database Parameter | param_getproperties
Displaying All Parameters of the Current Database Parameter File | param_directgetall
Displaying the Data for All Database Parameters | param_extgetall
Displaying the Data for All Volume Parameters | param_getvolsall
Displaying the Data for Individual Volume Parameters | param_getvolume
Displaying the Current Value of a Database Parameter | param_getvalue
Displaying the Data Type of a Database Parameter | param_gettype
Displaying the Stored Explanatory Text | param_getexplain
Displaying the Stored Help Text | param_gethelp
Displaying the System Default Value | param_getdefault
Displaying a Value from the Database Parameter File | param_directget
Displaying Individual Data for a Database Parameter | param_extget
Scrolling in the Database Parameter History | param_gethistorynext
Opening a Parameter Session | param_startsession
List of Available Parameter Files | param_versions
Opening the Database Parameter History | param_gethistory


Access to SQL Session: AccessSQL (SAP Library - SAP DB)

 Entering content frame

Background documentation Access to SQL Session: AccessSQL

Operators who have been assigned the AccessSQL operator authorization can execute the following commands:

Displaying the Result Set Structure | sql_info
Updating the Optimizer Statistics | sql_updatestat
Updating the Optimizer Statistics with the XPU Program | exec_xpu
Scrolling in the Additional Result Data | sql_fetch
Opening an SQL Session | sql_connect
Closing an SQL Session | sql_release
Transferring an SQL Statement | sql_execute
Recreating a Damaged Index | sql_recreateindex


Access to Utility Session: AccessUtility (SAP Library - SAP DB)

 Entering content frame

Background documentation Access to Utility Session: AccessUtility

Operators who have been assigned the AccessUtility operator authorization can execute the following DBM commands :

Activating a New Database Instance | util_activate
Displaying a Physical Database Page | util_getpage
Terminating a Utility Session | util_release
Opening a Utility Session | util_connect
Adding a Volume | db_addvolume
Writing a Physical Database Page | util_putpage
Transferring a Utility or SQL Command | util_execute


Opening a DBM Server Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a DBM Server Session

Use

You open a session with the DBM Server and define to which database instance the following transferred options and commands refer. If the database instance is on a remote server, you must specify the server name <server_node> in addition to the name of the database instance <database_name>.

A DBM Server session is the prerequisite for Logging on to the Database Manager Program and the execution of most DBM Commands .

Prerequisites

You have installed the Database Manager CLI program on your server. It is part of the SAP DB database software.

Syntax

dbmcli – d <database_name> [-n <server_node>]

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .

Syntax

dbmcli –d <database_name>


Logging On to the Database Manager (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Logging On to the Database Manager

Use

The Database Manager operator specified using <userid> logs on to the Database Manager program.

For local communication, the operator is already logged on to the operating system.

Prerequisites

Logging on to the Database Manager requires a session with the DBM Server . You can open this session before logging on to the Database Manager or together with the logon.

Two Step Logon

You can first open the session with the DBM Server and then log on to the Database Manager in a second step.

Opening a DBM Server Session

dbmcli – d <database_name> [-n <server_node>]

Logging On to the Database Manager

user_logon <userid>,<password>

One Step Logon

Using the option –u | -U, you can perform both logon steps at the same time. The Database Manager implicitly executes the DBM command user_logon.

dbmcli -u [<userid>,<password>] –d <database_name>

or logon with XUSER: dbmcli -U [<user_key>] –d <database_name>

  • -u: explicit specification of the DBM operator identified with <userid> and <password>

If you use –u without specifying <userid>,<password>, the Database Manager prompts you to enter the operator name and password. In this way you can avoid the operator password being visible in the command line, command history, and the operating system process list.
  • -U: Logging on with a user stored in the XUSER file

If you do not specify a <user_key> when using –U, the Database Manager uses the data under the DBMUSR XUSER key.

You can store operator details for various tasks with the help of the program XUSER and use them for logging on.

Note the different meanings of the command with uppercase and lowercase specification.

See also: User manual

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Command Structure (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Command Structure

Use

Options and a maximum of one DBM command with its parameters can be transferred to the program Database Manager CLI.

A DBM command can also contain line feeds.

See also: Input Help

If you use options with optional parameters, mark the beginning of the DBM command with the option –c (see Indicate as DBM command: -c).
By doing so, you avoid the Database Manager program interpreting the beginning of the DBM command as a parameter of the previously specified option.

Prerequisites

Check under Control Panel ® Services that the service XServer has started
(status: started).

Syntax

dbmcli [<options>] [<command>]

Reply

See Reply Format


Input Help (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Input Help

The following input help is available for the script mode and the session mode :

Local System Call: !

Comment: #

Linking Lines: /

Linking Lines: <


Comment: # (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Comment: #

A command which starts with a number sign is ignored.


Local System Call: ! (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Local System Call: !

The command to be entered is preceded by an exclamation mark.

The command is not transferred to the Database Manager but is executed in the local command interpreter of the operating system.


Linking Lines: / (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Linking Lines: /

Prerequisites

You are working in session mode or script mode .

If you end a line within a multiple line DBM Command with a slash, the system recognizes that the command is not complete. It is not executed when a line feed is inserted.

Only the entry of a line feed without a preceding slash indicates to the system that the command is complete. It is then transferred to the Database Manager.


Linking Lines: < (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Linking Lines: <

Using the special character less than (<), you can transfer commands consisting of several lines to the Database Manager.

Syntax

'<'<stop-token> <command-begin>

The character string <command-begin> is linked to the continuation lines until a line is found which starts with <stop-token>.

All lines are separated from one another by a line feed.

The line with <stop-token> is not incorporated into the command.


Options (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options

You can use the following options in the Database Manager CLI (Command Structure):

Deleting XUSER Data | -ud
Displaying the Parameters for an XUSER Entry | -up
Displaying XUSER Data | -ul
Indicate as DBM Command | -c
Installation Directory of the Database Instance | -R <inst_path>
Local Operation | -s
Logging On to the XUSER Program | -ux
Name of the Database Instance | -d <database_name>
Name of the Database Server | -n <server_node>
Name of the Input Script | -i <file_name>
Name of the Log File | -t <file_name>
Name of the Output File | -o <file_name>
Opening a Service Session | -uSRV
Opening a Utility Session | -uUTL | -UUTL
Opening an SQL Session | -uSQL | -USQL
Storing XUSER Data | -us
Version of the Database Manager | -V
XUSER Key | -uk

If you use options with optional parameters, mark the beginning of the DBM command with the option –c (see Indicate as DBM command: -c).
By doing so, you avoid the Database Manager program interpreting the beginning of the DBM command as a parameter of the previously specified option.

dbmcli -uUTL samplename,secret -d myDB

This calls the Database Manager (DBMCLI) and establishes a utility session for user samplename , password secret, with registered database instance myDB.


Logging On to the XUSER Program: -ux (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Logging On to the XUSER Program: -ux

Use

Option in the Database Manager CLI ( Command Structure ).

You authorize yourself with the user under the XUSER key DEFAULT.

See also: User manual

Syntax

-ux <default_userid>,<password>


Displaying the Parameters for an XUSER Entry: -up (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Parameters for an XUSER Entry: -up

Use

Option in the Database Manager CLI.

You store the connection parameters for an entry in the XUSER program.

See also: User manual

Prerequisites

You are also using the option -us (Storing XUSER data) at the same time.

Syntax

-up <param>=<value>; ...;

<param> | SQLMODE | TIMEOUT | CACHELIMIT | ISOLATION | DBLOCALE
<value> | for SQLMODE: INTERNAL, ANSI, DB2, ORACLE,SAPR3 for ISOLATION: 0,1,2,3,10,15,20,30


Display of XUSER Data: -ul (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Display of XUSER Data: -ul

Use

Option in the Database Manager CLI ( Command Structure ).

You request the operator data stored in the XUSER program.

The system displays a table of the existing XUSER keys with the assigned operator names.

See also: User manual

Prerequisites

You are also using option -ux (Logon to XUSER) at the same time.

Syntax

-ul


Opening a Service Session: -uSRV (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Opening a Service Session: -uSRV

Use

Option in the Database Manager CLI

Certain DBM commands require a service session before they can be executed.

If you specify this option, the DBM command to open a service session is executed implicitly.

When you end the Database Manager CLI, the service session is also ended.

Prerequisites

You are also using the option -d at the same time to specify a database instance and the option -u to log on to the Database Manager.

Syntax

-uSRV


Opening an SQL Session: -uSQL (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Opening an SQL Session: -uSQL

Use

Option in the Database Manager CLI.

Certain DBM commands require an SQL session before they can be executed.

If you specify this option, the DBM command to open an SQL session is executed implicitly. The SQL session is established with the transferred operator data.

If no operator is specified with this option, the Database Manager CLI uses the data of the current DBM operator .

Operator details can be stored for various tasks with the help of the program XUSER and used for logging on.

Note the different meanings of the command with uppercase and lowercase specification.
-uSQL: Explicit specification of the operator with the <userid> and <password>
-USQL: Logon with an operator stored in the XUSER file.

See also: User manual

Prerequisites

You are also using the option -d at the same time to specify a database instance and the option -u to log on to the Database Manager.

Syntax

-uSQL [<userid>,<password>]

or logon with XUSER: -USQL <user_key>


Opening a Utility Session: -uUTL (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Opening a Utility Session: -uUTL

Use

Option in the Database Manager CLI.

A utility session is a prerequisite for the execution of certain DBM commands .

If you specify this option, the DBM command to open a utility session is executed implicitly. A utility session is established with the transferred operator data.

If no operator is specified with -uUTL, the Database Manager CLI uses the data of the first DBM operator .

If you do not specify a <user_key> when using –UUTL, the Database Manager CLI uses the data under the XUSER key c.

Operator details can be stored for various tasks with the help of the program XUSER and used for logging on.

Note the different meanings of the command with uppercase and lowercase specification.
-uUTL: Explicit specification of the operator with the <userid> and <password>
-UUTL: Logon with an operator stored in the XUSER file.

See also: User manual

Prerequisites

You are also using the option -d at the same time to specify a database instance and the option -u to log on to the Database Manager.

Syntax

-uUTL [<userid>,<password>]

or logon with XUSER: -UUTL [<user_key>]


Installation Directory of the Database Software: -R (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Installation Directory of the Database Software: -R

Use

Option in the Database Manager CLI.

On servers that contain several versions of the database system software it is necessary to address the correct version of the database. Enter the path of the version you want under <inst_path>.

Syntax

-R <inst_path>

dbmcli -R "C:\Program Files\SAP DBTech\V72"

When you set up a session there is a check whether the specified version on the server is recorded in the list of registered versions. If it is not, the session connection is refused.

When you call the Database Manager CLI with the option -R, a specified database version can only be connected if the database software has been correctly registered.

If you specify the option -d and the name of a database instance in addition to the option –R, option -R is ignored.In this case, the Database Manager CLI uses the version of the database software assigned to the specified database instance.


Indicator as DBM Command: -c (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Indicate as DBM Command: -c

Use

Option in the Database Manager CLI.

Use the option –c to logically delimit a Database Manager CLI option with optional parameters and a DBM command from each other. The Database Manager CLI program interprets all specifications following –c as a DBM command.

Syntax

-c <DBM_command>

If you do not specify -c between the option with optional parameters and the DBM command, the beginning of the DBM command is interpreted as an operator name/password combination for the option –uSQL:

d:\v74>dbmcli -d a73 -u dbm,dbmp -uSQL sql_execute select * from tables

ERR

-24988,ERR_SQL: sql error

-4008,Unknown user name/password combination

You mark the beginning of the DBM command with the option –c. The default value is used for the –uSQL option.

d:\v74>dbmcli -d a73 -u dbm,dbmp -uSQL –c sql_execute select * from tables

OK

...


Local Operation: -s (SAP Library - SAP DB)

 Entering content frame

Background documentation Local Operation: -s

Use

Option in the Database Manager CLI

If you call the Database Manager CLI with this option, no communication takes places with a DBM Server . In this case, you use the internal DBM Server functions of the Database Manager CLI. This means that you are also logged on to the operating system and can execute all of the commands that would require a logon to the operating system without the use of the -s option.

Syntax

-s


Deleting XUSER Data: -ud (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting XUSER Data: -ud

Use

Option in the Database Manager CLI

You delete user data from the program XUSER.

You can delete the following user data:

  • User data for a particular combination of the name of a database instance and the server on which this database instance is running
  • User data for an XUSER key

See also: User manual

Deleting User Data for a Particular Combination of Database Instance and Database Server

Syntax

-ud

You authorize yourself with the user currently stored in the XUSER program.

-d <database_instance> [-n <server_node>] -u <userid>,<password> -ud

or

You authorize yourself with the user under the XUSER key DEFAULT.

-d <database_name> [-n <server_node>] -ux <default_userid>,<password> -ud

Deleting User Data Using an XUSER Key

Syntax

-ud

You authorize yourself with the user currently stored in the XUSER program.

-uk <userkey> -u <userid>,<password> -ud

or

You authorize yourself with the user under the XUSER key DEFAULT.

-uk <userkey> -ux <default_userid>,<password> -ud


Name of the Output File: -o (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Name of the Output File: -o

Use

Option in the Database Manager CLI.

All details are written to the file specified as <file_name>.

Syntax

-o <file_name>


Name of Database Instance: -d (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Name of Database Instance: -d

Use

Option in the Database Manager CLI.

The name specified for the database instance in <database_name> applies for the whole session. All database-specific DBM commands relate to this database instance.

When you set up a session there is a check whether the specified database instance on the server is recorded in the list of registered database instances. If it is not, the session connection is refused.

Prerequisites

The database instance specified in <database_name> exists (Creating a Database Instance).

Syntax

-d <database_name>


Name of the Log File: -t (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Name of the Log File: -t

Use

Option in the Database Manager CLI

All commands transferred to the Database Manager and the respective replies are logged in the specified file <file_name>. The existing content of the file is retained.

Syntax

-t <file_name>


Name of the Database Server: -n (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Name of the Database Server: -n

Use

Option when opening a session with the Database Manager CLI.

The DBM Server program on the database server specified with <server_node> is addressed.

Prerequisites

Program X-Server is active on node <server_node> (Status: Started).

See also: User manual

Syntax

-n <server_node>


Name of the Input Script: -i (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Name of the Input Script: -i

Use

Option in the Database Manager CLI

If you specify the option –i, the DBM command(s) listed in the file <file_name> are processed.

Syntax

-i <file_name>


Storing XUSER Data: -us (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Storing XUSER Data: -us

Use

Option in the Database Manager CLI.

You store user data in the XUSER program.

You can store this data as

  • User data for a particular combination of the name of a database instance and the server on which this database instance is running
  • User data for an XUSER key

See also: User manual

Storing user data for a particular combination of the name of the database instance and the database server

Prerequisites

You use the options -d (Name of the Database Instance) and, optionally, -n (Name of the Database Server) at the same time.

You authorize yourself for the XUSER program with the currently stored user or the user under the XUSER key DEFAULT.

Syntax

-us <new_userid>,<new_password>

You authorize yourself with the user currently stored in the XUSER program

-d <database_instance> [-n <server_node>] [-u <userid>,<password>] -us <new_userid>,<new_password>

or

You authorize yourself with the operator under the XUSER key DEFAULT

-d <database_instance> [-n <server_node>] [-ux <default_userid>,<password>] -us <new_userid>,<new_password>

Storing user data using an XUSER key

Prerequisites

You use the option -uk (XUSER key) at the same time.

You authorize yourself for the XUSER program with the currently stored user or the user under the XUSER key DEFAULT.

Syntax

-us <new_userid>,<new_password>

You authorize yourself with the user currently stored in the XUSER program.

-uk <userkey> [-u <userid>,<password>] -us <new_userid>,<new_password>

or

You authorize yourself with the user under the XUSER key DEFAULT.

-uk <user_key> [-ux <default_userid>,<password>] -us <new_userid>,<new_password>


Version of the Database Manager: -V (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Version of the Database Manager: -V

Use

Option in the Database Manager CLI.

You request the version of the Database Manager.

Syntax

-V


XUSER Key: -uk (SAP Library - SAP DB)

 Entering content frame

Procedure documentation XUSER Key: -uk

Use

Option in the Database Manager CLI.

You specify the XUSER key under which the user data is to be stored in the XUSER program.

See also: User manual

Syntax

-uk <user_key>


DBM Commands (SAP Library - SAP DB)

 Entering content frame

Background documentation DBM Commands

Use

DBM commands are commands in the Database Manager CLI for managing database instances.

You can use these to perform the following tasks:

Accessing the Database Instance

Analyzing the Database Instance

Backing up and Recovering Database Instances

Configuring Database Instances

Configuring the Database Manager

Displaying the Version Information

Ending the Database Manager

Executing the liveCache Initialization Script

Functions for Database Operation

Installation and Registration Management

List of the DBM Commands

Logging On to the Operating System

Managing the DBM Operators

All commands during a session with the Database Manager relate to the database instance whose name was specified with the option -d when logging on to the Database Manager CLI.

See also: Command Structure

Prerequisites

To right to execute a DBM command can be linked to three prerequisites:

· Logging On to the Database Manager

· Operator Authorizations

· Logging On to the Operating System

You can find out which of these prerequisites must be fulfilled for the execution of a particular DBM command from the descriptions of the individual DBM commands.

Syntax

<command_name> [<parameters>]


Analyzing the Database Instance (SAP Library - SAP DB)

 Entering content frame

Background documentation Analyzing the Database Instance

You have the option of performing various analyses of the database instance.

The Database Manager gives you the following options:

· Accessing the Database Analyzer Program
You can use this program to monitor the performance of the database system for a definable period of time.

· Database Trace Functions
Use the database trace to log selected activities of the database kernel in detail. Note that the activated database trace can have a significant influence on the performance of the database system.

· Accessing Database Files
The system creates a range of files for each database instance, depending on which actions have been performed. These files are saved in the run directory of the database instance. Before a run directory is defined when the database instance is installed, the files are written directly to the directory wrk under the installation directory.


Database Trace Functions (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Trace Functions

Use

Use these functions only when told to do so by SAP DB Support . The database trace is not required for normal database operation.

Using the database trace , you log selected activities of the database kernel in detail. You can activate, deactivate, and evaluate the database trace using the commands described below.

Prerequisites

Note the operator authorizations required for the particular commands DBM commands ( Operator Authorizations ).

Overview of the Database Trace Commands


Overview of the Database Trace Commands (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of the Database Trace Commands

Displaying Options for the Text Version of the Database Trace | trace_protopt
Displaying the Logged Activities of the Database Trace | trace_show
Deactivating the Database Trace | trace_off
Creating the Text Version of the Database Trace | trace_prot


Displaying the Options for the Text Version of the Database Trac (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Options for the Text Version of the Database Trace

Use

You can specify various options when creating the text version of the database trace .

You display which options are permissible for the text version of the current database trace using this command. You receive a list with the names and description of the valid options.

By specifying options, you restrict which trace output for the internal database components is copied to the text file. Use these options in consultation with SAP DB Support .

Prerequisites

You have the DBM operator authorization DBInfoRead or DBFileRead .

Syntax

trace_protopt

dbmcli -d DB -u dbm,dbm trace_protopt

OK
name,option
a Order Interface (AK)
b Record Interface (BD)
k Show Message Block (KB)
m Message Block
e No Entrypos Output
s Strategy
t Time
x Switch Output (Slow Kernel)

a | The trace output of the internal database component order interface is copied to the text file
b | The trace output of the internal database component record interface is copied to the text file
k |
m | The internal data structure with the name message block is transferred to the text file
e |
s | Information about the processing strategy is copied to the text file
T |
X | Additional trace output is copied to the text file

Reply

OK<NL>
name,option<NL>
<name>,<option><NL>
<name>,<option><NL>
...


Displaying the Logged Activities of the Database Trace (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Logged Activities of the Database Trace

Use

You display which activities of the database kernel are currently logged.

All activities of the database kernel that can be logged are displayed under the column name Description. The word ON appears in the State column for activities that are actually currently being logged.

If you specify the option verbose, the system displays an extended description of the database trace .

Prerequisites

You have the DBM operator authorization DBInfoRead or DBFileRead .

Syntax

trace_show [verbose]

dbmcli -d DB -u dbm,dbm trace_show

OK
Name State Level Description
DEFAULT OFF - Default
INDEX OFF - Index
LOCK ON - Lock
LONG OFF - Long
PAGES OFF - Pages
STANDARD OFF - Standard
TABLE OFF - Table
OBJECT OFF - Objects
OBJECTADD OFF - Objects add
OBJECTGET OFF - Objects get
OBJECTALTER OFF - Objects alter
OBJECTFREE OFF - Objects free
SELECT OFF - Select
INSERT OFF - Insert
UPDATE OFF - Update
DELETE OFF - Delete
ORDER OFF - Order
OPTIMIZER OFF - Optimize
TIME OFF - Time
CHECK OFF - Check
COMMANDS ON - Commands
TOPICCONVERTER OFF 0 Topic Converter
TOPICDATA OFF 0 Topic Data
TOPICFRAMECTRL OFF 0 Topic Framecontrol
TOPICLOG OFF 0 Topic Log
TOPICIOMAN ON 7 Topic I/O manager
TOPICMEMORY OFF 0 Topic Memory
TOPICDEVSPACE OFF 0 Topic Devspace
TOPICRUNTIME OFF 0 Topic Runtime
TOPICALLOCATOR OFF 0 Topic Allocator
CHECKCONVERTER OFF 0 Check Converter
CHECKDATA OFF 0 Check Data
CHECKFRAMECTRL OFF 0 Check Framecontrol
CHECKLOG OFF 0 Check Log
CHECKIOMAN OFF 0 Check I/O manager
CHECKMEMORY OFF 0 Check Memory
CHECKDEVSPACE ON 3 Check Devspace
CHECKRUNTIME OFF 0 Check Runtime
CHECKALLOCATOR OFF 0 Check Allocator

Reply

OK<NL>
name State Level Description<NL>
<name> (ON|OFF) (-|<level>) <short description>[,<long description>]<NL>
<name> (ON|OFF) (-|<level>) <short description>[,<long description>]<NL>
...


Deactivating the Database Trace (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deactivating the Database Trace

Use

You determine which activities of the database kernel should no longer be logged or completely deactivate the database trace .

You specify which database kernel activities should no longer be logged with the <activity_list> option. Separate multiple activities by a space.

By specifying ALL, you deactivate the log function for all activities, and therefore completely deactivate the database trace.

Prerequisites

You have the DBM operator authorization DBInfoRead or DBFileRead .

Syntax

trace_off <activity_list> | ALL
<activity_list> :: = <activity> | <activity> <activity_list>
<activity> :: see table

Deactivate the database trace for the areas LOCK and TOPICIOMAN

dbmcli -d a74 -u dbm,dbmp trace_off LOCK TOPICIOMAN

OK

Option <activity>

Name

ALL

CHECK

CHECKALLOCATOR

CHECKCONVERTER

CHECKDATA

CHECKDEVSPACE

CHECKFRAMECTRL

CHECKIOMAN

CHECKLOG

CHECKMEMORY

CHECKRUNTIME

COMMANDS

DEFAULT

DELETE

INDEX

INSERT

LOCK

LONG

OBJECT

OBJECTADD

OBJECTALTER

OBJECTFREE

OBJECTGET

OPTIMIZER

ORDER

PAGES

SELECT

STANDARD

TABLE

TIME

TOPICALLOCATOR

TOPICCONVERTER

TOPICDATA

TOPICDEVSPACE

TOPICFRAMECTRL

TOPICIOMAN

TOPICLOG

TOPICMEMORY

TOPICRUNTIME

UPDATE

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Creating the Text Version of the Database Trace (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating the Text Version of the Database Trace

Use

Use this command only when told to do so by SAP DB Support. The database trace is not required for normal database operation.

You transfer the binary version of the database trace to the text version. You can use all values and combinations of values for <option> options that you received as a reply when Displaying the Options for the Text Version of the Database Trace.

The binary version of the database trace has the file name knltrace and is stored in the run directory of the database instance (see also: Database Files).

Prerequisites

You have the DBM operator authorization DBInfoRead or DBFileRead.

You have created the database trace (Activating the Database Trace).

You have determined the file ID of the database trace file (List of Database Files).

Syntax

trace_prot <option> | <option>...

Creating the text version of the database trace for the areas
 a - Order Interface and b - Record Interface:

dbmcli -d DB -u dbm,dbmp trace_prot ab

OK

Reply

An OK message.

In the event of errors, see Reply Format.


Accessing the Database Analyzer Program (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing the Database Analyzer Program

The Database Analyzer program is a tool for analyzing the database instance. It replaces the previous tools x_wizard and X_wiztrc, and makes it easier to find out the causes of performance problems.

You can use the Database Analyzer irrespective of database instance type and the version of the database software. It is possible to access the database instance from a remote server with this program.

Overview of the Commands for the Database Analyzer


Overview of the Commands for the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of the Commands for the Database Analyzer

Calling the Database Analyzer | dban_start
Ending the Database Analyzer | dban_stop
Determining the Status of the Database Analyzer | dban_state


Calling the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Calling the Database Analyzer

Use

You call the Database Analyzer program in the Database Manager. The Database Manager then transfers the database names, the user data for the SYSDBA user and the options specified with the command to the Database Analyzer.

If the Database Analyzer is already active, only its status is determined.

Syntax

dban_start [<options>]

d:\v74>dbmcli -d a74 -u dbm,dbm dban_start

Reply

You receive the output of the Database Analyzer.

Example of a Successful Call of the Database Analyzer

Example of an Error when Calling the Database Analyzer


Example of a Successful Call of the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of a Successful Call of the Database Analyzer

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_start

Reply:

OK
0,OK: everything works fine
0, Database Analyzer -d A74 -u *,* -state

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

Used protocol directory: D:\V74\USR\wrk\A74\analyzer
Used configuration file: D:\V74\USR\env\dbanalyzer74.cfg

INFO 13: Database Analyzer active in directory "D:\V74\USR\wrk\A74\analyzer".

Database = A74
Node =
Rundirectory = D:\V74\USR\wrk\A74
Configfile = D:\V74\USR\env\dbanalyzer74.cfg
Protocoldirectory = D:\V74\USR\wrk\A74\analyzer
Interval = 900
Reconnect = false
ProcessID = 1884
SessionID = 657
Started = 2002-09-11 09:16:29

The Database Analyzer was successfully started or was already active.


Example of an Error when Calling the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of an Error when Calling the Database Analyzer

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_start

Reply:

ERR
-24964,ERR_EXECUTE: error in program execution
1,Database Analyzer -d A74 -u *,* -state

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

ERROR 4: Cannot connect to database.

-709 [SAP AG][SQLOD32 DLL][SAP DB]Unable to connect to data source;-709 CONNECT:(database not running).

The Database Analyzer could not be started.
The system displays a description of the cause of the error.


Ending the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Ending the Database Analyzer

Use

You end the Database Analyzer program in the Database Manager.

If the Database Analyzer is already active, only its status is determined.

Syntax

dban_stop

d:\v74>dbmcli -d a74 -u dbm,dbm dban_stop

Reply

You receive the output of the Database Analyzer.

Example of Ending the Database Analyzer Successfully

Example of Errors when Ending the Database Analyzer


Example of Ending the Database Analyzer Successfully (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of Ending the Database Analyzer Successfully

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_stop

Reply:

OK
0,OK: everything works fine
0, Database Analyzer -d A74 -u *,* -stop

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

Used protocol directory: D:\V74\USR\wrk\A74\analyzer
Used configuration file: D:\V74\USR\env\dbanalyzer74.cfg

The Database Analyzer was successfully ended.


Examples of Errors when Ending the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Examples of Errors when Ending the Database Analyzer

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_stop

Response Example 1:

ERR
-24964,ERR_EXECUTE: error in program execution
1, Database Analyzer -d A74 -u *,* -stop

SAP DB Database Analyzer, The Performance Analysis, Version 7.4
Copyright (c) 1998-2002 by SAP AG

Used protocol directory: D:\V74\USR\wrk\A74\analyzer
Used configuration file: D:\V74\USR\env\dbanalyzer74.cfg

ERROR 20: Database Analyzer not active in directory "D:\V74\USR\wrk\A74\analyzer".

The Database Analyzer could not be ended.
ERROR 20 means that the Database Analyzer is not active.

Response Example 2:

ERR
-24964,ERR_EXECUTE: error in program execution
1,dbanalyzer -d A74 -u *,* -stop

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

ERROR 4: Cannot connect to database.

-709 [SAP AG][SQLOD32 DLL][SAP DB]Unable to connect to data source;-709 CONNECT: (database not running).

The Database Analyzer could not be ended.
The system displays a description of the cause of the error.


Determining the Status of the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Determining the Status of the Database Analyzer

Use

You determine whether the Database Analyzer is active.

Syntax

dban_state

d:\v74>dbmcli -d a74 -u dbm,dbm dban_state

Reply

You receive the output of the Database Analyzer.

Example of Determining the Status Successfully

Example of an Error when Determining the Status


Example of Determining the Status Successfully (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of Determining the Status Successfully

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_state

Response Example 1:

OK
0,OK: everything works fine
0, Database Analyzer -d A74 -u *,* -state

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

Used protocol directory: D:\V74\USR\wrk\A74\analyzer
Used configuration file: D:\V74\USR\env\dbanalyzer74.cfg

INFO 20: Database Analyzer not active in directory "D:\V74\USR\wrk\A74\analyzer".

The status was successfully determined. INFO 20 means that the Database Analyzer is not active.

Response Example 2:

OK
0,OK: everything works fine
0,dbanalyzer -d A74 -u *,* -state

SAP DB Database Analyzer, The Performance Analysis Tool, Version 7.4
Copyright (c) 1998-2002 by SAP AG

Used protocol directory: D:\V74\USR\wrk\A74\analyzer
Used configuration file: D:\V74\USR\env\dbanalyzer74.cfg

INFO 13: Database Analyzer active in directory "D:\V74\USR\wrk\A74\analyzer".

Database = A74
Node =
Rundirectory = D:\V74\USR\wrk\A74
Configfile = D:\V74\USR\env\dbanalyzer74.cfg
Protocoldirectory = D:\V74\USR\wrk\A74\analyzer
Interval = 900
Reconnect = false
ProcessID = 1896
SessionID = 639
Started = 2002-09-10 16:51:40

The status was successfully determined. INFO 13 means that the Database Analyzer is active. The system displays additional information.


Example of an Error when Determining the Status (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example of an Error when Determining the Status

Name of the database instance: a74

Name and operator password of the DBM operator: dbm,dbm

d:\v74>dbmcli -d a74 -u dbm,dbm dban_stop

Reply

ERR
-24964,ERR_EXECUTE: error in program execution
1, Database Analyzer -d A74 -u *,* -state

SAP DB Database Analyzer, The Performance Analysis, Version 7.4
Copyright (c) 1998-2002 by SAP AG

ERROR 4: Cannot connect to database.

-709 [SAP AG][SQLOD32 DLL][SAP DB]Unable to connect to data source;-709 CONNECT:(database not running).

The state could not be determined.
The system displays a description of the cause of the error.


Accessing Database Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing Database Files

Use

Use this command to access database files in the current database instance.

Prerequisites

Note the operator authorizations required for the particular DBM commands.

Overview of the Commands for Accessing Database Files


Overview of the Commands for Accessing Database Files (SAP Library - SAP DB)

 Entering content frame

Syntax Overview of the Commands for Accessing Database Files

Displaying the Diagnosis History | diag_histlist
Editing Log Files of the Database Instance | file_operation
Scrolling Through a Database File | file_getnext
List of the Database Files | file_getlist
Opening a Database File | file_getfirst
Packing Database Files | diag_pack
Backing Up a Database File | file_backup
Restoring a Database File | file_restore


Displaying the Diagnosis History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Diagnosis History

Use

You display the available diagnosis history.

If a database instance was not properly stopped, the system backs up certain database files during the restart of the database instance (Starting the Database Instance). These files are required for the diagnosis of problems that occurred previously. The files are backed up by the system in a diagnosis backup and stored in the directory DIAGHISTORY in the run directory of the database instance (Database Manager default value). You can define this path using the parameter DIAG_HISTORY_PATH.

If you run the command without specifying the option <YYYYMMDDHHMMSS>, the system displays a list of all available diagnosis backups. These are listed with their time stamps and the paths under which the backups are stored. This means that you can also access the diagnosis backup using operating system resources.

If you enter the command again with the option <YYYYMMDDHHMMSS> (timestamp), the system displays the file IDs of the files belonging to the diagnosis backup. Using the file ID, you can display the contents of a database file (Opening a Database File).

Prerequisites

You have the DBM operator authorization DBFileRead.

Syntax

diag_histlist [<YYYYMMDDHHMMSS>]

Command without option specified

dbmcli -d DB -u dbm,dbmp diag_histlist

OK
20010706140709  d:\sapdb\usr\wrk\DB\DIAGHISTORY\A74_20010706_14-07-09
20010706162223  d:\sapdb\usr\wrk\DB\DIAGHISTORY\A74_20010706_16-22-23

Command with option specified

dbmcli -d DB -u dbm,dbmp diag_histlist 20010706162223

OK
DIAGHIST#20010706_16-22-23\knldiag
DIAGHIST#20010706_16-22-23\knldump
DIAGHIST#20010706_16-22-23\knltrace
DIAGHIST#20010706_16-22-23\rtedump

Reply

The result of the request depends on whether you specify the option <YYYYMMDDHHMMSS> (time stamp).

After Entering a Command Without an Option

If you do not specify a time stamp, the system displays a list of all available diagnosis backups.

OK<NL>
<YYYYMMDDHHMMSS> <directory><NL>

<YYYYMMDDHHMMSS> <directory><NL>

...

After Entering a Command with an Option

If you specify a time stamp, the system displays a list of the files that belong to the diagnosis backup.

OK<NL>
<file_id><NL>

<file_id><NL>

...

In the event of errors, see Reply Format.


Editing Log Files of the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Editing Log Files of the Database Instance

Use

You are deleting part of the content of the log files of the database instance or complete files.

This command can be used for log files only and not for other database files. If you use the command on a file for which it is not valid, you generate the error
 -24996 ERR_PARAM - wrong parameters.

You specify the operation that you want to perform with the parameter OP.

Prerequisites

You have the DBM operator authorization DBFileRead.

You have used the command for displaying the list of database files to find out the file ID of the file or group of files that you want to edit.

Syntax

file_operation <file_id> OP=DELETE [DATE=<yyyymmddhhmmss>] | OP=SHRINK DATE=<yyyymmddhhmmss>|LINE=<n>

<file_id>

Log file(s) of the database instance

OP=DELETE

The file(s) is/are deleted.

You can specify that all files that have not been changed since the specified date, DATE=<yyyymmddhhmmss>, are to be deleted.

OP=SHRINK

Part of the content of the file is deleted.

If you also specify the parameter DATE=<yyyymmddhhmmss>, all lines that were written before the specified date are deleted.

If, instead, you specify the parameter LINE=<n>, the contents of the file are reduced to <n> lines. The <n> lines that were written most recently are retained.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format.


Scrolling Through a Database File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling Through a Database File

Use

You are requesting the rest of the content of an opened database file. Use the <file_handle> displayed by the system when you open the database file.

Prerequisites

You have opened a database file. The keyword CONTINUE in the reply shows that you have not yet read the whole file.

You have the DBM operator authorization DBFileRead.

You have determined the file ID of the file (List of Database Files).

Syntax

file_getnext <file_id> <file_handle>

Reply

Output in ASCII Mode

OK<NL>
[CONTINUE|END]<NL>
<file_length>:20<data_length>:20<NL>
<data><NL>
<data><NL>
...

Output in Binary Mode

OK<NL>
[CONTINUE|END]<NL>
<file_length><data_length><NL>
<data> <NL>

Values for the individual fields of the reply

END | Contents of the file have been completely transferred, file is automatically closed
CONTINUE | File has additional entries that have not been transferred due to the limited size of the reply memory. Call these by entering the command used above again
<file_length> | File length
<data_length> | Data length
<data> | Data value

The total length of file is not determined again and is, therefore, set to 0.


List of the Database Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of the Database Files

Use

You are requesting a list of the database files of the current database instance.

You determine the scope of the displayed file list by using the parameter <list_level>.

Possible values for <list_level>:

0 | Default value of the Database Manager CLI, display the most important files
1 | Display all files

Prerequisites

You have the DBM operator authorization DBFileRead.

Syntax

file_getlist <list_level>

Only those files are listed that are actually available. The list may therefore vary with the state of the database instance.

Reply

An OK message. Then it lists the database files currently available.

OK
key_name,mode,size,date,time,comment,file_name
<file_ id> (ASCII|BINARY) <file_length > <date> <time> <comment> <file_name>
<file_id> (ASCII|BINARY) <file_length> <date> <time> <comment> <file_name>
...

Values for the individual fields of the reply

file_id | Key identifying name of a database file
file_length | Size of database file
date | Date last changed
time | Time last changed
comment | Additional information
file_name | File name


Opening a Database File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Database File

Use

You open the database file specified under <file_id> and transfer the first block. Using the <file_id>, the Database Manager determines the actual name of the file and whether it is a binary or text file.

File access using this command is limited to the database files . For this reason this command does not necessitate logging on to the operating system.

You can request the files that are currently available and their <file_id> with the command file_getlist ( List of the Database Files ).

Prerequisites

You have the DBM operator authorization DBFileRead .

Syntax

file_getfirst <file_id>

Options for <file_id>

See: Database Files

Reply

Output in ASCII Mode

OK<NL>
<file_handle><NL>
[CONTINUE|END]<NL>
<file_length>:20<data_length>:20<NL>
<data><NL>
<data><NL>
...

Output in Binary Mode

OK<NL>
file_handle><NL>
[CONTINUE|END]<NL>
<file_length><data_length><NL>
<data><NL>

Values for the individual fields of the reply

<file_handle> | Numeric value that can be used for subsequent access to this file.
END | The contents of the file have been transferred in full. The file is closed automatically.
CONTINUE | The file contains further entries that were not transferred due to the limited storage available for replies. Interrogate this data by entering the above command or close the file.
<file_length> | File length
<data_length> | Data length
<data> | Data

In ASCII mode the data is read from the file line by line. Each line is extended by a line feed (0x0D,0x0A) in the output area.

On a UNIX server, the line feed only consists of one character. This is why the value initially output for the file length may be smaller than the data length.

In the event of errors, see Reply Format .


Packing Database Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Packing Database Files

Use

To be able to comprehensively diagnose a database problem, SAP DB-Support requires a significant number of database instance files.

Use this command to collect all of the required database files in a compressed archive file.

Default values of the Database Manager for the archive file:

File name | diagpack.tgz
Directory | Run directory for the database instance
<file_id> | DIAGTGZ

When opening the file, note that it is stored in binary format (Opening a Database File).

Prerequisites

You have the DBM operator authorization DBFileRead.

Syntax

diag_pack [file=<archive>] [class=<class_spec> | <class_spec>,...] [date=<time_stamp>]

<archive> | Name and path of the archive file that you want to create
<class_spec> | Class of files that you want to include in the package The default value of the Database Manager is the class protocol Separate multiple classes with commas.
<time_stamp> | Time stamp of the diagnosis backup Additional parameter when class hist specified Determine this by Displaying the Diagnosis History

Options for <class_spec>

Class | Description
protocol | General log files
backup | Log files from backups and restores
config | Configuration files
lvc | Additional log files for a database of instance type liveCache


Backing Up a Database File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up a Database File

Use

Use this command to create a backup copy of the specified database file. Specify the name of the database file in <file_id>.

Normally, you do not have to create backup copies of internal Database Manager files because the program creates backups automatically every time it writes to the configuration files.

Prerequisites

You have the DBM operator authorization DBFileRead.

You have determined the file ID of the relevant database file (List of the Database Files).

Syntax

file_backup <file_id>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format.


Restoring a Database File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring a Database File

Use

Use this command to copy the backup copy of the database file specified using <file_id> back to its original position. If a file already exists there, it will be overwritten.

Normally, you do not have to copy backups of internal Database Manager files to their original position manually because the Database Manager will automatically use the backups if it is unable to access the original file.

Prerequisites

You have the DBM operator authorization DBFileRead.

You have determined the file ID of the file that you want to copy (List of Database Files).

Syntax

file_restore <file_id>

Reply

There is an OK message after the command has been executed successfully.

In the event of errors, see Reply Format.


Logging On to the Operating System (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Logging On to the Operating System

Use

So that the Database Manager can access a remote server once with operating system rights, log on to the operating system with a DBM command in session mode or script mode.

This logon is needed for executing the following DBM Server commands.

Creating a Database Instance | db_create
Deleting the Registration of a Version of the Database Software | inst_unreg
Registering a Version of the Database Software | inst_reg

Prerequisites

No special operator authorization is required for this command.

Syntax

user_system <dbm_user>,<password>

Reply

An OK message.

In the event of errors, see Reply Format.


Displaying the Version Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Version Information

Use

You display the version information of the Database Manager. Since the version of the DBM Server is always the same as the version of the database software, this is how you can also determine the version of the database software.

Prerequisites

You do not need to log on to the Database Manager to execute this DBM command.

Nor do you require any operator authorization.

Syntax

dbm_version

Reply

OK
VERSION    = <version><NL>
BUILD      = <build_number><NL>
OS         = <os><NL>
INSTROOT   = <dependent_path><NL>
LOGON      = <logon_state><NL>
CODE       = <code><NL>
SWAP       = <swap><NL>
UNICODE    = (YES|NO)<NL>
INSTANCE   = (OLTP|LVC|CS|BW|unknown)<NL>
SYSNAME    = <os><NL>

Values of the reply lines

VERSION | Version number of the Database Manager
BUILD | Identification number of the Database Manager
OS | Name of the operating system
INSTROOT | Installation directory of the version-dependent components
LOGON | Displays whether a logon to the operating system has been performed: True logged on False not logged on
CODE | Display of the character set used in the Database Manager: ASCII or EBCDIC
SWAP | Display of the swap type (internal representation of numerical values) used in the Database Manager : no hihi-hilo-lohi-lolo full lolo-lohi-hilo-hihi half lohi-lolo-hihi-hilo
UNICODE | Configuration of the current database instance as a UNICODE database
INSTANCE | Database Instance Type
SYSNAME | Name of the operating system

In the event of errors, see Reply Format.


Executing the liveCache Initialization Script (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Executing the liveCache Initialization Script

This command is only relevant in connection with SAP applications.

Use

You are logged on to the Database Manager CLI and start the liveCache initialization script stored on the database server from this program.

You can specify parameters with this DBM command that are passed to the liveCache initialization script by the Database Manager. The output from the liveCache initialization script is supplied by the Database Manager CLI.

Prerequisites

You have the operator authorization SystemCmd .

Syntax

exec_lcinit [<lcinitparams>]

Successful Reply

OK<NL>
0,<err_description><NL>
<pgmcode>,<command><NL>
<command_output_lines><NL>

Error Message

ERR<NL>
<err_code>,<err_description><NL>
<pgm_code>,<command><NL>
<command_output_lines><NL>

Values for the individual fields of the reply

<err_code> | Error number of the Database Manager, if successful the error number is 0.
<err_description> | Description of the error
<pgm_code> | Return value of the executed program
<command> | Command line executed by the Database Manager
<command_output_lines> | Output text of the program
<NL> | Line feed


Ending the Database Manager (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Ending the Database Manager

Use

This command ends the session with the Database Manager.

Syntax

release | bye | exit | quit

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Functions for Database Operation (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions for Database Operation

Use

For the day-to-day operation of the database instance , there are DBM commands provided. You can use these commands to request general information on the status of the database instance and transfer the instance to the required operational state .

Prerequisites

Note the operator authorizations required for the particular commands DBM commands ( Operator Authorizations ).

Overview of the Commands for Database Operation


Overview of the Commands for Database Operation (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of the Commands for Database Operation

Deleting Runtime Information After a Database Error | db_clear
Displaying Information About the Database Instance | show
Displaying the Database Kernel Variant | db_speed
Displaying the Operational State of the Database Instance | db_state
List of the Information About the Database Instance | show_list
Loading SAP-Specific Tables | load_r3tab
Loading the System Tables | load_systab
Restarting the Database Instance | db_restart
Scrolling in the Information About the Database Instance | show_next
Starting the Database Instance | db_start
Starting the PythonLOAD Program | exec_load
Stopping the Database Instance | db_stop
Transferring to the ADMIN Operational State | db_admin
Transferring to the OFFLINE Operational State | db_offline
Transferring to the ONLINE Operational State | db_online
Using the Database Console | db_cons


Updating Optimizer Statistics with the XPU Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating Optimizer Statistics with the XPU Program

Use

The optimizer is part of the database instance and ensures the fastest possible processing of database accesses. To do this, it accesses the statistics about the contents of database tables. See also: Optimizer

You update the statistics about the contents of the tables of the database instance using the XPU program.

You use the parameters for the XPU program as parameters.

Prerequisites

You have the DBM operator authorization AccessSQL .

The database instance is in ONLINE operational state.

Syntax

exec_xpu <xpu_params>

Reply

You receive the reply of the XPU program.

OK<NL>
<xpu_output>

In the event of errors, see Reply Format .


Displaying the Database Kernel Variant (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Database Kernel Variant

Use

You display the variant of the database kernel of the current database instance .

Prerequisites

You have the DBM operator authorization DBInfoRead .

The database instance is in operational state ONLINE or ADMIN.

Syntax

db_speed

Reply

OK<NL>
Speed<NL>
(FAST|QUICK|SLOW|UNKNOWN|)

FAST | Fastest database kernel variant, with minimum logging and runtime checks.
QUICK | Variant of the database kernel with various logs and runtime checks.
SLOW | Variant of the database kernel with extensive logs and runtime checks.
UNKNOWN | The kernel variant cannot be determined.

If the database is in the OFFLINE operational state, the system answers this command with an error message.


Displaying the Operational State of the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Operational State of the Database Instance

Use

You display the operational state of the database instance .

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

db_state

Reply

OK<NL>
State<NL>
(ONLINE|ADMIN|OFFLINE|UNKNOWN|STOPPED INCORRECTLY)

State | Description
ONLINE | The database instance is ready.
ADMIN | The database instance has been shutdown to the ADMIN operational state. Only special administrative tasks can be performed.
OFFLINE | The database instance has not been started.
STOPPED INCORRECTLY | Only with a UNIX operating system: The database stopped after an error.
UNKNOWN | The operational state cannot be determined.


Displaying Information About the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Information About the Database Instance

Use

You display information about the database instance ; about statistics, the operational state , tasks, and so on. To do this, the show command obtains and outputs information from program x_cons.

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

show <command>

Possible values for <command>

IO | Input/output activities in regular database operation
AIO | Input/output activities for data backups
STORAGE | Configuration and current status of the various storage areas
TASKS | List of available tasks
ACTIVE [DW|SV|US] | Active tasks for [Datawriter-Task|Server-Task|User-Task]
RUNNABLE [DW|SV|US] | Runnable tasks (waiting for CPU)
T_C [DW|SV|US|Tx] | Task-specific information on [Datawriter_Task | Server Task | User Task | Task No.x]
VERSIONS | Current variant of the database kernel and the runtime environment
REGIONS | Information about the critical regions used in the kernel
STATE | Operational state of the database instance
RTE | Runtime environment
QUEUES | Queues of runnable tasks (waiting for CPU)
SUSPENDS | Information about suspend states anywhere in the overall system
SLEEP | The CPU load from user kernel threads measured by the database kernel.
THRD_TIMES | Information from the system about the CPU load from user kernel threads (Microsoft Windows NT operating system only)
ALL | All of the information provided by the database console

Reply

OK<NL>
[CONTINUE]<NL>
<info_record><NL>
<info_record><NL>

Continue | More result data ready
<info_record> | Information


Using the Database Console (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Using the Database Console

Use

You use the database console to analyze and influence the runtime behavior of the database instance .

As parameters, you use a command for the database console, <cons_cmd>, and additional parameters for the database console <cons_param>.

Use the database console only when told to do so by SAP DB Support .

Prerequisites

You have the DBM operator authorization DBStop .

The database instance is in the operational state ADMIN or ONLINE.

Syntax

db_cons <cons_cmd> [<cons_param>]

Reply

You receive the database console reply.

OK<NL>
<console_output>

In the event of errors, see Reply Format .


Scrolling in the Information About the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the Information About the Database Instance

Use

You display additional information about the database instance .

Prerequisites

You have the DBM operator authorization DBInfoRead .

You have entered a command to display information about the database instance . The keyword CONTINUE in the reply indicates that further information is available; this information has not yet been output because of the limited size of the reply memory.

Syntax

show_next

Reply

OK<NL>
[CONTINUE | END]<NL>
<info_record><NL>
<info_record><NL>

Values in the individual fields of the reply

END | The requested information on the database instance has been transferred in full. The file is closed automatically.
Continue | More result data is available but was not transferred due to the limited size of the reply memory. You can call up this data by entering the show_next command again.
<info_record> | Information


Loading the System Tables (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Loading the System Tables

Use

System tables are internal tables for the system that users do not define or change.

You have to reload the system tables after a change of database software version.

You do not need to reload system tables when restoring a database instance .

In order to load the system tables, the DBM Server must know the name and password of the SYSDBA and the password of the DOMAIN user . If this is not already the case, enter the name and password of the SYSDBA under -u <sysdba>,<password>, and the DOMAIN user's password under -ud <domain_password>.

See also: User manual

Prerequisites

You have the DBM operator authorization ExecLoad or LoadSysTab .

Syntax

load_systab [-u <sysdba>,<password>] [-ud <domain_password>]

Reply

OK<NL>
<errcode>,<err_description><NL>
<pgmcode>,<command><NL>
<xload_output_lines><NL>
<xload_protocol_lines><NL>

Values for the individual fields of the reply

<errcode> | Error number of the DBM Server program. If successful the error number is 0
<err_description> | Description of the error
<pgmcode> | Return value of the executed program
<command> | Command line executed by the DBM Server program
<xload_output_lines> | Output text of the program
<xload_protocol_lines> | Lines of the LOAD log
<NL> | Line feed


Loading SAP-Specific Tables (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Loading SAP-Specific Tables

Use

The SAP-specific tables contain information for the SAP application about the status of the database instance .

You maintain the contents of the SAP-specific tables. Normally, these tables are maintained by the SAP application on a regular basis.

Prerequisites

You have the DBM operator authorization ExecLoad or LoadSysTab .

Syntax

load_r3tab

Reply

OK<NL>
<errcode>,<err_description><NL>
<pgmcode>,<command><NL>
<xload_output_lines><NL>
<xload_protocol_lines><NL>

Values for the individual fields of the reply

<errcode> | Error number of DBM Server. If successful the error number is 0
<err_description> | Description of the error
<pgmcode> | Return value of the executed program
<command> | Command line executed by the DBM Server
<xload_output_lines> | Output text of the program
<xload_protocol_lines> | Lines of the LOAD log
<NL> | Line feed


List of the Information About the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of the Information About the Database Instance

Use

You display the list of all keywords <keyword> for information about the database instance. You then use the command show <keyword> ( Displaying Information About the Database Instance ) to display the desired information.

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

show_list


Deleting Runtime Information After a Database Error (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting Runtime Information After a Database Error

Use

If runtime information is still present in the operating system after a database error, it is not possible to restart the database instance .

Using this command, you remove this runtime information from the operating system and therefore allow the restart of the database instance.

Prerequisites

You have the DBM operator authorization DBStop .

Syntax

db_clear

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Restarting the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restarting the Database Instance

Use

You transfer the database instance from the operational state ADMIN or ONLINE first into the OFFLINE operational state and then into the operational state ONLINE.

Prerequisites

You have the DBM operator authorization DBStop .

Syntax

db_restart [<option>]

Options

You can use the following options(<option>) with the command:

-f | -fast | The fast variant of the database kernel is started.
-q | -quick | The quick variant of the database kernel is started.
-s | -slow | The slow variant of the database kernel is started.
-d | -dump | A dump is generated on transferring from ADMIN or ONLINE to OFFLINE.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Starting the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting the Database Instance

Use

You are switching the database state from the operational state OFFLINE to the state ADMIN (Transferring to the Operational State ADMIN).

Prerequisites

You have the DBM operator authorization DBStart.

On the Microsoft Windows operating system, this database instance must be registered as a service under the name SAP DB: <database_name>. This is done implicitly when you create a database instance with the Database Manager.

Syntax

db_start [<option>]

Options

Options (<options>) that determine the kernel variant that starts the database instance:

-f | -fast

-q | –quick

-s | –slow

If you do not specify an option, the system makes a service entry for the fastest available variant of the database kernel.

You should only use the options -q | –quick and -s | –slow if errors occur and in consultation with SAP DB Support.

Reply

An OK message.

In the event of errors, see Reply Format.


Starting the PythonLOAD Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting the PythonLOAD Program

Use

PythonLOAD is an environment programmed in the script language Python that allows load operations to be executed. As a response to the execution of this script, the system displays information about the execution status of the program as a reply.

The PythonLOAD program is executed on the current database instance with the operator specified in <userid> <password>. Specify a PythonLOAD script file <file>. If you specify a relative file name, it is used relative to the directory <dependent_path>\env.

PythonLOAD options in double quotation marks are transferred uninterpreted to the PythonLOAD program.

Prerequisites

You have the DBM operator authorization ExecLoad .

Syntax

exec_load <userid> <password> <file> ["<option>"]

Reply

OK<NL>
<errcode>,<errdescription><NL>
<pgmcode>,<command><NL>
<pythonload output lines><NL>

Values for the individual fields of the reply

<errcode> | Error number of the DBM Server program. If successful the error number is 0
<errdescription> | Description of the error
<pgmcode> | Return value of the executed program
<command> | Command executed by the DBM Server program
<pythonload output lines> | Output text of the program
<NL> | Line feed


Stopping the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Stopping the Database Instance

Use

With this command, you transfer the database instance from the operational state ADMIN or ONLINE to the operational state OFFLINE.

Prerequisites

You have the DBM operator authorization DBStop .

Syntax

db_stop [<option>]

Option

If you specify the value -d | -dump as an <option>, a dump is created when the database instance transfers from the ADMIN to the OFFLINE operational state.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring to the ADMIN Operational State (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring to the ADMIN Operational State

Use

The database instance is transferred to the ADMIN operational state .

If the database instance is in the operational state ONLINE, it is first transferred to the OFFLINE operational state and only then to the ADMIN operational state.

Prerequisites

You have the DBM operator authorization DBStop .

Syntax

db_admin [<option>]

Options

Options <option> you can use with the command:

-f | -fast | When transferring from the OFFLINE operational state to ADMIN under Microsoft Windows NT/Windows 2000, the fast variant of the database kernel is started.
-q | -quick | When transferring from the OFFLINE operational state to ADMIN under Microsoft Windows NT/Windows 2000, the quick variant of the database kernel is started.
-s | -slow | When transferring from the OFFLINE operational state to ADMIN under Microsoft Windows NT/Windows 2000, the slow variant of the database kernel is started.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring to the OFFLINE Operational State (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring to the OFFLINE Operational State

Use

The database instance is transferred to the operational state OFFLINE.

Prerequisites

You have the DBM operator authorization DBStop .

Syntax

db_offline [<option>]

Options

You can enter the command with the following option <option> :

-d | –dump

A dump is generated when transferring from the operational states ADMIN or ONLINE to OFFLINE.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring to the ONLINE Operational State (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring to the ONLINE Operational State

Use

You transfer the database instance to the ONLINE operational state .

Prerequisites

You have the operator authorization DBStart .

Syntax

db_online [<option>]

Options

Options <option> you can use with the command:

-f | -fast | The fast variant of the database kernel is started.
-q | -quick | The quick variant of the database kernel is started.
-s | -slow | The slow variant of the database kernel is started.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Installation and Registration Management (SAP Library - SAP DB)

 Entering content frame

Background documentation Installation and Registration Management

Use

You manage information on the versions of the database software and the generated database instances in Registration Management.

DBM Commands are provided for maintaining the installation(s) of the database software and for registering and deleting database instances. Many of these commands, however, do not need to be called explicitly during normal database operation, but are called by installation programs of the database software or by the database application.

Overview of the Commands for Installation and Registration Management

Prerequisites

Note the operator authorizations required for the particular DBM commands ( Operator Authorizations ).


Overview of the Commands for Installation and Registration Management

 Entering content frame

Syntax documentation Overview of the Commands for Installation and Registration Management

Changing the Software Version of the Current Database Instance | db_reg -R
Creating a Database Instance | db_create
Defining the Version-Independent Directories | dbm_setpath
Deleting the Current Database Instance | db_drop
Deleting the Registration of a Version of the Database Software | inst_unreg
Displaying the Version-Independent Directories | dbm_getpath
List of All Registered Database Instances | db_enum
List of All Registered Versions of the Database Software | inst_enum
Registering a Version of the Database Software | inst_reg
Registering the Current Database Instance | db_reg


Displaying the Version-Independent Directories (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Version-Independent Directories

Use

You display the version-independent directories configured on the database server.
If more than one version of the database software is installed on your computer, version-independent data or programs are stored and found in these directories.

Prerequisites

You do not need to log on to the Database Manager to execute this DBM command. Nor do you require any operator authorization.

Syntax

dbm_getpath <independent_data_path> | <independent_program_path>

See also: Variables


Changing the Software Version of the Current Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing the Software Version of the Current Database Instance

Use

You change the version of the database software for the current database instance .

You can only switch between versions of the SAP DB software that do not require migration of the database instance.

Prerequisites

The database instance is in operational state OFFLINE( Taking the Database Instance OFFLINE ).

You have called the Database Manager CLI with the -d option.

Syntax

db_reg -R

Procedure

  1. End all sessions with the DBM Server program, particularly all sessions in the Database Manager GUI .
  2. Run the command db_register -R
  3. If you are working with the Database Manager CLI in session mode , terminate the Database Manager CLI now.

Result

For every subsequent access to this database instance, the Database Manager program uses the new version of the database software.


Defining the Version-Independent Directories (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining the Version-Independent Directories

Use

You define the version-independent directories.
If more than one version of the database software is installed on your computer, version-independent data or programs are stored and found in these directories.

Prerequisites

You do not need to log on to the Database Manager to execute this DBM command.

Nor do you require any operator authorization.

Syntax

dbm_setpath <independent_data_path> | <independent_program_path> <path>

See also: Variables

Reply

An OK message.

In the event of errors, see Reply Format.


List of All Registered Database Instances (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of All Registered Database Instances

Use

You can call up the list of all database instances registered on the server.

If you specify the [-s] option, the service database instances for each version of the database software are also listed ( Access Using a Service Session ).

Prerequisites

You have called the Database Manager using the -n option.

You do not need to log on to the Database Manager to execute this DBM command .

Nor do you require an operator authorization.

Syntax

db_enum [-s]

Reply

The system outputs an OK message. Then a table is displayed, listing all of the registered database instances in tabular format.

OK<NL>
<database_name><TAB><dependent_path><TAB><version>[<TAB><description>]<NL>
<database_name><TAB><dependent_path ><TAB><version>[<TAB><description>]<NL>
...

Reply values

<database_name> | Name of database instance
<dependent_path> | Directory that contains the programs dependent on the database version.
<version> | Version of the database software
<description> | More information about the database instance

myDB1 C:\Program Files\SAP DBTech\V72" 7.2.1.0 fast offline

myDB2 C:\Program Files\SAP DBTech\V73" 7.3.0.14 slow running


List of All Registered Versions of the Database Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of All Registered Versions of the Database Software

Use

You can call up the list of all registered versions of the database software on the database server.

Prerequisites

You do not need to log on to the Database Manager to execute this DBM command .

Nor do you require an operator authorization.

Syntax

inst_enum

Reply

The system outputs an OK message. The system then displays a table of the registered versions <version> and their installation paths <dependent_path>.

OK<NL>
<version><TAB><dependent_path><NL>
<version><TAB><dependent_path><NL>
...

OK
7.2.1.0 "C:\Program Files\SAP DBTech\V72"
7,30,00,14 "C:\Program Files\SAP DBTech\V73"


Deleting the Current Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting the Current Database Instance

Use

Use this command to delete a database instance.

If you specify the option WITHOUTFILES for this command, the database files on the DBM Server are retained. If you do not specify this option, the files for the database instance are also deleted.

Prerequisites

The database instance is in the operational state OFFLINE ( Taking the Database Instance OFFLINE ).

You have the DBM operator authorization InstallMgm.

Syntax

db_drop [WITHOUTFILES]

Example

Reply

An OK message.

In the event of errors, see Reply Format.


db_drop Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text db_drop Command: Example

1. Stop the database instance:

dbmcli –d <database_name> <dbm_user>,< password> db_stop

or

dbmcli -d <database_ name> -u <dbm_user>,< password> db_offline

2. Delete the current database instance from the database server:

dbmcli -d <database_ name> -u <dbm_user>,< password> db_drop

This deletes the database instance’s files.


Deleting the Registration of a Version of the Database Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting the Registration of a Version of the Database Software

Use

You remove an entry from the list of registered versions of the database software. Components of a version that require this entry are then no longer operable.

Specify the installation path <dependent_path> as a parameter.

Prerequisites

You have called the Database Manager CLI with -R option.

You are logged on to the operating system ( Operating System Logon ).

You do not require any DBM operator authorization.

Syntax

inst_unreg <dependent_path>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Creating a Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Database Instance

Use

You are the operating system user and are creating a new database instance.

Prerequisites

The following prerequisites must be met on the server on which you want to create the database instance:

Communication | Microsoft Windows | UNIX
local | Operating system user has administration rights for database server * (Implicit logon to the operating system) | Logon on to the operating system using option –s (local operation)
remote | Operating system user has administration rights for database server and the log on as batch job * right Log on to the operating system using db_create and option <os_user>,<password> | Log on to the operating system using db_create and the option <os_user>,<password>

If several versions of the database software are available on the database server, you must specify the path of the version to which this database instance is to be assigned when registering the database instance. To do this, use the option -R (installation directory of the database software) when calling the Database Manager CLI.

*(You can find information about maintaining operating system users in your operating system documentation.)

Syntax

db_create [<option>] <database_name> <dbm_user>,<password> [<os_user>,<password>]

<database_name> | Name of database instance, maximum length eight characters
<dbm_user>,<password> | Database Manager operator This operator is stored on the database server when you start to create the database. Subsequent access to the database instance is possible only with this operator.
[<os_user>,<password>] | Operating system user If you want to create the database instance on a remote server, you must also specify the operating system user for this server. If the logon to the operating system fails, the database instance cannot be installed.

Creating a local database instance on Microsoft Windows:
db_create myDB1 samplename,secret

Creating a remote database instance on Microsoft Windows:
db_create myDB2 samplename,secret winuser,win

From now on, to access this database instance you need the <dbm_user> and<password>specified at registration.

Reply

There is an OK message after the command has been executed successfully.

In the event of errors, see Reply Format.

Example: How to Create a Database Instance


Kernel Variant -a | -auto (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Kernel Variant -a | -auto

-a | –auto

If you use this option, under Microsoft Windows NT the service entry Start-up-type in the Control Panel is set to automatic.

Under the UNIX operating system this parameter is ignored.


Kernel Variant -f | -fast (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Kernel Variant -f | -fast

-f | –fast

Default value of the Database Manager CLI

Fastest database kernel variant, with minimum logging and runtime checks.

Specifying this option has the following effect:

Microsoft Windows

When you create a database instance, the service entry of the fast variant of the database kernel is used. The kernel variant fast is started when you enter the command that starts the database instance.

UNIX

The command that registers the database instance does not work. Specifying the option -f | –fast therefore only makes sense when starting the database instance.


Kernel Variant -q | -quick (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Kernel Variant -q | -quick

-q | –quick

Variant of the database kernel with various logs and runtime checks.

Specifying this option has the following effect:

Microsoft Windows

When you create a database instance, the service entry of the quick variant of the database kernel is used. When the command to start the database instance is run, the kernel variant quick of the database instance is started.

UNIX

The command for registering the database instance does not work. Specifying the option -q | –quick, therefore, only makes sense when starting the database instance.

However, these options should only be used in case of error and after consulting SAP DB Support.


Kernel Variant -s | -slow (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Kernel Variant -s | -slow

- s | –slow

Variant of the database kernel with extensive logs and runtime checks.

Specifying this option has the following effect:

Microsoft Windows

When you create a database instance, the service entry of the slow variant of the database kernel is used. When you execute the command for starting the database instance, the kernel variant slow of the database instance is started.

UNIX

The command for registering the database instance does not work. Specifying the option -s | –slow, therefore, only makes sense when starting the database instance.

However, these options should only be used in case of error and after consulting SAP DB Support.


db_create Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text db_create Command: Example

To create a new database instance with the Database Manager CLI, you only need a few DBMCLI commands.

First execute the command db_create and define the first Database Manager operator.

dbmcli db_create <database_name> <dbm_user>,<password>

· If you can choose between multiple versions of the database software, make your choice by specifying the option:
 dbmcli db_create <database_name> <dbm_user>,<password> -R <dependent_path>.

· If you want to install a new database on a remote server, also specify the option -n <server_node>. You also need authorization for the operating system:

dbmcli -n <server_node> db_create <database_name> <dbm_user>,<password> <os_user>,<password>

· On UNIX platforms there is no difference between remote and local communication. Therefore authorization is always required. When you are creating a new database instance locally, you can avoid communication and, therefore, authorization by using the option -s:

dbmcli -s db_create <database_name> <dbm_user>,< password>

For the other steps need to create the database instance, use a DBMCLI script:

dbmcli -d <database_name> -u <dbm_user>,<password> -i <script_file>

Example of a script:

param_startsession
param_init
param_put MAXUSERTASKS 5
param_checkall
param_commitsession
param_addvolume 1 SYS sys_001 F
param_addvolume 1 LOG LOG_001 F 2000
param_addvolume 1 DATA DAT_001 F 10000
db_admin
util_connect
util_execute INIT CONFIG
 util_activate <sysdba>,<password>
 load_systab -ud <domain_password>

Modify the values of the database parameters according to your requirements.


Registering the Current Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Registering the Current Database Instance

Use

You are registering a database instance.

Prerequisites

· You have the DBM operator authorization InstallMgm.

· The database instance is in the operational state OFFLINE.

· You have called the Database Manager CLI with the -d option.

Syntax

db_reg


Registering a Version of the Database Software (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Registering a Version of the Database Software

Use

You enter the software version of the Database Manager from the current database installation in the list of registered versions of the database software.

The version is registered once only, upon installation of the relevant database software. The installation must be registered for this software to function correctly.

Prerequisites

You have called the Database Manager CLI with the -R option.

You are logged on to the operating system ( Logging On to the Operating System ).

Syntax

inst_reg [-k <key>][-c]

Options

You must specify a unique key -k <key> if you have installed the same version of the database software more than once.

If only the client programs of the database software have been installed on a computer, register the client with the -c option.

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Configuring the Database Manager (SAP Library - SAP DB)

 Entering content frame

Background documentation Configuring the Database Manager

Use

You can use the following DBM commands to configure the Database Manager:

Displaying a Configuration Parameter of the Database Manager | dbm_configget
Changing a Configuration Parameter of the Database Manager | dbm_configset

Prerequisites

You have the operator authorization InstallMgm .


Displaying a Configuration Parameter of the Database Manager (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying a Configuration Parameter of the Database Manager

Use

You display the value of the configuration parameter of the Database Manager specified in <parameter_name>.

The parameter values are stored in the encrypted configuration file. Specify the option -raw to obtain the encrypted values. If you do not specify the option, the unencrypted value is displayed.

Note that parameter names are case sensitive when working with the Database Manager.

Prerequisites

You have the DBM operator authorization InstallMgm .

Syntax

dbm_configget [-raw] <parameter_name>

Displaying the encrypted value VALUE with the -raw option.

dbmcli -d DB -u dbm,dbm dbm_configget –raw VALUE

OK

c92ee241db0bf5632bc029bcf98f186b440bb548c0f056eb

Reply

OK<NL>
<parameter_value><NL>

In the event of errors, see Reply Format.


Changing a Configuration Parameter of the Database Manager (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing a Configuration Parameter of the Database Manager

Use

You set the value specified for the parameter specified as <parameter_name> in the configuration of the Database Manager. The new parameter value is registered by the system, and is transferred to the configuration file as the valid value at the next restart of the database instance.

You can specify that the value is to be stored unencrypted with the option -raw.

Maximum number of characters for encrypted values: 18
A longer value is shortened to 18 characters by the Database Manager CLI.

Maximum number of characters for unencrypted values: 512

Prerequisites

You have the DBM operator authorization InstallMgm .

Syntax

dbm_configset <parameter_name> <value>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Configuring Database Instances (SAP Library - SAP DB)

 Entering content frame

Background documentation Configuring Database Instances

Use

The database parameters are stored in the description file and the parameter file.

The default values, value areas, calculation rules, and parameter properties the Database Manager needs to process parameters correctly are all stored in the description file.

The description file and a parameter file that has default values assigned to it are installed with the database instance . With the commands for the configuration of database instances you change the entries in the parameter file of the database instance.

Prerequisites

For some of the commands for configuring database instances you require a parameter session .

Note the operator authorizations required for the particular commands DBM commands ( Operator Authorizations ).

Procedure

When logging on to the Database Manager , use the -d option to specify the name of the database instance for which you want to edit the parameters. On entering the param_* commands, a search is made in the parameter file belonging to this database instance for the value of the respective parameters.

If you do not specify a name or you specify the name of a non-existent database, the required parameter cannot be found.

Overview of the Commands for Configuring Database Instances


Parameter Properties (SAP Library - SAP DB)

 Entering content frame

Background documentation Parameter Properties

Property

Explanation

Possible values

CASESENSITIVE

Upper/lower case distinctions are relevant (for example, file names under UNIX)

YES | NO

CHANGE

Parameter can be changed

YES | NO

CLEAR

In a new installation, the parameter must not be copied from another database instance (examples: database instance name, volumes)

YES | NO

VOLUME

Type of parameter (Yes: volume parameter, NO: kernel parameter)

YES | NO

DISPLAYNAME

Character string (may include spaces) displayed instead of the parameter name in the Database Manager GUI

DYNAMIC

Parameter has a position indicator in the description file, such as DATAVOL_?
In the parameter file, it becomes DATAVOL_00, DATAVOL_01 and so on.

YES | NO

GROUP

Assignment to a group for display in the Database Manager GUI
 GENERAL: General Database Parameters, visible
 EXTENDED: Special Database Parameters, visible
 SUPPORT: Support Database Parameters, visible
 NO: The parameter is not accessible using the Database Manager GUI
 INFO: The parameter contains special information for users

GENERAL
| EXTENDED
| SUPPORT
| NO
| INFO

INSTANCES

Instance type for which the parameter is relevant

No entry: Parameter is generally valid

LVC | OLTP | BW | CS

INTERN

The value is only in the description file, not in the parameter file (Configuring Database Instances)

YES | NO

LASTKNOWNGOOD

Valid value of the parameter with which the database instance was last started

MANDATORY

Mandatory parameter

YES | NO

MAX

Maximum parameter value

MIN

Minimum parameter value

MODIFY

You can still change the parameter after the database instance has been generated (for example: RUNDIRECTORY: NO)

YES | NO

OVERRIDE

You can overwrite the DBM Server’s default value

YES | NO
| HIGHER

VALUESET

Permitted value set for a parameter
The individual values must be separated by spaces or tabs. Permitted string constants in character string parameters must be set off in quotation marks.

See also: Database Manager GUI 7.4


Overview of the Commands for Configuring Database Instances (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of the Commands for Configuring Database Instances

Terminating a Parameter Session | param_abortsession
Changing the Value of a Database Parameter | param_put
Changing Volume Parameters | param_addvolume
Displaying All Data for a Database Parameter | param_getfull
Displaying All Properties of a Database Parameter | param_getproperties
Displaying All Parameters of the Current Database Parameter File | param_directgetall
Displaying the Data for All Database Parameters | param_extgetall
Displaying the Data for All Volume Parameters | param_getvolsall
Displaying the Data for Individual Volume Parameters | para_getvolume
Displaying the Current Value of a Database Parameter | param_getvalue
Displaying the Data Type of a Database Parameter | param_gettype
Displaying the Stored Explanatory Text | param_getexplain
Displaying the Stored Help Text | param_gethelp
Displaying the System Default Value | param_getdefault
Displaying a Value from the Database Parameter File | param_directget
Displaying Individual Data for a Database Parameter | param_extget
Confirming Changes to the Database Parameter File | param_commitsession
Scrolling in the Database Parameter History | param_gethistorynext
Directly Changing a Value in the Database Parameter File | param_directput
Opening a Parameter Session | param_startsession
Adding a Volume | db_addvolume
Initializing the Database Parameters for a New Database Instance | param_init
Copying a Database Parameter File | param_copy
Correcting Database Parameters | param_putconfirm
List of Available Parameter Files | param_versions
Deleting the Database Parameter File | param_rmfile
Deleting a Database Parameter | param_directdel
Deleting Volume Parameters | param_delvolume
Opening the Database Parameter History | param_gethistory
Checking All Database Parameters | param_checkall
Resetting the Parameter File to a Previous Version | param_restore

The commands of the class param_direct* access the parameter file of the database instance directly. These commands do not require a parameter session and they cannot be rolled back ( Rollback ).


Terminating a Parameter Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating a Parameter Session

Use

You terminate the parameter session. All of the changes and corrections made to database parameters in this session are rejected. The internal data structures in which the contents of the description file and the parameter file were stored are removed (see also: Configuring Database Instances ).

If you change values without a parameter session, that is, directly in the parameter file (Make direct changes with param_directput and delete directly with param_directdel ), the changes are immediately written to the parameter file, that is, they cannot be rejected.

Prerequisites

You have opened a parameter session .

You have the DBM operator authorization ParamRead .

Syntax

param_abortsession

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Changing the Value of a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing the Value of a Database Parameter

Use

You can use this command to change the value of a database parameter in the internal data structures and to store it in the Database Manager.

In contrast to the function for changing a value directly in the database parameter file , the parameter is not written straight to the parameter file and you can still reject it by not confirming the parameter change or by terminating the parameter session .

The change of this parameter is rejected if the value entered or the change is impermissible due to the parameter properties.

After changing the database parameter, you must also execute the command to check all database parameters .

Prerequisites

You have opened a parameter session .

You have the DBM operator authorization ParamCheckWrite .

Syntax

param_put <parameter_name> <user_value>

Example

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


param_put Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text param_put Command: Example

You change the value of the database parameter MAXUSERTASKS to the value 5.

param_startsession
param_init
param_put MAXUSERTASKS 5
param_checkall
param_commitsession


Changing Volume Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing Volume Parameters

Use

Extend an existing database instance using the command db_addvolume (Adding a Volume). Use the command param_addvolume described here only for Creating a New Database Instance or in consultation with SAP DB Support.

Inconsistencies in the volume settings can lead to damage to the database instance.

Use this command to enter the volume parameters in the parameter file of the database instance. The new parameter value is registered by the system, and is transferred to the parameter file as the valid value at the next restart of the database instance.

You change volume parameters in two steps:

1. Change the entries for the parameters in the parameter file

2. Transfer the corresponding information to the database kernel using a utility command (Transferring a Utility or SQL Command)

If this command fails, you must also remove the entries in the parameter file of the database instance.

No check is made of whether there is sufficient disk capacity available to add the volume.

No check is made of whether the corresponding volume of the database instance is mirrored (Log Mode DUAL).

Prerequisites

You have the DBM operator authorization ParamFull.

Syntax

param_addvolume <volno> <volmode> <volname> <voltype> <volsize>

Options

<volno> | Volume number
<volmode> | Type of the volume
<volname> | Name of volume/file of the volume
<voltype> | Type of volume (such as file, raw device)
<volsize> | Size of the volume
Option <volmode>
DATA | Data Volume; the number of the data volume is assigned by the system as a four-digit number with leading zeros when creating the volume
LOG | Log Volume; the number of the log volume is assigned by the system as a three-digit number with leading zeros when creating the volume
MLOG | Mirrored log volume (Log Mode DUAL)

Reply

An OK message.

In the event of errors, see Reply Format.


Displaying All Data for a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying All Data for a Database Parameter

Use

You request all of the data stored for the database parameter identified as <parameter_name>.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getfull <parameter_name>

Example

Reply

The system outputs an OK message followed by all of the data for the parameter concerned.

OK<NL>
<type><NL>
<default><NL>
<value><NL>
<property> <value><NL>
<property> <value><NL>
...
HELP
<helpline><NL>
<helpline><NL>
...
EXPLAIN
<explainline><NL>
<explainline><NL>
...

Reply values

<type> | Data type of the parameter
<default> | System default value
<value> | Current value, taken from the parameter file at the start of the session
<property> | Property of the Parameter
<helpline> | Help text
<explainline> | Explanatory text

In the event of errors, see Reply Format .


param_getfull Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text param_getfull Command: Example

Displaying the data for the parameter RUNDIRECTORY

dbmcli -d DB -u dbm,dbm param_getfull RUNDIRECTORY

OK
c64
d:\sapdb\usr\wrk\DB
CHANGE YES
INTERN NO
MANDATORY YES
CLEAR YES
DYNAMIC NO
CASESENSITIVE YES
OVERRIDE NO
DEVSPACE NO
MODIFY YES
GROUP GENERAL
DISPLAYNAME
VALUESET
MAX
MIN
INSTANCES
LASTKNOWNGOOD d:\sapdb\usr\wrk\DB
HELP
Path where context and diagnosis information is stored
EXPLAIN
Path where context and diagnosis information is stored for this database instance.
(char(64))


Displaying All Properties for a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying All Properties for a Database Parameter

Use

You request all properties of the database parameter identified as <parameter_name>. All properties <property> are listed with their values <value>.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getproperties <parameter_name>

Reply

OK<NL>
<property> <value><NL>
<property> <value><NL>
...

In the event of errors, see Reply Format .


Displaying All Parameters of the Current Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying All Parameters of the Current Database Parameter File

Use

You display all database parameters of the current database instance with their values. One parameter with name <parameter_name> and value <value> is displayed per line.

The param_directgetall command accesses the database instance parameter file directly. It does not require a parameter session and so cannot be rolled back ( Rollback ).

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_directgetall

Reply

OK<NL>
<parameter_name> <value><NL>
<parameter_name> <value><NL>
...

In the event of errors, see Reply Format .


Displaying the Data for All Database Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Data for All Database Parameters

Use

You request all database parameters from the description file and the parameter file of the database instance (see also: Configuring Database Instances ).

If the reply is successful, the name of each database parameter <parameter_name>, its data type <type> and its current value <value> are displayed. This is the value that is copied from the parameter file at the start of the session. If the parameter is not in it, the default value from the description file is displayed.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_extgetall [<property>=<value>]

<property> Option

By specifying properties you can restrict what is displayed. However, each property can only be specified once. If the same property is entered more than once, the value of the last entry is used.

A parameter must correspond to the specified value in all specified properties (AND link). Several values for one property separated by commas are treated as OR-linked.

Property | Possible values
CASESENSITIVE | YES | NO
CHANGE | YES | NO
CLEAR | YES | NO
VOLUME | YES | NO
DISPLAYNAME | Character string (may include spaces) displayed in place of the parameter name in the Database Manager GUI
DYNAMIC | YES | NO
GROUP | GENERAL | EXTENDED | SUPPORT | NO
INFO | YES | NO
INSTANCES | Database instance types for which the parameter is relevant No entry: Parameter is generally valid
INTERN | YES | NO
MANDATORY | YES | NO
MAX | Maximum parameter value
MIN | Minimum parameter value
MODIFY | YES | NO
OVERRIDE | YES | NO | HIGHER
VALUESET | Permitted parameter value set

param_getextall CHANGE=YES GROUP=GENERAL

This command returns all parameters that are changeable and assigned to the General - General database parameters group.

param_getextall GROUP=GENERAL,EXTENDED

This command returns all parameters that are assigned to the General - General database parameters group or the Extended - Special database parameters group.

Reply

OK<NL>
<parameter_name> <type> <value><NL>
<parameter_name> <type> <value><NL>
...

In the event of errors, see Reply Format .


Displaying the Data for All Volume Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Data for All Volume Parameters

Use

You display the data for all volumes of a database instance .

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getvolsall [<volmode>]

Options

<volmode>

Type of the volume

Option <volmode>

DATA | Data Volume ; the number of the data volume is assigned by the system as a four-digit number with leading zeros when creating the volume
LOG | Log Volume ; the number of the log volume is assigned by the system as a three-digit number with leading zeros when creating the volume
MLOG | Mirrored log volume ( Log Mode DUAL)

Displaying the data for all volumes of the type DATA

dbmcli -d DB -u dbm,dbm param_getvolsall DATA

OK
MAXDATAVOLUMES 3
DATAVOL_0001 10000 F DAT_001
DATAVOL_0002 11000 F DAT_002

Reply

The system displays a list the data for the volumes.

OK<NL>
<parameter_name> <value>
<parameter_name> <value>
...
<volume> <volsize> <voltype> <volname>
<volume> <volsize> <voltype> <volname>
...

Values for the Fields of the Reply

<parameter_name> | Name of a database parameter relevant for volumes
<value> | Value of the parameter
<volume> | Volume ID
<volname> | Name of volume/file of the volume
<voltype> | Type of volume (such as file, raw device)
<volsize> | Size of the volume

In the event of errors, see Reply Format .


Displaying the Data of an Individual Volume Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Data of an Individual Volume Parameter

Use

You display the data of an individual volume parameter of the current database instance.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getvolume <volno> <volmode>

Options

<devno> | Number of the volume
<devmode> | Type of the volume

Option <devmode>

DATA | Data Volume ; the number of the data volume is assigned by the system as a four-digit number with leading zeros when creating the volume
LOG | Log Volume ; the number of the log volume is assigned by the system as a three-digit number with leading zeros when creating the volume
MLOG | Mirrored log volume ( Log Mode DUAL)

dbmcli -d DB -u dbm,dbm param_getvolume 1 DATA

OK
DAT_001
F
10000

Reply

OK<NL>
<volname>
<voltype>
<volsize>

Values for the Fields of the Reply

<volname> | Name of volume/file of the volume
<voltype> | Type of volume (such as file, raw device)
<volsize> | Size of the volume

In the event of errors, see Reply Format .


Displaying the Current Value of a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Current Value of a Database Parameter

Use

You display the current value of the database parameter specified in <parameter_name>.

The system displays the value of the parameter as saved in the database parameter file the last time the database instance was started.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getvalue <parameter_name>

Reply

OK<NL>
<value>

In the event of errors, see Reply Format .


Displaying the Data Type of a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Data Type of a Database Parameter

Use

You display the current value of the parameter specified as <parameter_name>.

There is an OK message after the command has been executed successfully. This is followed by the data type <type> of the specified parameter. The following output values for <type> are possible:
int2 | int4 | c8 | c18 | c24 | c40 | c64

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_gettype <parameter_name>

Reply

OK<NL>
<type>

In the event of errors, see Reply Format .


Displaying the Stored Explanatory Text (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Stored Explanatory Text

Use

You display the stored explanatory text for the database parameter <parameter_name>.

The system outputs an OK message followed by the explanatory text <explanation_line>. The line is empty, if no explanatory text is stored.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getexplain <parameter_name>

Reply

OK<NL>
<explanation_line><NL>
<explanation_line><NL>
...

In the event of errors, see Reply Format .


Displaying the Stored Help Text (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Stored Help Text

Use

You display the stored help text for the database parameter <parameter_name>.

The system outputs an OK message followed by the help text <helpline>. The line is empty, if no help text is stored.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_gethelp <parameter_name>

Reply

OK<NL>
<helpline><NL>
<helpline><NL>
...

In the event of errors, see Reply Format .


Displaying the System Default Value (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the System Default Value

Use

You display the system default value of the database parameter specified in <parameter_name>.

The system outputs an OK message and a line showing the system <default> value. The line is blank if the database parameter does not exist.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_getdefault <parameter_name>

Reply

OK<NL>
<default>

In the event of errors, see Reply Format .


Displaying a Value from the Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying a Value from the Database Parameter File

Use

The parameter file of the database instance is searched for the value of the database parameter specified in <parameter_name>.

After a successful search an OK message is displayed. The name of the database parameter <parameter_name> and its value <value> are displayed in the following line. The message output if the specified parameter is not in the parameter file is not found.

The param_directget command accesses the database instance parameter file directly. It does not require a parameter session and so cannot be rolled back ( Rollback ).

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_directget <parameter_name>

Reply

OK<NL>
<parameter_name> <value><NL>

In the event of errors, see Reply Format .


Displaying Individual Data for a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Individual Data for a Database Parameter

Use

You display the name, data type, and current value of the database parameter specified in <parameter_name>. The description file and the parameter file of the current database instance are searched (see also: Configuring Database Instances ).

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_extget <parameter_name>

Reply

OK<NL>
<parameter_name> <type> <value><NL>

<parameter_name> | Name of the database parameter
<type> | Data type of the database parameter
<value> | Current value This is the value that is copied from the parameter file at the start of the session. If the parameter is not in it, the default value from the description file is displayed here.

In the event of errors, see Reply Format .


Confirming Changes to the Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Confirming Changes to the Database Parameter File

Use

You confirm all changes to the database parameters and transfer these to the parameter file of the database instance . Before storing them the check status of all parameters is verified.

If you specify the NOCLOSE option, the parameter session remains open after the database parameters have been stored. If you do not specify this option, the parameter session is closed after the database parameters have been stored.

The changed values in the parameter file are only effective after a restart of the database instance.

Prerequisites

You have changed parameter values in a parameter session .

You have the DBM operator authorization ParamCheckWrite .

Syntax

param_commitsession [NOCLOSE]

Successful Reply

The system outputs an OK message.

Error Message

Execution of the command is refused:

ERR
14,ERR_XPCHECK_CN00 : param check failure/request
<identifier> <checkstatus>
<user_value>
<computed_value>

Values for the individual fields of the reply

<checkstatus>

The following check status may occur:

Mandatory: An obligatory database parameter has been assigned an empty value.

Constraint: An condition defined in the description file could not be fulfilled ( Configuring Database Instances ).

Request: The user input deviates both from the value transferred to the system and confirmed by it earlier, as well as from the system default value.

<user_value>

Value that the operator entered with param_put.

<computed_value>

Default value calculated by the system

Check status request is displayed only if the user entry varies from the value of the database parameter in the parameter file.

Continuation of Procedure

If the check status is a request, you can correct the error as follows:

Specify the valid value with param_putconfirm ( Correcting Database Parameters ). Otherwise the system default <computed_value> is used this for parameter for all further calculations of other parameters.

In the following cases, the parameter change is refused:

- The parameter has the value NOBODY for the CHANGE property

- The parameter has the value NO for the property MODIFY and the parameter file was already checked by the kernel (parameter __PARAM_CHANGED___ exists)

- You are dealing with a volume parameter (VOLUME property = Yes) and there are changed kernel parameters in the parameter file (VOLUME property= No) that have not yet been checked by the kernel
(Exception: You are creating a new database instance)

- The parameter is a kernel parameter and volume parameters have already been changed, but not yet checked by the kernel.


Scrolling in the Database Parameter History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the Database Parameter History

Use

You call up the rest of the contents of the database parameter history.

If you receive a reply of only:

OK
<header_line><NL>

then all specified entries have already been displayed.

If you have set selection criteria in the options on opening the database parameter history, then these also apply while you are scrolling through the parameter history.

Prerequisites

You have opened the database parameter history ( Opening the Database Parameter History ).

You have the DBM operator authorization ParamRead .

Syntax

param_gethistorynext

Reply

OK
<header_line><NL>
<param_line><NL>
<param_line><NL>
...

Values for the individual fields of the reply

<header_line>

Contains the names of the fields displayed
S stands for STATE and describes the database parameter's change state

<param_line>

Contains the values for the fields described in the <header_line>, the values are in the same column position as the field description in the <header_line>

Field S for STATE can contain any of the following entries:

c: changed
d: deleted
a: active


Changing a Value Directly in the Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing a Value Directly in the Database Parameter File

Use

With this command you change the parameters of the database instance . Unlike the function changing the value of a database parameter , the value <value> for the prameter identified as <parameter_name> is written straight to the parameter file. An entry is only made if the parameter is already contained in the parameter file.

In the following cases the parameter change is refused:

  • The parameter has the value NOBODY for the CHANGE property
  • The parameter has the value NO for the property MODIFY and the parameter file was already checked by the kernel (parameter __PARAM_CHANGED___ exists)
  • You are dealing with a volume parameter (property VOLUME = Yes) and there are changed kernel parameters in the parameter file (property VOLUME = No) that have not yet been checked by the kernel
    (Exception: You are creating a new database instance)
  • The parameter is a kernel parameter and volume parameters have already been changed, but not yet checked by the kernel.

The entered value for the parameter is not checked for consistency. Therefore unqualified changes to parameters are also possible using the command param_directput. These can then not be rejected by param_abortsession because the changes are written directly to the parameter file.

Prerequisites

You have the DBM operator authorization ParamFull .

Syntax

param_directput <parameter_name> <value>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Opening a Parameter Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Parameter Session

Use

You open a parameter session to check or change the parameters of a database instance .

The DBM Server loads the description file and parameter file of the database instance (see also: Configuring Database Instances ) and stores the contents in internal data structures. All access operations to this internal data take place within a parameter session.

In case of syntax error an error message is displayed which contains the file name, line number and line text.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_startsession

Reply

The system outputs an OK message.

In case of syntax error an error message is displayed which contains the file name, line number and line text.


Adding a Volume (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Adding a Volume

Use

You define additional data volumes or log volumes to extend the disk space for the database instance .

Prerequisites

You have the DBM operator authorization ParamFull or AccessUtility .

Syntax

db_addvolume <volmode> <volname> <voltype> <size>

<volmode> | Type of volume that is to be added. Possible values are: DATA (Data volume) LOG (Log volume)
<volname> | Name of device/file
<voltype> | Type of device or fill that is to be added. Possible values are: F (File) L (Link) R (Raw Device)
<size> | Size of the volume to be added in pages

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Initializing the Database Parameters for a New Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Initializing the Database Parameters for a New Database Instance

Use

You initialize all of the database parameters needed to generate a new database instance ( Database Parameters ).

This procedure uses the name of the database instance from the session with the Database Manager. There must not be database parameter file for this database instance.

All database parameters are first assigned their default values from the description file (see also: Configurating Database Instances ). Then a complete calculation run is carried out. The values from the calculation run overwrite the default values.

The new parameter values in the database parameter file are checked for correct syntax. The system does not display a message about conditions that are not fulfilled or missing obligatory values.

The initialization is performed only within the Database Manager. The parameters are saved to the database parameter file only when you confirm changes to the database parameter file .

Prerequisites

You have opened a parameter session .

You have the DBM operator authorization InstallMgm .

Syntax

param_init

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Copying a Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Copying a Database Parameter File

Use

You copy the parameter file of an existing database instance as the initial configuration for a new database instance. You can only copy a source parameter file if the new database instance does not yet have one.

All parameter changes made during the current parameter session up to this point are overwritten by the copied parameter file. Parameters that cannot be changed because of their properties retain their system default values copied from the description file. This applies to the following parameters:

- RUNDIRECTORY contains a directory name
 <independent_data_path>/wrk/<database_name>
  • KERNELVERSION is initialized with the version number stored in the DBM Server

Specify the name of the source database in <source_db>.

(See also: Configuring Database Instances )

Prerequisites

You have opened a parameter session .

You have the DBM operator authorization InstallMgm .

Syntax

param_copy <source_db>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Correcting Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Correcting Parameters

Use

You correct the value of a parameter. In doing so, you have the choice of assigning either the user input <user_value> or the system default value <computed_value> to the parameter <parameter_name> registered with request.

The value is stored in the parameter manager and becomes effective after a Restart of the Database Instance . Parameters that you correct with this command are only queried if both the current user input and the system default value do not match the confirmed value.

You can only use this command for SAP DB database systems up to version 7.3.

Prerequisites

You have the DBM operator authorization ParamCheckWrite .

You have opened a parameter session and checked parameters.

The check status Request for a parameter was indicated.

Syntax

param_putconfirm <parameter_name> <user_value>|<computed_value>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


List of the Available Parameter Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of the Available Parameter Files

Use

You request a list of all available parameter files.

Prerequisites

You have the DBM operator authorization ParamRead .

Syntax

param_versions

Reply

OK<NL>
<file><NL>
<file><NL>
...

<file>

Name of the parameter file

In the event of errors, see Reply Format .


Deleting the Database Parameter File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting the Database Parameter File

Use

You can delete the parameter file.

Use this command with great care.

With the command param_restore ( Resetting the Parameter File to a Previous Version ), you can restore the version of the parameter file that was valid before the deletion.

Prerequisites

You have the DBM operator authorization InstallMgm .

Syntax

param_rmfile

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Deleting a Database Parameter (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting a Database Parameter

Use

You delete the parameter specified as <parameter_name> from the database parameter file.

The changed values are transferred to the parameter file and are effective after the next restart of the database instance.

Use this command with great care.

The param_directdel command accesses the database instance parameter file directly. It does not require a parameter session and so cannot be rolled back ( Rollback ).

Prerequisites

You have the DBM operator authorization ParamFull .

Syntax

param_directdel <parameter_name>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Deleting Volume Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting Volume Parameters

Use

You delete the data for the specified volume from the database parameter file.

Use this command with great care.

Inconsistencies in the volume settings can lead to damage to the database instance .

Prerequisites

You have the DBM operator authorization ParamCheckWrite .

Syntax

param_delvolume <volno> <volmode>

Options

<volno> | Number of the volume
<volmode> | Type of the volume

Option <volmode>

 | Data Volume ; the number of the data volume is assigned by the system as a four-digit number with leading zeros when creating the volume
LOG | Log Volume ; the number of the log volume is assigned by the system as a three-digit number with leading zeros when creating the volume
MLOG | Mirrored log volume ( Log Mode DUAL)

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Opening the Database Parameter History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening the Database Parameter History

Use

You open the database parameter history and transfer the first block of the contents. The entries are output in reverse chronological sequence, that is, starting with the most recent and ending with the oldest.

You can limit the output by specifying options. If you enter several selection criteria, then only those parameter changes that correspond to all the criteria are output.

If the parameter history entries have been incompletely transferred, you can call up the rest of the contents using the command for scrolling through the database parameter history.

Prerequisites

You have the DBM operator authorization ParamRead.

Syntax

param_gethistory

[fields=<field_list>] [name=<parameter_name>]

[date=<yyyymmdd>] [group=<group_list>]

[state=<state_list>]

Example

Options

<field_list>

You can restrict the quantity of history fields supplied by the Database Manager by specifying a field list.
Enter the fields that you want to display here using a comma as a separator.
The fields you select will always be output in the following sequence:

Possible entries:

DATE Date when parameter was changed (YYYYMMDD)
TIME Time when parameter was changed (00HHMMSS)
NAME Name of parameter
NEWVALUE New value of parameter
OLDVALUE Old value of parameter
STATE Change state of parameter
GROUP Group to which the parameter is assigned

If you do not specify a field list, then all fields are displayed.

<parameter_name>

You can display the history of one specific parameter by specifying the parameter name.
If you do not specify a parameter name, the entries for all parameters in the history are displayed.

<yyyymmdd>

If you specify a date, then only those parameter changes that have taken place since this date are displayed.
If you do not specify a date, all entries in the history are displayed.

<group_list>

You can restrict the database parameters for which the changes are displayed by specifying a parameter group. Use a comma to separate entries.

Possible values are:
GENERAL: General database parameters
EXTENDED: Special database parameters
SUPPORT: Support database parameters

If you do not specify a parameter group, then the parameter changes for all groups are displayed.

<state_list>

You can specify the change state to determine whether active, changed or deleted database parameters are displayed. Use a comma to separate entries.

Possible values are: A (active), C (changed), D (deleted)

If you do not specify a state, then all parameter changes are displayed.

Reply

OK
<header_line><NL>
<param_line><NL>
<param_line><NL>
...

Values for the Individual Fields of the Reply

<header_line>

contains the names of the fields displayed
S stands for STATE and describes the parameter's status

<param_line>

contains the values for the fields described in the <header_line>, the values are in the same column position as the field description in the <header_line>

Field S for STATE (change status of the database parameters) can contain any of the following entries:

c: changed
d: deleted
a: active


param_gethistory Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text param_gethistory Command: Example

Opening the parameter history for the parameter _MAXDATAVOLUMES

dbmcli -d myDB -u dbm,dbmp param_gethistory name=_MAXDATAVOLUMES

OK
DATE TIME NAME  NEWVALUE OLDVALUE S GROUP
20010613 00152700 _MAXDATAVOLUMES 5 4 A SUPPORT
20010613 00152700 _MAXDATAVOLUMES 4 3 C SUPPORT
20010613 00152659 _MAXDATAVOLUMES 3 C SUPPORT


Checking All Database Parameters (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Checking All Database Parameters

Use

You check all database parameters using the properties, calculation formulas, and conditions stored in the description file (Configuring Database Instances).

Prerequisites

You have opened a parameter session.

You have the DBM operator authorization ParamCheckWrite.

Syntax

param_checkall [<mode>]

Option <mode>

Using the parameter <mode>, you can control the behavior of the Database Manager for parameters with the check status request.

Possible values of <mode>:

No entry | The system default values are used for all parameters (necessary for background processing).
GENERAL | Only the parameters from the group General - General Database Parameters are requested during the check status request.
EXTENDED | Only the parameters from the groups General - General Database Parameters and Extended - Special Database Parameters are checked.
SUPPORT | This option is only relevant for SAP DB Support. All parameters (General, Extended, and Support groups) are checked (support database parameters).

Reply

If an error occurs the database parameter check is canceled with an error message.

ERR
14,ERR_XPCHECK_CN00 : param check failure/request
<parameter_name>      <check_status>
<user_value>
<computed_value>

<parameter_name> | Name of the database parameter
<check_status> | The following are possible values for the check status: Mandatory – An obligatory parameter has been assigned a blank value. Constraint – a constraint could not be fulfilled. Request – the operator input deviates both from the value transferred to the system and confirmed by it earlier, as well as from the system default value.
<user_value> | Value that the operator entered with param_put.
<computed_value> | Default value calculated by the system

For open requests the parameter changes cannot be confirmed (Confirming Changes to the Database Parameter File).

Continuation of Procedure

Correct the parameter in question using param_putconfirm (parameter correction) or param_put (change a parameter value)and carry out a new check with the command param_checkall [<mode>].

The new parameter value is registered by the system, and is transferred to the parameter file as the valid value at the next restart of the database instance.


Resetting the Parameter File to a Previous Version (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Resetting the Parameter File to a Previous Version

Use

The parameter file is reset to the version specified by <version_number>.

This parameter file will be used when the database instance is next started.

Prerequisites

You have the DBM operator authorization ParamCheckWrite .

Syntax

param_restore <version_number>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


List of the DBM Commands (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of the DBM Commands

Use

You request the list of all DBM commands . In addition, you receive a short syntax description for all commands.

The list of displayed commands can be restricted via the parameter <command>. Only those commands are displayed which start with the specified character string.

Prerequisites

You do not need to log on to the Database Manager to execute this DBM command .

Syntax

help [-obsolete] <command>

d:\v73>dbmcli help autosave

OK
autosave_cancel (obsolete version of autolog_cancel)
autosave_off (obsolete version of autolog_off)
autosave_on (obsolete version of autolog_on)
autosave_show (obsolete version of autolog_show)

Option

Specify the option -obsolete, to display exclusively the obsolete commands. The system displays a reference to the current name for each of these commands.

d:\v73>dbmcli help -obsolete

OK
autosave_cancel (obsolete version of autolog_cancel)
autosave_off (obsolete version of autolog_off)
autosave_on (obsolete version of autolog_on)
autosave_show (obsolete version of autolog_show)
backup_save_cancel (obsolete version of autolog_on)
backup_save_ignore (obsolete version of backup_ignore)
.....

Reply

OK<NL>
<command_name> <description><NL>
<command_name> <description><NL>
...

In the event of errors, see Reply Format .


Backing Up and Recovering Database Instances (SAP Library - SAP DB)

 Entering content frame

Background documentation Backing Up and Recovering Database Instances

Use

You can use the Database Manager CLI to perform complete data backups, incremental data backups, and log backups and to import these backups if hardware errors occur, so restoring the database to a consistent state.

Prerequisites

Note the operator authorizations required for the particular DBM commands.

Commands for Backup Media

Commands for Backing Up and Archiving

Commands for the Backup History

Commands for External Backup IDs

Commands for Backup Information

Commands for Restoring


Commands for Backup Media (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for Backup Media

Use

A backup medium is assigned to every backup action. Backup media can be files, tapes, and pipes.

The path specifications and properties of the tape device, tapes, or files are grouped together in the media definition under a freely selectable, practical name. Under these names, the backup media can be re-used for all possible backup operations.

Prerequisites

Note the operator authorizations required for the particular commands DBM commands .

Syntax

Change Date of the Media Definition File | medium_date
Defining or Changing a Backup Medium | medium_put
Displaying the Media Data | medium_get
List of All Defined Backup Media | medium_getall
Deleting a Backup Medium | medium_delete
Transferring an Existing Media Definition | medium_migrate


Change Date of the Media Definition File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Change Date of the Media Definition File

Use

You request the date on which the current media definition file was last changed (Database Manager Files).

Prerequisites

You have the DBM operator authorizations Backup and DBInfoRead.

Syntax

medium_date

Reply

OK<NL>
<YYYYMMDDHHMMSS><NL>

In the event of errors, see Reply Format.


Creating or Changing a Backup Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating or Changing a Backup Medium

Use

You create a new backup medium or change the data for a backup medium that already exists. To do this, you must make the following specifications:

<name>

The backup medium specified in <name> is created or updated. The name of the medium may comprise a group name and a member name. These are separated by a slash.

<name> ::= [<group_name>/]<member_name>

Groups of parallel backup media of this type are used for parallel backups and restores. To create a group of parallel backup media, execute the command for creating one backup medium as many times as you need. Create the group by assigning each different <member_name> to the same <group_name>.

If you want to perform a backup or a restore using one of the external backup tools TSM, NetWorker, Backint for Oracle, or Backint for SAP DB, ensure the name of the medium starts with ADSM, NSR, BACK, or BACK. In this case, specify PIPE only as the <type>. The pipe must not already exist, and there must be no limit on its size. On Microsoft Windows, the name of the pipe must have the following form: \\.\pipe\<pipe_name>

There are no special naming conventions on UNIX.

When you make parallel backups with the external backup tool NetWorker, the number of pipes used for backups must be the same as the number of tape devices used.

<location>

The name of the device/file with which it can be addressed through operating system functions.

<type>

Type of the backup medium. Possible values are:

AUTO
TAPE
FILE
NOREWIND
PIPE
UNKNOWN

The media type AUTO is the default value for the command to Activate the Automatic Log Backup. There can only be one backup medium of this type. If there is already a backup medium of type AUTO, and you create a backup medium of type AUTO again, the system changes the media type of the existing backup medium to LOG.

<backup_type>

Backup type for the backup medium:
 DATA (complete data backup), PAGES (incremental data backup), or LOG (log backup)

<size>

Maximum number of pages that can be written to the backup medium. This is necessary to change the tape correctly, for example. If the backup media is of sufficient size, a zero can be specified.

<block_size>

Number of pages that are transferred when accessing the medium (default: 8).

<overwrite>

This option is only relevant for the medium type FILE and describes the behavior if the file is already present. Permitted values are:
 NO
YES

<autoldr>

Specifies whether the device changes the medium automatically:
YES
NO

<oscmd>

Operating system command to be executed before backing up to a succeeding medium or restoring a succeeding medium.

Prerequisites

You have the DBM operator authorization Backup.

Syntax

medium_put <name> <location> <type> <backup_type> <size> <block_size> <overwrite> <autoldr> <oscmd>

Examples: Creating Backup Media

Reply

OK

In the event of errors, see Reply Format.


medium_put Command: Examples (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text medium_put Command: Examples

Defining a file as a backup medium for an interactive log backup:

dbmcli -d <database_instance> -u <dbm_user>,<password> medium_put logsave /usr/sapdb/log FILE LOG

Defining a file as a backup medium for an automatic log backup:

dbmcli -d <database_instance> -u <dbm_user>,<password> medium_put autosave /usr/sapdb/auto FILE AUTO

Defining a file as an overwritable backup medium for a complete data backup:

dbmcli -d <database_instance> -u <dbm_user>,<password> medium_put completeF /usr/sapdb/complete FILE DATA 0 0 YES

Defining a tape device as a backup medium for a complete data backup

dbmcli -d <database_instance> -u <dbm_user>,<password> medium_put completeT /dev/rft0 TAPE DATA 64000 8 NO

Defining a file as a backup medium for an incremental data backup:

dbmcli -d <database_instance> -u <dbm_user>,<password> medium_put incrF /usr/sapdb/incr FILE PAGES

Defining a pipe as an external backup medium for an incremental data backup with an external backup tool on Microsoft Windows:

dbmcli -d <database_name> -u <dbm_user>,<password> medium_put ADSM123 \\.\pipe\example PIPE PAGES


Displaying the Media Data (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Media Data

Use

You display the media data for the backup medium specified in <name>.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead.

Syntax

medium_get <name>

Reply

OK<NL>
<name> <location> <type> <backup_type> <size> <block_size> <overwrite> <autoldr> <oscmd> <date_created> <date_modified> <NL>

The fields of the one-line output are separated by tabs.

Values for the individual fields of the reply

<name>

Name to identify the backup medium. The name of the backup medium may comprise a group name and a member name. These are separated by a slash.

<name> ::= [<group_name>/]<member_name>

This type of group is used with parallel backup or restore operations.

<location>

The name of the device/file with which it can be addressed through operating system functions.

<type>

Type of the backup medium, possible values are:
 TAPE
FILE
NO-REWIND
PIPE
AUTOLOADER
UNKNOWN

<backup_type>

Type of backup for which the backup medium is to be used: Possible values are:
 DATA for a complete data backup
PAGES for an incremental data backup
LOG for a log backup

<size>

Maximum number of pages which can be written to the backup medium. This is necessary to change the tape correctly, for example. If the media are of sufficient size, a zero can be specified.

<block_size>

Number of pages that are transferred when accessing the medium (default: 8).

<overwrite>

This option is only relevant for the medium type FILE and describes the behavior if the file is already present. Permitted values are:
 NO
YES
VERSION

<autoldr>

Specifies whether the device changes the medium automatically:
YES
NO

<oscmd>

Operating system command to be executed before backing up to a succeeding medium or restoring a succeeding medium.

<date_created>

Date on which the backup medium was created

<date_modified>

Date on which the backup medium was changed

In the event of errors, see Reply Format.


List of All Defined Backup Media (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of All Defined Backup Media

Use

You can call up a list of all defined backup media.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead.

Syntax

medium_getall

Reply

OK<NL>
 <name> <location> <type> <backup_type> <size> <block_size> <overwrite> <autoldr> <oscmd> <date_created> <date_modified> <NL>

<name> <location> <type> <backup_type> <size> <block_size> <overwrite> <autoldr> <oscmd> <date_created> <date_modified> <NL>

...

Values for the individual fields of the reply

<name>

Name for identifying the backup medium. The name of the medium may comprise a group name and a member name. These are separated by a slash.

<name> ::= [<grpname>/]<membername>

This type of group is used with parallel data backups or parallel restore operations.

<location>

The name of the device/file
Used for operating system functions.

<type>

Type of the backup medium Possible values are:
 TAPE
FILE
NO-REWIND
PIPE
AUTOLOADER
UNKNOWN

<backup_type>

The type of backup for which the medium is to be used:
 DATA (complete data backup)
 PAGES (incremental data backup)
 LOG (log backup)

<size>

Maximum number of pages which can be written to the medium. This is necessary to change the tape correctly, for example. If the backup media is of sufficient size, a zero can be specified.

<block_size>

Number of pages that are transferred when accessing the medium (default value: 8).

<overwrite>

This option is only relevant for the media type FILE and describes the behavior if the file is already present. Possible values are:
 NO
YES
VERSION

<autoldr>

Specifies whether the device changes the medium automatically:
 YES
NO

<oscmd>

Operating system command to be executed before backing up to a succeeding medium or restoring a succeeding medium.

In the event of errors, see Reply Format.


Deleting a Backup Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting a Backup Medium

Use

You delete the backup medium specified as <name>.

Prerequisites

You have the DBM operator authorization Backup .

Syntax

medium_delete <name>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring an Existing Media Definition (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring an Existing Media Definition

Use

You can transfer existing definitions for backup media from the media definition file control.med (database version 6.2) to the new media definition file dbm.mmm (as of database version 7.2.4.2).

(See also: Database Files )

The media definition from the old file is not transferred if there is an identical media name in the old and new media definition files.

As the old definitions for backup media do not contain a backup type (incremental data backup, complete data backup, or log backup), you should define this afterwards using the command medium_put ( Defining or Changing a Backup Medium ). Otherwise you must specify this when starting the backup process.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

medium_migrate

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Commands for Backing Up and Archiving (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for Backing Up and Archiving

Use

With the Database Manager, you can perform complete data backups , incremental data backups , and log backups .

For log backups, we recommend that you enable automatic log backup . The option of interactive log backups is also available to you, however.

Prerequisites

Note the operator authorizations required for the particular commands DBM commands .

The prerequisite for executing all other backup commands is to execute the command to backup the database instance first.

Syntax

Canceling the Automatic Log Backup | autolog_cancel
Displaying the Automatic Log Backup Function | autolog_show
Displaying the Current Backup Status | backup_state
Deactivating the Automatic Log Backup | autolog_off
Terminating an Interrupted Backup | backup_cancel
Creating a Single Backup of the Version Files | archive_stage
Activating the Automatic Log Backup | autolog_on
Continuing the Backup Without the Medium Last Reported as Full | backup_ignore
Creating Multiple Archives of the Version Files | archive_stage_repeat
Backing Up to a Succeeding Medium | backup_replace
Backing Up the Database Instance | backup_start
Backing Up with External Backup Tools | ---


Canceling the Automatic Log Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Canceling the Automatic Log Backup

Use

You can cancel an automatic log backup while it is running. This deactivates the automatic log backup function. Use this command to prevent technical problems with the backup medium , for example.

If you want the log to be backed up automatically again later, then you have to explicitly enable the log backup again ( Activating the Automatic Log Backup ).

Prerequisites

You have the DBM operator authorization Backup .

Syntax

autolog_cancel

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Displaying the Automatic Log Backup Function (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Automatic Log Backup Function

Use

You determine whether the automatic log backup function is enabled or disabled.

Prerequisites

You have the DBM operator authorization DBFileRead or DBInfoRead. .

Syntax

autolog_show

dbmcli -d <database_name> -u <userid>,<password> autolog_show

OK<NL>
AUTOLOG IS OFF <NL>

Reply

OK<NL>
AUTOLOG IS (OFF | ON)<NL>

AUTOLOG IS ON | Automatic log backup is enabled
AUTOLOG IS OFF | Automatic log backup is disabled

In the event of errors, see Reply Format .


Displaying the Current Backup Status (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Current Backup Status

Use

You display the current status of the backup operation.

You can use this request during a backup of the database instance .

Prerequisites

You have the DBM operator authorization Backup .

You have started a backup ( Backing Up the Database Instance ).

Syntax

backup_state

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Version of the database software

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup media used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup Id

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Archiving the Version Files of the Log Area (SAP Library - SAP DB)

 Entering content frame

Background documentation Archiving the Version Files of the Log Area

To increase the security of your database system, we recommend that you archive the version files created during Log Backup and stored on the hard disk of your system at regular intervals (Version Files). To do this, copy the version files to another backup medium (see also Backups).

You can perform this process manually or use external backup tools.
For information on which external backup tools are supported by the SAP DB database system, see the documentation The SAP DB Database System in the section External Backup Tool.

There are DBM commands available for archiving with external backup tools, with which you can copy the version files once or several times to external backup media.

The commands for archiving the version files to external backup media are supported from database version 7.04.03.

Creating a Single Archive of the Version Files

Creating Multiple Archives of the Version Files


Creating a Single Archive of the Version Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Single Archive of the Version Files

Use

You archive the original version files for the log area. To do this, you copy the version files using an external backup tool to an external backup medium.

The command for archiving the version files once to external backup media is supported from database version 7.04.03.

If you want to backup the same version files more than once to different external backup media, first use the archive_stage command described here and then the command for creating multiple archives of the version files of the log area.

Prerequisites

Your database instance has at least Version 7.04.03.

You have the DBM operator authorization Backup.

You have backed up the log (Log Backup).

The external backup medium is defined for the backup type LOG (Defining or Changing a Backup Medium).

Syntax

archive_stage <ext_backup_medium> <log_medium> [VERIFY | NOVERIFY] [REMOVE | KEEP] [FNL <list>]

<ext_backup_medium> | Name of the external backup medium
<log_medium> | Name of the backup medium that was used for the log backup
VERIFY | System default value The archived files are compared with the original files.
NOVERIFY | Only the usual checks as to whether the backup was successful are performed by the system. The system displays error messages and the output of the backup tools.
REMOVE | System default value The original files are deleted after they have been successfully archived to the external backup medium.
KEEP | The original files are archived, but not then deleted.
FNL | File Number List: Keyword of the list of files to be archived
<list> | File name or area or file names, you can leave out leading zeros. Separate multiple specifications using commas. If you do not specify a file list, all version files on the backup medium that are also in the backup history are copied.

In most cases, it is not necessary to specify a file number list, as all completed version files are archived with the command archive_stage. The system obtains the information about which files are complete from the backup history.
Only specify the keyword FNL and the file number list if version files that you are sure were created are not in the backup history due to an error. This would be the case, for example, if the version files with the number 10 and 12 are in the backup history, but number 11 is missing.

Archiving the originals of the version files 1 and 3-10
These are on the backup medium LOGMEDIUM and are archived to the external backup medium EXTMEDIUM. Only the usual system checks are to be performed. The version files are not then to be deleted.

archive_stage EXTMEDIUM LOGMEDIUM NOVERIFY KEEP FNL 1,3-10

Reply:

OK
Processed Stage Files  9
Bytes Processed     12845056
Deleted Stage Files    0
Remaining Stage Files  2

Result

The system displays an OK message and information about the archived version files.

The archived version files are assigned their own external backup IDs and are entered in the backup history.

Processed Stage Files | Processed version files
Bytes Processed | Processed bytes
Deleted Stage Files | Deleted version files
Remaining Stage Files | Remaining version files


Creating Multiple Archives of the Version Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating Multiple Archives of the Version Files

Use

You archive the original version files of the log area more than once on to different external backup media. You can also use different external backup tools to do this.

Exactly the same version files are processed as were copied to the first external backup medium using the command to archive the version files once, which must be executed once.

The command for archiving the version files to external backup media is supported from database version 7.04.03.

It can be executed only in the same DBM server session as the command for archiving the version files once, which must be executed first (see Opening a DBM Server Session).

Prerequisites

Your database instance has at least Version 7.04.03.

You have the DBM operator authorization Backup.

You have first executed the command to archive the version files once, specifying the KEEP option.

The external backup media are defined for the backup type LOG (Defining or Changing a Backup Medium).

Syntax

archive_stage_repeat <ext_backup_medium> [VERIFY | NOVERIFY] [REMOVE | KEEP]

<ext_backup_medium> | Name of the external backup medium
VERIFY | System default value The archived files are compared with the original files.
NOVERIFY | Only the usual checks as to whether the backup was successful are performed by the system. The system displays error messages and the output of the backup tools.
REMOVE | System default value The original files are deleted after they have been successfully archived to the external backup medium.
KEEP | The original files are archived, but not then deleted.

Multiple archiving of the original version files 1 and 3-10
These are on the backup medium LOGMEDIUM, and are first archived to the external backup medium EXTMEDIUM_1 and then to the medium EXTMEDIUM_2. Only the usual system checks are to be performed. The version files are not then to be deleted.

archive_stage EXTMEDIUM_1 LOGMEDIUM NOVERIFY KEEP FNL 1,3-10

Reply:

OK
Processed Stage Files  9
Bytes Processed     12845056
Deleted Stage Files    0
Remaining Stage Files  2

archive_stage_repeat EXTMEDIUM_2

Reply:

OK
Processed Stage Files  9
Bytes Processed     12845056
Deleted Stage Files    9
Remaining Stage Files  0

Result

The system displays an OK message and information about the archived version files.

The archived version files are assigned their own external backup IDs and are entered in the backup history.

Processed Stage Files | Processed version files
Bytes Processed | Processed bytes
Deleted Stage Files | Deleted version files
Remaining Stage Files | Remaining version files


Deactivating the Automatic Log Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deactivating the Automatic Log Backup

Use

You deactivate the automatic log backup .

Prerequisites

You have the DBM operator authorization Backup .

Syntax

autolog_off

dbmcli -d <database_name> -u <userid>,<password> autolog_off

OK

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Terminating an Interrupted Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating an Interrupted Backup

Use

You can exit an interrupted backup process completely.

Prerequisites

You have the DBM operator authorization Backup .

You have begun backing up the database instance . The backup operation was interrupted.

Syntax

backup_cancel

Reply

In the reply to this command only the field Return code is assigned a value.

OK<NL>
Return code <value>

In the event of errors, see Reply Format .


Activating the Automatic Log Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating the Automatic Log Backup

Use

You enable automatic log backup. For <medium>, specify the backup medium on which the log is to be automatically backed up.

Prerequisites

You have the DBM operator authorization Backup.

Syntax

autolog_on <medium>

You must specify a suitable medium when you activate the automatic log backup for the first time. The Database Manager then uses the medium last used for the automatic log backup, if you do not specify another medium.

dbmcli -d <database_name> -u <dbm_user>,<password> autolog_on [<medium>]

Reply

The system displays an OK message.

In the event of errors, see Reply Format.


Continuing the Backup Without the Medium Last Reported as Full (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Continuing the Backup Without the Medium Last Reported as Full

Use

Use this command to continue a backup without the last medium that was reported full.

Prerequisites

You have the DBM operator authorization Backup .

You have started backing up the database instance . The backup operation was interrupted because the backup medium was reported full.

Syntax

backup_ignore

Reply

The reply to this command provides information about the backup supplied by the kernel.

This information is only given when the backup has been ended or interrupted. This command may therefore take a long time to execute.

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>

In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages

If it is clear from the message number that the backup was only interrupted, the session must be continued with the continuation command: ( backup_replace , backup_ignore ), or terminated with backup_cancel .

In the event of errors, see Reply Format .


Backing Up to a Succeeding Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up to a Succeeding Medium

Use

You have started a backup . This was interrupted because the system reported that the backup medium is full.

You define a new backup medium. The backup continues to the medium you defined.

Prerequisites

You have the DBM operator authorization Backup .

Syntax

backup_replace <medium>

Reply

The reply to this command provides information about the backup supplied by the kernel.

This information is only given when the backup has been ended or interrupted. This command may therefore take a long time to execute.

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volumn Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages

If it is clear from the message number that the backup was only interrupted, the session must be continued with the continuation command: ( backup_replace , backup_ignore ), or terminated with backup_cancel .

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Backing Up the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up the Database Instance

Use

You back up the database instance.

If you want to use an external backup tool to do this, proceed as described in the section Backing Up with External Backup Tools. Otherwise, use the command backup_start, described below.

Prerequisites

You have the DBM operator authorization Backup.

You have started a utility session.

Syntax

backup_start <medium> [<type>] [AUTOIGNORE]

<medium> | Name of the backup medium; for a backup to a group of parallel backup media, specify the name of the media group here. This must first be defined (Defining or Changing a Backup Medium).
<type> | Backup type: DATA (complete data backup), PAGES (incremental data backup) or LOG (log backup)
AUTOIGNORE | The backup is to be automatically continued without the last backup medium reported as full (Continuing the Backup Without the Medium Last Reported as Full)

If you are using backup media that is already defined, it is vital you follow the current naming conventions for backup media (see Defining or Changing a Backup Medium ) to avoid error messages.

Reply

The reply to this command provides information about the backup supplied by the kernel.

This information is only given when the backup has been ended or interrupted. This command may, therefore, take a long time to execute.

OK<NL>
Returncode              <value><NL>
Date                    [<value>]<NL>
Time                    [<value>]<NL>
Server                  [<value>]<NL>
Database                [<value>]<NL>
Kernel Version          [<value>]<NL>
Pages Transferred       [<value>]<NL>
Pages Left              [<value>]<NL>
Volumes                 [<value>]<NL>
Medianame               [<value>]<NL>
Location                [<value>]<NL>
Error text              [<value>]<NL>
Label                   [<value>]<NL>
Is Consistent           [<value>]<NL>
First LOG Page          [<value>]<NL>
Last LOG Page           [<value>]<NL>
DB Stamp 1 Date         [<value>]<NL>
DB Stamp 1 Time         [<value>]<NL>
DB Stamp 2 Date         [<value>]<NL>
DB Stamp 2 Time         [<value>]<NL>
Page Count              [<value>]<NL>
Devices Used            [<value>]<NL>
Database ID             [<value>]<NL>
Max Used Data Page      [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of the database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup media used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup: first page saved in log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum page number (indication of minimum database size when backup is imported)

Reply in the Event of an Error

If an error occurs while you are using an external backup tool, you will receive a reply in the following format:

ERR<NL>
<errcode>, <err_description><NL>
[<extended_description><NL>]

<errcode> | Error message number See also: Messages 7.4
<err_description> | Description of the error
<extended_description> | Cause of the error

The following errors may occur:

<errcode> | <err_description> | Explanation
-24927 | ERR_TOOLCHK: the external backup tool was not found | The external backup tool could not be found or has been installed incorrectly.
-24926 | ERR_MEDIUMCHK: the medium cannot be used with an external backup tool | The specified backup medium cannot be used with the backup tool referred to by the medium name (Creating or Changing a Backup Medium).
-24925 | ERR_PREPARE: prepare of the backup operation failed | The preparations necessary to use the backup tool were not made correctly.
-24924 | ERR_DBREQ: cannot start database kernel request | The database instance was unable to start the backup.
-24923 | ERR_TOOLREQ: cannot start external backup tool correctly | The backup tool could not be started correctly.
-24922 | ERR_OPCHK: cannot check state of backup operation | Unable to check the status of the database instance or the backup tool.
-24921 | ERR_POSTOP: cannot finish backup operation correctly | Although the backup was successful, the post-processing steps required could not be performed.
-24920 | ERR_BACKUPOP: backup operation was unsuccessful | The backup failed due to a problem with the database or the backup tool.
-24919 | ERR_CLEANUP: cannot clean up correctly after backup operation | Although the backup was successful, the temporary system resources that were used could not be freed up again.

If it is clear from the message number that the backup was only interrupted, the session must be continued with the continuation command: (backup_replace, backup_ignore), or terminated with backup_cancel.


Backing Up with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Backing Up with External Backup Tools

The Database Manager supports the use of external backup tools for complete and incremental data backups, as well as for the archiving of log backups.

For information on which external backup tools are supported by the SAP DB database system, see the documentation The SAP DB Database System in the section External Backup Tool.

You can also use scripts to perform backups with external backup tools. However, if you do this, the Database Manager does not write a backup history, and cannot, therefore, check whether a backup has been successful.

Using the Backup Tools

Start the backup operation directly from the Database Manager CLI. The naming conventions for backup media enable the program to recognize the external backup tool and start it. The pipes for transferring the backup data are implicitly created by the Database Manager CLI during the backup process. They must not exist beforehand.

Prerequisites

· You have the DBM operator authorization Backup.

· The database instance is in the operational state ADMIN or ONLINE.

· You have defined the backup media in accordance with the naming conventions for external backup media (Defining or Changing a Backup Medium).

· You have configured the SAP DB software installation for the backup tool you want to use (see Integration of External Backup Tools).

· You have inserted the required backup media in the external backup tool.

Procedure

Proceed as described under Backing Up the Database Instance or Archiving the Version Files of the Log Area.

Backups with TSM:

dbmcli –u dbm,dbm –uUTL –d mydb backup_start ADSMData DATA

ADSMData | Backup medium for the external backup tool TSM
DATA | Complete data backup


Commands for the Backup History (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for the Backup History

Use

The system writes the backup history to the file dbm.knl. This file is stored in the run directory of the database instance (see also: Database Manager Log Files).

Information on all the backup and restore actions that have been performed is recorded chronologically in the backup history.

The Database Manager CLI provides you with a number of DBM commands, with which you can work with the backup history.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

Change Date of the Backup History | backup_history_date
Displaying the Backup History | backup_history_list
Scrolling in the Backup History | backup_history_listnext
Fetching the Backup History | backup_history_open
Closing a Backup History | backup_history_close


Change Data of the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Change Data of the Backup History

Use

You can request the date on which the current backup history was last changed.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

backup_history_date

Reply

OK<NL>
<YYYYMMDDHHMMSS><NL>

In the event of errors, see Reply Format .


Displaying the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Backup History

Use

The system displays the content of the backup history . You can restrict or extend what is displayed using options.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

You have fetched the backup history ( Fetching the Backup History ).

Syntax

backup_history_list <options>

Options

-c <columns>

With option –c you can restrict the number of columns to be displayed. The keywords for the individual columns are:
KEY
LABEL
ACTION
STAMP1
STAMP2
START
STOP
FIRSTLOG
LASTLOG
LOG
MEDIA
PAGES
VOLUMES
RC
ERROR

If several columns are specified, you separate them by commas.

-k <key>

Only the line of the backup history that contains the keyword specified under <key> is displayed.

This option cannot be used with the -r option.

-l <label>

Only the lines of the backup history that contain the specified backup ID are displayed.

This option cannot be used with the -r option.

-a <action>

Only the lines of the backup history that correspond to the specified backup type are output.

This option cannot be used with the -r option.

-r

All data backups that are required to recover the database instance are displayed. If the log volume is intact, only the data backups that match the available log are displayed.

-r LAST

Beginning with the last complete data backup, all backups that are required to recover the database instance are displayed.

-r <key>

Beginning with the complete data backup specified in <key>, all backups that are required to recover the database instance are displayed.

-u <yyyymmddhhmmss>

Only those lines in the backup history that contain data that was saved in the database instance before the specified time are displayed.

This option cannot be used with the -r option.

-m

For each line that relates to a backup, information is supplied on the backup medium used.

-e

For each line that relates to a backup, information is supplied on the relevant external backup ID .

Reply

OK<NL>
(END|CONTINUE)<NL>
<history_line><NL>
[<media_line><NL>]
[<external_backup_id-line><NL>]
<history_line><NL>
[<media_line><NL>]
[<external_backup_id-line><NL>]
....

Values for the individual fields of the reply

END | The contents of the backup history have been transferred in full. The file is closed automatically.
CONTINUE | The backup history contains further entries that were not transferred due to the limited storage available for replies. You can interrogate this data by entering the above command or close the backup history .
<history_line> | Information on the completed backups. The individual columns are separated by |. A separate line is output for each backup.
<media_line> | Information on the medium used for the backup The line is prefixed with an M: and is followed by columns separated by |.
<external_backup_id_line> | If the backup was created using an external backup tool, information on the external backup ID is provided here. You have to specify this information when restoring a backup from an external backup tool. The line is prefixed with E: which, in turn, is followed by columns separated with |.

In the event of errors, see Reply Format .


Scrolling in the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the Backup History

Use

You read more of the backup history. Options you specified for displaying the backup history remain active.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

You have fetched the backup history (Fetching the Backup History) and executed the command for displaying the backup history. The keyword CONTINUE in the reply shows that you have not yet read the whole file.

Syntax

backup_history_listnext

Reply

OK<NL>
[END|CONTINUE]<NL>
<history_line><NL>
[<media_line><NL>]
[<external_backup_id-line><NL>]
<history_line><NL>
[<media_line><NL>]
[<external_backup_id-line><NL>]
....

Values for the Individual Fields of the Reply

END | The contents of the backup history have been transferred in full. The file is closed automatically.
CONTINUE | The backup history contains further entries that were not transferred due to the limited storage available for replies. You can display this data by entering the above command or close the backup history.
<history_line> | Information on the completed backups. The individual columns are separated by |. A separate line is displayed for each backup.
<media_line> | Information on the backup medium used for the backup The line is prefixed with an M: and is followed by columns separated by |.
<external_backup_id_line> | If the backup was created using an external backup tool, information on the external backup ID is provided here. You have to specify this information when restoring a database instance from an external backup tool. The line is prefixed with E: which, in turn, is followed by columns separated with |.

In the event of errors, see Reply Format.


Fetching the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Fetching the Backup History

Use

With this command you fetch the current backup history . The backup history is also updated with the current information about the utilized backup tools.

To view the content, choose backup_history_list ( Displaying the Backup History ) or backup_history_listnext ( Scrolling Through the in the Backup History ).

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

backup_history_open <option>

Option

-e

If you specify the option –e, in addition to the backup history information, the system displays the status of the availability of the respective backups in the external backup tools .

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Closing the Backup History (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Closing the Backup History

Use

You close a previously displayed backup history ( Displaying the Backup History ).

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

backup_history_close

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Commands for External Backup IDs (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for External Backup IDs

Use

Backups created with external backup tools can be identified uniquely by means of an external backup ID. These IDs are logged in the backup history. They can be called up using the commands for the backup history and must be entered when restoring using external backup tools.

To enable restores without a backup history, the external backup IDs of the backups currently in the backup tool can, however, also be determined using the DBM commands.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead.

Syntax

Displaying External Backup IDs | backup_ext_ids_list
Scrolling in the External Backup IDs | backup_ext_ids_listnext
Releasing the Memory Occupied by the External Backup IDs | backup_ext_ids_forget
Fetching External Backup IDs | backup_ext_ids_get


Displaying External Backup IDs (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying External Backup IDs

Use

You display the information requested by a backup tool. This information comprises, for each backup , the availability status, the external backup ID , the backup type, and the creation date/time.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

You have fetched a backup tool’s external backup IDs ( Fetching External Backup IDs ).

Syntax

backup_ext_ids_list

Reply

OK<NL>
(END|CONTINUE)<NL>
[<external_backup_id_line><NL>]
[<external_backup_id_line><NL>]
....

Values for the individual fields of the reply

END | All of the information requested by the backup tool was transferred in full.
CONTINUE | Information on further backups is available. This was not transferred because of the limited storage available for replies. You can scroll through this information or release the memory occupied by it .
<external_backup_id_line> | A line containing information on one of the backups registered in the backup tool. The individual columns are separated by a |.

In the event of errors, see Reply Format .


Scrolling in the External Backup IDs (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the External Backup IDs

Use

You display the external backup IDs of the individual backup media of a backup . In addition, the system displays the availability status, the backup type, and the creation time of the backup for each backup medium.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

You have fetched the external backup IDs of a backup tool ( Fetching External Backup IDs ) and executed the command for displaying the external backup IDs . The keyword CONTINUE in the reply shows that you have not yet read the whole file.

Syntax

backup_ext_ids_listnext

Reply

OK<NL>
(END|CONTINUE)<NL>
[<external_backup_id_line><NL>]
[<external_backup_id_line><NL>]
....

Values for the individual fields of the reply

END | All of the requested information has been transferred in full.
CONTINUE | Information on further backups is available. This was not transferred because of the limited storage available for replies. You can call up this information by entering the above command again or release the occupied memory .
<external_backup_id_line> | A line containing information on one of the backups still registered in the backup tool. The individual columns are separated by a line (|).

In the event of errors, see Reply Format .


Releasing the Memory Occupied by the External Backup IDs (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Releasing the Memory Occupied by the External Backup IDs

Use

You release the memory in which the external backup IDs requested by a backup tool are stored.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

backup_ext_ids_forget

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Fetching External Backup IDs (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Fetching External Backup IDs

Use

You display the external backup IDs of backups for a database instance that are currently registered in the backup tool specified by <medium>.

Prerequisites

You have the DBM operator authorization Backup or DBInfoRead .

Syntax

backup_ext_ids_get <medium> [<database_name>] [<server_node>]

<medium> | Name of the backup medium ; this must be defined beforehand ( Defining or Changing a Backup Medium )
<database_name> | Name of the database instance from which the backups were created
<server_node> | Name of the server on which the backup was created

Reply

The system outputs an OK message.

Use the command backup_ext_ids_list (see Reading External Backup IDs ) to display the external backup IDs.

In the event of errors, see Reply Format .


Commands for Backup Information (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for Backup Information

Use

Whatever operational state the database instance is in, you can request the information held on the backup media about backups . You can use various DBM commands to do this.

Prerequisites

You have the operator authorization Backup .

Syntax

Displaying the Backup Information in the Operational State OFFLINE | Medium_labeloffline
Displaying the Backup Information in the Operational State ONLINE or ADMIN | Medium_label
Displaying the Current Status of a Backup Check | recover_state_check
Checking a Backup | recover_check


Displaying the Backup Information in the Operational State OFFLI (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Backup Information in the Operational State OFFLINE

Use

You display the information about the backup stored on a backup medium . The system accesses the backup medium directly so that this function can be executed, if the database instance is in the operational state OFFLINE. If the database instance is in operational state ONLINE or ADMIN, use the command for displaying the backup information in the operational state ONLINE or ADMIN .

Prerequisites

You have the DBM operator authorization Backup .

Syntax

medium_labeloffline <medium>

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of the log backup to be read

For log backup: first page saved in the log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Displaying the Backup Information in the Operational State ONLIN (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Backup Information in the Operational State ONLINE or ADMIN

Use

You display the information stored on a backup medium about the backup .

Prerequisites

You have the DBM operator authorization Backup .

You have started a utility session ( Open a utility session ). The database instance is in the operational state ONLINE or ADMIN.

Syntax

medium_label <medium>

Specify the backup medium from which the information is to be read under <medium>.

For parallel backup media, specify only the name of the group of parallel backup media . You must first define this group ( Defining or Changing a Backup Medium ).

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Note In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Displaying the Current Status of a Backup Check (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Current Status of a Backup Check

Use

You display information about the current status of a backup check . You can run this command while a backup is being checked.

Prerequisites

You have the DBM operator authorization Backup .

You have opened a service session ( Opening a Service Session ).

Syntax

recover_state_check

Reply

OK<NL>
Return code <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volumes [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Error text [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Version of the database software

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

Only for log backup: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Highest page number assigned (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Checking a Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Checking a Backup

Use

You check that the backup is consistent and complete. This command is executed independently of the running functions of the current database instance but can temporarily adversely impact database instance performance.

Prerequisites

You have the DBM operator authorization Backup .

You have opened a service session .

Syntax

recover_check <medium> <type> [ExternalBackupID <external_backup_ID>] [<nnn>] [UNTIL <date> <time>]

<medium> | Name of the backup medium ; this must be defined beforehand ( Defining or Changing a Backup Medium )
<type> | Type of Backup: DATA (Complete data backup ), PAGES (Incremental data backup) or LOG ( Log Backup )

Options

ExternalBackupID <external_backup_ID> | To check a backup created with an external backup tool , enter a backup ID name that the external tool will recognize.
<nnn> | Actual backup version on the backup media that is being checked; relevant only for media of type FILE
UNTIL <date> <time> | For log backups you can enter an exact time up to which the log backups are to be checked.

The backup specified is just checked, not restored.

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Mediumname [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup: first page saved in log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

Reply in the Event of an Error

If an error occurs during the process, you will receive a reply in the following format:

ERR<NL>
<errcode>, <err_description><NL>
[<extended_description><NL>]

<errcode> | Error message number See also: Messages 7.2 and 7.3
<err_description> | Description of the error
<extended_description> | Cause of error

The following errors may occur:

<errcode> | <err_description> | Explanation
-24927 | ERR_TOOLCHK: the external backup tool was not found | The external backup tool could not be found or has been installed incorrectly.
-24926 | ERR_MEDIUMCHK: the medium cannot be used with an external backup tool | The medium specified cannot be used with the backup tool the medium name refers to ( Defining and Changing a Backup Medium ).
-24925 | ERR_PREPARE: prepare of the backup operation failed | The preparations necessary to use the backup tool were not made correctly.
-24924 | ERR_DBREQ: cannot start database kernel request | The database instance was unable to start the check.
-24923 | ERR_TOOLREQ: cannot start external backup tool correctly | The backup tool could not be started correctly.
-24922 | ERR_OPCHK: cannot check state of backup operation | Unable to check the status of the database instance or the backup tool.
-24921 | ERR_POSTOP: cannot finish backup operation correctly | Although the backup was successful, the post-processing steps required could not be performed.
-24920 | ERR_BACKUPOP: backup operation was unsuccessful | The check failed due to a problem with the database or the backup tool.
-24919 | ERR_CLEANUP: cannot clean up correctly after backup operation | Although the check was successful, the temporary system resources that were used could not be freed up again.


Commands for Restoring (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Commands for Restoring

Use

The Database Manager supports the restoring of the database instance after hardware errors. The last state of the database is restored. A prerequisite for this is that all the data specified in the backup history is available.

To obtain the highest possible throughput of data, complete data backups and incremental data backups can be imported from a number of backup media simultaneously. The number of parallel backup media used for the restore does not depend on the number of parallel backup media used to make the backup originally. Even a backup made to single medium plus continuation media can be imported in parallel.

You define the maximum number of backup media that can be imported concurrently using the parameter MAX_BACKUP_DEVS. The use of up to 32 tape devices allows you to reduce backup and restore times considerably.

Prerequisites

Note the operator authorizations required for the particular commands DBM commands.

The prerequisite for executing all other restore commands is to execute the command to restore the database instance first.

Syntax

Displaying Current Information About the Database Instance | db_restartinfo
Displaying the Current Recovery Status | recover_state
Terminating an Interrupted Restore or Backup Check | recover_cancel
Continuing a Parallel Restore or Backup Check | recover_ignore
Recovering a Database Instance | recover_start
Restoring the Parameter File from a Data Backup | recover_config
Recreating a Damaged Index | sql_recreateindex
Restoring with External Backup Tools | ---
Restoring or Checking a Backup with Succeeding Medium | recover_replace


Displaying Current Information About the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Current Information About the Database Instance

Use

You can display the current status of the database instance after importing a backup . Information is displayed on the state of the log and the ability of the database instance to Restart ( Restartability ).

Prerequisites

You have the DBM operator authorization Recovery .

You have executed the command for restoring a database instance .

Syntax

db_restartinfo

dbmcli -d myDB -u dbm,dbm db_restartinfo

OK
Used LOG Page 10636
First LOG Page 8640
Restartable 1
Id Restart Record P46643:DB_20010629_115558
Id LOG Info P46643:DB_20010629_115558
Consistent 1

Reply

OK<NL>
Used LOG Page <number><NL>
First LOG Page <number><NL>
Restartable (1|0)<NL>
Id Restart Record <id><NL>
Id LOG Info <id><NL>
Consistent (1|0)<NL>

Values for the individual fields of the reply

Used LOG Page | Next log page to be used after restarting
First LOG Page | Oldest available log page
Restartable | Restartable (1 = yes, 0 = no)
Id Restart Record | Identifier of the restart record for the database instance
Id LOG Info | Identifier for the database instance log
Consistent | Consistency of the database instance, that is, can be restarted without log (1 = yes, 0 = no)

In the event of errors, see Reply Format .


Displaying the Current Restore Status (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Current Restore Status

Use

You display information about the current status of the restore. You can execute this command while a backup of a database instance is being restored.

Prerequisites

You have the DBM operator authorization Recovery .

You have executed the command for restoring a database instance . The operation was interrupted.

Syntax

recover_state

Reply

OK<NL>
Return code <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volumes [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Error text [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of the database

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

Only for log backup: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Highest page number assigned (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Terminating an Interrupted Restore or a Backup Check (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating an Interrupted Restore or a Backup Check

Use

You definitively terminate an interrupted restore or a backup check.

Prerequisites

You have the DBM operator authorization Backup .

You have executed the command for Restoring the Database Instance or for Checking a Backup . The operation was interrupted.

Syntax

recover_cancel

Reply

In the reply to this command only the field Returncode is assigned a value.

OK<NL>
Returncode <value>

See also: Messages

In the event of errors, see Reply Format .


Continuing the Parallel Restore or Backup Check (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Continuing the Parallel Restore or Backup Check

Use

You continue reading in from the other backup media . As a reply to this command, you receive the information about the import of the backup .

The output is, however, only given when the backup has been completely read in or is interrupted. This command may therefore take a long time to execute.

Prerequisites

You have the DBM operator authorization Backup .

You have started restoring a database instance by reading data from several media simultaneously. The procedure was interrupted because at least one medium no longer has a succeeding backup medium.

Syntax

recover_ignore

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Note In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages

If it is clear from the message number that the recovery was only interrupted, the session must be continued with the continuation command (recover_ignore) or terminated ( recover_cancel ).

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of the database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup volumes used

Medianame

Name of backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup: first page saved in log

Last LOG Page

Only for log backup: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Recovering a Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recovering a Database Instance

Use

When you recover a database instance, you import a backup and recover the state of the database that it contains.

If you used an external backup tool to make this backup, you also use this tool to recover the database instance. Proceed as described in Restoring with External Backup Tools. Otherwise, use the description of the command recover_start, below.

The reply to this command gives you information about the import of the backup. However, you see this information only if the backup has been imported completely, or if the backup was interrupted. This command may, therefore, take a long time to execute.

If automatic log backups were activated before the recovery was started, they are not reactivated automatically after the recovery.

To reactivate the log backups, execute the command for activating automatic log backups.

Prerequisites

You have the DBM operator authorization Recovery.

Syntax

recover_start <medium> <type> [ExternalBackupID <external_backup_ID>] [<nnn>] [UNTIL <date> <time>] [AUTOIGNORE]

<medium> | Backup medium from which you want to import the backup. When you restore a backup made on multiple parallel backup media (a parallel backup), enter the name of the media group here.
<type> | Type of the backup that you want to import: DATA (complete data backup), PAGES (incremental data backup), or LOG (log backup)

Options

ExternalBackupID <external_backup_ID> | To restore a backup created with an external backup tool, enter a backup ID name here that the external backup tool can recognize as the backup.
<nnn> | Actual backup version on the backup medium that you want to read; relevant only for media of type FILE.
UNTIL <date> <time> | You can specify a time up to which you want to import log backups.
AUTOIGNORE | In the case of a parallel restore, the process is automatically continued by the system (Continuing a Parallel Restore).

It is vital that you follow the current media naming conventions (see Defining or Changing a Backup Medium) to avoid error messages.

Restoring using NetWorker:

dbmcli –u dbm,dbm –uUTL –d myDB recover_start NSRPages PAGES ExternalBackupID 9025

Reply

OK<NL>
Return code              <value><NL>
Date                    [<value>]<NL>
Time                    [<value>]<NL>
Server                  [<value>]<NL>
Database                [<value>]<NL>
Kernel Version          [<value>]<NL>
Pages Transferred       [<value>]<NL>
Pages Left              [<value>]<NL>
Volumes                 [<value>]<NL>
Medianame               [<value>]<NL>
Location                [<value>]<NL>
Error text              [<value>]<NL>
Label                   [<value>]<NL>
Is Consistent           [<value>]<NL>
First LOG Page          [<value>]<NL>
Last LOG Page           [<value>]<NL>
DB Stamp 1 Date         [<value>]<NL>
DB Stamp 1 Time         [<value>]<NL>
DB Stamp 2 Date         [<value>]<NL>
DB Stamp 2 Time         [<value>]<NL>
Page Count              [<value>]<NL>
Devices Used            [<value>]<NL>
Database ID             [<value>]<NL>
Max Used Data Page      [<value>]<NL>

Values for the Individual Fields of the Reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of the database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup media used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

Only for data backup: backup is internally consistent

First LOG Page

For data backup: First page of the log backup to be read

For log backup: first page saved in log

Last LOG Page

Only for log backup: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum page number (indication of minimum database size when backup is imported)

Reply in the Event of an Error

If an error occurs while you are using an external backup tool, you receive a reply in the following format:

ERR<NL>
<errcode>, <err_description><NL>
[<extended_description><NL>]

<errcode> | Error message number See also: Messages 7.4
<err_description> | Description of the error
<extended_description> | Cause of the error

The following errors may occur:

<errcode> | <err_description> | Explanation
-24927 | ERR_TOOLCHK: the external backup tool was not found | The external backup tool could not be found or has been installed incorrectly.
-24926 | ERR_MEDIUMCHK: the medium cannot be used with an external backup tool | The specified backup medium cannot be used with the backup tool to which the medium name refers ( Defining and Changing a Backup Medium ).
-24925 | ERR_PREPARE: prepare of the backup operation failed | The preparations necessary to use the backup tool were not made correctly.
-24924 | ERR_DBREQ: cannot start database kernel request | The database instance was unable to start the restore operation.
-24923 | ERR_TOOLREQ: cannot start external backup tool correctly | The backup tool could not be started correctly.
-24922 | ERR_OPCHK: cannot check state of backup operation | Unable to check the status of the database instance or the backup tool.
-24921 | ERR_POSTOP: cannot finish backup operation correctly | Although the recovery was successful, the post-processing steps required could not be performed.
-24920 | ERR_BACKUPOP: backup operation was unsuccessful | The recovery failed due to a problem with the database or the backup tool.
-24919 | ERR_CLEANUP: cannot clean up correctly after backup operation | Although the recovery was successful, the temporary system resources used could not be freed up again.


Restoring the Parameter File from a Data Backup (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring the Parameter File from a Data Backup

Use

You recover the parameter file from the data backup stored on a backup medium .

All parameters except for SERVERDB are taken over. The parameter SERVERDB is converted to the value of the current database instance .

The parameter file is stored under the name of the current database instance.

Prerequisites

You have the DBM operator authorization Recovery .

You have opened a service session .

You have executed the command for restoring a database instance .

Syntax

recover_config <medium>

Reply

OK<NL>
Return code <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volumn Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Error text [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of database instance

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup media used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup : first page saved in the log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Recreating a Damaged Index (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recreating a Damaged Index

Use

Use this command to recover the specified indexes.

To save time, indexes are not maintained when a backup is imported. These must be recovered explicitly. You recover damaged indexes or indexes that are no longer up to date.

The database software ignores damaged indexes. For this reason, they cannot cause errors, but do impair the performance of the database instance.

Prerequisites

You have the DBM operator authorization AccessSQL.

You have opened an SQL session.

You have executed the command for restoring a database instance.

Syntax

sql_recreateindex <scheme>.<table>.<index>

<scheme> | Scheme
<table> | Table name
<index> | Index name or field name

Reply

The system displays an OK message.

In the event of errors, see Reply Format.


Recovering a Damaged Volume (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recovering a Damaged Volume

Use

If you are running the log volumes of a database instance in mirrored form, and a single log volume fails while the database is running, there are functions available that enable you to recover the failed volume.

Entries that were written to the intact volume only while the damaged volume was out of action are not copied.

Note that the mirrored log volume is only secure once the recovered volume is operating again. You should therefore backup the log entries that only exist once using a log backup (Backing up the Database Instance).

Prerequisites

You have the DBM operator authorization Recovery.

You are operating the database instance with mirrored log volumes. ( LOG_MODE: DUAL).

You have opened a utility session.

You have executed the command for restoring a database instance.

Syntax

recover_volume <volno> [<volmode>]

<volno> | Number of the volume
<volmode> | Here, LOG is the only possible entry.

With this command, you return a damaged volume of a volume pair to operation.

Reply

The system displays an OK message.

In the event of errors, see Reply Format.


Restoring with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring with External Backup Tools

The Database Manager supports the use of external backup tools for complete and incremental data backups, as well as for the archiving of log backups.

For information on which external backup tools are supported by the SAP DB database system, see the documentation The SAP DB Database System in the section External Backup Tool.

Using the Backup Tools

Start the operation for restoring the database instance from the Database Manager CLI. The naming conventions for external backup media enable the program to recognize the external backup tool and start it.

Prerequisites

You have configured your SAP DB software installation for the external backup tool you want to use (see Integration of External Backup Tools).

When you restore data, NetWorker requires the exact name of the relevant backup pipe. This means that the media group must be configured in exactly the same way it was when you backed up the data. The backup media must also be in the same order in the media group.

Procedure

First determine the external backup ID for the required backup (Fetching External Backup IDs, Displaying External Backup IDs). The Database Manager uses this ID to identify the backup that is to be restored.

The number of media in a group of parallel backup media must correspond to the number of media used to create the backup.

If a deadlock occurs when you restore parallel media, you must use the Database Manager to import the backup in sequence (that is, each individual medium in the media group).

Proceed as described in Restoring the Database Instance.


Restoring or Checking a Backup with a Succeeding Medium (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Restoring or Checking a Backup with a Succeeding Medium

Use

You specify the next medium from which reading in the backup is to continue. As a reply to this command, you receive the information about the import of the backup. The output is, however, only given when the backup has been completely read in or is interrupted. This command may therefore take a long time to execute.

Prerequisites

You have the DBM operator authorization Backup .

You have executed the command for restoring a database instance . The procedure was interrupted, because all backup data has been read from one backup medium .

Syntax

recover_replace <medium> [ExternalBackupID <ext_backup_ID>] [<loc> [<nnn>]]

<medium>

Medium from which the backup is to be read.
When restoring a backup made on several media at the same time, you must enter the name of the group of parallel backup media here.

Options

ExternalBackupID <external_backup_ID> | To restore a backup created with an external backup tool , enter a backup ID name here with which the external backup tool will recognize the backup.
<loc> | Name of the device/the file in which the backup to be restored is stored. Operating system functions must be able to address the device/file using <loc>.
<nnn> | Actual backup version on the backup medium that is to be read; relevant only for a backup medium of the type FILE.

It is vital you follow the current media naming conventions (see Defining or Changing a Backup Medium ) to avoid error messages.

Reply

OK<NL>
Returncode <value><NL>
Date [<value>]<NL>
Time [<value>]<NL>
Server [<value>]<NL>
Database [<value>]<NL>
Kernel Version [<value>]<NL>
Pages Transferred [<value>]<NL>
Pages Left [<value>]<NL>
Volume Count [<value>]<NL>
Medianame [<value>]<NL>
Location [<value>]<NL>
Errortext [<value>]<NL>
Label [<value>]<NL>
Is Consistent [<value>]<NL>
First LOG Page [<value>]<NL>
Last LOG Page [<value>]<NL>
DB Stamp 1 Date [<value>]<NL>
DB Stamp 1 Time [<value>]<NL>
DB Stamp 2 Date [<value>]<NL>
DB Stamp 2 Time [<value>]<NL>
Page Count [<value>]<NL>
Devices Used [<value>]<NL>
Database ID [<value>]<NL>
Max Used Data Page [<value>]<NL>

In particular, analyze the Returncode reply field, which contains a numeric value supplied by the kernel.

See also: Messages 7.2 and 7.3

If it is clear from the message number that the recovery was only interrupted, the session must be continued with the continuation command (recover_replace) or terminated ( recover_cancel ).

Values for the individual fields of the reply

Date

Date

Time

Time

Server

Name of the database server

Database

Name of the database

Kernel Version

Database kernel version

Pages Transferred

Number of pages transferred

Pages Left

Number of pages still to be transferred

Volumes

Number of backup media used

Medianame

Name of the backup medium

Location

File or device name

Errortext

Error message text

Label

Backup ID

Is Consistent

For data backup only: backup is internally consistent

First LOG Page

For data backup: first page of log backup to be read

For log backup: first page saved in log

Last LOG Page

For log backup only: last page saved in log

DB Stamp 1 Date
DB Stamp 1 Time

Time stamp for first page of log backup

DB Stamp 2 Date
DB Stamp 2 Time

Time stamp for last page of log backup

Page Count

Total number of pages saved

Devices Used

Number of backup devices used

Database ID

Database ID used to identify data and log backups that belong together

Max Used Data Page

Maximum number of pages used (indication of minimum database size when backup is imported)

In the event of errors, see Reply Format .


Managing the DBM Operators (SAP Library - SAP DB)

 Entering content frame

Background documentation Managing the DBM Operators

Use

The Database Manager CLI provides a number of DBM commands with which you can display data for DBM operators or transfer operator data to the Database Manager.

Changing DBM Operator Data | user_put
Creating DBM Operators | user_create
Displaying Operator Authorizations | user_getrights
Displaying Operator Data | user_get
List of DBM Operators | user_getall
Deleting DBM Operators | user_delete

Prerequisites

You have the DBM operator authorization UserMgm .


Changing DBM Operator Data (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing DBM Operator Data

Use

You can modify the operator data of the DBM operator specified in <userid>.

The new values are specified with <property>=<value>.

In <property> you can specify all operator properties except the Name. The name of an operator must not be modified.

You can specify multiple operator authorizations . Separate these from each other with commas. Put a plus sign in front of the authorization to assign it and a minus sign to revoke it.

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_put <userid> <property>=<value> [, <property>=<value>, ...]

Reply

The system outputs an OK message.

user_put samplename SERVERRIGHTS=+StartDB, -StopDB

OK

In the event of errors, see Reply Format .


Creating DBM Operators (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating DBM Operators

Use

You create a DBM operator having the operator name and operator password specified in <userid> and <password>.

At first, this operator has no operator authorizations . You must explicitly assign these to the operator ( Changing the DBM Operator Data ).

Alternatively, you can also specify a <template_user>, from which all operator authorizations, but not operator name and operator password are then copied.

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_create <userid>,<password> [<template_user>]

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Displaying Operator Authorizations (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Operator Authorizations

Use

You display the list of operator authorizations for the operator specified in <userid>.

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_getrights <userid>

Example

Reply

OK<NL>
UserMgm <flag> User management
InstallMgm <flag> Install management
SystemCmd <flag> System commands
FileFull <flag> File full access
FileRead <flag> File read access
DBFileRead <flag> Database file read access
AccessUtility <flag> Utility session access
BackupRestore <flag> Backup restore actions
BackupSave <flag> Backup save actions
ParamFull <flag> Parameter full access
ParamCheckWrite <flag> Parameter check-write access
ParamRead <flag> Parameter read access
AccessSQL <flag> SQL session access
ExecLoad <flag> Can execute load
LoadSysTab <flag> Can load system tables
DBStop <flag> Can stop database
DBStart <flag> Can start database
DBInfoRead <flag> Info functions access

A plus symbol under <flag> indicates that the relevant authorization is assigned to the operator. A minus symbol under <flag> indicates that the relevant authorization is not assigned to the operator.

In the event of errors, see Reply Format .


user_getrights Command: Example (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text user_getrights Command: Example

Displaying the rights of the DBM operator with the name DBM, and the operator password DBM for using the Database Manager

dbmcli -d myDB -u dbm,dbm user_getrights dbm

OK

DBInfoRead + Request status data
ExecLoad + Execute the LOAD program
SystemCmd + Execute operating system commands
UserMgm + User management
FileFull - File access (read and write)
FileRead - File access (read only)
DBFileRead + Database file access (read only)
Backup + Saving backups
InstallMgm + Installation management
LoadSysTab + Load the system tables
ParamCheckWrite + Parameter access (checked write)
ParamFull + Parameter access (read and write)
ParamRead + Parameter access (read only)
DBStart + Start database instance
DBStop + Stop database instance
Recovery + Restoring backups
AccessSQL + Access to SQL session
AccessUtility + Access to utility session

Result of the Request

The Database Manager operator DBM has all operator authorizations for the Database Manager, with the exception of FileFull and FileRead.


Displaying Operator Data (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Operator Data

Use

You display the data for the DBM operator specified in <userid>.

The Database Manager displays a list of the operator authorizations assigned to the operator. These are separated by commas.

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_get <userid>

Displaying the data for the DBM operator with the name DBM, password DBM

dbmcli -d myDB -u dbm,dbm user_get dbm

OK
SERVERRIGHTS=DBInfoRead,ExecLoad,SystemCmd,UserMgm,DBFileRead,Backup,...
SECONDPASSWORD=NO
DISABLED=NO
COMMENT=

Reply

OK<NL>
SERVERRIGHTS=<right_list><NL>
SECONDPASSWORD=[YES|NO]<NL>
DISABLED=[YES|NO]<NL>
COMMENT=<comment><NL>

Values for the fields of the reply: See Operator Properties

In the event of errors, see Reply Format .


List of DBM Operators (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of DBM Operators

Use

You request the operator names of all DBM operators that are registered for the current database instance .

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_getall

Display all DBM operators for the database instance:

dbmcli -d myDB -u dbm,dbm user_getall

OK
dbm
DBA
domain

Reply

OK<NL>
<userid><NL>
<userid><NL>
...

In the event of errors, see Reply Format .


Deleting DBM Operators (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting DBM Operators

Use

You delete the DBM operator specified in <userid>.

You cannot delete the DBM operator currently logged on, or the first DBM operator that was created when creating the database instance.

Prerequisites

You have the DBM operator authorization UserMgm .

Syntax

user_delete <userid>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Accessing the Database Instance (SAP Library - SAP DB)

 Entering content frame

Background documentation Accessing the Database Instance

Use

This group of DBM commands allows you to communicate with the database kernel.

Prerequisites

Take account of the operator authorizations required for the respective DBM commands.

To use these DBM commands you must generate and work in a utility session , an SQL session , or a service session . For more information see the documentation for the particular DBM commands.

Overview of Commands for Accessing the Database Instance:

  • Access Using a Utility Session
  • Access Using an SQL Session
  • Access Using a Service Session
  • Access to Database Events


Overview of Commands for Accessing the Database Instance (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Overview of Commands for Accessing the Database Instance

Activating a New Database Instance | util_activate
Activating a Database Event | event_set
Updating the Optimizer Statistics | sql_updatestat
Updating the Optimizer Statistics with the XPU Program | exec_xpu
Displaying the Structure of a Result Set | sql_info
Displaying a Physical Database Page | util_getpage
Displaying the Status Data for the Database Instance | info
Terminating a Database Event Session | event_release
Terminating a Service Session | service_release
Terminating an SQL Session | sql_release
Terminating a Utility Session | util_release
Scrolling in the Result Data | sql_fetch
Scrolling in the Status Information of the Database Instance | info_next
Deactivating a Database Event | event_delete
Opening a Service Session | service_connect
Opening an SQL Session | sql_connect
Opening a Utility Session | util_connect
List of Activated Database Events | event_list
Writing a Physical Database Page | util_putpage
Transferring an SQL Statement | sql_execute
Transferring a Utility or SQL Command | util_execute
Waiting for a Database Event | event_wait


Access Using a Utility Session (SAP Library - SAP DB)

 Entering content frame

Background documentation Access Using a Utility Session

Use

For a utility session with the database instance, you can use the following DBM commands:

Activating a New Database Instance | util_activate
Displaying a Physical Database Page | util_getpage
Terminating a Utility Session | util_release
Opening a Utility Session | util_connect
Writing a Physical Database Page | util_putpage
Transferring a Utility or SQL Command | util_execute

Prerequisites

You have the DBM operator authorization AccessUtility.


Activating a New Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating a New Database Instance

Use

You start a newly registered database instance for the first time and create the first database user . This user is the database administrator with the name SYSDBA.

See also: User manual

Prerequisites

You have the DBM operator authorization AccessUtility .

Syntax

util_activate <sysdba>,<password>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Displaying a Physical Database Page (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying a Physical Database Page

Use

A physical page is fetched from the volume specified. Enter the number of the volume required in the parameter <volno>, and its type in <volmode>. The system displays the requested page, and before the <page_data> the length of the page <page_size> in bytes.

If you only specify one page number <pageno>, the corresponding logical page is output.

This command is only useful when being used by client applications.

Prerequisites

You have the DBM operator authorization AccessUtility .

The database is in the ADMIN operational state.

You have started a utility session .

Syntax

util_getpage [<volmode> <volno>] <pageno>

Option <volmode>

DATA | Data Volume
LOG | Log Volume
MLOG | Mirrored log volume ( Log Mode DUAL)
NAME | If you use this option, do not specify a number for the following parameter <volno>; instead specify the name of the volume: util_getpage [<NAME> <volname>] <pageno>

Reply

OK<NL>
<page_size><NL>
<page_data>


Terminating a Utility Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating a Utility Session

Use

With this command you end the active utility session. All assigned resources are released.

Prerequisites

You have the DBM operator authorization AccessUtility or Backup .

You have opened a utility session .

Syntax

util_release

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Opening a Utility Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Utility Session

Use

You open a session with the database instance with which to use the utility task of the database kernel. This task is reserved solely for the administration of the database.

Only one utility task exists for each database instance. Administrative operations cannot therefore be performed in parallel.

If you have not specified an operator, the DBM operator registered on the database server will be logged on.

Prerequisites

You have the DBM operator authorization AccessUtility or Backup .

You are working in script mode or session mode .

Syntax

util_connect

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Writing a Physical Database Page (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Writing a Physical Database Page

Use

The page is written to the specified volume.

Specify the number of the desired volume for <volno> and the type of the desired volume for <volmode>.

If you only specify one page number <pageno>, this is the logical page that is written to the volume.

You can define the length of the database page (<page_data>) using the parameter <page_size>.

This command is only useful when used by client applications.

Prerequisites

You have the DBM operator authorization AccessUtility .

The database is in the ADMIN operational state.

You have started a utility session .

Syntax

util_putpage [<volmode> <volno>] <pageno> <page_size><NL><page_data>

Option <volmode>

DATA | Data Volume
LOG | Log Volume
MLOG | Mirrored log volume ( Log Mode DUAL)
NAME | When using this option, do not enter a number for the following parameter <volno>; enter the name of the volume instead: util_putpage [<NAME> <volname>] <pageno>

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring a Utility or SQL Command (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring a Utility or SQL Command

Use

You transfer the specified utility command or SQL statement to the database instance .

Prerequisites

You have the DBM operator authorization AccessUtility .

You have opened a utility session .

Syntax

util_execute <statement>

Reply

The system outputs an OK message.

If an error occurs, the system terminates the utility session and outputs an error message number. The system sets up the session again with the current parameters.

See also: Messages


Access Using an SQL Session (SAP Library - SAP DB)

 Entering content frame

Background documentation Access Using an SQL Session

Use

For an SQL session with the database instance, you can use the following DBM commands:

Updating the Optimizer Statistics | sql_updatestat
Displaying the Structure of a Result Set | sql_info
Displaying Status Information for the Database Instance | info
Terminating an SQL Session | sql_release
Scrolling in the Result Data | sql_fetch
Scrolling in the Status Information of the Database Instance | info_next
Opening an SQL Session | sql_connect
Transferring an SQL Statement | sql_execute

Prerequisites

Note the operator authorizations required for the particular DBM commands.


Updating the Optimizer Statistics (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating the Optimizer Statistics

Use

You update the statistics for the Optimizer.

These statistics enable the Optimizer to choose the best strategy for retrieving data. Obsolete statistics impair the performance of the database instance.

You can update all the statistics or restrict the update function to a set of statistics using a table specification <tablespec>.

See also: Optimizer

Prerequisites

You have the DBM operator authorization AccessSQL .

You have started an SQL session .

Syntax

sql_updatestat [<tablespec>]

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Displaying the Structure of a Result Set (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Structure of a Result Set

Use

You display the structure of the result set for an SQL statement.

Prerequisites

You have the DBM operator authorization AccessSQL .

You have started an SQL session .

Syntax

sql_info <statement>

sql_info select username,connectmode,templimit, user_id from users

OK
USERNAME;CONNECTMODE;TEMPLIMIT;USER_ID

Reply

The names of all columns are output separated by semicolons.

OK<NL>
<col_1>;<col_2>;...;<col_n><NL>q


Displaying Status Information for the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Status Information for the Database Instance

Use

You display the information given under <info_id>.

Prerequisites

You have the DBM operator authorization DBInfoRead.

You have started an SQL session.

Syntax

info <info_id>

Option <info_id>

BADVOLUMES | Damaged volumes
BADIDX | Damaged indexes
CACHES | Accesses to the caches
CLSCON | liveCache class container (only for the liveCache instance type)
COLUMNS | Columns of database instance tables
DATA | Data volumes
VOLUMES | Volumes
DISABLEDIDX | Deactivated indexes
EVENTS | Active events
INDEXES | Database instance indexes
INFOS | Available information
IO | Read and write operations
LOCKS | Locks
LOG | Log status (Log Concept)
OMSCACHES | liveCache caches (only for liveCache instance type)
OMSMON | liveCache monitors (only for liveCache instance type)
PARAMS | Database Parameters
STATE | Short description of the status of the database instance
SYSDDCONFIG | Internal configuration
SYSDDMONITOR | Internal monitors
SYSDDSRVDB | Internal database status
TABLES | Database instance tables
UNUSEDIDX | Unused indexes
UPDSTAT | Update of the statistics for the Optimizer is possible (See also: Optimizer: SAP DB 7.4)
UPDSTATW | Statistics must be updated for the Optimizer
USERS | Logged on database users
VERSIONS | Version of the database software

Reply

OK<NL>
(END|CONTINUE)<NL>
<description_record><NL>
<info_record><NL>
<info_record><NL>

END | Result set output complete
Continue | More result data ready

The description line <description_record> contains the names of the fields of the following information lines <info_record>.


Terminating an SQL Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating an SQL Session

Use

You exit the active SQL session. All assigned resources are released.

Prerequisites

You have the DBM operator authorization AccessSQL or DBInfoRead .

You have opened an SQL session .

Syntax

sql_release

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Scrolling in the Result Data (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the Result Data

Use

You request the output of additional result data.

Prerequisites

You have the DBM operator authorization AccessSQL .

You have opened an SQL session and transferred an SQL statement . In the response, CONTINUE indicated that additional result data was available.

Syntax

sql_fetch

Reply

The fields in a record are separated by semicolons.

Character strings are displayed in single quotation marks.

OK<NL>
(END|CONTINUE)<NL>
<record><NL>
<record><NL>

Values for the individual fields of the reply

END | The contents of the file have been transferred in full. The file is closed automatically.
CONTINUE | The file contains further entries that were not transferred due to the limited storage available for replies. You can display these by entering the above command again.


Scrolling in the Status Information of the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Scrolling in the Status Information of the Database Instance

Use

You can display additional information on the status of the database instance .

Prerequisites

You have the DBM operator authorization DBInfoRead .

When displaying status information for the database instance or scrolling in the status information for the database instance, the system informs you that you can request more information using the keyword CONTINUE.

Syntax

info_next

Reply

OK<NL>
(END|CONTINUE)<NL>
<description_record><NL>
<info_record><NL>
<info_record><NL>

Values for the individual fields of the reply

END | Result set output complete
Continue | More result data ready
<description_record> | Name of the fields of the subsequent information lines
<info_record> | Information


Opening an SQL Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening an SQL Session

Use

You create an SQL session for the specified DBM operator with the database kernel. The operator of an SQL session shares the performance of the database instance with up to n additional operators.

If you have not specified an operator, the DBM operator registered on the server is logged on.

Prerequisites

You have the DBM operator authorization DBInfoRead or AccessSQL .

You are working in script mode or session mode .

Syntax

sql_connect [<userid>,<password>]

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Transferring an SQL Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring an SQL Statement

Use

When you enter a SELECT statement, the system displays the results. The system outputs an OK message for other statements.

Prerequisites

You have the DBM operator authorization AccessSQL .

You have started an SQL session .

Syntax

sql_execute <statement>

sql_execute SELECT username,connectmode,templimit,user_id from users

OK
END
'PUBLIC';'SINGLE';(null);3
'DBA';'SINGLE';(null);10
'DOMAIN';'SINGLE';(null);11
'SYS';'SINGLE';(null);12
'CONTROL';'MULTIPLE';(null);0

Reply

OK<NL>
(END|CONTINUE)<NL>
<record><NL>
<record><NL>

The fields in an answer record are separated by semicolons.

Character strings are displayed in single quotation marks.

END | Result set output complete
Continue | More result data ready

In the event of errors, see Reply Format .


Access Using a Service Session (SAP Library - SAP DB)

 Entering content frame

Background documentation Access Using a Service Session

Use

To use the DBM Server commands for checking backups and restoring parameter files from the data backup, you must have a service session running.

For a service session with the database instance, you can use the following DBM commands:

Terminating a Service Session | service_release
Opening a Service Session | service_connect

Prerequisites

You have the DBM operator authorization Backup.


Terminating a Service Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating a Service Session

Use

This command ends the active service session. All assigned resources are released. When Ending the Database Manager , this command is implicitly executed.

Prerequisites

You have the DBM operator authorization Backup .

You have started a service session .

Syntax

service_release

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Opening a Service Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Service Session

Use

You start the appropriate service kernel for the version of the database software and open a session with the utility task.

The service kernel is a specially configured database instance without a dataset of its own. You can use it to carry out tasks for other database instances, such as Checking a Backup , or Restoring the Parameter File from a Data Backup .

Prerequisites

You have the DBM operator authorization Backup .

You are working in script mode or session mode .

Syntax

service_connect

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Access to Database Events (SAP Library - SAP DB)

 Entering content frame

Background documentation Access to Database Events

Use

You can use the following commands to access events of the database kernel:

Activating a Database Event | event_set
Terminating a Database Event Session | event_release
Deactivating a Database Event | event_delete
List of Activated Database Events | event_list
Waiting for a Database Event | event_wait

Prerequisites

You have the DBM operator authorization DBInfoRead .


Activating a Database Event (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Activating a Database Event

Use

You activate a database event. In accordance with the set parameters, you can display messages about the occurrence of the activated events in the Database Manager CLI using the commands for waiting for a database event .

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

event_set <name> [<prio>] [[<value>] <value>]

You activate the event BACKUP_PAGES with the value 1000.

dbmcli -d myDB -u dbm,dbm -uUTL -c event_set BACKUP_PAGES 1000

OK

During the running backup process, the database instance will now generate a message after every thousand backed up pages . You can display the generated messages using the commands for waiting for a database event .

Options

<name> | Name of the event
<prio> | Priority of the event NIL: No priority defined MEDIUM: Medium priority HIGH: High priority
<value> | Additional value whose meaning depends on the event

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Terminating a Database Event Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Terminating a Database Event Session

Use

When waiting for a database event , a database instance session is implicitly created. You end that session with this command.

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

event_release

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


Deactivating a Database Event (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deactivating a Database Event

Use

You deactivate a database event. The occurrence of the event will now no longer be logged by the Database Manager .

Prerequisites

You have the DBM operator authorization DBInfoRead .

Syntax

event_delete <name> [<prio>] [[<value>] <value>]

You deactivate the event BACKUP_PAGES, for which the value 1000 was defined.

dbmcli -d myDB -u dbm,dbm -uUTL -c event_delete BACKUP_PAGES 1000

OK

Options

<name> | Name of the event
<prio> | Priority of the event NIL: No priority defined MEDIUM: Medium priority HIGH: High priority
<value> | Additional value whose meaning depends on the event

Reply

The system outputs an OK message.

In the event of errors, see Reply Format .


List of the Activated Database Events (SAP Library - SAP DB)

 Entering content frame

Procedure documentation List of the Activated Database Events

Use

You request a list of activated database events.

Prerequisites

You have the DBM operator authorization DBInfoRead.

Syntax

event_list

dbmcli -d myDB -u dbm,dbm event_list

OK
Name            State   Prio    1st  2nd   Description
BACKUP_PAGES    OFF     NIL     0          Next <n> pages moved
DB_ABOVE_LIMIT  ON      MEDIUM  90         Database above limit
DB_ABOVE_LIMIT  ON      HIGH    95         Database above limit
DB_ABOVE_LIMIT  ON      HIGH    96         Database above limit
DB_ABOVE_LIMIT  ON      HIGH    97         Database above limit
DB_ABOVE_LIMIT  ON      HIGH    98         Database above limit
DB_ABOVE_LIMIT  ON      HIGH    99         Database above limit
DB_BELOW_LIMIT  OFF     NIL     0          Database below limit

Reply

OK<NL>
Name       State   Prio    1st     2nd     Description<NL>

<name>     <state> <prio>  <value> <value> <description><NL>

<name>     <state> <prio>  <value> <value> <description><NL>

...

Values in the individual fields of the reply

<name> | Name of the event
<state> | Status of the event ON: Event is activated OFF: Event is not activated The database kernel reports the occurrence of an activated event while Waiting for a Database Event.
<prio> | Priority of the event NIL: No priority defined MEDIUM: Medium priority HIGH: High priority
<value> | Additional value whose meaning depends on the event
<description> | Description of the event

In the event of errors, see Reply Format.


Waiting for a Database Event (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Waiting for a Database Event

Use

You request notification from the Database Manager about the occurrence of an activated event and the data associated with it.

Once you have received the notification, you evaluate it, and wait for the next notification from the Database Manager of the occurrence of the activated event by entering the command again.

You only receive a reply to this command when the activated event occurs.

Use this command through a Database Manager programming interface.

If you want to use the command with the Database Manager CLI, work in session mode .

Prerequisites

You have the DBM operator authorization DBInfoRead .

You have activated a database event ( Activating a Database Event ).

Syntax

event_wait

dbmcli -d myDB -u dbm,dbm

dbmcli on myDB>event_wait

OK
NAME=BACKUP_PAGES
PRIORITY=LOW
DATE=20010712
TIME=00151725
VALUE1=99
COUNT=188
DESCRIPTION=Next <n> pages moved

You receive notification about the occurrence of the event BACKUP_PAGES.


Overview of All DBM Commands (SAP Library - SAP DB)

 Entering content frame

Component documentation Overview of All DBM Commands

archive_stage | Creating a Single Archive of the Version Files
archive_stage_repeat | Creating Multiple Archives of the Version Files
autolog_cancel | Canceling the Automatic Log Backup
autolog_off | Deactivating the Automatic Log Backup
autolog_on | Activating the Automatic Log Backup
autolog_show | Displaying the Automatic Log Backup Function
backup_cancel | Terminating an Interrupted Backup
backup_ext_ids_forget | Releasing the Memory Occupied by the External Backup IDs
backup_ext_ids_get | Fetching External Backup IDs
backup_ext_ids_list | Displaying External Backup IDs
backup_ext_ids_listnext | Scrolling in the External Backup IDs
backup_history_close | Closing the Backup History
backup_history_date | Change Date of the Backup History
backup_history_list | Displaying the Backup History
backup_history_listnext | Scrolling in the Backup History
backup_history_open | Fetching the Backup History
backup_ignore | Continuing the Backup Without Last Known Full Backup Medium
backup_replace | Backing Up to a Succeeding Medium
backup_start | Backing Up the Database Instance
backup_state | Displaying the Current Backup Status
bye | Ending the Database Manager
db_addvolume | Adding a Volume
db_admin | Transferring to the ADMIN Operational State
db_clear | Deleting Runtime Information After a Database Error
db_cons | Using the Database Console
db_create | Creating a Database Instance
db_drop | Deleting the Current Database Instance
db_enum | List of All Registered Database Instances
db_offline | Transferring to the OFFLINE Operational State
db_online | Transferring to the ONLINE Operational State
db_reg | Registering the Current Database Instance
db_reg -R | Changing the Software Version of the Current Database Instance
db_restart | Restarting the Database Instance
db_restartinfo | Displaying Current Information About the Database Instance
db_speed | Displaying the Database Kernel Variant
db_start | Starting the Database Instance
db_state | Displaying the Operational State of the Database Instance
db_stop | Stopping the Database Instance
dban_start | Calling the Database Analyzer
dban_state | Determining the Status of the Database Analyzer
dban_stop | Ending the Database Analyzer
dbm_configget | Displaying a Configuration Parameter of the Database Manager
dbm_configset | Changing a Configuration Parameter of the Database Manager
dbm_getpath | Displaying the Version-Independent Directories
dbm_setpath | Defining the Version-Independent Directories
dbm_version | Displaying the Version Information
diag_histlist | Displaying the Diagnosis History
diag_pack | Packing Database Files
event_delete | Deactivating a Database Event
event_list | List of Activated Database Events
event_release | Terminating a Database Event Session
event_set | Activating a Database Event
event_wait | Waiting for a Database Event
exec_lcinit | Executing the liveCache Initialization Script
exec_load | Starting the PythonLOAD Program
exec_xpu | Updating the Optimizer Statistics with the XPU Program
exit | Ending the Database Manager
file_backup | Backing Up a Database File
file_getfirst | Opening a Database File
file_getlist | List of the Database Files
file_getnext | Scrolling Through a Database File
file_operation | Editing Log Files of the Database Instance
file_restore | Restoring a Database File
help | List of DBM Commands
info | Displaying Status Information for the Database Instance
info_next | Scrolling in the Status Information of the Database Instance
inst_enum | List of All Registered Versions of the Database Software
inst_reg | Registering a Version of the Database Software
inst_unreg | Deleting the Registration of a Version of the Database Software
load_r3tab | Loading SAP-Specific Tables
load_systab | Loading the System Tables
medium_date | Change Date of the Media Definition File
medium_delete | Deleting a Backup Medium
medium_get | Displaying the Media Data
medium_getall | List of All Defined Backup Media
medium_label | Displaying the Backup Information in the Operational State ONLINE or ADMIN
medium_labeloffline | Displaying the Backup Information in the Operational State OFFLINE
medium_migrate | Copying an Existing Media Definition
medium_put | Defining or Changing a Backup Medium
param_abortsession | Terminating a Parameter Session
param_addvolume | Changing Volume Parameters
param_checkall | Checking All Database Parameters
param_commitsession | Confirming Changes to the Database Parameter File
param_copy | Copying a Database Parameter File
param_delvolume | Deleting Volume Parameters
param_directdel | Deleting a Database Parameter
param_directget | Displaying a Value from the Database Parameter File
param_directgetall | Displaying All Parameters of the Current Database Parameter File
param_directput | Directly Changing a Value in the Database Parameter File
param_extget | Displaying Individual Data for a Database Parameter
param_extgetall | Displaying the Data for All Database Parameters
param_getdefault | Displaying the System Default Value
param_getexplain | Displaying the Stored Explanatory Text
param_getfull | Displaying All Data for a Database Parameter
param_gethelp | Displaying the Stored Help Text
param_gethistory | Opening the Database Parameter History
param_gethistorynext | Scrolling in the Database Parameter History
param_getproperties | Displaying All Properties of a Database Parameter
param_gettype | Displaying the Data Type of a Database Parameter
param_getvalue | Displaying the Current Value of a Database Parameter
param_getvolsall | Displaying the Data for All Volume Parameters
param_getvolume | Displaying the Data for Individual Volume Parameters
param_init | Initializing the Database Parameters for a New Database Instance
param_put | Changing the Value of a Database Parameter
param_putconfirm | Correcting Database Parameters
param_restore | Resetting the Parameter File to a Previous Version
param_rmfile | Deleting the Database Parameter File
param_startsession | Opening a Parameter Session
param_versions | List of Available Parameter Files
quit | Ending the Database Manager
recover_cancel | Terminating an Interrupted Restore or Backup Check
recover_check | Checking a Backup
recover_config | Restoring the Parameter File from a Data Backup
recover_ignore | Continuing a Parallel Restore or Backup Check
recover_replace | Restoring or Checking a Backup with Succeeding Medium
recover_start | Restoring the Database Instance
recover_state | Displaying the Current Recovery Status
recover_state_check | Displaying the Current Status of a Backup Check
release | Ending the Database Manager
service_connect | Opening a Service Session
service_release | Terminating a Service Session
show | Displaying Information About the Database Instance
show_list | List of the Information About the Database Instance
show_next | Scrolling in the Information About the Database Instance
sql_connect | Opening an SQL Session
sql_execute | Transferring an SQL Statement
sql_fetch | Scrolling in the Result Data
sql_info | Displaying the Structure of a Result Set
sql_recreateindex | Recreating a Damaged Index
sql_release | Terminating an SQL Session
sql_updatestat | Updating the Optimizer Statistics
trace_off | Deactivating the Database Trace
trace_prot | Creating the Text Version of the Database Trace
trace_protopt | Displaying Options for the Text Version of the Database Trace
trace_show | Displaying the Logged Activities of the Database Trace
user_create | Creating DBM Operators
user_delete | Deleting DBM Operators
user_get | Displaying Operator Data
user_getall | List of DBM Operators
user_getrights | Displaying Operator Authorizations
user_put | Changing DBM Operator Data
util_activate | Activating a New Database Instance
util_connect | Opening a Utility Session
util_execute | Transferring a Utility or SQL Command
util_getpage | Displaying a Physical Database Page
util_putpage | Writing a Physical Database Page
util_release | Terminating a Utility Session


Reply Format (SAP Library - SAP DB)

 Entering content frame

Background documentation Reply Format

Normally communication is in ASCII format. Only in special cases, such as binary data access, do the request and reply also contain binary data.

This ensures that the replies on the client side can be easily read. It also largely avoids dependence on the hardware architecture.

Successful Reply

If the request is successful, an OK message is given in the following format:

OK[,<description>]<NL>
[<answer>]

The character string OK is the first token of the reply. There is an optional explanatory text on the same line. The meta character <NL> stands for a line feed.

The reply data is provided after the line feed. The structure of the reply data depends on the concrete DBM command .

Error Message

ERR[,<description>]<NL>
[<errcode>,<errdescription><NL>
[<subcode>,<subdescription><NL>]
[<extended_description><NL>]]

An error always starts with the character string ERR. The same line may also contain a description.

The number of the error (<errcode>) and a relevant text (<errdescription>) can be included on the next line
(See also: Messages).

If the system has the error number and relevant text of a subcomponent (for example, runtime environment or operating system), these are transferred as <subcode> and <subdescription>.

Possible additional information follows in the <extended_description>. Special cases in which the <extended description> has a structured format are described with the relevant DBM commands.

Internal Error of the Database Manager:

ERR
-24979,ERR_XPNOTFOUND_CN00 : parameter not found

Error in the Runtime Environment:

ERR
-24994,ERR_RTE_CN00 : runtime environment error
3,cannot access PARAM file [32]

Error when analyzing the description file (see also: Configuring Database Instances ):

ERR
-24978,ERR_XPSYNTAX_CN00 : xparam syntax error
16,XPERR_IVSEQ_CN21 : error in IF-ELSIF-ELSE sequence
D:\d628\usr\env\cserv.pcf(60) : ELSE


Operating Modes (SAP Library - SAP DB)

 Entering content frame

Background documentation Operating Modes

The Database Manager CLI program provides three operating modes:

  • Command Mode
  • Script mode
  • Session Mode

All modes are implicitly activated by the way the Database Manager CLI is called.


Command Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation Command Mode

The Database Manager CLI works in command mode if a DBM command is specified when the program is called.

The command is executed. The session and the Database Manager CLI program then end.


Script Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation Script Mode

Use

Use this command to activate the script mode.

Specify the name of the input script <file_name> that contains the DBM commands that are to be processed by the Database Manager.

Use the following input options in the script:

Local System Call: !

Comment: #

Linking Lines: /

Linking Lines: <

Syntax

dbmcli –i <file_name>


Session Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation Session Mode

The Database Manager CLI works in the session mode if no DBM command and no input script are specified.

Within a session of the Database Manager CLI you can execute several commands.

Use the following input methods for this:

Local System Call: !

Comment: #

Linking Lines: /

Linking Lines: <

To end the session mode, enter release.


Database Manager Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager Files

For each database instance, the Database Manager creates a range of files that are stored in different locations in the directory structure, depending on the file type (see Directory Structure of the Database System).

There are two types of Database Manager file:

· Database Manager Log Files

· Database Manager Configuration Files


Database Manager Log Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager Log Files

Specify the file ID and/or the file class when packing the diagnosis package diagpkg.tgz (Packing Database Files).

General Log Files (File Class protocol)

File Content | File name | File ID
DBM Server log | dbm.prt | DBMPRT
Log of the utility command | dbm.utl | UTLPRT
Log of the system table load | dbm.ins | INSTPRT
Log of database administration activities | dbahist.prt | DBAHIST
Log of the system table load | dbm.ins | INSTPRT

Log Files for Backups and Recoveries (File Class backup)

File Content | File name | File ID
History of backups and recoveries | dbm.knl | BACKHIST
History of the media used for backups | dbm.mdf | BACKMDF
History of backups with external backup tools | dbm.ebf | BACKEBF
Log of last backup with an external backup tool | dbm.ebp | BACKEBP

See also:

SAP DB Directories


Database Manager Configuration Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager Configuration Files

The configuration files of the Database Manager are located in the directory <independent_data_path>/wrk/<database_name>.

Configuration files have the file class config.

File Content | File name | File ID
Configuration file of the Database Manager Created by the system for each database instance | dbm.cfg | -
Database Manager backup media | dbm.mmm | DBMMDF

See also:

Displaying a Configuration Parameter of the Database Manager

Changing a Configuration Parameter of the Database Manager

SAP DB Directories


Database Analyzer: SAP DB (SAP Library - SAP DB)

 Entering content frame

Component documentation Database Analyzer: SAP DB

The Database Analyzer program is a tool for analyzing the performance of SAP DB database instances.

You can use the Database Analyzer independently of the SAP DB version and the database instance type. You can also use this program to access the database instance from a remote host.

Scope of Functions

The Database Analyzer collects performance-relevant data by monitoring the performance of the database instance at regular (variable) intervals. It splits the results of its analyses into five classes – information, three different levels of warnings, and error messages.

This makes it easier for you to find out the following possible causes of problems with the database instance:

  • Database configuration (caches, parameter)
  • Synchronization (locks, critical regions, heap)
  • Processing of database requests (such as processing strategies, indexes, optimizer statistics)
  • Hardware configuration

To be able to interpret the information gathered by the Database Analyzer, you require a sound working knowledge of the SAP DB architecture, the architecture of your SAP DB application program, and your operating system.

For general information on the SAP DB database system, see The SAP DB Database System on the SAP DB Homepage http://www.sapdb.org.

  • Calling the Database Analyzer
  • Log Files
  • Messages
  • Configuration File


Calling the Database Analyzer (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Calling the Database Analyzer

You can call the Database Analyzer in several different ways:

From the operating system level
Enter the following command:
dbanalyzer
[–d <database_name>] [-u <user,password>]
[-t <interval>[,<number>]] [-n <database_server>]
[-f <configfile>] [-o <outputdir>]
[-c <level> ]
[-i] [-nologo] [-noenv] [-stop]
Options

In the Database Manager CLI
Database Manager CLI Call

In the CCMS (for SAP systems)
Database instance type liveCache: Structure link Bottleneck Analysis (Database Analyzer)
Database instance typ SAP DB OLTP: Database Bottlenecks


Options (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options

You can specify the following options when you call the Database Analyzer:

-d <database_name> | Name of the database instance
-u <user,password> | User name and password
-t <interval>,<number> | Time interval (in seconds) between two analyses and the chosen number of analyses If you choose a <number>, then the Database Analyzer ends after this number of analyses.
-n <database_server> | Name of the server on which the database instance runs If you specify the server name, you must also use the option –o to specify the directory for the log files.
-f <configfile> | Name of the configuration file If you do not specify a configuration file, the Database Analyzer uses the file dbanalyzer<version>.cfg in the SAP DB directory <dependent_path>/env.
-o <outputdir> | Directory for the log files If you start the Database Analyzer on the server on which the database instance is installed, you do not need to specify –o. In this case, the Database Analyzer uses the subdirectory analyzer in the run directory of the database instance.
-c <outputlevel> | Specifies, on a scale of 1 (low) to 4 (high), how much additional information appears on the console If you do not specify -c, then no information appears on the console.
-i | Deletes any existing log files for the same day
-nologo | Suppresses the logo
-noenv | Suppresses logging and output of the environment variables from the configuration file
-stop | Stops a running Database Analyzer


Log Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Files

The data collected by the Database Analyzer during the day is saved in a range of log files in the log file directory.

You can specify the log file directory as follows:

When you call the Database Analyzer, you can use the option –o to specify the log file directory. The log files are saved in the subdirectories / YYYYMMDD.

If you start the Database Analyzer on the server on which the database instance is installed, you do not need to specify –o. The log files are saved in the subdirectory analyzer in the run directory of the database instance.

The Database Analyzer generates the following log files:

DBAN.prt

This file contains the following information:

· Unique information about the configuration and performance-relevant data of the database instance

· Bottlenecks discovered by the Database Analysis after each measurement

The Database Analyzer weights the information and bottlenecks:

I | Information | General information, such as the number of executed commands
W1 to W3 | Warning levels 1 to 3 | Bottleneck warnings with low, medium, and high priority
E | Emergency | Critical problems, such as an imminent database crash

DBAN_<monitor_class>.csv

These files contain all analysis data and are used to check runtime behavior.

One file exists for each monitor class (analysis area). You can use Microsoft Excel to open and read this file as soon as the Database Analyzer stops writing to it.

List of All Log Files

See also:

Messages


List of Log Files (SAP Library - SAP DB)

 Entering content frame

Background documentation List of Log Files

This table shows you the information that you can find in the Database Analyzer log files.

Log Files for All Database Instance Types

DBAN.prt | Logs messages, including analysis rules and current values that caused the message
DBAN_CACHES.csv | Successful and unsuccessful accesses to the caches, and hit rates
DBAN_FILLING.csv | Filling level of the database instance (for example, the size of the data volumes, number of permanently and temporarily used pages)
DBAN_IO.csv | Reads and writes to cache pages and data pages
DBAN_LOAD.csv | Accesses and selectivity of SELECT, FETCH, INSERT, UPDATE, and DELETE statements
DBAN_LOGGING.csv | Number of log pages written, filling level of the log queue
DBAN_REGIONS.csv | Information about accesses to critical regions
DBAN_STRATEGY_INDEX.csv | Accesses and selectivity for index searches
DBAN_STRATEGY_PRIMKEY.csv | Accesses and selectivity for PRIMARY KEY searches
DBAN_STRATEGY_SCANS.csv | Accesses and selectivity for INDEX SCAN and TABLE SCAN searches
DBAN_TASK_ACTIVITIES.csv | Information on task activities (such as number of SQL statements, number or running user tasks, number of task changes)
DBAN_TASK_IO.csv | Number and duration of physical writes and reads from perspective of the log writer, the user task, and the pager
DBAN_TASK_STATES.csv | Number and duration of processed statements Number and wait duration of the task states Vsuspend, Vwait, Vsleep
DBAN_TRANSACTIONS.csv | Number of SQL statements and procedure calls, PREPARE, EXECUTE, COMMIT, and ROLLBACK statements, subtransactions, TIMEOUTS caused by locks, and conversions of row locks to table locks (Lock List Escalations)

liveCache-Specific Log Files

DBAN_CACHES_OCCUPANCY.csv | Cache load and occupancy (proportion of OMS, SQL, and history pages in the Structure link data cache)
DBAN_OMS.csv | Number of calls by Structure link DB procedures, dereferences, deleted objects, history accesses
DBAN_OMS_CONTAINER.csv | Information on Structure link class containers (such as number of classes, occupancy, number of free pages)
DBAN_OMS_HEAP.csv | Information on Structure link OMS heap (such as occupancy, current size, collisions)
DBAN_OMS_VERSIONS.csv | Information on Structure link OMS versions (such as number and age of versions used)


Messages (SAP Library - SAP DB)

 Entering content frame

Background documentation Messages

Database Analyzer can write the following messages in the log file, among others:

Avg user cmd exec time for task

Avg user suspend time for task

Avg user wait time for task

Catalog cache hitrate

Collision rate

Data cache hitrate

Data volume filling level

Deletes

Free user tasks

Index accesses

Index range accesses

Isolated index accesses

Isolated index range accesses

Isolated index scans

Log area filling level

Lock list escalations

Log queue overflows

Log write time

Max log queue filling

Number of cached history pages

Number of physical reads

Number of physical writes

Number of physical writes of temporary pages

OMS cache hitrate

OMS heap collisions

OMS heap utilization

OMS history cache hitrate

OMS terminates

OMS version is old

OMS version is unloaded

Out of memory exceptions

Parse activities

Physical reads for user task

Primary key accesses

Primary key range accesses

Selects and Fetches

Table scans

Updates

User task blocked in state

User task physical writes


Avg user cmd exec time for task (SAP Library - SAP DB)

 Entering content frame

Background documentation Avg user cmd exec time for task

Avg user cmd exec time for task <task_ID>: <duration> ms,
<number_of> commands, application pid <pid>

Explanation

The time needed by the specified user task to execute the statements is very high. You see the average execution time of a statement, the number of statements checked, and the process ID of the relevant application process.

Whether this counts as a bottleneck, depends on the application structure.

Mass statements in background processes can often cause long runtimes. As well as this, situations such as locks in SQL objects, physical reads and writes, or dispatching caused by the prioritization of other tasks, can cause internal kernel wait situations that increase runtimes.

If, in liveCache instances, a Structure link DB procedure needs to take a long time to execute, it is highly likely that other users are being blocked in the same liveCache thread. This can cause unexpectedly long runtimes for other transactions or DB procedures.


Avg user suspend time for task (SAP Library - SAP DB)

 Entering content frame

Background documentation Avg user suspend time for task

Avg user suspend time for task <task_ID>: <duration> ms,
<number_of> suspends, application pid <pid>

Explanation

The execution of this user task has been terminated by wait times. You see the average duration of all wait times that have been determined. This value is normally under 100 milliseconds.

You also see how often wait times occur.

User Response

Check the state of the user task at regular intervals.


Avg user wait time for task (SAP Library - SAP DB)

 Entering content frame

Background documentation Avg user wait time for task

Avg user wait time for task <task_ID>: <duration> ms, <number_of> waits, application pid <pid>

Explanation

In a lock collision, the wait for a lock to be released is very long.

This can be caused by a long transaction. Long wait times (task state vwait) can also occur when many applications want to lock the same object.

The database system attempts to execute locking tasks with high priority within the database kernel if the locks are requested by other sessions.

For information on the current locks, see the system tables TRANSACTIONS and LOCKS in the database instance.

User Response

Check the following aspects of the application:

  • Is it suitable for isolation level 0 (uncommitted)?
  • Can the time between the lock request and the COMMIT statement be reduced?
  • Can you avoid simultaneous locks on the same row by splitting tables?


Catalog cache hitrate (SAP Library - SAP DB)

 Entering content frame

Background documentation Catalog cache hitrate

Catalog cache hitrate <percentage>%, <number> of <number> accesses failed

Explanation

The hit rate when accessing the catalog cache in which the parsed SQL statements are administered is too low. In a running database application, the catalog cache hit rate should be about 90%. If new program parts or programs are started, the hit rate can sink to a very low level. However, the average over 15 minutes should not be below 85%.

User Response

The size of the catalog cache should be about 100 pages for each database session. You can check this with the general database parameter MAXUSERTASKS and the special database parameter CAT_CACHE_SUPPLY.

The catalog cache is enlarged dynamically by the active database sessions, and released again with a RELEASE statement. You can determine the current cache sizes with the SQL statement SELECT * FROM CONNECTEDUSERS.

If sessions need significantly more than 100 pages, we recommend that you increase the catalog cache accordingly in the medium term, if the memory of the server is large enough.


Collision rate (SAP Library - SAP DB)

 Entering content frame

Background documentation Collision rate

<region_name>: collision rate (<percentage>%), <number_of> collisions, <number_of> accesses on region <region_ID>

Explanation

The rate of lock collisions is very high.

Tasks that run in different threads are attempting to access a global region in parallel. The synchronization that enables this often leads to collisions.

One exception to this in liveCache instances are high collision rates in the regions ( <region_id>) OMSVDIR and CNSTVIEW. This is normal for certain actions, such as a simultaneous CIF queue transfer.

User Response

You need to act if the collision rate rises above 10%. Generally, the risk of collisions rises with the number of processors used (database parameter MAXCPU). Check, therefore, whether the database system can fulfill the needs of the applications with fewer CPUs in multiprocessor systems.

If high collision rates occur in multiprocessor central systems (database system and application run on the same server), check whether the CPU on the server is overloaded, and whether the database threads are blocked by other applications. In this case, the database threads that contain user tasks; should have REAL TIME PRIORITY in the operating system. However, at the same time, the value of MAXCPU must be at least one lower than the number of real CPUs, to avoid operating system blocks.

Additional Actions

If the high collision rates occur in the regions DATAn, SPLITn or TREEn, then increase the values of both the general database parameter CACHE_SIZE and the special database parameters _DATA_CACHE_RGNS and _TREE_RGNS.

If the high collision rates occur in the regions TRACE or BUFWRTR, then activate the database trace temporarily for troubleshooting only.


Data cache hitrate (SAP Library - SAP DB)

 Entering content frame

Background documentation Data cache hitrate

Data cache hitrate <percentage>%, <number> of <number> accesses failed

Explanation

The hit rate when accessing the data cache is too low. In a running liveCache application, the hit rate should not be under 100%.

Lower hit rates may occur for short periods of time, for example, when objects are accessed for the first time, or if a table that is being scanned (TABLE SCAN) is larger than 10% of the data cache (only if the special database parameter LRU_FOR_SCAN has the value yes). Data cache hit rates that are lower than 99% over 15 minutes must be avoided.

User Response

Check the following points:

Load in the data cache

Configuration of the database instance and the hardware

In liveCache instances, the size of the plan versions, as well as Structure link OMS versions that have existed for a long time.

Individual SQL statements can often take up a large proportion of the total logical and physical reads. Increasing the cache just moves the load from the hard disk to the CPU, even though, for example, an additional index could turn a read-intensive table scan into quick direct access.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4.


Data volume filling level (SAP Library - SAP DB)

 Entering content frame

Background documentation Data volume filling level

Data volume filling level <percentage>%, <number_of> pages configured, perm used <perm_used>, temp used <temp_used>

Explanation

The filling level of the data volumes is high. If the filling level is 100%, the database stops.

User Response

If the amount of data that needs administering in the database instance has increased, you may need to add a new data volume.

A large proportion of temporary data pages ( temp used) indicates large amounts of (buffer) results. Find the statement that causes these large amounts of (buffer) results to be created, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4.


Deletes/Updates (SAP Library - SAP DB)

 Entering content frame

Background documentation Deletes/Updates

Delete selectivity <percentage>%: <number_of> deletes, <number_of> rows read, <number_of> rows qualified

Update selectivity <percentage>%: <number_of> updates, <number_of> rows read, <number_of> rows qualified

Explanation

The ratio of read rows to modified rows is poor for UPDATE or DELETE statements.

Before UPDATE and DELETE statements can modify or delete rows, the row must be localized in the table. The same access strategies are used as in a SELECT statement.

User Response

Find the statement that causes this poor ratio of read rows to found rows, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4.


Free user tasks (SAP Library - SAP DB)

 Entering content frame

Background documentation Free user tasks

Free user tasks: <count>, connected users: <count>

Explanation

The number of free user tasks is low. If there are no free user tasks, then no more applications can connect to the database.

User Response

Check the existing database connections. Check whether any applications have connected to the database more than once. If the amount of applications that want to work with the database instance rises, you may need to increase the values of the database parameter MAXUSERTASKS.


Lock list escalations (SAP Library - SAP DB)

 Entering content frame

Background documentation Lock list escalations

Lock list escalations: <count>

Explanation

The number of row locks in a table is too high. The database system attempts to convert the row locks into a table lock (see also Lock Behavior).

User Response

You can specify the maximum possible number of row locks in the lock list in the general database parameter MAXLOCKS. The database system attempts to convert the row lock into a table lock if a task holds more than 0,1*MAXLOCKS row locks in a table. If too many escalations occur, increase the parameter value.

Whether escalations are a problem depends strongly on the application in question. If escalations occur, check the application to see whether modifying transactions that lock a lot of rows cannot be corrected by an interim COMMIT.


Log area filling level (SAP Library - SAP DB)

 Entering content frame

Background documentation Log area filling level

Log area filling level <percentage>%, <number_of> pages configured, <number> used

Explanation

The filling level of the log area is high. If the filling level is 100%, the database stops.

User Response

Back up the log area. If necessary, activate automatic log backups. If automatic log backups are already activated, check whether the last backup was successful.


Log queue overflows (SAP Library - SAP DB)

 Entering content frame

Background documentation Log queue overflows

Log queue overflows: <count>

Log queue overflows: <count>, configured log queue pages: <count>

Explanation

The log queue is full before the log pages are written to the log area.

User Response

Use the special database parameter LOG_IO_QUEUE to check the size of the log queue, and increase its value, if possible.

Check the performance of the hard disk on which the log volumes are located.


Log write time (SAP Library - SAP DB)

 Entering content frame

Background documentation Log write time

Avg log write time (log_writer_task) <duration> ms, <number_of> writes, <number_of> pages

Avg log write time (dev_thread) <duration> ms, <number_of> writes, <number_of> pages

Explanation

The physical writes of log entries take too long. There is the risk of a bottleneck.

User Response

Check the reads and writes in the disk area or device on which the log area is located. If possible, only the log entries must be made here, and no other reads or writes. In certain circumstances, you may need to move the log area to a quicker device.


Max log queue filling (SAP Library - SAP DB)

 Entering content frame

Background documentation Max log queue filling

Max log queue filling: <percentage>%

Explanation

The filling level of the log queue is high. If the filling level reaches 100%, you risk a log queue overflow.

User Response

Check the value of the database parameter LOG_IO_QUEUE and raise it, if necessary.

Check the performance of the hard disk on which the log volumes are located.


Number of cached history pages (SAP Library - SAP DB)

 Entering content frame

Background documentation Number of cached history pages

Number of cached history pages (<number>) exceeds number of cached OMS pages (<number>)

Explanation

This message can occur for liveCache instances only.

In the Structure link data cache, the number of history pages is higher than the number of OMS data pages.

User Response

Search for old Structure link OMS versions and transactions that prevent the history pages from being deleted in the data cache.

Check whether the reports /SAPAPO/OM_REORG_DAILY and /SAPAPO/OM_DELETE_OLD_SIMSESS are being executed at regular intervals (see also Structure link Monitoring OMS Versions).).


Number of physical reads (SAP Library - SAP DB)

 Entering content frame

Background documentation Number of physical reads

Number of physical reads: <count>

Explanation

A large number of physical reads are being made on the volumes of the database instance, since the data requested by the applications was not found in the data cache.

User Response

If a table is accessed for the first time, or if it has not been used for a long time, and was therefore displaced from the data cache, then this situation is not a problem.

However, if this does not explain the read activity, check the hit rate for the data cache, and increase the size of the data cache, if necessary.

Also make sure that the SQL statements specified by the application do not read significantly more data than needed for processing, because of poor search strategies, for example.

If the database parameter LRU_FOR_SCAN has the value yes, then table scans use only 10% of the data cache for caching the table. This means that the table cannot be held completely in the data cache, and the next scan has to read it physically again.


Number of physical writes (SAP Library - SAP DB)

 Entering content frame

Background documentation Number of physical writes

Number of physical writes: <count>

Explanation

Not all of the data used by the applications can be held in the data cache. This causes pages from the data cache to be displaced to the data area, which means that there are a large number of writes to the data volumes.

This phenomenon is almost unavoidable if load times (data import) are long, since the imported data is usually much larger than the size of the data cache.

Also, a savepoint also writes modified pages from the data cache to the data area at regular intervals. Read and write activity increases significantly at this time, without causing a genuine bottleneck. In normal operations, you should not be able to measure any significant write activities other than the savepoints.

User Response

If you notice a high level of write activity in normal operations, first make sure that no savepoint was active during the measurement interval (which is possibly too short).

If no savepoint was active, increase the size of the data cache.


Number of physical writes of temporary pages (SAP Library - SAP DB)

 Entering content frame

Background documentation Number of physical writes of temporary pages

Number of physical writes of temporary pages: <count>

Explanation

When temporary data pages are generated to build (buffer) sets of results (in JOINS or ORDER BY statements, for example), the data cache is not large enough for the temporary pages, and they have to be displaced to the data area. However, these pages must be exported out of the data area again for the further processing of the SQL statement.

User Response

Find the statement that causes these large amounts of (buffer) results to be created, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4..


OMS cache hitrate (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS cache hitrate

OMS cache hitrate <percentage>%, <number> of <number of> accesses failed

Explanation

This message can occur for liveCache instances only.

The hit rate when accessing the Structure link OMS data in the Structure link data cache is too low. In a running liveCache application, the hit rate should not fall below 100%, otherwise the data must be read physically.

The hit rate may fall for short periods of time, for example, when objects are accessed for the first time.

User Response

Check the following points:

· The load on the Structure link data cache

· The size of the plan version

· Long-running Structure link OMS versions

· Configuration of the liveCache instance and the hardware


OMS heap collisions (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS heap collisions

OMS heap collision rate <percentage>%, <number of> collisions during <number of> heap allocations/deallocations

Explanation

This message can occur for liveCache instances only.

Tasks that run in different threads attempt to request or release memory from the Structure link OMS heap in parallel. This causes collisions.

User Response

Check whether the parameter Structure link OMS_HEAP_COUNT, which determines the number of OMS heap segments, has an optimum value.

Generally, the risk of collisions rises with the number of processors used (database parameter MAXCPU). Check whether the liveCache can fulfill the requirements of the applications with fewer processors. If not, check whether the CPU on the server is overloaded, and whether the liveCache threads are blocked by other applications running on the server. In this case, the liveCache threads that contain user tasks; should have REAL TIME PRIORITY in the operating system. However, at the same time, the value of MAXCPU must be at least one lower than the number of real CPUs, to avoid operating system blocks.


OMS heap utilization (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS heap utilization

OMS heap utilization <percentage>%, used/max: <used_size>/<heap_limit_size> MB

Explanation

This message can occur for liveCache instances only.

The memory requirements in the Structure link OMS heap are very high for the running Structure link DB procedures.

If the memory utilization in the OMS heap reaches 100%, there is the risk of errors in the DB procedures ( Out Of Memory Exceptions), or that Structure link OMS version data is displaced from the OMS heap to the global Structure link data cache ( OMS version is unloaded).

User Response

If necessary, increase the size of the OMS heap.

Check whether the configuration of your database instance and hardware meets the requirements of the liveCache application.


OMS history cache hitrate (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS history cache hitrate

OMS history cache hitrate <percentage>%, <number> of <number of> accesses failed

Explanation

This message can occur for liveCache instances only.

The hit rate when accessing the Structure link history data in the Structure link data cache is too low. In a running liveCache application, the hit rate should not fall below 100%, otherwise the data must be read physically.

The hit rate may fall for short periods of time, for example, when objects are accessed for the first time.

User Response

Check the following points:

  • Load in the Structure link data cache
  • Size of the plan version
  • Long-running Structure link OMS versions
  • Configuration of the liveCache instance and the hardware


OMS terminates (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS terminates

<number of> terminates of DB procedure '<DB_procedure_name>' due to errors

Explanation

This message can occur for liveCache instances only.

An error occurred during the execution of the specified Structure link DB procedure.

User Response

Use the log files (such as knldiag and lcapo_com_trace_<xy>.txt) to find out the cause of the error.


OMS version is old (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS version is old

OMS version <OMS_version_ID> is <hours> hours old, uses <number> KB

Explanation

This message can occur for liveCache instances only.

Structure link OMS versions are open for long periods of time and occupy memory in the Structure link OMS heap. In this way, the number of Structure link history pages grows in the Structure link data cache and on the hard disk.

User Response

Find out the OMS version and the filling level of the data cache.

If the filling level of the data cache and the percentage of the history pages are high, try and find out the cause.

Check whether the reports /SAPAPO/OM_REORG_DAILY and /SAPAPO/OM_DELETE_OLD_SIMSESS are being executed at regular intervals (see also Structure link Monitoring OMS Versions).).


OMS version is unloaded (SAP Library - SAP DB)

 Entering content frame

Background documentation OMS version is unloaded

OMS version <OMS_version_ID> is unloaded, uses <number> KB

Explanation

This message can occur for liveCache instances only.

Structure link OMS version data was loaded from the Structure link OMS heap into the Structure link data cache, since the value of one of the two liveCache parameters Structure link OMS_HEAP_THRESHOLD or Structure link OMS_VERS_THRESHOLD was exceeded.

Performance suffers when accessing the relevant OMS versions, since it takes longer to access the data cache than the OMS heap.

User Response

Check the parameters OMS_HEAP_THRESHOLD and OMS_VERS_THRESHOLD.

If necessary, increase the size of the OMS heap.


Optimizer strategies (SAP Library - SAP DB)

 Entering content frame

Background documentation Optimizer strategies

<number of> <optimizer_strategy_executes>, selectivity <percentage>%: <number of> rows read, <number of> rows qualified

Explanation

The ratio of read table rows to found table rows is poor when a particular access strategy ( <optimizer_strategy_executes>) is used.

The access strategy can be one of the following strategies:

·         Primary key accesses
(EQUAL CONDITION FOR KEY COLUMN,
EQUAL CONDITION FOR KEY COLUMN (SUBQ),
IN CONDITION FOR KEY COLUMN)

· Primary key range accesses
(RANGE CONDITION FOR KEY COLUMN,
RANGE CONDITION FOR KEY COLUMN (SUBQ),
IN CONDITION FOR KEY COLUMN)

· Index accesses
(EQUAL CONDITION FOR INDEX,
EQUAL CONDITION FOR INDEX (SUBQ),
IN CONDITION FOR INDEX)

· Index range accesses
(RANGE CONDITION FOR INDEX,
RANGE CONDITION FOR INDEX (SUBQ),
IN CONDITION FOR INDEX)

· Isolated index accesses
see : EXPLAIN Statement: Columns O,D,T,M, column O (Only Index)
and Index accesses

· Isolated index range accesses
see : EXPLAIN Statement: Columns O,D,T,M, column O (Only Index)
and Index range accesses

· Isolated index scans
(INDEX SCAN)

User Response

Find the statement that causes this poor ratio of read rows to found rows, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4.

See also Table scans


Out of memory exceptions (SAP Library - SAP DB)

 Entering content frame

Background documentation Out of memory exceptions

Out of memory exceptions: <count>

Explanation

This message can occur for liveCache instances only.

Structure link DB procedures fail due to too little memory in the Structure link OMS heap.

User Response

· Search for more information in the log file knldiag.

· Check the Structure link OMS versions, and check how much space they occupy in the OMS heap, for example, by using the log files DBAN_OMS_VERSIONS.csv and DBAN_OMS_HEAP.csv.

· Check the OMS heap and, if necessary, increase the size of the heap.


Parse activities (SAP Library - SAP DB)

 Entering content frame

Background documentation Parse activities

Parse activities <percentage>%, <number of> prepares, <number of> commands

Explanation

The proportion of parse activities in the total number of statements executed is very high.

Before an SQL statement is executed for the first time, it has to be analyzed (parsed). When doing this, the database system determines the possible access strategies, and saves the statement to the database instance in a compact form. When the statement is executed again, only this internal information is accessed, and the statement executed directly.

For static SQL statements, the C/C++ precompiler makes sure that the parse activity is performed only once. In applications that are based on ODBC or the C/C++ precompiler, and that use the PREPARE statement, the developer is responsible for the number or parse or EXECUTE requests.

If the JDBC interface is used, and the parse info cache is active, the JDBC interface is responsible for the optimization of the parse requests. However, you must keep the number of PREPARE statements as small as possible here as well.

A high level of parse activity when the database is running can indicate a missing statement cache implementation in your application, or a missing parse info cache in the JDBC interface.

A level of parse activity is normal when programs or program parts are started for the first time.


Physical reads for user task (SAP Library - SAP DB)

 Entering content frame

Background documentation Physical reads for user task

<number of> physical reads for user task <task_ID>, <number of> commands, application pid <pid>

Explanation

The user task <task_id> makes a large number of physical reads on the volumes of the database instance, since the data requested by the applications was not found in the data cache.

User Response

If a table is accessed for the first time, or if it has not been used for a long time, and was therefore displaced from the data cache, then this situation is not a problem.

However, if this does not explain the read activity, check the hit rate for the data cache, and increase the size of the data cache, if necessary.

Also make sure that the SQL statements specified by the application do not read significantly more data than needed for processing, because of poor search strategies, for example.

If the database parameter LRU_FOR_SCAN has the value yes, then table scans use only 10% of the data cache for caching the table. This means that the table cannot be held completely in the data cache, and the next scan has to read it physically.


Selects and Fetches (SAP Library - SAP DB)

 Entering content frame

Background documentation Selects and Fetches

<number of> selects and fetches, selectivity <percentage>%: <number of> rows read, <number of> rows qualified

Explanation

The strategies for accessing table data are poor for SELECT or FETCH statements. The system has to read a large number of table rows to find a small number of rows that fulfill a WHERE condition.

User Response

Find the statement that causes this poor ratio of read rows to found rows, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4..


Table scans (SAP Library - SAP DB)

 Entering content frame

Background documentation Table scans

<number of> table scans, selectivity <percentage>%: <number of> rows read, <number of> rows qualified

Explanation

The ratio of read rows to found rows is poor for table scans (TABLE SCAN). This often indicates a poor search strategy, caused either by the application (missing or insufficient indexes), or by a problem in the SELECT optimization of the database kernel.

Scanning large tables can have seriously negative effects on the performance of the entire system.

User Response

Find the statement that causes this poor ratio of read rows to found rows, and check the access strategies for this statement.

For information on creating optimized SQL statements, see Optimizer: SAP DB 7.4.


User task blocked in state (SAP Library - SAP DB)

 Entering content frame

Background documentation User task blocked in state

User task <task_ID> blocked in state '<state_description>'

User task <task_ID> blocked in state '<state description>', DB procedure: <DB_procedure_name>

Explanation

The specified user task is active, however, its task state is not changing. This also blocks all other tasks in the same user kernel thread. In extreme cases, the blocking task may be in an endless loop.


User task physical writes (SAP Library - SAP DB)

 Entering content frame

Background documentation User task physical writes

User task physical writes: <count>

Explanation

Modified pages are swapped from the data cache to the data area, since not all of the data used by the applications can be held in the data cache.

If the data cache were large enough, the physical write would be delayed to the next savepoint, and be performed asynchronously. Cache displacements, however, cause synchronous writes and reads, and must be avoided.

This phenomenon is almost unavoidable if load times (data import) are long, since the imported data is usually much larger than the size of the data cache.

User Response

Increase the size of the data cache.


Configuration File (SAP Library - SAP DB)

 Entering content frame

Background documentation Configuration File

The configuration file dbanalyzer<version>.cfg defines the rules and commands for how the Database Analyzer determines performance-relevant data.

The Analyzer either takes the performance-relevant data directly from the system tables for the database, or calculates it from these values.

The configuration file also describes the five classes (information, three levels of warnings, error messages) that the Database Analyzer uses to analyze the parameters and log them in the file DBAN.prt. You can specify fixed instructions for how the user should respond to these classes.

Changes to the rules and commands apply to the configuration file only; the Database Analyzer program remains unchanged.


Loader (SAP Library - SAP DB)

 Entering content frame

Component documentation Loader

This documentation describes the Loader tool, which can be used as of SAP DB version 7.4.

For general information about the SAP DB database system, see the documentation The SAP DB Database System and the following Internet address: www.sapdb.org.

· Architecture of the Loader

· Concepts

· Overview

· Commands and SQL Statements

· Call

· Log Functions

· Commands

· Terms and Procedures


Concepts (SAP Library - SAP DB)

 Entering content frame

Background documentation Concepts

The Loader uses the concepts of the SAP DB database instance and also its own concepts.

Concepts of the SAP DB Database

For the entire concepts of the SAP DB database, see the Reference Manual: SAP DB 7.4, Concepts section. In particular, the Loader uses the following concepts:

· Database Catalog

· Application Data

· System Tables

Loader Concepts

· Transformation

· System Tables

The Loader provides you with functions for unloading, loading, and formatting (transforming) data between different data sources and data targets using different data streams.

The range of language of the Loader allows the transformation of the data of all users of a SAP DB database, a user, a table of a user, or a set of qualified columns of a table or multiple tables (Commands for Unloading and Loading).

Media and database instances are supported as physical data sources and physical data targets. You can also use external backup tools to unload or load all your application data or the entire database catalog (see Unloading with External Backup Tools, Loading with External Backup Tools).

The Loader uses metadata, which can be in different formats, for the logical description of data and its transformation.

When the system tables are filled, this can, among other things, be used for restarting a transformation.


Transformation (SAP Library - SAP DB)

 Entering content frame

Background documentation Transformation

The Loader provides you with functions for unloading, loading, and formatting data between different data sources and data targets using data streams.

This action is known as a transformation and is described using the syntax of the Loader or entries in the Loader-specific system tables.

A transformation is identified using Loader and SAP DB database instance details, a transformation type, the required part of the database catalog, and the data streams.

· Loader connection:
Server node, database name, user name, password, SQL mode, ASCII code page, transaction size, MaxErrorCount, backup tool

· SAP DB database connection:
Server node, database name

· Transformation type:
EXTRACT: Data is to be unloaded.
LOAD: Data is to be loaded.
UPDATE Data is to be changed.

· Part of the database catalog:
You can define the scope of the catalog objects of a SAP DB database involved in a transformation.
ALL: Entire database catalog
USER: Part of the database catalog that belongs to the specified user
TABLE: Part of the database catalog that belongs to the specified table
You can specify a set of qualified columns of one or more tables.
For the parts of the database catalog specified using ALL and USER, you can determine the commands and their runtime information from the system tables .

· Data stream


System Tables (SAP Library - SAP DB)

 Entering content frame

Background documentation System Tables

One important log function of the Loader is storing Loader-relevant information in system tables.

When you install the database system, the following system tables are created for the Loader:

· CODEPAGE

· TRANSFORMATIONMODEL

· TRANSFORMATIONMONITOR

· TRANSFORMATIONPACKAGES

· TRANSFORMATIONRESOURCES

· TRANSFORMATIONSTATISTICS

· TRANSFORMATIONSTEPS

The owner of these system tables is the SYSDBA user. You do not need to specify the owner when you access these tables.

In the TRANSFORMATION system tables, the Loader logs information on the runtime responses of unload and load processes. If you perform a load or unload process that spans multiple tables, the system tables are filled with the corresponding information.

You can also configure a transformation using the system tables.

The Loader uses the entries in the system tables to restart commands. You can use this ability to restart with the RESTART option (restart) of the command.


Overview (SAP Library - SAP DB)

 Entering content frame

Background documentation Overview

Follow the links below for information on commands, call options, and log functions for the Loader.

Commands and SQL Statements

· Commands for creating a database session

· Commands for loading and unloading

· SQL statements

Call

· Call with the Loader CLI (LOADERCLI)

· Call with the Perl Interface of the Loader

· Call with the Python Interface of the Loader

· Call with the Java Interface of the Loader

Log Functions

· Log file

· System tables


Commands and SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Commands and SQL Statements

The Loader can execute commands and SQL statements.

· Commands for creating a database session
The commands and SQL statements for loading and unloading can only be executed after a database session has been successfully created.This ensures that only suitably authorized owners can load and unload.

· Commands for unloading and loading
An important function of the Loader is unloading and loading the database catalog, parts of the database catalog, and application data.

· SQL statements
The Loader can execute the SQL statements required for loading and unloading.


Commands for Creating a Database Session (SAP Library - SAP DB)

 Entering content frame

Background documentation Commands for Creating a Database Session

The Loader can process a range of commands and SQL statements, including commands for creating a database session:

· AUTOCOMMIT Command

· SET Command

· SQLMODE Command

· USE SERVERDB Command

· USE USER Command


Commands for Unloading and Loading (SAP Library - SAP DB)

 Entering content frame

Background documentation Commands for Unloading and Loading

The Loader can process a range of commands and SQL statements, including commands for unloading and loading data.

The range of language of the Loader allows you load or unload, in increasing granularity, a complete database, the objects of a user, individual tables, or a set of columns of a table.

What do you want to unload or load? | Loader Commands
Database catalog and appplication data | DBEXTRACT/DBLOAD You can use external backup tools to unload or load the data.
Database catalog | CATALOGEXTRACT ALL/CATALOGLOAD ALL You can use external backup tools to unload or load the data.
Database catalog objects and the application data of a user | CATALOGEXTRACT USER/CATALOGLOAD USER TABLEEXTRACT USER/TABLELOAD USER
Tables | CATALOGEXTRACT TABLE/CATALOGLOAD TABLE TABLEXTRACT TABLE/TABLELOAD TABLE DATAEXTRACT/DATALOAD
Set of qualified columns of a table | DATAEXTRACT/DATALOAD FASTLOAD DATAUPDATE

See also:


Examples of DATALOAD Commands (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Examples of DATALOAD Commands

DATALOAD TABLE sqltravel20.reservation IF POS 4 >= '11.08.1999"
  rno       1
  cno       2
  hno       3
  arrival   4
  departure 5
  roomtype  6
INFILE 'reservation.data'
  DATE 'dd.mm.yyyy'

DATALOAD TABLE sqltravel10.room
  IF (POS 41-44 REAL < '400.00')
  AND
     (POS 41-44 REAL >= '50.00')
      nno      01-04 INTEGER
      roomtype 09-15
      price    41-44 REAL
INFILE 'room.data' FORMATTED

DATALOAD TABLE edemo.products
  productid    01-10
  productname  11-51         NULL IF POS 10-12 = '   '
  unitinstock  52-55 INTEGER NULL IF POS 52-55 INTEGER < '0'
  unitprice    60-67 DECIMAL (2) NULL IF POS 60 <> 'X'
                                  OR POS 60-67 DECIMAL < '0'
INFILE 'products.data' FORMATTED

DATALOAD TABLE edemo.suppliers
  supplierid   1
  phone        2 DEFAULT NULL
  address      3 DEFAULT NULL
INFILE 'suppliers.data'
NULL '-            '

DATALOAD TABLE edemo.orders
  oderid       1
  orderdate    DATE
  requireddate 2
INFILE 'orders.data'


SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Statements

The Loader includes all functions (see Commands and SQL Statements) required for processing SQL statements that unload and load data. DDL statements, in particular, are vital for the loading of data (Reference Manual, SQL Statements: Overview section).

Database queries, however, return only status messages.

COMMIT and ROLLBACK statements are only effective in the mode AUTOCOMMIT OFF (see AUTOCOMMIT Command).


Call (SAP Library - SAP DB)

 Entering content frame

Background documentation Call

The Loader processes commands and SQL statements. Commands and SQL statements can be processed in the background or be embedded in programming languages.

The way in which the Loader Server is called varies, depending on which client of the Loader you are using.

· Call with the Loader CLI (LOADERCLI)

· Call with the Perl Interface of the Loader

· Call with the Python Interface of the Loader

· Call with the Java Interface of the Loader

See also:

Syntax Rules for Calling the Loader

This documentation contains only a short summary of the functions of the script languages that can be used in the Loader. For more information, see the vendor documentation for Perl, Python, or Java.


Call with the Loader CLI (LOADERCLI) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Call with the Loader CLI (LOADERCLI)

You can call the Loader with the Loader CLI client (LOADERCLI).

Call

loadercli [<options>]

You can specify options when you call the Loader. Make note of the following options:

· You can use the option -r to decide whether you want to use the Loader Server embedded in the Loader CLI, or the Loader Server that is separate from the Loader CLI.

· You can use the option -b to specify the operating mode. This determines whether the commands and SQL statements are processed interactively or in the background.

Process Flow

Before it connects to the database instance, the Loader CLI first evaluates the specified options. The commands and SQL statements in the command file (or entered interactively) are then executed.

Calling the separate Loader (server and client in one program), which then processes the commands and SQL statements in the background

loadercli -d demodb -u sqltravel01,travel01 –b command.dat -E 20

The Loader creates a connection to the database instance demodb for the user sqltravel01. The Loader processes the commands and statements contained in the command file command.dat. If errors (return code <> 0) occur, the processing of the command file is terminated as soon as 20 error messages occur.

Calling the Loader Server on the local host, separately from the Loader CLI. The Loader Server then processes the commands and SQL statements in the background.

loadercli -d demodb -u sqltravel01,travel01 –r loaderhost -b command.dat -E 20

The Loader CLI creates a connection to the Loader Server on the local host loaderhost. The Loader Server creates a connection to the database instance demodb for the user sqltravel01. The Loader processes the commands and statements contained in the command file command.dat. If errors (return code <> 0) occur, the processing of the command file is terminated as soon as 20 error messages occur.

Calling the separate Loader (server and client in one program), which then processes the commands and SQL statements interactively

loadercli -d demodb -u sqltravel01,travel01

The Loader creates a connection to the database instance demodb for the user sqltravel01. The Loader then waits for the commands and SQL statements in the command line, and processes them.

Result

The Loader executes the commands and SQL statements. The Loader writes a log file.

Errors

If errors occur when commands or SQL statements are processed, then the way in which the Loader responds depends on whether it is running interactively or in the background.

If you are using the Loader interactively, it reports the error, and then waits for your next entry.

If you are using the Loader in the background, it stops processing commands and SQL statements after a defined number of errors, and exits.You can use the option –E to define the number of errors that the Loader ignores before it stops processing commands.If you do not use the option –E, the the Loader stops running after the first command with an error. You cannot react to the errors when you use the Loader CLI.

If you want to respond to errors, the Loader functions are available as a library for the Perl and Python script languages.

See also:
Call with the Perl Interface of the Loader
Call with the Python Interface of the Loader


Options (SAP Library - SAP DB)

 Entering content frame

Background documentation Options

When you call the Loader with the Loader CLI (LOADERCLI), you can specify options: loadercli [<options]

Options

-b <command_file> | Name of the command file, specify the operating mode
-d <database_name> | Name of the database instance
-u <userid>,<password> | User name and password
-n <server_node> | Database server
-r <server_node> | Name of the local Loader server, if you want to call the Loader CLI and Loader Server separately
-E <number> | Maximum permitted number of errors
-o[w|a] <file_name> | Name of the output file
-p <number><substitution_string > | Specifies a substitution parameter
-R <directory_name> | Directory that contains the programs that depend on the version of the database software
-V | Version of the Loader
-v | Version of the Loader CLI
-h | Help

Use

When you call the Loader, you usually specify the name of the user (option -u) and of the database instance (option -d). This creates a connection between the Loader and the specified database instance for this user.

You can specify all required commands and SQL statements in a command file (option -b), or you can enter them interactively.

loadercli -d demodb -u sqltravel01,travel01 -b command.dat

You can also call the Loader without options, or by specifying only a database instance name (option -d). In this case, you must specify all other commandos for creating a database session in the command file. This creates the connection between the Loader and this database instance or another database instance.


Command File: -b (SAP Library - SAP DB)

 Entering content frame

Function documentation Command File: -b

Option for calling the Loader with LOADERCLI to transfer the name of the command file and for setting the operating mode.

Syntax

-b <command_file>

<command_file>

Command file

Use

When you specify this option, the Loader CLI gets the commands and SQL statements from the specified command file and sends them to the Loader Server. The Loader CLI is in background mode.

If you do not specify this option, the Loader CLI opens an interactive session.


Database Instance: -d (SAP Library - SAP DB)

 Entering content frame

Function documentation Database Instance: -d

Option for calling the Loader with LOADERCLI for transferring the name of the database instance

Syntax

-d <database_name>

<database_name>

Name of the database instance to which a database user wants to connect

Use

The Loader creates a connection to the specified database instance. When it does this, the Loader executes the Loader command USE SERVERDB implicitly, or the Loader command USE USER, if both database instance name and user data have been specified.

You can also specify the name of the database instance with the commands USE SERVERDB or USE USER. This enables you to change the name during the Loader session.


User Data: -u (SAP Library - SAP DB)

 Entering content frame

Function documentation User Data: -u

Option for calling the Loader with LOADERCLI for transferring user data

Syntax

-u [<user_name>,<password>]

<user_name> | User name (see database user)
<password> | User password

If you use –u without specifying <user_name>,<password>, then the Loader prompts you for a user name/password combination. This is how you avoid displaying the user password in the command line, command history, or process list of the operating system.

Prerequisite

At the same time, you use the option –d to specify a database instance.

Use

A database session is created for the specified user. At the same time, the Loader executes the Loader command USE USER implicitly. The database system automatically converts the user name and password to uppercase letters.

You can also use the command USE USER to specify user data.This lets you change users during a Loader session.


Database Server: -n (SAP Library - SAP DB)

 Entering content frame

Function documentation Database Server: -n

Option for calling the Loader with LOADERCLI to transfer the server name of the database instance

Syntax

-n <server_node>

<server_node>

Node name of the server on which the database instance is located
Default value: Name of the local server

Prerequisite

At the same time, you are using the option –d or –d and –u.

Use

The Loader creates a connection to the database instance on the specified server. When it does this, the Loader executes the Loader command USE SERVERDB implicitly, or the Loader command USE USER, if both database instance name and user data have been specified.

You can also use the command USE SERVERDB or USE USER to specify the server node name.


Loader Server: -r (SAP Library - SAP DB)

 Entering content frame

Function documentation Loader Server: -r

Option when calling the Loader with LOADERCLI; use this option to control whether the Loader is started as a client-server application or as a separate program.

Syntax

-r <server_node>

<server_node>

Node name of the local host on which the Loader CLI and the Loader Server are located

Use

If the option -r <server_node> is specified, the Loader CLI creates a network connection to the Loader Server (both programs are on the local host) and sends all commands that need to be executed to the Loader Server.

If the option –r is not specified, the Loader CLI uses the embedded Loader Server to execute the commands. In this case, there is no network communication between the Loader CLI and the Loader Server.


Maximum Permitted Number of Errors: -E (SAP Library - SAP DB)

 Entering content frame

Function documentation Maximum Permitted Number of Errors: -E

Option for calling the Loader with LOADERCLI for transferring the permissible number of errors

Syntax

-E <number>

<number>

Permitted number of commands with errors

Prerequisite

At the same time, you use the option –b to specify a command file. This option is ignored in the interactive operating mode.

Use

You use this option to specify after how many commands with errors the Loader stops processing the command file.


Output File: - o[w|a] (SAP Library - SAP DB)

 Entering content frame

Function documentation Output File: - o[w|a]

Option for calling the Loader with LOADERCLI for specifying the output file

Syntax

-o[w|a] <file_name>

<file_name>

Name of the file to which the output of the SAP DB Loader is to be written
Default value: Screen

Prerequisite

At the same time, you use the option –b to specify a command file. If you specify this option in the interactive operating mode, an error is generated.

Use

The output of the SAP DB Loader is written to the specified file.

Option -ow

The file is opened and any existing entries are deleted.

Option -oa

The file is opened and the outputs are appended to the end of the file without any existing entries being deleted.

This option refers only to output from the Loader. Despite this, the program still writes a log file.


Substitution Parameter: -p (SAP Library - SAP DB)

 Entering content frame

Function documentation Substitution Parameter: -p

Option for calling the SAP DB Loader with LOADERCLI for transferring a substitution parameter

Syntax

-p<number> <substitution_value>

<number> | Defines the number n of the placeholder you want to substitute in the command file, where 1<=n<=9.
<substitution_value> | Value that substitutes the placeholder in the command file

Prerequisite

At the same time, you use the option –b to specify a command file. This option is ignored in the interactive operating mode.

Use

Use this option to specify values for placeholders in the command file. These values can be any character strings. You can specify nine different parameters (and placeholders) for each command file.

In the command file, enter the placeholder in the form &<number>.

Entry in the command file:

DATAEXTRACT FOR DATALOAD TABLE customer OUTFILE '&1' OUTFILE 'customer.data'
DATAEXTRACT FOR FASTLOAD TABLE article OUTFILE '&1' APPEND OUTFILE 'article.data'

You can specify the name of the command file with the call of the SAP DB Loader CLI, using the option –p :

loadercli ... –p1 command.dat


InstRoot Directory: -R (SAP Library - SAP DB)

 Entering content frame

Function documentation InstRoot Directory: -R

Option for calling the Loader with LOADERCLI for setting up the connection to the Loader

Syntax

-R <dependent_path>

<dependent_path>

Name of the directory (InstRoot) on the server of the Loader that contains the programs that are dependent on the version of the database software
Default value: none

Use

If multiple versions of the Loader are installed on the server, you can start a specific version of the Loader. If you do not specify a directory name, the Loader for the newest version of the database software is started.


Loader Version: -V (SAP Library - SAP DB)

 Entering content frame

Function documentation Loader Version: -V

Option when calling the Loader with LOADERCLI to determine the version of the Loader Server

Syntax

-V


LOADERCLI Version: -v (SAP Library - SAP DB)

 Entering content frame

Function documentation LOADERCLI Version: -v

Option when calling the Loader with LOADERCLI to determine the version of the client of the Loader CLI (LOADERCLI)

Syntax

-v


Help: -h (SAP Library - SAP DB)

 Entering content frame

Function documentation Help: -h

Option for displaying information (help) for all available options when calling the Loader with LOADERCLI

Syntax

-h


Command File (SAP Library - SAP DB)

 Entering content frame

Background documentation Command File

When you call the Loader with the LOADERCLI, you can store the commands and SQL statements that are to be evaluated in a special file, the command file.

When you call the Loader, you specify the option –b to pass the name of the command file to the Loader.

loadercli -d demodb -u sqltravel01,travel01 -n DBHost -b command.dat

The commands and SQL statements are in the file command.dat.

Use

The commands and SQL statements in the command file that you specify are individually processed by the Loader in the specified order.

See also:

Syntax Rules for Command Files


Syntax Rules for Commands Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Syntax Rules for Command Files

Note the following syntax rules for command files.

General Syntax Rules for Calling the Loader

Syntax Rules for Calling the Loader

Delimiting Lines Between Commands

Individual commands in a command file are separated by a line, at the beginning of which there is a double forward slash //.

Comments

After a double forward slash // at the start of the line, you can enter comments. The comments are ignored by the Loader during the processing of the command file.

CREATE TABLE customer
(cno      FIXED(4) CONSTRAINT cno BETWEEN 1 AND 9999   KEY,
 salutn   CHAR(7)  CONSTRAINT salutn IN ('Mr', 'Ms', 'company'),
 name     CHAR(10) NOT NULL,
 zip      CHAR(5)  CONSTRAINT SUBSTR(zip_dom,1,5) LIKE '(0-9)(0-9)(0-9)(0-9)(0-9)',
 address  CHAR(25) NOT NULL)
//
FASTLOAD TABLE customer
  cno           1
  name          2
  zip           3
  address       4
INFILE 'customer.data'
//create index
CREATE INDEX customer_index ON customer (name)
//
DATAEXTRACT cno, name, zip, address from customer
OUTFIELDS
  cno           1
  name          2
  zip           3
  address       4
OUTFILE 'newcustomer.data'


Call with the Perl Interface of the Loader (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Call with the Perl Interface of the Loader

You can call the Loader by processing a Perl script.

Prerequisites

Perl is installed on the host.

The following Perl modules are delivered with the Loader program, and allow you to create Perl scripts that can be processed by the Loader.

· Microsoft Windows 2000: loaderaperl.dll, loader.pm, instperl.pl

· UNIX: loadercperl.so, loader.pm, instperl.pl

· HP : loadercperl.sl, loader.pm, instperl.pl

Open the instperl.pl file. When you do this, the files are copied to the relevant directories.

Call

perl <perl_script_file> [<argument> ...]

You have the option of specifying arguments <argument>.

Frequently used arguments:

<user_name>
<password>

User name (see Database User)
Password
The database system converts the user name and password into uppercase letters automatically.

<database_name>

Name of database instance

<data_path>

Directory in which the data file is stored

<server_node>

Name of the server on which the Loader is located

perl sample samplename secret TST C:\data\sapdb

The Perl script sample is called. The logon to the Loader is performed for the user samplename on the database instance TST. The data file is in the directory C:\data\sapdb.

Template for Background Files

The following section contains examples of background files in Perl. Their equivalents in the Python script language are also provided for comparison.

Example 1 Build a Perl module with reference to the SAP DB Perl Libraries, parse the call arguments | Perl | Python
Example. 2 Set up a database session with the Loader Log on to the database instance, Log off | Perl | Python
Example no. 3 Start a database session Log on to the database instance Query error code to determine whether table exists Create a table without querying the error code Log off | Perl | Python
Example no. 4 Start a database session Log on to the database instance Create a table and query the error code Load data into the table using commands and query the error code Log off | Perl | Python
Example no. 5 Start a database session Log on to the database instance Load data to the table using commands and intercept exceptions Log off | Perl | Python

Perl Classes


Perl Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Perl Classes

Use the following classes to call the SAP DB Loader with Perl scripts:

· Loader Class

· Exception Classes


Perl: Loader Class (SAP Library - SAP DB)

 Entering content frame

Background documentation Perl: Loader Class

Constructor: Loader (<server_node>, <database_name>)

<server_node> | Server node name
<database_name> | Name of database instance

Creation of a connection to the Loader

If the server node name and name of the database instance are specified, the system assumes that the database instance, data, and Loader are located on a remote server.

If only the name of the database instance is specified, the system assumes that the database instance, data, and Loader are located on the local server. The suitable Loader is determined from the version of the specified database instance.

If neither the server node name nor the name of the database instance is specified, the system establishes a connection to the newest Loader on the local system.

The session is closed again when the object is deleted with undef $session.

$session = loader::Loader ('p12345', 'mydb')

Method: cmd (<command_string>)

An SQL statement or Loader command is executed.

The script is terminated if the command fails.

$output = $session->cmd ("DATALOAD TABLE customer".
                        "cno       1-4".
                        "name  6-12".
                        "zip       14-18".
                        "city      20-31".
                        "INFILE '$data_path\customer.dat' ")

Method: sql (<command_string>)

An SQL statement or a Loader command is executed.

If a command fails, execution of the script is terminated.

If an SQL statement fails, a return code is output.

$result = $session->sql ('EXISTS TABLE MYTABLE')


Perl: Exception Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Perl: Exception Classes

An exception is a string beginning with either CommunicationError or LoaderServError.

LoaderServError: 25011 SQL error -3005 = Invalid SQL Statement

Example of use in a script:

eval {$session->cmd ('complete nonsense;') };
if ($@) { print "command failed: $@\n"; }

Print output:

command failed: LoaderServError: 25011 SQL error -3005 = Invalid SQL Statement


Perl: Example 1 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Perl: Example 1

Example of Calling the Loader with Perl Script

Build a Perl module with reference to the SAP DB Perl Libraries,
parse the call arguments:

# Reference to the SAP DB Perl Library
# ------------------------------------

use SAP::DBTECH::loader;

# Parse the call arguments
# ------------------------

$user_name = $ARGV[0];
$password = $ARGV[1];
$database_name = $ARGV[2];
$data_path = $ARGV[3];
$server_node = "localhost";


Perl: Example 2 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Perl: Example 2

Example of Calling the Loader with Perl Script

Start a database session with the Loader,
Log on to the database instance,
Log off

# Reference to the SAP DB Perl Library
# ------------------------------------

use SAP::DBTECH::loader;

# Parse the call arguments
# ------------------------

$user_name = $ARGV[0];
$password = $ARGV[1];
$database_name = $ARGV[2];
$data_path = $ARGV[3];
$server_node = "localhost";

# Create a database session for the Loader
# -------------------------------------------

$session = loader::Loader ($server_node, $database_name);

# Log on to the database instance
# --------------------------------

$session->cmd("use user $user_name $password;");

# Log off
# --------

undef $session


Perl: Example 3 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Perl: Example 3

Example of Calling the Loader with Perl Script

Start a database session,
Log on to the database instance,
Query error code to determine whether table exists
Create a table without querying the error code
Log off

# Reference to the SAP DB Perl Library
# ------------------------------------

use SAP::DBTECH::loader;

# Parse the call arguments
# ------------------------

$user_name = $ARGV[0];
$password = $ARGV[1];
$database_name = $ARGV[2];
$data_path = $ARGV[3];
$server_node = "localhost";

# Create a database session for the Loader
# -------------------------------------------

$session = loader::Loader ($server_node, $database_name);

# Log on to the database instance
# --------------------------------

$session->cmd("use user $user_name $password;");

# Query whether the table exists by querying the error code
# The sql method is used to do this
# -------------------------------------

$rc = $session->sql('EXISTS TABLE CUSTOMER')

If $rc!=0

# Create the table CUSTOMER
# -------------------------

$session->cmd ( 'CREATE TABLE customer ( '.
                    'cno             FIXED(4), '.
                    'name            CHAR(10) ASCII, '.
                    'zip             CHAR(5)  ASCII, '.
                    'city            CHAR(12) ASCII, '.
                    'PRIMARY KEY (cno) ')

# End the database session
# ----------------------------

undef $session


Perl: Example 4 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Perl: Example 4

Example of Calling the Loader with Perl Script

Start a database session
Log onto the database instance
Create a table and query the error code
Load data to the table using Loader commands and query the error code
Log off

# Reference to the SAP DB Perl Library
# ------------------------------------

use SAP::DBTECH::loader;

# Parse the call arguments
# ------------------------

$user_name = $ARGV[0];
$password = $ARGV[1];
$database_name = $ARGV[2];
$data_path = $ARGV[3];
$server_node = "localhost";

# Create a database session for the Loader
# -------------------------------------------

$session = loader::Loader ($server_node, $database_name);

# Log on to the database instance
# --------------------------------

$session->cmd("use user $user_name $password;");

$rc = $session->sql('EXISTS TABLE CUSTOMER')

If $rc!=0

# Create the table CUSTOMER
# -------------------------

$session->cmd ( 'CREATE TABLE customer ( '.
                    'cno             FIXED(4), '.
                    'name            CHAR(10) ASCII, '.
                    'zip             CHAR(5)  ASCII, '.
                    'city            CHAR(12) ASCII, '.
                    'PRIMARY KEY (cno) ')

print $rc

If $rc==0

# Load the table CUSTOMER
# -------------------------

$loadrc = $session->cmd ("DATALOAD TABLE customer ".
                           "cno       1-4   ".
                           "name      6-12  ".
                           "zip       14-18 ".
                           "city      20-31 ".
                           "INFILE $data_path\customer.dat" )

print $loadrc

# End the database session
# ----------------------------

undef $session


Perl: Example 5 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Perl: Example 5

Example of Calling the Loader with Perl Script

If a command is changed at runtime, for example, because user inputs are part of the command, syntax errors can easily occur.
The SQL method only provides SQL error codes. You need exceptions to intercept syntax errors in the DATALOAD command.

Start a database session
Log on to the database instance
Load data to the table using Loader commands and intercept exceptions
Log off

An incorrect data path in the following example can lead to a syntax error or data access error.

# Reference to the SAP DB Perl Library
# ------------------------------------

use SAP::DBTECH::loader;

# Parse the call arguments
# ------------------------

$user_name = $ARGV[0];
$password = $ARGV[1];
$database_name = $ARGV[2];
$data_path = $ARGV[3];
$server_node = "localhost";

# Create a database session for the Loader
# -------------------------------------------

$session = loader::Loader ($server_node, $database_name);

# Log on to the database instance
# --------------------------------

$session->cmd("use user $user_name $password;");

# Example of Exception Handling
# -----------------------------

eval{
    $loadrc=$session->sql ("DATALOAD TABLE customer ".
                            "cno       1-4    ".
                           "name      6-12  ".
                           "zip       14-18 ".
                            "city      20-31  ".
                            "INFILE $data_path\customer.dat" );
    print "$loadrc\n";}
if ($@){
    print "command failed: $@\n";
}

# End the database session
# ----------------------------

undef $session


Call with the Python Interface of the Loader (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Call with the Python Interface of the Loader

You can call the Loader by processing a Python script.

Prerequisites

The following Python modules are delivered with the Loader program, and allow you to create Python scripts that can be processed by the Loader.

· Microsoft Windows 2000: loader.pyd

· UNIX: loadermodule.so

· HP: loadermodule.sl

These are the modules you need to use the Loader functions. You do not need a complete PYTHON installation.

If you already have a PYTHON installation, add %INSTROOT%\misc to the PYTHONPATH variable.

The Loader supports PYTHON as of version 1.5.2.

Call

x_python <python_script_file> [<argument>...]

You have the option of specifying arguments <argument>.

Frequently used arguments:

<user_name>
<password>

User name (see Database User)
Password
The database system converts the user name and password into uppercase letters automatically.

<database_name>

Name of database instance

<data_path>

Directory in which the data file is stored

<server_node>

Name of the server on which the Loader is located

X_python sample samplename secret TST C:\data\sapdb

The Python script sample is called. The logon to the Loader is performed for the user samplename on the database instance TST. The data file is in the directory C:\data\sapdb.

Template for Background Files

The following section contains examples of background files in Python. Their equivalents in the Perl script language are also provided for comparison.

Example 1 Build a Python module with reference to the SAP DB Python Libraries, parse the call arguments | Python | Perl
Example. 2 Set up a database session with the Loader Log on to the database instance, Log off | Python | Perl
Example no. 3 Start a database session Log on to the database instance Query error code to determine whether table exists Create a table without querying the error code Log off | Python | Perl
Example no. 4 Start a database session Log on to the database instance Create a table and query the error code Load data into the table using commands and query the error code Log off | Python | Perl
Example no. 5 Start a database session Log on to the database instance Load data to the table using commands and intercept exceptions Log off | Python | Perl

Python Classes


Python Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Python Classes

Use the following classes to Call the SAP DB Loader with Python Scripts :

· Loader Class

· Exception Classes


Python: Loader Class (SAP Library - SAP DB)

 Entering content frame

Background documentation Python: Loader Class

Constructor: Loader (<server_node>, <database_name>)

<server_node> | Server node name
<database_name> | Name of database instance

Creation of a connection to the Loader

If the server node name and name of the database instance are specified, the system assumes that the database instance, data, and Loader are located on a remote server.

If only the name of the database instance is specified, the system assumes that the database instance, data, and Loader are located on the local server. The suitable Loader is determined from the version of the specified database instance.

If neither the server node name nor the name of the database instance is specified, the system establishes a connection to the newest Loader version on the local system.

The session is closed again when the object is deleted with del session.

session = loader.Loader ('p12345', 'mydb')

Method: cmd (<command_string>)

An SQL statement or Loader command is executed.

The script is terminated if the command fails.

output = session.cmd (""" DATALOAD TABLE customer
                     cno       1-4
                     name      6-12
                     zip      14-18
                     city     20-31
                     INFILE '%s\customer.dat' """ %data_path)

Method: sql (<command_string>)

An SQL statement or a Loader command is executed.

If a command fails, execution of the script is terminated.

If an SQL statement fails, a return code is output.

result = session.sql ('EXISTS TABLE MYTABLE')


Python: Exception Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Python: Exception Classes

Class: CommunicationError

The creation of the connection to the SAP DB Loader failed.

The value of the exception is an instance with the following attributes:

  • errorCode
  • message

Class: LoaderServError

The command failed.

The value of the exception is an instance with the following attributes:

  • errorCode (Loader error number)
  • message (Loader error text)
  • sqlCode (SQL error number if an SQL command fails, otherwise 0)
  • sqlMessage (SQL error text if an SQL command fails, otherwise 0)


Python: Example 1 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Python: Example 1

Example of calling the Loader with Python Script

Build a Python module with reference to the SAP DB Python Libraries
Parse the call arguments

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# ------------------------

user_name = sys.argv [1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''


Python: Example 2 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Python: Example 2

Example of calling the Loader with Python Script

Start a database session with the Loader,
Log on to the database instance,
Log off

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# ------------------------

user_name = sys.argv

[1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''

# Create a database session for the Loader
# ----------------------------------------

session = loader.Loader (server_node, database_name)

# Log on to the database instance
# --------------------------------

session.cmd ('use user %s %s;' % (user_name, password))

# Log off
# --------

del session


Python: Example 3 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Python: Example 3

Example of calling the Loader with Python Script

Start a database session,
Log on to the database instance,
Query error code to determine whether table exists
Create a table without querying the error code
Log off

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# ------------------------

user_name = sys.argv

[1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''

# Create a database session for the Loader
# ----------------------------------------

session = loader.Loader (server_node, database_name)

# Log on to the database instance
# --------------------------------

session.cmd ('use user %s %s;' % (user_name, password))

# Query whether the table exists by querying the error code
# The sql method is used to do this
# -------------------------------------

rc = session.sql("EXISTS TABLE CUSTOMER")

If rc!=0

   # Then branch of the If statement must be indented in Python
   # Create the table CUSTOMER
   # ----------------------------------------------------------

   session.cmd ( """CREATE TABLE CUSTOMER (
                       CNO             FIXED(4),
                       NAME            CHAR(10) ASCII,
                       ZIP             CHAR(5)  ASCII,
                       CITY            CHAR(12)  ASCII,
                       PRIMARY KEY (CNO) """)

session.cmd ("COMMIT")

# End the database session
# ------------------------

del session


Python: Example 4 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Python: Example 4

Example of calling the Loader with Python Script

Start a database session
Log on to the database instance
Create a table and query the error code
Load data to the table using Loader commands and query the error code
Log off

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# ------------------------

user_name = sys.argv

[1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''

# Create a database session for the Loader
# ----------------------------------------

session = loader.Loader (server_node, database_name)

# Log on to the database instance
# --------------------------------

session.cmd ('use user %s %s;' % (user_name, password))

# Query whether the table exists by querying the error code
# The sql method is used to do this
# -------------------------------------

rc = session.sql("EXISTS TABLE CUSTOMER")

If rc!=0

   # Then branch of the If statement must be indented in Python
   # Create the table CUSTOMER
   # ----------------------------------------------------------

   rc = session.sql( """CREATE TABLE customer (
                       cno             FIXED(4),
                       name            CHAR(10) ASCII,
                       zip             CHAR(5)  ASCII,
                       city            CHAR(12) ASCII,
                       PRIMARY KEY (cno) """)

print rc

If rc==0

   # Then branch of the If statement must be indented in Python
   # Load the table CUSTOMER
   # ----------------------------------------------------------

   loadrc = session.sql ("""DATALOAD TABLE customer
                            cno       1-4
                            name      6-12
                            zip       14-18
                            city      20-31
                            INFILE %s\customer.dat""" %data_path )
   print loadrc

session.cmd ("COMMIT")

# End the database session
# ------------------------

del session


Python: Example 5 (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Python: Example 5

Example of calling the Loader with Python Script

If a command is changed at runtime, for example, because user inputs are part of the command, syntax errors can easily occur.
The SQL method only provides SQL error codes. You need exceptions to intercept syntax errors or other Loader errors in the commands.

Start a database session
Log on to the database instance
Load data to the table using Loader commands and intercept exceptions
Log off

# Reference to the Python Libraries
# ---------------------------------

import sys
import loader

# Parse the call arguments
# ------------------------

user_name = sys.argv

[1]
password = sys.argv [2]
database_name = sys.argv [3]
data_path = sys.argv[4]
server_node = ''

# Create a database session for the Loader
# -------------------------------------------

session = loader.Loader (server_node, database_name)

# Log on to the database instance
# --------------------------------

session.cmd ('use user %s %s;' % (user_name, password))

# Example of Exception Handling
# -----------------------------

try:

  loadrc = session.sql ("""DATALOAD TABLE customer
                             cno       1-4
                             name      6-12
                             zip      14-18
                             city     20-31
                             INFILE %s\customer.dat""" %data_path )
  print "'%s'" % loadrc

except loader.LoaderServError, err:

print 'command failed:', err

# End the database session
# ------------------------

del session


Call with the Java Interface of the Loader (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Call with the Java Interface of the Loader

You can call the Loader using Java.

Prerequisites

Java is installed on the server.

The following Java modules are delivered with the Loader program:

com.sap.dbtech.powertoys.Loader

com.sap.dbtech.powertoys.LoaderException

For a description of the modules, see Java Classes.


Java Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Java Classes

Use the following classes to call the SAP DB Loader with Java:

· Loader Class

· Exception Classes


Java: Loader Class (SAP Library - SAP DB)

 Entering content frame

Background documentation Java: Loader Class

The following Java module is delivered with the SAP DB Loader program:

com.sap.dbtech.powertoys.Loader

public class Loader extends java.lang.Object

With the Loader class, you can create new Loader object instances and execute SQL statements or Loader commands.

Constructor: Loader

public Loader(java.util.Properties properties) throws RTEException

A new Loader object instance is created. The Loader class uses the following properties:

· host: The Loader is started on this host.

· dbname: The Loader is started for the specified database instance.

· dbroot: The Loader is started for this version/in this directory.

Method: cmd

public java.lang.String cmd(java.lang.String cmdString) throws RTEException, LoaderException

An SQL statement or a Loader command ( cmdString) is executed.

Method: dbLoader

public static Loader dbloader(java.lang.String host, java.lang.String dbname) throws RTEException

A new Loader object instance is created by specifying the host name ( host) and the name of the database instance ( dbname).

Method: dbrootLoader

public static Loader dbrootloader(java.lang.String host, java.lang.String dbroot) throws RTEException

A new Loader object instance is created in which the host name ( host) and the dbroot directory are specified.

Method: finalize

public void finalize() throws RTEException

This method overwrites the method finalize() of the class java.lang.Object.

Method: release

public void release() throws RTEException

The Loader session is ended.


Java: Exception Classes (SAP Library - SAP DB)

 Entering content frame

Background documentation Java: Exception Classes

The following Java module is delivered with the SAP DB Loader program:

com.sap.dbtech.powertoys.LoaderException

public class LoaderException extends java.lang.

If a Loader command fails, the Loader exception is output.

Method: getErrorCode

public int getErrorCode()

The error code set by the Loader is returned.

Method: getErrorID

public java.lang.String getErrorID()

The error number set by the Loader is returned.

Method: toString

public java.lang.String toString()

The exception is output as a string object.


Syntax Rules for Calling the Loader (SAP Library - SAP DB)

 Entering content frame

Background documentation Syntax Rules for Calling the Loader

Not the following general syntax rules when you call the Loader.

Upper- and Lowercase Characters

A distinction is not made between upper- and lowercase characters. The Loader converts all names to uppercase characters internally, unless you place character strings in double quotation marks.

Keywords

Both the keywords of the Loader and SQL keywords can be used to denote database objects if they are placed in single or double quotation marks.


Log Functions (SAP Library - SAP DB)

 Entering content frame

Background documentation Log Functions

The Loader logs its actions in a log file and in system tables.

· Log File

· System Tables

Unloading or loading a database takes some time, depending on the volume of data. The Loader can restart the action if it is interrupted. To do this, the information in the system tables is evaluated.


Log File (SAP Library - SAP DB)

 Entering content frame

Background documentation Log File

One important log function of the Loader is creating and managing a log file.

When you start the Loader, a log file is created or updated. The name of this log file is loader.prt. The file is stored in the directory <independent_data_path>\wrk of the database instance.

The following information is logged in the log file:

· Database instance and user name

· Time at which a load or unload action starts and ends

· All executed SQL statements

· All executed load commands
– For each load command, the position of the rejected input records in the medium and the cause of error
- For each load command, the accumulated counts (inserted/modified lines and rejected lines)

· All executed unload commands
For each DATAEXTRACT command, the accumulated counts (number of extracted lines, and the number of lines extracted with errors)

· A message if the action was terminated

The log file is structured in such a way that parts of it can be easily used to create a command file.

All comments start in a new record with // * or // <letter> and are ignored by the Loader.

Special comment lines:

// M | Line with messages These are informative system messages, such as the number of lines inserted and rejected, last completed transaction, and so on.
// E | Line with error messages This is used to introduce the two lines with the table and position values as well as the error number or error text for rejected lines.
// R | Line with REMARK comment These are comments that the user specified using the REMARK command.


CODEPAGE (SAP Library - SAP DB)

 Entering content frame

Object documentation CODEPAGE

The system table CODEPAGE contains the conversion tables that are used by the Loader for the conversion.

Table Structure

CREATE TABLE SYSDBA.CODEPAGE
    (CODEPAGEID CHAR (32)  NOT NULL,
     CODEPAGETABLE CHAR (512) BYTE NOT NULL,
     PRIMARY KEY (CODEPAGEID))

Column | Explanation
CODEPAGEID | Name of code pages (ISO-8859-2, for example)
CODEPAGETABLE | Conversion table from ASCII to UCS2 for each code page

Content

The system table CODEPAGE is preconfigured. The CODEPAGE column contains 27 entries when it is delivered:

ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14, ISO-8859-15, ISO-8859-16, WINDOWS-874, WINDOWS-932, WINDOWS-936, WINDOWS-949, WINDOWS-950, WINDOWS-1250, WINDOWS-1251, WINDOWS-1252, WINDOWS-1253, WINDOWS-1254, WINDOWS-1255, WINDOWS-1256, WINDOWS-1257.

The default value of the Loader (code page ISO-8859-1) is not in the table.

Use

See code_page_spec


TRANSFORMATIONMODEL (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONMODEL

The SAP DB Loader system table TRANSFORMATIONMODEL contains all entries about transformations that span more than one table. After a successful transformation, these entries are unloaded to a data stream or deleted.

TRANSFORMATIONMODEL

PACKAGEGUID | CHAR(24) BYTE | Unique ID of the transformation package
TASKID | FIXED(6.0) | ID of the transformation task
SERVERNODE | CHAR(32) | Server node on which the database instance to be transformed is installed
SERVERDB | CHAR(32) | Name of the database instance that is to be transformed
CODETYPE | CHAR(32) | Code type of the database instance (ASCII | UNICODE)
USERNAME | CHAR(32) | User name
CODEPAGEID | CHAR(32) | ID of the ASCII code page that is to be used
STORAGEDEVICE | CHAR(32) | External storage medium that is to be used
TRANSACTIONSIZE | FIXED(6.0) | Minimum number of rows that are to be transformed before the status of the transformation step is logged
TRANSFORMATION | CHAR(32) | Transformation type (EXTRACT | LOAD | UPDATE)
PART | CHAR(32) | Parts of the database catalog (ALL | USER | TABLE)
STEPID | FIXED(6.0) | ID of the transformation step
OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Table name
TABLETYPE | CHAR(8) | Table type (TABLE | VIEW | SYNONYM)
CATALOGSTREAMNAME | CHAR(254) | ID of the CATALOG data stream
CATALOGSTREAMTYPE | CHAR(32) | Medium of the CATALOG data stream (FILE | PIPE | TAPE)
CATALOGSTREAMEBID | CHAR(32) | External backup ID of the CATALOG data stream
CATALOGSTREAMFORMAT | CHAR(32) | Format of the CATALOG data stream (DDL | XML)
DATASTREAMNAME | CHAR(254) | ID of the DATA data stream
DATASTREAMTYPE | CHAR(32) | Medium of the DATA data stream (FILE | PIPE | TAPE)
DATASTREAMEBID | CHAR(32) | External backup ID of the DATA data stream
DATASTREAMFORMAT | CHAR(32) | Format of the DATA data stream (PAGES | RECORDS | COMPRESSED | FORMATTED)
DATASTREAMHEADERBLOCK | FIXED(6.0) | Start position of the header of the DATA data stream (in 2 GB blocks)
DATASTREAMHEADERPOS | FIXED(10.0) | Start position of the header of the DATA data stream (in bytes, less than 2 GB)
DATASTREAMDATABLOCK | FIXED(6.0) | Start position of the data of the DATA data stream (in 2 GB blocks)
DATASTREAMDATAPOS | FIXED(10.0) | Start position of the data of the DATA data stream (in bytes, less than 2 GB)
DATASTREAMTRAILEBLOCK | FIXED(6.0) | Start position of the trailer of the DATA data stream (in 2 GB blocks)
DATASTREAMTRAILERPOS | FIXED(10.0) | Start position of the trailer of the DATA data stream (in bytes, less than 2 GB)
EXCLUDE | BOOLEAN | Transformation step was excluded (TRUE) or not (FALSE)
RESTART | BOOLEAN | Transformation step was executed (TRUE) or not (FALSE)
RESTORE | BOOLEAN | Transformation command was generated (TRUE) or not (FALSE)
PAGECOUNT | FIXED(10.0) | Number of pages that were transformed during a transformation step
ROWCOUNT | FIXED(10.0) | Number of rows that were transformed during a transformation step
STARTTIME | TIMESTAMP | Start of the transformation step
ENDTIME | TIMESTAMP | End of the transformation step
REQUESTTIME | FIXED(15.10) | Total execution time of a kernel request within a transformation step
RECEIVETIME | FIXED(15.10) | Total execution time of a kernel reply within a transformation step
IOTIME | FIXED(15.10) | Total I/O time within a transformation step
LOGTIME | FIXED(15.10) | Total time required for the management of actions within a transformation step
SEQ_NO | FIXED(6.0) | Sequence number with which split GRANT statements can be assigned to each other
CMD | CHAR(254) | Authorization statement


TRANSFORMATIONMONITOR (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONMONITOR

The SAP DB Loader system table TRANSFORMATIONMONITOR describes the resource usage of a transformation.

TRANSFORMATIONMONITOR

PACKAGEGUID | CHAR(24) | Unique ID of the transformation package
ROWCOUNT | FLOAT(38) | Number of transformed rows
TRANSACTIONSIZE | FIXED(6.0) | Minimum number of rows that are to be transformed before the status of the transformation step is logged
SYSTEMDURATION | FLOAT(38) | System performance
KERNELDURATION | FLOAT(38) | Kernel performance
LOADERDURATION | FLOAT(38) | Loader performance
DATADURATION | FLOAT(38) | Pager performance
LOGDURATION | FLOAT(38) | Total time required for the management of actions within a transformation step
IODURATION | FLOAT(38) | Total I/O time within a transformation step


TRANSFORMATIONPACKAGES (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONPACKAGES

The SAP DB Loader system table TRANSFORMATIONPACKAGES contains all steps of a transformation for a transformation package.

TRANSFORMATIONPACKAGES

PACKAGEGUID | CHAR(24) BYTE | Unique ID of the transformation package
TASKID | FIXED(6.0) | ID of the transformation task
STEPID | FIXED(6.0) | ID of the transformation step
OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Table name
EXCLUDE | BOOLEAN | Transformation step was excluded (TRUE) or not (FALSE)
RESTART | BOOLEAN | Transformation step was executed (TRUE) or not (FALSE)


TRANSFORMATIONRESOURCES (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONRESOURCES

The SAP DB Loader system table TRANSFORMATIONRESOURCES describes the data sources and data targets involved in a transformation.

TRANSFORMATIONRESOURCES

Column name | Data Type | Explanation
PACKAGEGUID | CHAR(24) BYTE | Unique ID of the transformation package
SERVERNODE | CHAR(32) | Server node on which the database instance to be transformed is installed
SERVERDB | CHAR(32) | Name of the database instance that is to be transformed
USERNAME | CHAR(32) | User name
CODEPAGEID | CHAR(32) | ID of the ASCII code page that is to be used
STORAGEDEVICE | CHAR(32) | External storage medium that is to be used
CATALOGSTREAMNAME | CHAR(254) | ID of the CATALOG data stream
CATALOGSTREAMTYPE | CHAR(32) | Medium of the CATALOG data stream (FILE | PIPE | TAPE)
CATALOGSTREAMEBID | CHAR(32) | External backup ID of the CATALOG data stream
DATASTREAMNAME | CHAR(254) | ID of the DATA data stream
DATASTREAMTYPE | CHAR(32) | Medium of the DATA data stream (FILE | PIPE | TAPE)
DATASTREAMEBID | CHAR(32) | External backup ID of the DATA data stream


TRANSFORMATIONSTATISTICS (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONSTATISTICS

The SAP DB Loader system table TRANSFORMATIONSTATISTICS describes the resource usage of a step of a transformation.

TRANSFORMATIONSTATISTICS

PACKAGEGUID | CHAR(24) BYTE | Unique ID of the transformation package
STEPID | FIXED(6.0) | Ascending number for each transformation package
OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Table name
BYTECOUNT | FIXED(11.0) | Size of the DATA data stream in bytes
ROWCOUNT | FIXED(10.0) | Number of table rows in the DATA data stream
TRANSACTIONSSIZE | FIXED(6.0) | Minimum number of rows that are to be transformed before the status of the transformation step is logged
SYSTEMTIME | FLOAT(38) | Transformation performance
KERNELTIME | FIXED(20.10) | Kernel performance
LOADERTIME | FLOAT(38) | Loader performance
DATATIME | FLOAT(38) | Pager performance
LOGTIME | FIXED(15.10) | Total time required for the management of actions within a transformation step
IOTIME | FIXED(15.10) | Total I/O time within a transformation step


TRANSFORMATIONSTEPS (SAP Library - SAP DB)

 Entering content frame

Object documentation TRANSFORMATIONSTEPS

THE SAP DB Loader system table TRANSFORMATIONSTEPS describes a transformation at table level.

TRANSFORMATIONSTEPS

PACKAGEGUID | CHAR(24) BYTE | Unique ID of the transformation package
TRANSFORMATION | FIXED(6.0) | Transformation type (EXTRACT | LOAD | UPDATE)
OWNER | CHAR(32) | Owner of the table
TABLENAME | CHAR(32) | Table name
CATALOGSTREAMNAME | CHAR(254) | ID of the CATALOG data stream
CATALOGSTREAMFORMAT | CHAR(32) | Format of the CATALOG data stream (DDL | XML)
DATASTREAMNAME | CHAR(254) | ID of the DATA data stream
DATASTREAMFORMAT | CHAR(32) | Format of the DATA data stream (PAGES | RECORDS | COMPRESSED | FORMATTED)
DATASTREAMHEADERBLOCK | FIXED(6.0) | Start position of the header of the DATA data stream (in 2 GB blocks)
DATASTREAMHEADERPOS | FIXED(10.0) | Start position of the header of the DATA data stream (in bytes, less than 2 GB)
DATASTREAMDATABLOCK | FIXED(6.0) | Start position of the data of the DATA data stream (in 2 GB blocks)
DATASTREAMDATAPOS | FIXED(10.0) | Start position of the data of the DATA data stream (in bytes, less than 2 GB)
DATASTREAMTRAILERBLOCK | FIXED(6.0) | Start position of the trailer of the DATA data stream (in 2 GB blocks)
DATASTREAMTRAILERPOS | FIXED(10.0) | Start position of the trailer of the DATA data stream (in bytes, less than 2 GB)
RESTART | BOOLEAN | Transformation step was executed (TRUE) or not (FALSE)
START | FIXED(10.0) | Number of transformed rows


Commands (SAP Library - SAP DB)

 Entering content frame

Background documentation Commands

Each Loader command comprises one or more keywords, arguments, and options.These commands can be divided into commands for creating a database session and commands for unloading and loading data.

Command Overview

AUTOCOMMIT
CATALOGEXTRACT
CATALOGLOAD
DATAEXTRACT
DATALOAD
DATAUPDATE
DBEXTRACT
DBLOAD
FASTLOAD
SET
SQLMODE
TABLEEXTRACT
TABLELOAD
USE SERVERDB
USE USER

Syntax Elements

Syntax Rules for Commands

Keywords


AUTOCOMMIT Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation AUTOCOMMIT Command

You use this command for setting up a database session to activate/deactivate AUTOCOMMIT mode for a database session.

Syntax

<autocommit_statement> :: = AUTOCOMMIT ON | AUTOCOMMIT OFF

AUTOCOMMIT ON

The AUTOCOMMIT mode is activated (Loader default value).

With commands for loading data, a COMMIT is used to complete the insertion of a certain number of data records. The user can determine this number using the SET TRANSACTION SIZE command. This mode is not relevant when data is unloaded, because the table contents in the database are not modified.

If you execute COMMIT and ROLLBACK statements when AUTOCOMMIT mode is activated, the SAP DB Loader ignores these statements.

The Loader terminates each SQL statement implicitly with a COMMIT.

AUTOCOMMIT OFF

AUTOCOMMIT mode is deactivated.

All transactions must be terminated explicitly using a COMMIT.

You can group commands in units so that they can be completed or reset at once.

This mode does not apply to the commands FASTLOAD, TABLEEXTRACT, and TABLELOAD, as these commands run outside the transaction concept of the database and are therefore always implicitly terminated with a COMMIT by the Loader.

Large transactions (such as a large number of data records to be loaded) require a correspondingly large log area.


CATALOGEXTRACT Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation CATALOGEXTRACT Command

You can use this Loader command to control the unloading of the entire database catalog or parts of it.

Syntax

<catalogextract_statement> ::= CATALOGEXTRACT <part_spec > <outstream_spec >

You can also use the keywords EXTRACT CATALOG instead of the keyword CATALOGEXTRACT.

Prerequisites

The command CATALOGEXTRACT ALL can only be executed by the SYSDBA user.

Use

<part_spec>

· CATALOGEXTRACT ALL
The data stream <outstream_spec> contains all commands for creating a database session and SQL statements for data definition that are required for the definition of the entire database catalog.
You can use external backup tools to unload data.

· CATALOGEXTRACT USER
The data stream <outstream_spec> contains all commands for creating a database session and SQL statements for data definition that are required for the definition of the parts of the database catalog that belong to the specified user.

· CATALOGEXTRACT TABLE
The specified table is a base table. The user is the owner of this table.
The data stream <outstream_spec> contains all SQL statements for data definition that are required for the definition of the table and the database catalog objects connected to it.

Data Stream: <outstream_spec>

During unloading, the data stream <outstream_spec> is created for the database catalog definitions.

The system table TRANSFORMATIONMODEL and other system tables are filled.

Result

The desired parts of the database catalog are unloaded to the data stream <outstream_spec>.

You can use the corresponding CATALOGLOAD command to restore these database catalog objects.

Errors

The unload process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file.


CATALOGLOAD Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation CATALOGLOAD Command

You can use this Loader command to control the loading of the entire database catalog or parts of it.

Syntax

<catalogload_statement> ::= CATALOGLOAD <part_spec > <instream_spec >

You can also use the keywords LOAD CATALOG instead of the keyword CATALOGLOAD.

Prerequisite

A data stream was created with the CATALOGEXTRACT command.

The command CATALOGLOAD ALL can only be executed by the SYSDBA user.

Use

<part_spec>

· CATALOGLOAD ALL
The entire database catalog is restored from the data stream <instream_spec> using the commands for creating a database session and the SQL statements for data definition.
You can use external backup tools to load data.

· CATALOGLOAD USER
The user that executes the CATALOGLOAD USER command must have the same user name as the owner of the database catalog objects in the data stream <instream_spec>. The database catalog objects in the data stream are restored using the commands for creating a database session and the SQL statements for data definition.

· CATALOGLOAD TABLE
The user that executes the CATALOGLOAD TABLE command must have the same user name as the owner of the database catalog objects in the data stream <instream_spec>. The database catalog objects in the data stream are restored using the commands for creating a database session and the SQL statements for data definition.

Data Stream: <instream_spec>

The data stream <instream_spec> is required when loading.

If you want to use the data stream generated with the CATALOGEXTRACT command, specify this name.

The system table TRANSFORMATIONMODEL and other system tables are filled.

Result

The desired parts of the database catalog are loaded from the data stream <instream_spec> to the database catalog.

Errors

The load process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file.


DATAEXTRACT Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation DATAEXTRACT Command

With this Loader command, you can control the unloading of application data from database tables.

Syntax

<select_expression> [OUTFIELDS] [ <output_column_list> ] <extract_files_spec>
| DATAEXTRACT <restore_spec> TABLE <table_name> [ <order_clause> ] <extract_files_spec>

You can also use the keywords EXTRACT DATA instead of the keyword DATAEXTRACT.

Prerequisite

You must have access authorization for the tables from which you want to unload data.

You must be owner of the table to use the second variant of the DATAEXTRACT command.

Use

The Loader offers you the following variants of the DATAEXTRACT command.

Variant 1: DATAEXTRACT [OUTFIELDS]

You can do the following with this variant of the command:

· Define the table columns that you want to unload

· Link multiple tables that you want to unload

· Specify a sort sequence for the extracted data

DATAEXTRACT cno, name, zip, address from customer
  OUTFILE 'customer.data'

DATAEXTRACT * from article
  OUTFIELDS  foa         01-08
             des         09-39
             stock       40-43 INTEGER
             min_ord     44-45 INTEGER
             ordered     46-49 INTEGER
             del_date    50-57
             price       58-65 DECIMAL (2)
             weight      66-69 REAL
  OUTFILE 'article.data' FORMATTED

Variant 2: DATAEXTRACT … TABLE

You can only use this variant of the command to unload complete single tables. You unload all application data of a table in one data stream and the table definition in the database catalog in a second data stream. You can use these two data streams to recreate the unloaded table and load all application data.

DATAEXTRACT FOR DATALOAD TABLE article
  OUTFILE 'article.command'
  OUTFILE 'article.data'

Data stream for the definition from the database catalog: article.command
Data stream for application data: article.data

Process Flow

The Loader uses the information from the DATAEXTRACT command to generate an internal SELECT command and constructs a results table. The data in this results table is then unloaded into the target data stream, as instructed by the command.

All tables from which data is being unloaded are write-protected while the DATAEXTRACT command is being executed. This means that other users cannot make changes to this table while it is being unloaded.

Result

The data is unloaded from the tables to be unloaded into the target data stream(s).

You can use a DATALOAD or FASTLOAD command to reload the table data back into the database instance.

Errors

The unload process cannot be successfully completed. In this case, the SAP DB Loader logs the number of successfully unloaded data records in the log file.


DATALOAD Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation DATALOAD Command

With this Loader command, you can control the loading of application data.

Syntax

<dataload_statement> ::=
DATALOAD TABLE < table_spec > [< duplicates_clause >] < load_column_spec_mlt > < instream_spec > [< longfile_spec_mlt >]

You can also use the keywords LOAD DATA instead of the keyword DATALOAD.

DATALOAD TABLE sqltravel00.customer
  cno         01-04
  name        06-16
  zip         17-22
  address     23-48
INFILE 'customer.data' FORMATTED

DATALOAD TABLE edemo.products
  productid     01-10 CHAR
  productname   11-51 CHAR
  unitinstock   52-55 INTEGER
  unitsonorder  56-59 INTEGER
  unitprice     60-67 DECIMAL (2)
INFILE 'products.data' FORMATTED

Additional Examples

Use

Like the FASTLOAD command , the DATALOAD command reads data from a data stream and writes it to the tables of a database instance.

DATALOAD commands are processed while the database is running.

A DATALOAD process lasts longer in total than a FASTLOAD process. The writing of the log entries, in particular, can lead to a loss of performance. If errors occur, you can undo DATALOAD entries, as the log entries can be evaluated.

Prerequisites

The table exists in the database instance. Otherwise, it must be created before the DATALOAD command is executed.

Process Flow

The Loader generates an internal mass INSERT statement from the DATALOAD command and then executes it.

During the load operation, all of the tables modified by this DATALOAD command can also be read and changed by other users.

Result

The data in the data stream has been loaded to the target table(s).All of the changes made to the target table(s) as a result have also been written to the log area of the database instance.

Errors

If the load operation cannot be ended successfully, the Loader logs the last row that was inserted successfully in the table, the number of rows inserted, and the number of rows rejected in the log file.


DATAUPDATE Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation DATAUPDATE Command

With this Loader command, you can control the updates of individual column values of tables.

Syntax

<dataupdate_statement> ::=
DATAUPDATE TABLE <table_spec > <acc_column_spec_mlt > <set_column_spec_mlt > <instream_spec > [<longfile_spec_mlt >]

You can also use the keywords UPDATE DATA instead of the keyword DATAUPDATE.

Prerequisites

The target table exists in the database instance.

Process Flow

The Loader generates an internal UPDATE statement from the DATAUPDATE command and then executes it.

Result

The individual line values in the specified table columns are updated. All of the changes made to the target table(s) as a result have also been written to the log area of the database instance.

Errors

If errors occur when a DATAUPDATE command is executed, the Loader terminates the command and displays an error message. A log file is written.


DBEXTRACT Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation DBEXTRACT Command

With this Loader command, you can control the unloading of all application data and the corresponding database catalog information.

Syntax

<dbextract_statement> ::=
DBEXTRACT [<configurationstream_spec >] <catalogoutstream_spec > <dataoutstream_spec > [<packagestream_spec >] [<restart>]

You can also use the keywords EXTRACT DB instead of the keyword DATAEXTRACT.

Prerequisite

THE DBEXTRACT command can only be executed by the SYSDBA user.

Use

The DBEXTRACT command combines the commands CATALOGEXTRACT ALL and TABLEEXTRACT ALL. You can use external backup tools to unload data.

Data Streams: <catalogoutstream_spec> and <dataoutstream_spec>

At least two data streams are created when unloading:

· Data stream for the database catalog definitions <catalogoutstream_spec>

· Data stream for the application data <dataoutstream_spec>

The system table TRANSFORMATIONMODEL and other system tables are filled.

Exclude Tables from Unload: <configurationstream_spec>

· Unless you specify the data stream <configurationstream_spec>, all application data is unloaded.

· By specifying a data stream <configurationstream_spec>, you can exclude the application data of selected tables from the application data being unloaded<dataoutstream_spec>. The tables must be specified in the data stream by the specification of their owner and the table name.
The information about which tables are not to be unloaded is stored in the system tables. You can display this information by displaying the system table TRANSFORMATIONPACKAGES. The tables excluded from the unload of the application data have the value TRUE in the column EXCLUDE.

The database catalog entries (<catalogoutstream_spec>) of all tables are always unloaded, regardless of the restrictions made in <configurationstream_spec>.

Unloading the System Table TRANSFORMATIONPACKAGES: <packagestream_spec>

· When you specify a data stream <packagestream_spec>, all entries of the table TRANSFORMATIONPACKAGES are unloaded to this data stream. Use this option to make a log of the unload process.

· If you do not specify the data stream <packagestream_spec>, the system table TRANSFORMATIONPACKAGES is not unloaded.

Result

The application data and the database catalog are unloaded to the data streams <dataoutstream_spec> and <catalogoutstream_spec>.

If specified, all entries of the table TRANSFORMATIONPACKAGES are unloaded in the data stream <packagestream_spec>.

You can use the corresponding DBLOAD command to restore the database catalog and the application data.

Errors

The unload process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file. The PACKAGEGUID is required if you want to restart the unload process.


DBLOAD Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation DBLOAD Command

With this Loader command, you can control the loading of all application data and the corresponding database catalog information.

Syntax

<dbload_statement> ::=
DBLOAD [<configurationstream_spec >] <cataloginstream_spec > <datainstream_spec > [<packagestream_spec >] [<restart>]

You can also use the keywords LOAD DB instead of the keyword DBLOAD.

Prerequisite

THE DBLOAD command can only be executed by the SYSDBA user.

You have unloaded the database catalog and its content with the DBEXTRACT command.

Use

The DBLOAD command combines the commands CATALOGLOAD ALL and TABLELOAD ALL.

You can use external backup tools to load data.

Data Streams: <cataloginstream_spec> and <datainstream_spec>

At least two data streams are required when loading:

· Data stream for the database catalog definitions <cataloginstream_spec>

· Data stream for the application data <datainstream_spec>

If you want to use the data streams generated with the DBEXTRACT command, specify these names.

The system table TRANSFORMATIONMODEL and other system tables are filled.

Exclude Tables from Load: <configurationstream_spec>

· Unless you specify the data stream <configurationstream_spec>, all of the data contained in the data streams <cataloginstream_spec> and <datainstream_spec> are loaded.

· By specifying a data stream <configurationstream_spec>, you can exclude the application data of selected tables from the application data being loaded <datainstream_spec>. The tables must be specified in the data stream by the specification of their owner and the table name.
The information about which tables are not to be loaded is stored in the system tables. You can display this information by displaying the system table TRANSFORMATIONPACKAGES. The tables excluded from the loading of the application data have the value TRUE in the column EXCLUDE.

The database catalog entries (<cataloginstream_spec>) of all tables are always loaded, regardless of the restrictions made in <configurationstream_spec>.

Differentiate between the following variants when making the required specifications in the data stream <configurationstream_spec>, depending on the medium from which you are loading the data streams:

· Variant 1: Loading from a file (FILE)
The data stream must contain entries for the positions of table data that is to be excluded from the load process. You can find this information in the specifications for the data stream <packagestream_spec> of the corresponding DBEXTRACT command.

· Variant 2: Loading using a pipe (PIPE)
The tables specified in the data stream are excluded from the transformation.

Unloading the System Table TRANSFORMATIONPACKAGES: <packagestream_spec>

· When you specify a data stream <packagestream_spec>, all entries of the table TRANSFORMATIONPACKAGES are unloaded to this data stream. Use this option to make a log of the load process.

· If you do not specify the data stream <packagestream_spec>, the system table TRANSFORMATIONPACKAGES is not unloaded.

Result

The application data and the database catalog definitions are loaded using the data streams <datainstream_spec> and <cataloginstream_spec>.

If necessary, all entries of the table TRANSFORMATIONPACKAGES are unloaded in the data stream <packagestream_spec>.

Errors

The load process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file. The PACKAGEGUID is required if you want to restart the unload process.


FASTLOAD Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation FASTLOAD Command

With this Loader command, you can control the loading of application data for the specified tables.

Syntax

<fastload_statement> ::=
FASTLOAD [< usage_spec >] TABLE < table_spec > [< load_column_spec_mlt >] < instream_spec >

FASTLOAD with 100 % USAGE
TABLE sqltravel00.customer
  cno           1
  name          2
  zip           3
  address       4
INFILE 'customer.data'

Use

FASTLOAD commands are processed while the database is running.

When application data is loaded with FASTLOAD, it is entered directly in the pages of the database instance. This command loads data more quickly than the DATALOAD command. However, because it does not write any log entries, you must back up the new data after you have loaded it. You can either back up the corresponding pages (incremental data backup) or all data (complete data backup). The table is write-protected until you have backed up the new application data.

Prerequisites

· The target table exists in the database instance. Otherwise, the table can be created using a corresponding SQL statement before the FASTLOAD commands is executed.

· You have logged onto the Loader with the user who is the owner of the target table.

· The data in the data stream to be imported is sorted in ascending order in the sequence of the primary key.

· The target table does not have an index.

· If the target table already contains application data, only those data records whose key values are greater than the largest key value in the target table can be inserted.

· The data that you want to load does not contain LONG columns.

Process Flow

When a FASTLOAD command is started, the target table of the load operation in the database instance is locked so other users cannot write to it. The target table can still be read, however.

Unrestricted reading and writing is possible in all other tables.

Once a FASTLOAD command has been processed, other write operations triggered with FASTLOAD from the same user can be performed on this table. Once the load operation with FASTLOAD has been completed, all users only have read access for the table.

A backup of the database instance must be created before this table is released again for write operations from other users.

Result

The data from the source table has been loaded to the target table.

The successful load of the application data is completed implicitly by the Loader with a COMMIT.

Errors

If a FASTLOAD load operation is aborted, all of the lines transferred during the operation are deleted. Application data that existed in the table before the FASTLOAD load operation was started remains unchanged.

If you cancel the load operation because the Loader refused to transfer certain lines, you can check the log file to find the data record that caused the operation to fail.


SET Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation SET Command

This Loader command to create a database session allows you to define many properties of a database session.

Syntax

bool_spec >
| SET CODETYPE < standard_code_spec >
| SET < code_page_spec >
| SET COMPRESSED '/<s>/<d>/'
| SET DATE < standard_date_mask >
| SET LANGUAGE '<ENG|DEU>'
| SET MAXERRORCOUNT <valMAXERRORCOUNT>
| SET < null_spec >
| SET < number_spec >
| SET TIME < standard_time_mask >
| SET TIMESTAMP < standard_timestamp_mask >
| SET TRANSACTION SIZE <valTRANSACTION_SIZE>

BACKUPTOOL <BACKINT|NETWORKER|TSM>

Specifies the external backup tool (see also mediumtype_spec)

COMPRESSED ' /<s>/<d>/'

Characters used in the COMPRESSED format to separate or select data; current value can be changed for individual commands

<s> Character used to separate data fields, default value: comma, value must be exactly one character long, and cannot be blank

<d> Character used to select data, default value: double quotation marks, value can be exactly one character long or blank,
if it is blank, no delimiter is defined

LANGUAGE '< ENG|DEU>'

Language in which the messages of the database instance and the Loader appear
ENG: English, DEU: German

MAXERRORCOUNT <valMAXERRORCOUNT>

Definition of how many errors the Loader accepts during the processing of an individual command before processing of the command is terminated
This value applies during a complete session or until it is overwritten by another SET MAXERRORCOUNT command

TRANSACTION SIZE <valTRANSACTION_SIZE>

Defines the number of data records after which a COMMIT is performed, when inserting data

Use

You can adjust predefined values of the control parameters of the Loader to your requirements.

The new values are only valid for the current database session and must be restored if they are needed in subsequent sessions.


SQLMODE Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation SQLMODE Command

You can use this Loader command to specify, during the creation of a database session, the SQL Mode of the database instance.

Syntax

<sql_mode_statement> ::= SQLMODE < sql_mode>

Use

The commands for loading and unloading executed by the Loader and the SQL statements are interpreted in accordance with the defined SQL mode.

The defined SQL mode remains active until it is changed again with this command. If you enter an invalid SQL mode, the Loader uses the internal SQL mode of the database instance.


TABLEEXTRACT Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation TABLEEXTRACT Command

With this Loader command, you can control the unloading of database tables.

Syntax

<tableextract_statement> ::=
TABLEEXTRACT <part_spec > [<configurationstream_spec >] <dataoutstream_spec > [<packagestream_spec >] [<restart>]

You can also use the keywords EXTRACT TABLE instead of the keyword DATAEXTRACT.

Prerequisites

When you use TABLEEXTRACT TABLE, the source table must exist in the database instance.
THE command TABLEEXTRACT ALL can only be executed by the SYSDBA user.

Use

· You can unload the application data (including LONG values) of the specified database tables in data streams. The format of the data stream must be PAGES in each case.

· You can unload the application data (including LONG values) and the database catalog definitions of the specified database tables to data streams. The format of the data stream must be RECORDS in each case.

You must not change the data streams.

Tables are write-protected while they are unloaded to the data stream.

<part_spec>

· TABLEEXTRACT ALL
The data stream <dataoutstream_spec> contains the application data of all tables.

· TABLEEXTRACT USER
The data stream <dataoutstream_spec> contains the application data of the tables that belong to the specified user.

· TABLEEXTRACT TABLE
The specified table is a base table. The user is the owner of this table.
The data stream <dataoutstream_spec> contains the application data of the specified table.

Data Stream: <dataoutstream_spec>

The data streams <dataoutstream_spec> are created during unloading.

When it processes the commands TABLEEXTRACT ALL and TABLEEXTRACT USER, the Loader creates one or more data streams (depending on the size of the tables it is unloading), each of which can contain the application data from one or more tables. The Loader specifies the maximum size of a single data stream as 1 GB.

The media names for the data streams are created using the name specified in the command, in that a four digit extension of the format 0001 is added to the name. The maximum number of media for each TABLEEXTRACT is therefore set at 9999.

The system table TRANSFORMATIONMODEL and other system tables are filled.

Exclude Tables from Unload: <configurationstream_spec>

· Unless you specify the data stream <configurationstream_spec>, all specified tables are unloaded.

· By specifying a data stream <configurationstream_spec>, you can exclude the application data of selected tables from the application data being unloaded<dataoutstream_spec>. The tables must be specified in the data stream by the specification of their owner and the table name.
The information about which tables are not to be unloaded is stored in the system tables. You can display this information by displaying the system table TRANSFORMATIONPACKAGES. The tables excluded from the unload of the application data have the value TRUE in the column EXCLUDE.

Unloading the System Table TRANSFORMATIONPACKAGES: <packagestream_spec>

· When you specify a data stream <packagestream_spec>, all entries of the table TRANSFORMATIONPACKAGES are unloaded to this data stream. Use this option to make a log of the unload process.

· If you do not specify the data stream <packagestream_spec>, the system table TRANSFORMATIONPACKAGES is not unloaded.

Result

The specified tables are unloaded to the data streams <dataoutstream_spec>.

If specified, all entries of the table TRANSFORMATIONPACKAGES are unloaded in the data stream <packagestream_spec>.

You can reload the tables using the corresponding TABLELOAD command.

Errors

The unload process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file. The PACKAGEGUID is required if you want to restart the unload process.


TABLELOAD Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation TABLELOAD Command

With this Loader command, you can control the loading of database tables.

Syntax

<tableload_statement> ::=
TABLELOAD <part_spec > [<configurationstream_spec >] <datainstream_spec > [<packagestream_spec >] [<restart>]

You can also use the keywords LOAD TABLE instead of the keyword TABLELOAD.

Prerequisites

The command TABLELOAD ALL can only be executed by the SYSDBA user.

You have unloaded the database tables with the TABLEEXTRACT command.

You must not change the format of the generated data streams (PAGES or RECORDS). If the data streams have the format RECORDS, you must create the required database table definitions in the database catalog using the corresponding data definition statements.

The target tables must be empty. If the tables are not empty, the Loader attempts to delete the contents of the tables.

Use

<part_spec>

· TABLELOAD ALL
The data streams <datainstream_spec> contain the application data of all tables.

· TABLELOAD USER
The data streams <datainstream_spec> contain the application data of the tables that belong to the current user.

· TABLELOAD TABLE
The specified table is a base table. The user is the owner of this table.
The data stream <datainstream_spec> contains the application data of the specified table.

Data Streams <datainstream_spec>

You can recover database tables using the data streams created with the TABLEEXTRACT command. If you want to use the data streams generated with the TABLEEXTRACT command, specify this name as <datainstream_spec>.

The system table TRANSFORMATIONMODEL and other system tables are filled.

Process Flow

The Loader recovers the table in the following order:

1. The database catalog information is adjusted (case 1) or newly created (case 2).

2. The application data is loaded (including LONG values).

3. Indexes are created if they exist in the source table.

No log entries are written during a load process with TABLELOAD.

Case 1:
The table to be restored exists in the database instance

The Loader can adjust the following differences between the database catalog information for the source and target tables:

· Table name and column name of source table and target table
The table name and column names of the source table are copied.

· Differently defined defaults
The defaults defined in the source table are copied. The defaults defined in the target table are deleted.

· Differently defined indexes
The indexes defined in the source table are copied. The indexes defined in the target table are deleted.

· Differently defined constraints
The constraints defined in the source table are copied. The constraints defined in the target table are deleted.

If there are differences between the source and target tables for the definitions of types and the length of the individual columns, the TABLELOAD process is terminated.

Case 2:
The table to be restored does not exist in the database instance

· If data streams have the format PAGES, the table is newly created using the existing database catalog information.

· If the data streams have the format RECORDS, you must create the required database table definitions in the database catalog using the corresponding data definition statements.

Exclude Tables from Load: <configurationstream_spec>

· Unless you specify the data stream <configurationstream_spec>, all data contained in the data streams <datainstream_spec> is loaded.

· By specifying a data stream <configurationstream_spec>, you can exclude the application data of selected tables from the application data being loaded <datainstream_spec>. The tables must be specified in the data stream by the specification of their owner and the table name.
The information about which tables are not to be loaded is stored in the system tables. You can display this information by displaying the system table TRANSFORMATIONPACKAGES. The tables excluded from the loading of the application data have the value TRUE in the column EXCLUDE.

Differentiate between the following variants when making the required specifications in the data stream <configurationstream_spec>, depending on the medium from which you are loading the data streams:

· Variant 1: Loading from a file (FILE)
The data stream must contain entries for the positions of table data that is to be excluded from the load process. You can find this information in the specifications for the data stream <packagestream_spec> of the corresponding TABLEEXTRACT command.

· Variant 2: Loading using a pipe (PIPE)
The tables specified in the data stream are excluded from the load.

Unloading System Tables: <packagestream_spec>

· When you specify a data stream <packagestream_spec>, all entries of the table TRANSFORMATIONPACKAGES are unloaded to this data stream. Use this option to make a log of the load process.

· If you do not specify the data stream <packagestream_spec>, the system table TRANSFORMATIONPACKAGES is not unloaded.

Result

The database tables are loaded using the data streams <datainstream_spec>.

If specified, all entries of the table TRANSFORMATIONPACKAGES are unloaded in the data stream <packagestream_spec>.

The table is write-protected during the restore process and after a successful restore. To remove the write-protection, back up the database instance after you have restored the table.

Errors

The load process cannot be successfully completed. In this case, the Loader logs the cause of the error in the log file.

The values PACKAGEGUID and CLIENTNODE are both written to the log file. The PACKAGEGUID is required if you want to restart the unload process.


USE SERVERDB Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation USE SERVERDB Command

You can use this Loader command for creating a database session to create a connection to another database instance.

Syntax

<use_serverdb_statement> ::= USE < database_name_statement >

Prerequisites

A user with the same name and password must exist on the new database instance.

Use

You switch to another database instance without having to exit the Loader. It terminates the connection to the current database instance and sets up the new connection to the database instance.

All subsequent commands are referred to this database instance by the Loader.

USE SERVERDB MK1 ON DBHost;


USE USER Command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation USE USER Command

You can use this Loader command for creating a database session to create a connection with the specified information to a database instance.

Syntax

<use_user_statement> ::= USE < user_statement>

Use

This command terminates the current connection of the Loader to the database instance and creates a new connection with the specified parameters.

If you do not enter a database instance name under <user_statement>, the new connection is created to the database instance that was used prior to the USE USER command.


Syntax Rules for Commands (SAP Library - SAP DB)

 Entering content frame

Background documentation Syntax Rules for Commands

The syntax used for Loader commands is the Backus Naur Form (BNF) with the following conventions:

< Rule name > ::= < Rule section >

The terms in angle brackets represent syntactical units. Each rule name must be resolved by a rule section.

A rule section is any combination of rules and endsymbols. Endsymbols are numbers, literals, or keywords and are not resolved further.

Rule sections set in angle brackets indicate an optional user input.

The keywords used in the commands are written in uppercase for the sake of clarity. They can be specified by the user in upper- or lowercase letters.

Blank characters are allowed in commands. These are not interpreted by the Loader.

Endsymbols that start with val stand for values that must be specified by the user. Remember that values for 'valLITERAL' (as specified in the syntax rules) must be placed in single quotation marks.

If you use keywords as names of columns, tables or users, you must place them in double quotation marks.

· Syntax Rules for Setting up a Session

· Syntax Rules for Table Descriptions

· Syntax Rules for Column Descriptions

· Syntax Rules for Describing the Data Stream


Syntax Rules for Setting up a Session (SAP Library - SAP DB)

 Entering content frame

Background documentation Syntax Rules for Setting up a Session

The syntax rules listed here are components of the commands for setting up a database session. The use of these rules is explained in more detail.

You can go from the commands for setting up a database session directly to the descriptions of the syntax rules used in each case.

database_name_statement

sql_mode

user_statement


Syntax Rules for Table Descriptions (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Syntax Rules for Table Descriptions

The syntax rules listed here are components of the table description in the commands for loading and unloading application data . The use of these syntax rules is explained in more detail.

You can go from the description of the commands for loading and unloading data directly to the description of the syntax rules used in each case.

If you want to use keywords as table or user names, you must place them in double quotation marks.

compare_operator condition | duplicates_clause | field_format field_pos
if_condition | restore_spec | simple_condition
table_name table_spec | usage_spec |


Syntax Rules for Column Descriptions (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Syntax Rules for Column Descriptions

The syntax rules listed here are components of the column description in the commands for loading and unloading application data . The use of these syntax rules is explained in more detail.

You can go from the description of the commands for loading and unloading data directly to the description of the syntax rules used in each case.

If you want to use keywords as column names, you must place them in double quotation marks.

acc_column_spec acc_column_spec_mlt | column_assignment column_descriptor column_id column_id_spec column_names | format_spec
generate_spec | key_column_spec | lit_column_spec load_column_spec load_column_spec_mlt
null_assign null_condition numerical_functions | order_clause output_column output_column_list | round_or_trunc_spec


Syntax Rules for Describing the Data Stream (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Syntax Rules for Describing the Data Stream

The syntax rules listed here are components of the description of the data stream in the load and unload commands. The use of these syntax rules is explained in more detail.

You can go from the commands for setting up a database session directly to the descriptions of the syntax rules used in each case.

bool_spec | cataloginstream_spec catalogoutstream_spec code_page_spec code_spec configurationstream_spec | datainstream_spec dataoutstream_spec date_spec delimiter_spec
ebid_spec extract_files_spec | instream_spec int_spec | longfile_code_spec longfile_spec longfile_spec_mlt
mediumtype_spec | noheader_spec null_spec number_spec | outstream_spec
packagestream_spec part_spec | restart |


acc_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation acc_column_spec

Syntax Rules for Column Descriptions

Syntax

<acc_column_spec> ::= < key_column_spec > | < simple_column_spec >

Use

Use this syntax rule in a DATAUPDATE command to define whether the qualification columns are key columns or non-key columns of the target table.

If you use key columns as qualification columns ( key_column_spec ), each data record in the data stream updates that line in the target table that matches the specified key.

DATAUPDATE TABLE customer
KEY  cno 01-04
SET  city 05-16
INFILE 'customer.data' FORMATTED

If you use non-key columns as qualification columns ( simple_column_spec ), each data record in the source file updates each line in the target table that is identified with the value(s) of the qualification column(s).

DATAUPDATE TABLE customer
     city 1
SET  zip 2
INFILE 'customer.data'


acc_column_spec_mlt (SAP Library - SAP DB)

 Entering content frame

Syntax documentation acc_column_spec_mlt

Syntax Rules for Column Descriptions

Syntax

<acc_column_spec_mlt> ::= < acc_column_spec > <acc_column_spec_mlt>

Use

Use this syntax rule in a DATAUPDATE command to define the qualification columns.

You can use both key columns and non-key columns as qualification columns.

The qualification columns must be listed before the target columns ( set_column_spec ) in a DATAUPDATE command.


bool_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation bool_spec

Syntax Rules for Describing the Data Stream

Syntax

<bool_spec> ::= BOOLEAN <valVALUE_FOR_TRUE>/<valVALUE_FOR_FALSE>

valVALUE_FOR_TRUE | Defines the character string for values that are true
valVALUE_FOR_FALSE | Defines the character string for values that are false

The default value of the SAP DB Loader is TRUE/FALSE.

The character strings can contain a maximum of 10 characters.

Use

Use this syntax rule to specify the character string that represents the BOOLEAN values in data streams to be unloaded from a database instance or to be loaded into a database instance.

You can also change the current value for individual commands.

See also:

Data Format


cataloginstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation cataloginstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<cataloginstream_spec> ::= CATALOG < instream_spec >


catalogoutstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation catalogoutstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<catalogoutstream_spec> ::= CATALOG < outstream_spec >


code_page_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation code_page_spec

Syntax Rules for Describing the Data Stream

Syntax

<code_page_spec> ::= CODEPAGE [<valCODEPAGE_NAME>]

valCODEPAGE_NAME

Name of code pages
Default value: ISO-8859-1

If you specify an empty value, the code page is reset to the default value.

Use

You define which code page is used when CHAR data is converted from ASCII to UCS2 (see also: standard_code_spec).

Case 1: The code page for the conversion is a user-defined code page and is not yet contained in the system table CODEPAGE.

To make user-defined code pages accessible to the SAP DB Loader for conversions, you first have to load these code pages into the system table CODEPAGE. To do this, proceed as follows:

1. In the directory <dependent_path>/env, create a file with the name <valCODEPAGE_NAME>.txt. This file has to be formatted like the files that are provided by the Unicode consortium at ftp://ftp.unicode.org/Public/MAPPINGS/.

Example File ISO-8859-8.txt

# Name:             ISO/IEC 8859-8:1999 to Unicode
# Unicode version:  3.0
# Table version:    1.1
# Table format:     Format A
# Date:             2000-Jan-03
# Authors:          Ken Whistler kenw@sybase.com
#
# Copyright (c) 1991-1999 Unicode, Inc.  All Rights reserved.
#
# This file is provided as-is by Unicode, Inc. (The Unicode Consortium).
# No claims are made as to fitness for any particular purpose.  No
# warranties of any kind are expressed or implied.  The recipient
# agrees to determine applicability of information provided.  If this
# file has been provided on optical media by Unicode, Inc., the sole
# remedy for any claim will be exchange of defective media within 90
# days of receipt.
#
# Unicode, Inc. hereby grants the right to freely use the information
# supplied in this file in the creation of products supporting the
# Unicode Standard, and to make copies of this file in any form for
# internal or external distribution as long as this notice remains
# attached.
…
# Format:  Three tab-separated columns
#    Column #1 is the ISO/IEC 8859-8 code (in hex as 0xXX)
#    Column #2 is the Unicode (in hex as 0xXXXX)
#    Column #3 the Unicode name (follows a comment sign, '#')
…

0x00 0x0000   #  NULL
0x01 0x0001   #  START OF HEADING
0x02 0x0002   #  START OF TEXT
0x03 0x0003   #  END OF TEXT
0x04 0x0004   #  END OF TRANSMISSION
0x05 0x0005   #  ENQUIRY
0x06 0x0006   #  ACKNOWLEDGE
0x07 0x0007   #  BELL
0x08 0x0008   #  BACKSPACE
0x09 0x0009   #  HORIZONTAL TABULATION
0x0A 0x000A   #  LINE FEED

2. Load the code page into the system table CODEPAGE.
Use the SET command to do so. When processing the SET command SET CODEPAGE <valCODEPAGE_NAME>, the SAP DB Loader first tries to find the specified code page in the system table CODEPAGE. If the table does not contain the code page, the SAP DB Loader tries to find the corresponding file <valCODEPAGE_NAME>.txt. If this file exists, it is read, and the conversion table is entered in the system table CODEPAGE.

If the file is not found, and if the code page is not contained in the system table, the SAP DB Loader stops processing the SET command and displays an error message.

If the SET command is processed successfully, the user-defined code page is available in the system table CODEPAGE.

Case 2: The code page for the converstion is already contained in the system table CODEPAGE.

Process Flow

The SAP DB Loader reads the converstion table from the system table CODEPAGE. All subsequent conversions of the CHAR data from ASCII to UCS2 are performed by using this conversion table.

See also:

Data Format

Format of the Data Stream


code_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation code_spec

Syntax Rules for Describing the Data Stream

Syntax

<code_spec> ::= < standard_code_spec > | CODESET <valCODESET_NAME>

valCODESET_NAME

Code attribute

Use

You can define the default value for the interpretation of data streams that contain plain text values .

See also:

Data Format


column_assignment (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_assignment

Syntax Rules for Column Descriptions

Syntax

<column_assignment> ::= <valCOLUMN_NAME> '<valLITERAL>'
| <valCOLUMN_NAME> <generate_spec >

valCOLUMN_NAME | Column name Specify it according to the SQL conventions. It can also contain the table name as a prefix (such as, customer.cno).
valLITERAL | Constant

Use

When you load application data, you can use this syntax rule to specify that a constant value is loaded into the specified column for each loaded data record, and which value this constant must have.

To do this, specify the constant in a position in the command. No data is then loaded from the data stream for the appropriate column.

If the data stream is empty, the constants specified in the command are not loaded.

Loading Constants: <valCOLUMN_NAME> '<valLITERAL>'

To load any constant, specify the constant instead of a position. Place the value in single quotation marks.

The SAP DB Loader handles the constant like a plain text value and converts it to the data type of the target column.

If you want to load the constant into a numeric column, it must have a valid numeric format.

DATALOAD TABLE article
ano 01-08 CHAR
descr 09-39 CHAR
stock 40-43 INTEGER
min_ord '50'
ordered 46-49 INTEGER
delivery_date 50-57 CHAR
price 58-65 DECIMAL (2)
weight 66-69 REAL
INFILE 'customer.data' FORMATTED

Loading Special Constants: <valCOLUMN_NAME> <generate_spec >

You can load the special values STAMP, USER, USERGROUP, DATE, TIME, TIMESTAMP, and TRUE and FALSE.

DATALOAD TABLE article
changed_by USER
changed_on DATE
changed_at TIME
ano 1
descr 2
stock 3 NULL IF POS 3 < '0'
INFILE 'customer.data'


column_descriptor (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_descriptor

Syntax Rules for Column Descriptions

Syntax

<column_descriptor> ::= <valCOLUMN_NAME> < field_pos > < format_spec >

valCOLUMN_NAME

Column name
Specify it according to the SQL conventions. It can also contain the table name as a prefix (such as, customer.cno).

Use

In a command to load application data, you can use this syntax rule to assign a data field of the data stream to a column of the target table. To do this, you specify the column name, the position, and the external data type of the data in the data stream.

DATALOAD TABLE article
  ano         01-08 CHAR
  descr       09-39 CHAR
  stock      40-43 INTEGER
  min_ord     44-45 INTEGER
  ordered     46-49 INTEGER
  del_date 50-57 CHAR
  price       58-65 DECIMAL (2)
  weight      66-69 REAL
INFILE 'article.data' FORMATTED


column_id (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_id

Syntax Rules for Column Descriptions

Syntax

<column_id> ::= <valCOLUMN_NAME> | <valCOLUMN_ID>

valCOLUMN_NAME | Column name Specify it according to the SQL conventions. It can also contain the table name as a prefix (such as, customer.cno).
valCOLUMN_ID | Column ID

Use

In a command for unloading application data, use it to assign a column of the source table to a data field of the data stream .

DATAEXTRACT cno, name, zip, place FROM customer
OUTFIELDS
  cno       01-04
  name    06-12
  zip       14-18
  place     20-31
OUTFILE 'customer.data' FORMATTED

The column number valCOLUMN_ID indicates the position of the column in the SELECT statement.

DATAEXTRACT cno, name, zip, place FROM customer
OUTFIELDS
  1  01-04
  2  06-12
  3  14-18
  4  20-31
OUTFILE 'customer.data' FORMATTED


column_id_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_id_spec

Syntax Rules for Column Descriptions

Syntax

<column_id_spec> ::= <column_id > <field_pos > <format_spec > <null_assign >

Use

Use it in unload commands to assign the data fields of the data stream to the columns of the source table. You specify the external data types and the conditions for unloading the application data.

Note the following rules:

Decide whether you want your column descriptions to contain field_pos field descriptions.

However, you must specify position descriptions for all or none of the described columns. If you do not, the SAP DB Loader generates an error and terminates the command.

Format of the Data Stream: COMPRESSED

· Enter the position descriptions as relative positions only.

If you enter position descriptions with start and end positions for single columns or all columns, the SAP DB Loader generates an error and terminates the command.

DATAEXTRACT * from customer
OUTFIELDS
  cno       1
  name      2
  zip       3
  place     4-31     ERROR
OUTFILE 'customer.data' COMPRESSED

· Assign position 1 to the first column in your list. The position numbers of the following columns rise by 1 each time. This also means that each position number can only be assigned once.
If you do not keep to these rules, the SAP DB Loader generates an error and terminates the command.

DATAEXTRACT * from customer
OUTFIELDS
  cno       1
  name      2
  street    3
  zip       3     ERROR
  place     5     ERROR
OUTFILE 'customer.data' COMPRESSED

· You can assign a column to multiple different positions.

DATAEXTRACT * from customer
OUTFIELDS
  cno       1
  name   2
  zip       3
  place     4
  surname    5
OUTFILE 'customer.data' COMPRESSED

Format of the Data Stream: FORMATTED

· Specify all position descriptions with exact start and end positions.

· Specify only ascending, non-overlapping values for position descriptions.
If the positions do not follow on from each other, the SAP DB Loader fills the gaps with blank characters. This also applies to binary data.

DATAEXTRACT * from customer
OUTFIELDS
  cno       01-04
  name      06-12
  zip       14-18
  place     16-31
OUTFILE 'customer.data' FORMATTED

· Define the positions for the data stream at least as long as the length of the values in the database.
If you define a position for the data stream that is longer than the length of the value in the database, the following occurs:
- Character strings are aligned left and space characters entered to make them the correct length
- Numeric values are aligned right and space characters entered to make them the correct length
If you define a position for the data stream that is shorter than the length of the values in the database, the Loader generates an error and terminates the command.


column_names (SAP Library - SAP DB)

 Entering content frame

Syntax documentation column_names

Syntax Rules for Column Descriptions

Syntax

<column_names> ::= <valCOLUMN_NAME> | <valCOLUMN_NAME>,<column_names>

valCOLUMN_NAME

Column name

Use

Use this syntax rule in a DATEXTRACT command with order_clause (see variant 2 of the DATAEXTRACT command) to specify the sort order of the columns that you want to unload.

DATAEXTRACT FOR DATALOAD TABLE article ORDER BY delivery date, price
OUTFILE 'article.command'
OUTFILE 'article.data’


compare_operator (SAP Library - SAP DB)

 Entering content frame

Syntax documentation compare_operator

Syntax Rules for Table Descriptions

Syntax

<compare_operator> ::= < | > | = | <= | >= | !=

Use

In the syntax rule <simple_condition>, use this syntax rule to specify the value with which a value in the data record is to be compared.


condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation condition

Syntax Rules for Table Descriptions

Syntax

<condition> ::= <simple_condition > | (<condition>) | <condition> AND <condition>
| <condition> OR <condition> | NOT <condition>

Use

The SAP DB Loader distinguishes between simple conditions and compound conditions. Simple conditions can be negated with NOT, combined with AND and OR to form compound conditions, or put in parentheses as required.

Operators in parentheses are evaluated before those that are not in parentheses.

If no operators are in parentheses, the SAP DB Loader weights them as follows:

· NOT takes precedence over AND and OR

· AND takes precedence over OR

· If the weighting is identical, the operators are evaluated from left to right.

Only those records to which the simple or compound condition applies are loaded.

See also:

Selecting Data Records

You want to load those data records from the data stream hotel.data where the place is  BERLIN and the price is less than 400.00 to the destination table hotel:

DATALOAD TABLE hotel
  IF POS 41-44 REAL < '400,00'
  AND
     POS 27-36 = 'BERLIN'
       hno     01-04 INTEGER
       name    09-18
       zip     20-25 DECIMAL
       place   27-36
       price   41-44 REAL
INFILE 'hotel.data' FORMATTED


configurationstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation configurationstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<configurationstream_spec> ::= CONFIGURATION < instream_spec >


database_name_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation database_name_statement

Syntax Rules for Setting up a Session

Syntax

<database_name_statement> ::= SERVERDB <valDBNAME> [ON <valDBNODE>]

valDBNAME | Name of the database instance , applies to the whole database session with this database instance. If the name of the database instance is identical to a keyword or if the upper- and lowercase notation is relevant, the name must be placed in quotation marks.
valDBNODE | Name of the server on which the database instance that you want to open for a database session is installed.

Use

Use it to open a database session for the database instance specified with valDBNAME.

If you also specify the name of the server valDBNODE, on which this database instance is installed, the database session for this database instance is opened on this server. Otherwise, the SAP DB Loader assumes that the specified database instance is on the server where the user is logged on to the SAP DB Loader.


datainstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation datainstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<dataoutstream_spec> ::= DATA < instream_spec >


dataoutstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dataoutstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<dataoutstream_spec> ::= DATA < outstream_spec >


date_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation date_spec

Syntax Rules for Describing the Data Stream

Syntax

<date_spec> ::= DATE <standard_date_mask > | DATE '<valFREE_MASK>'

valFREE_MASK

Freely definable output format

Use Y for the year, M for the month, D for the day.
The year must have two or four characters, days must have two characters,and months must have two or three characters. If you enter three characters for the month, that is MMM, the name of the month is displayed as the standard English abbreviation, for example, Oct for October.

Use

Use this syntax rule to specify the data format of the plain text values in which DATE columns are entered and output.

This format only applies to the load or unload command in which it is specified. If no date format is specified in a command, then either the Loader default is used, or a value specified with the SET DATE command.

Using a freely definable display in a DATAEXTRACT command

CREATE TABLE d_test (col1 DATE)
//
INSERT INTO d_test VALUES (DATE)
//
DATAEXTRACT * FROM d_test
OUTFILE 'd_test.data'
DATA 'YYYY-MMM-DD'

Example for the content of the target data stream
”2003-May-15”


delimiter_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation delimiter_spec

Syntax Rules for Describing the Data Stream

Syntax

<delimiter_spec> ::= DELIMITER '<valDELIMITER>'

valDELIMITER

DELIMITER display,

No character, or exactly one character long

Represent a blank DELIMITER by specifying blank single quotation marks ( '')

Use

Use it to specify which character should be used to select application data in data streams with the format COMRESSED. If you want to unselected data, enter a blank DELIMITER in the command.

Use the SET command to view the SAP DB Loader default.

See also:

Data Format


duplicates_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation duplicates_clause

Syntax Rules for Table Descriptions

Syntax

<duplicates_clause> ::= IGNORE DUPLICATES | REJECT DUPLICATES | UPDATE DUPLICATES

IGNORE DUPLICATES | The new line is not inserted.
REJECT DUPLICATES | The new line is rejected with an error message.
UPDATE DUPLICATES | The new line overwrites the existing line.

Use

Use this syntax rule in a DATALOAD command to specify how to proceed when loading data from a data stream , and a line with the same key as the new line already exists in the target file.

If you do not make a specification, REJECT DUPLICATES is the default.

DATALOAD TABLE sqltravel00.customer
  UPDATE DUPLICATES
  customerid    01-04
  name          06-16
  zip           17-22
  address       23-48
INFILE 'customer.data' FORMATTED


ebid_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ebid_spec

Syntax Rules for Describing the Data Stream

Syntax

<ebid_spec> ::= EBID '<valEBID>'

valEBID

External Backup ID

Use

After you have finished unloading data with external backup tools, the external backup ID is written to the log file and the transformation tables of the Loader (see SAP DB Loader: Log Functions).

When you load data with external backup tools, you must specify this ID as mediumtype_spec after the key word TAPE.


extract_files_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extract_files_spec

Syntax Rules for Describing the Data Stream

Syntax

<extract_files_spec> ::= <data_ outfile_spec> [ <longfile_spec_mlt> ]
| <command_ outfile_spec > <data_outfile_spec> [<longfile_spec_mlt>]

data_outfile_spec | Definition of the data stream for application data
command_outfile_spec | Definition of the data stream for load commands to be generated ( Command file )
longfile_spec_mlt | Target data stream for data from table fields defined as LONG values

Use

The first specification of this rule applies only to DATAEXTRACT commands that do not create command files (variant 1 of the DATEXTRACT command).

DATAEXTRACT * FROM article
OUTFILE 'article.data'

The second specification only applies for DATAEXTRACT commands that enable a complete recovery of the table (variant 2 of the DATAEXTRACT command).

DATAEXTRACT FOR DATALOAD TABLE article
OUTFILE 'article.command'
OUTFILE 'article.data'


field_format (SAP Library - SAP DB)

 Entering content frame

Syntax documentation field_format

Syntax Rules for Table Descriptions

Syntax

<field_format> ::= /* leer */ | CHAR | DECIMAL [<valFRACTION>]
| ZONED [<valFRACTION>] | INTEGER | REAL

valFRACTION

Number of decimal places for the external data types DECIMAL and ZONED

Use

Use this syntax rule to describe the external data type of the data fields in the data streams .

You only need to specify the data type in a load or unload command or in a condition ( condition ), if the data field in question is to be read or output with a data type other than CHAR. Every internal database column format in the database can be read and output in CHAR format.

See also:

Converting Data Types


field_pos (SAP Library - SAP DB)

 Entering content frame

Syntax documentation field_pos

Syntax Rules for Table Descriptions

Syntax

<field_pos> ::= <valSTART_POS> | <valSTART_POS> - <valEND_POS>

valSTART_POS | Start position of a data field
valEND_POS | End position of a data field

Use

Use this syntax rule to describe:

  • The position of the input field in the data stream when loading application data
  • The position of an output field in the data stream when unloading application data
  • The position of a comparison value for loading application data selectively ( simple_condition ).

The position specification is dependent on the format of the data stream .

Format FORMATTED

If the data stream has the format FORMATTED , enter only absolute start and end positions for the data fields in the data stream.

The data stream customer.data has the FORMATTED format. The data fields have a standard format and end with a line break.

Position no.

1 2 3 4 5 6 7 8 9 .....

0 1 m i l l e r – 1 0 2 7 7 N e w   Y o r k - - -
0 2 s m i t h - 6 0 6 7 8 C h i c a g o - - - - -
0 3 k l e i n e r t 3 3 1 8 4 M i a m i - - - - -

FASTLOAD command:

FASTLOAD TABLE customer
  cno       01-02
  name   03-10
  zip       11-15
  city      16-27
INFILE 'customer.data' FORMATTED

Format COMPRESSED

If the data stream has the format COMPRESSED , enter only relative positions for the data fields in the data stream.

The data stream customer.data has the COMPRESSED format. The data fields do not have a standard format but are separated by commas:

Position no.

1   2       3    4       ....

001,miller,10277,New York
002,smith,60678,Chicago
003,kleinert,33184,Miami

FASTLOAD command:

FASTLOAD TABLE customer
  cno       1
  name 2
  zip       3
  city   4
INFILE 'customer.data'

COMPRESSED is the SAP DB Loader default value.

The data stream customer.data has the FORMATTED BINARY format:

Position no. | 1 2 3 4 5 6 7 8 9 .....
 | 0 1 m i l l e r x x 1 0 2 7 7 N e w Y o r k : : : 0 2 s m i t h : 6 0 6 7 8 C h i c a g o : : : : : 0 3 k l e i n e r t 3 3 1 8 4 M i a m I

The data fields have a standard format but do not end with a line break.

FASTLOAD command:

FASTLOAD TABLE customer
  cno       01-02
  name    03-10
  zip       11-15
  city      16-26
INFILE 'customer.data' FORMATTED BINARY


format_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation format_spec

Syntax Rules for Column Descriptions

Syntax

<format_spec> ::= < field_format > [HEX] [< numerical_functions >]

Use

In a command to load or unload application data, use this syntax rule to specify the data fields in the data stream ( external data type , position, and so on).

HEX :You can define HEX values .


generate_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation generate_spec

Syntax Rules for Column Descriptions

Syntax

<generate_spec> ::= USER | USERGROUP
| STAMP | DATE | TIME | TIMESTAMP | <sequence_number>

USER | Name of the current user is loaded
USERGROUP | Name of the group of the current user is loaded. If this user is not assigned to a user group, the name of the current user is loaded. The column into which you want to load one of these values must have the type CHAR (n) where n >= 32.
DATE | Current date The column into which you want to load one of these values must have the type DATE.
TIME | Current time The column into which you want to load one of these values must have the type TIME.
TIMESTAMP | Current timestamp The column into which you want to load one of these values must have the type TIMESTAMP.
STAMP | A unique value generated by SAP DB that can only be loaded into columns of the type CHAR (n) BYTE where n >= 8.

Use

Use it to load the specified special constants into the database.


if_condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation if_condition

Syntax Rules for Table Descriptions

Syntax

<if_condition> ::= IF <condition > | OTHERWISE

Use

Use this syntax rule to define the selection criterion that determines which records from the data stream are loaded to which target table.

You can selectively load data records that do not fulfill the selection criterion to a specific target table by using the OTHERWISE condition. This means that you can load all those records in the data stream, for which you cannot define a standard selection criterion, to a certain target table.

This syntax rule allows you to select data records when loading them from a data stream into a target table:

OTHERWISE can only be specified for the last table in a series of DATALOAD commands.


instream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation instream_spec

Syntax Rules for Describing the Data Stream

Syntax

<instream_spec> ::= INSTREAM [< mediumtype_spec >] '<valSTREAM_NAME>' [< stream_format_spec >] [< stream_extract >] [ noheader_spec ]

valSTREAM_NAME

Name and path of the medium

Use

When loading data, use this syntax rule to describe the data stream .

The rules stream_extract and noheader_spec are only evaluated for FASTLOAD and DATALOAD commands . If you use these rules in other commands, they are ignored.

  • You can use stream_extract to specify that only certain parts of a data stream are to be loaded.
  • For data streams with binary values , you can use noheader_spec to specify that the corresponding medium does not have a special header containing the sizes of a data record.


int_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation int_spec

Syntax Rules for Describing the Data Stream

Syntax

<int_spec> ::= INTEGER HILO | INTEGER LOHI

INTEGER HILO | The current data stream stores integers so that the byte with the lowest valency is stored first; that is, is furthest right in the binary number (the big endian).
INTEGER LOHI | The current data stream stores integers so that the byte with the highest valency is stored first, that is, the furthest right in the binary number (little endian, byte swap).

Use

Use it to define the representation of integers in data streams. You can only do this for data streams with the FORMATTED BINARY format ( binary values ). This rule is ignored when you load or unload in data streams that have the COMPRESSED format.

If the representation specified for a data stream does not match the current server, the values are adjusted before being loaded into the database or written to the data stream.

See also:

Data Format


key_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key_column_spec

Syntax Rules for Column Descriptions

Syntax

<key_column_spec> ::= KEY < simple_column_spec >

Use

Use this rule to specify that a certain qualification column in the DATAUPDATE command is a key column of the target table.


lit_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation lit_column_spec

Syntax Rules for Column Descriptions

Syntax

<lit_column_spec> ::= '<valLITERAL>' < field_pos >

valLITERAL

Text constant

Use

Use this rule to define text constants for output in addition to the output values in the DATAEXTRACT command .

DATAEXTRACT * from customer
OUTFIELDS
  'Customer number:'  01-15
  cno               16-19
  'Name:'           20-25
  name          26-32
  zip               34-38
  city               50-61
OUTFILE 'customer.data' FORMATTED

The text constant is specified in single quotation marks instead of the column name or column ID ( column_id ).


load_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation load_column_spec

Syntax Rules for Column Descriptions

Syntax

<load_column_spec> ::= <column_descriptor> [ <null_condition> ] | <column_assignment>

Use

Use this rule in a command for loading application data to assign the data fields in the data stream to the columns in the target table, and specify the external data types and conditions for loading the data.

DATALOAD TABLE article
  ano         01-08 CHAR
  descr       09-39 CHAR
  stock      40-43 INTEGER
  min_ord     44-45 INTEGER
  ordered     46-49 INTEGER
  del_date 50-57 CHAR
  price       58-65 DECIMAL (2)
  weight      66-69 REAL
INFILE 'article.data' FORMATTED


load_column_spec_mlt (SAP Library - SAP DB)

 Entering content frame

Syntax documentation load_column_spec_mlt

Syntax Rules for Column Descriptions

Syntax

<load_column_spec_mlt> ::= <load_column_spec > <load_column_spec_mlt>

Use

Use this syntax rule in a command for loading application data to describe the data records you want to load from a data stream and their assignment to the columns of the target table.

Table definition:

CREATE TABLE sqltravel00.customer (cno FIXED(4,0), name CHAR(10) NOT NULL, zip CHAR(5), address CHAR(25), PRIMARY KEY (cno))

Load command:

DATALOAD TABLE customer
  cno       01-04
  name      06-16
  zip       17-22
  address   23-48
INFILE 'customer.data' FORMATTED

Rules

Data must exist in the data stream for every column that you specify in the load command.

If you do not specify columns in the target table in the command, the entire column is populated with the default value defined for this column during the load operation. The NULL value is loaded if no specific default value is defined for the column.

DATALOAD TABLE customer
  cno       01-04
  name      06-16
INFILE 'customer.data' FORMATTED

zip and address are filled with the default value when the data is loaded

Key columns and mandatory columns (columns that are defined as NOT NULL without a default value) must be specified in the load command. Otherwise, the processing terminates with an SQL error.

DATALOAD TABLE customer
  name      06-16
  zip       17-22
  address   23-48
INFILE 'customer.data' FORMATTED

The command is terminated with an SQL error, as the column cno is missing.

If you do not specify any columns for the target table in the load command, the table is loaded as if all columns in the target table were specified in the command. If this is the case, data must exist in the data stream for all of the columns in the target table.

DATALOAD TABLE customer
INFILE 'customer.data' FORMATTED

Data must exist in the data stream for all of the columns in the target table.


longfile_code_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation longfile_code_spec

Syntax Rules for Describing the Data Stream

Syntax

<longfile_code_spec> ::= <code_spec > | BINARY

Use

With this specification, you define the default value for the interpretation of LONG data streams.

Using this syntax rule, you can also transform LONG data between various code types when you load or unload the data.

If you load/unload ASCII LONG data into an ASCII database or UCS2 LONG data into a UNICODE database, the data does not have to be converted.

The following combinations are possible (internal database data type and external data type):

Internal database data type | Possible code attributes of LONG data stream during unloading
LONG ASCII | ASCII, UCS2, UTF8
LONG UNICODE | UCS2, UTF8
LONG BYTE | BINARY, ASCII (HEX), UCS2 (HEX), UTF8 (HEX)

Internal database data type | Possible code attributes of LONG data stream during loading
LONG ASCII | ASCII
LONG UNICODE | ASCII, UCS2, UTF8
LONG BYTE | BINARY, ASCII, UCS2 (HEX), UTF8 (HEX)


longfile_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation longfile_spec

Syntax Rules for Describing the Data Stream

Syntax

<longfile_spec> ::= LONGFILE <valCOLUMN_ID> < longfile_code_spec >
| LONGFILE <valCOLUMN_NAME> <longfile_code_spec>
| LONGFILE <valCOLUMN_ID> <valFILE_NAME> [<longfile_code_spec>]
| LONGFILE <valCOLUMN_NAME> <valFILE_NAME> [<longfile_code_spec>]

valCOLUMN_ID | Column ID
valCOLUMN_NAME | Column name
valFILE_NAME | Name and path of data stream

Use

If you use one of the first two syntax rules, longfile_code_spec is a required specification. In all other cases, this specification is optional.

  • The first two syntax rules relate to loading/unloading in cases where each LONG value of a column is in a separate LONG data stream.
  • The other rules relate to loading/unloading in cases where all LONG values of a column are in one LONG data stream.

See also:

Loading LONG Values

Unloading LONG Values


longfile_spec_mlt (SAP Library - SAP DB)

 Entering content frame

Syntax documentation longfile_spec_mlt

Syntax Rules for Describing the Data Stream

Syntax

<longfile_spec_mlt> ::= < longfile_spec > <longfile_spec_mlt>

Use

You can use the DATALOAD, DATAEXTRACT, and DATAUPDATE commands to load LONG values to a target table, unload them from a data stream, or modify the LONG values in a table. Use this rule to define the columns in a target table to which you want to load LONG values, or from which data source you want to unload them.

The data for LONG values is stored separately from the other data in LONG data streams. Specify these data streams with the syntax rule longfile_spec.

If, when you are unloading LONG values, you specify more LONG data streams than there are LONG columns in the column list (see output_column_list), the SAP DB Loader ignores the surplus LONG data streams.

See also:

Loading LONG Values

Unloading LONG Values


mediumtype_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation mediumtype_spec

Syntax Rules for Describing the Data Stream

Syntax

<mediumtype_spec> ::= FILE | PIPE | TAPE [<ebid_spec>]

Use

You can use this syntax rule for a data stream to assign a medium.

· FILE: Medium for the data stream is the file system.

· PIPE: Medium for the data stream is a pipe.

· TAPE (relevant for unloading data only): The medium for the data stream is a tape that is addressed by an external backup tool.

· TAPE <ebid_spec> (relevant for loading data only): The medium for the data stream is a tape that is addressed by an external backup tool. You must also specify the external backup ID of the data stream that you want to load.

Explanation

The media type TAPE is supported for unloading or loading the entire database or database catalog (this means that it is currently only supported for the following commands: DBEXTRACT/DBLOAD, CATALOGEXTRACT ALL/CATALOGLOAD ALL). If you specify TAPE, an external backup tool is used for unloading or loading the data.

You must perform the following steps when you use external backup tools:

  1. Configuration of the external backup tool
    Configuring the Backint for Oracle Connection
    Configuring the Backint for SAP DB Connection
    Configuring the NetWorker Connection
    Configuring the TSM Connection
  2. Specifying the external backup tool
    To do this, use the Loader command SET BACKUPTOOL.

After the data has been unloaded, the external backup ID is written to the log file and to the transformation table of the Loader. If necessary, you must use this log information to find out the external backup ID.


noheader_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation noheader_spec

Syntax Rules for Describing the Data Stream

Syntax

<noheader_spec> ::= NOHEADER <valRECORD_LENGTH>

valRECORD_LENGTH

Length of an individual data record in the data stream

Use

When loading application data with a FASTLOAD or DATALOAD Command, you use this syntax rule to describe in infile_spec that a data stream with the FORMATTED BINARY format does not contain special headers. At the same time, you specify the length of an individual data record in the data stream.

This specification is optional.

If the data stream was generated with the DATAEXTRACT command, it contains a special header with the length of an individual data record in the data stream.

If this header is missing, you can use noheader_spec to specify the length of an individual data record. If this rule is missing, the SAP DB Loader calculates the length of an individual data record using the information on the column positions in the load command.


null_assign (SAP Library - SAP DB)

 Entering content frame

Syntax documentation null_assign

Syntax Rules for Column Descriptions

Syntax

<null_assign> ::= [IF] NULL SET '<valLITERAL>'

valLITERAL

Null value representation

Explanation

Place the value for the null representation in single quotation marks. This is a plain text value that the SAP DB Loader represents as a character string or binary numeric value. This depends on the external data type of the column for which you want to generate the representation of the null value.

If you want to display the null value representation in one of the external data types for binary values, it must have a valid numeral format. This means either a floating decimal number in mantissa/exponent representation or a fixed point number with the currently agreed or standard decimal setting.

The generated null value representation is written to the same place in the data stream as the actual column value.

· If the null value representation is shorter than the length of the value specified by the position, the value is filled with space characters. If the null value representation is longer, it is shortened to the specified length. The SAP DB Loader generates a warning.

· If columns in the target table permit NULL values and you have not specified a null value representation, the SAP DB Loader default is used for unloaded NULL values ( null_spec ). This has the external data type CHAR.

· If you define a null value representation for unloading NOT-NULL columns, it does not cause an error.

Use

Use this syntax rule in a command for unloading application data to specify which value for the data field of the source table is written to the data stream if the value in the source table is a NULL value.

You want to unload the source table article from the database into the data stream article.data. Some of the columns in the table contain NULL values.
Define a separate condition for each of these columns. If this condition is met, the corresponding null value representation is entered in the data stream.

DATAEXTRACT * FROM article
OUTFIELDS
  ano       01-08
  descr     09-39             IF NULL SET '   '
  stock     40-43 INTEGER     IF NULL SET '0'
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2) IF NULL SET 'X'
  weight    54-57 REAL
OUTFILE 'article.data' FORMATTED

You want to unload the source table article from the database instance into the data stream article.data. Some of the columns in the table contain NULL values.
Because there is no null value representation defined for the columns in the command, but all values have the external data type CHAR, the SAP DB Loader default null value representation '?' is used.

DATAEXTRACT * FROM article
OUTFIELDS
  ano       01-08
  descr     09-39
  stock     40-51
  min_ord   52-63
  price     64-74
  weight    75-85
OUTFILE 'article.data' FORMATTED

You want to unload the source table article from the database instance into the data stream article.data. Some of the columns in the table contain NULL values.
Because there is no null value representation defined for the columns in the command, the SAP DB Loader attempts to use the null value representation defined as a default (data type CHAR). This causes an error if a numeric external data type has been defined for the columns. The command terminates with an error message.

DATAEXTRACT * FROM article
OUTFIELDS
  ano       01-08
  descr     09-39
  stock     40-43 INTEGER
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2)
  weight    54-57 REAL
OUTFILE 'article.data' FORMATTED


null_condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation null_condition

Syntax Rules for Column Descriptions

Syntax

<null_condition> ::= NULL [IF] <condition > | DEFAULT NULL

Explanation

When the condition is evaluated, the shorter of the comparison values (value in the data stream or the null value representation) is filled with blank characters.

A check is made before each line in the data stream is loaded to see whether the condition formulated for the columns applies. If it does, the NULL value is inserted in this column. If not, the value from the assigned field in the data stream is inserted.

Use

Use this syntax rule in a command to load application data to specify the conditions under which the NULL value is loaded into a column of the target table.

You can use the DEFAULT-NULL condition if the NULL value in the data stream is represented in the same way for all columns that you want to load from the target table. The character string that you need to specify after NULL IF POS is only specified once as a NULL specification (null_spec) in the DEFAULT-NULL condition.

You cannot load columns defined as key columns (KEY) or NOT NULL with the NULL value. If you do, the table load action terminates with an appropriate error message.

If, when you created the table in the database instance, you defined a default other than NULL for columns, you cannot load NULL values into the columns. If this is the case, the SAP DB Loader uses the default defined for the column instead of the NULL value.

You want to load the data from the data stream article.datainto the database instance. You want to load the NULL value into some columns of the target table. Define a separate condition for each of these columns. The NULL value is entered if this condition is met.

DATALOAD TABLE article
  ano       01-08
  descr     09-39            NULL IF POS 09-11 = '   '
  stock     40-43 INTEGER    NULL IF POS 40-43 INTEGER < '0'
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2) NULL IF POS 1 <> 'X'
                                  OR POS 46-53 DECIMAL < '0'
  weight    54-57 REAL
INFILE 'article.data' FORMATTED

You want to load the data from the data stream article.datainto the database instance. You want to load the NULL value into some columns of the target table. The same '?' representation of the NULL value applies to all columns in the command where DEFAULT NULL is specified.

DATALOAD TABLE article
  ano       01-08
  descr     09-39 DEFAULT NULL
  stock     40-43 INTEGER DEFAULT NULL
  min_ord   44-45 INTEGER
  price     46-53 DECIMAL (2) DEFAULT NULL
  weight    54-57 REAL
INFILE 'article.data' FORMATTED
NULL '?'


null_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation null_spec

Syntax Rules for Describing the Data Stream

Syntax

<null_spec> ::= NULL '<valLITERAL>'

valLITERAL

Null value representation; maximum length of 20 characters

The SAP DB Loader default value is:
?                    (a question mark and 19 blank characters).

Use

Use this syntax rule to specify the character string used to represent null values that were loaded from the database instance in data streams .

You can also change the current value for individual commands.

See also:

Data Format


number_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation number_spec

Syntax Rules for Describing the Data Stream

Syntax

<number_spec> ::= DECIMAL '/[<t>]/<d>/'

t | Defines the character for structuring thousands The Loader default value is not a character.
d | Defines the character used to separate integers from decimal places The Loader default value is a period.

If no digit or character is specified for t or d, the Loader uses the default.

Use

Use this syntax rule to specify which characters are to be used in decimal numbers to group thousands and separate integers from decimal places.

· If you use this data format definition in the SET command, then you also specify the number format for all subsequent commands. In a single Loader session, this applies until a new SET command is executed.

Number format in the SET command

SET DECIMAL '/ /,/'
Specifies the following number format: 1 999 987,98

SET DECIMAL '///'
Specifies the following number format (Loader default): 1999987.98

· You can change the specified number format for individual commands. For more information, see Date Format.

Number format in a command

DATAEXTRACT freight FROM edemo.orders
OUTSTREAM FILE 'orders.data'
FORMATTED
DECIMAL '/./,/'

Specifies the following number format for a value in the file: orders.data:
1.007,64


numerical_functions (SAP Library - SAP DB)

 Entering content frame

Syntax documentation numerical_functions

Syntax Rules for Column Descriptions

Syntax

<numerical_functions> ::= <scale_spec >
| <round_or_trunc_spec >
| <scale_spec> <round_or_trunc_spec>

Use

Use this syntax rule to scale, round, or truncate numeric data values when you load data from the data stream to the target table or unload data from the source table to the data stream.

Note that you must always specify scale_spec before round_or_trunc_spec.

DATALOAD TABLE distance
  ...
   cm 7 SCALE 2
  cm 7 SCALE -3 ROUND 1
...
 INFILE 'meter.data'

DATAEXTRACT * FROM distance
  cm    10-14 INTEGER SCALE 2
  m     14-17 INTEGER
  km    18-21 INTEGER SCALE -3 TRUNC 2

OUTFILE 'dimensions.bin' FORMATTED


order_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation order_clause

Syntax Rules for Column Descriptions

Syntax

<order_clause> ::= ORDER BY < column_names >

Use

Use this syntax rule as a supplement to the DATAEXTRACT FOR DATALOAD command (variant 2 of the DATAEXTRACT command ) to specify the sort order of the extracted data.

For a description of this SQL statement, see the Reference Manual, ORDER clause (order_clause) section.


output_column (SAP Library - SAP DB)

 Entering content frame

Syntax documentation output_column

Syntax Rules for Column Descriptions

Syntax

<output_column> ::= < column_id_spec > | < lit_column_spec >

Use

Use this rule in a command for unloading application data to assign the columns of the source table to the data fields in the data stream , and to specify the external data types and conditions for unloading the data.

DATAEXTRACT * FROM article
OUTFIELDS
  ano         01-08 CHAR
  descr       09-39 CHAR
  stock      40-43 INTEGER
  min_ord     44-45 INTEGER
  ordered     46-49 INTEGER
  del_date  50-57 CHAR
  price       58-65 DECIMAL (2)
  weight      66-69 REAL
OUTFILE 'article.data' FORMATTED


output_column_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation output_column_list

Syntax Rules for Column Descriptions

Syntax

<output_column_list> ::= < output_column > | <output_column> <output_column_list>

Use

Use this syntax rule in a DATAEXTRACT command to describe the columns to be unloaded of a source table and the representation of the data records in the data stream .

Rules

  • The columns can be in any order in the column description.
  • The column list can only contain columns from the SELECT statement ( select_expression ) or a subset of them.
  • Values are output only for those columns in the column list. If the column list contains more columns than the SELECT statement, the SAP DB Loader generates an error and terminates the command.
  • If you do not describe the columns of the source table in the command, you must not specify the OUTFIELDS key word. The data is output as plain text values .
  • If you have defined the format COMPRESSED for the data stream, the values of the columns to be extracted are output in the order in the SELECT statement, and separated with separators.
  • If you have defined the format FORMATTED for the data stream, the values of the columns to be extracted are formatted and output in the order in the SELECT statement. The length of the individual output values depends on the defined sizes of the individual columns in the source table.
  • If the SELECT statement does not contain any column names (DATAEXTRACT * FROM ...), the columns are formatted according to the format of the data stream. They are output in the order specified by the database for processing the command.

Definition of the source table:

create table customer (cno char (4), name char (6) NOT NULL, zip integer, city char (11), PRIMARY KEY (cno))

Unload command:

DATAEXTRACT * from customer
OUTFIELDS
  cno       01-04
  name   06-12
  zip       14-18
  city      20-31
OUTFILE 'customer.data' FORMATTED;


outstream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation outstream_spec

Syntax Rules for Describing the Data Stream

Syntax

<outstream_spec> ::= OUTSTREAM < mediumtype_spec > '<valSTREAM_NAME>' [< stream_format_spec >] [< stream_extract >] [APPEND]

valSTREAM_NAME | Name and path of the medium , in a DATAEXTRACT command , also the name of the command file to be generated
APPEND | An existing medium is not overwritten. This means that data or generated load statements are added to the end of the medium. This does not apply to TABLEEXTRACT commands . A TABLEEXTRACT command overwrites an existing medium.

Use

When unloading data, use this syntax rule to describe the data stream .


packagestream_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation packagestream_spec

Syntax Rules for Describing the Data Stream

Syntax

<packagestream_spec> ::= PACKAGE < outstream_spec >

Use

DBEXTRACT command

DBLOAD command

TABLEEXTRACT command

TABLELOAD command


part_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation part_spec

Syntax Rules for Describing the Data Stream

Syntax

<part_spec> ::= TABLE <table_name > | USER | ALL

TABLE | A single table is unloaded to a data stream or loaded from a data stream. Prerequisite: The user must be the owner of this table
USER | The tables of the user currently logged on to the SAP DB Loader are unloaded to one or more data streams or the tables unloaded with the corresponding commands are restored from these data streams. The user who restores the tables does not need to be the user who unloaded them. If you are loading tables that were unloaded by the user user1, the tables can be reloaded by user2.
ALL | All tables of the database catalog are unloaded to one or more data streams or are loaded from these data streams. Prerequisite: The user must be the SYSDBA user.

Use

This syntax rule is used in the following commands: TABLEEXTRACT, TABLELOAD, CATALOGEXTRACT, or CATALOGLOAD command.

You specify whether an individual table, the tables of the user logged on, or all tables of the database catalog are loaded or unloaded.


restart (SAP Library - SAP DB)

 Entering content frame

Syntax documentation restart

Syntax Rules for Describing the Data Stream

Syntax

<restart> ::= RESTART <valPACKAGEGUID>

valPACKAGEGUID

ID that is generated during the Loader runtime for the commands that span more than one table

Use

The PACKAGEGUID and the host name of the client of the SAP DB Loader are entered in the table TRANSFORMATIONPACKAGES and logged in the log file .

The user can determine the PACKAGEGUID from the table TRANSFORMATIONPACKAGES or from the log file to restart the command with the corresponding PACKAGEGUID.


restore_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation restore_spec

Syntax Rules for Table Descriptions

Syntax

<restore_spec> ::= FOR DATALOAD| FOR FASTLOAD| FOR DATAUPDATE

Use

Use this syntax rule in a DATAEXTRACT command to specify which command is to be generated for loading data in the command file .

If a FASTLOAD command is generated this command contains the value of 80% for the fill level of the database ( <usage_spec> ). This is the default value of the SAP DB Loader.

DATAEXTRACT FOR DATALOAD TABLE article
OUTFILE 'article.control'
OUTFILE 'article.data'


round_or_trunc_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation round_or_trunc_spec

Syntax Rules for Column Descriptions

Syntax

<round_or_trunc_spec> ::= ROUND <valFRACTION> | TRUNC <valFRACTION>

valFRACTION

Number of decimal places

The value must be between 0 and 18. This function doe not have any effect if the number does not have any decimal places.

Use

Use this syntax rule to specify the number of decimal places in a number.

ROUND <valFRACTION>

The value is rounded off at the (<valFRACTION>+1) th decimal place. If this number is >= 5, the value is rounded up. If it is < 5, the value is rounded down. The result is a number in which the (<valFRACTION>+1)th and all subsequent decimal places are equal to 0. The other digits in the number may have been changed if the value was rounded up.

DATALOAD TABLE distance
  ...
  cm 7 SCALE 2
  cm 7 SCALE -3 ROUND 1
...
INFILE 'meter.data'

TRUNC <valFRACTION>

The (<valFRACTION>+1)th and all subsequent decimal places of the value are set to 0. The first <valFRACTION> decimal places remain unchanged.

DATAEXTRACT * FROM distance
  cm    10-14 INTEGER SCALE 2
  m     14-17 INTEGER
  km    18-21 INTEGER SCALE -3 TRUNC 2

OUTFILE 'dimensions.bin' FORMATTED


scale_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation scale_spec

Syntax Rules for Column Descriptions

Syntax

<scale_spec> ::= SCALE <valSCALE_FACTOR>

valSCALE_FACTOR

Scaling factor, can be positive or negative

The value to which the syntax rule refers is multiplied by the corresponding power of ten.

Use

You can scale values using this syntax rule.

You can combine this syntax rule with round_or_trunc_spec .

DATALOAD TABLE distance
  ...
  cm 7 SCALE 2
  cm 7 SCALE -3
...
INFILE 'meter.data'

DATAEXTRACT * FROM
  cm    10-14 INTEGER SCALE 2
  m     14-17 INTEGER
  km    18-21 INTEGER SCALE -3

OUTFILE 'dimensions.bin' FORMATTED


select_expression (SAP Library - SAP DB)

 Entering content frame

Syntax documentation select_expression

Syntax Rules for Column Descriptions

Syntax

<select_expression>

This database query is formulated in the same way as a SELECT statement, however, instead of SELECT, the keyword DATAEXTRACT or EXTRACT DB is used. All options of a SELECT statement are permitted:

· Select the result columns and determine their order in the result table

· Join multiple tables

· Use qualifications to select result lines

· Specify sort order

· Specify locks (WITH LOCK)

Use

Use this syntax rule in a DATAEXTRACT command to specify which columns in a table to extract.

DATAEXTRACT * FROM article
OUTFIELDS
  ano       01-08
  descr     09-39
  stock     40-51
  min_ord   52-63
  price     64-74
  weight    75-85
OUTFILE 'article.data' FORMATTED

DATAEXTRACT ano,descr,stock,min_ord FROM article order by ano
OUTFIELDS
  ano       1
  descr     2
  stock     3
  min_ord   4
OUTFILE 'article.data'

DATAEXTRACT ano,descr,stock,min_ord FROM article WITH LOCK
OUTFIELDS
  ano       1
  descr     2
  stock     3
  min_rod  4
OUTFILE 'article.data'


separator_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation separator_spec

Syntax Rules for Describing the Data Stream

Syntax

<separator_spec> ::= SEPARATOR '<valSEPARATOR>'

valSEPARATOR

Separator for data fields; must be one character long

Use

Use this syntax rule to specify which character is used to separate data fields in data streams that have the COMPRESSED format.

Use the SET command to view the SAP DB Loader default.

See also:

Data Format


set_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_column_spec

Syntax Rules for Column Descriptions

Syntax

<set_column_spec> ::= SET < load_column_spec >

Use

Use this syntax rule in a DATAUPDATE command to define the columns of the target table that you want to update with this command.

DATAUPDATE TABLE customer
KEY cno 01-04
SET city 05-16
INFILE 'customer.data' FORMATTED


set_column_spec_mlt (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_column_spec_mlt

Syntax Rules for Column Descriptions

Syntax

<set_column_spec_mlt> ::= < set_column_spec > <set_column_spec_mlt>

Use

Use this syntax rule in a DATAUPDATE command to define the columns of the target table that you want to update with this command.

DATAUPDATE TABLE customer
KEY cno 01-04
SET city 05-16
INFILE 'customer.data' FORMATTED


sequence_number (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sequence_number

Syntax Rules for Column Descriptions

Syntax

<sequence_number> ::= SEQNO | SEQNO <valSTART>
| SEQNO <valSTART> <valINCREMENT>

valSTART | Start value and first value to be loaded
valINCREMENT | Increment between loaded values

The keyword SEQNO specifies that sequential numbers are generated. Both the start value and the increment can be negative.

If you only enter the keyword SEQNO in the command, the start value is 0 and the increment between values is 1.

If you only enter the start value in the command after SEQNO, the increment between the values is 1.

Use

Use this syntax rule to load self-generated sequential numbers with a freely definable start value and increment.

The set of calculable numbers is cyclical. This means that the value that comes after the largest possible value is the smallest possible value. In this way, you can generate as many numbers as you want, including repeated sequential numbers.

A column of the type FIXED(10) is enough for storing the sequential numbers.

DATALOAD TABLE article
  ano       SEQNO 10000 5
  descr     2
  stock    3 NULL IF POS 3 < '0'
INFILE 'article.data' FORMATTED


simple_column_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_column_spec

Syntax Rules for Column Descriptions

Syntax

<simple_column_spec> ::= < column_descriptor > | < column_assignment >

Use

Use this syntax rule in a DATAUPDATE command to assign the data fields of the qualification columns in the data stream to the columns of the target table and to specify the external data types .

DATAUPDATE TABLE article
ano 01-08 CHAR
descr 09-39 CHAR
SET min_ord 40-41 INTEGER
SET del_date 42-49 CHAR

INFILE 'article.data' FORMATTED


simple_condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation simple_condition

Syntax Rules for Table Descriptions

Syntax

<simple_condition> ::= POS < field_pos > < field_format > [HEX] < compare_operator > '<valLiteral>'

valLITERAL

Constant

As with the other fields in a data record, you use the position of a value that you want to compare to describe it. You only need to specify the external data type of this value if the data type is not CHAR.

You specify a constant as a plain text value and place it in quotation marks. The constant is converted to the data type of the value that you want to compare in the data record.

If the constant you want to use as a comparison value is a number, it must have a valid number format, that is, it must be a floating point number in mantissa/exponent notation or a fixed-point number with the currently defined decimal representation or the default decimal representation in the SAP DB Loader.

Use

Use this syntax rule to define the selection criterion that determines which records from the data stream are loaded to which target table. The data records that are you want to load are selected by comparing them with a constant.

You want to load only those data records from the source data stream hotel.data where the price is less than 400.00 to the target table hotel:

DATALOAD TABLE hotel
  IF POS 41-44 REAL < '400,00'
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED


sql_mode (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sql_mode

Syntax Rules for Setting up a Session

Syntax

<sql_mode> ::= INTERNAL | ANSI | DB2 | ORACLE

INTERNAL | Internal database system SQL Mode (system default)
ANSI | SQL dialect in accordance with the ANSI standard (ANSI X3.135-1992, Entry SQL)
DB2 | SQL dialect in accordance with the definition for DB2 Version 4
ORACLE | SQL dialect in accordance with the ORACLE7 definition

Use

The active SQL mode determines which SQL dialect is understood by the database system. It is transferred between the SAP DB Loader and the database instance when the connection is set up. The SQL statements and load commands are interpreted in accordance with the specified SQL mode, if the data stream does not have the format PAGES .

  • If you do not specify an SQL mode, the SQL mode INTERNAL is used.
  • If you enter an invalid SQL mode, the database system automatically assumes that you want to use the INTERNAL SQL mode.
  • The SQL mode can change within a command file or a script.


standard_code_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation standard_code_spec

Syntax Rules for Describing the Data Stream

Syntax

<standard_code_spec> ::= ASCII | UCS2 | UTF8

Use

In the code_spec, you define the default value for the interpretation of data streams that contain plain text values. The default value of the SAP DB Loader is ASCII.

When you load or unload data, you can transform it between various code types.

If you load/unload ASCII data into an ASCII database or UCS2 data into a Unicode database, the data does not have to be converted.

The following combinations are possible (internal database data type and external data type):

Internal database data type | Possible code attributes for data streams with plain text values when unloaded
(VAR)CHAR ASCII | ASCII, UCS2, UTF8
(VAR)CHAR UNICODE | UCS2, UTF8
(VAR)CHAR BYTE | BINARY, ASCII (HEX), UCS2 (HEX), UTF8 (HEX)
Numerical data types | ASCII, UCS2, UTF8

Internal database data type | Possible code attributes for data streams with plain text values when loaded
(VAR)CHAR ASCII | ASCII
(VAR)CHAR UNICODE | ASCII, UCS2, UTF8
(VAR)CHAR BYTE | BINARY, ASCII, UCS2 (HEX), UTF8 (HEX)
Numerical data types | ASCII, UCS2, UTF8

If you want to use a particular code page for the ASCII to UCS2 conversion, you can specify the page with the SET command SET <code_page_spec >.

When you load/unload LONG data, you determine the default values by using the syntax rule longfile_code_spec.


standard_date_mask (SAP Library - SAP DB)

 Entering content frame

Syntax documentation standard_date_mask

Syntax Rules for Describing the Data Stream

Syntax

<standard_date_mask> ::= EUR | INTERNAL | ISO | JIS | USA

'YYYY' | Year (four digits)
'MM' | Month (two digits, 01-12)
'DD' | Day (two digits, 01-31)

Format | General Form | Example
EUR | 'DD.MM.YYYY' | '23.01.2003'
INTERNAL | 'YYYYMMDD' | '20030123'
ISO/JIS | 'YYYY-MM-DD' | '2003-01-23'
USA | 'MM/DD/YYYY' | '01/23/2003'

Days and months must have two digits. In all formats except INTERNAL, the year must have two or four digits. In the format INTERNAL, the year must have four digits.

Use

Use the standard date definition to specify the format for plain-text values in which DATE columns are entered and displayed.

The default value in the Loader is INTERNAL.

· If you use this standard date definition in the SET command, then you also specify the date format for all subsequent commands. In a single Loader session, this applies until a new SET command is executed.

Date format in the SET command

SET DATE ISO

· You can change the specified date format for individual commands. For more information, see Date Format.

Date format in a command

CREATE TABLE d_test (col1 DATE)
//
INSERT INTO d_test VALUES (DATE)
//
DATAEXTRACT * FROM d_test
OUTFILE 'd_test.data'
DATE ISO

Example for the content of the target data stream
”2003-05-15”


standard_time_mask (SAP Library - SAP DB)

 Entering content frame

Syntax documentation standard_time_mask

Syntax Rules for Describing the Data Stream

Syntax

<standard_time_mask> ::= EUR | INTERNAL | ISO | JIS | USA

'HHHH' | Hour (four digits)
'HH' | Hour (two digits)
'MM' | Minutes (two digits, 00-59)
'SS' | Seconds (two digits, 00-59)

Format | General Form | Example
EUR | 'HH.MM.SS' | '14.30.08'
INTERNAL | 'HHHHMMSS' | '00143008'
ISO/JIS | 'HH:MM:SS' | '14:30:08'
USA | 'HH:MM AM (PM)' | '2:30 PM'

Minutes and seconds must have two digits. Except in the format INTERNAL, the hours must have two digits. In the format INTERNAL, the hours must have two or four digits.

When you load data, hours greater than 24 cause errors, except in the format INTERNAL. When you unload data, hours are displayed modulo 24, except in the format INTERNAL. In the format INTERNAL, you can specify hours up to 9999.

Use

Use the standard time definition to specify the format for plain-text values in which TIME columns are entered and displayed.

The default value in the Loader is INTERNAL.

· If you use this standard time definition in the SET command, then you also specify the time format for all subsequent commands. In a single Loader session, this applies until a new SET command is executed.

Time format in the SET command

SET TIME ISO

· You can change the specified time format for individual commands. For more information, see Date Format.

Time format in a command

CREATE TABLE t_test (col1 TIME)
//
INSERT INTO t_test VALUES (TIME)
//
DATAEXTRACT * FROM t_test
OUTFILE 't_test.data'
TIME ISO

Example for the content of the target data stream
”2003-05-15”


standard_timestamp_mask (SAP Library - SAP DB)

 Entering content frame

Syntax documentation standard_timestamp_mask

Syntax Rules for Describing the Data Stream

Syntax

<standard_timestamp_mask> ::= EUR | INTERNAL | ISO | JIS | USA

'YYYY' | Year (four digits)
'MM' | Month (two digits, 01-12)
'DD' | Day (two digits, 01-31)
'HH' | Seconds (two digits, 0-24)
'MM' | Minutes (two digits, 00-59)
'SS' | Seconds (two digits, 00-59)
'NNNNNN' | Microseconds (six digits)

Format | General Form | Example
EUR/JIS/USA | 'YYYY-MM-DD-HH.MM.SS.NNNNNN' | '2003-01-23-14.30.08.456234'
INTERNAL | 'YYYYMMDDHHMMSSNNNNNN' | '20030123143008456234'
ISO | 'YYYY-MM-DD HH:MM:SS.NNNNNN' | '2003-01-23 14:30:08.456234'

Years must have four digits. Months and days must have two digits.
Hours, minutes, and seconds must have two digits.
For microseconds, you can choose any number of digits from 0 to 6.

Use

Use the standard time stamp definition to specify the format for plain-text values in which TIMESTAMP columns are entered and displayed.

The default value in the Loader is INTERNAL.

· If you use this standard time stamp definition in the SET command, then you also specify the time stamp format for all subsequent commands. In a single Loader session, this applies until a new SET command is executed.

Time stamp format in the SET command

SET TIMESTAMP ISO

· You can change the specified time stamp format for individual commands. For more information, see Date Format.

Time stamp format in a command

CREATE TABLE ts_test (col1 TIMESTAMP)
//
INSERT INTO ts_test VALUES (TIMESTAMP)
//
DATAEXTRACT * FROM ts_test
OUTFILE 'ts_test.data'
TIMESTAMP ISO

Example for the content of the target data stream
”2003-05-15 11:36:55.123456”


stream_extract (SAP Library - SAP DB)

 Entering content frame

Syntax documentation stream_extract

Syntax Rules for Describing the Data Stream

Syntax

<stream_extract> ::= START <valSTART_POS>
| START <valSTART_POS> <valEND_POS>
| START <valSTART_BLOCK> : <valSTART_POS> <valEND_BLOCK> : <valEND_POS>

valSTART_POS | Number of the first data record to be loaded
valEND_POS | Number of the last data record to be loaded
valSTART_BLOCK | Block number of the first data record to be loaded
valEND_BLOCK | Block number of the last data record to be loaded


stream_format_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation stream_format_spec

Syntax Rules for Describing the Data Stream

Syntax

<stream_format_spec> ::=
  < code_spec > <stream_format_spec>
| < number_spec > <stream_format_spec>
| < date_spec > <stream_format_spec>
| < time_spec > <stream_format_spec>
| < timestamp_spec > <stream_format_spec>
| < null_spec > <stream_format_spec>
| < bool_spec > <stream_format_spec>
| < int_spec > <stream_format_spec>
| < separator_spec > <stream_format_spec>
| < delimiter_spec > <stream_format_spec>
| COMPRESSED <stream_format_spec>
| FORMATTED <stream_format_spec>
| FORMATTED BINARY <stream_format_spec>
| PAGES <stream_format_spec>
| RECORDS <stream_format_spec>

Use

Use this syntax rule within a load and unload command to define the data formats and the format of the data stream .


table_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_name

Syntax Rules for Table Descriptions

Syntax

<table_name> ::= <valTABLE_NAME> | <valTABLE_OWNER>.<valTABLE_NAME>

valTABLE_NAME | Name of the table Specify the table name in accordance with the SQL conventions. You can also define a user name as a prefix.
valTABLE_OWNER | Owner of the table

Use

Use this syntax rule in a command to load or unload data to specify a table name.

FASTLOAD TABLE hotel
  IF (POS 41-44 REAL < '400.00')
  AND
     (POS 41-44 REAL >= '400.00')
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED;

DATALOAD TABLE berolina.hotel
  IF (POS 41-44 REAL < '400.00')
  AND
     (POS 41-44 REAL >= '400.00')
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED;


table_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_spec

Syntax Rules for Table Descriptions

Syntax

<table_spec> ::= < table_name > < if_condition >

Use

Use this syntax rule in a DATALOAD command to specify the name(s) and contents of the target table(s).

It also applies to loading a table in the FASTLOAD command .

You want to load from the data stream adresses.data the data records that begin with the letter 'k' into the target table with the name customer.

DATALOAD TABLE sqltravel00.customer     IF POS 1 = 'k'
  customerid  2
  name        3
  zip         5
  address     6


time_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation time_spec

Syntax Rules for Describing the Data Stream

Syntax

<time_spec> ::= TIME < standard_time_mask > | TIME '<valFREE_MASK>'

valFREE_MASK

Freely definable output format

Use H for hours, M for minutes, and S for seconds. Minutes and seconds must have two digits. Hours must have two or four digits.

Use

Use this syntax rule to specify the data format of the plain text values in which TIME columns are entered and displayed.

This format only applies to the load or unload command in which it is specified. If no time format is specified in a command, then either the Loader default is used, or a value specified with the SET TIME command.

Freely definable display in a command

CREATE TABLE t_test (col1 TIME)
//
INSERT INTO t_test VALUES (TIME)
//
DATAEXTRACT * FROM t_test
OUTFILE 't_test.data'
TIME 'HHHH-MM-SS'

Example for the content of the target data stream

”0011-46-56”


timestamp_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation timestamp_spec

Syntax Rules for Describing the Data Stream

A time stamp consists of a date value, a time value, and microseconds.

Syntax

<timestamp_spec> ::= TIMESTAMP <standard_timestamp_mask >
| TIMESTAMP '<valFREE_MASK>'

valFREE_MASK

Freely definable output format

Use Y for the year, M for the month, D for the day, H for the hours, M for the minutes, S for the seconds, and N for the microseconds.
The year must have two or four characters, days must have two characters,and months must have two or three characters. If you enter three characters for the month, that is MMM, the name of the month is displayed as the standard English abbreviation, for example, Oct for October.
Minutes and seconds must have two digits. Hours must have two or four digits. For microseconds, you can choose any number of digits from 0 to 6.

Use

Use this syntax rule to specify the data format of the plain text values in which TIMESTAMP columns are entered and output.

This format only applies to the load or unload command in which it is specified. If no time stamp format is specified in a command, then either the Loader default is used, or a value specified with the SET TIMESTAMP command.

Freely definable display in a command

CREATE TABLE ts_test (col1 TIMESTAMP)
//
INSERT INTO ts_test VALUES (TIMESTAMP)
//
DATAEXTRACT * FROM ts_test
OUTFILE 'ts_test.data'
TIMESTAMP 'YYYY-MM-DD-HH-MM-SS-NNNNNN'

Example for the content of the target data stream
”2003-11-15-13-14-12-987654”


usage_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation usage_spec

Syntax Rules for Table Descriptions

Syntax

<usage_spec> ::= WITH <valUSAGE> % USAGE | WITH <valUSAGE> ROWS USAGE

valUSAGE

Positive integer

For a percentage, this number must be between 50 and 100.

If you specify the number of rows, the length of a single table record plays a role.

Use

Use this syntax rule in a FASTLOAD command to specify the extent to which you want to fill a table page with data records.

To do this, you can specify a percentage between 50 and 100 or define the number of rows (data records) that you want to load in each table page. If you specify a number of rows that exceeds the actual number possible, the SAP DB Loader displays an error message during the load operation, indicating the maximum number of rows permitted in each table page.

The default value of the SAP DB Loader is 80%.

· If the table will not be modified at all, or only slightly, it is a good idea to utilize the occupied memory by more than 80%.

· If considerable dynamic growth is anticipated for the table, it is a good idea to utilize the occupied memory by less than 80%.

Specifying the desired memory utilization does not guarantee that it will actually be achieved. Use the Database Manager program to check the current memory utilization for the relevant table.

You want to specify a memory utilization of 100% for a FASTLOAD of data from the data stream customer.data to the customer table.

FASTLOAD with 100 % USAGE
TABLE customer
  cno           1
  name          2
  zip           3
  city          4
INFILE 'customer.data'

You want to enter 25 data records in each table page on the database instance.

FASTLOAD with 25 ROWS USAGE
TABLE customer
  cno           1
  name          2
  zip           3
  city          4
INFILE 'customer.data'


user_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation user_statement

Syntax Rules for Setting up a Session

Syntax

<user_statement> ::= USER <valUSERNAME> <valPASSWORD> [<database_name_statement> ]

valUSERNAME | User name (see database user)
valPASSWORD | User password

The database system automatically converts the user name and password to uppercase letters. If you want to suppress the conversion, you must place the names in quotation marks.

Use

The user data transferred is used to set up a database session with the database instance.

You can specify user data with the option -u (if you call the Loader CLI) or by calling the Perl interface or the Python interface of the Loader.


Keywords (SAP Library - SAP DB)

 Entering content frame

Function documentation Keywords

Keywords are components of commands . They define the function of the command, which is modified by arguments and options.

DATALOAD TABLE article
  ano         01-08 CHAR
  descr       09-39 CHAR
  stock     40-43 INTEGER
  min_order   44-45 INTEGER
  ordered     46-49 INTEGER
  del_date  50-57 CHAR
  price       58-65 DECIMAL (2)
  weight      66-69 REAL
INFILE 'customer.data' FORMATTED

The SAP DB Loader uses the keywords listed below. In some cases, you can also use the specified alternatives to the keywords.

Keywords A - C

Keywords D - E

Keywords F - K

Keywords L - P

Keywords R - S

Keywords T - Z


Keywords A - C (SAP Library - SAP DB)

 Entering content frame

Background documentation Keywords A - C

Keywords of the SAP DB Loader

Keyword | Alternative Keywords
ALL AND ANSI APPEND ASCII AUTOCOMMIT BINARY BOOLEAN BY CATALOG CATALOGEXTRACT CATALOGLOAD CHAR CODESET CODETYPE COMPRESS CONFIGURATION COUNT CURRENT | EXTRACT CATALOG LOAD CATALOG


Keywords D - E (SAP Library - SAP DB)

 Entering content frame

Background documentation Keywords D - E

Keywords of the SAP DB Loader

Keyword | Alternative Keywords
DATA DATAEXTRACT DATALOAD DATAUPDATE DATE DB2 DBEXTRACT DBLOAD DEC DECIMAL DEFAULT DELIMITER DUPLICATES EBCDIC EUR EXTRACT CATALOG EXTRACT DATA EXTRACT DB EXTRACT TABLE | EXTRACT DATA LOAD DATA UPDATE DATA EXTRACT DB LOAD DB CATALOGEXTRACT DATAEXTRACT DBEXTRACT TABLEEXTRACT


Keywords F - K (SAP Library - SAP DB)

 Entering content frame

Background documentation Keywords F - K

Keywords of the SAP DB Loader

FASTLOAD
FILE
FOR
FORMATTED
HEX
HILO
IF
IGNORE
INFILE
INSTALLATION
INSTREAM
INTERNAL
INTEGER
ISO
JIS
KEY


Keywords L - P (SAP Library - SAP DB)

 Entering content frame

Background documentation Keywords L - P

Keywords of the SAP DB Loader

Keywords | Alternative Keyword
LANGUAGE LOAD CATALOG LOAD DATA LOAD DB LOAD TABLE LOHI LONGFILE MESSAGE NOT NULL NUMBER OFF ON OR ORACLE ORDER OTHERWISE OUTFILE OUTFIELDS OUTSTREAM PACKAGE PAGES PIPE POS | CATALOGLOAD DATALOAD DBLOAD TABLELOAD


Keywords R - S (SAP Library - SAP DB)

 Entering content frame

Background documentation Keywords R - S

Keywords of the SAP DB Loader

REAL
RECORDS
REJECT
RELEASE
RESTART
ROUND
ROWS
SCALE
SEPARATOR
SEQNO
SERVERDB
SET
SQLMODE
STAMP
START
SQLID
SYSDATE


Keywords T - Z (SAP Library - SAP DB)

 Entering content frame

Component documentation Keywords T - Z

Keywords of the SAP DB Loader

Keywords | Alternative Keywords
TABLE TABLEEXTRACT TABLELOAD TABLEUNLOAD TABLEUPDATE TAPE TERMCHARSET TIME TIMESTAMP TRUNC UID UPDATE UPDATE DATA UPDATE TABLE USA USAGE USE USER USERKEY USERGROUP VERSION WITH ZONED | EXTRACT TABLE LOAD TABLE UPDATE TABLE DATAUPDATE TABLEUPDATE


Terms and Procedures (SAP Library - SAP DB)

 Entering content frame

Background documentation Terms and Procedures

AUTOCOMMIT |  |
Background Operating Mode | Binary Values |
Call | CATALOGEXTRACT | CATALOGLOAD
Command File | Commands | COMPRESSED
Data | DATAEXTRACT | DATALOAD
Data Stream | Data Types | DATAUPDATE
DBEXTRACT | DBLOAD |
External Data Types |  |
FASTLOAD | FORMATTED | FORMATTED BINARY
HEX Values |  |
INSTREAM | Interactive Operating Mode | Internal Database Data Types
Java |  |
Loader | Loader CLI | Loader Server
Loading Binary Values | Loading Data | Loading LONG Values
Loading with External Backup Tools | Log Files |
Medium | Metadata |
Operating Mode | Options | OUTSTREAM
PAGES | Perl | Plain Text Values
Python |  |
RECORDS |  |
Selecting Data Records | SET | SQL Statements
SQLMODE | System Tables |
TABLEEXTRACT | TABLELOAD | Transformation
Unloading Data | Unloading LONG Values | Unloading with External Backup Tools
USE SERVERDB | USE USER |


Operating Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation Operating Mode

You can choose from two operating modes when you call the Loader with the Loader CLI. The modes are activated implicitly by the way in which the Loader CLI is called.

· Background or script mode(specify the option -b)
The required commands and SQL statements must be stored in a command file. When you call the Loader, you must specify the command file with the option –b <command_file>.

· Interactive or session mode (do not specify the option -b)
The Loader CLI runs in interactive mode if you do not specify the command file option -b when you call the Loader CLI.
In this case, you can enter commands and SQL statements in the command line after you start the Loader CLI.
If you enter a Loader command that runs over more than one line, and you end one of these lines with a forward slash (‘/’), then the Loader CLI recognizes that the command is not yet complete. This stops the command from being executed when you enter the line.
Only when you enter a line without preceding it with a forward slash does the Loader CLI recognize that the command is complete. It then sends the command to the Loader Server, which executes it. After all the commands and SQL statements have been executed, the Loader CLI displays a message.
To exit interactive mode, enter release or exit.


Binary Values (SAP Library - SAP DB)

 Entering content frame

Background documentation Binary Values

The following applies for the SAP DB Loader:

All numeric external data types (INTEGER, REAL, DECIMAL, ZONED) are interpreted as binary values. These can be converted to any of the internal database data types (FIXED, SMALLINT, INTEGER, FLOAT).

  • Data of the data type INTEGER is always interpreted as signed values by the SAP DB Loader. You can adjust its display in a data stream with int_spec (Specified in commands to load and unload as a processing specification for the data stream as the syntax rule stream_format_spec ).
  • Data of the data type REAL is coded in host-specific format and cannot be transported between different operating systems and computer platforms without being converted again.

See also:

Converting the Data Types


Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Data

The Loader provides you with functions for unloading, loading, and formatting data between different data sources and data targets in different granularities (Commands for Unloading and Loading).

The Loader recognizes two types of data:

· Application Data

· Metadata


Application Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Application Data

Application data is the data that is stored in the database tables.

The Loader writes the application data to a data stream when unloading from the database system and to the database system when loading from a data stream.


Metadata (SAP Library - SAP DB)

 Entering content frame

Background documentation Metadata

The SAP DB database system manages its metadata in the database catalog .

For the SAP DB Loader, metadata is data that mirrors the database catalog information and also describes the data, the application data , database catalog information and load and unload processes ( Transformations ) in accordance with the requirements of the SAP DB Loader.

  • Metadata of the Application Data
  • Metadata of the Database Catalog
  • Metadata of the Transformations


Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Stream

The Loader transforms metadata of the database catalog, application data, and pages of a SAP DB database instance to metadata and application data (data definitions, data records, and data fields), and pages and conversely in a format that is readable for the Loader. The data is unloaded into data streams, or loaded from these streams.

Every data stream is identified using the following data:

· Metadata and/or Application Data

· Data Format and Format of the Data Stream

· Direction

· Medium


Data Format (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Format

With most Loader commands for loading and unloading data, you can specify the external data type and the data format that the relevant field values in the data stream have or should have.

You can also define which separators and delimiters are to be used.

Procedure

You can specify the data format in load and unload commands as a processing specification for the data stream (syntax rule stream_format_spec).

code_spec
number_spec
date_spec|time_spec|timestamp_spec
null_spec
bool_spec
int_spec
separator_spec|delimiter_spec

The specified data format applies to the columns that have the corresponding internal database data type.


Format of the Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation Format of the Data Stream

Data streams can have the following formats:

· COMPRESSED

· FORMATTED

· FORMATTED BINARY

· PAGES

· RECORDS

You can specify the format in unload and load commands as a processing specification for the data stream (syntax rule stream_format_spec).

The Loader requires that data streams with clear text values have the format COMPRESSED. If this is not the case, you must explicitly specify the FORMATTED format or, with binary coded data streams, FORMATTED BINARY format in the unload or load command.


COMPRESSED (SAP Library - SAP DB)

 Entering content frame

Background documentation COMPRESSED

COMPRESSED (CSV, Comma Separated Values) is a possible format of a data stream.

If a command for unloading or loading data does not explicitly specify the format FORMATTED or FORMATTED BINARY, the system assumes that the data in the source data stream is in the COMPRESSED format (Loader default value). This means that it does not have to be specified explicitly in an unload or load command.

The COMPRESSED format can only be used for source data streams with plain text values. Data streams with binary values must be loaded with the FORMATTED BINARY format.

If you do not specify a format in an unload or load command, however, the data is not in plain text, the Loader creates an error message.

customer.data

Position number

1   2       3    4       ....

001,miller,10277,New York
002,smith,60678,Chicago
003,kleinert,33184,Miami

The data fields do not have a uniform format but are separated by commas:

FASTLOAD command:

FASTLOAD TABLE customer
  cno       1
  surname   2
  zip       3
  place     4
INFILE 'customer.data’

Data Lines

In COMPRESSED format, a data line is compressed to the minimum required to represent the data. The length of the individual data fields and the total length of the data lines can vary. Each data line ends with a line break.

When data is unloaded, a data line in a source table of this format corresponds to exactly one data record in the target data stream.

When data is loaded, a data line in a source data stream of this format corresponds to exactly one data record in the target table.

Data Fields

Data fields in the data streams must have the external data type CHAR.

The individual data fields are separated by a freely selectable character (default value of the Loader: comma). They can also be encapsulated in freely selectable characters (default value of the Loader: double quotation marks).

If delimiters follow each other directly in a data line, then the value is the empty character string. If the relative position is larger than the number of values in the line, the value is also the empty character string.

Position Specification

The assignment of a data field of the data stream to a column in the table is determined by the position specification <field_pos> in a command for unloading or loading data. This specifies a relative position within the data record. It therefore specifies which value in a data record is to be loaded into or unloaded from a specific column.

When you unload data from the database to a target data stream, assign the position 1 to the first column in your list. The position numbers of the following columns rise by 1 each time. This also means that each position number can only be assigned once.

When you load data from a source table, the data fields in the target table in the database must be sorted in ascending order. You can also assign the same input values to different columns or even omit positions. If consecutive delimiters are detected or if the relative position is greater than the number of values in the line, the value is the empty character string.


FORMATTED (SAP Library - SAP DB)

 Entering content frame

Background documentation FORMATTED

FORMATTED (FWV, Fixed Width, Columnar Values) is a possible format of a data stream. As this format is not the default value of the Loader, it must be explicitly specified in an unload or load command.

The FORMATTED format can only be used for source data streams in plain text. Data streams with binary values must be loaded with the FORMATTED BINARY format.

customer.data

Position no.

1 2 3 4 5 6 7 8 9 .....

0 1 m i l l e r – 1 0 2 7 7 N e w   Y o r k - - -
0 2 s m i t h - 6 0 6 7 8 C h i c a g o - - - - -
0 3 k l e i n e r t 3 3 1 8 4 M i a m i - - - - -

The data fields have a uniform format.

FASTLOAD command:

FASTLOAD TABLE customer
  cno       01-02
  surname   03-10
  zip       11-15
  place     16-27
INFILE 'customer.data' FORMATTED

Data Lines

A data line in a data stream corresponds to a data record that you want to unload or load.

All data lines have the same fixed length. Each line in the data stream contains the individual data fields at the same position with a fixed length. Each data line ends with a line break.

Data Fields

The assignment between data fields in the data stream and the table columns is made using the position specification in a command for unloading or loading data.

Position Specification

The data fields in the data stream are described using their byte start and end position. The first possible byte start position is 1. Specifying an end position is optional. If no end position is specified for a data field, it has a length of 1.

The assignment between the data fields in the data stream and table columns can be made in any order. The order does not affect the processing speed.

The positions do not need to follow each other directly when you unload or load data. When it unloads data, the Loader fills any gaps with blank characters.


FORMATTED BINARY (SAP Library - SAP DB)

 Entering content frame

Background documentation FORMATTED BINARY

FORMATTED BINARY (FWV, Fixed Width, Columnar Values) is a possible format of a data stream. As this format is not the default value of the Loader, it must be explicitly specified in an unload or load command.

This format can be used to unload and load binary values.

The FORMATTED BINARY format is largely the same as the FORMATTED format. The only difference is that the length of a data record is only determined by the total length of the individual data fields.

customer.data

Position no. | 1 2 3 4 5 6 7 8 9 .....
 | 0 1 m i l l e r x 1 0 2 7 7 N e w Y o r k 0 2 s m i t h 6 0 6 7 8 C h i c a g o 0 3 k l e i n e r t 3 3 1 8 4 M i a m i

The data fields have a uniform format.

FASTLOAD command:

FASTLOAD TABLE customer
  cno       01-02
  surname   03-10
  zip       11-15
  place     16-26
INFILE 'customer.data' FORMATTED BINARY

Data Fields

The data fields can contain special characters and all have the same fixed length. This also applies to the individual data records.

The assignment between data fields in the data stream and table columns is made in accordance with the <field_pos> position specification in the unload or load command.

Unlike the FORMATTED format, a data record does not end with an additional line break.

Position Specifications

Data fields are described by their byte start and end positions. The first possible byte start position of a data record is 1. Specifying an end position is optional. If you do not specify an end position, the corresponding data field has a length of 1.

The data fields of the data stream can be assigned in any order to the table columns. The order does not affect the processing speed.

The positions do not need to follow each other directly when you unload or load data. When it unloads data, the Loader fills any gaps with blank characters.


PAGES (SAP Library - SAP DB)

 Entering content frame

Object documentation PAGES

PAGES is a possible format of a data stream . The application data is stored in pages .


RECORDS (SAP Library - SAP DB)

 Entering content frame

Object documentation RECORDS

RECORDS is a possible format of the data stream .

This is a proprietary SAP DB format.


Direction (SAP Library - SAP DB)

 Entering content frame

Background documentation Direction

Direction of the data stream

INSTREAM: From a Loader data stream to a SAP DB database instance

OUTSTREAM: From a SAP DB database instance to a Loader data stream


Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Data Types

With most loader commands for loading and unloading, you can specify the data type which the relevant field values in the data stream have or should have. This specification tells the Loader how to interpret the data in the data stream.

· When loading application data in a table, the specified external data types are converted to internal database types and the corresponding column values of a table are loaded.

· When unloading application data from a table, the internal database types are converted to the specified external data types and the corresponding column values are unloaded.

See also:

Converting Data Types

You cannot specify an external data type with the TABLELOAD and TABLEEXTRACT commands.

The external data type and the corresponding internal database data type of the column value in the target table do not have to be identical.

The database table article requires the internal database data type FIXED for the value in the ordered column.

The FASTLOAD command defines the external data type INTEGER for the column ordered.

FASTLOAD TABLE article
ano            01-08
des            09-39 CHAR
stock          40-43 INTEGER
min_ord        44-45 INTEGER
ordered        46-49 INTEGER
delivery_date  50-57 CHAR
price          58-65 DECIMAL(2)
weight         66-69 REAL
INFILE 'article.data' FORMATTED

The data in the column ordered is converted to the internal database data type FIXED when it is loaded.


Internal Database Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Internal Database Data Types

Internal database data types are the data types defined for the columns in the database table.

For an explanation of all internal database data types, see Reference Manual, Data Type (data_type) section.


External Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation External Data Types

External data types are the data types into which the Loader can convert internal database data types when it unloads application data, or they are the data types that the Loader converts into internal database data types when it loads data.

You can specify an external data type as a field specification in the unload or load command for each field value that you want to unload or load (see format_spec).

You cannot specify an external data type in the commands TABLEEXTRACT and TABLELOAD.

If no external data type is specified for a field value, the Loader selects the CHAR data type as the default for this field value. Therefore, if the field value does not have the data type CHAR or the data type CHAR is not desired, you must specify the data type.

The Loader can process the following external data types:

CHAR (plain text value) | ASCII, UCS2, or UTF8-coded, depending on the server, max. 254 Bytes long
INTEGER (Binary value) | Binary coded (server-specific), 1, 2, or 4 bytes long, sign in bit 0, negative values in two's complement notation
REAL (Binary value) | Floating point notation with mantissa and exponent, 4 or 8 bytes long, in server-specific notation
DECIMAL (Binary value) | Packed decimal: one digit per half byte, sign in extreme right half byte, 1 to 10 bytes long, maximum of 18 digits, the position of the decimal point is derived from the table column type
DECIMAL(n) (Binary value) | n specifies the number of digits on the right of the decimal point
ZONED (Binary value) | Zoned decimal: /370 zoned data format is permitted, the position of the decimal point is derived from the table column type
ZONED(n) (Binary value) | n specifies the number of digits on the right of the decimal point


Converting the Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Converting the Data Types

The SAP DB Loader can convert between numeric data types , if necessary.

You can use the external data type CHAR to read or output any internal database data type .

  • When loading data into a table, the specified external data type is converted to internal database data types and the corresponding column values of a table are loaded.
  • When unloading data from a table, the internal database types are converted to the specified external data types and the corresponding column values are unloaded.

 | External Data Type | Internal Database Data Type
Loading data to a database instance | INTEGER, DECIMAL, ZONED, REAL | FIXED , FLOAT , SMALLINT , INT[EGER]
Unloading data from a database instance | FIXED, SMALLINT, INTEGER | INTEGER, DECIMAL, ZONED, REAL
 | FLOAT | REAL or CHAR[ACTER]

DATALOAD TABLE article
   ano         01-08
   descr       09-39
   stock      40-43 INTEGER
   min_ord     44-45 INTEGER
   ordered     46-49 INTEGER
   del_date  50-57
   price       58-65 DECIMAL (2)
   weight      66-69 REAL
INFILE 'customer.data' FORMATTED


Unloading with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Unloading with External Backup Tools

If you use the loader commands DBEXTRACT or CATALOGEXTRACT ALL to unload data, then you can use an external backup tool.

Prerequisite

See Configuration of External Backup Tools for SAP DB.

Use the loader command SET BACKUPTOOL to specify the external backup tool for the loader session.

Procedure

You start to unload the data directly from the Loader. The Loader creates the pipes for unloading the backup data implicitly as part of the unload. These pipes must not exist before the unload.

Specify TAPE as the media type (mediumtype_spec).


Unloading LONG Values (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Unloading LONG Values

When unloading application data, there are special features, if values with the internal database data type LONG are unloaded.

In the syntax rule longfile_spec in longfile_spec_mlt , specify the name and path of the LONG data stream in which the LONG values are to be inserted.

You can use both variants of the syntax rule to unload the data.

  • Always use a column ID for the LONG column that you want to unload if a column ID is specified in the column list for this column (see output_column_list ).
  • Use the column name if the column name is specified in the column list.

DATAEXTRACT * FROM hotel
OUTFILE 'hotel.data'
LONGFILE info 'info.data'

DATAEXTRACT cno, name, zip, address, info FROM hotel
OUTFIELDS
   cno    1
   name     2
   zip      3
   address  4
   info     5
   OUTFILE 'hotel.data'
LONGFILE info 'info.data'

When you unload LONG values, you must differentiate between the following cases:

  • Each LONG Value to Be Unloaded in a Separate LONG Data Stream
  • All LONG Values to Be Unloaded in One LONG Data Stream


Each LONG Value to Be Unloaded in a Separate LONG Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation Each LONG Value to Be Unloaded in a Separate LONG Data Stream

Each LONG value to be unloaded from a column is written to a separate data stream .

In the command for unloading data, you specify the name of the LONG data stream with a number of placeholders for sequential numbering of the generated LONG data streams for each LONG column that you want to unload.

If the LONG column you want to unload has no value in a data record (the value is an empty character string), an empty LONG data stream is generated for this LONG value.

The generated unique media name enables the individual LONG data streams to be assigned to the corresponding data record in the target table.

Use a sufficient number of numeric characters at the end of the media name as a placeholder. If the upper limit of the numbering is reached while the data is being unloaded, but there are still values left to be unloaded, the SAP DB Loader generates an error message and terminates the command.

DATAEXTRACT * FROM hotel
   cno      1
   name     2
   info     3
OUTFILE 'hotel.data' FORMATTED
LONGFILE info 'info.data.###'

The SAP DB Loader generates the data stream with the name info.data.001 for the first LONG value to be unloaded, the data stream info.data.002 for the second, and so on.
Content of the target data stream:

10,Excelsior,'info.data.001'
30,Flora, 'info.data.002'
60,Bellevue,'info.data.003'

See also:

Unloading LONG Values

All LONG Values to Be Unloaded in One LONG Data Stream


All LONG Values to Be Unloaded in One LONG Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation All LONG Values to Be Unloaded in One LONG Data Stream

All LONG values to be unloaded from a column are written in one data stream.

In the command for unloading data you enter the name of a data stream for each LONG column, into which the each of the LONG values of this LONG column to be unloaded are entered.

If the LONG column you want to unload has no value in a data record (the value is an empty character string), the position specification for this LONG value is generated as follows: the start position is the end position of the preceding LONG value in the column plus 1; the end position is the end position of the preceding LONG value in the column. This means that the start position is always one value larger than the end position.

The start and end position of the generated LONG value in the data stream enable the LONG values to be assigned to data records.

DATAEXTRACT * FROM hotel
OUTFIELDS
   hno      1
   name     2
   info     3
OUTFILE 'hotel.data'
LONGFILE info 'info.data'

Content of the target data stream:

10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360

See also:

Unloading LONG Values

Each LONG Value to Be Unloaded in a Separate LONG Data Stream


HEX Values (SAP Library - SAP DB)

 Entering content frame

Background documentation HEX Values

You can use the additional specification HEX to describe an external data type as a hexadecimal value.

This enables you to load or unload all data types in hexadecimal form. Every byte of data in the result is then represented by two hexadecimal numbers. Every value in the data stream then occupies twice as much space as the value of the same data type without the specification as a HEX value.

FASTLOAD TABLE customer
  cno       01-03 CHAR HEX
  name    04-12 CHAR HEX
  zip       13-17 INTEGER HEX
  place     18-29 CHAR HEX
INFILE 'customer.data' FORMATTED

DATALOAD TABLE article IF POS 40-47 INTEGER HEX > '0'
  ano       01-08
  descr     09-39 NULL IF POS 09-11 = ' '
  stock     40-47 INTEGER HEX
  min_ord   47-48 INTEGER
  price     48-55 DECIMAL (2)
  weight     56-59 REAL
INFILE 'article.data' FORMATTED


Plain Text Values (SAP Library - SAP DB)

 Entering content frame

Background documentation Plain Text Values

Field values with the external data type CHAR are plain text values; that is, these values consist of readable characters.

  • Plain text values can conform to different specifications: ASCII, UCS2 or UTF8 (data format code_spec ).
  • You can specify the data formats for plain text values that represent the date, time, or a timestamp ( date_spec , time_spec , timestamp_spec ).

You can specify these data formats in load and unload commands as a processing specification for the data stream (syntax rule stream_format_spec ).

Plain text values can be used to input data into columns of any internal data type used by the database and can be converted to any data type. If you want to load plain text values into numerical columns, the values must be able to be interpreted as numbers.


Loading with External Backup Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Loading with External Backup Tools

If you use the loader commands DBLOAD or CATALOGLOAD ALL to load data, then you can use an external backup tool.

Prerequisite

See Configuration of External Backup Tools for SAP DB.

Use the loader command SET BACKUPTOOL to specify the external backup tool for the loader session.

Procedure

You start to load the data directly from the Loader.

Specify the external backup ID (TAPE <ebid_spec>) as the media type (mediumtype_spec).


Loading Binary Values (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Loading Binary Values

All numeric external data types (INTEGER, REAL, DECIMAL, ZONED) are interpreted as binary values .
These can be converted to any of the internal database data types (FIXED, SMALLINT, INTEGER, FLOAT) ( Converting Data Types ).

  • Data of the data type INTEGER is always interpreted as signed values by the SAP DB Loader. Use the syntax rule <int_spec> to specify how these values are represented in the source data stream .
  • Data of the data type REAL is coded in host-specific format and cannot be transported between different operating systems and computer platforms without being converted again.

You can use the FASTLOAD command and the DATALOAD command to load external binary values into database tables.

DATALOAD TABLE hotel
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED

Prerequisites

You must specify the source data stream in the load command with either the FORMATTED format or the FORMATTED BINARY format. The data stream must be coded in binary.


Loading LONG Values (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Loading LONG Values

In a command for loading application data, use the syntax rule longfile_spec in longfile_spec_mlt to specify for each column with the internal database data type LONG the name and path of the data stream from which you want to load the LONG values.

When you load LONG values, you can only use the LONGFILE <valCOLUMN_NAME> '<valFILE_NAME>' variant of the syntax rule, since you can only use column names in the load command, and no column IDs (see: column_descriptor ).

When you load LONG values, you must differentiate between the following cases:

  • Each LONG Value to Be Inserted in a Separate LONG Data Stream
  • All LONG Values to Be Inserted in One LONG Data Stream


Each LONG Value to Be Inserted in a Separate LONG Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation Each LONG Value to Be Inserted in a Separate LONG Data Stream

Each LONG value to be inserted into a column is in a separate data stream .

In the data stream, you specify the names of the data streams that contain the LONG values instead of the column values (if necessary, also entering position specifications). The entire data streams or parts of them are loaded as LONG values.

Complete data stream is loaded as LONG values

DATALOAD TABLE sqltravel10.hotel
   hno      1
   name     2
   info     3
INFILE 'hotel.data'

Content of the data stream:

10,Excelsior,'EXCELSIOR.LNG'
30,Flora,'FLORA.LNG'
60,Bellevue,'BELLEVUE.LNG'

Parts of the data stream are loaded as LONG values.

DATALOAD TABLE sqltravel10.hotel
   hno      1
   name     2
   info     3
INFILE 'hotel.data'

Content of the data stream:

10,Excelsior,'EXCELSIOR.LNG' 1-880
30,Flora,'FLORA.LNG' 8-1046
60,Bellevue,'BELLEVUE.LNG' 100-260

Specifying a Code Attribute

You can optionally specify a code attribute in the load command for all data streams that contain LONG values that are to be loaded. You can only enter a single code attribute for all data streams. You cannot specify a code attribute for each individual specified data stream.

Code Attribute for a Data Stream with LONG Values

Specifying the Code Attribute ASCII

DATALOAD TABLE sqltravel10.hotel
   hno      1
   name     2
   info     3
INFILE 'hotel.data'
LONGFILE info ASCII

Content of the data stream:

10,Excelsior,'EXCELSIOR.LNG'
30,Flora,'FLORA.LNG'
60,Bellevue,'BELLEVUE.LNG'

No media name can be used after the keyword LONGFILE.

See also:

Loading LONG Values

All LONG Values to Be Inserted in One LONG Data Stream


All LONG Values to Be Inserted in One LONG Data Stream (SAP Library - SAP DB)

 Entering content frame

Background documentation All LONG Values to Be Inserted in One LONG Data Stream

All LONG values to be inserted into a column are in one data stream .

Variant 1

In the data stream, you specify the name of the data stream containing the LONG values with the start and end position of the LONG value to be loaded, instead of a column value.

DATALOAD TABLE sqltravel10.hotel
   hno      1
   name     2
   info     3
INFILE 'hotel.data'

Content of the data stream:

10,Excelsior,'HOTEL.LNG' 1-880
30,Flora,'HOTEL.LNG' 881-1046
60,Bellevue,'HOTEL.LNG' 1047-1360

Variant 2

You specify the name of the data stream that contains the LONG values after the keyword LONGFILE. In the data stream itself, specify only the position specifications without a preceding data stream name.

DATALOAD TABLE sqltravel10.hotel
   hno     1
   name    2
   info    3
INFILE 'hotel.data'
LONGFILE info 'HOTEL.LNG'

Content of the data stream:

10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360

Specifying a Code Attribute for the Media Specified with LONGFILE

In the load command, you can optionally specify a code attribute for data streams specified with LONGFILE.

Code Attribute for a Data Stream LONG Values

Specifying the Code Attribute ASCII

DATALOAD TABLE sqltravel10.hotel
   hno      1
   name     2
   info     3
INFILE 'hotel.data'
LONGFILE info 'HOTEL.LNG' ASCII

Content of the data stream:

10,Excelsior,1-880
30,Flora,881-1046
60,Bellevue,1047-1360

See also:

Loading LONG Values

Each LONG Value to Be Inserted in a Separate LONG Data Stream


Code Attribute for a Data Stream with LONG Values (SAP Library - SAP DB)

 Entering content frame

Background documentation Code Attribute for a Data Stream with LONG Values

If you do not specify a code attribute in the command, the SAP DB Loader uses a default value for the code attribute of the data stream. This is derived from the internal database data type of the column to be loaded. The following conversion table is used:

Internal Database Data Type | External Code Attribute
LONG ASCII | ASCII
LONG BYTE | BINARY
LONG UNICODE | UCS2

If the external code attribute and the internal database data type are different, the SAP DB Loader converts the data. If the types are incompatible, the SAP DB Loader generates an error message and stops processing the command.

Compatibility Table

External Code Attribute | Internal Database Data Type | Compatible yes/no
ASCII | LONG ASCII LONG BYTE LONG UNICODE | yes yes yes
UCS2 | LONG ASCII LONG BYTE LONG UNICODE | no yes yes
BINARY | LONG ASCII LONG BYTE LONG UNICODE | no no yes

Use

Each LONG Value to Be Inserted in a Separate LONG Data Stream

All LONG Values to Be Inserted in One LONG Data Stream


Medium (SAP Library - SAP DB)

 Entering content frame

Background documentation Medium

The Loader uses a medium to physically store the data stream outside the database. If you unload or load data with the Loader, the data source and data target are SAP DB databases and media.

The Loader differentiates between the media types specified in mediumtype_spec.


Metadata of the Application Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Metadata of the Application Data

The metadata of the application data (Metadata of the type DATA) are defined in the data streams using SAP DB Loader commands and SQL statements .

The SAP DB Loader stores this information in the system tables , if the transformation spans multiple tables.

The corresponding data is stored in the SAP DB database instance in the form of pages or rows and in a data stream in the non-readable formats PAGES and RECORDS or in the readable formats FORMATTED , COMPRESSED and LONG.

If the data are transformed to the format of rows, columns of the external data type CHAR with the code attribute ASCII can be transformed to values of data fields with the code attribute ASCII, UCS-2 or UTF-8.


Metadata of the Database Catalog (SAP Library - SAP DB)

 Entering content frame

Background documentation Metadata of the Database Catalog

Metadata of the database catalog (Metadata of the type CATALOG) describe the structure of the data in the database catalog.

The SAP DB Loader stores this information in its system tables , if the transformation spans multiple tables.

The corresponding data is stored in the SAP DB database instance in the form of rows in the system tables and in a data stream in the form of SQL statements for data definition.


Metadata of the Transformations (SAP Library - SAP DB)

 Entering content frame

Background documentation Metadata of the Transformations

The metadata of the transformations (Metadata of types CONFIGURATION and PACKAGE) are declared in the form of commands or in the form of SAP DB Loader-specific system tables .

This metadata describes the configuration and the runtime behavior of the transformations that span multiple tables.

The corresponding data, such as user and table names, is stored, sorted by referential constraint conditions.

In the SAP DB database instance, the data is stored in the form of rows in the system tables and in a data stream in the readable format COMPRESSED .


Selecting Data Records (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Selecting Data Records

When you load application data, you can select the data records according to their contents.

The conditions defined here can be negated with NOT, linked with AND and OR, or encapsulated as required. The SAP DB Loader weights the operators accordingly.

See also:

condition

if_condition

You want to load only those data records from the source data stream hotel.data into the target table hotel that satisfy the following conditions:

The price in the data record is less than 400.00 ( IF).
The name of the hotel is not City ( NOT).
The hotel is located in BERLIN ( AND).
The zip code is 13125 or 13126 ( OR):

DATALOAD TABLE hotel
  IF POS 41-44 REAL < '400.00'
  AND
     POS 27-36 = 'BERLIN'
  AND
    (POS 20-25 = '13125' OR POS 20-25 = '13126')
  AND NOT
     POS 09-18 = 'City'
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED

You want to load only those data records from the source file hotel.data into the target table hotelwhere the price is not more than 400.00:

DATALOAD TABLE hotel
  IF NOT POS 41-44 REAL > '400.00'
      hno     01-04 INTEGER
      name    09-18
      zip     20-25 DECIMAL
      city    27-36
      price   41-44 REAL
INFILE 'hotel.data' FORMATTED


SQL Studio (SAP Library - SAP DB)

 Entering content frame

Component documentation SQL Studio

SAP DB is a relational database system with an SQL-compatible user interface.

"Relational" means that SAP DB provides all its information to users in the form of tables. The standard language SQL (Structured Query Language) provides a set of instructions with which you can manage, update, and analyze these tables.

SQL Studio provides easy access to the data held in a SAP DB database instance. As well as its use as a query definition tool, SQL Studio is a comfortable tool, both for application programmers who want to test SQL statements, and also for database designers who can benefit from the graphical support it provides for the creation and modification of database objects.

You can use SQL Studio for the following tasks:

· Creating and managing database tables, indexes, and sequences, and managing stored SQL statements, database users, and database procedures with the Catalog Manager

· Creating and executing SQL statements in the SQL Dialog

· Selecting and editing data records in a screen display with the Form Dialog

· Formulating database queries with the help of visual tools in the Visual Query Dialog

The SQL Studio as it is described here can be used on Microsoft Windows operating systems only. For other operating system platforms you can use the Web SQL Studio.

You can download the SQL Studio program free of charge from the following Internet address: www.sapdb.org.

For general information about the SAP DB database system, see the documentation The SAP DB Database System at the following Internet address: www.sapdb.org ® Documentation.


Starting SQL Studio (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting SQL Studio

Procedure

To start SQL Studio, choose Start ® Programs ® SAP DB ®SQL Studio.

Starting from the command line

You can also start SQL Studio from the command line. If you do launch SQL Studio from the command line, you can also specify options for it.

...

...

1. Switch to the directory where the program sqlsto.exe is located.

2. Enter the following command: sqlsto [<options>].

You can use the following options:

-? | Display all command line options
-version | Display information on software version
-n <server_name> | Name of database server
-d <database_name> | Name of the database instance
-u <user_name[,password]> | User name and password
-c oracle | SQL mode ORACLE. After starting the SQL Studio, you can also change the SQL mode in the user settings.
-t <trace_file> | Generate a log file for logging SQL statements (see also ODBC Manual: SAP DB)


Opening a Database Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Database Session

Use

Before you can use SQL Studio to access the data in a database instance, you must establish a connection with the database server and log on to the database.

When you do so, you can suppress the timeout behavior of the database if you want to. Over a longer period of time, inactive database connections are therefore no longer automatically terminated.

Procedure

...

1. If you want to suppress the timeout behavior of the database, first activate the No Timeout checkbox in the toolbar.

2. Choose Session ® Connect.

3. Enter the name of the database server and the database instance.

4. Enter your user name and password, and choose OK.

When you enter the user name and password, the system automatically uses upper case. If you want the system to differentiate between upper and lower case, you must put quotation marks around your user name and password. The quotation marks are also necessary if the user name or password includes special characters. Quotation marks must not be used as part of the user name or password itself.

Result

The system establishes a connection with the database. The current session is entered in the recent sessions list.

You can also open a new database session directly in the same window by using the recent sessions list. The current session is then closed.

If you want to open an additional database session in a new window, choose Session ® New SQL Studio.


Recent Sessions List (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Recent Sessions List

Use

You can open a new database session directly from the recent sessions list.

The list contains up to 10 sessions. Depending on your user settings, the password may be stored for these sessions.

Procedure

Choose Session and then the required session.

· If the password was stored for the selected session, the system connects directly to the database.

· If the password was not stored for the selected session, you must enter the password. The system then connects to the database.

You can delete the list of recent SQL Studio sessions if no current session is open. To do this, choose Session ® Clear Recent Sessions.


Logging Off from the Database (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Logging Off from the Database

To end a current database connection, choose Session ® Disconnect.

You may want to log off if, for example, you are only authorized to connect to the database once and you want to log on to it from another SAP DB component without ending the SQL Studio program.

If you want to re-logon, or log on with a different user or options, you do not need to log off first. The system automatically closes the existing connection to the database as soon as you log on again with Session ® Connect or via the recent sessions list .


User Settings (SAP Library - SAP DB)

 Entering content frame

Procedure documentation User Settings

Use

You can personalize the settings in SQL Studio during operation. These settings are stored when you exit SQL Studio.

Procedure

To change your settings, choose Session ® Settings.

You can now make your changes.

General

Store Password | The system stores the password that you used at logon for the next logon.
Confirmation for saving SQL Studio Objects | When the dialog window closes, the system asks whether you want to save the newly created SQL Studio object.
Open Form Dialog read only | Form dialogs are opened in read-only mode first.
Remove failed connection attempts from Recent Sessions list | The system deletes the failed attempts from the recent sessions list.
Identifiers in Create Dialogs uppercase | When you create a new SQL Studio object, the system automatically converts the entries to uppercase.

Result window

Limit for long columns (Bytes) | The number of bytes that should be loaded from the database for a LONG column
Limit for binary zoom (Bytes) | Number of bytes that are displayed when zooming in the LONG column of a result table
Representation of null value | How the NULL value is displayed
Clipped result view (Internal Mode) | Result set displayed in segments
Replace non chars in long columns | ASCII codes < 32 are replaced by a blank character when LONG columns are displayed.
Copy columns tab separated to clipboard | When results are temporarily stored on the clipboard, the system separates the columns with tabs.
Copy Result with Column Header | When the results are copied, the system also copies the column headers.
Append Exported Data to File | When you export a result table into a file, the content of this result table is attached to the existing file content.

Catalog Manager

Selected table types | Specifies which table types are displayed in the Catalog Manager
Path for local folder | Path to be used to save SQL Studio Objects in a local folder
Restore catalog state | When you log on to the database again, the last view of the Catalog Manager is restored.
Convert input for catalog filter to uppercase | The system automatically converts filter entries in the Catalog Manager to upper case

Query Dialog

Isolation Level | Isolation level for creating SQL statements
SQL mode | SQL mode for creating SQL statements in the SQL dialog The SQL mode INTERNAL is always used for the Form dialog and the Visual Query dialog.
Execute Statements Asynchronously | SQL statements are executed asynchronously. You can specify a period of time (in milliseconds) during which the SQL Studio is inactive when SQL statements are executed.

If you have the user attribute EXCLUSIVE, you cannot change the standard settings for the isolation level and SQL mode. In this case, SQL Studio automatically works with the isolation level COMMITTED and in SQL mode INTERNAL.

For an explanation of the user attributes, see the authorization section of the Reference Manual.


Catalog Manager (SAP Library - SAP DB)

 Entering content frame

Object documentation Catalog Manager

The Catalog Manager is displayed in the left-hand area of the SQL Studio window. It displays all directories and database objects which you are authorized at least to read:

SQL Studio Objects | Stored SQL statements and draft database tables
Tables | Database and system tables, view tables and synonyms arranged according to user
Indexes | Indexes that have been created for tables, arranged according to table and owner
Number sequences | Generated number sequences, arranged according to owner
Favorites | Database tables selected by the user
Users | All users for which the user logged onto the database has owner rights
Database Procedures | Database procedures that the user created in the database
Triggers | Triggers that the user created in the database

If you want the Catalog Manager to show you certain objects only, specify a filter for the object names. Enter the first few letters of the name that you want to use as a filter, and choose Catalog Manager ® Refresh. However, the filter does not apply to your saved SQL statements and drafts.

To show or hide the Catalog Manager, choose View ® Catalog Manager.


SQL Studio Objects (SAP Library - SAP DB)

 Entering content frame

Object documentation SQL Studio Objects

You can store SQL statements and drafts of database tables as SQL Studio objects in the database on locally in the Local Folder subdirectory. This means that you can use the objects at a later date.

Creating SQL Studio Objects

· To create a new folder for SQL Studio objects in the database using the Catalog Manager, choose Catalog Manager ® New ® Folder.

· To create SQL statements and store them as SQL Studio objects, use the SQL dialog, the Form dialog or the Visual Query dialog.

· To store drafts of database tables as SQL Studio objects, create the table definition with the Catalog Manager.

You can enter the path for the Local Folder in the user profile settings.

Editing and Executing SQL Studio Objects

· To edit a stored SQL Studio object, select the object and choose Catalog Manager ® Open Object Definition.

· To use a stored SQL Studio object in dialogs or a table definition, select the object. Choose Catalog Manager ® Send Object To and then the relevant dialog type.

· To execute the SQL statements of a stored SQL Studio object directly, select the object and choose Catalog Manager ® Execute. The system displays the result table in a separate window. If an error occurred, an error message is displayed in the status window of the SQL Studio. Depending on your settings, additional information such as the time it took to execute your SQL statements is also displayed there.

Renaming and Deleting SQL Studio Objects

· To rename a stored SQL Studio object, select the object and choose Catalog Manager ® Rename Object.

· To edit a stored SQL Studio object, select the object and choose Catalog Manager ® Drop Object.


Tables (SAP Library - SAP DB)

 Entering content frame

Object documentation Tables

Under Tables, the Catalog Manager displays the database tables, view tables and synonyms that you have access to in accordance with your user settings. The entries are arranged by owner.

You can create and edit database tables. You can create, rename, and delete view tables and synonyms.

· Creating a database table

· Creating a view table

· Creating a synonym

· Displaying the definition of a table

· Changing the definition of a database table

· Displaying the content of a table

· Using a Table in Dialogs or Definitions

· Renaming a table

· Deleting all rows of a table

· Deleting a table


Creating a Database Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Database Table

Use

You can use SQL Studio to create new database tables in the database that you are logged on to. When you do so, you can use existing database tables or stored SQL Studio objects as a template for new database tables.

Prerequisites

You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

...

1. Choose Catalog Manager ® New ® Table Definition.

The system opens a window for table definition.

2. To use an existing database table or a saved SQL Studio object as a template for your new database table, choose Table Definition ® Get Table. Select the relevant table or the SQL Studio object, and choose OK to confirm.

3. Enter a table name.

4. Carry out the following steps:

¡ Defining Columns

¡ Defining Constraints for Columns

¡ Defining Foreign Key Dependencies

¡ Defining Miscellaneous Information

5. To use or edit your table draft again later, save it as an SQL Studio object by choosing Table Definition ® Save As.

6. Choose Table Definition ® Create Table. The system creates the new table in the database.

7. To export the SQL statement for creating the database table to the SQL dialog, choose Table Definition ® Export to SQL Dialog.

For information on the syntax of CREATE TABLE statements, see the section CREATE TABLE Statement of the Reference Manual.


Defining Columns (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining Columns

Use

This section shows you how to define a table column when you create a database table or change a table definition.

Procedure

...

1. In the Name field, enter a name for the column, and confirm it with Enter.

2. In the Datatype field, select the relevant data type.

3. Depending on the data type, you can specify additional properties:

¡ Dimension (Dim)

¡ Code type(Code)

¡ Column is key column

¡ Columns may not contain NULL values (Not NULL)

¡ Default value for column value (Default)

¡ Uniqueness of column values (Unique)

¡ Comment

· To insert a new column, choose New Column. The new column is added to the end of the table.

· To insert a new column and at the same time copy the definition of existing columns in the same table, select the required columns, and choose Clone Column. The new column is added to the end of the table.

· To insert new columns and copy the definition of existing columns from existing tables, choose Import Column. A window opens, containing all columns defined by the current user. Select one or more columns and choose OK. The new column is added to the end of the table.

· In order to remove a column from the table, select the column and choose Remove Column.

You can change the columns sequence by selecting one or more columns and moving them upwards or downwards using the arrows Ý ß.


Defining Constraints (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining Constraints

Use

This section shows you how to define constraints for table columns when you create a database table or change a table definition. A constraint for the values of a column is composed of one or more conditions that you formulate line-by-line and can link together.

Prerequisites

You have already defined the table columns.

You can only formulate constraints for columns with valid column definitions.

Procedure

1. In the Name field, enter a name for the constraint (optional).

2. In the Column field, select the column that you want to formulate the condition for.

3. In the Predicate field, select a predicate for the condition. To negate the condition, use the NOT operator !. Negation is not possible with relational operators.

4. In the Expression field, enter the relational expression for the condition, and confirm it with Enter.
When you enter the relational expression, you can choose between the following options:

Option | Meaning
Single Value | The expression consists of a single value.
ALL | The condition must be fulfilled with all expressions in the list (Expression List).
ANY | The condition must be fulfilled with at least one expression in the list (Expression List).
DEFAULT | The expression consists of the default value of the column.

5. Enter how the formulated condition is to be linked with the next condition (AND/OR).

If you retrospectively reset the relation type to <none>, all subsequently formulated conditions are deleted immediately.

6. To insert a new constraint, choose New Constraint.

7. To insert new constraints and at the same time copy the definition of existing constraints in the same table, select the required constraints, and choose Copy Constraint.

8. To insert new constraints and copy the definition of existing constraints from existing tables, choose Import Constraint. A window opens, containing all constraints defined by the current user. Select one or more constraints and choose OK to confirm.

9. In order to delete a constraint, select the constraint and choose Remove Constraint.


Defining Foreign Key Dependencies (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining Foreign Key Dependencies

Use

This section shows you how to define foreign key dependencies to other database tables when you create a database table or change the table definition. Foreign key dependencies describe the dependencies between the data of two tables.

Prerequisites

You have already defined the table columns.

Procedure

1. In the field Foreign Key Name, enter the name for the foreign key (optional).

2. In the field Referencing Columns, choose the referencing column, and confirm with Enter.

3. Copy the referenced database table from the Catalog Manager into Reference by using Drag&Drop. Select the column that is referenced and confirm with Enter.

4. In the On Delete field, select how you want the referenced table to behave if a data record in the referencing table is deleted (DELETE rule).

5. In the Comment field, enter a comment (optional).

6. To add a new link, choose New Foreign Key.

7. To insert new links and at the same time copy the definition of existing links of the same table, select the required links, and choose Copy Foreign Key.

8. To insert new links and copy the definition of existing links from existing tables, choose Import Foreign Key. A window opens, containing all links defined by the current user. Select one or more links and choose OK.

9. To delete a link, select it and choose Remove Foreign Key.

For information on the syntax of referential CONSTRAINT definitions, see the referential CONSTRAINT definition section of the Reference Manual: SAP DB.


Defining Miscellaneous Information (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining Miscellaneous Information

When you create database tables or change table definitions, you can make the following additional entries in the Misc field:

Entry | Meaning
Comment | Comment
Duplicates | You can use the DUPLICATES clause to control behavior if key collisions occur.
Statistics | Sample Value specifies how large the portion of data is that is included for optimization of the database strategy.
Temporary Table Ignore Rollback | The table is a temporary table and is saved locally under Temp. For temporary tables, you can specify the option Ignore Rollback.
Identifiers Uppercase | Automatic conversion of table names, column headers and other names into upper case. A change to this setting affects the entire table definition immediately. If you use a database table as a template for the creation of another database table, the user setting is copied from the template.

For information on the syntax of CREATE TABLE statements, see the section CREATE TABLE Statement of the Reference Manual.


Creating a View Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a View Table

Use

You can use SQL Studio to create view tables.

Prerequisites

· If you want the view table to be based on a database query, you must have already saved this query as an SQL Studio object.

· You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

...

1. Choose Catalog Manager ® New ® View Definition.

A window for defining the view table is opened.

2. To use a database table as a basis for the view table, choose View Definition ® Get Table. Select the relevant database table, and choose OK to confirm.

3. To use the structure of the hit list of a database query as a basis for the view table, copy the saved database query from the Catalog Manager into the definition window by using Drag&Drop.

4. Enter a name for the view table.

5. If you want to rename the columns of your view table, enter the new column names in Alias in View.

6. Select the required options:

Replace Existing View | Replace the existing view table
Check on Insert or Update | Check the view conditions when changing values
Identifiers Uppercase | Automatic conversion of table names and column headers into uppercase

7. Choose View Definition ® Create View.

To export the SQL statement for creating the view table to the SQL dialog, choose View Definition ® Export to SQL Dialog.

For information on the syntax of CREATE VIEW statements, see the CREATE VIEW Statement section of the Reference Manual: SAP DB.


Creating a Synonym (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Synonym

Use

You can use SQL Studio to create synonyms for database tables.

Prerequisites

You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

1. In the Catalog Manager select the database table that you want to create a synonym for, and choose Catalog Manager ® New ® Synonym Definition.
A window for defining the synonym is opened.

2. Enter a synonym name, and select whether the synonym is to be private or public.

3. Choose Synonym Definition ® Create Synonym.

To export the SQL statement for creating the synonym to the SQL dialog, choose Synonym Definition ® Export to SQL Dialog.

For information on the syntax of CREATE SYNONYM statements, see the CREATE SYNONYN Statement section of the Reference Manual: SAP DB.


Displaying the Definition of a Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Definition of a Table

Use

You can use SQL Studio to display the definition of a database table, view table, or synonym.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the User Manual.

Procedure

1. In the Catalog Manager, select the table that you want to display the definition of.

2. Choose Catalog Manager ® Open Object Definition.


Changing the Definition of a Database Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing the Definition of a Database Table

Use

You can use SQL Studio to change the definition of a database table.

Prerequisites

You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

...

1. Select the table and choose Catalog Manager ® Alter Table.

The system opens a window for table definition.

2. Make the required changes:

· Defining Columns

· Defining Constraints for Columns

· Defining Foreign Key Dependencies

· Defining Miscellaneous Information

3. Choose Table Definition ® Alter Table.

To export the SQL statement for changing the database table to the SQL dialog, choose Table Definition ® Export to SQL Dialog.

For information on the syntax of ALTER TABLE statements, see the ALTER TABLE Statement section of the Reference Manual: SAP DB.


Displaying the Content of a Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Content of a Table

Use

You can use SQL Studio to display the content of a table.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the table that you want to display the content of.

2. Choose Catalog Manager ® Show Content.


Using a Table in Dialogs or Definitions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Using a Table in Dialogs or Definitions

Use

You can copy tables directly from the Catalog Manager into an SQL dialog, a form dialog, or a Visual Query dialog. You can also use tables as the basis for a table definition or view definition.

Procedure

Select the table in the Catalog Manager. Choose Catalog Manager ® Send Object To and then the relevant dialog type.


Renaming a Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Renaming a Table

Use

You can use SQL Studio to rename tables.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the table that you want to rename.

2. Choose Catalog Manager ® Rename Object and enter the new name.


Deleting all Rows of a Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting all Rows of a Table

Use

You can use SQL Studio to delete all rows of a table.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the table for which you want to delete the rows.

2. Choose Catalog Manager ® Delete All Rows

If you delete the rows of a synonym, you thereby delete the rows of the original database table.


Deleting a Table (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting a Table

Use

You can use SQL Studio to delete a table from the database.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the table that you want to delete from the database.

2. Choose Catalog Manager ® Drop Object.


Indexes (SAP Library - SAP DB)

 Entering content frame

Object documentation Indexes

Under Indexes, the Catalog Manager displays all the tables that indexes have been created for. The following options are available:

  • Creating an index
  • Displaying the definition of an index
  • Deleting an index


Creating an Index (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating an Index

Use

You can use SQL Studio to create new indexes for database tables.

Prerequisites

You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

...

1. In the Catalog Manager select the database table that you want to create an index for, and choose Catalog Manager ® New ® Index Definition.

2. In the Index Name field, enter a name for the index.

3. In the In Index field, choose Yes for the columns that you want to index values for.

4. To sort the index values in ascending or descending order, select the option ASC or DESC in the Sort field.

5. To change the sequence of the table columns, select a table column and use the Ý ß, arrows to move it up or down.

6. Select the required options:

Unique | Ensures the uniqueness of the indexed columns
Index Name Uppercase | Automatic conversion of table names and column headers into upper case

7. Choose Table Definition ® Create Index.

8. To export the SQL statement for creating the index to the SQL dialog, choose Index Definition ® Export to SQL Dialog.

For information on the syntax of CREATE INDEX statements, see the CREATE INDEX Statement section of the Reference Manual: SAP DB.


Displaying the Definition of an Index (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Definition of an Index

Use

You can use SQL Studio to display the definition of an index.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the index that you want to display the definition of.

2. Choose Catalog Manager ® Open Object Definition.


Deleting an Index (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting an Index

Use

You can use SQL Studio to delete the index of a database table.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the index that you want to delete.

2. Choose Catalog Manager ® Drop Object.


Number Sequences (SAP Library - SAP DB)

 Entering content frame

Object documentation Number Sequences

Under Sequences , the Catalog Manager displays all the sequences that were created in the database. The following options are available:

  • Creating a sequence
  • Displaying the definition of a sequence
  • Deleting a sequence


Creating a Sequence (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating a Sequence

Use

You can use SQL Studio to create new sequences in the database.

Prerequisites

You have the necessary user authorizations and the user attribute NOT EXCLUSIVE.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System and the Authorization section of the Reference Manual.

Procedure

...

1. Choose Catalog Manager ® New ® Sequence Definition.

2. Enter a name for the sequence, and define the required values.

3. Choose Sequence Definition ® Create Sequence.

4. To export the SQL statement for creating the sequence to the SQL dialog, choose Sequence Definition ® Export to SQL Dialog.

For information on the syntax of CREATE SEQUENCE statements, see the CREATE SEQUENCE Statement section of the Reference Manual: SAP DB.


Displaying the Definition of a Sequence (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying the Definition of a Sequence

Use

You can use SQL Studio to display the definition of a sequence and the most recently generated value of this sequence.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the sequence that you want to display the definition of.

2. Choose Catalog Manager ® Open Object Definition.


Deleting a Sequence (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting a Sequence

Use

You can use SQL Studio to delete sequences from the database.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the Catalog Manager, select the sequence that you want to delete.

2. Choose Catalog Manager ® Drop Object.


Favorites (SAP Library - SAP DB)

 Entering content frame

Object documentation Favorites

So that you can access database objects quickly and easily, you can store them in the Favorites folder in the Catalog Manager.

· To store a database object in the Favorites folder, select the required database object and choose Catalog Manager ® Add to Favorites.

· To remove a database object from the Favorites folder, select the relevant database object and choose Catalog Manager ® Remove from Favorites.

· To remove all database objects from the Favorites folder, select the Favorites folder and choose Catalog Manager ® Clear Favorites.


User (SAP Library - SAP DB)

 Entering content frame

Object documentation User

Under Owned Users, the Catalog Manager displays the users for which you have owner rights. SQL Studio enables you to view information about these users, and rename and delete users.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

· To display information about a user, select the user name, choose Catalog Manager ® Open Object Definition.

· To change a user name, select it and choose Catalog Manager ® Rename Object.

· To delete a user, select the user name, and choose Catalog Manager ® Drop Object.


Database Procedures (SAP Library - SAP DB)

 Entering content frame

Object documentation Database Procedures

Under Procedures, the Catalog Manager displays all the database procedures that were created in the database. You can use SQL Studio to display the definitions of these database procedures, and to delete the database procedures.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System.

Procedure

· To display a database procedure, choose Catalog Manager ® Open Object Definition.

· To delete a database procedure, select it and choose Catalog Manager ® Drop Object.

For information on the syntax of CREATE DBPROC statements, see the CREATE DBPROC Statement section of the Reference Manual: SAP DB.


Triggers (SAP Library - SAP DB)

 Entering content frame

Object documentation Triggers

Under Triggers, the Catalog Manager displays all the triggers that were created in the database. You can use SQL Studio to display the definitions of these triggers, and to delete the triggers themselves.

Prerequisites

You have the required user authorizations.

For an explanation of user authorizations and user attributes, see the User Concept section of the documentation The SAP DB Database System.

Procedure

· To display the definition of a trigger, select it and choose Catalog Manager ® Open Object Definition.

· To delete a trigger, select it and choose Catalog Manager ® Drop Object.

For information on the syntax of CREATE TRIGGER statements, see the CREATE TRIGGER Statement section of the Reference Manual: SAP DB.


SQL Dialog (SAP Library - SAP DB)

 Entering content frame

Function documentation SQL Dialog

If you want to create SQL statements directly in SQL, you use the SQL dialog.

The following options are available in the SQL dialog:

· Creating and executing SQL statements

· Setting parameters for SQL statements

· Importing and exporting SQL statements

For information on the syntax and semantics of the SQL statements of the SAP DB database system, see the Reference Manual: SAP DB.


Creating and Executing SQL Statements (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating and Executing SQL Statements

Use

In the SQL dialog, you can create and save SQL statements in a number of different modes.

Procedure

1. Choose View ® SQL Dialog. The system opens a window for the SQL dialog.

2. The default values that you set in the user settings are used for the SQL mode and the isolation level. If you want to use different values, select a different SQL mode and isolation level in the lower part of the dialog box.

3. You can also change the commit mode in the lower part of the dialog box.

If you have the user attribute EXCLUSIVE, you can select the mode Auto Commit: ON only. For an explanation of the user attributes, see the authorization section of the Reference Manual.

4. Enter your SQL statements.

You can add SQL statements that were already executed during the current database session. Choose SQL Dialog ® Recent Statements. Select the required statement, and choose Get.

The keyword list also supports you in creating SQL statements.

5. To comment out a row, use // or –– at the start of the row.

6. To separate several SQL statements from one another, enter a commented-out separator line.

7. To scroll through the statement history of the database session, choose SQL Dialog ® Previous Statement or SQL Dialog ® Next Statement.

8. You can set parameters for SQL statements.

9. To use or edit your statements again later, save them as SQL Studio objects by choosing SQL Dialog ® Save As.

10. To execute the SQL statements, choose SQL Dialog ® Execute. If you only want to execute some of the displayed SQL statements, select the section that you want to execute and choose SQL Dialog ® Execute.

Result

The status line of the statement window indicates whether your SQL statements were executed successfully. If an error occurred, an error message is displayed in the status window of the SQL Studio. Depending on your settings, additional information such as the time it took to execute your SQL statements is also displayed there.

If your SQL statement returns a result table, this is displayed in a separate window.


Keyword List (SAP Library - SAP DB)

 Entering content frame

Object documentation Keyword List

Use

In the SQL dialog, the Keyword List supports you in creating SQL statements.

Procedure

1. To access the list of keywords, choose SQL Dialog ® Show Keyword List.

2. To add your own keywords to the list, select the required word in your SQL statement and choose SQL Dialog ® Add to Keyword List.

3. To remove your own keywords from the list, select the required word in your SQL statement and choose SQL Dialog ® Remove from Keyword List.


Setting Parameters for SQL Statements (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Parameters for SQL Statements

Use

In the SQL dialog, you can set parameters for SQL statements. When you execute the SQL statement for which a parameter has been set, a dialog window opens in which you must enter a value for the parameter.

Procedure

1. When you create an SQL statement, insert square brackets in all the places you want a variable entry to be possible.

2. If you want to formulate a prompt for the dialog window, enter this prompt within the square brackets.

If you want to set parameters for queries for the columns Article No. and Unit Price in the Article table, you can set the following parameters among the selection criteria:

SELECT  "Article No.", "Unit Price" FROM "Article"
WHERE  "Article No." > [article number (from)]
AND  "Article No." < [article number (to)]
AND  "Unit Price" <= [upper price limit]

By setting parameters you can also replace entire sections of an SQL statement.

You can formulate a SELECT statement and add a WHERE condition using a parameter:

SELECT * FROM USERS [Your WHERE condition]

If you specify a comparison value for the data type CHAR, VARCHAR, DATE or TIME, you must enclose the comparison value in single quotation marks.


Importing and Exporting SQL Statements (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Importing and Exporting SQL Statements

Use

In the SQL dialog , you can import and export SQL statements as ASCII format text files.

Procedure

Choose Import File or Export File in the context menu of the SQL dialog.


Form Dialog (SAP Library - SAP DB)

 Entering content frame

Function documentation Form Dialog

You use the Form dialog if you want to display, select, and edit data records from tables in a screen display.

The following options are available in the Form dialog:

· Executing a Form dialog

· Selecting data records using search conditions

· Changing data records

· Inserting data records

· Deleting a data record

· Importing and exporting LONG columns

If you want to create statements directly in SQL or want to use database options other than the editing of data records, use the SQL dialog.


Executing a Form Dialog (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Executing a Form Dialog

Use

You can use the form dialog to execute statements to edit data records at different isolation levels.

Procedure

...

1. Choose View ® Form Dialog. The system opens a window for the Form dialog.

2. Depending on your user settings, at first you are in read only or in change mode. If you want to change the dialog mode, activate or deactivate the Read Only selection in the lower part of the dialog box.

3. The default value that you set in the user settings is entered for the isolation level. If you want to use a different isolation level, select the relevant isolation level in the lower part of the dialog box.

4. Choose Form Dialog ® Get Table. Select the table that you want to edit, and choose OK to confirm.

The first data record is displayed in the left half of the window. You can use the arrows < > to scroll through the data records. In change mode, you can change, insert, or delete data records. In the right half of the window, you can enter search conditions for selecting specific records.

To hide the window area for entering the search conditions, deselect the Filter flag.

5. To view the data records as a list, choose Report. To switch back to the screen display, choose Record.

6. To use or edit the dialog again later, save it as an SQL Studio object by choosing Form Dialog ® Save As.

7. To export the SQL statement of your Form dialog to the SQL dialog, choose Dialog ® Export to SQL Dialog.


Selecting Data Records Using Search Conditions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Selecting Data Records Using Search Conditions

Use

To display only certain data records of a table, you can enter search conditions in the Form dialog.

Procedure

1. To display the window area for entering the search conditions, select the Filter flag.

2. Formulate your search conditions for the appropriate table columns. Select the required predicate, and enter comparison values or relational expressions.

3. Enter how the formulated search condition is to be linked with the next search condition.

4. Choose Refresh. SQL Studio downloads the data records from the database.

For information on the syntax of predicates, see the predicate section of the Reference Manual: SAP DB.


Changing Data Records (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing Data Records

Use

You can use the Form dialog to edit and change data records in a screen display.

Prerequisites

· You have selected change mode for executing the Form dialog.

· You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the screen display, scroll to the data record that you want to change.

2. Enter your changes.

The names of key columns are emboldened.

You can import and export the contents of LONG columns.

3. Confirm with Update. SQL Studio transfers the changes to the database.


Inserting Data Records (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Inserting Data Records

Use

You can use the Form dialog to insert new data records in tables in a screen display.

Prerequisites

· You have selected change mode for executing the Form dialog.

· You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

...

1. In the screen display, choose Form Dialog ® New. An empty input form opens.

2. Enter your data. Note the following:

¡ The names of key columns are emboldened.

¡ For a NULL value, enter the display of the NULL value according to your user settings (?, for example).

¡ If you leave a field blank when you insert a data record, the system interprets this in the following ways:

§ If a DEFAULT value is defined for the relevant column, this value is copied to the database table.

§ If no DEFAULT value is defined for the relevant column, the NULL value is copied to the database table.

¡ You can import and export the contents of LONG columns.

3. Choose Insert. SQL Studio stores the new data record in the table.
Another input form opens. You can enter further data directly and insert this as data records.

4. If you do not want to insert any more data records, deselect Form Dialog ® New.

5. To view the new data records in a list display, choose Refresh and then Report.

When you insert data records, you can use an existing data record from the same table as a template. Scroll to this data record, enter your changes, and choose Insert. The data record is inserted in the table as a new data record.


Deleting a Data Record (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting a Data Record

Use

You can use the Form dialog to delete data records.

Prerequisites

· You have selected change mode for executing the Form dialog.

· You have the required user authorizations.

For an explanation of user authorizations, see the User Concept section of the documentation The SAP DB Database System.

Procedure

1. In the screen display, scroll to the data record that you want to delete.

2. Choose Delete.

SQL Studio deletes the data record from the database immediately.


Importing and Exporting LONG Columns (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Importing and Exporting LONG Columns

Use

You can use the Form dialog to import the content of LONG columns from a file or the clipboard, and export them to a file or the clipboard.

Procedure

1. To import the content of a LONG column from a file, click the input field of this column in the screen display, and choose Form Dialog ® Import Long ® Import from File.

2. To import the content of a LONG column from the clipboard, click the input field of this column in the screen display, and choose Form Dialog ® Import Long ®Import Text from Clipboard.

3. To export the content of a LONG column to a file, click the input field of this column in the screen display, and choose Form Dialog ® Export Long ® Export to File.

4. To export the content of a LONG column to the clipboard, click the input field of this column in the screen display, and choose Form Dialog ® Export Long ® Export to Clipboard as Text.


Visual Query Dialog (SAP Library - SAP DB)

 Entering content frame

Function documentation Visual Query Dialog

If you want the system to provide you with visual support when you formulate database queries, you can use the Visual Query dialog.

The following options are available in the Visual Query dialog:

· Creating and executing a Visual Query

· Linking table columns with JOINS

· Entering search conditions

· Setting parameters for search conditions

· Defining a result view

If you want to create statements directly in SQL or want to use other database options in addition to database queries, use the SQL dialog.


Creating and Executing a Visual Query (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating and Executing a Visual Query

Use

In the Visual Query dialog, you can create and save SQL statements on a number of different isolation levels.

Procedure

...

1. Choose View ® Visual Query. The system opens a window for the Visual Query dialog. The window consists of the following areas:

¡ The top half of the window is the area for selecting tables.

¡ The bottom half of the window is the area for defining the result.

2. The default value that you set in the user settings is entered for the isolation level. If you want to use a different isolation level, select the relevant isolation level in the lower part of the dialog box.

3. Choose Visual Query ® Get Table. Select the table that you want to use in your database query, and choose OK to confirm. In this way, you can copy up to 16 tables to the area for selecting tables. For each of the tables copied, the system opens a window containing the names of the table columns.

¡ To rearrange the tables, choose Visual Query ® Arrange Tables or Visual Query ® Cascade Tables.

¡ To remove a table from the table selection, close the relevant window.

¡ To remove all tables from the table selection, choose Visual Query ® Clear Window.

4. Select the names of the table columns that your database query relates to, and use the Drag&Drop function to copy them to the area for defining the result.

If you enter *, you copy all table columns of a table into the area for defining the result. To remove a table column from the result definition, select the column and choose Visual Query ® Delete Column.

5. You can link table columns with JOINS, enter search conditions for the data records, and define the result view.

6. To use or edit your Visual Query again later, save it as an SQL Studio object by choosing Visual Query ® Save As.

7. To execute the database query that you created with Visual Query, choose Visual Query ® Execute.

8. To export the SQL statements of your Visual Query to the SQL dialog, choose Visual Query ® Export to SQL Dialog.

Result when Executing a Visual Query

The status line of the statement window indicates whether your SQL statements were executed successfully. If an error occurred, an error message is displayed in the status window of the SQL Studio. Depending on your settings, additional information such as the time it took to execute your SQL statements is also displayed there.

If your database query returns a result table, this is displayed in a separate window.


Linking Table Columns with JOINS (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Linking Table Columns with JOINS

Use

You can use the Visual Query dialog to link table columns with JOINS in database queries.

For information on the syntax of JOINS, see the JOIN predicate section of the Reference Manual: SAP DB.

Prerequisites

When you created the Visual Query, you copied the tables containing the columns you want to link together to the area for selecting tables.

Procedure

1. In the table selection, select the table column that you want to link, and choose the Drag&Drop function to link it to the relevant column in the other table. The system displays a connecting line between the two table columns.

2. To specify the JOIN in more detail, select it, and choose Show Join Definition in the context menu. The system opens a window for the JOIN definition. Select the JOIN type and relational operator, and choose OK.

3. To delete a JOIN, select it and choose Delete Join in the context menu.

If you copy the same table to the table selection twice, SQL Studio assigns an alias name. In this way, you can create SELF JOINS.


Entering Search Conditions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Entering Search Conditions

Use

In the Visual Query dialog, you can enter search conditions when you formulate your database query.

Prerequisites

When you created the Visual Query, you copied the table columns that your database query relates to into the area for defining the result.

Procedure

1. In the relevant table column, enter your search condition in the Predicate field.
You can set parameters for the search condition .

If you specify a search condition for a column with the data type CHAR, VARCHAR, DATE or TIME, you must put the relational expression between single quotation marks.

2. You can formulate several search conditions with AND links or OR links. If you want to use one column several times to formulate search conditions, but only want to display it once, you can hide it in the result view.

· To formulate several search conditions with AND links, enter these conditions in the same row.

· To formulate several search conditions with OR links, enter each of these conditions in a new row.

For information on the syntax of search conditions and predicates, see the search condition and predicate sections of the Reference Manual: SAP DB.


Setting Parameters for Search Conditions (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Parameters for Search Conditions

Use

In the Visual Query dialog, you can set parameters for search conditions for database queries. When you execute the database query a dialog window then opens in which you must enter a value for the parameter.

Procedure

1. When you create a search condition, insert square brackets in all the places you want a variable entry to be possible.

2. If you want to formulate a prompt for the dialog window, enter this prompt within the square brackets.

You can set parameters for the search condition for the Order_No column of the table Purchase orders as follows:
=[order number:]


Defining the Result View (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining the Result View

Use

In the Visual Query dialog, you can specify how SQL Studio displays the result of your database query.

Prerequisites

When you created the Visual Query, you copied the table columns that your database query relates to into the area for defining the result.

Procedure

1. To assign a synonym to a column name, enter the name of the synonym in the Synonym line.

2. To hide a column in the result view, choose No in the Visible line of the relevant column.

This is particularly useful if you only need the column in order to formulate search conditions.

3. To group the results according to the column values, choose Yes in the Group line of the relevant column.

You can use this grouping feature to define average values, maximum values, minimum values, totals, and the number of found data records in the result view.

4. To sort the data records in ascending or descending order, in the Order field, select Ascending or Descending in the column that you want to use for sorting.


Result Tables (SAP Library - SAP DB)

 Entering content frame

Object documentation Result Tables

SQL Studio displays the results of each database query in a separate area of the window. You can use the navigation functions in the context menu of a result to scroll through the result table.

The following options are also available:

  • Adjusting the result view
  • Saving a result

If you execute several SQL statements at once in the SQL dialog , several individual result tables are generated. You can use the selection list in the status line of the result window to switch between these result tables.


Adjusting the Result View (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Adjusting the Result View

Use

You can display the result table in segments or consecutively. You can rename or hide columns, or fix (freeze) them in the result table to make scrolling easier, and you can change the font of the result table.

Procedure

1. To always display the result table in segments, choose Clipped Result View in the user settings.
In the SQL dialog and the Visual Query dialog, you can change this setting for the current dialog window. To do this, choose SQL Dialog ® Clipped Result View or Visual Query ® Clipped Result View.

2. To rename, hide or fix columns, choose Customize in the context menu for the result. Make the following settings:

¡ Change the column names, if required.

¡ Change the Visible setting for the individual columns, if required.

¡ In Fixed Columns, enter the number of columns that you want to fix, starting from the left.

Confirm your settings with OK.

3. To change the font of the result table, choose Font in the context menu for the result. Select the required font, and confirm with OK.


Saving a Result (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Saving a Result

Use

In the SQL mode INTERNAL, you can save the complete result of a database query as a text file, or export it to Microsoft Excel. You can save individual cells as a text file, or display them in a separate zoom window.

Procedure

· To save the complete result table as a text file, choose Export Result to ® File in the context menu for the result.
Depending on your user settings, the content of the result table is attached to the existing file content, or a new file content is generated.
When SQL Studio saves the result, it separates the columns with tabs, and the rows with line breaks. Column contents with the datatype CHARACTER or LONG are cut off after 16 characters. Characters that cannot be displayed are replaced by blanks.

· To export the complete result table to Microsoft Excel, choose Export Result to ® Excel in the context menu for the result.
Microsoft Excel opens automatically, and transfers a maximum of 1024 bytes per cell. Data with type CHARACTER are cut off after 1021 bytes.

· To save a cell as a text file, choose Export Cell to ® File.
Depending on your user settings, the content of the result table is attached to the existing file content, or a new file content is generated.

· To display a cell in a separate zoom window, choose Export Cell to ® Zoom Window. In the user settings you can decide how many bytes are displayed in the zoom window.

Exporting and/or displaying the contents of cells is particularly helpful for column contents that have data type LONG.


Status Window (SAP Library - SAP DB)

 Entering content frame

Object documentation Status Window

In the status window on the lower part of the screen of the SQL Studio, the system displays information such as error messages or the time it takes to execute particular SQL statements.

You can search for words or terms, copy the text in the status window, or export it as a text file.

The following options are also available:

· If, in addition to error messages, you want to see information about your actions in the SQL Studio, choose Status Window ® Trace All.

· If you want to select the entire content of the status window, choose Status Window ® Select All.

· If you want to delete the content of the status window, choose Status Window ® Clear.

· If you want to show or hide the status window, choose View ® Status Window.


Web SQL Studio (SAP Library - SAP DB)

 Entering content frame

Component documentation Web SQL Studio

SAP DB is a relational database system with an SQL-compatible user interface.

"Relational" means that SAP DB provides all its information to users in the form of tables. The standard language SQL (Structured Query Language) provides a set of statements that you can use to maintain and analyze these tables.

The Web-based query tool Web SQL Studio allows easy access to the data of a SAP DB database instance. Once you have installed Web SQL Studio in your network, you can start it from all browsers, and open a database session. You can now create SQL statements, process saved SQL statements, and manage and execute SQL statements.

For Microsoft Windows users, SAP DB also offers the query tool SQL Studio with enhanced functions.

For information about installing Web SQL Studio, see the Web Tools Installation Guide. You can download the Web tools free of charge from the following Internet address: www.sapdb.org .

For general information about the SAP DB database system, see the documentation The SAP DB Database System at the following Internet address: www.sapdb.org ® Documentation.


Starting Web SQL Studio (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Starting Web SQL Studio

Prerequisites

The SAP DB Web Tools are installed in the network and the SAP DB Web Server has been started (see Web Tools Installation Guide).

Procedure

To start Web SQL Studio, open your Web browser and enter the following URL:

http://<web_server>:<port>/websql

· For <web_server>, enter the name of the host where the SAP DB Web Server is installed.

· For <port>, enter the port address of the SAP DB Web Server.

You have now started Web SQL Studio, and you can open a database session.


Opening a Database Session (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Opening a Database Session

Use

To use Web SQL Studio to access the data of a database instance, you must first create a connection to the database host and log on to the database.

Prerequisites

· You have started Web SQL Studio.

· The operational state of the SAP DB database instance that you want to access is ONLINE.

If the operational state of the database instance is not ONLINE, use the Database Manager to start the database instance.

Procedure

...

1. Enter the name of the database host and the name of the database instance.

2. Enter your user name and password, and choose Logon.

When you enter your user name and password, the system automatically changes all the letters to uppercase. If you want the system to differentiate between lowercase and uppercase, you have to enter the user name and password enclosed by quotation marks. The quotation marks are also necessary if the user name or password includes special characters. Your user name and password are not allowed to contain quotation marks.

Result

Web SQL Studio creates a connection to the selected database instance. You can now create SQL statements, process saved SQL statements, and execute SQL statements.

To end the database session, choose Logoff in the header of Web SQL Studio.


Creating an SQL Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating an SQL Statement

Use

You can use Web SQL Studio to create, save, and execute new SQL statements.

Prerequisites

· You have opened a database session.

· You have the required user authorizations.

For an explanation of user authorizations and user attributes, see the Authorization section of the SAP DB reference manual.

Procedure

...

1. Enter your SQL statements in the SQL dialog window.

2. To exclude a line, enter // or –- at the beginning of the line.

3. To separate two SQL statements from one another, enter an excluding separator line.

4. To display statements that have already been executed in this database session, choose Prev Statement or Next Statement.

5. To delete all the contents of the SQL dialog window, choose Clear.

6. Set parameters, if necessary.

7. To reuse or process your SQL statement at a later stage, save it. To do this, select the relevant folder, and choose Save in Selected Folder. Enter a name for the SQL statement, and choose OK.


Setting Parameters for an SQL Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Setting Parameters for an SQL Statement

Use

You can set parameters for SQL statements. When you execute an SQL statement for which parameters exist, the system displays a dialog box where you have to enter a value for the parameter.

Procedure

  1. When you create the SQL statement, insert square brackets in all the places where variable entries are possible.
  2. If you want to formulate a prompt for the dialog box, enter this prompt within the square brackets.
  3. By setting parameters you can also replace entire sections of an SQL statement.


Processing a Saved SQL Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Processing a Saved SQL Statement

Use

You can use Web SQL Studio to open, process, and execute SQL statements.

Prerequisites

· You have opened a database session.

· You have the required user authorizations for processing the SQL statement.

For an explanation of user authorizations and user attributes, see the Authorization section of the SAP DB reference manual.

Procedure

...

1. To open a saved SQL statement, expand the relevant folder on the left-hand side, and select the SQL statement. The system displays the statement in the SQL dialog window.

2. Process the statement in the SQL dialog window.

3. Choose Save.

Web SQL Studio accesses the same dataset as SQL Studio. All the folders that were created with SQL Studio, and all the saved SQL Studio objects are also visible in Web SQL Studio. One exception is the Local Folder.

If you open objects that were created in SQL Studio with Form Dialog or Visual Query, or that are table definitions, the system displays the underlying SQL statement. You can only save this statement under a new name. To do this, select a folder, and choose Save in Selected Folder. Enter a name for the SQL statement, and choose OK.

Under Type on the right-hand side next to the SQL dialog window, you can see the object type of the statement that you opened.


Executing an SQL Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Executing an SQL Statement

Use

You can use Web SQL Studio to execute new or saved SQL statements. Before you execute an SQL statement, you can select its commit mode, SQL mode, and isolation level.

Prerequisites

You have created a new SQL statement or processed a saved SQL statement. The system displays the statement that you want to execute on the SQL dialog screen.

Procedure

...

1. On the right-hand side next to the SQL dialog screen, select the relevant modes and the isolation level for executing the statement.

2. Choose Execute.

Result

· If your SQL statement returns a results table, the system displays this table in the lower screen area.

· If you executed multiple SQL statements simultaneously, you can scroll down the result tables by using the dropdown box.

· If your SQL statement does not return a results table, the system displays information in the results window about whether your statement was successful.


SAP DB WebDAV GUI (SAP Library - SAP DB)

 Entering content frame

Component documentation SAP DB WebDAV GUI

The SAP DB WebDAV GUI is an HTML-based application that simplifies administration and metadata management when you index XML documents. These XML documents are stored in the document store (WebDAV store) of the SAP DB WebDAV Service.

· Overview: XML Indexing and the SAP DB WebDAV Service

· How the WebDAV GUI Works

· Terms

· Supported Subset of the XPATH Standard

WebDAV XML Indexing is part of the SAP DB WebDAV Services. You can download these services free of charge from the SAP DB homepage at http://www.sapdb.org (see also Web Tools Installation Guide: SAP DB 7.4).

For general information on the SAP DB database system, see The SAP DB Database System under Documentation on the SAP DB homepage.


Overview: XML Indexing and the SAP DB WebDAV Service (SAP Library - SAP DB)

 Entering content frame

Background documentation Overview: XML Indexing and the SAP DB WebDAV Service

This graphic is explained in the accompanying text

An SAP DB database instance is used as a store for the WebDAV documents and their properties (WebDAV Properties). The metadata needed for the indexing of XML documents, such as XML index definitions, is also stored in the database.

The indexing service accesses this metadata, and uses it to determine the index values for the XML documents that you want to index. These index values are then stored as WebDAV properties with the documents in the database instance.

For the synchronous indexing of documents, an internal indexing service is already available as part of the SAP DB WebDAV Service. You can adapt this internal service to your requirements.

If you want to index XML documents asynchronously, then you must define at least one separate indexing service.


Synchronous Indexing (SAP Library - SAP DB)

 Entering content frame

Background documentation Synchronous Indexing

When you perform synchronous indexing for an XML document, the document is indexed each time you use a modified PUT request to save it to the document store. The index values are stored as WebDAV properties.

If the indexing fails, the document is not saved to the document store.

Procedure

...

1. Use the following HTTP header to assign the XML document to a document class:

SAPDB_DocumentClass: <document_class>

2. If you want to prevent the document being indexed synchronously, even though it is assigned to a document class, then use an additional header, as follows:

SAPDB_AsyncIndexing: {F|T}

¡ If you specify F (False) or if you do not specify this header, then the document is indexed synchronously.

¡ If you specify T (True), then the XML document is saved only with the information about its document class. The document is then indexed asynchronously by the index engine.

PUT /webdav/test.xml HTTP/1.1
Host: <web_server>
Content-Type: text/xml
Content-Length: 1000
SAPDB_DocumentClass: BOOK
SAPDB_AnsyncIndexing: F

<mediadescription>
   <header mediatype="BOOK">
      <subtype>PAPERBACK</subtype>
      <isbn>3-446-12345-8</isbn>
      <pages>244</pages>
   </header>
   <data>
      <authors>
         <author>
            <name>Shepard, Francis</name>
         </author>
      </authors>
      <title>XML Indexing. Basics.</title>
      <shortdesc>
         All you need to know about XML Indexing to
         get a good start.
      </shortdesc>
      <price>$49.90</price>
      <longdesc>...</longdesc>
   </data>
</mediadescription>

See also Overview: XML Indexing and the SAP DB WebDAV Service


Asynchronous Indexing (SAP Library - SAP DB)

 Entering content frame

Background documentation Asynchronous Indexing

The asynchronous indexing of documents is performed by the index engine. This means that XML documents do not need to be indexed as soon as they are saved to the document store. The documents are indexed independently of the PUT request.

This enables a reindexing of existing indexed documents, in which the XML indexes are updated. You can request the reindexing of documents from the WebDAV Explorer.

Asynchronous indexing also gives you scaling options. You can operate multiple index engines in parallel on multiple hosts.

See also Overview: XML Indexing and the SAP DB WebDAV Service


XML Indexes (SAP Library - SAP DB)

 Entering content frame

Object documentation XML Indexes

XML indexes are always assigned to a specific document class. The definition of an XML index specifies how XML documents in this document class are indexed. The required index values are determined using the XPATH location path.

· Creating/Changing an XML Index Definition

· Deleting an XML Index Definition


XPATH Location Path (SAP Library - SAP DB)

 Entering content frame

Background documentation XPATH Location Path

XPATH is a Web standard for navigating in XML documents. XPATH location paths are used to extract information from the structure of an XML document, such as the author or the page number. This information is then used for XML indexing.

An XPATH location path comprises a base path and a value path.

· The base path describes a node set in the XML document.

· The value path describes the values that you want to determine from this node set.

The XPATH location path /mediadescription/header/@mediatype determines the value of the attribute mediatype of the XML tag <h eader> as an index value.

The XPATH location path //author/name/text() determines the name of the author from the XML document.

The XML indexing function of the SAP DB WebDAV Service currently supports a subset of the accepted XPATH standard.


Document Classes (SAP Library - SAP DB)

 Entering content frame

Object documentation Document Classes

An XML document can belong to precisely one document class. The document class is used to index different types of XML documents, such as books or articles, by different criteria. To enable this, definitions of your chosen XML indexes are assigned to the document class. The indexing service uses these definitions to determine the index values in all documents in this document class.

· Creating/Changing/Deleting a Document Class

· WebDAV Explorer: Displaying/Changing the Properties of Folders or Files


Indexing Service (SAP Library - SAP DB)

 Entering content frame

Background documentation Indexing Service

An index engine is an indexing service if it is configured with the following information: the document classes that you want to process, definitions of the XML indexes, and the document store that you want to use.

The information about the configuration (the definition of the indexing service) can be used by multiple index engines at the same time.

See also: Defining/Changing an Indexing Service


Index Engine (SAP Library - SAP DB)

 Entering content frame

Background documentation Index Engine

An index engine is a program that uses the definition of the indexing service to index the XML documents stored in the document store.

The index engine can be installed on a separate host. To improve scaling, you can also operate multiple index engines, each on a separate host.

You can use the index engine monitoring functions to monitor all registered index engines.


Document Store (SAP Library - SAP DB)

 Entering content frame

Background documentation Document Store

An SAP DB database instance is used as a document store (WebDAV store) for the XML documents that you index with the SAP DB WebDAV GUI.

You specified this database instance when you set up the SAP DB WebDAV Service.

To enable it to connect with the database instance, the indexing service requires information such as the name of the database instance, its host, and a valid user name and password.

· Specifying or Changing the Document Store

· Deleting the Information About a Document Store


How the WebDAV GUI Works (SAP Library - SAP DB)

 Entering content frame

Procedure documentation How the WebDAV GUI Works

Calling the WebDAV GUI

To call the WebDAV GUI, enter the following URL:
http://<web_server>:<port>/webdav?gui

See also: Variables Used in the Web Tools Installation Guide: SAP DB 7.4

The initial screen of the WebDAV GUI appears.

Using the WebDAV GUI

You can choose from the following functions:

· Choose WebDAV Explorer if you want to navigate through the Document Store.

· Choose Document Retrieval if you want to search for indexed XML documents.

· Choose Index Engine Monitoring if you want to monitor the Index Engine.

· Choose Indexing Service Settings if you want to set up an indexing service. This involves creating, changing, or deleting metadata for XML indexing.


WebDAV Explorer (SAP Library - SAP DB)

 Entering content frame

Procedure documentation WebDAV Explorer

You can use the WebDAV Explorer to navigate through the document store. You can view the properties and content of the files and folders, change the document class of files, update their indexes, and delete files and folders.

· Navigating Through the Document Store

· Displaying Properties of Folders or Files

· Changing the Document Class of a File

· Updating the Indexing of a File

· Deleting Folders or Files

· Using the Deleted Items Folder with WebDAV HTTP


Navigating Through the Document Store (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Navigating Through the Document Store

Use

You can use the WebDAV Explorer to navigate through the document store.

Procedure

· To display the content of a folder or file, click its name.

· To display the next highest level of the document store, click This graphic is explained in the accompanying text.

· To refresh the display, click This graphic is explained in the accompanying text.


Displaying Properties of Folders or Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Displaying Properties of Folders or Files

Use

The WebDAV Explorer shows you when the folders and files in your document store were last changed. It also shows you the size of the stored files, as well as additional information on the files, folders, their locks, and XML indexing.

Procedure

· For information on the WebDAV properties and lock properties of a folder or file, click This graphic is explained in the accompanying text (Show Properties).

The following information is displayed for each folder:

Contained Files | Number of files in this directory tree
Contained Folders | Number of directories in this directory tree
Size | Total size of all files in this directory tree

The following information is displayed for each file:

Content Type | Format of the file content
Size | File size
Last Modified | Date on which the file was last modified

The following information is displayed for file and folder locks:

Lock Type | Lock type
Scope | Scope of the lock (EXCLUSIVE or SHARED)
Owner | Owner of the lock
Depth | Depth of the lock
Timeout | Time for which the lock is valid
Lock Token | Lock ID

· For information on the XML indexing of a file, click This graphic is explained in the accompanying text (Show XML Indexing Properties). You see the document class and current indexing status. You can assign a different document class, or update the indexing.


Changing the Document Class of a File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Changing the Document Class of a File

To assign a new or changed document class to a file, use the WebDAV Explorer to display the information on the XML indexing of this file. Choose a document class, and then Update.

If you change the document class of a file, or remove all assignments to a document class (No Document Class Assigned), then the existing index values for this file are deleted, and the indexing status changed accordingly. If you have assigned a different document class to the file, then the file is indexed again automatically, if the corresponding index engine is running.


Updating the Indexing of a File (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Updating the Indexing of a File

To update the XML indexing of a file, use the WebDAV Explorer to display the information on the XML indexing. Choose Trigger Reindexing, and then Update.


Deleting Folders or Files (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting Folders or Files

Use

In the WebDAV Explorer, you can delete folders and files, restore deleted folders and files, or remove them from the document store permanently.

Procedure

· To delete a folder or file, click This graphic is explained in the accompanying text (Delete). The folder or file is moved to the folder This graphic is explained in the accompanying text (Deleted Items).

If the Deleted Items folder already contains a folder or file with the same name as an item you have just deleted, then the existing item in the Deleted Items folder is overwritten. This removes the item from the document store permanently.

· To restore a deleted folder or file, proceed as follows:

a. Open the Deleted Items folder and click This graphic is explained in the accompanying text (Restore) for the folder or file that you want to restore.

b. Under Restore to, enter a directory for the folder or file.

c. If you want to overwrite an existing folder or file with the same name in this target directory, then choose Overwrite.

An overwritten folder or file is removed from the document store permanently.

d. Confirm the action by choosing Restore.

· To remove a deleted folder or file from the document store permanently, open the Deleted Items folder and click This graphic is explained in the accompanying text (Discard) for the folder or file that you want to discard.

· To empty the Deleted Items folder (and remove its entire contents from the document store permanently), click This graphic is explained in the accompanying text (Empty Deleted Items Folder).

You can also use the Deleted Items folder with WebDAV HTTP.


Using the Deleted Items Folder with WebDAV HTTP (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Using the Deleted Items Folder with WebDAV HTTP

Use

As well as accessing the Deleted Items folder when you delete folders or files in the WebDAV Explorer, you can also access it with WebDAV requests.

Procedure

· When you use the DELETE request, also use the HTTP header
 SAPDB_DeletedItems: {F|T}.

¡ If you specify F (False) or if you do not specify the header, then the DELETE request performs the standard action, that is, the folder or file is removed from the document store permanently.

¡ If you specify T (True), then the folder or file is moved from the document store to the Deleted Items folder.

DELETE /folder/ HTTP/1.1
Host: <web_server>
SAPDB_DeletedItems: T

· You can access the content of the Deleted Items folder with the following WebDAV requests:

¡ GET

¡ PROPFIND

¡ DELETE

¡ COPY

The WebDAV request
 DELETE /Deleted Items HTTP/1.1
removes the entire contents of the Deleted Items folder from the document store permanently.


Document Retrieval (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Document Retrieval

Use

You can use the Document Retrieval function to search for indexed XML documents quickly and simply. You can search for documents in a specific document class, or search for specific index values. You can make any type of query, no matter how complex.

Procedure

...

Enter your conditions, and choose Search.

· To find all documents in a specific document class, choose this document class.

· To find all documents with a specific index value, choose the name of the XML index, a comparison operator, and the index value.

· Use OR and/or AND operators to link multiple search conditions together.

¡ When you use OR, you can specify only one alternative comparison value for the same XML index.

¡ When you use AND, you can specify one more comparison value for the same XML index or another XML index.

· To delete your entries, choose Clear.

Result

You get a list of all documents that meet your search conditions.You can open a document directly by clicking its name.


Index Engine Monitoring (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Index Engine Monitoring

Use

The Index Engine Monitoring function gives you a quick overview of the registered index engines. It tells you on which host the index engines are registered, as which indexing services they are working, and which document stores they are using.

You can display this information as an overview, or in more detail for each index engine.

Overview Display

To display the overview, choose Overview in the navigation area of the Index Engine Monitoring function. An overview of all the index engines appears, sorted by the hosts on which they are registered. The following information is displayed:

· The name and a short description of each index engine

· The corresponding indexing service

· The document store used

· The time of the last communication with the index engine. This indicates whether the index engine is working correctly. A communication should be received about once every 10 minutes.

To refresh the display, choose Refresh.

Single Display

To display the details of a single index engine, choose its name in the navigation area of the Index Engine Monitoring function. The following information is displayed:

· The host on which this index engine is registered

· The name and a short description of the index engine

· The installation directory (Installation Root) of the index engine

· The directory path and name of the corresponding log file

· The corresponding indexing service

· The document store used

· The indexing library used

· The time of the last communication with the index engine. This indicates whether the index engine is working correctly. A communication should be received about once every 10 minutes.

To refresh the display, choose Refresh.


Indexing Service Settings (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Indexing Service Settings

Use

You manage the indexing services under Indexing Service Settings. You can specify all information needed for indexing documents, as well as changing or deleting information for existing indexing services.

Procedure

...

1. Choose the indexing service that you want to display or edit.

¡ If you want to adapt an existing indexing service, then choose the name of this service from the list.

§ If you want to adapt the indexing service for synchronous indexing, then choose Synchronous Indexing.

§ If you want to configure the predefined indexing service for asynchronous indexing, then choose Asynchronous Indexing.

¡ If you want to create a new indexing service for asynchronous indexing, then choose New.

2. You can now define or change the indexing service.

Any changes that you make to document store information, document classes, and XML indexes have an effect on all indexing services that use the information you change.

3. If you want to delete an existing indexing service, then choose the name of this service from the list. Information on this service is displayed. Click Delete.


Defining/Changing an Indexing Service (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Defining/Changing an Indexing Service

Prerequisite

You have opened the dialog for defining or changing an indexing service. You do this by choosing either New or the name of an existing service under Indexing Service Settings.

Procedure

To define or change an indexing service, proceed as follows:

...

1. If the indexing service does not yet have a name, specify a name under Service Name. This name must be unique.

2. You can specify a short description of the indexing service under Description, however, this is not mandatory.

3. The list under Assigned Document Classes shows you which document classes are assigned to the indexing service. These are the classes of XML documents that the service will process and index. You can create new document classes, change them, or delete them.

All available document classes are always assigned to each indexing service. It is not possible for individual document classes to be processed by certain indexing services only.

Note that, therefore, all changes to a document class affect all indexing services.

4. Choose the document store under Document Store. You can specify a new document store, or change a document store.

If you remove the assignment between a document store and an indexing service, then you also delete all information about this document store, if it is not assigned to another indexing service (see also Deleting the Information About a Document Store).

5. Confirm your entries.

¡ If you define a new indexing service, choose Create.

¡ If you change an existing indexing service, choose Update.

6. Restart the indexing engines.


Creating/Changing/Deleting a Document Class (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating/Changing/Deleting a Document Class

Prerequisite

You are in the dialog for defining or changing an indexing service to which the document class is assigned.

Any changes that you make to a document class affect all indexing services.

Creating or Changing a Document Class

Öf..

1. Open the dialog for creating or changing a document class as follows:

¡ To change a document class, select a name from the list of assigned document classes, and click Change.

¡ To create a new document class, choose New.

2. If the document class does not yet have a name, choose a name and enter it under Document Class Name. This name must be unique.

3. You can specify a short description of the document class under Description, however, this is not mandatory.

4. The list under Assigned XML Indexes shows you which XML indexes are assigned to the document class, in other words, the index values that the indexing service searches for in documents in this document class. You can assign more indexes, remove existing assignments, create new XML index definitions, or change existing definitions.

¡ To assign a defined XML index to the document class, choose the arrow ▼, and choose a name from the list of XML indexes.

¡ To remove the assignment between an XML index and the document class, select this XML index in the list, and click Remove.

¡ To remove the assignment for all XML indexes, click Remove All.

You can assign up to 100 XML indexes to a document class.

When you remove the assignment of an XML index to a document class, you also delete all information about this XML index, if it is not assigned to another document class (see also Deleting an XML Index Definition).

5. Confirm your entries.

¡ If you are creating a new document class, choose Create.

¡ If you are changing an existing document class, choose Update.

6. Restart the indexing engines.

Deleting a Document Class

To delete a document class, select a name from the list of assigned document classes, and click Delete.

To assign a document class to a document, or to change the assignment, use the WebDAV Explorer.


Creating/Changing an XML Definition (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating/Changing an XML Index Definition

Prerequisite

You are in the dialog for creating or changing a document class.

Procedure

...

1. Open the dialog for creating or changing the definition of an XML index:

¡ To change an existing XML index definition, click its name in the list of assigned XML indexes.

¡ To create a new XML index definition, choose New.

2. If the XML index does not yet have a name, then specify a name under XML Index Name. This name must be unique.

3. You can specify a short description of the XML index under Description, however, this is not mandatory.

4. Specify the XPATH by entering your chosen values for the Base Path and the Value Path.

5. Confirm your entries.

¡ If you are defining a new XML index, choose Create.

¡ If you are changing an existing XML index definition, choose Update.

6. Restart the indexing engines.


Deleting an XML Index Definition (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting an XML Index Definition

You cannot delete definitions of XML indexes explicitly. Instead, an implicit deletion mechanism is used.

An XML index definition is deleted automatically under the following circumstances:

· You defined the XML index when you created or changed a document class, however, you decided not to assign the definition to this document class.

· You defined the XML index while you were creating or changing a document class, however, you terminated the create or change function for this class.

· You removed the assignment of the XML index to a document class when you changed this class, and the XML index is not assigned to any other document class.

· The document class that is assigned to this XML index has been deleted, and the XML index is not assigned to any other document class.


Specifying or Changing the Document Store (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Specifying or Changing the Document Store

Prerequisite

You are in the dialog for defining or changing an indexing service that is assigned to this document store, or that you want to assign to this document store.

Procedure

...

1. Open the dialog for specifying or changing the document store as follows:

¡ To change the information on an existing document store, choose its name under Document Store, and click Change.

¡ To enter information for a new document store, choose New.

2. If the document store does not yet have a name, choose a name and enter it under Document Store Name. This name must be unique.

3. You can specify a short description of the document store under Description, however, this is not mandatory.

4. Specify the following parameters for the connection to the document store:

Database Server | Name of the server on which the relevant database instance is installed
Database Name | Name of the database instance
Database User | Name of the database user who is the owner of the WebDAV tables. This is usually the DBA user.
Password | Password of the user

5. If you want an ODBC trace, then specify a file name under Trace File, including the absolute path under which you want to generate the trace file. The ODBC trace is written from the time at which you connect to the database.

To deactivate the ODBC trace, delete the file name under Trace File, and restart all indexing engines that use this document store.

6. Confirm your entries.

¡ If you want to specify a new document store, choose Create.

¡ If you are changing the information about an existing document store, choose Update.

7. Restart the indexing engines.


Deleting the Information on a Document Store (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Deleting the Information About a Document Store

You cannot delete the information about a document store explicitly. Instead, an implicit deletion mechanism is used.

Information about a document store is deleted automatically in the following circumstances:

· You entered the information when you defined or changed an indexing service, however, you decided not to assign the information to the service.

· You entered the information while you were creating or changing an indexing service, however, you terminated the create or change function for this service.

· You removed the assignment of the document store to an indexing service when you changed the indexing service, and the document store is not assigned to any other indexing service.


Supported Subset of the XPATH Standard (SAP Library - SAP DB)

 Entering content frame

Background documentation Supported Subset of the XPATH Standard

The SAP DB WebDAV XML indexing functions support a subset of the XPATH standard, as defined in the W3C document www.w3.org/TR/xpath.

The supported syntax includes the following access types:

Access Type

Meaning

Example

Child axis + node test text()

The child axis indicates a node set in the XML document.

child::text() determines the text nodes of the nodes in this node set.

/child::a/child::b/child::text()

or (for short)

/a/b/text()

Child axis + attribute axis

The child axis indicates a node set in the XML document.

The attribute axis determines all values of attr attributes of the nodes in this node set.

/child::a/child::b/attribute::attr

or (for short)

/a/b/@attr

Name test ‘*’

Determines the text nodes of all child nodes of nodes in a node set

/child::a/child::*/child::text()

or (for short)

/a/*/text()

Predicate filter

Determines the text nodes of all nodes of a node set that have an attribute attr with the specified value.

Only the attribute axis and the comparison operators = and != are allowed within predicate filters. The attribute value must be a character string literal.

Only one attribute is allowed.

/a/b[attribute::attr=‘aaa’]/text()

Descendant axis + node test text()

The descendant axis indicates all node sets whose path contains a specific node.

child::text() determines the text nodes of the nodes in this node set.

/descendant::a/child::text()

or (for short)

//a/text()

Descendant axis + attribute axis

The descendant axis indicates all node sets whose path contains a specific node.

The attribute axis determines all values of attr attributes of the nodes in this node set.

/descendant::a/attribute::*

or (for short)

//a/@*


Terms (SAP Library - SAP DB)

 Entering content frame

Background documentation Terms

· XML Indexes

· Synchronous Indexing

· Asynchronous Indexing

· XPATH Location Path

· Document Classes

· Indexing Service

· Index Engine

· Document Store


Interfaces (SAP Library - SAP DB)

 Entering content frame

Component documentation Interfaces

Title of the Documentation | Contents
C/C++ Precompiler User Manual | Options for the C/C++ Precompilers, Embedded SQL
ODBC Manual: SAP DB | Basics and special features of the SAP DB ODBC driver


C/C++-Precompiler User Manual (SAP Library - SAP DB)

 Entering content frame

Component documentation C/C++ Precompiler User Manual 7.4

The interface between the SAP DB database system and SAP DB application programs is the database language SQL (Structured Query Language). SQL statements embedded in the application program (Embedded SQL) are used for communication with the database instance. Parameter values are exchanged in special program variables, called host variables.

The C/C++ Precompiler prepares C/C++ source code with embedded SQL statements for translation into an executable application program. The compiler checks the syntax and semantics of the embedded statements, converts them to procedure calls in the precompiler runtime environment, and generates a C/C++ file, which can then be compiled.

This user manual describes how to embed SQL statements for the SAP DB database system in the programming language C/C++, and how to work with the precompiler.

This manual requires a sound working knowledge of the meaning of elementary SQL statements. For a description of the syntax and semantics of database statements, and the conventions for syntax notation, see the Reference Manual: SAP DB 7.4.

For general information on the SAP DB database system, see the documentation The SAP DB Database System on the SAP DB Homepage http://www.sapdb.org under Documentation.


Embedding SQL Statements in C/C++ (SAP Library - SAP DB)

 Entering content frame

Background documentation Embedding SQL Statements in C/C++

When you embed database statements in the source code of an application program, observe the following points as well as the general rules:

· Conventions for the Order of Embedded SQL Statements

· Rules for the Declaration Segment

· Conventions for Host Variables

· Using Indicator Variables

· Permitted Data Types

· Connecting to a Database Instance

· Overview of Precompiler Statements

· Database System Messages

· Programming Notes


General Rules (SAP Library - SAP DB)

 Entering content frame

Procedure documentation General Rules

Observe the following general rules when you embed SQL statements.

· Precede each embedded SQL statement with the key words EXEC SQL to delimit it from the programming language statements. These key words must be on the same line, and can only be split with a blank character.

· Finish each embedded SQL statement with a semicolon.

· You can write embedded SQL statements that run over multiple lines.

· You can interrupt embedded SQL statements with comments. Place the comments between the characters /* and */.

· You can place comments about SQL statements at the end of the line. Precede comments at the end of a line with two dashes, --.

· Precede the names of host variables and indicator variables within embedded SQL statements with a colon :

· No other names used in an application program are allowed to start with a colon :

· Names used in an application program must not start with the characters sq. This combination of characters is also reserved by the precompiler.

· The program parts analyzed by the precompiler must not be elements of the preprocessor include statements (#define, #include).

See also: Overview of Precompiler Statements

EXEC SQL BEGIN DECLARE SECTION;
char addr [6];
char fname [8], lname [8];
EXEC SQL END DECLARE SECTION;

/* Generate table „customer“ */

EXEC SQL CREATE TABLE customer
(cno FIXED (4) KEY, address CHAR (5),
firstname CHAR (7), lastname CHAR (7));

/* Get values */

/* Add values to database */

EXEC SQL INSERT INTO customer
(cno, address, first name, last name)
VALUES (100, :addr, :fname, :lname);

/* Message in event of error */

if (sqlca.sqlcode != 0)
printf ("%d       ",sqlca.sqlcode);


Conventions for the Order of SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Conventions for the Order of SQL Statements

When the precompiler runs with the precompiler option check, it runs once, sequentially, through the source code of the application program, and sends any static SQL statements that it finds to the database kernel . So that the check can run correctly, the embedded SQL statements must appear in an executable order in the source code.

Observe the following conventions when you embed SQL statements.

· CREATE TABLE comes before INSERT, UPDATE, DELETE, and SELECT.

· INSERT, UPDATE, DELETE, and SELECT come before DROP TABLE.

· SELECTcomes before FETCH. It must be possible to make a unique assignment between the SELECT statement and the FETCH statement.

· DECLARE CURSOR comes before OPEN.

· OPENcomes before FETCH.

· FETCHcomes before CLOSE.

The process flow of the program solely is responsible for the order in which the SQL statements are actually executed at runtime of the program.

The precompiler does not send dynamic SQL statements to the database, since their content is unknown before runtime.


Rules for the Declare Section (SAP Library - SAP DB)

 Entering content frame

Background documentation Rules for the Declare Section

In the declare section, you declare all host variables and indicator variables that are exchanged between the database instance and the application program in embedded SQL statements. You can use multiple declaration sections within an application program.

Observe the following rules:

· Start the declare section with EXEC SQL BEGIN DECLARE SECTION;.

· End the declare section with EXEC SQL BEGIN DECLARE SECTION;.

· Follow the permitted syntax for the declaration section.

· Observe the conventions for host variables and the rules for indicator variables.

· Use the data types permitted for the precompiler.

· You can use the memory classes typedef, static, extern or auto.

· You can specify declarations both outside of and within functions.

· As well as variable declarations, you can specify type definitions and parameter-free constant definitions (#define) for positive whole numbers in the declare section.

#define n(a) (a+10) is not permitted.
#define n 7 is permitted.
You can, for example, use n as the length of an array variable:
int array [n]

· Also specify array lengths for the memory class extern. These lengths must lie within the range of the corresponding external definitions.

To improve efficiency, only declare those variables in EXEC SQL declare sections that you are actually using as host variables in embedded SQL statements.

EXEC SQL BEGIN DECLARE SECTION;

char no [6];

char fname [8], lname [8];

EXEC SQL END DECLARE SECTION;


Syntax of the Declaration Section (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Syntax of the Declare Section

This syntax list shows you the syntax of the declaration section. The syntax notation used is BNF.

<arrdim> ::=
  <identifier>
| <unsigned_integer>

<chardecspec> ::=
  <storclspec>
| <chartype>
| <chardecspec> [<storclspec>]
| <chardecspec> <typespec>

<chartype> ::=
  char
| VARCHAR
| varchar

<constant> ::=
  <identifier>
| <unsigned_integer>

<decimaldef> ::=
  DECIMAL [<decimaltag>] [(<decimalscale>)]

<decimaldigits> ::=
  <identifier>
| <unsigned_integer>

<decimalfract> ::=
  <identifier>
| <unsigned_integer>

<decimalref> ::=
  DECIMAL <identifier>

<decimalscale> ::=
  decimaldigits
| decimaldigits,decimalfract

<decimaltag> ::=
  <identifier>

<decimaltype> ::=
  <decimaldef>
| <decimalref>

<declaration> ::=
  <decspec> <declist>;

<declarator> ::=
  <identifier>
| * <identifier>
| <declarator> [ <arrdim> ]

<declist> ::=
  <possinitdec>
| <declist>,<possinitdec>

<decspec> ::=
  <typespec>
| <chardecspec>
| <intdecspec>
| <filedecspec>
| <floatdecspec>
| decimaltype
| <decspec> [<storclspec>]
| <decspec> <typespec>
| <longdescdecspec>

<expression> ::=
  <basexpr>
| <basexpr> (<expression>) <basexpr>

<fieldlist> ::=
  <typespec> <declist>;
| <fieldlist> <typespec> <declist>;

<filedecspec> ::=
  <storclspec>
| <filetype>
| <chardecspec> [<storclspec>]
| <filedecspec> <typespec>

<filetype> ::=
  SQLFILE
| sqlfile

<floatdecspec> ::=
  <storclspec>
| <floattype>
| <chardecspec> [<storclspec>]
| <floatdecspec> <typespec>

<floattype> ::=
  float
| long
| double

<initializer> ::=
  <expression>
| {<initlist>}

<initlist> ::=
  <initializer>
| <initlist>,<initializer>

<intdecspec> ::=
  <storclspec>
| <inttype>
| <chardecspec> [<storclspec>]
| <intdecspec> <typespec>

<inttype> ::=
  short
| long
| int
| unsigned

<longdescdecspec> ::=
  <storclspec>
| <longdesctype>
| <longdescdecspec> [<storclspec>]
| <longdescdecspec> <typespec>

<longdesctype> ::=
  SQLLongDesc
| sqllongdesc

<possinitdec> ::=
  <declarator>
| <declarator> = <initializer>

<prepcomline> ::=
  #define <identifier_constant>

<statement> ::=
  <prepcomline>
| <declaration>

<storclspec> ::=
  external
| static
| auto
| typedef

<structdef> ::=
  struct [<structag>] {<fieldlist>}

<structref> ::=
  struct <identifier>

<structag> ::=
  <identifier>

<structype> ::=
  <structdef>
| <structref>

<typespec> ::=
  <inttype>
| <floatptye>
| <chartype>
| <floattype>
| <decimaltype>
| <longdesctype>
| <structype>
| <identifier>
| const
| volatile

<unichardecspec> ::=
  <storclspec>
| <unichartype>
| <unichardecspec> [<storclspec>]
| <unichardecspec> <typespec>

<unichartype> ::=
  SQLUCS2
| SQLUTF16
| TCHAR (only available for use with Unicode applications)


Host Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Host Variables

Host variables are variables that are used in embedded SQL statements to exchange values between the application program and the database instance .

Observe the following points when you use host variables:

· Declare the host variables in the declare section. When you do this you can use data types predefined by the precompiler, as well as C/C++ basic data types.

See also: Permitted Data Types

· Observe the conventions for host variables. You can also use structures and arrays in host variables. You can generate structure definitions from database tables and database procedures.


Conventions for Host Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Conventions for Host Variables

Observe the following conventions for host variables.

· The name of a host variable can have a maximum of 32 characters.

· The name of a host variable cannot start with the characters sq.

· A host variable can be a structure or an array . A structure can contain arrays, and arrays of structures are also possible.

· A host variable can be a pointer variable of permitted data types. Pointer to Pointer and Pointer to Array are not permitted.

· In each declaration, you can specify a maximum of one pointer and arrays with up to four dimensions. Arrays of pointer variables are permitted, but not Pointer to Array.

· The precompiler cannot check the lengths of host variables with the data type char *, and writes a warning to the precompiler log. At runtime, the character pointer must point to a NULL-delimited character string.

· So that they can include the closing NULL bytes, host variables with the data type char [n] must be declared with one more field than the corresponding column in the database table.
When char variables are send to a database table, the variable content is copied up to the closing NULL byte. Longer table columns are filled up with blank characters.
When char variables are read from a database table, all following blank characters in the table content are truncated, and the closing NULL byte is set in the variable after the last character that is not a blank character. If the host variable is shorter than the table column, then the last character is overwritten.


Structures as Host Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Structures as Host Variables

Host variables can be structures. When the precompiler runs, it splits the structure into its individual components, in the order of the component declarations.

When you use structures as host variables, you can, for example, specify multiple values in the INTO clause of a SELECT statement at the same time.

EXEC SQL BEGIN DECLARE SECTION;

typedef char string8 [8];

  struct {
char addr [6];
struct {
string8

lname, fname [3];
} name;
} person;

EXEC SQL END DECLARE SECTION;

EXEC SQL SELECT !person INTO :person
         FROM customer WHERE cno = 100;

You can use a simplified notation for structures in SQL statements.

You can also specify the corresponding indicator variable as a structure with the same number of components.

You can generate the structure definition from a database table or a database procedure.


Arrays as Host Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Arrays as Host Variables

Host variables can be arrays. In an array statement they cause an SQL statement to be executed more than once.

In multi-dimensional arrays, the last dimension is run first.

EXEC SQL BEGIN DECLARE SECTION;

float p[3][2];

EXEC SQL END DECLARE SECTION;

EXEC SQL CREATE TABLE KOORD (x float, y float);

p[0][0] = 0.0;

p[0][1] = 0.1;

p[1][0] = 1.0;

p[1][1] = 1.1;

p[2][0] = 2.0;

p[2][1] = 2.1;

EXEC SQL INSERT INTO KOORD VALUES (:p);

/* insert generates following content */

/*      x  |  y

*/
/*

---------

*/
/*     0.0 |

0.1

*/
/*     1.0 |

1.1

*/
/*     2.0 |

2.2

       */

Also specify the corresponding indicator variable as an array, with the same length and dimension.

You can use a simplified notation for array variables in SQL statements.


Simplified Notation for Structure and Array Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Simplified Notation for Structure and Array Variables

Use

In SQL statements, you can use a simplified notation for structure variables and array variables, so avoiding the need to list the columns of the database table that are addressed explicitly.

Procedure

· Specify the name of a structure variable or array variable as !<var>, for example, in the <select_list> of the SELECT statement.

· You can use the tilde character (~<var>) instead of an exclamation mark.

· The precompiler derives the column names from the names of the structure components or array elements. The column names can have a maximum of 18 characters.

· You can specify <[owner.]tablename.> before !<var>. This information is then inserted in front of each column name.

· Instead of the complete variable !<var>, you can specify a structured component of var of your choice, for example, !var.x.y. In this case, the appropriate subset of column names is generated.

EXEC SQL BEGIN DECLARE SECTION;

  typedef char string8 [8];
  struct {char addr [6];
  struct {string8 lname, fname [3];} name;} person;

EXEC SQL END DECLARE SECTION;

EXEC SQL CREATE TABLE customer
(cno FIXED(4) key, addr

CHAR(5),
name_lname CHAR(7), name_fname1

CHAR(7),
name_fname2 CHAR(7), name_fname3

CHAR(7));

/* Get values */

EXEC SQL INSERT INTO customer
  (cno, !person )
  VALUES (100, :person);

/* Has same effect as: */

EXEC SQL INSERT INTO customer
  (cno, addr, name_lname,
  name_fname1, name_fname2, name_fname3)
  VALUES (100, :person.addr,
  :person.name.lname, :person.name.fname[0],
  :person.name.fname[1],
  :person.name.fname[2]);


Indicator Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Indicator Variables

If you want your application program to process NULL values or DEFAULT values, or if values might be truncated when they are exchanged between host variables and the database, then you must specify an indicator variable as well as the host variable in the embedded SQL statement.

Observe the rules for indicator variables.

The value of an indicator variable is called an indicator value, and performs the following tasks:

· It provides information on whether the corresponding host variables have been processed correctly. For this reason, query the indicator value after the SQL statement has been processed.

· It is used to transfer NULL values to the database instance.

· It is used to transfer DEFAULT values to the database instance.

· It is used in GETVAL statements and PUTVAL statements to ignore individual LONG columns.

If a SELECT statement or a FETCH statement specifies that values are transferred from columns in which NULL values can appear, then you must specify an indicator variable. Otherwise the C/C++ precompiler writes a warning when the precompiler runs with the precompiler option check, and you see an error message when you select a NULL value at runtime ( sqlcode = -809).

In dynamic SQL statements with a descriptor, the hostindicator component of an sqlvar entry performs the same task as an indicator variable.


Rules for Indicator Variables (SAP Library - SAP DB)

 Entering content frame

Background documentation Rules for Indicator Variables

Note the following points when you use indicator variables:

...

· Declare each indicator variable as a data type long int, int or short int in the declaration segment.

· Specify the indicator variable behind the corresponding host variable in the embedded SQL statement, divided by a blank character.

· Observe the same conventions as for host variables.

EXEC SQL BEGIN DECLARE SECTION;

char fname [8], lname [8];

int fnameind, lnameind;

EXEC SQL END DECLARE SECTION;

/* Insert NULL value */

fnameind = -1;

strcpy (lname, "COMPANY X");

lnameind = 0;

EXEC SQL INSERT INTO customer (firstname,lastname)
VALUES (:fname :fnameind, :lname :lnameind);

/* Test for truncation */

EXEC SQL SELECT lastname
INTO :lname :lnameind
FROM customer
WHERE lname = "COMPANY X";

if (lnameind > 0)
printf ("%d      ", lnameind );


Indicator Values (SAP Library - SAP DB)

 Entering content frame

Background documentation Indicator Values

The table shows the possible indicator values that can be taken by an indicator variable of the hostindicator component or an sqlvar entry in the descriptor.

Indicator Value | Meaning
0 | A value has been transferred between the database and the application program without errors. The value sent to the table column or host variable is a defined value.
-1 | The value of the host variables or of the corresponding table entry is the NULL value.
-2 | An error occurred (overflow, or division by zero). The value of the host variables or of the corresponding table entry is not defined.
> 0 | A truncated value has been sent to the host variable or to the corresponding table column. The indicator value specifies the actual length of the value.
SQL_DEFAULT_PARAM | Used to transfer DEFAULT values to the database instance.
SQL_IGNORE | Used to ignore LONG columns in GETVAL statements and PUTVAL statements

See also: Database System Messages (sent through the sqlca structure)


Permitted Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Permitted Data Types

You can use the following data types for host variables in the declaration section:

· All basic data types

· The data type struct

· The data types predefined by the precompiler ( VARCHAR, SQLFILE and SQLLongDesc), and UNICODE data types

· Any data types you have defined yourself previously in a declaration section


Basic Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Basic Data Types

In the declare section, you can use the C/C++ basic data types to declare host variables. A corresponding SAP DB data type exists for each basic data type.

The precompiler performs the following tasks:

· When the precompiler runs, it checks whether the memory of the host variables and the corresponding table column is large enough for the maximum possible value to be sent between the database instance and the application program. If this is not the case, the precompiler writes a warning in the precompiler log.

· If necessary, the precompiler converts the data types at runtime.

The following table shows the corresponding SAP DB data types for the basic data types:

Description

C/C++ Data Type

SAP DB Data Type

Alphanumeric character

char

CHAR (1)

Character string with closing NULL byte

char*
char [n+1], n £ 8000
char [n+1], n > 8000

CHAR (n)
VARCHAR (n)
LONG

Integer

[unsigned] int, short int, long int

SMALLINT, INTEGER (2 or 4 bytes), FIXED (5), FIXED (10)

Fixed point number

float, double

FIXED (n,m)

Floating point number

float
double

FLOAT (6)
FLOAT (15)

Date

char [9]

DATE

Time

char [9]

TIME

Timestamp with closing NULL byte

char [21]

TIMESTAMP

Boolean

All numeric data types (null or not null)

BOOLEAN

Byte

char [n], n  £  8000
char [n], n > 8000

[VAR]CHAR (n) BYTE
LONG BYTE

When you specify dates, times, and timestamps, stick to the correct date and time format.


Predefined Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Predefined Data Types

The C/C++ precompiler predefines the following permitted data types to make it easier to handle database tables. You can use them to declare host variables in the declaration section.

· VARCHAR

· SQLFILE

· UNICODE data types


VARCHAR (SAP Library - SAP DB)

 Entering content frame

Object documentation VARCHAR

Use

You can use the predefined data type VARCHAR to declare host variables to which you want to assign character strings with variable lengths.

The C/C++ precompiler converts the VARCHAR declaration into a structure declaration with a two-byte length and an array or pointer. The current length of a VARCHAR variable is determined by the length field. NULL bytes do not contribute to the calculation of the length. In a VARCHAR declaration with pointer declarer, the application program is responsible for assigning memory at runtime.

This graphic is explained in the accompanying text

VARCHAR v [n];

is replaced by

struct {unsigned short len; unsigned char arr [n];} v;

where the current length of the character string is assigned to len and the characters themselves are assigned to arr.

VARCHAR *v;

is replaced by

struct {unsigned short len; unsigned char arr [1];} *v;

See also: Examples for Permitted VARCHAR Declarations


Example for Permitted VARCHAR Declarations (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Examples for Permitted VARCHAR Declarations

Examples for permitted VARCHAR declarations:

VARCHAR a [21], b [100] [133];

typedef VARCHAR longstring [ 65534 ];
longstring c, d;

typedef VARCHAR *PVC;
PVC p;

You can assign memory for p:

n = 100; /* Maximum length of VARCHAR variables*/
p = (PVC) malloc (sizeof (p->len) + n * sizeof

(p->arr));

You can declare VARCHAR pointers with fixed maximum lengths as follows:

typedef VARCHAR VC30 [30];
VC30 *q;

q is a pointer to a VARCHAR with a maximum length of 30.

Memory is assigned to q with the following statement:

q = (VC30* ) malloc (sizeof (VC30));


SQLFILE (SAP Library - SAP DB)

 Entering content frame

Object documentation SQLFILE

Use

You can enable the direct transfer of file content in and out of LONG columns by using the predefined data type SQLFILE to declare host variables.

Procedure

Assign the name of a file to the value of the host variable. Note the following:

· If this file already exists, then its content must be a character string (of any length). The SQL statements INSERT and UPDATE write the content of the file to the LONG column.

· If this file does not already exist, the SELECT statements of a LONG column generate it with the specified file name. The column content becomes the content of the file.

· If this file already exists when a SELECT statement is executed, then the content of the LONG column is appended to its existing content. If you want to avoid this, you must delete the existing file before the SELECT statement is executed, for example, with an EXEC COMMAND statement.

· Any errors in the processing of the file terminate the SQL statement and trigger a database error message sqlcode < 0.

EXEC SQL BEGIN DECLARE SECTION;

SQLFILE f1[30] = "document.doc";

char title[41] = "Manual";

SQLFILE f2[30];

EXEC SQL END DECLARE SECTION;

EXEC SQL CREATE TABLE documents(title CHAR (40) KEY,
document LONG BYTE);

EXEC SQL INSERT INTO documents VALUES (:title, :f1);

strcpy (f2, "tempdocument.doc");

EXEC SQL SELECT document INTO :f2 FROM documents
WHERE title = :title;


SQLLongDesc (SAP Library - SAP DB)

 Entering content frame

Background documentation SQLLongDesc

You can make working with LONG columns easier by using the predefined data type SQLLongDesc to declare host variables. In a FETCH statement, for example, this gives you information on the total length of the LONG column.

The data type SQLLongDesc is declared as a structure in the header file cpc.h:

typedef struct sqllongdesc {
  char *szBuf;
  int cbColLen;
  int cbBufLen;
  int cbBufMax;
} sqllongdesc;

typedef sqllongdesc SQLLongDesc;

The components of this structure declaration have the following meaning:

  • szBuf: Pointer to a memory area that includes the LONG data
  • cbColLen: Total length of the corresponding LONG column in the table
  • cbBufLen: Length of the data currently saved in szBuf
  • cbBufMax: Size (in bytes) of the memory area to which szBuf points

When a FETCH or GETVAL statement is executed, the precompiler enters the length of the LONG column in the component cbColLen.

You must assign values to the other components before SQL statements. See also: Special Features when Using Data Type SQLLongDesc


Special Features when Using Data Type SQLLongDesc (SAP Library - SAP DB)

 Entering content frame

Background documentation Special Features when Using Data Type SQLLongDesc

Note the following points when you use the data type SQLLongDesc:

· If you want to execute INSERT statements or PUTVAL statements with host variables of data type SQLLongDesc, you must first assign values to the structure components szBuf, cbBufMax and cbBufLen of this data type.

· If you want to execute FETCH statements or GETVAL statements with host variables of data type SQLLongDesc, you must first assign values to the structure components szBuf and cbBufMax of this data type.

SQLLongDesc ldesc;

#define LONGLEN 100000

#define FILLLEN 80000

/* Assign memory for including data */

ldesc.szBuf = (char *) malloc (LONGLEN);

/* Fill memory with values */

memset(ldesc.szBuf, ‘X’, FILLLEN);

/* Specify size of memory area */

ldesc.cbBufMax = LONGLEN;

/* Specify length of data in buffer */

Ldesc.cbBufLen = FILLLEN;

EXEC SQL INSERT INTO LONGTEST VALUES (:i1, :ldata :il1, :l2 :il2);


UNICODE Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation UNICODE Data Types

The C/C++ precompiler provides predefined data types for working with UNICODE data.

The table gives you an overview of these UNICODE data types:

Description

C/C++ Data Type

SAP DB Data Type

Unicode character string with closing NULL byte

The basic C/C++ data type is unsigned short.

In UCS 2, the characters are coded in a platform-specific byte configuration.

SQLUCS2*
SQLUCS2 [n+2], n < 4000
SQLUSC2 [n+2], n ³ 4000

CHAR (n) UNICODE, VARCHAR (n) UNICODE
LONG UNICODE

Unicode character string with closing NULL byte

The basic C/C++ data type is unsigned short.

In UTF 16 without surrogate, the characters are coded in a platform-specific byte configuration.

SQLUTF16*
SQLUTF16 [n+2], n < 4000
SQLUTF16 [n+2], n ³ 4000

CHAR (n) UNICODE, VARCHAR (n) UNICODE
LONG UNICODE

Generic data type

CHAR or SQLUCS2 data type, depending on the precompiler option –G unicode.

TCHAR*
TCHAR [n+1], n < 4000
TCHAR [n+1], n ³ 4000

CHAR (n) UNICODE, VARCHAR (n) UNICODE
LONG UNICODE

See also: Converting Data Types


Converting Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Converting Data Types

If, in an embedded SQL statement, the C/C++ basic data type or the UNICODE data type of a parameter does not correspond to the SAP DB data type of the corresponding table column, but can be converted, then the precompiler runtime environment converts the data types at runtime of the application program.

The following table shows the possible conversions, and the errors that can occur:

C/C++ Basic Data Types

SAP DB Data Types

FIXED

FLOAT

BOOLEAN

LONG

CHAR

VARCHAR

DATE/TIME

short int, int,
long int

1,2

1b,2

6

Not permitted

4,5

Not permitted

Not permitted

float, double, long float

1a,2

2

6

Not permitted

4,5

Not permitted

Not permitted

char [n]

4,5

4,5

Not permitted

3

3

3

3

char

4,5

4,5

Not permitted

Not permitted

3

3

3

UNICODE Data Types

SAP DB Data Types

FIXED

FLOAT

BOOLEAN

LONG

CHAR

VARCHAR

DATE/TIME

SQLUCS2 [n],
SQLUTF16 [n],
TCHAR [n]

4,5,7

4,5,7

Not permitted

3,7

3,7

3,7

3,7

SQLUCS2,
SQLUTF16,
TCHAR

4,5,7

4,5,7

Not permitted

3,7

3,7

3,7

3,7

1 An overflow can occur ( sqlcode < 0).

1a An overflow can occur when a value is transferred to the database table.

1a An overflow can occur when a value is transferred to the host variable.

2 Some decimal places may be cut off (indicator value > 0).

3 Some characters may be cut off. The warning message sqlwarn1 is set. The indicator value specifies the actual length of the character string.

4 An overflow can occur when numerical values are converted into character strings ( sqlcode < 0).

5 An overflow or invalid number can occur when character strings are converted into numerical values ( sqlcode < 0).

6 The value 0 is mapped to false. All values other than 0 are mapped to true.

7 An error message is written when UNICODE values are converted that cannot be translated to 8 bit ASCII ( sqlcode < 0).

See also: Database System Messages


Generating Structure Definitions (SAP Library - SAP DB)

 Entering content frame

Background documentation Generating Structure Definitions

Use

You can use the INCLUDE DECLARE statement to generate a file <file_name> from a database table or database procedure. This file derives a corresponding structure definition from the structure of the database table. You can use this structure definition to declare host variables and the corresponding indicator variables.

A table has been defined as follows:

CREATE TABLE example (
  A FIXED (5),
  B FIXED (8),
  C FIXED (5, 2),
  D FLOAT (5),
  E CHAR (80))

The application program can then contain the following statements:

EXEC SQL BEGIN DECLARE SECTION;

EXEC SQL INCLUDE "example.h" TABLE example AS STRUCT IND;

struct example s, sa[10], *sp;

struct iexample indi;

EXEC SQL END DECLARE SECTION;

EXEC SQL SELECT * FROM example;

EXEC SQL FETCH INTO :s :indi;

EXEC SQL FETCH INTO :sa[4] :indi;

sp = &sa[9];

EXEC SQL FETCH INTO :sp :indi;

The include statement generates the following declarations:

struct example {short A;long B;float C,D;char E [81];};

and

struct iexample {short IA, IB, IC, ID, IE;};


Working with UNICODE Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Working with UNICODE Data

Use

The C/C++ Precompiler supports the use of UNICODE data in SAP DB application programs. The only permitted coding formats are UCS2 or UTF-16 (without surrogate), both with a platform-specific byte configuration. All output in the trace file is in UTF 8.

You can use UNICODE character strings in the following locations in host variables only:

  • As user name and password in the CONNECT statement
  • As a statement name in dynamic SQL statements
  • As a result table name in OPEN CURSOR statements
  • As an SQL statement
  • As parameters for SQL statements

You cannot use UNICODE application programs with ASCII database instances.

Prerequisite

You have installed a UNICODE-compliant database instance.

After a CONNECT statement, the precompiler can recognize automatically whether it is connected to a UNICODE-compliant database instance.

Procedure

· Use suitable host variables with the appropriate predefined UNICODE data types for your UNICODE character strings.

· If the user name or password contains UNICODE characters, then also use UNICODE host variables.

· If host variables contain complete SQL statements, then these statements are sent as ASCII or UNICODE character strings, depending on the type of the host variables. For performance reasons, only use UNICODE host variables for an SQL statement if the statement actually contains UNICODE characters.

· Run the precompiler with the precompiler option –G unicode.

EXEC SQL BEGIN DECLARE SECTION;

/* "SELECT TABLENAME FROM DOMAIN.TABLES " encoded in UCS2 */

SQLUCS2 sqlstmt[36] = {0x0053, 0x0045, 0x004C, 0x0045, 0x0043,

0x0054, 0x0020, 0x0054, 0x0041, 0x0042,

0x004C, 0x0045, 0x004E, 0x0041, 0x004D,

0x0045, 0x0020, 0x0046, 0x0052, 0x004F,

0x004D, 0x0020, 0x0044, 0x004F, 0x004D,

0x0041, 0x0049, 0x004E, 0x002E, 0x0054,

0x0041, 0x0042, 0x004C, 0x0045, 0x0053,

0x0000};

SQLUCS2 resultstring[64];

EXEC SQL END DECLARE SECTION;

/* connect ... */

/* parse a unicode sql command and give it a statement name */

EXEC SQL PREPARE stmt1 FROM :sqlstmt;

EXEC SQL DECLARE curs1 CURSOR FOR stmt1;

EXEC SQL OPEN curs1;

/* loop over resultset */

while (sqlca.sqlcode != 100)

{

EXEC SQL FETCH curs1 INTO :resultstring;

/* ... */

}

EXEC SQL CLOSE curs1;


Working with LONG Columns (SAP Library - SAP DB)

 Entering content frame

Background documentation Working with LONG Columns

To make it easier to work with LONG columns, the C/C++ Precompiler offers the predefined data types SQLFILE and SQLLongDesc, as well as the GETVAL statement and the PUTVAL statement, for step-by-step processing of the columns.

However, you can also declare host variables for LONG columns as char arrays or VARCHAR data types.

EXEC SQL CREATE TABLE LONGTEST
(I1 INTEGER, L1 LONG BYTE, L2 LONG BYTE);

EXEC SQL BEGIN DECLARE SECTION;

VARCHAR l1[1000], l2[50];

int i1, il1, il2;

EXEC SQL END DECLARE SECTION;

EXEC SQL INSERT INTO LONGTEST VALUES
(:i1, :l1 :il1, :l2 :il2);

Example for using a descriptor:

sqlvartype *actvar;

EXEC SQL BEGIN DECLARE SECTION;

char *insert = "INSERT INTO LONGTEST VALUES (:I1, :L1, :L2)";

EXEC SQL END DECLARE SECTION;

EXEC SQL PREPARE ins from :insert;

EXEC SQL DECLARE :C1 CURSOR FOR ins;

EXEC SQL DESCRIBE ins;

/* ... */

actvar = &sqlda.sqlvar[1];

(*actvar).hostvartype = sqlvchar;

/* ... */

EXEC SQL OPEN :C1 USING DESCRIPTOR;


Transferring NULL Values to the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring NULL Values to the Database Instance

Use

In the application program, you can use indicator values to transfer a NULL value to a database table, for example, in an INSERT or UPDATE statement.

Procedure

Before calling the embedded SQL statement, set the indicator value to -1. The database instance ignores the value of the corresponding host variable, and enters the NULL value in the table that is being addressed.

You can also use indicator values for transferring DEFAULT values to the database instance.


Transferring DEFAULT Values to the Database Instance (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Transferring DEFAULT Values to the Database Instance

Use

In the application program, you can use indicator values to transfer a DEFAULT value to a database table, for example, in an INSERT or UPDATE statement.

Procedure

Before calling the embedded SQL statement, set the indicator value to the predefined constant SQL_DEFAULT_PARAM. The database instance ignores the value of the corresponding host variable, and enters the DEFAULT value in the table that is being addressed.

This procedure is not permitted for LONG columns.

You can also use indicator values for transferring NULL values to the database instance.


Connecting to a Database Instance (SAP Library - SAP DB)

 Entering content frame

Background documentation Connecting to a Database Instance

Before your application program can execute SQL statements, the program must connect to the database instance and open a database session.

Use the statements for connecting to the database instance. Note the following:

· The statements for connecting to the database instance must be the first SQL statements executed by the application program. However, they do not have to be the first SQL statements in the source code.

For the correct order of the SQL statements in the source code, see Conventions for the Order of SQL Statements.

· One application program can have multiple sessions with one or more database instances. The database instance handles each session as an independent transaction. In the SQL mode INTERNAL, there can be a maximum of eight parallel sessions with different SAP DB database instances.


Overview of Precompiler Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Overview of Precompiler Statements

You have the following options when you embed SQL statements in the source code of an application program:

· Static SQL statements

· Dynamic SQL statements

· ARRAY statements

The embedded statements consist of statements to the precompiler, and the actual statement that is sent to the database.

The key words EXEC SQL form the simplest precompiler statement. The static SQL statement EXEC SQL <statement> specifies that the database kernel executes the database statement <statement>.

This table gives you an overview of the precompiler statements and how they are used:

CANCEL statement | Cancels a running SQL statement
CONNECT statement | Statement for connecting to the database instance
DECLARE statements | Indicate declaration sections
DESCRIBE statement | Initializes a descriptor structure for a dynamic SQL statement
EXEC COMMAND statement | Executes an operating system command
EXECUTE statement | Executes a dynamic SQL statement
EXECUTE IMMEDIATE-statement | Calls a dynamic SQL statement without parameters
GETVAL statement | Reads LONG columns piecewise
INCLUDE DECLARE statement | Generates structure definitions
INCLUDE FILE statement | Inserts file content in the source text
OPEN CURSOR statement | Executes a dynamic SQL statement with named result table
PREPARE statement | Prepares a dynamic SQL statement
PUTVAL statement | Inserts values in LONG columns piecewise
SET SERVERDB statement | Statement for connecting to the database instance
TRACE statements | Activates logging in a trace file
USING clause | Assigns parameter values in a dynamic SQL statement
VERSION statement | Displays the software version
WHENEVER statements | Calls actions with conditions

See also: Syntax Directory, Working with Multiple Database Sessions, Compatibility with Other Database Systems

For the syntax of the database statements in the SQL mode INTERNAL, see the Reference Manual: SAP DB.


Working with Multiple Database Sessions (SAP Library - SAP DB)

 Entering content frame

Background documentation Working with Multiple Database Sessions

When you work with multiple database connections in parallel, you must specify the relevant database session in your embedded SQL statements.To do this, specify the following in <session_spec>:

· In SQL mode INTERNAL, specify the session number <session_number>.

· In SQL mode ORACLE, specify the key word AT and the session name <session_name>.

See also: CONNECT Statement and Overview of Precompiler Statements


DECLARE Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation DECLARE Statements

Use

DECLARE statements mark the beginning and end of a declare section.

Syntax

EXEC SQL BEGIN DECLARE SECTION;

EXEC SQL END DECLARE SECTION;


INCLUDE DECLARE Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation INCLUDE DECLARE Statement

Use

You can use the INCLUDE DECLARE statement to generate structure definitions.

Prerequisites

· The precompiler must run with the precompiler option check, so that the application program gets the information it requires from the database instance.

· The file <filename> must not exist. If it exists, an INCLUDE FILE statement is executed instead of the INCLUDE DECLARE statement.

Syntax

EXEC SQL INCLUDE <file_name> <declare_clause>
[<as_clause>] [<ind_clause>];

<declare_clause> ::= <table_clause> | <dbproc_clause>

<table_clause>   ::= TABLE <table_name>

<dbproc_clause>  ::= DBPROC <dbproc_name>

<as_clause>      ::= AS VAR [<variable_declarator>]
|                    AS TYPE [<type_declarator>]
|                    AS STRUCT [<structure_tag>]

<ind_clause>     ::= IND [<ind_variable_declarator>] [<structure_tag>]

· AS VAR generates a variable declaration. AS TYPE generates a type declaration. AS STRUCT generates a structure declaration.

· If you do not specify an AS clause, the INCLUDE DECLARE generates a variable declaration by default.

· The default name of the structure definition is the name of the database table or procedure. However, you can also choose another name in the AS clause.

· The names of the structure components are derived from the column names of the table. The data types of the structure components are compatible with the data types of the corresponding table columns.

· You use the IND clause to generate another structure definition that you can specify as a type definition when you declare the indicator variables.

· If you do not specify a name in <structure_tag>, then, by default, the name of the structure definition for the indicator variable is generated from the table name and preceded by an I.

· The names of the structure components for the indicator variable are, by default, derived from the table name and the column names, preceded by an i.

· The data types of the structure components are short int.

· If the table contains columns with the data type long, then the precompiler generates, as a structure component, a character string with 32767 characters for each of these columns, and displays a warning on the screen. You can then redefine or modify these structure components in the source code.


Statements for Connecting to the Database Instance (SAP Library - SAP DB)

 Entering content frame

Background documentation Statements for Connecting to the Database Instance

Use

Use these embedded SQL statements to connect to a database instance and open a database session.

Procedure

...

1. In the SQL mode INTERNAL, use the SET SERVERDB statement to specify the name of the database instance to which you want to connect, and the name of the server on which the database instance is running.

In the SQL mode ORACLE, enter the name and server of the database instance in the USING clause of the CONNECT statement.

2. Use the CONNECT statement to specify the user name and password and open the database session. At the same time, you can choose options for the database connection.


SET SERVERDB Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation SET SERVERDB Statement

Use

You use the SET SERVERDB statement to specify information on connecting to the database instance in the SQL mode INTERNAL. This includes defining which database instance on which server you want the application program to connect to.

Syntax

EXEC SQL [<session_number>] SET SERVERDB <database_name> [ON <database_server>];

· You can also specify the name of the database instance <database_name> and the server <database_server> on which it runs in a host variable with the data type char.

· Enter <session_number> as the session number if you want your application program to open multiple database sessions in parallel. In the SQL mode INTERNAL, there can be a maximum of eight parallel sessions with different SAP DB database instances.

You can override the information from the SET SERVERDB statement with the KEY in the CONNECT statement.

When you run the precompiler, you can also override the information from the SET SERVERDB statement for all database sessions with the precompiler options –d and -n.


CONNECT Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation CONNECT Statement

Use

Use the CONNECT statement to connect to the database instance, and specify the user name and password for the database session.

Prerequisite

In the SQL mode INTERNAL, you have specified the name of the chosen database instance and server in the SET SERVERDB statement.

You can do without the SET SERVERDB statement if you choose the database instance and server by specifying a KEY in the CONNECT statement.

Syntax

CONNECT Statement in the SQL Mode INTERNAL

CONNECT Statement in the SQL Mode ORACLE

· When you run the precompiler, you can use the precompiler option –u to override the user name and password specified in the CONNECT statement for the first database session. The values for all subsequent database sessions of the application program are, if possible, taken from the source code when the precompiler runs. A warning appears if these values are missing, and the embedded SQL statements of the subsequent database sessions are not checked.

· When you run the precompiler, you can use the precompiler option –U to override the KEY specified in the CONNECT statement of the first database session.


CONNECT Statement in the SQL Mode INTERNAL (SAP Library - SAP DB)

 Entering content frame

Background documentation CONNECT Statement in the SQL Mode INTERNAL

Use

Use the CONNECT statement to connect to the database instance, and specify the user name, password, and options for the database session.

Syntax

EXEC SQL [<session_number>] CONNECT
         [<user_name> IDENTIFIED BY <password> | <uidpwd>]
         [<connect_option>...] [KEY <key>];

<uidpwd> ::= <user_name>/<password>

<connect_option> ::= [ISOLATION LEVEL <unsigned_integer>]
                     [TIMEOUT <unsigned_integer>]

· Enter <session_number> as the session number if you want your application program to open multiple database sessions in parallel. In the SQL mode INTERNAL, there can be a maximum of eight parallel sessions with different SAP DB database instances.

· The user name <user_name> and password <password> can also be specified as a character string in a host variable (character or UNICODE data types).

· In <connect_option> you can specify an isolation level and timeout value.

· You can specify the <key> in a host variable with data type char . You can specify an XUSER user key, DEFAULT or the environment variable SQLOPT . For information on setting the connection options at runtime in this environment variable, see your operating system documentation.

· The values of the <key> complete or override the values from the SET SERVERDB statement, as well as the explicitly specified user name, password, and CONNECT options.


CONNECT Statement in the SQL Mode ORACLE (SAP Library - SAP DB)

 Entering content frame

Background documentation CONNECT Statement in the SQL Mode ORACLE

Use

Use the CONNECT statement to connect to the database instance, and specify the user name, password, and options for the database session.

Syntax

EXEC SQL CONNECT
         [<user_name> IDENTIFIED BY <password> | <uidpwd>]
         AT <session_name>
         USING <database_server-database_name>
         [<connect_option>...] [KEY <key>];

<uidpwd> ::= <user_name>/<password>

<connect_option> ::= [ISOLATION LEVEL <unsigned_integer>]
                     [TIMEOUT <unsigned_integer>]

· Choose a name for the database name in <session_name>. The only limit on the possible number of parallel database sessions in the SQL mode ORACLE is the maximum possible number of database sessions of the database instances.

· The user name <user_name> and password <password> can also be specified as a character string in a host variable (character or UNICODE data types).

· In <connect_option> you can specify an isolation level and timeout value.

· You can specify the <key> in a host variable with data type char . You can specify an XUSER user key, DEFAULT or the environment variable SQLOPT . For information on setting the connection options at runtime in this environment variable, see your operating system documentation.

· The <key> values complete or override the explicitly specified user name, password, and CONNECT options.


Static SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Static SQL Statements

Use dynamic SQL statements particularly if you already know the structures of the database tables during the programming phase, and the embedded SQL statements do not change at runtime of the application program. The C/C++ precompiler checks the syntax of static SQL statements by sending them to the database kernel when you run the precompiler with the precompiler option check.

If the SQL statements or the structures of the database tables change at runtime of the program, use dynamic SQL statements.

You can formulate the following types of static SQL statements:

· Static SQL statement without parameters

· Static SQL statement with parameters


Static SQL Statement Without Parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation Static SQL Statement Without Parameters

Use

One example of static SQL statements without parameters are DDL statements such as the CREATE TABLE statement. However, you can also formulate INSERTs, UPDATEs, DELETEs, and other statements.

Syntax

EXEC SQL [<session_spec>] <statement>;

Specify <session_spec> , when you are working with multiple database sessions.

EXEC SQL CREATE TABLE hotel
(hno FIXED (4,0) KEY CONSTRAINT hno BETWEEN 1 AND 9999,
name CHAR(15) NOT NULL, zip FIXED (5,0) NOT NULL, loc CHAR(20), price FIXED(6,2));

EXEC SQL INSERT INTO hotel VALUES (10,'Excelsior', 79000,'Atlanta', 135.00);

EXEC SQL INSERT INTO hotel VALUES (20,'Flora', 44000,'Philadelphia', 45.00);

EXEC SQL COMMIT WORK;


Static SQL Statement with Parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation Static SQL Statement with Parameters

Use

The most common use of parameters in a static SQL statement is the use of host variables as parameters in a WHERE condition.

The host variables must be declared in the declaration section.

You can use host variables in static SQL statements only in positions where the SQL syntax allows a parameter. For example, you cannot specify table names with host variables.

Syntax

EXEC SQL [<session_spec>] <statement>;

Specify <session_spec> , when you are working with multiple database sessions.

EXEC SQL BEGIN DECLARE SECTION;

char name[16];

EXEC SQL END DECLARE SECTION;

sprintf (name, "Excelsior");

EXEC SQL SELECT name FROM hotel WHERE name = :name;

EXEC SQL FETCH INTO :name;


Dynamic SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Dynamic SQL Statements

Use dynamic SQL statements if you do not know the structures of the database tables during the programming phase, and the embedded SQL statements can change at runtime of the application program.

If the SQL statements and table structures do not change at runtime, use static SQL statements.

You can formulate the following types of dynamic SQL statements:

Dynamic SQL statements without parameters

Dynamic SQL statements with parameters


Dynamic SQL Statements Without Parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation Dynamic SQL Statements Without Parameters

Use

Specify dynamic SQL statements without parameters as a character string <statement_source> in a host variable in the application program. The character string itself cannot contain any other host variable.

Call the dynamic SQL statement with the EXECUTE IMMEDIATE statement.

Syntax

EXEC SQL [<session_spec>] EXECUTE IMMEDIATE <statement_source>;

Specify <session_spec> , when you are working with multiple database sessions.

EXEC SQL BEGIN DECLARE SECTION;

char statement [40];

EXEC SQL END DECLARE SECTION;

strcpy (statement, "INSERT HOTEL VALUES (80, 'Royal Plaza', 2000, \'Denver', 90.00)");

EXEC SQL EXECUTE IMMEDIATE :statement;

EXEC SQL EXECUTE IMMEDIATE 'COMMIT WORK';


Dynamic SQL Statements with Parameters (SAP Library - SAP DB)

 Entering content frame

Background documentation Dynamic SQL Statements with Parameters

Use

You can set parameters for dynamic SQL statements, so that any values unknown during the programming phase can be exchanged between the application program and the database instance.

Procedure

...

1. Replace the values that need to be exchanged with the placeholder ? in the statement.

2. Use the PREPARE statement to prepare the dynamic SQL statement for execution, and assign it a statement name.

3. Execute the dynamic SQL statement with the EXECUTE statement or OPEN CURSOR statement.
Use the USING clause to assign values to the previously unknown parameters at runtime, for example, from a program variable of your choice. This does not have to be a host variable.
You can execute a prepared SQL statement as often as you want, specifying new values as parameters each time.

If, during the programming phase, you do not know the table columns addressed by a dynamic SQL statement, and, therefore, the required parameters, then also use a descriptor.

EXEC SQL BEGIN DECLARE SECTION;

int hno;

char name[16];

float price;

char cmd[100];

char *stmt;

EXEC SQL END DECLARE SECTION;

strcpy (cmd, "INSERT (INTO???) hotel VALUES(10, 'Excelsior', \
79000, 'Atlanta', 135.00)");

EXEC SQL PREPARE STMT1 FROM :cmd;

EXEC SQL EXECUTE STMT1;

hno = 10;

strcpy (cmd, "SELECT name, price INTO ?, ? \
FROM hotel WHERE hno=?");

stmt = "STMT2";

EXEC SQL PREPARE :stmt FROM :cmd;

EXEC SQL EXECUTE :stmt USING :name, :price, :hno;


Using the Descriptor (SAP Library - SAP DB)

 Entering content frame

Background documentation Using the Descriptor

Use

If, during the programming phase, you do not know the table columns addressed by a dynamic SQL statement with parameters, and, therefore, the required parameters, then use a descriptor.

At runtime, the application program determines the number, data types, and lengths of the table columns addressed by an SQL statement, and saves this information in the structure sqlda (SQL Descriptor Area, descriptor for short).

You can then use this information to assign the appropriate program variables to the parameters in the SQL statement.

See also: Example for Using a Descriptor

Prerequisite

You have used the PREPARE statement to prepare the dynamic SQL statement.

Procedure

1. Initialize the descriptor with the DESCRIBE statement.

2. Use the information in the descriptor to assign appropriate program variables to the parameters in the dynamic SQL statement. To do this, enter the addresses of these program variables in the descriptor structure as well.

Make sure that the program variables contain valid values at runtime.

3. Use the EXECUTE statement or the OPEN CURSOR statement with the USING clause.

If you use the SQL mode INTERNAL, the C/C++ precompiler defines an initial descriptor called sqlda automatically. In other modes, and if you want to use other descriptors, declare them as variables with the data type sqlda. This data type is defined in the header file cpc.h.


Structure of the Descriptor (SAP Library - SAP DB)

 Entering content frame

Background documentation Structure of the Descriptor

This table describes the structure of the descriptor (the data structure sqlda) that you can use in dynamic SQL statements with parameters in the SQL mode INTERNAL.

The C/C++ precompiler also supports ORACLE sqlda data structures (see Compatibility with Other Database Systems).

sqldaid | Contains the character string sqlda for finding the structure in a memory dump
sqlmax | Maximum number of sqlvar entries The C/C++ precompiler specifies the constant sqlmax = 300 for this value, however, you can change it.
sqln | Number of sqlvar entries currently allocated
sqld | Number of output parameters used in the SQL statement Any parameters that can be both input and output parameters are also counted as output parameters.
sqlvar | array [sqlmax] of sqlvar entries For each parameter, an entry sqlvar [i] is generated according to the order in which the parameter appears in the SQL statement. This entry contains information on the data type and the length of the addressed table column.

All constants used in the descriptor are declared in the header file cpc.h.

If you do not want to use the standard descriptor, you can declare the descriptor <descriptor_name> as a variable of the type sqldatype or struct sqlda (in SQL mode ORACLE, SQLDA only). However, the descriptor must always have the same type within a program.


sqlvar [i] Entries in the Descriptor (SAP Library - SAP DB)

 Entering content frame

Background documentation sqlvar [i] Entries in the Descriptor

Each sqlvar [i] entry in the descriptor structure describes the properties of a parameter in the dynamic SQL statement, as well as the properties of the required or assigned program variables.

Each sqlvar [i] entry consists of the following components:

colname

Contains the name of the table column for a FETCH statement.

For all other SQL statements, colname contains the entry columnx, where x is a sequential number.

colio

Specifies whether the parameter is an input or output parameter.

sqlinppar: Input parameter
 sqloutpar: Output parameter
 sqlinoutpar: Input and output parameter

colmode

Specifies whether NULL values are permitted for the parameter.

colmode is a byte whose four low-order bits are interpreted as a bit mask.

Bit 0: Mandatory
Bit 1: Optional (NULL permitted)
Bit 2: Default
Bit 3: Escape Character

coltype

Specifies the SAP DB data type of the parameter.

See: SAP DB Data Types in sqlvar Entries

collength

Specifies the length of the parameter or table column.

For numerical data types, collength specifies the number of digits.

For all other data types, collength specifies the number of characters.

You can modify the value of collength, for example, if the closing NULL byte increases the number of characters in a character string by 1.

colfrac

Specifies the number of decimal places for numerical parameters or table columns.

For the data type FLOAT/REAL colfrac = -1.

hostindicator

Contains the indicator value, so performing the same task as an indicator variable.

For input parameters, the user can set hostindicator.

For output parameters, query hostindicator. If the table column contains a NULL value, the value of the program variable is not overwritten.

hostvartype

In hostvartype, specify the C/C++ data type of the program variable assigned to the parameter (see C/C++ Data Types in sqlvar Entries).

If necessary, modify the values of collength and colfrac.

The DESCRIBE statement initializes hostvartype with the value –1 (undefined).

hostcolsize

In hostcolsize, specify the size of an array element (in bytes) for array statements.

hostvaraddr

In hostvaraddr, specify the address of the program variable assigned to the parameter.

For array statements, specify the address of the first array element.

The DESCRIBE statement initializes hostvaraddr with the NULL value.

hostindaddr

Contains the address of hostindicator.

Instead of this, you can also specify the address of an indicator variable. The indicator value is then written to this variable, and the content of hostindicator is undefined.

For array statements, specify the address of the first array element of the indicator variable.

If you do not want to use an indicator value, specify NULL.

colinfo

Used for internal information on converting program variables.

Do not change this value.


SAP DB Data Types in sqlvar Entries (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB Data Types in sqlvar Entries

This table shows the possible sqlvar entries coltype and the corresponding SAP DB data types.

coltype | SAP DB Data Type
sqlfixed | FIXED
sqlfloat | FLOAT
sqlchar | CHAR
sqlbyte | CHAR (n) BYTE
sqldate | DATE
sqltime | TIME
sqlexpr | FLOAT
sqltimestamp | TIMESTAMP
sqllong | LONG
sqllongbyte | LONG BYTE
sqlboolean | BOOLEAN
sqlunicode | CHAR UNICODE
sqlsmallint | SMALLINT
sqlinteger | INTEGER
sqlvarchar | VARCHAR
sqlvarbyte | VARCHAR BYTE
sqllongunicode | LONG UNICODE
sqlvarunicode | VARCHAR UNICODE


C/C++ Data Types in sqlvar Entries (SAP Library - SAP DB)

 Entering content frame

Background documentation C/C++ Data Types in sqlvar Entries

This table shows the possible sqlvar entries hostvartype and the corresponding C/C++ data types.

hostvartype | C/C++ Data Type
sqlvint1 | integer (1 byte)
sqlvint2 | integer (2 bytes)
sqlvint4 | integer (4 bytes)
sqlvint8 | integer (8 bytes)
sqlvuns1 | unsigned integer (1 byte)
sqlvuns2 | unsigned integer (2 bytes)
sqlvuns4 | unsigned integer (4 bytes)
sqlvuns8 | unsigned integer (8 bytes)
sqlvreal4 | float (4 bytes)
sqlvreal8 | float (8 bytes)
sqlvchar | char array (ends with null byte)
sqlvcharp | char array (filled up with blank characters)
sqlvbyte | char array (null bytes permitted and filled up with null bytes)
sqlvstring1 | String with variable length struct {len char; char array}
sqlvstring2 | String with variable length struct {len short; char array}
sqlvstring4 | String with variable length struct {len int; char array}
sqlvfile | char array (filled up with blank characters) The value of this parameter must be a file name. See also SQLFILE
sqlvfilec | char array (ends with null byte) The value of this parameter must be a file name. See also SQLFILE
sqlvlongdesc | SQLLongDesc
sqlvucs2 | UCS2 array (filled up with blank characters)
sqlvutf16 | UTF16 array without surrogate (filled up with blank characters)
sqlvunicode | UTF8 array (filled up with blank characters)
sqlvunicodec | UTF8 array (ends with null byte)
sqlvstringunicode | UTF8 array with variable length struct {len short; char array}
sqlvstringunicode4 | UTF8 array with variable length struct {len int; char array}


Example for Using a Descriptor (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example for Using a Descriptor

EXEC SQL BEGIN DECLARE SECTION;

char stmnt [255];

EXEC SQL END DECLARE SECTION;

strcpy (stmnt, "select hno, name, price from hotel");

EXEC SQL PREPARE SEL FROM :stmnt;

EXEC SQL EXECUTE SEL;

EXEC SQL PREPARE FET FROM 'FETCH USING DESCRIPTOR';

EXEC SQL DESCRIBE FET;

/* Bind each column to a piece of memory */

for (i=0;i<sqlda.sqln;i++) {
  sqlvartype *sqlvar = &sqlda.sqlvar[i];

  switch(sqlvar->coltype){
    case (sqlfixed) : {
      if (sqlvar->colfrac == 0) {
        sqlvar->hostvartype = sqlvint4;

        sqlvar->hostcolsize = sizeof(int);

        sqlvar->hostvaraddr = malloc(sizeof(int));
      }
      else {
        sqlvar->hostvartype = sqlvreal4;

        sqlvar->hostcolsize = sizeof(float);

        sqlvar->hostvaraddr = malloc(sizeof(float));
      }
      break;

    }
    case (sqlchar) : {
      sqlvar->hostvartype = sqlvchar;

      sqlvar->hostcolsize = sqlda.sqlvar[0].collength;

      sqlvar->hostvaraddr = malloc(sizeof(int));

      break;

    }
default : {
/* TODO:

support more datatypes */

    }
    }
    }

    /* Process result table */

    EXEC SQL EXECUTE FET USING DESCRIPTOR;

    while (sqlca.sqlcode == 0) {
      EXEC SQL EXECUTE FET USING DESCRIPTOR;
    }


PREPARE Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation PREPARE Statement

Use

Use the PREPARE statement to prepare a dynamic SQL statement with parameters for execution, and assign it a statement name.

Syntax

EXEC SQL [<session_spec>] PREPARE <statement_name>
         [INTO <descriptor_name> [USING <using_clause>]]
         FROM <statement_source>;

· Specify <session_spec> , when you are working with multiple database sessions.

· In <statement_name >, specify the statement name either in a host variable or as a constant character string.

· In <statement_name >, specify the dynamic SQL statement either in a host variable or as a constant character string.

In the PREPARE statement, the <descriptor_name> and the <using_clause> have no meaning in the SQL mode INTERNAL. They are used for DB2 compatibility.


DESCRIBE Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation DESCRIBE Statement

Use

Use the DESCRIBE statement to initialize the descriptor structure, and to determine the parameter and table column information needed for a dynamic SQL statement with descriptor.

Prerequisite

You have used the PREPARE statement to prepare the SQL statement for execution.

Syntax

EXEC SQL [<session_spec>] DESCRIBE <statement_name>
[INTO <descriptor_name> [<using_clause>]];

· Specify <session_spec> , when you are working with multiple database sessions.

· If the INTO clause is not specified, the precompiler uses the standard descriptor sqlda.

· If you do not want to use the standard descriptor, you can declare the descriptor <descriptor_name> as a variable of the type sqldatype or struct sqlda (in SQL mode ORACLE, SQLDA only). However, the descriptor must always have the same type within a program.

Note

In the SQL mode INTERNAL, the <using_clause> has no meaning in the DESCRIBE statement. It is used for DB2 compatibility.


EXECUTE Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation EXECUTE Statement

Use

Use the EXECUTE statement to execute a dynamic SQL statement with parameters.

Prerequisites

· You have used the PREPARE statement to prepare the SQL statement for execution.

· If you are using a descriptor, you have initialized it with the DESCRIBE statement.

Syntax

EXEC SQL [<session_spec>] [<for_clause>] EXECUTE <statement_name> [<using_clause>];

· Specify <session_spec> , when you are working with multiple database sessions.

· Use the USING clause to assign values to the parameters.

· Use the FOR clause for array statements.


OPEN CURSOR Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation OPEN CURSOR Statement

Use

You can use the OPEN CURSOR statement to execute a dynamic SQL statement with parameters, and generate a named result table (cursor).

Prerequisites

· You have used the PREPARE statement to prepare the SQL statement for execution.

· If you are using a descriptor, you have initialized it with the DESCRIBE statement.

· You have already defined the cursor (the named result table) with a DECLARE CURSOR statement.

Syntax

EXEC SQL [<session_spec>] [<for_clause>] OPEN <cursor_name>
         [ USING <parameter_list>
         | USING DESCRIPTOR [<descriptor name>] [KEEP]
         | INTO <parameter_list>
         | INTO DESCRIPTOR [<descriptor name>] [KEEP]]

· If, in the programming phase, you do not know how many different result tables are processed by your application program, you can specify the result table name <cursor_name> in a host variable in the OPEN CURSOR statement.

· Specify KEEP if you want to follow the OPEN CURSOR statement with PUTVAL statements.

· Here, INTO has the same meaning as specifying USING <parameter_list>. It guarantees compatibility with other database systems.

EXEC SQL BEGIN DECLARE SECTION;

int hno;

char name[16];

float price;

char cmd[100];

char *stmt;

char *cursor;

EXEC SQL END DECLARE SECTION;

strcpy (cmd, "INSERT (INTO???) hotel VALUES(10, 'Excelsior', \
79000, 'Atlanta', 135.00)");

EXEC SQL PREPARE STMT1 FROM :cmd;

EXEC SQL DECLARE cur1 CURSOR FOR STMT1;

EXEC SQL OPEN cur1;

hno = 10;

strcpy (cmd, "SELECT name, price FROM hotel WHERE hno=?");

stmt = "STMT2";

EXEC SQL PREPARE :stmt FROM :cmd;

cursor = "cur2";

EXEC SQL DECLARE :cursor CURSOR FOR :stmt;

EXEC SQL OPEN :cursor USING :hno;

EXEC SQL FETCH :cursor INTO :name, :price;


USING Clause (SAP Library - SAP DB)

 Entering content frame

Background documentation USING Clause

Use the USING clause for dynamic SQL statements with parameters to assign values to the parameters in EXECUTE or OPEN CURSOR statements.

Prerequisites

· You have used the PREPARE statement to prepare the SQL statement for execution.

· If you are using a descriptor, you have initialized it with the DESCRIBE statement.

Syntax

<using_clause> ::=
  USING <parameter_list>
| USING DESCRIPTOR [<descriptor_name>]
| INTO <parameter_list>
| INTO DESCRIPTOR [<descriptor_name>]

· If you do not specify <descriptor_name>, the standard structure sqlda is used.

· Here, INTO has the same meaning as specifying USING. It guarantees compatibility with other database systems.


Array Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation Array Statement

Use

Use array statements to read or change more than one data record in a data table with only a single embedded SQL statement. An array statement executes an SQL statement multiple times in a loop, and applies each array element as a parameter in a row of the database table.

You have the following options when you formulate an array statement:

· You specify all parameters in a static SQL statement in array host variables.

· You use the FOR clause together with a descriptor and array program variables in a dynamic SQL statement.

Syntax

EXEC SQL [<session_spec>] [FOR <loop_parameter>] <sql_statement>;

· Specify <session_spec>, when you are working with multiple database sessions.

· The value of <loop_parameter> detemines the number of loop repeats. If the array variable has more or fewer components than specified in <loop_parameter>, a warning appears in the precompiler log and the statement is executed with the lowest dimension. This also applies if you use multiple array variables that do not have the same number of elements.

If errors occur in the database kernel while the array statement is being executed, the statement is terminated, and the number of successfully processed records is entered under sqlerrd[2] in the structure sqlca.

The SQL statement SELECT INTO is not permitted for array statements in the SQL mode INTERNAL.

Example

Example of a static array statement:

/* Array Insert */

EXEC SQL BEGIN DECLARE SECTION;

int hno[3];

int zip[3];

float price[3];

char *name[3], *loc[3];

EXEC SQL END DECLARE SECTION;

hno[0]   = 10;

name[0]  = "Excelsior";

zip[0]   = 89073;

loc[0]   = "Philadelphia";

price[0] = 135.00;

hno[1]   = 30;

name[1]  = "Flora";

zip[1]   = 48159;

loc[1]   = "Atlanta";

price[1] = 45.00;

hno[2]   = 20;

name[2]  = "Continental";

zip[2]   = 86165;

loc[2]   = "Cincinnati";

price[2] = 70.00;

EXEC SQL INSERT INTO HOTEL VALUES (:hno, :name, :zip, :loc, :price);


INCLUDE FILE Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation INCLUDE FILE Statement

Use

You can use the INCLUDE FILE statement to include source code from a file <file_name> in your application program. The precompiler places this text at the location of the INCLUDE FILE statement in the source code. The text itself cannot contain an INCLUDE FILE or INCLUDE DECLARE Statement.

Syntax

EXEC SQL INCLUDE <file_name>;

If necessary, you can use EXEC SQL INCLUDE sqlca to select the position in the source code at which you want the precompiler to declare the structure sqlca. This statement ensures compatibility with other embedded SQL compilers. If you do not select a position, the precompiler places the declaration at the start of the program.


PUTVAL Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation PUTVAL Statement

Use

You can use PUTVAL statements to insert data in a LONG column piecewise.

The PUTVAL statements must follow a INSERT statement. Each PUTVAL statement that follows this INSERT statement appends the current content of the corresponding host variable to the LONG column of the database table.

Prerequisite

You have started to insert the data in the LONG column with an INSERT statement.

Syntax

EXEC SQL [<session_spec>] PUTVAL INTO <table_name>
         [(<column_name>,...)] VALUES (<parameter_list>)

· Apart from the key word PUTVAL, the PUTVAL statement must be the same as the preceding INSERT statement. For example, the order and number of the parameters in the parameter list must be the same as the parameter list <parameter_list> of the INSERT statement.

· Before each PUTVAL statement, assign the new data to the host variable for the LONG column.

· The PUTVAL statement ignores any values in the parameter list that refer to table columns other than the LONG column.

· You cannot execute any other SQL statements between the INSERT statement and the subsequent PUTVAL statement, or between the PUTVAL statements themselves.

Every other SQL statement closes the LONG column in the database table, so that no more data can be appended.

· Inform yourself about the special features when using the data type SQLLongDesc.

· If you want to insert more than one row in a table, use an array statement.

EXEC SQL CREATE TABLE LONGTEST
(I1 INTEGER, L1 LONG BYTE, L2 LONG BYTE);

EXEC SQL BEGIN DECLARE SECTION;

  int array_size;

  VARCHAR l1[100][500], l2[100][50];

  int i1[100];

EXEC SQL END DECLARE SECTION;

array_size = 100;

EXEC SQL FOR :array_size INSERT INTO LONGTEST VALUES
(:i1, :l1 :il1, :l2 :il2);

· If you do not want a PUTVAL statement to insert any data in a certain LONG column, then assign the predefined constant SQL_IGNORE to the appropriate indicator value in this statement.

You cannot insert LONG data with the length NULL.


GETVAL Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation GETVAL Statement

Use

You can use the GETVAL statement to read data piecewise from a LONG column.

The GETVAL statements must follow a FETCH statement. Each GETVAL statement that follows this FETCH statement reads the next part of the content from the LONG column of the database table from the current position.

Prerequisite

You have started to read the data from the LONG column with a FETCH statement.

Syntax

EXEC SQL [<session_spec>] GETVAL INTO (<parameter_list>)

· Apart from the key word GETVAL, the GETVAL statement must be the same as the preceding FETCH statement. For example, the order and number of the parameters in the parameter list must be the same as the parameter list <parameter_list> of the FETCH statement.

· You cannot execute any other SQL statements between the FETCH statement and the subsequent GETVAL statement, or between the GETVAL statements themselves.

· If the host variable that corresponds to the LONG column has the data type SQLLongDesc, then you can read the total length of the LONG column in the corresponding structure component cbColLenafter the GETVAL statement has been executed.

· You can determine how often you need to execute the GETVAL statement by querying the warning message sqlwarn1. If sqlwarn1 has the value W, then the LONG column has not yet been read completely.

After the FETCH statement has been executed, the remaining content of the LONG column is read by the following statement:

while (sqlca.sqlwarn[1] == 'W')
EXEC SQL GETVAL INTO :i1, :l1, :l2;

· If you do not want a GETVAL statement to read the data of a certain LONG column, then assign the predefined constant SQL_IGNORE to the appropriate indicator value in this statement.


WHENEVER Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation WHENEVER Statements

Use

You can use WHENEVER statements to program actions that you want to be executed for each subsequent embedded SQL statement.

You have the following options:

· You program actions that are executed before or after each SQL statement.

· You program error handling actions.

The WHENEVER statement must be located in the source code of the application program in front of the SQL statements that it handles. This is so that the C/C++ precompiler can generate the appropriate individual statements when the precompiler runs. The WHENEVER statement is valid for all subsequent SQL statements in the source code until another WHENEVER statement for the same condition takes over, or until the program ends.

Syntax

EXEC SQL WHENEVER <condition> <action>;

Where <condition> is an error (see Handling Errors with WHENEVER Statements), or one of the following conditions:

SQLBEGIN | The specified <action> is executed before each SQL statement.
SQLEND | The specified <action> is executed after each SQL statement.

For <action>, specify one of the possible actions for the WHENEVER statement.

Example

Example for Using WHENEVER Statements


Handling Errors with WHENEVER Statements (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Handling Errors with WHENEVER Statements

Use

You can use WHENEVER statements to program standard error handling procedures for errors and exceptions that can occur when embedded SQL statements are executed. You can check four different types of database system messages, and choose from four standard reactions to these messages.

Use a WHENEVER statement if, for example, the application program does not query the values of the messages sqlcodeor sqlwarn0 after an SQL statement.

Syntax

EXEC SQL WHENEVER <condition> <action>;

Where <condition> is one of the following cases:

SQLWARNING | sqlwarn0 has the value W. At least one warning exists.
SQLERROR | sqlcode has a negative value. An error has occurred.
NOT FOUND | sqlcode has the value 100 (ROW NOT FOUND). No table row found.
SQLEXCEPTION | sqlcode has a positive value greater than 100. An exception has occurred.

For <action>, specify one of the possible actions for WHENEVER statements.

If SQLERROR occurs, the application program must terminate, and the error must be analyzed.

If you call an error handling function <action> that also contains SQL statements, and these SQL statements can send error messages, then start the function with a WHENEVER CONTINUE statement to avoid endless loops.

This graphic is explained in the accompanying text Example

EXEC SQL WHENEVER SQLEND CALL CheckSQLCode(&sqlca);

EXEC SQL SELECT DIRECT NAME, LOC
         INTO :name, :loc FROM HOTEL KEY HNO = :hno;

void

CheckSQLCode(sqlcatype *sqlca)
{
if (sqlca->sqlcode != 0)

{
code =

sqlca->sqlcode;
EXEC SQL WHENEVER

SQLERROR CONTINUE;
EXEC SQL INSERT INTO

ERROR VALUES (:code);
}
}


Actions for the WHENEVER Statement (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Actions for the WHENEVER Statement

Use WHENEVER statements to call the following actions <action>:

STOP | Resets the running transaction correctly, ends the database connection with the RELEASE statement COMMIT WORK RELEASE and terminates the program
CONTINUE | Continues to run the application program. Use CONTINUE to deactivate a previous WHENEVER action for this condition.
GOTO <label> | The application program jumps to the label <label>. <label> can have a maximum of 45 characters.
CALL <function> | The application program calls the function <function>. The function call can have a maximum of 50 characters, including the parameters used.


Example for Using WHENVER statements (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example for Using WHENEVER Statements

The following examples show the usage of different WHENEVER statements.

EXEC SQL WHENEVER SQLWARNING CALL warnproc();

EXEC SQL SELECT * FROM dual;

/* receives a warning and calls warnproc */

EXEC SQL WHENEVER SQLERROR CALL errproc();

EXEC SQL DELETE FROM unknowntable;

/* receives an error and calls errorproc */

EXEC SQL WHENEVER SQLERROR STOP;

/* receives also an error but stops execution */

EXEC SQL DELETE FROM unknowntable;


CANCEL Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation CANCEL Statement

Use

Use the CANCEL statement to cancel the processing of an SQL statement by the database kernel. This means that the SQL statement has no effect.If successful, the CANCEL statement has the return code sqlcode 0. The canceled statement has the sqlcode –102.

Syntax

EXEC SQL CANCEL [<cancel_session>];

<cancel_session> ::= <session_number> | <session_name> | CURRENT


EXEC COMMAND Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation EXEC COMMAND Statement

Use

You can use the EXEC COMMAND statement to execute operating system commands, for example, to delete files or call the Database Manager CLI.

The same general rules apply to EXEC COMMAND statements as to SQL statements. Precede each system call with the key words EXEC COMMAND .

Syntax

EXEC COMMAND SYNC <command> RESULT <result_parameter>
| EXEC COMMAND ASYNC <command>;

<command> ::= <string_constant> | <host_variable>

<result_parameter> ::=  <host_variable>

· Declare <result_parameter> as a host variable with the type int (2 bytes).

· In SYNC mode, the application program stops until the operating system command has been completed.

· In ASYNC mode, the operating system command is executed in the background.

· For information on the correct syntax of the operating system command, see your operating system documentation.


VERSION Statement (SAP Library - SAP DB)

 Entering content frame

Background documentation VERSION Statement

Use

You can use the VERSION statement to display the versions of the general SAP DB runtime environment and the precompiler runtime environment.

Syntax

EXEC SQL VERSION <runtime_version>, <precompiler_version>;

You can specify <runtime_version> and <precompiler_version> as host variables with the data type char and a length of 40 bytes.


TRACE Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation TRACE Statements

Use

You can use the TRACE statements to specify that the precompiler runtime environment logs the execution of individual embedded SQL statements in the trace file <filename>.pct at runtime of the application program.

Procedure

Include the SQL statements that you want to log in the statements SET TRACE ON or SET TRACE LONG and SET TRACE OFF.

Any SQL statements that appear in external subroutines or modules called by the included SQL statements are also logged.

To activate logging for the whole application program, set your chosen trace option when you run the precompiler or call the program. The trace option then overrides the individual TRACE statements.

Syntax

EXEC SQL SET TRACE ON; | Activates logging with the trace option TRACE SHORT Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2].
EXEC SQL SET TRACE LONG; | Activates logging with the trace option TRACE LONG Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2] and all parameter values.
EXEC SQL SET TRACE OFF; | Deactivates logging
EXEC SQL SET TRACE LINE <trace_line>; | The content of <trace line> is written to the trace file as a comment. You can specify <trace line> as a character string or in a host variable.


Database System Messages (SAP Library - SAP DB)

 Entering content frame

Background documentation Database System Messages

Database system messages and warnings are sent using the global structure sqlca (SQL Communication Area) The precompiler includes this structure automatically in every SAP DB application program. At runtime of the application program, the database saves information on the execution of the last embedded SQL statement in the structure components, for example, information on any errors that occurred.

Query the structure component sqlcodeafter every SQL statement.

The sqlca components have the following meaning:

sqlcaid

char [8]

Contains the character string sqlca and is used to find the sqlca when analyzing a memory dump

sqlcabc

integer (4 byte)

Specifies the length of the sqlca in bytes

sqlcode

integer (4 byte)

Contains the message code of the database system message

sqlcode = 0 indicates that a statement was executed successfully.

sqlcode > 0 indicates problems that must be handled in the program.

sqlcode < 0 indicates errors that terminated the program.

For descriptions of all the messages, see Messages: SAP DB..

sqlerrml

integer (2 byte)

Specifies the current length of sqlerrmc

sqlerrmc

char [70]

Contains an explanation of the message if sqlcode has a value other than 0

sqlerrd

Array of six 4 byte integer numbers

sqlerrd [2] specifies how many table rows were processed by the SQL statement. -1 indicates that the number of processed rows is unknown.
If there are errors in array statements, sqlerrd [2] contains the number of the last row that was processed without errors.

sqlerrd [5] specifies the runtime of the statement in the database kernel (in seconds).

sqlerrd [6] specifies the position in the SQL statement at which a syntax error was found. This value is undefined for array statements. If the SQL statement did not have any errors, then sqlerrd [6] = 0.

sqlwarn0

char [1]

sqlwarn0 = W specifies that the SQL statement generated at least one of the warnings sqlwarn1..sqlwarnc.

If no warning exists, then sqlwarn0 contains a blank character.

sqlwarn1..sqlwarnc

Warning messages in the structure sqlca

sqlresn

char [18]

Contains the name of the result table after a SELECT statement is called

sqlresn contains a blank character after all other calls

sqldatetime

integer (2 byte)

Specifies which date and time format the data types DATE, TIME und TIMESTAMP have.

1 INTERNAL
 2 ISO
 3 USA
 4 EUR
 5 JIS

All other sqlca components are used for internal purposes.


Warning Messages in the Structure sqlca (SAP Library - SAP DB)

 Entering content frame

Background documentation Warning Messages in the Structure sqlca

This table shows you the warning messages that can occur as database system messages.

Each of the sqlca components sqlwarn1..sqlwarnc has the value W if the execution of an embedded SQL statement generates the corresponding warning.
If the corresponding warning does not exist, the component contains a blank character.

sqlwarn1

char [1]

Specifies whether a character string of the type char was truncated when a host variable and the database exchanged values.

If you use an indicator variable, and a warning occurs, the variable specifies the length of the original character string.

sqlwarn2

char [1]

Specifies whether COUNT, MAX, MIN, SUM, AVG, STDDEV or VARIANCE NULL values were found in the database table and ignored by the database kernel when the SET functions were executed

sqlwarn3

char [1]

Specifies whether the number of result columns of a SELECT or FETCH statement did not match the number of host variables in the INTO clause

sqlwarn4

char [1]

Specifies whether an UPDATE or DELETE statement was performed without a WHERE clause and, therefore, in the entire database table

sqlwarn6

char [1]

Specifies whether the values of a date (DATE or TIMESTAMP) needed to be corrected

You see this warning for incorrect dates such as 31.2 or 37.7.

sqlwarn8

char [1]

Specifies whether all table rows needed to be searched to generate a result table

sqlwarnb

char [1]

Set if a TIME value is greater than 99 (or greater than 23 in the USA format) The value is corrected to modulo 100 (or 24).

sqlwarnc

char [1]

For a SELECT statement, specifies whether more rows were found than permitted by the ROWNO predicate in the WHERE clause


Programming Notes (SAP Library - SAP DB)

 Entering content frame

Background documentation Programming Notes

To optimize your SAP DB application program, remember the following programming notes:

· In SELECT statements, identify the columns that you want to select.

· Use key specifications to identify the table rows that need to be processed. You can determine key columns from the system tables.

· SELECT statements with multiple result rows with no ORDER clause do not specify the order in which the table rows are read from the database table. In this case, the logic of your application program cannot assume that there is a specified order.,

· You can use the SINGLE SELECT statement to process individual rows in the SQL mode INTERNAL.

· Note the different way of handling named result tables (CURSOR) in the different SQL modes.

For information on the special features of the SQL mode ORACLE in the SAP DB database system, see the documentation SQL Mode ORACLE: SAP DB.

· Inform yourself about the user and role concept of the SAP DB database system.

· Execute a RELEASE statement as the final SQL statement in your application program. This releases the resources needed by the precompiler runtime environment.

· In the SAP DB database system, remember that DDL statements such as CREATE TABLE are also subject to the transaction concept, which means that they can be undone or that they must be completed with a COMMIT statement.

· Read the information about the locks in the database, and define a suitable isolation level for your statements.

· Program reactions to possible TIMEOUT messages. You can do this by, for example, querying the structure component sqlcode after each SQL statement (see Database System Messages).

For more information on the meaning of the optimum SQL statements and the available options, see Optimizer: SAP DB.


Compatibility with Other Database Systems (SAP Library - SAP DB)

 Entering content frame

Background documentation Compatibility with Other Database Systems

The SAP DB database system can execute database statements that are written in other SQL modes.

You specify the SQL mode of your application program in the precompiler options when you run the precompiler.

Inform yourself about the special features in the SQL mode ORACLE and the SQL mode ANSI.

If you only want to create individual embedded SQL statements in another SQL mode, then precede them with the following key words:

· EXEC SAPDB or EXEC INTERNAL for individual statements in the INTERNAL mode

· EXEC ORACLE for individual statements in the ORACLE mode

· EXEC ANSI for individual statements in the ANSI mode


Special Features in SQL Mode ORACLE (SAP Library - SAP DB)

 Entering content frame

Background documentation Special Features in SQL Mode ORACLE

· The isolation levels 0, 1, 2, 3 are permitted in the SQL mode ORACLE. The default isolation level is 1.

· You need to define the appropriate sqlda structures for dynamic SQL statements. They are compatible with the ORACLE sqlda structures, but contain additional internal SAP DB information. Use the appropriate INCLUDE files that are included automatically when the precompiler runs.

/*Declaration*/

SQLDA orada;

/*Initialization*/

orada = sqlald (max_vars, max_name, max_ind_name);

where max_vars indicates the number of parameters, max_name the maximum number of characters in the parameter names, and max_ind_name the maximum number of characters in the indicator names.

· With a few exceptions, the return code sqlcode of the database system is copied from SAP DB (see Messages: SAP DB).

This table shows the exceptions and the corresponding SAP DB message codes:

ORACLE Message Code | SAP DB Message Code
-1008 | Warnung3
-1007 | -804
-1034 | -813
0 | -4000
Warnung1 | -743
100 | 1403 ROW NOT FOUND


Special Features in SQL Mode ANSI (SAP Library - SAP DB)

 Entering content frame

Background documentation Special Features in SQL Mode ANSI

· The isolation levels 0, 1, 2, 3 are permitted in the SQL mode ANSI. The default isolation level is 3.

· Dynamic SQL statements in ANSI mode use the SAP DB sqlda structure that is included automatically when the precompiler runs.

· With a few exceptions, the return code sqlcode of the database system is copied from SAP DB (see Messages: SAP DB).

This table shows the exceptions and the corresponding SAP DB message codes:

ANSI Message Code | SAP DB Message Code
-250 | +250
-300 | +300
-320 | +320
ANSISTATE 01004 | sqlwarn1
ANSISTATE 01003 | sqlwarn2

The warning messages sqlwarn1and sqlwarn2 appear in the structure sqlca.


Functions of the C/C++ Precompiler (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions of the C/C++ Precompiler

When you run the precompiler, the C/C++ precompiler translates the SQL statements embedded in the application program into calls of procedures of the precompiler runtime environment, and prepares the source code for the C/C++ compiler

The precompiler performs the following tasks:

· Generates the descriptor structure sqlda

· Generates the structure sqlca for database system messages

· Includes the standard header file cpc.h

· Checks the syntax of the embedded SQL statements

· Generates the precompiler log with any error messages and warnings

Precompiler Option check

If you choose the precompiler option check , the precompiler checks the existence of the called database tables and columns, as well as the compatibility of the data types and the access privileges of the users. It does this by sending the embedded SQL statements to the parser or database kernel. A ROLLBACK resets the effects of all SQL statements executed in this way after the precompiler has completed its run.

Only the syntax can be checked for statements with components unknown to the precompiler. These can be, for example, dynamic SQL statements or CONNECT statements with host variables.

The SQL statements are executed in the order in which they appear in the source code, and not in the logical order of the program statements.

Connecting to a Database

Before it can check the embedded SQL statements (with the check option), the precompiler must connect to the database instance. The following rules apply:

· If the first static SQL statement of a database session is not a CONNECT statement, then all user data of the XUSER user key DEFAULT applies.

· If the first static SQL statement of a database session is a CONNECT statement, then all data is taken from this statement, and any missing data from the XUSER user key DEFAULT.

· In the first database session, you can use appropriate precompiler options to override all user data.


Running the Precompiler (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Running the Precompiler

To check the source code file <filename>.cpc of your application program with the C/C++ Precompiler, and so make it executable, perform the following tasks:

...

1. Use the following call to start the precompiler and compiler from the command line:
cpc <precompiler_options> <filename> <compiler_options>
Specify your preferred precompiler options and compiler options. The precompiler generates a C file <filename>.c or a C++ file <filename>.cpp, depending on the chosen precompiler options.

2. Translate this file with your C/C++ compiler. The compiler generates an object file. Depending on your chosen precompiler options, the compiler can be started at the same time as the precompiler, so that the object file can be generated from your source code in a single step.

3. Combine this object file with other object files and libraries until you have an executable program. To do this, call the precompiler linker cpclnk with your chosen options, or include the precompiler runtime environment libpcrl manually.

See also Example: Compiling a SAP DB Application Program


Call Options for the Precompiler Linker (SAP Library - SAP DB)

 Entering content frame

Background documentation Call Options for the Precompiler Linker

After running the precompiler and compiling your application program, call the precompiler linker with the following options:

Options for Microsoft Windows Operating Systems

cpclnk [-<sdkver>] [-BIT32|-BIT64] [-MT|-MD|-SMT] [<link_options>] <file_name> [<object_archive>]

· If you have installed multiple versions of the precompiler software, choose a version with <sdkver>.

For example, enter –7402, if you have installed Version 7.4.02.

· Use the options -BIT32|-BIT64 and -MT|-MD|-SMT to specify the runtime libraries that you want the linker to use.

· Specify your linker options in <link_options>. For information on your linker, see your operating system documentation.

· Choose a name for the executable program in <file_name>.

· Specify the object files in <object_archive>. You can also specify the relevant path.

Options for UNIX Operating Systems

cpclnk [-P] [-s] [<link_options>] <file_name> [<object_archive>]

· Use option –P to call the C++ linker.

· Use option –s if you want to link the object files statically.


Precompiler Options (SAP Library - SAP DB)

 Entering content frame

Background documentation Precompiler Options

This table shows all the options you can specify when you call the precompiler.

-E cansi

Generates ANSI C-compatible code

-E cplus

Generates C++-compatible code

-BIT32

Generates 32 bit-compatible code

If you do not specify this option, the precompiler generates 64 bit-compatible code, if possible.

-m <m_begin,m_end>

Defines the valid column range in which the precompiler interprets source code

If you do not specify this option, the following defaults apply:
 m_begin = 1
m_end = 132

-e

Generates a program module that can be combined with other modules

Only translate the main module without this option, all other modules must be compiled with this option.

-H <check_option>

<check_option> = nocheck|syntax|check

Sets the chosen check option for the precompiler

nocheck: the precompiler checks only the syntax of the exec sql commands for the embedded SQL statements

syntax: the precompiler also checks the syntax of the database statements themselves

check: the precompiler also checks the existence of the called database tables and columns, their compatibility with the data types of the corresponding host variables, and the access privileges of the specified database user

If you do not specify a check option, the precompiler uses check automatically.

-b <maxpacketsize>

Restricts the size of the request buffer for SQL statements when the precompiler runs

The default when the precompiler runs is <maxpacketsize> = 16000

At runtime of the application program, the request buffer is restricted by the support database parameter _PACKAGE_SIZE of the database instance that is being addressed.

-G unicode

Specifies that the generic precompiler data types, such as TCHAR and LPSTR, are converted to UNICODE data types such as WCHAR and LPWSTR

At the same time, the precompiler integrates the macro SAPDB_WITH_UNICODE with the source code.

If you do not specify this option, then the generic data types are converted to ANSI data types (CHAR, CHAR*).

-s

Suppresses the screen output of precompiler messages

-w

Suppresses the output of any precompiler warnings

-o

Specifies that the embedded SQL statements are copied to the source code generated by the precompiler as comments

-l

Specifies that the precompiler writes the embedded SQL statements and their error messages to the precompiler log

-c

Prevents the compiler from being called automatically after the precompiler has run successfully

However, the source file for the compiler is retained.

-T

Sets the default TRACE SHORT for the trace option

-X

Sets the default TRACE LONG for the trace option

-F <trace_file_name>

Sets the default for the name of the trace file (see Trace Options)

-n <server_name>

Overrides the database server specified in the SET SERVERDB statement or CONNECT statement for the first database session

-d <database_name>

Overrides the database instance specified in the SET SERVERDB statement or CONNECT statement for the first database session

-u <user_name>,<password>

Overrides the user name and password specified in the CONNECT statement of the first database session

-U <user_key>

Overrides the KEY specified in the CONNECT statement for the first database session

-S <sql_mode>

<sql_mode> = internal|ansi|oracle

Defines the SQL mode for your application program

If you do not specify an SQL mode, the precompiler uses the INTERNAL mode automatically.

-D <datetimeformat>

<datetimeformat> = eur|iso|jis|usa|internal

Defines the date and time format used in the application program

If you do not specify a format, the precompiler uses the INTERNAL format automatically.

-V

Displays the precompiler version

-<sdkver>

Specifies the version of the precompiler software

For example, enter –7402, if you have installed Version 7.4.02.

-h

Displays all call options for the precompiler and precompiler runtime environment


Precompiler Log (SAP Library - SAP DB)

 Entering content frame

Background documentation Precompiler Log

When the precompiler runs, the C/C++ precompiler writes a log file <filename>.pcl. Depending on the specified precompiler options, this file can contain the source code, warnings, and error messages from the precompiler.

If errors occur before the precompiler can generate the log file, then they are logged in the file sqlerror.pcl.


Example: Compiling a SAP DB Application Program (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example: Compiling a SAP DB Application Program

You have written a source code file test.cpc.

Use the command cpc –d DB –u Jones,secret test

to generate the file test.o. This uses the database instance DB with the user Jones and the password secret.

Use the command cpclnk test

to link the file with the runtime library and generate an executable program.

If you want a trace file to be written when the test program is executed, set the environment variable SQLOPT to -X. The corresponding command in a Bash shell is as follows:

export SQLOPT=-X

The trace file test.pct is written when the test program is executed. This file is located in the same directory as the test program.

To test the newly installed precompiler, you can use the SAP DB test database at http://www.sapdb.org.

After you install the package (5 KB), you have a database called TST, and the user TEST with the password TEST.

Example of the call for compiling the file test.cpc:

cpc -d TST -u TEST,TEST test


Functions of the Precompiler Runtime Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions of the Precompiler Runtime Environment

The precompiler runtime environment performs the following functions at runtime of the application program:

· Connecting to the databases and opening database session as specified in the connection options

· Assigning parameter values

· Converting data types

· Executing precompiler statements

· Using indicator variables to denote NULL values (undefined values)

· Writing database system messages in the structure sqlca

· Writing the trace file as specified in the trace options

See also the example: Executing a SAP DB Application Program

You can use the IRCONF tool to administer the installed versions of the runtime library of the interface programs, including the precompiler.


Connection Options at Runtime (SAP Library - SAP DB)

 Entering content frame

Background documentation Connection Options at Runtime

The table shows you all options that you can set for the precompiler runtime environment in the environment variable SQLOPT when you connect to the database instance.

The options–u, -U, -t and –I are then valid for all database connections of the application program for which you have specified the key <key> DEFAULT or SQLOPT in the CONNECT statement.

The options –n and –d apply to all database connections and override the settings specified in the CONNECT or SET SERVERDB statement.

For information on setting the environment variable, see your operating system documentation.

-n <server_name> | Name of the database server
-d <database_name> | Name of the database instance
-u <user_name,password> | User name and password
-U <user_key> | XUSER user key
-t <timeout> | Timeout value in seconds If the default -1 is specified, then the precompiler runtime environment uses the timeout value specified in the database parameter SESSION_TIMEOUT.
-I <isolation_level> | Isolation level If no isolation level is specified, the precompiler runtime environment uses level 10 automatically.


Trace Options (SAP Library - SAP DB)

 Entering content frame

Background documentation Trace Options

Use

You can use the trace options to specify that the precompiler runtime environment logs the execution of the entire application program in the trace file <filename>.pct at runtime.

If you want to log individual embedded SQL statements only, then use the TRACE statements.

You can use the IRTRACE tool to activate and deactivate the trace at runtime.

Procedure

· Specify your chosen default for the trace option in the precompiler options when you run the precompiler.

· Set your chosen trace option for runtime in the environment variable SQLOPT.

The following table shows the possible trace options that you can specify when running the precompiler and calling the application program.

-T

Logs with the option TRACE SHORT

Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2].

-X

Logs with the option TRACE LONG

Every executed SQL statements is logged, including the messages sqlcode und sqlerrd[2] and all parameter values.

-F <trace_file_name>

Allows you to choose a name other than <filename>.pct for the trace file

If you do not specify any other trace options, then the option TRACE SHORT is activated at the same time.

If you specify pid or PID for <trace_file_name>, then the name of the trace file becomes pid<process_id>.pct automatically. In this way, you can generate multiple trace files in parallel. If you do not specify any other trace options, then logging is deactivated at the same time.

The following table shows the possible trace options that you can specify only when you call the application program:

-N

Suppresses the logging of the date and time for the start and end of each executed SQL statement

-L <execution_time>

Specifies that any SQL statements that take longer to execute than <execution_time> are logged

Specify <execution_time> in seconds.

The log option TRACE LONG is used automatically. Dates and times cannot be suppressed with –N.

-Y <statement_count>

Specifies that logging alternates between the two trace files < filename>.pct and < filename>.prot in the run directory of the application program.

Use <statement_count> to specify how many SQL statements are logged in each file. If the number of SQL statements exceeds <statement_count> then the trace files are overwritten cyclically.

If you specify this option, then the option TRACE LONG is used automatically. Dates and times cannot be suppressed with –N.

See also Example of a Trace File


Using IRTRACE (SAP Library - SAP DB)

 Entering content frame

Background documentation Using IRTRACE

IRTRACE is a tool for changing the trace settings and displaying the current trace setting of the precompiler runtime environment for a SAP DB application program translated with the C/C++ precompiler.

To do this, you enter commands at the operating system level. IRTRACE and the application program communicate through a shared memory segment.

If you use IRTRACE to change trace settings, the system makes an entry in the shared memory segment. The application program checks the entries in the shared memory at regular intervals, and changes its trace setting accordingly. The assignment of an application program to the correct entry in the shared memory is made using the process ID of the application program. The entry remains in the shared memory for as long as the corresponding process is active, and can be queried.

When a shared memory segment is being used, the system creates the synchronization file irtrace.shm, which the processes of the application program and IRTRACE use to access the shared memory. The system creates this release-independent file in the directory /opt/sapdb/indep_prog/wrk. In the installation, the system registers the path /opt/sapdb/indep_prog and creates the subdirectory wrk. The system also gives read and write rights to the IRTRACE tool and the application program.


Displaying the Current Trace Setting (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying the Current Trace Setting

Use the IRTRACE tool to display the current trace setting.

To do this, enter the following commands:

· Display the current trace setting for the application program:

irtrace -p <process_id>

· Display overview of trace settings for all application programs where changes have been made with IRTRACE:

irtrace -p all


Changing the Trace Setting (SAP Library - SAP DB)

 Entering content frame

Background documentation Changing the Trace Setting

You can use the IRTRACE tool to change the current trace setting.

· Activating/deactivating/switching the trace for a specified process:
irtrace -p <process_id> -t <trace_setting>

· Activating or deactivating the trace for all application programs on the local server that have been translated by the precompiler.
irtrace -p all -t <trace_setting>

This table shows the possible values for <trace_setting>:

<long> | Activates logging with option TRACE LONG
<short> | Activates logging with option TRACE SHORT
<off> | Deactivates trace

See also: Trace Options.


Example of a Trace File (SAP Library - SAP DB)

 Entering content frame

Example Example of a Trace File

PREPARE        :

select name, price into ?, ? from hotel where hno=?

SQL STATEMENT  :  FROM MODULE : docu07             AT LINE : 80

Statement Name : STMT2

PARSEID: OUTPUT:  00000347 00000901 3D001400

START  :  DATE :  2001-11-02    TIME :  0015:40:00

END    :  DATE :  2001-11-02    TIME :  0015:40:00

SQL STATEMENT  :  FROM MODULE : docu07             AT LINE : 80

Statement Name : STMT2

PARSEID: INPUT :  00000347 00000901 3D001400

INPUT :    3: hno                             :                  10

OUTPUT:    1: name                            : Excelsior

OUTPUT:    2: price                           :               135.00

SQLERRD(INDEX_3) : 1

START  :  DATE :  2001-11-02    TIME :  0015:40:00

END    :  DATE :  2001-11-02    TIME :  0015:40:00


Example: Executing an Application Program (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Example: Executing an Application Program

You want to execute an application program, test, that you have translated with the C/C++ Precompiler.

If you want a trace file to be written when the test program is executed, set the environment variable SQLOPT to -X. The corresponding command in a Bash shell is as follows:

export SQLOPT=-X

The trace file test.pct is written when the test program is executed. This file is located in the same directory as the test program.

To test the newly installed precompiler, you can use the SAP DB test database at http://www.sapdb.org .

After you install the package (5 KB), you have a database instance called TST, and the user TEST with the password TEST.

In a Bash shell you can, for example, execute the following command:

export SQLOPT="-d TST -u TEST,TEST"

The result of this is that your application program uses, at runtime, the database instance TST and the user TEST with the password TEST.


Return Codes (SAP Library - SAP DB)

 Entering content frame

Background documentation Return Codes

The precompiler returns the following return codes:

0 | Precompiler and compiler ran without errors
1 | Precompiler ran with errors
2 | Precompiler ran without errors; compiler ran with errors
3-120 | Number of precompiler errors
126 | Error in precompiler data management
127 | Precompiler called; compiler not yet called

The SAP DB application program returns the following return codes:

1 | No error
2 | Error when reading the XUSER file
3 | Database instance is not in the operational state ONLINE
4 | Too many database sessions
5 | Unknown combination of user name and password
6 | Application program ended with WHENEVER STOP statement
7 | SQLOPT contains incorrect options
8 | Error when opening or writing to the trace file
9 | Internal data structures inconsistent (system error)


Using the IRCONF Tool (SAP Library - SAP DB)

 Entering content frame

Background documentation Using the IRCONF Tool

For connections and communication between the database server and the client, the runtime library of the interface programs (such as the precompiler and ODBC) must be installed on the client.

You can update this part of the client software. So that you can continue to use and administer any older applications, the various versions of the runtime library of the interface programs are installed in different directories. The registrations in the system perform these installations automatically.

IRCONF is a tool that you can use to register and display the installed versions of the runtime library of the interface programs at a later time. You do this by entering commands at the operating system level, with your choice of options.


Options for IRCONF (SAP Library - SAP DB)

 Entering content frame

Background documentation Options for IRCONF

The following options are available when you use the IRCONF tool:

Specifying the installation path | -p <path>
Displaying registered versions of the runtime library | -s
Deleting the registration of the runtime library | -r
Overriding the driver name | -d <CPC_driver>
Registering the version of the runtime library | -i
Overriding the version check | -v <version>
Specifying an additional key | -k <key>
Displaying options and help | -h


Specifying the Installation Path: -p (SAP Library - SAP DB)

 Entering content frame

Background documentation Specifying the Installation Path: -p

Use

Use the option –p to define the installation path. You only need to specify the root directory here.

After the installation, the runtime library of the interface programs is in a subdirectory of the root directory:

· Windows NT: .\pgm

· UNIX (32 bit): ./lib

The installation saves the runtime library of the interface programs for 64 bit UNIX operating systems in the subdirectory ./lib/lib64.

You can link the option -p with the options -i (Registering the Version of the Runtime Library) and/or -v (Overriding the Version).


Displaying Registered Versions of the Runtime Library: -s (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying Registered Versions of the Runtime Library: -s

Use

Use the option -s to display the registered versions of the runtime library of the interface programs on the client.

Syntax

irconf -s

Result

You see the paths and versions of the installed runtime library of the interface programs.

/opt/sapdb/interfaces/precompiler/runtime/7300 -> 7.3.00.00
/opt/sapdb/interfaces/precompiler/runtime/7401 -> 7.4.01.00


Deleting the Registration of the Runtime Library: -r (SAP Library - SAP DB)

 Entering content frame

Background documentation Deleting the Registration of the Runtime Library: -r

Use

Use the option –r to delete the registration of a runtime library of the interface programs on the client. Specify the path in which the client installation is located.

Syntax

irconf -r -p <path>

irconf -r -p /opt/sapdb/interfaces/precompiler/runtime/7.2

Result

You see a message about the deletion of the registration, including the path and the version of the runtime library of the interface programs.

/opt/sapdb/interfaces/precompiler/runtime/7401 -> 7.4.01.00 registration removed


Overriding the Driver Name: -d (SAP Library - SAP DB)

 Entering content frame

Background documentation Overriding the Driver Name: -d

Use

The driver name is used for finding out versions information about the runtime libraries of the interface programs. The default is libpcr.

The option –d <CPC_driver> is needed for support purposes only.

Syntax

irconf -i -d <CPC_driver>

irconf -i -d <libpcr.old>


Registering the Version of the Runtime Library: -i (SAP Library - SAP DB)

 Entering content frame

Background documentation Registering the Version of the Runtime Library: -i

Use

Use the option –i to register a version of the runtime library of the interface programs on the client. Use the option -p <path> to specify the path under which this version of the runtime library has been installed.

During registration, the version of the runtime library of the interface programs (Windows NT: libpcr.dll, UNIX: libpcr.so or libpcr.sl) is checked, and the version found by the system is registered. In special cases, you may need to avoid this version check (Overriding the Version: -v).

Syntax

irconf -i -p <path>

irconf -i -p /opt/sapdb/interfaces/precompiler /runtime/7401

Result

You see a message about the successful registration, including the path and the version of the installed runtime library of the interface programs.

/opt/sapdb/interfaces/precompiler /runtime/7401 -> 7.4.01.00 registered


Overriding the Version Check: -v (SAP Library - SAP DB)

 Entering content frame

Background documentation Overriding the Version Check: -v

Use

The IRCONF tool attempts to determine the version of the installed runtime library of the interface programs. In special cases, you can use the option -v to override this feature. You can specify this option when you register the version of a runtime library, and then save the version under a version string of your choice.

You want to register a 64 bit version of the runtime library of the interface programs with a 32 bit version of IRCONF. The 32 bit version of IRCONF cannot determine the version of the 64 bit software, and you need to override the feature that determines the version.

In a special support scenario, you need to register the version of the runtime library under another name, and you need to override the feature that determines the version.

Syntax

irconf -i -v <version> -p <path>

Result

You see which version is installed under the specified path.

/usr/sapdb-if/runtime/7401 -> 7.4.01.00


Specifying an Additional Key: -k (SAP Library - SAP DB)

 Entering content frame

Background documentation Specifying an Additional Key: -k

Use

The registration procedure does not permit two identical versions of the runtime library of the interface programs to be determined uniquely on one server (in different directories). This can be the case if the test system and the production system are both installed on the same server, but the binaries come from different directories.

In this case, use the option –k to name and retrieve the versions. Set the environment variable SAPDBINSTKEY to the value specified in <key>, so that the applications can use the version registered in this key.

Syntax

irconf -i -p <path> -k <key>

irconf -i –p /opt/sapdb/interfaces/precompiler/runtime/7401 -k db_instance_name

Result

You see under which path the version specified in <key> was registered.

/opt/sapdb/interfaces/precompiler/runtime/7401 -> 7.4.01.00 db_instance_name


Displaying Options and Help: -h (SAP Library - SAP DB)

 Entering content frame

Background documentation Displaying Options and Help: -h

Use

You can use this option to display a summary of all options possible with IRCONF.

Syntax

irconf -h

Result

You see the following output:

Usage : irconf -i[-v | -d | -p | -k] | -r -p | -s | -h

Options:

-i Registers a version

-r Unregisters a version

-s Displays all installed versions

-v <version> Overrides version number identified by the system

-d <CPC_driver> Default is 'libpcr'

-p <path> Installation path

-k <key> Installation name

-h Displays help


IRCONF Error Messages (SAP Library - SAP DB)

 Entering content frame

Background documentation IRCONF Error Messages

IRCONF can write the following error messages:

· Invalid option
An invalid option was specified when IRCONF was called.

· Invalid combination of options

· Missing CPC Driver name
Option -d specified without arguments.

· Missing path name
Option -p specified without arguments.

· Missing installation name
Option -k specified without arguments.

· Missing version number
Option -v specified without arguments.

· Cannot get version info of CPC Driver
The version of the runtime library of the interface programs on the client cannot be found.

· The specified driver does not exist
The specified driver does not exist or cannot be loaded.

· Cannot find any installed version of CPC Driver
No installations of the runtime library of the interface programs are registered.

· The specified installation does not exist


Syntax Directory (SAP Library - SAP DB)

 Entering content frame

Background documentation Syntax List

This syntax list shows you the syntax of all precompiler statements. The syntax notation used is BNF.

For the syntax of the database statements in the SQL mode INTERNAL, see the Reference Manual: SAP DB.

as_clause

array_statement

cancel_session

cancel_statement

c_function

char_host_var

close_statement

command

connect_option

connect_statement

connect_statement_internal

connect_statement_oracle

cursor_name

database_name

database_server

dbproc_clause

dbproc_name

ddl_statement

declare_clause

declare_cursor_statement

declare_statement

describe_statement

descriptor_name

dml_statement

dyna_parameter

dyna_parameter_list

embedded_sql_statement

exec_command_statement

execute_immediate_statement

execute_statement

fetch_spec

fetch_statement

file_host_var

file_name

float_host_var

for_clause

getval_statement

host_variable

hostvarprefix

include_declare_statement

include_file_statement

include_sqlca_statement

include_statement

ind_clause

indicator_marker

indicator_variable

ind_variable_declarator

int_host_var

key

label

loop_parameter

open_cursor_statement

os_command

os_command_async

os_command_sync

parameter

parameter_list

parameter_marker

precom_version

prepare_statement

putval_statement

result_param

rte_version

session_name

session_number

session_spec

set_serverdb_statement

sqlda_variable

statement_name

statement_source

string_constant

structure_tag

table_clause

trace_line

trace_state

trace_statement

type_declarator

uidpwd

unichar_host_var

using_clause

using_expr

variable_declarator

variable_name

version_statement

whenever_action

whenever_condition

whenever_statement


as_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation as_clause

<as_clause> ::=
  AS VAR [< variable_declarator >]
| AS TYPE [< type_declarator >]
| AS STRUCT [< structure_tag >]


array_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation array_statement

< array_statement > ::=
  [< for_clause >] < dml_statement >


cancel_session (SAP Library - SAP DB)

 Entering content frame

Syntax documentation cancel_session

<cancel_session> ::=
  < session_number >
| < session_name >
| CURRENT


cancel_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation cancel_statement

< cancel_statement > ::=
  EXEC SQL CANCEL [< cancel_session >];


c_function (SAP Library - SAP DB)

 Entering content frame

Syntax documentation c_function

<c_function> ::=
  < simple_identifier >


char_host_var (SAP Library - SAP DB)

 Entering content frame

Syntax documentation char_host_var

< char_host_var > ::=
  <hostvarprefix> < identifier >

(for variables of type chardecspec only)


close_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation close_statement

<close_statement> ::=
  CLOSE [< cursor_name >]


command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation command

<command> ::=
  < string_constant >
| < char_host_var >
| < unichar_host_var >


connect_option (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_option

<connect_option> ::=
  [ISOLATION LEVEL < unsigned_integer >] [TIMEOUT < unsigned_integer >]


connect_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_statement

< connect_statement > ::=
  < connect_statement_internal >
| < connect_statement_oracle >


connect_statement_internal (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_statement_internal

< connect_statement_internal > ::=
  EXEC SQL [< session_number >]
  CONNECT [< user_name > IDENTIFIED BY < password > | < uidpwd >]
  [< connect_option >...] [KEY < key >];


connect_statement_oracle (SAP Library - SAP DB)

 Entering content frame

Syntax documentation connect_statement_oracle

< connect_statement_oracle > ::=
  EXEC SQL
  CONNECT [< user_name > IDENTIFIED BY < password > | < uidpwd >]
  AT < session_name > USING < database_server - database_name >
  [< connect_option >...] [KEY < key >];


cursor_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation cursor_name

<cursor_name> ::=
  < result_table_name >
| < char_host_var >
| < unichar_host_var >


database_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation database_name

<database_name> ::=
  < string_constant >
| < char_host_var >


database_server (SAP Library - SAP DB)

 Entering content frame

Syntax documentation database_server

<database_server> ::=
  < string_constant >
| < char_host_var >


dbproc_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dbproc_clause

<dbproc_clause> ::=
  DBPROC < dbproc_name >


dbproc_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dbproc_name

<dbproc_name> ::=
  [< owner >.]< procedure_name > [(< parameter_list >)]


ddl_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ddl_statement

<ddl_statement> ::=
  < create_table_statement >
| < drop_table_statement >
| < alter_table_statement >
| < rename_table_statement >
| < rename_column_statement >
| < exists_table_statement >
| < create_domain_statement >
| < drop_domain_statement >
| < create_sequence_statement >
| < drop_sequence_statement >
| < create_synonym_statement >
| < drop_synonym_statement >
| < rename_synonym_statement >
| < create_view_statement >
| < drop_view_statement >
| < rename_view_statement >
| < create_index_statement >
| < drop_index_statement >
| < alter_index_statement >
| < rename_index_statement >
| < comment_on_statement >
| < create_trigger_statement >
| < drop_trigger_statement >
| < create_dbproc_statement >
| < drop_dbproc_statement >


declare_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation declare_clause

<declare_clause> ::=
  < table_clause >
| < dbproc_clause >


declare_cursor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation declare_cursor_statement

<declare_cursor_statement> ::=
  EXEC SQL [< session_spec >]
  DECLARE < cursor_name > CURSOR FOR < statement_source >;


declare_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation declare_statement

< declare_statement > ::=
  EXEC SQL BEGIN DECLARE SECTION;
| EXEC SQL END DECLARE SECTION;


describe_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation describe_statement

< describe_statement > ::=
  EXEC SQL [< session_spec >] DESCRIBE < statement_name >
  [INTO < descriptor_name > [< using_clause >]];


descriptor_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation descriptor_name

<descriptor_name> ::=
  < sqlda_variable >


dml_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dml_statement

<dml_statement> ::=
  < select_statement >
| <select_into_statement> (nur SQL-Modus ORACLE)
| < insert_statement >
| < update_statement >
| < delete_statement >
| < close_statement >
| < putval_statement >
| < getval_statement >
| < call_statement >
| < explain_statement >


dyna_parameter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dyna_parameter

<dyna_parameter> ::=
  < parameter_marker > [< indicator_marker >]


dyna_parameter_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dyna_parameter_list

<dyna_parameter_list> ::=
  < dyna_parameter ,...>


embedded_sql_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation embedded_sql_statement

< embedded_sql_statement > ::=
  EXEC SQL [< session_spec >]
| < ddl_statement >;
| < dml_statement >;
| < array_statement >;


exec_command_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation exec_command_statement

< exec_command_statement > ::=
  EXEC COMMAND < os_command >;


execute_immediate_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation execute_immediate_statement

< execute_immediate_statement > ::=
  EXEC SQL [< session_spec >] EXECUTE IMMEDIATE < statement_source >;


execute_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation execute_statement

< execute_statement > ::=
  EXEC SQL [< session_spec >] [< for_clause >]
  EXECUTE < statement_name > [< using_clause >];


fetch_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation fetch_spec

<fetch_spec> ::=
  FIRST
| LAST
| NEXT
| PREV
| SAME
| POS (< unsigned_integer >)
| POS (< int_host_var >)


fetch_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation fetch_statement

<fetch_statement> ::=
  EXEC SQL [< session_spec >] [< for_clause >]
  FETCH [< fetch_spec >] [< cursor_name >] < using_clause >;


file_host_var (SAP Library - SAP DB)

 Entering content frame

Syntax documentation file_host_var

<file_host_var> ::=
  < hostvarprefix >< identifier >

(nur für Variablen vom Typ vfldecspec erlaubt)


file_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation file_name

<file_name> ::=
  < string_constant >


float_host_var (SAP Library - SAP DB)

 Entering content frame

Syntax documentation float_host_var

<float_host_var> ::=
 < hostvarprefix >< identifier >

(for variables of type flpdecspec only)


for_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation for_clause

<for_clause> ::=
  FOR < loop_parameter >


getval_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation getval_statement

< getval_statement > ::=
  GETVAL INTO (<parameter_list>)

(For LONG columns only)


host_variable (SAP Library - SAP DB)

 Entering content frame

Syntax documentation host_variable

< host_variable > ::=
  < char_host_var >
| < unichar_host_var >
| < int_host_var >
| < float_host_var >


hostvarprefix (SAP Library - SAP DB)

 Entering content frame

Syntax documentation hostvarprefix

<hostvarprefix> ::=
  :


include_declare_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation include_declare_statement

< include_declare_statement > ::=
  EXEC SQL INCLUDE < file_name > < declare_clause >
  [< as_clause >] [< ind_clause >];


include_file_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation include_file_statement

< include_file_statement > ::=
  EXEC SQL INCLUDE < file_name >;


include_sqlca_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation include_sqlca_statement

<include_sqlca_statement> ::=
  EXEC SQL INCLUDE SQLCA;


include_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation include_statement

<include_statement> ::=
  < include_sqlca_statement >
| < include_file_statement >
| < include_declare_statement >


ind_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ind_clause

<ind_clause> ::=
  IND [< ind_variable_declarator >] [< structure_tag >]


indicator_marker (SAP Library - SAP DB)

 Entering content frame

Syntax documentation indicator_marker

<indicator_marker> ::=
  ?


indicator_variable (SAP Library - SAP DB)

 Entering content frame

Syntax documentation indicator_variable

< indicator_variable > ::=
  < int_host_var >


ind_variable_declarator (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ind_variable_declarator

<ind_variable_declarator> ::=
  < simple_identifier >


int_host_var (SAP Library - SAP DB)

 Entering content frame

Syntax documentation int_host_var

<int_host_var> ::=
  < hostvarprefix >< identifier >

(for variables of type intdecspec only)


key (SAP Library - SAP DB)

 Entering content frame

Syntax documentation key

<key> :: =
  < simple_identifier >


label (SAP Library - SAP DB)

 Entering content frame

Syntax documentation label

<label> :: =
  < identifier >


loop_parameter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation loop_parameter

<loop_parameter> ::=
  < unsigned_integer >
| < int_host_var >


open_cursor_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation open_cursor_statement

< open_cursor_statement > ::=
  EXEC SQL [< session_spec >] [< for_clause >] OPEN < cursor_name >
  [  USING < parameter_list >
   | USING DESCRIPTOR [< descriptor_name >] [KEEP]
   | INTO < parameter_list >]
   | INTO DESCRIPTOR [< descriptor_name >] [KEEP]];


os_command (SAP Library - SAP DB)

 Entering content frame

Syntax documentation os_command

<os_command> ::=
  < os_command_async >
| < os_command_sync >


os_command_async (SAP Library - SAP DB)

 Entering content frame

Syntax documentation os_command_async

<os_command_async> ::=
  ASYNC < os_command >


os_command_sync (SAP Library - SAP DB)

 Entering content frame

Syntax documentation os_command_sync

<os_command_sync> ::=
  SYNC < os_command > RESULT < result_param >


parameter (SAP Library - SAP DB)

 Entering content frame

Syntax documentation parameter

<parameter> ::=
  < host_variable > [< indicator_variable >]


parameter_list (SAP Library - SAP DB)

 Entering content frame

Syntax documentation parameter_list

<parameter_list> ::=
  < parameter ,...>


parameter_marker (SAP Library - SAP DB)

 Entering content frame

Syntax documentation parameter_marker

<parameter_marker> ::=
  ?


precom_version (SAP Library - SAP DB)

 Entering content frame

Syntax documentation precom_version

<precom_version> ::=
  < char_host_var >


prepare_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation prepare_statement

< prepare_statement > ::=
  EXEC SQL [< session_spec >] PREPARE < statement_name >
  [INTO < descriptor_name > [USING < using_clause >]]
  FROM < statement_source >;


putval_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation putval_statement

< putval_statement > ::=
  PUTVAL INTO < table_name > [(< column_name >,...)]
  VALUES (< parameter_list >)

(For LONG columns only)


result_param (SAP Library - SAP DB)

 Entering content frame

Syntax documentation result_param

<result_param> ::=
  < int_host_var >


rte_version (SAP Library - SAP DB)

 Entering content frame

Syntax documentation rte_version

<rte_version> ::=
  < char_host_var >


session_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation session_name

<session_name> ::=
  < string_constant >
| < char_host_var >


session_number (SAP Library - SAP DB)

 Entering content frame

Syntax documentation session_number

<session_number> ::=
  1|2|3|4|5|6|7|8|9


session_spec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation session_spec

<session_spec> ::=
  < session_number > (SQL-Modus Internal)
| AT < session_name > (SQL-Modus ORACLE)


set_serverdb_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation set_serverdb_statement

< set_serverdb_statement > ::=
  EXEC SQL [< session number >]
  SET SERVERDB < database_name > [ON < database_server >];


sqlda_variable (SAP Library - SAP DB)

 Entering content frame

Syntax documentation sqlda_variable

<sqlda_variable> ::=
  < simple_identifier >


statement_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation statement_name

<statement_name> ::=
  < string_constant >
| < char_host_var >
| < unichar_host_var >


statement_source (SAP Library - SAP DB)

 Entering content frame

Syntax documentation statement_source

<statement_source> ::=
  ‘< dml_statement >’
| ‘< ddl_statement >’
| < statement_name >


string_constant (SAP Library - SAP DB)

 Entering content frame

Syntax documentation string_constant

<string_constant> ::=
  “< simple_identifier >”
| ‘< simple_identifier >’


structure_tag (SAP Library - SAP DB)

 Entering content frame

Syntax documentation structure_tag

<structure_tag> ::=
  < simple_identifier >


table_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation table_clause

<table_clause> ::=
  TABLE < table_name >


trace_line (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trace_line

<trace_line> ::=
  < string_constant >
| < char_host_var >


trace_state (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trace_state

<trace_state> ::=
  TRACE ON
| TRACE LONG
| TRACE OFF
| TRACE LINE < trace_line >


trace_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation trace_statement

<trace_statement> ::=
  EXEC SQL SET TRACE < trace_state >;


type_declarator (SAP Library - SAP DB)

 Entering content frame

Syntax documentation type_declarator

<type_declarator> ::=
  < simple_identifier >


uidpwd (SAP Library - SAP DB)

 Entering content frame

Syntax documentation uidpwd

<uidpwd> ::=
  < user_name >/< password >


unichar_host_var (SAP Library - SAP DB)

 Entering content frame

Syntax documentation unichar_host_var

<unichar_host_var> ::=
  < hostvarprefix >< identifier >

(for variables of type unichardecspec only)


using_clause (SAP Library - SAP DB)

 Entering content frame

Syntax documentation using_clause

< using_clause > ::=
  USING < using_expr >
| INTO < using_expr >


using_expr (SAP Library - SAP DB)

 Entering content frame

Syntax documentation using_expr

<using_expr> ::=
  < parameter_list >
| DESCRIPTOR [< descriptor_name >]


variable_declarator (SAP Library - SAP DB)

 Entering content frame

Syntax documentation variable_declarator

<variable_declarator> ::=
  < simple_identifier >


variable_name (SAP Library - SAP DB)

 Entering content frame

Syntax documentation variable_name

<variable_name> ::=
  < simple_identifier >


version_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation version_statement

<version_statement> ::=
  EXEC SQL VERSION < rte_version >, < precom_version >;


whenever_action (SAP Library - SAP DB)

 Entering content frame

Syntax documentation whenever_action

<whenever_action> ::=
  CALL < c_function >
| CONTINUE
| GOTO < label >
| STOP


whenever_condition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation whenever_condition

<whenever_condition> ::=
  SQLWARNING
| SQLERROR
| SQLEXCEPTION
| NOT FOUND
| SQLBEGIN
| SQLEND


whenever_statement (SAP Library - SAP DB)

 Entering content frame

Syntax documentation whenever_statement

< whenever_statement > ::=
  EXEC SQL WHENEVER < whenever_condition > < whenever_action >;


ODBC Manual (SAP Library - SAP DB)

 Entering content frame

Component documentation ODBC Manual

This manual describes the basics and features of the SAP DB ODBC driver. The explanations apply to SAP DB database systems as of version 7.3.01.

To understand this documentation, you require a basic knowledge of the C programming language, knowledge of SQL, and a general knowledge of database systems.

Use

The SAP DB ODBC driver allows access to the SAP DB database system. Data is accessed using the Structured Query Language (SQL).

Depending on the operating system, the SAP DB ODBC driver is both 32 bit- and 64 bit- compatible. It runs on Linux, Microsoft Windows as of Microsoft Windows 95 and all UNIX systems that are supported by SAP DB.

If the ODBC application is operated on the same host as the database instance, communication takes place using shared memory. Remote access of the ODBC application to the database instance is performed using TCP/IP.

You can download the SAP DB ODBC driver free of charge from the SAP DB homepage http://www.sapdb.org.

For a complete description of the ODBC functions and an ODBC syntax reference, see the Microsoft homepage (http://www.microsoft.com/data/ODBC) in the ODBC Software Development Kit (SDK) under ODBC Programmer’s Reference.

For general information about the SAP DB database system, see The SAP DB Database System and on the SAP DB Homepage at http://www.sapdb.org.


Supported ODBC Versions (SAP Library - SAP DB)

 Entering content frame

Background documentation Supported ODBC Versions

The SAP DB ODBC driver fulfils the ODBC 3.51 interface specification.

When developing your own applications, note that these differentiate between ODBC 2.x and ODBC 3.x versions. You should therefore use the function SQLSetEnvAttr to set the SQL_ATTR_ODBC_VERSION before you request a connection handle with SQLAllocHandle.


Properties of the SAP DB ODBC Driver (SAP Library - SAP DB)

 Entering content frame

Background documentation Properties of the SAP DB ODBC Driver

The functionality of the SAP DB ODBC driver is described in more detail for certain areas:

Supported Data Types

Conversion of SQL and C Data Types

Processing SQL Statements

ODBC-API Compatibility

Unicode Support


Supported Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Supported Data Types

The ODBC interface differentiates between the data types made available by the database system (SQL data types) and the data types used in the ODBC application (C data types).

SQL Data Types

C Data Types


SQL Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Data Types

Every database system defines its own SQL data types. An ODBC driver processes only those data types that are defined by the associated database system.

You can use the function SQLGetTypeInfo to determine how an ODBC driver maps the SQL data types of the database system to the ODBC supported data types and to its own driver-specific data types, as well as the specifications for length, decimal places (scale), and the number of valid digits (precision).

For more information about the data types defined for the SAP DB database system, see the Reference Manual, data type section.

SAP DB data types that are supported by the SAP DB ODBC Driver

Character | CHAR, VARCHAR, LONG, CHAR BYTE, VARCHAR BYTE, LONG BYTE
Numeric | DECIMAL, FIXED, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION
Date | DATE, TIME, TIMESTAMP
Other | BOOLEAN, CHAR EBCDIC, VARCHAR EBCDIC


C Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation C Data Types

ODBC C data types represent those data types of C variables in which the application data intended for communication with the database is processed.

Relationship Between SQL and C Data Types

fCType | ODBC C Typedef | C Type
SQL_C_CHAR | SQLCHAR * | unsigned char *
SQL_C_SSHORT | SQLSMALLINT | short int
SQL_C_SLONG | SQLINTEGER | long int (32 bit)
SQL_C_USHORT | SQLUSMALLINT | unsigned short int
SQL_C_ULONG | SQLUINTEGER | unsigned long int (32 bit)
SQL_C_FLOAT | SQLREAL | float
SQL_C_DOUBLE | SQLDOUBLE | double
SQL_C_BIGINT | SQLBIGINT | _int64, long (64 bit)
SQL_C_UBIGINT | SQLUBIGINT | unsigned _int64, unsigned long (64 bit)
SQL_C_BINARY | SQLCHAR* | unsigned char*
SQL_C_DATE | SQL_DATE_STRUCT | struct tagDATE_STRUCT { SQLSMALLINT year; SQLSMALLINT month; SQLSMALLINT day;}
SQL_C_TIME | SQL_TIME_STRUCT | struct tagTIME_STRUCT { SQLSMALLINT hour; SQLSMALLINT minute; SQLSMALLINT second;}
SQL_C_TIMESTAMP | SQL_TIMESTAMP_STRUCT | struct tagTIMESTAMP_STRUCT { SQLSMALLINT year; SQLSMALLINT month; SQLSMALLINT day; SQLSMALLINT hour; SQLSMALLINT minute; SQLSMALLINT second; SQLUINTEGER fraction;}
SQL_C_BIT | SQLCHAR | unsigned char


Conversion of SQL and C Data Types (SAP Library - SAP DB)

 Entering content frame

Background documentation Conversion of SQL and C Data Types

The SAP DB ODBC driver allows the conversion for all supported data types .

See also:

Microsoft Homepage (http://www.microsoft.com/data/ODBC) in the ODBC Software Development Kit (SDK) under ODBC Programmer‘s Reference, Converting Data from SQL to C Data Types and Converting Data from C to SQL Data Types sections.


Processing SQL Statements (SAP Library - SAP DB)

 Entering content frame

Background documentation Processing SQL Statements

The SAP DB ODBC driver supports the complete ODBC-SQL syntax.

For detailed information about the ODBC function calls, see the Microsoft Homepage (http://www.microsoft.com/data/ODBC) in the ODBC Software Development Kit (SDK) under ODBC Programmer‘s Reference, Chapter 8: SQL Statements, Escape Sequences in ODBC, Scalar Functions section.

Numeric functions | ABS, ACOS, ASIN, ATAN, ATAN2, CEILING, COS, COT, DEGREES, EXP, FLOOR, LOG, MOD, SIGN, SIN, SQRT, TAN, TRUNCATE, PI, RADIANS, ROUND
String functions | CONCAT, LCASE, LEFT, LENGTH, LOCATE, LTRIM, REPLACE, RIGHT, RTRIM, SOUNDEX, SUBSTRING, UCASE,
System functions | DBNAME, IFNULL, USERNAME
Time and date functions | CURDATE, CURTIME, DAYNAME, DAYOFMONTH, DAYOFWEEK, DAYOFYEAR, HOUR, MINUTE, MONTH, MONTHNAME, NOW, SECOND, WEEK, YEAR

SELECT {fn MONTH(NOW())} FROM dual

The SAP DB ODBC driver has extensions to the usual SQL syntax in the following areas:

Database Procedures

Cursor Functions


Database Procedures (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Procedures

Database procedures can be processed as SQL statements.

See also: Reference Manual, Database Procedure section.

The ODBC syntax for procedures does not support return values of functions. Therefore, a specification in the format
{ ? = call ...}
is invalid.


Cursor Functions (SAP Library - SAP DB)

 Entering content frame

Background documentation Cursor Functions

The SAP DB ODBC driver supports three types of positionable cursors: static, dynamic, and keyset-driven. These differ in the extent to which changes to the database data by the current session or the sessions of other users are visible.

As SAP DB can lock row-by-row, a user can change data in a table even if another user has also opened parts of this table. The prerequisite for this is that the rows to be changed are outside the part of the table that the other user has opened.
Locks for individual pages or entire tables lead to significantly longer waits than row locks in operation with multiple concurrent users.

Using the function SQLSetPos, an application can execute positioning INSERT, UPDATE, and DELETE statements.


ODBC-API Compatibility (SAP Library - SAP DB)

 Entering content frame

Background documentation ODBC-API Compatibility

In the SAP DB ODBC driver, all functions can be executed both under Microsoft Windows and under UNIX/Linux.

The ODBC API is structured into the areas core, level 1, and level 2.

There is an overview of the functions that are defined for the individual API compatibility levels below.

Core API

Level 1 API

Level 2 API


Core API (SAP Library - SAP DB)

 Entering content frame

Background documentation Core API

Overview of the functions that are defined in the SAP DB ODBC driver for the core API

Function | Remarks
SQLAllocConnect | -
SQLAllocEnv | -
SQLAllocStmt | -
SQLBindCol | If the length specification pcbValueMax is smaller than the length of a bound LONG column, the SAP DB ODBC driver returns the value SQL_NO_TOTAL for pcbValue. In all other cases, pcbValue specifies the length of the copied bytes. You can then fetch other parts of this LONG column with the SQLGetData function.
SQLCancel | -
SQLColAttributes | -
SQLConnect | -
SQLDescribeCol | -
SQLDisconnect | -
SQLError | -
SQLExecDirect | -
SQLExecute | -
SQLFetch | -
SQLFreeConnect | -
SQLFreeEnv | -
SQLFreeStmt | -
SQLGetCursorName | Case-sensitive, maximum length 18 characters Take this into account, for example, with the statement SELECT FOR UPDATE, as identifiers that are not enclosed in quotation marks are automatically converted into uppercase letters. The SAP DB ODBC driver constructs default values for cursor names in accordance with the following schema: SQL_CURSOR_nnnn, where nnnn corresponds to an internal counter. SQL_CUR_nnnnnnn, if n >= 10000
SQLNumResultCols | -
SQLPrepare | -
SQLRowCount | Specifies the number of affected rows for all SELECT, INSERT, DELETE statements, and so on. If no result set was created, the value -1 is displayed for the undeterminable number of affected rows.
SQLSetCursorName | -
SQLTransact | -


Level 1 API (SAP Library - SAP DB)

 Entering content frame

Background documentation Level 1 API

Overview of the functions that are defined in the SAP DB ODBC driver for the Level 1 API

Function

Remark

SQLBindParameter

If you want to process more than one LONG column with an INSERT, UPDATE, or DELETE statement, and bind the parameters with the attribute SQL_DATA_AT_EXECUTE, note that, for the SQLPutData function, it is only possible to assign the NULL value to one LONG column, at most.
If you want to set more than one LONG column to the NULL value with only one statement, you must bind the columns in the length specification (pcbValue) using the attribute SQL_NULL_DATA. Otherwise, you receive the message
szSqlState = S1000 SQLCODE =-22002.

SQLColumns

-

SQLDriverConnect

Keyword for the name of the database server: SERVERNODE
Keyword for the name of the database instance: SERVERDB

SQLGetConnectAttr

Remark

SQLGetData

-

SQLGetFunctions

Remark

SQLGetInfo

Remark

SQLGetStmtAttr

-

SQLGetTypeInfo

You can determine the data types supported by the SAP DB database system using the function SQLGetTypeInfo.

The following data types are supported:
CHAR, VARCHAR, DECIMAL, FIXED, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION, DATE, TIME, TIMESTAMP, LONG, CHAR() BYTE, VARCHAR() BYTE, LONG BYTE, BOOLEAN

If the database is configured so that Unicode characters can be processed, SAP DB also supports the following data types:
CHAR() UNICODE, VARCHAR() UNICODE, LONG UNICODE

SQLParamData

For LONG columns that contain NULL values, see remark for SQLBindParameter

SQLPutData

For LONG columns that contain NULL values, see remark for SQLBindParameter

SQLSetConnectAttr

See SQLGetConnectAttr

SQLSetParam

-

SQLSetStmtAttr

-

SQLSpecialColumns

-

SQLStatistics

-

SQLTables

The SAP DB ODBC driver supports the following table types (szTableType):
ALIAS, RESULT, SNAPSHOT, SYSTEM, SYSTEM TABLE, TABLE, UNLOADED, VIEW


Remark for SQLGetConnectAttr (SAP Library - SAP DB)

 Entering content frame

Background documentation Remark for SQLGetConnectAttr

List of all supported attributes and return values of the SAP DB ODBC driver

Attributes | Return Values
SQL_ ATTR_ACCESS_MODE | pvParam = SQL_MODE_READ_WRITE
SQL_ ATTR_AUTOCOMMIT | pvParam = SQL_AUTOCOMMIT_ON
SQL_ATTR_CONNECTION_DEAD |
SQL_ATTR_CURRENT_CATALOG |
SQL_ ATTR_LOGIN_TIMEOUT | pvParam = 15
SQL_ATTR_ODBC_CURSORS |
SQL_ATTR_QUIET_MODE |
SQL_ ATTR_OPT_TRACE | pvParam = SQL_OPT_TRACE_OFF =0
SQL_ ATTR_OPT_TRACEFILE | (The filename set with SQLSetConnectAttr, default value: \SQL.LOG)
SQL_ ATTR_TRANSLATE_LIB |
SQL_ ATTR_TRANSLATE_OPTION | pvParam = 0
SQL_ ATTR_TXN_ISOLATION | pvParam = SQL_TXN_REPEATABLE_READ
SQL_ MODE = SQL_CONNECT_OPT_START + 2 | pvParam = (1 = INTERNAL, 2 = DB2, 3 = ANSI, 4 = ORACLE)


Remark for SQLGetFunctions (SAP Library - SAP DB)

 Entering content frame

Background documentation Remark for SQLGetFunctions

If the function ID SQL_API_ODBC3_ALL_FUNCTION is specified, the macro SQL_FUNC_EXISTS returns the result TRUE for the following values:

SQL_API_SQLALLOCCONNECT

SQL_API_SQLALLOCENV

SQL_API_SQLALLOCHANDLE

SQL_API_SQLALLOCHANDLESTD

SQL_API_SQLALLOCSTMT

SQL_API_SQLBINDCOL

SQL_API_SQLBINDPARAM

SQL_API_SQLBINDPARAMETER

SQL_API_SQLBROWSECONNECT

SQL_API_SQLBULKOPERATIONS

SQL_API_SQLCANCEL

SQL_API_SQLCLOSECURSOR

SQL_API_SQLCOLATTRIBUTES

SQL_API_SQLCOLUMNPRIVILEGES

SQL_API_SQLCOLUMNS

SQL_API_SQLCONNECT

SQL_API_SQLCOPYDESC

SQL_API_SQLDATASOURCES

SQL_API_SQLDESCRIBECOL

SQL_API_SQLDESCRIBEPARAM

SQL_API_SQLDISCONNECT

SQL_API_SQLDRIVERCONNECT

SQL_API_SQLDRIVERS

SQL_API_SQLENDTRAN

SQL_API_SQLERROR

SQL_API_SQLEXECDIRECT

SQL_API_SQLEXECUTE

SQL_API_SQLEXTENDEDFETCH

SQL_API_SQLFETCH

SQL_API_SQLFETCHSCROLL

SQL_API_SQLFOREIGNKEYS

SQL_API_SQLFREECONNECT

SQL_API_SQLFREEENV

SQL_API_SQLFREEHANDLE

SQL_API_SQLFREESTMT

SQL_API_SQLGETCONNECTATTR

SQL_API_SQLGETCONNECTOPTION

SQL_API_SQLGETCURSORNAME

SQL_API_SQLGETDATA

SQL_API_SQLGETDESCFIELD

SQL_API_SQLGETDESCREC

SQL_API_SQLGETDIAGFIELD

SQL_API_SQLGETDIAGREC

SQL_API_SQLGETENVATTR

SQL_API_SQLGETFUNCTIONS

SQL_API_SQLGETINFO

SQL_API_SQLGETSTMTATTR

SQL_API_SQLGETSTMTOPTION

SQL_API_SQLGETTYPEINFO

SQL_API_SQLMORERESULTS

SQL_API_SQLNATIVESQL

SQL_API_SQLNUMPARAMS

SQL_API_SQLNUMRESULTCOLS

SQL_API_SQLPARAMDATA

SQL_API_SQLPARAMOPTIONS

SQL_API_SQLPREPARE

SQL_API_SQLPRIMARYKEYS

SQL_API_SQLPROCEDURECOLUMNS

SQL_API_SQLPROCEDURES

SQL_API_SQLPUTDATA

SQL_API_SQLROWCOUNT

SQL_API_SQLSETCONNECTATTR

SQL_API_SQLSETCONNECTOPTION

SQL_API_SQLSETCURSORNAME

SQL_API_SQLSETDESCFIELD

SQL_API_SQLSETDESCREC

SQL_API_SQLSETENVATTR

SQL_API_SQLSETPARAM

SQL_API_SQLSETPOS

SQL_API_SQLSETSCROLLOPTIONS

SQL_API_SQLSETSTMTATTR

SQL_API_SQLSETSTMTOPTION

SQL_API_SQLSPECIALCOLUMNS

SQL_API_SQLSTATISTICS

SQL_API_SQLTABLEPRIVILEGES

SQL_API_SQLTABLES

SQL_API_SQLTRANSACT


Remark for SQLGetInfo (SAP Library - SAP DB)

 Entering content frame

Background documentation Remark for SQLGetInfo

List of all attributes and return values supported by the SAP DB ODBC driver

Attributes

Return Values

SQL_ACCESSIBLE_PROCEDURES

rgbInfoValue = "N"

SQL_ACCESSIBLE_TABLES

rgbInfoValue = "N"

SQL_ACTIVE_CONNECTIONS

rgbInfoValue = 0

SQL_ACTIVE_STATEMENTS

rgbInfoValue = 32767

SQL_ALTER_TABLE

rgbInfoValue =
  SQL_AT_ADD_COLUMN
| SQL_AT_DROP_COLUMN
| SQL_AT_ADD_COLUMN_DEFAULT
| SQL_AT_ADD_CONSTRAINT
| SQL_AT_ADD_TABLE_CONSTRAINT
| SQL_AT_DROP_COLUMN_CASCADE
| SQL_AT_DROP_COLUMN_DEAFAULT
| SQL_AT_SET_COLUMN_DEFAULT

SQL_BOOKMARK_PERSISTENCE

rgbInfoValue =
  SQL_BP_SCROLL
| SQL_BP_UPDATE

SQL_CATALOG_LOCATION

rgbInfoValue = 1 (SQL_CL_START)

SQL_CATALOG_NAME_SEPARATOR

rgbInfoValue = "."

SQL_CATALOG_TERM

rgbInfoValue = "Qualifier"

SQL_CATALOG_USAGE

rgbInfoValue = 0x00000000

SQL_COLUMN_ALIAS

rgbInfoValue = "Y"

SQL_CONCAT_NULL_BEHAVIOR

rgbInfoValue = 0 (SQL_CB_NULL)

SQL_CONVERT_BIGINT

SQL_CONVERT_BINARY

SQL_CONVERT_BIT

SQL_CONVERT_CHAR

SQL_CONVERT_DATE

SQL_CONVERT_DECIMAL

SQL_CONVERT_DOUBLE

SQL_CONVERT_FLOAT

SQL_CONVERT_FUNCTIONS

rgbInfoValue = 0x00000000L

SQL_CONVERT_INTEGER

SQL_CONVERT_LONGVARBINARY

rgbInfoValue = 0x00000000L

SQL_CONVERT_LONGVARCHAR

SQL_CONVERT_NUMERIC

SQL_CONVERT_REAL

SQL_CONVERT_SMALLINT

SQL_CONVERT_TIME

SQL_CONVERT_TIMESTAMP

SQL_CONVERT_TINYINT

SQL_CONVERT_VARBINARY

SQL_CONVERT_VARCHAR

SQL_CORRELATION_NAME

rgbInfoValue = 2 (SQL_CN_ANY)

SQL_CURSOR_COMMIT_BEHAVIOR

rgbInfoValue =
SQL_CB_PRESERVE
| SQL_CB_DELETED (SQLMode = ANSI)

SQL_CURSOR_ROLLBACK_BEHAVIOR

rgbInfoValue =
SQL_CB_PRESERVE
| SQL_CB_DELETED (SQLMode = ANSI)

SQL_DATA_SOURCE_NAME

rgbInfoValue = (Name of the opened data source)

SQL_DATA_SOURCE_READ_ONLY

rgbInfoValue = "N"

SQL_DBMS_NAME

rgbInfoValue = "SAP DB"

SQL_DBMS_VER

rgbInfoValue = "/07.03.nnn"

SQL_DEFAULT_TXN_ISOLATION

rgbInfoValue = SQL_TXN_READ_COMMITTED

SQL_DRIVER_HDBC

rgbInfoValue = (Handle of the driver logon)

SQL_DRIVER_HENV

rgbInfoValue = (Handle of the driver environment)

SQL_DRIVER_HLIB

rgbInfoValue = (Handle of the library)

SQL_DRIVER_HSTMT

rgbInfoValue = (Handle of the driver statement)

SQL_DRIVER_NAME

rgbInfoValue = "sqlod32.dll", "libsqlod.so" (UNIX)

SQL_DRIVER_ODBC_VER

rgbInfoValue = "03.51"

SQL_DRIVER_ODBC_VER

rgbInfoValue = (Version of the Driver Manager > 3.51)

SQL_DRIVER_VER

rgbInfoValue = "7.<minor_version>.<correction_level>"

SQL_EXPRESSIONS_IN_ORDERBY

rgbInfoValue = "N"

SQL_FETCH_DIRECTION

rgbInfoValue =
  SQL_FD_FETCH_NEXT
| SQL_FD_FETCH_FIRST
| SQL_FD_FETCH_LAST
| SQL_FD_FETCH_PRIOR
| SQL_FD_FETCH_ABSOLUTE
| SQL_FD_FETCH_RELATIVE
| SQL_FD_FETCH_BOOKMARK

SQL_FILE_USAGE

rgbInfoValue = 0 (SQL_FILE_NOT_SUPPORTED)

SQL_GETDATA_EXTENSIONS

rgbInfoValue =
  SQL_GD_ANY_COLUMN
| SQL_GD_ANY_ORDER
| SQL_GD_ANY_BOUND
| SQL_GD_ANY_BLOCK

SQL_GROUP_BY

rgbInfoValue = SQL_GB_GROUP_BY_CONTAINS_SELECT

SQL_IDENTIFIER_CASE

rgbInfoValue = 1 (SQL_IC_UPPER)

SQL_IDENTIFIER_QUOTE_CHAR

rgbInfoValue = "\""

SQL_INTEGRITY

rgbInfoValue = "N"

SQL_KEYWORDS

rgbInfoValue = (List of key words, dependent on SQLMode)

SQL_LIKE_ESCAPE_CLAUSE

rgbInfoValue = "Y"

SQL_LOCK_TYPES

rgbInfoValue = 1 SQL_LCK_NO_CHANGE

SQL_MAX_BINARY_LITERAL_LEN

rgbInfoValue = 0

SQL_MAX_CATALOG_NAME_LEN

rgbInfoValue = 0

SQL_MAX_CHAR_LITERAL_LEN

rgbInfoValue = 0

SQL_MAX_COLUMN_NAME_LEN

rgbInfoValue = 32

SQL_MAX_COLUMNS_IN_GROUP_BY

rgbInfoValue = 128

SQL_MAX_COLUMNS_IN_INDEX

rgbInfoValue = 16

SQL_MAX_COLUMNS_IN_ORDER_BY

rgbInfoValue = 128

SQL_MAX_COLUMNS_IN_SELECT

rgbInfoValue = 1023

SQL_MAX_COLUMNS_IN_TABLE

rgbInfoValue = 1023

SQL_MAX_CONCURRENT_ACTIVITIES

rgbInfoValue = 32767

SQL_MAX_CURSOR_NAME_LEN

rgbInfoValue = 32

SQL_MAX_DRIVER_CONNECTIONS

rgbInfoValue = 0

SQL_MAX_INDEX_SIZE

rgbInfoValue = 1024

SQL_MAX_OWNER_NAME_LEN

rgbInfoValue = 32

SQL_MAX_PROCEDURE_NAME_LEN

rgbInfoValue = 32

SQL_MAX_QUALIFIER_NAME_LEN

rgbInfoValue = 0

SQL_MAX_ROW_SIZE

rgbInfoValue = 0

SQL_MAX_ROW_SIZE_INCLUDES_LONG

rgbInfoValue = "N"

SQL_MAX_SCHEMA_NAME_LEN

rgbInfoValue = 32

SQL_MAX_STATEMENT_LEN

rgbInfoValue = 0

SQL_MAX_TABLE_NAME_LEN

rgbInfoValue = 32

SQL_MAX_TABLES_IN_SELECT

rgbInfoValue = 64

SQL_MAX_USER_NAME_LEN

rgbInfoValue = 32

SQL_MULT_RESULT_SETS

rgbInfoValue = "Y"

SQL_MULTIPLE_ACTIVE_TXN

rgbInfoValue = "Y"

SQL_NEED_LONG_DATA_LEN

rgbInfoValue = "N"

SQL_NON_NULLABLE_COLUMN

rgbInfoValue = 1 (SQL_NNC_NON_NULL)

SQL_NULL_COLLATION

rgbInfoValue = 1 (SQL_NC_LOW)

SQL_NUMERIC_FUNCTIONS

rgbInfoValue =
  SQL_FN_NUM_ABS
| SQL_FN_NUM_ACOS
| SQL_FN_NUM_ASIN
| SQL_FN_NUM_ATAN
| SQL_FN_NUM_ATAN2
| SQL_FN_NUM_CEILING
| SQL_FN_NUM_COS
| SQL_FN_NUM_COT
| SQL_FN_NUM_EXP
| SQL_FN_NUM_FLOOR
| SQL_FN_NUM_LOG
| SQL_FN_NUM_MOD
| SQL_FN_NUM_SIGN
| SQL_FN_NUM_SIN
| SQL_FN_NUM_SQRT
| SQL_FN_NUM_TAN
| SQL_FN_NUM_PI
| SQL_FN_NUM_DEGREES
| SQL_FN_NUM_RADIANS
| SQL_FN_NUM_ROUND

SQL_ODBC_API_CONFORMANCE

rgbInfoValue = 2 (SQL_OAC_LEVEL2)

SQL_ODBC_SAG_CLI_CONFORMANCE

rgbInfoValue = 1 (SQL_OSCC_COMPLIANT)

SQL_ODBC_SQL_CONFORMANCE

rgbInfoValue = 2 (SQL_OSC_EXTENDED)

SQL_ODBC_SQL_OPT_IEF

rgbInfoValue = "N"

SQL_ODBC_VER

rgbInfoValue = "03.520000"

SQL_ORDER_BY_COLUMNS_IN_SELECT

rgbInfoValue = "N"

SQL_OUTER_JOINS

rgbInfoValue = "Y"

SQL_OWNER_TERM

rgbInfoValue = "Owner"

SQL_OWNER_USAGE

rgbInfoValue =
  SQL_OU_DML_STATEMENTS
| SQL_OU_PROCEDURE_INVOCATION
| SQL_OU_TABLE_DEFINITION
| SQL_OU_INDEX_DEFINITION
| SQL_OU_PRIVILEGE_DEFINITION

SQL_POS_OPERATIONS

rgbInfoValue =
  SQL_POS_UPDATE
| SQL_POS_DELETE
| SQL_POS_ADD (only allowed with dynamic cursors)
| SQL_POS_POSITION
| SQL_POS_REFRESH

SQL_POSITIONED_STATEMENTS

rgbInfoValue =
  SQL_PS_POSITIONED_DELETE
| SQL_PS_POSITIONED_UPDATE
| SQL_PS_SELECT_FOR_UPDATE

SQL_PROCEDURE_TERM

rgbInfoValue = "stored procedure"

SQL_PROCEDURES

rgbInfoValue = "Y"

SQL_QUALIFIER_LOCATION

rgbInfoValue = 1 (SQL_CL_START)

SQL_QUALIFIER_NAME_SEPARATOR

rgbInfoValue = "."

SQL_QUALIFIER_TERM

rgbInfoValue = "Qualifier"

SQL_QUALIFIER_USAGE

rgbInfoValue = 0x00000000

SQL_QUOTED_IDENTIFIER_CASE

rgbInfoValue = 3 (SQL_IC_SENSITIVE)

SQL_ROW_UPDATES

rgbInfoValue = "Y"

SQL_SCHEMA_TERM

rgbInfoValue = "Owner"

SQL_SCHEMA_USAGE

rgbInfoValue =
  SQL_OU_DML_STATEMENTS
| SQL_OU_PROCEDURE_INVOCATION
| SQL_OU_TABLE_DEFINITION
| SQL_OU_INDEX_DEFINITION
| SQL_OU_PRIVILEGE_DEFINITION

SQL_SCROLL_CONCURRENCY

rgbInfoValue =
  SQL_SCCO_READ_ONLY
| SQL_SCCO_LOCK
| SQL_SCCO_OPT_ROWVER
| SQL_SCCO_OPT_VALUES

SQL_SCROLL_OPTIONS

rgbInfoValue =
  SQL_SO_FORWARD_ONLY
| SQL_SO_KEYSET_DRIVEN
| SQL_SO_DYNAMIC
| SQL_SO_STATIC

SQL_SEARCH_PATTERN_ESCAPE

rgbInfoValue = "\"

SQL_SERVER_NAME

rgbInfoValue = (Name of the database server)

SQL_SPECIAL_CHARACTERS

rgbInfoValue = "#@$"

SQL_STATIC_SENSITIVITY

rgbInfoValue = 0x00000000

SQL_STRING_FUNCTIONS

rgbInfoValue =
  SQL_FN_STR_LEFT
| SQL_FN_STR_LTRIM
| SQL_FN_STR_LENGTH
| SQL_FN_STR_LCASE
| SQL_FN_STR_REPLACE
| SQL_FN_STR_RIGHT
| SQL_FN_STR_RTRIM
| SQL_FN_STR_SUBSTRING
| SQL_FN_STR_UCASE
| SQL_FN_STR_SOUNDEX

SQL_SUBQUERIES

rgbInfoValue =
  SQL_SQ_COMPARISON
| SQL_SQ_EXISTS
| SQL_SQ_IN
| SQL_SQ_CORRELATED_SUBQUERIES

SQL_SYSTEM_FUNCTIONS

rgbInfoValue =
  SQL_FN_SYS_USERNAME
| SQL_FN_SYS_DBNAME
| SQL_FN_SYS_IFNULL

SQL_TABLE_TERM

rgbInfoValue = "Table"

SQL_TIMEDATE_ADD_INTERVALS

rgbInfoValue = 0x00000000

SQL_TIMEDATE_DIFF_INTERVALS

rgbInfoValue = 0x00000000

SQL_TIMEDATE_FUNCTIONS

rgbInfoValue =
  SQL_FN_TD_NOW
| SQL_FN_TD_CURDATE
| SQL_FN_TD_DAYOFMONTH
| SQL_FN_TD_DAYOFWEEK
| SQL_FN_TD_DAYOFYEAR
| SQL_FN_TD_MONTH
| SQL_FN_TD_WEEK
| SQL_FN_TD_YEAR
| SQL_FN_TD_CURTIME
| SQL_FN_TD_HOUR
| SQL_FN_TD_MINUTE
| SQL_FN_TD_SECOND
| SQL_FN_TD_DAYNAME
| SQL_FN_TD_MONTHNAME

SQL_TXN_CAPABLE

rgbInfoValue = 2 (SQL_TC_ALL)

SQL_TXN_ISOLATION_OPTION

rgbInfoValue =
  SQL_TXN_READ_UNCOMMITTED
| SQL_TXN_READ_COMMITTED
| SQL_TXN_REPEATABLE_READ
| SQL_TXN_SERIALIZABLE

SQL_UNION

rgbInfoValue =
  SQL_U_UNION
| SQL_U_UNION_ALL

SQL_USER_NAME

rgbInfoValue = (Name of the active user)


Level 2 API (SAP Library - SAP DB)

 Entering content frame

Background documentation Level 2 API

Overview of the functions that are defined in the SAP DB ODBC driver for the Level 2 API

Function

Remark

SQLBrowseConnect

SQLColumnPrivileges

SQLDataSources (*)

SQLDescribeParam

SQLExtendedFetch

You can only insert rows using the function with the dynamic cursor model (SQL_CURSOR_DYNAMIC). This is not possible with any other cursor models.

UPDATE and DELETE statements are possible both with the static (SQL_CURSOR_STATIC) and with the keyset-driven cursor (SQL_CURSOR_KEYSETDRIVEN) models.

SQLFetchScroll

SQLForeignKeys

SQLMoreResults

The function calls SQLFreeStmt with the attribute SQL_CLOSE to close the previous result set and then returns SQL_NO_DATA_FOUND.

SQLNativeSql

SQLNumParams

SQLParamOptions

SQLPrimaryKeys

SQLProcedureColumns

SQLProcedures

SQLSetPos

All attributes are permissible.
The attribute SQL_ADD is only possible in the dynamic cursor model (SQL_CURSOR_DYNAMIC).
Only the attribute SQL_LOCK_NO_CHANGE is permissible for the fLock argument.

SQLSetScrollOptions

SQLTablePrivileges


Unicode Support (SAP Library - SAP DB)

 Entering content frame

Background documentation Unicode Support

The SAP DB ODBC driver supports Unicode. This means that the functions listed below are also available, irrespective of whether the data source supports Unicode or not.

Under Microsoft Windows, the Driver Manager basically uses the Unicode variants of the ODBC API. If, for example, the SQLConnect function is called within the application, SQLConnectW is called in the ODBC driver. The conversions between ASCII and Unicode are performed by the Driver Manager.

Overview of the functions that are defined in the SAP DB ODBC driver for access to Unicode data

SQLBrowseConnectW

SQLColAttributesW

SQLColAttributeW

SQLColumnPrivilegesW

SQLColumnsW

SQLConnectW

SQLDataSourcesW

SQLDescribeColW

SQLDriverConnectW

SQLDriversW

SQLErrorW

SQLExecDirectW

SQLForeignKeysW

SQLGetConnectAttrW

SQLGetConnectOptionW

SQLGetCursorNameW

SQLGetDescFieldW

SQLGetDescRecW

SQLGetDiagFieldW

SQLGetDiagRecW

SQLGetInfoW

SQLGetStmtAttrW

SQLGetTypeInfoW

SQLNativeSqlW

SQLPrepareW

SQLPrimaryKeysW

SQLProcedureColumnsW

SQLProceduresW

SQLSetConnectAttrW

SQLSetConnectOptionW

SQLSetCursorNameW

SQLSetDescFieldW

SQLSetStmtAttrW

SQLSpecialColumnsW

SQLStatisticsW

SQLTablePrivilegesW

SQLTablesW


SAP DB ODBC Driver Under Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB ODBC Driver Under Microsoft Windows

Installation Under Microsoft Windows

Creating Data Sources Under Microsoft Windows


Installation Under Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Background documentation Installation Under Microsoft Windows

Use

You have various options for installing the SAP DB ODBC driver under Microsoft Windows:

  • As part of the SAP DB server package
  • As a separate software package, such as for purely client installations

These options differ only in the default value of the system for storing the installed software.

If you install the SAP DB ODBC driver as part of the server package, the system default value for the installation path up to database version 7.3 is the <dependent_data_path>, as of database version 7.4, the <independent_data_path>.

If you install the SAP DB ODBC driver as a separate software package, the default value for the system is the installation path C:\Program Files\SAP DB\ODBC7x, where x stands for the particular version of the SAP DB ODBC driver.

As of version 7.4, the ODBC installation package is included not only in the server package, but also in the Web Tools package and in the DB Analyzer package. The combination of the software packages corresponds to different installation profiles. You can install the entire software package; that is, including ODBC software, or select only the ODBC installation package from the software package.

See also: Installation Guidelines, Installation Profile section

Procedure

Check whether a SAP DB Server is already installed on your server. If this is the case, the SAP DB ODBC driver is also already installed, and no further steps are necessary. Otherwise, proceed as follows:

Open the InstallShield Wizard for the SAP DB ODBC driver by double clicking the file odbc7x-setup.exe.

The default value for the installation path is C:\Program Files\SAPDB\ODBC7x. You can change this installation path.

Follow the instructions in the Wizard.

Result

Information about all installed ODBC drivers is stored by the system in the file HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBCINST.INI. A driver-specific key is also created for each ODBC driver, and is also stored in this file.

Example
The following entry is stored in the registry for the SAP DB ODBC driver during installation:

HKEY_LOCAL_MACHINE
SOFTWARE\ODBC\ODBCINST.INI
SAP DB 7.4

The key SAP DB 7.4 is created.

The names of the ODBC driver DLLS and the name of the setup DLL are stored under the driver-specific key. The ODBC Administrator tool uses this information to load the corresponding DLL when creating new data sources.

Example
Under the key SAP DB 7.4, there is the following entry:

HKEY_CURRENT_USER
 SOFTWARE\ODBC\ODBCINST.INI\SAP DB 7.4
Driver=C:\SAP DB\pgm\sqlod32.dll
Setup=C:\SAP DB\pgm\sqlsp32.dll


Creating Data Sources Under Microsoft Windows (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating Data Sources Under Microsoft Windows

Use

You can create data sources using the ODBC Administrator tool.

The specifications for the data sources are stored by the system in the file HKEY_CURRENT_USER/Software/ODBC/ODBC.INI.

Procedure

  1. Choose Start ® Settings ® Control Panel ® Administrative Tools ® Data Sources (ODBC). This opens the ODBC Data Source Administrator.
  2. Choose Add.
  3. From the displayed list of the installed ODBC drivers, choose the entry SAP DB and confirm your choice by choosing Finish.
  4. Make the following entries:
    5.
    Data Source Name | Name of the data source. The data source is identified using this name. Use this name to simplify logging on to the database server. The name of the data source may not contain any special characters.
Description | Description of the data source
Database Name | Name of the database instance
Database Server | Name of the database server.If the database instance and the application are on the same server, you do not need to fill out this field.
  5. If you want to specify options for the new data source, choose Settings.
    Proceed with the entry of     Options for the Data Source .
    If you do not want to specify any options, choose OK.
    Your entries become effective when the next ODBC connection is created.


Options for Data Sources (Microsoft Windows) (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Options for Data Sources (Microsoft Windows)

You can specify various options to influence the functioning of the SAP DB ODBC driver. These options become active the next time that you log on to the database server.

The following options are possible:

Option

Remarks

SQL Mode

Select the database-specific SQL mode

Isolation Level

Overrides the default value of the SAP DB ODBC driver for the lock operation type (the default value is Committed).

Trace On

Activates or deactivates the driver log.
If you have set this option, the SAP DB ODBC driver creates a log of the database session. All SQL statements that the application transfers to the database system are recorded in the log.

A large number of file operations are performed if you activate logging. This affects the execution speed of the application. You should therefore deactivate logging again after your analysis.

This driver logging is not identical to the Driver Manager log, which you can activate and deactivate in the ODBC Data Source Administrator on the Tracing tab page.


SQL Mode (Microsoft Windows) (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Mode (Microsoft Windows)

Use

If you specify the option SQL Mode, you can use the SAP DB ODBC driver in a different SQL mode. This means that the driver can process not only the ODBC and SAP DB-specific SQL syntax, but also the ORACLE or DB2 syntax, for example.

Specifying this option can simplify the customization of SQL statements during the migration from ODBC applications from other database systems.

For a description of the SAP DB-specific SQL mode INTERNAL, see the Reference Manual, SQL Mode section.

Procedure

  1. Start the ODBC Data Source Administrator by choosing Start ® Settings ® Control Panel ® Administrative Tools ® Data Sources.
  2. Choose Add.
  3. Choose the SAP DB ODBC driver and then Finish.
  4. Specify the name of the data source, the name of the database instance, and the name of the database server. Choose Options.
  5. In the SQL Mode field, choose the desired SQL mode.
  6. Confirm the windows until the ODBC Data Source Administrator closes.

Result

The next time that you log on to the database server using this data source, the SAP DB ODBC driver functions in the selected SQL mode.


Isolation Level (Microsoft Windows) (SAP Library - SAP DB)

 Entering content frame

Background documentation Isolation Level (Microsoft Windows)

Use

SAP DB allows concurrent transactions on database objects. To do this, it uses a lock concept that creates locks on rows and tables to contain individual transactions. The lock operation type plays an important role in this. This is determined by defining an isolation level.

Use the Isolation Level option if you want to change the system default value for the lock operation type (Committed). The value defined in this way then applies for all connections of the data source.

The set lock operation type can be overridden by the application using the function SQLSetConnectAttr and queried with SQLGetConnectAttr.

Overview of the possible lock operation types

 | Dirty Read | Non-repeatable Read | Phantom Read
Uncommitted | x | x | x
Committed |  | x | x
Repeatable |  |  | x
Serializable |  |  |

The lock operation type Uncommitted corresponds to the weakest isolation level (0), while Serializable corresponds to the strongest isolation level (4).

Procedure

  1. Start the ODBC Data Source Administrator by choosing Start ® Settings ® Control Panel ® Administrative Tools ® Data Sources.
  2. Choose Add.
  3. Choose the SAP DB ODBC driver and then Finish.
  4. Specify the name of the data source, the name of the database instance, and the name of the database server. Choose Options.
  5. In the Isolation Level field, select the desired lock operation type.
  6. Confirm the windows until the ODBC Data Source Administrator closes.

Result

The next time that you log on to the database server using this data source, the SAP DB ODBC driver functions with the selected lock operation type.


Logging SQL Statements (Microsoft Windows) (SAP Library - SAP DB)

 Entering content frame

Background documentation Logging SQL Statements (Microsoft Windows)

Use

Select the Trace On option for a data source, if you want to log the SQL statements that are transferred from the application to the database system. You can set this option for existing data sources or when creating a new data source.

The following data is recorded:

  • SQL statement
  • Execution time
  • Start and end of a session
  • CONNECT parameters
  • Input and output parameters

Procedure

  1. Start the ODBC Data Source Administrator by choosing Start ® Settings ® Control Panel ® Administrative Tools ® Data Sources.
  2. Choose Add.
  3. Choose the SAP DB ODBC driver and then Finish.
  4. Specify the name of the data source, the name of the database instance, and the name of the database server, and choose Options.
  5. Select the Trace On field or choose a file using Browse to which the log should be written.
  6. Confirm the windows until the ODBC Data Source Administrator closes.

Result

The next time that you log on to the database server using this data source, the system logs all SQL statements that are transferred by the application to the database system.


Installed Files (Microsoft Windows 95 and following) (SAP Library - SAP DB)

 Entering content frame

Background documentation Installed Files (Microsoft Windows 95 and following)

Overview of the Files created during installation and their functions

The files are specified relative to the respective installation directory.
(See also: Installation Under Microsoft Windows )

Filename | Description
sql*.dll | Libraries of the SAP DB ODBC driver
odbcreg.exe | Program for entering the driver information in the registry


SAP DB ODBC Driver Under UNIX/Linux (SAP Library - SAP DB)

 Entering content frame

Background documentation SAP DB ODBC Driver Under UNIX/Linux

Installation Under UNIX/Linux

Creating Data Sources Under UNIX/Linux


Installation Under UNIX/Linux (SAP Library - SAP DB)

 Entering content frame

Background documentation Installation Under UNIX/Linux

You have various options for installing the SAP DB ODBC driver:

  • As part of the SAP DB server package

The software for the SAP DB ODBC driver is stored under the <dependent_data_path> up to database version 7.3 and under the <independent_data_path> as of database version 7.4.
  • As part of the rpm package for the call interfaces (only for Linux)

The installation program creates the directory /opt/sapdb/interfaces/odbc and stores the SAP DB ODBC driver files there.
  • Using a separate tgz package (ODBC Patch)

You can decide the path under which the tgz package unpacks and the software is installed yourself.

As of version 7.4, the ODBC installation package is included not only in the server package, but also in the Web Tools package. The combination of the software packages corresponds to different installation profiles. You can install the entire software package; that is, including ODBC software, or select only the ODBC installation package from the software package.

See also: Installation Guidelines, Installation Profile section

You can use the SAP DB ODBC driver under UNIX/Linux both with and without a Driver Manager ( Integrating the SAP DB ODBC Driver ).


Integrating the SAP DB ODBC Driver (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Integrating the SAP DB ODBC Driver

Use

You can use the SAP DB ODBC driver under UNIX/Linux both with and without a Driver Manager.

By entering link commands, you connect the static library libsqlod.a or the dynamic library libsqlod.so with the application. Ensure with dynamic links that the dynamic library libsqlod.so is found by the system at execution time (see, for example, Idconfig, LD_LIBRARY_PATH).

Procedure

Use with a Driver Manager

Using a Driver Manager, such as iODBC or unixODBC simplifies the exchange of ODBC drivers and allows the concurrent use of different ODBC drivers. The relevant documentation describes how you integrate an ODBC driver into the Driver Manager.

Use without a Driver Manager

If you are not using a Driver Manager, you must use an editor to enter the data for the SAP DB ODBC driver manually, either in the file ~/.odbc.ini or the file /var/spool/sql/ini/odbc.ini.

Result

The system first uses the valid .odbc.ini file for the respective user from his or her home directory during the assignment of data sources. If no suitable data source is found there, the system evaluates the file /var/spool/sql/ini/odbc.ini.

Using the ODBC Driver without a Driver Manager

Compiler command:

Compile the ODBC application myapp.c with appropriate ODBC header files

cc –c myapp.c –I<ODBC_include>

Link command for static library:

Static linking of the application myapp

cc –o myapp myapp.o <ODBC_lib>/libsqlod.a

Link command for dynamic library:

Dynamic linking of the application myapp

cc –o myapp myapp.o –L<ODBC_lib> -lsqlod


Creating and Changing Data Sources Under UNIX/Linux (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating and Changing Data Sources Under UNIX/Linux

Use

Under the UNIX and Linux operating systems, data sources are stored system-specifically in the directory /var/spool/sql/config/ in the file odbc.ini or user-specifically in the file ~/.odbc.ini. To create data sources, edit the desired file appropriately.

Procedure

  1. Open an editor.
  2. Open the desired file.
    Specify the name of the data source, the database server, and the database instance in accordance with the following structure:
    You can also specify     Options for Data Sources , if you want to change the system default values.

    [<data_source_name>]
    ServerDB=<database_name>
    ServerNode=<name_of_database_server>
    SQLMode=<INTERNAL|DB2|ANSI|ORACLE>
    IsolationLevel=<Uncommitted|Committed|Repeatable|Serializable>
    TraceFileName=<trace_file_path_and_name>

    If you want to specify multiple data sources, repeat the group of specifications above in accordance with the number of data sources.
  3. Save your entries.
    Your entries become effective when the next ODBC connection is created.


Options for Data Sources (UNIX/Linux) (SAP Library - SAP DB)

 Entering content frame

Background documentation Options for Data Sources (UNIX/Linux)

You can specify various options to influence the functioning of the SAP DB ODBC driver. These options become active the next time that you log on to the database server.

The following options are possible:

Option

Remark

SQLMode

Select the database-specific SQL mode (default value is INTERNAL)

IsolationLevel

Overrides the default value of the SAP DB ODBC driver for the isolation level (the default value is Committed).

TraceFileName

Activates or deactivates the driver log for logging the SQL statements (Default value: No log is written).

If you have set this option, the SAP DB ODBC driver creates a log of the database session. All SQL statements that the application sends to the database system are recorded in the log.

A large number of file operations are performed if you activate logging. This affects the execution speed of the application. You should therefore deactivate logging again after your analysis.


SQL Mode (UNIX/Linux) (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Mode (UNIX/Linux)

Use

By changing the option SQLMode, you can use the SAP DB ODBC driver in a different SQL mode. This means that the driver can process not only the ODBC and SAP DB-specific SQL syntax, but also the ORACLE or DB2 syntax, for example.

The system default value is INTERNAL (see also: Reference Manual, SQL Mode section).

If you migrate ODBC applications from other database systems, specifying this option can simplify the customization of the SQL statements.

Syntax

SQLMode =
  INTERNAL
| DB2
| ANSI
| ORACLE

For a description of the SAP DB-specific SQL mode INTERNAL, see the Reference Manual, SQL Mode section.

Procedure

To change the SQLMode option, follow the procedure described under Creating and Changing Data Sources Under UNIX/Linux .

The value defined in this way then applies for all connections of the data source.


Isolation Level (UNIX/Linux) (SAP Library - SAP DB)

 Entering content frame

Background documentation Isolation Level (UNIX/Linux)

Use

SAP DB allows concurrent transactions on database objects. To do this, it uses a lock concept that creates locks on rows and tables to contain individual transactions. The lock operation type plays an important role in this. This is determined by defining an isolation level.

The system default value for the lock operation type is Committed.

The set lock operation type can be overridden by the application using the function SQLSetConnectAttr and queried with SQLGetConnectAttr.

Syntax

IsolationLevel =
  Uncommitted
| Committed
| Repeatable
| Serializable

Overview of the possible lock operation types

 | Dirty Read | Non-repeatable Read | Phantom Read
Uncommitted | x | x | x
Committed |  | x | x
Repeatable |  |  | x
Serializable |  |  |

The lock operation type Uncommitted corresponds to the weakest isolation level (0), while Serializable corresponds to the strongest isolation level (4).

Procedure

To change the IsolationLevel option, follow the procedure described under Creating and Changing Data Sources Under UNIX/Linux .

The value defined in this way then applies for all connections of the data source.


Logging SQL Statements (UNIX/Linux) (SAP Library - SAP DB)

 Entering content frame

Background documentation Logging SQL Statements (UNIX/Linux)

Use

The SQL statements transferred by the application to the database instance can be logged in a file. The following data is recorded:

  • SQL statement
  • Execution time
  • Start and end of a session
  • CONNECT parameters
  • Input and output parameters

Only one application can write to each log file.

If this option is not set, no log is written (system default value).

Syntax

TraceFileName = <file_name>

<file_name> ::= [<path_name>/]file_identifier

Procedure

To change the TraceFileName option, follow the procedure described under Creating and Changing Data Sources Under UNIX/Linux .


Installed Files (UNIX/Linux) (SAP Library - SAP DB)

 Entering content frame

Background documentation Installed Files (UNIX/Linux)

Overview of the Files created during installation and their functions

The files are specified relative to the respective installation directory.
(See also: Installation Under UNIX/Linux )

Filename | Description
libsqlod.a, libsqlod.so | SAP DB ODBC driver library
incl/sql.h | ODBC driver header file (Core API)
incl/sqlext.h | ODBC driver header file (Level 1 API and Level 2 API)
incl/sqltypes.h | ODBC driver header file (Data types)
incl/WINDOWS.H | Header file for the UNIX/Linux platforms
demo/eng/ODBC/sqlexamp.c | C example program for an ODBC application
demo/eng/ODBC/sqladhoc.c | C example program for an ODBC application
demo/eng/ODBC/Makefile | Make file for generating a demo program


Development (SAP Library - SAP DB)

 Entering content frame

Component documentation Development

Title of the Documentation | Contents
Development Environment | Using the development environment
Source Code for Tools | Creating source code
Web-Based Problem Tracking System | Web interface for internal SAP DB program PTS (Problem Tracking System) for documenting problem messages about SAP DB software


Development Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Development Environment

General Directory Structure of the SAP DB Development Environment

Development Hierarchy

Environment Variables

Tools in the SAP DB Development Hierarchy

Working with the SAP DB Development Environment: Examples


General Directory Structure of the SAP DB Development Environmen (SAP Library - SAP DB)

 Entering content frame

Background documentation General Directory Structure of the SAP DB Development Environment

The SAP DB development environment uses a fixed directory structure.

The top node (SAPDB_DEV) corresponds to the environment variable $OWN .

The system creates the following directory structure when you call VMAKE for the first time.

This graphic is explained in the accompanying text

The top SAPDB_DEV node is divided into 3 areas:

  • Development area: sys
  • Temporary area: tmp
  • Directory for created software components: usr

Development Area

The development area is divided into the subdirectories desc, src, and wrk.

The development area is not always necessary. Using the development hierarchy , the system accesses the sources from the next hierarchy level when the software is created.

  • All types of description files are stored in the desc directory, which can also have subdirectories.
  • The src directory contains all the module files in separate directories or layers .

  • The actual software creation process takes place in the wrk directory. All of the intermediate products ( object files , include files ) and logs are also stored here.
  • A separate directory (fast, quick, slow) with a standard structure exists for each of the three VMAKE versions . Each of these directories has a tmp subdirectory. This is the temporary work area that is used during the MAKE operation .

    • All of the object files and static libraries created are stored in the obj subdirectory.
    • The date files are stored in the dates subdirectory.
    • The psrc and csrc directories can be used as buffers for module files if the VMAKE_OPTION parameters have been set accordingly.

    • The module files that were translated in debug mode are stored in the debug directory.

  • Since include files are independent of the VMAKE version, they are stored directly below the wrk directory in the incl directory.
  • The associated date files are stored directly below the wrk directory in the dates directory.

Temporary Area

This is a temporary area that allows the iview.pl tool to use the development environment. When the tool is called, the specified module and/or description files are copied to the tmp file. These files, however, cannot be modified in this directory.

Directory for Created Software Components

The usr directory for the created software components is the future DBROOT directory of the SAPDB software. All of the components that are required to operate the database are copied here.


Development Hierarchy (SAP Library - SAP DB)

 Entering content frame

Background documentation Development Hierarchy

VMAKE provides access to module and description files across several levels. Several development states can be logically superimposed on one another in different directories (also from other computers). This provides an overview of a complete software version.

Each hierarchy level does not have to contain all the module and description files. For the translation process , the module and description files are usually taken from the top level in the hierarchy. This hierarchy sequence is defined through the environment variable VMAKE_PATH .

A two-level hierarchy is implemented with the standard installation of the SAPDB development environment. This ensures that the original module and description files are always retained.

Example of a two-level hierarchy

Directory 1 (C:\SAPDB\SAPDB_ORG ) | Contains the original SAP DB sources; these are located in the subdirectories sys/desc and sys/src ( General Directory Structure )
Directory 2 (C:\SAPDB\SAPDB_DEV) | Directory for creating and developing SAPDB software

Working with the SAP DB Development Hierarchy


Working with the SAP DB Development Hierarchy (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Working with the SAP DB Development Hierarchy

If you want to modify files, use the icp.pl tool to copy them from the SAPDB_ORG directory to the SAPDB_DEV directory in the development hierarchy .

The SAPDB_ORG directory is located und the following path: C:\SAPDB\SAPDB_ORG

The SAPDB_DEV directory is located under the following path: C:\SAPDB\SAPDB_DEV

In this case, the environment variable $VMAKE_PATH must contain the following entry:

VMAKE_PATH= C:\SAPDB\SAPDB_DEV,C:\SAPDB\SAPDB_ORG

In a MAKE operation, SAPDB_DEV would now be searched for a module or description file. VMAKE only searches the next level if it cannot find the file here.

If a path in the VMAKE_PATH does not end with two slashes, it is also searched for current object files in the wrk directory. The files are copied if they match the current development status. The relevant module files do not need to be translated.

You can use the idiff.pl tool to compare the modified and original module or description files.

The iview.pl tool enables you to display a module or description file.


Environment Variables (SAP Library - SAP DB)

 Entering content frame

Object documentation Environment Variables

The VMAKE initialization process is based on environment variables.

In Windows NT, environment variables must be encapsulated in percentage symbols.

On UNIX systems, environment variables are prefixed with a $. This is also the selected notation in this documentation.

All of the environment variables listed here, with the exception of $NOQUIET, can be set with the initDev_SAPDB.bat (Windows NT) or initDev_SAPDB (UNIX) initialization script. This script is stored in the SAPDB_DEV directory when the development environment is installed.

$VMAKE_VERSION

$VMAKE_DEFAULT

$VMAKE_OPTION

$INSTROOT

$VMAKE_PATH

$SHELL

$TOOLSHELL

$TOOLOPT

$TOOL

$TOOLEXT

$DLL_TYPE

$ARC_TYPE

$OWN

$WRK

$PATH

%INCLUDE%

$RELVER

$CORRECTION_LEVEL

$BUILD_PRAEFIX

$PATHONPATH

$PERL5LIB

$EDITOR

$DBROOT

$NOQUIET

$TOOLVARS


$VMAKE_VERSION (SAP Library - SAP DB)

 Entering content frame

Object documentation $VMAKE_VERSION

This variable defines the system default for the VMAKE version .

VMAKE only evaluates the first letter of the set variable.

set VMAKE_VERSION=fast


$VMAKE_DEFAULT (SAP Library - SAP DB)

 Entering content frame

Object documentation $VMAKE_DEFAULT

This variable is optional. If this variable is not set, VMAKE uses the entry for the $VMAKE_VERSION variable. VMAKE only evaluates the first letter of the set variable.

It defines the system default for translating module files that are listed in description files.

set VMAKE_DEFAULT=fast

If translation is carried out with the slow VMAKE version and the $VMAKE_DEFAULT set to fast , only the module files in the description files are translated with the fast method; all other files are translated using the slow method.


$VMAKE_OPTION (SAP Library - SAP DB)

 Entering content frame

Object documentation $VMAKE_OPTION

You use the parameters for the $VMAKE_OPTION environment variable to define the VMAKE mode of operation.

You can override some of the $VMAKE_OPTION parameters by entering options for the VMAKE call.

If you want to specify several parameters, do not enter a blank space between the individual parameters.

set VMAKE_OPTION=DISOhvWMLRg


Parameters for $VMAKE_OPTION (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Parameters for $VMAKE_OPTION

Different parameters can be set for the $VMAKE_OPTION variable.

If you want to specify several parameters, do not enter a blank space between the individual parameters.

Parameters for Searching for Source Code

Parameters for Searching for Object Files

General Parameters for $VMAKE_OPTION

A | Object files are also copied to the first hierarchy level of $VMAKE_PATH if they can be found in an integrated file system.
a | A warning is output instead of an error message for differences regarding upper and lower-case notation of a target in the hierarchy. Discrepancies regarding upper and lower-case letters in the targets within the hierarchy are usually regarded as an error.
b | Normally, C module files are not allowed to use PASCAL include files . If this option is set, the C header files generated from the PASCAL include file are used.
C | c | C Level: The same rules apply as with the Pascal level, with the exception that no PASCAL module files are allowed to exist here. If PASCAL and C Level are used, non-PASCAL files are copied from the PASCAL Level to the C Level during the translation process . C | c, therefore, implies that a C Port is to be carried out. PASCAL files are translated into C files. C requires that source code be managed at this level. If you use c, this is optional. In other words, the source text from this level is used if it exists.
D | Date files are used to flag the date of a module file that was used to create a program.
e | All object files are assigned debug information.
g | global make: If objects are found in the path hierarchy that are younger than the those in the first hierarchy, they are copied to the first hierarchy (standard behavior).
h | If you specify a description file without an extension in the command line, VMAKE attempts to find a description file with a file name that matches the one entered in the command line. The system follows a specific search sequence. With the h option, you can assign description files the following order in accordance with their file extension: the system first searches for a file with this name and the extension shm, then with the extension lnk, then with the extension shr, and finally with the file extension rel.
H | PASCAL include files are not automatically converted to C header files.
I | i | Include Level: Include files are assigned a frame. This must be removed, and the include file must be transferred to the include directory . If neither the i nor the I option is set, include files are not interdependent. If i is specified, include files are subject to the standard dependency rules. If I is specified, include files are generated with size information for PASCAL. Include files are only considered if one of the S | s options is set.
l | local make: Object files whose module files are located in the first path are regarded as being up to date. This means that object files from the path hierarchy are never used.
L | Libraries are like relocatables: The contents of libraries are not analyzed. The date of the library is checked against the timestamp of the object files. The library is rebuilt by linking all of the relevant object files.
M | Modules are independent: Object files are stored in the file system, as they cannot be accessed otherwise. Alternatively, object files from programs that have already been linked can be used.
O | o | Object Level: This level contains object files that can be linked to generate programs. If O is set, these files are used accordingly. If o is specified, program generation ends once all of the object files have been created.
P | p | PASCAL Level: The frame is missing from all module files. PASCAL Level, since most module files are written in PASCAL and, therefore, PASCAL module files exist at this level. Files in different languages are stored here. If P is specified, PASCAL Level files remain in the PASCAL Level directory. P requires that source code be managed at this level; with p, this is optional, in other words, the source code from this level is used if it exists.
R | The shrglob and noshrglob options for description files are ignored.
S | s | Source Level: Many module files have a frame that has to be removed before they are translated. If S is specified, all of the module files have to be present. If s is set, these files are only used if they exist. Dependent files are only processed if the source code is present.
t | timestamp the start of bigger targets If description files are translated, a timestamp is output.
T | A timestamp is always output before a module file is translated.
X | Specify this option if write-protected source code (for example, from CD) is to be accessed.
Z | The system searches for module files, whose name does not contain a coded layer and which ends in .rc, .ico, .def, .mc, .dlg, .idl, .ycc, .lex or .rgs, in the Resource layer.


$VMAKE_OPTION Parameters for Searching for Source Code (SAP Library - SAP DB)

 Entering content frame

Syntax documentation $VMAKE_OPTION Parameters for Searching for Source Code

Different parameters can be set for the $VMAKE_OPTION variable.

If you want to specify several parameters, do not enter a blank space between the individual parameters.

Parameters for Searching for Source Code

(No parameter set) | The first item of source code found is used.
v | The first item of source code found is used. The system outputs a warning if a more recent file is found in the remaining path hierarchy.
V | The most recent source code in the hierarchy is used and, if necessary, copied to the local source area.
vV | The most recent source code in the hierarchy is used and a warning is output.


$VMAKE_OPTION Parameters for Searching for Object Files (SAP Library - SAP DB)

 Entering content frame

Syntax documentation $VMAKE_OPTION Parameters for Searching for Object Files

Different parameters can be set for the $VMAKE_OPTION variable.

If you want to specify several parameters, do not enter a blank space between the individual parameters.

Parameters for Searching for Object Files

(No parameter set) | The first object file found is used.
w | The first object file found is used. The system outputs a warning if a more recent object file is found in the remaining path hierarchy.
W | The most recent object file in the hierarchy is used.
wW | The most recent object file in the hierarchy is used and a warning is output.


$INSTROOT (SAP Library - SAP DB)

 Entering content frame

Object documentation $INSTROOT

This variable contains an absolute path specification within the current file system. This describes where VMAKE is to store linked software components.

VMAKE decides, on the basis of the software component, under which relative path under $INSTROOT the component will be stored.

set INSTROOT=D:\V72


$VMAKE_PATH (SAP Library - SAP DB)

 Entering content frame

Object documentation $VMAKE_PATH

This variable lists paths under which VMAKE can search for files .

The individual path specifications are separated by a comma. The paths can be absolute paths in the file system of the local computer, or of other computers that are integrated in the file system.

If a file system that is not integrated is to be used, the VMAKE Server program is required on the computer with this file system.

The path must then be specified as follows:

<server_name>:<absolute_path>

<server_name> | Name of the other computer
<absolute_path> | Absolute path on the file system of the other computer

If you enter two slashes at the end of a path specification, the system will ignore this path when searching for object files .

set VMAKE_PATH=D:\V72,P26326:F:\Develop//,\\P26208\share\tools


$SHELL (SAP Library - SAP DB)

 Entering content frame

Object documentation $SHELL

Description files can contain operating system commands.

You use this variable to specify that a certain command shell is to be used to process these OS commands.

set SHELL=C:\MyTools\4dos.exe


$TOOLSHELL (SAP Library - SAP DB)

 Entering content frame

Object documentation $TOOLSHELL

This variable defines the shell that executes the scripts used by VMAKE ( VMAKE Tools ).

set TOOLSHELL=D:\Perl\5.00502\bin\MSWin32-x86-object\perl5.00502.exe


$TOOLOPT (SAP Library - SAP DB)

 Entering content frame

Object documentation $TOOLOPT

You can use this variable to transfer additional options to the shell specified in the $TOOLSHELL variable.

set TOOLOPT=-d


$TOOL (SAP Library - SAP DB)

 Entering content frame

Object documentation $TOOL

The relative path containing the scripts and programs used by VMAKE is specified in this variable.

set TOOL=D:\DevTool


$TOOLEXT (SAP Library - SAP DB)

 Entering content frame

Object documentation $TOOLEXT

The file extension of the scripts ( VMAKE Tools ) is defined in this variable.

VMAKE only recognizes the first part of the script file names. VMAKE uses this variable to determine the file extension.

set TOOLEXT=.pl


$DLL_TYPE (SAP Library - SAP DB)

 Entering content frame

Object documentation $DLL_TYPE

The file extension for dynamic libraries is defined in this variable.

This variable is optional.

VMAKE has the following default settings:

Win32 | .dll
UNIX | without file extension


$ARC_TYPE (SAP Library - SAP DB)

 Entering content frame

Object documentation $ARC_TYPE

The file extension for static libraries is defined in this variable.

This variable is optional.

Default settings:

Win32 | .lib
UNIX | .a


$OWN (SAP Library - SAP DB)

 Entering content frame

Object documentation $OWN

The environment variable OWN corresponds to the absolute path for the SAPDB_DEV directory ( General Directory Structure of the SAP DB Development Environment ).

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$WRK (SAP Library - SAP DB)

 Entering content frame

Object documentation $WRK

The environment variable $WRK is used by various description files. It refers to the sys/wrk directory below the SAPDB_DEV directory ( General Directory Structure of the SAP DB Development Environment ).

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$PATH (SAP Library - SAP DB)

 Entering content frame

Object documentation $PATH

The $PATH variable must be adapted to include the following directories:

$DBROOT/bin

$DBROOT/pgm (NT)

$TOOL/Posix

$TOOL/bin

$TOOL/pgm (NT)

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


%INCLUDE% (SAP Library - SAP DB)

 Entering content frame

Object documentation %INCLUDE%

This environment variable only applies to Windows NT.

The compiler uses this environment variable to locate all of the SAPDB-internal include files.

The following entries must be listed here:

%DBROOT%\incl

%TOOL%\incl

%OWN%\sys\wrk\incl

%OWN%\sys\wrk\incl\SAPDB

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$RELVER (SAP Library - SAP DB)

 Entering content frame

Object documentation $RELVER

This environment variable specifies the current software version. It generates the build information in the program components, and is used by the link tools.

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$CORRECTION_LEVEL (SAP Library - SAP DB)

 Entering content frame

Object documentation $CORRECTION_LEVEL

This environment variable specifies the number of the correction level for the build information. This information is also used by the link tools.

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$BUILD_PRAEFIX (SAP Library - SAP DB)

 Entering content frame

Object documentation $BUILD_PRAEFIX

This environment variable specifies the patch level number of the current software version. This information is also used by the link tools.

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$PYTHONPATH (SAP Library - SAP DB)

 Entering content frame

Object documentation $PYTHONPATH

This environment variable must be set so that the Python scripts in the tools can be executed.

It should contain the following entries:

$TOOL\Lib\Python

$INSTROOT/lib

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$PERL5LIB (SAP Library - SAP DB)

 Entering content frame

Object documentation $PERL5LIB

This environment variable must be set so that the Perl scripts in the tools can be executed.

It should contain the following entries:

$INSTROOT/misc

$TOOL/bin

$TOOL/Lib/Perl

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$EDITOR (SAP Library - SAP DB)

 Entering content frame

Object documentation $EDITOR

This environment variable specifies the program that is used to display and edit files using the development environment operating tool iview.pl .

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$DBROOT (SAP Library - SAP DB)

 Entering content frame

Object documentation $DBROOT

This environment variable is an obsolete name for the $INSTROOT variable. As a result, it should be set in the same way as $INSTROOT.

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


$NOQUIET (SAP Library - SAP DB)

 Entering content frame

Object documentation $NOQUIET

If this environment variable is set, every call of the compiler is output during the creation process.


$TOOLVARS (SAP Library - SAP DB)

 Entering content frame

Object documentation $TOOLVARS

The path specification in this environment variable refers to the central initialization file toolvars.pl for most Perl scripts. The default storage location for this file is the $TOOL/bin directory.

A large part of the platform-specific adjustments is made in this Perl file. This includes the definition of the various platform-specific compiler, link, and other programs, as well as the associated options. Certain additional environment variables that are required for the creation process are also initialized in this file.

This environment variable is set by the initialization script initDev_SAPDB(.bat) ( Environment Variables ).


Tools in the SAP DB Development Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Tools in the SAP DB Development Environment

The development tools consist of the following components:

  • Tools for Operating the Development Environment
  • VMAKE , as a software creation tool
  • Various auxiliary programs

The various tools in the SAP DB development environment are essentially Perl scripts. These can be called with various options. You can use the -h option to display a list of the available options.


Tools for Operating the Development Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Tools for Operating the Development Environment

ims.pl; imq.pl; imf.pl

idiff.pl

ils.pl

ips.pl, ipq.pl und ipf.pl

iview.pl

icp.pl


ims.pl; imq.pl; imf.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation ims.pl; imq.pl; imf.pl

These commands are tools for operating the development environment and are used to create SAP DB software components. A distinction is made here between the three VMAKE versions . At least the name of a processing list , a link description , or a module file is expected as a parameter. You can also specify several names as parameters.

Once a defined environment has been initialized, these scripts call the VMAKE program.

All of the available options for calling VMAKE are also available for these scripts and are passed on directly to VMAKE.

Specify the name of the file (and not the complete path) in accordance with the naming conventions for files for all of the file names transferred as parameters.

Example


idiff.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation idiff.pl

This command is a tool for operating the development environment and compares the file specified as a parameter in the local development area ( General Directory Structure ) with an older version of the same file within the development hierarchy.

You can also use the –l option to compare the same files at different levels in the development hierarchy.

Specify the name of the file (and not the complete path) in accordance with the naming conventions for files for all of the file names transferred as parameters.


ils.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation ils.pl

This command is a tool for operating the development environment , and is similar to the commands dir or ls in other operating systems. The module or description files specified as parameters within the development hierarchy are displayed.

Specify the name of the file (and not the complete path) in accordance with the naming conventions for files for all of the file names transferred as parameters.


ips.pl, ipq.pl und ipf.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation ips.pl, ipq.pl and ipf.pl

These commands are tools for operating the development environment , and are used to display both of the VMAKE logs of the translation process .

There are three different commands for the three VMAKE versions . The logs from a creation process started with imf.pl can be displayed with the ipf.pl tool. The file name used with the imf.pl command must be specified as a parameter here:

imf.pl dbmcli

ipf.pl dbmcli


iview.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation iview.pl

This command is a tool for operating the development environment , and is used to display and edit module and decription files .

If the files are located in the src or desc subdirectory below the SAPDB_DEV directory ( General Directory Structure ), they are opened directly and can be modified accordingly.

If the are not located in these subdirectories, the system searches for their first occurrence in the development hierarchy and copies them to the tmp subdirectory below the SAPDB_DEV directory so that they can be displayed.

The files are displayed with the program that is referred to by the environment variable $EDITOR .

iview vcn12.cpp

iview dbmcli.lnk

You can also use the -l option to access all of the versions of a file within the development hierarchy, even though they are also located in the SAPDB_DEV directory.

iview –l1 co.com

Specify the name of the file (and not the complete path) in accordance with the naming conventions for files for all of the file names transferred as parameters.

Changes to the files that are relevant for translation can only be carried out if the files are directly located in the development area. You can copy these files with icp.pl .


icp.pl (SAP Library - SAP DB)

 Entering content frame

Background documentation icp.pl

This command is a tool for operating the development environment , and is used to copy a module - or description file from the development hierarchy to the development area in the SAPDB_DEV directory. As a result, this file is used instead of the file in the development hierarchy the next time a MAKE operation is carried out.

You can use the iview.pl command to display the copied file, an then edit it.

This command can only be used to copy one file. If you specify a second file name as a parameter in addition to the file name, the name of the copied file is changed to the one in the second parameter.

Specify the name of the file (and not the complete path) in accordance with the naming conventions for files for all of the file names transferred as parameters.


VMAKE (SAP Library - SAP DB)

 Entering content frame

Background documentation VMAKE

This document is designed as a reference guide for creating or maintaining programs, libraries, and so on with the VMAKE tool.

The VMAKE tool supports all versions of the SAP DB software.

To develop the SAPDB software, or parts thereof, enter the command for the required VMAKE version .

Various options are provided for modifying the call for the VMAKE tool.


Terms (SAP Library - SAP DB)

 Entering content frame

Background documentation Terms

Files

Layer

Target

Debug Mode


Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Files

When software is created, module files are translated using description files .

The resulting files are called object files .

The <file_name> of a file is preserved across the various phases of the MAKE operation. The file extension <ext> changes.


Module File (SAP Library - SAP DB)

 Entering content frame

Background documentation Module File

Source code comprises individual files. These files are referred to as module files.

Module files can be combined in module groups .

Module files are stored separately from description files in the file system of the OS ( Storage System ).

Module files can be written in any programming language. VMAKE features a complete set of tools for unpacking and translating module files for all of the programming languages supported by SAP DB.


Module File Directory (SAP Library - SAP DB)

 Entering content frame

Background documentation Module File Directory

The module file directory is used to store the module files .

The structure of this directory is identical to that of the object directory ( General Directory Structure of the SAP DB Development Environment ).


Include Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Include Files

An include file is a module file that is included in a different module file.

When the source code of an include file changes, both the file and the file, in which this include file is integrated, must be retranslated ( Translation Process ) as part of the software creation process.

Include files are independent of VMAKE versions .


Include Directory (SAP Library - SAP DB)

 Entering content frame

Background documentation Include Directory

Unlike module files, include files are independent of the called VMAKE version ( VMAKE Call Versions ) and, therefore, are always stored in the same directory.

This directory is called incl and is created by the VMAKE tool ( General Directory Structure ).


Description Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Description Files

Description files contain information on how the software is created, and which module files are used to do so. This information includes:

  • Link descriptions
  • Compilation descriptions
  • Processing lists


Link Descriptions (SAP Library - SAP DB)

 Entering content frame

Background documentation Link Descriptions

Link descriptions specify how the module files are to be linked to form a program.

Essentially, link files consist of a list of references to module files and other description files that are processed sequentially by the system. You can also specify the options that are to be used during the link operation .

The file extension of the link description is used to distinguish between the resulting software components ( Using VMAKE ).

File Extension of Link Description | Type of Software Component Created
lnk | Program
shm | Program that facilitates shared memory access
lib | Static library
dld | Dynamic library
rel | Program that can be linked to other programs (relocatable)
shr | Program that can be linked to other programs (relocatable) and facilitates shared memory access
mac | Other types of object files


Compilation Descriptions (SAP Library - SAP DB)

 Entering content frame

Background documentation Compilation Descriptions

Use

Compilation description specify how module files are to be translated. Essentially, a compilation description contains a list of module files and their interdependencies, as well as translation-specific options . These interdependencies include:

  • Include dependencies ( include file )
  • Dependencies, such as certain auxiliary files that must be located in the same directory as the module file to be translated ( demand=<list> ) during the translation process
  • Logical dependencies – if, for example, the module file X links to a file Z that is created as a by-product of the translation of the module file Y ( extdep=<list> )

Compilation descriptions are created for groups of module files, and not for individual module files. The compilation description has the same name as the layer . Compilation descriptions have the file extension .com

If the layer ak exists in the directory containing the module files (src), the directory with the description files (desc) must contain the compilation description ak.com .

If a layer (subdirectory) under the directory with the module files (src) contains further sublayers, the hierarchy must be recreated up to the second last level in the directory containing the description files (desc). The name of the compilation description is then formed from the last sublayer and the file extension .com

The compilation description for module files in the SAPDB/DBM/Cli layer has the name Cli.com and is located in the directory containing the description files (desc) under SAPDB/DBM.

Compilation descriptions are not processed sequentially. The processing points of a description of this kind are addressed selectively.


Processing Lists (SAP Library - SAP DB)

 Entering content frame

Background documentation Processing Lists

Use

A processing list is a list of description files and module files to be processed, as well as OS commands to be executed. A processing list can also contain other processing lists. In addition, options can be specified.

The entries in a processing list are processed by VMAKE from top to bottom. All of the listed files, as well as any other files listed as links, are first checked down to the lowest level to determine whether they have been changed with respect to a target created previously. Only if this is the case does VMAKE recreate (update) the targets.


Object Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Object Files

Module files are unpacked and translated. The files created as a result are called object files.

These files are usually stored in the directories that correspond to the VMAKE version ( VMAKE Call Versions ), that is, under fast, quick or slow (see General Directory Structure of the SAP DB Development Environment ).

If the noversion option is specified in the compiler description for a module file, the object file is stored directly in the wrk/obj directory.

Object files have the file extension .o


Object Directory (SAP Library - SAP DB)

 Entering content frame

Function documentation Object Directory

The object files are stored in the object directory.

The object directory has the same structure as the source code directory ( General Directory Structure of the SAP DB Development Environment ).


Initialization Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Initialization Files

VMAKE uses the following initialization files:

Langextinfo | Contains the assignments between the module files and the translation tools, based on the file extension or the last character in the file name.
Langinfo | Contains assignments between the programming languages and certain tools for unpacking and translating module files .
EXTRA | Contains assignments between files that do not require translation and their storage location.
DirectoryMapping | This file is used to assign module files to a layer , on the basis of the first part of their file name (directory mapping function).

These files can be modified.

The files are stored in the desc directory ( General Directory Structure of the SAP DB Development Environment ).


Langextinfo (SAP Library - SAP DB)

 Entering content frame

Background documentation Langextinfo

Use

Langextinfo is an initialization file of the VMAKE tool. This file is used to assign file extensions to a programming language. Each programming language is identified by a letter.

VMAKE uses certain default settings for each language.

If you want to change the existing assignments, create a file with the name Langextinfo in the desc directory. You can also assign new letters, programs, and file extensions. In this case, however, you must create an appropriate Langinfo file. All further changes are then made in this file.

If VMAKE finds a Langextinfo file, the information contained in the file overrides the system defaults.

Syntax

<langextinfo_line> = <comment_line> | (<lang_id><comment><token_sep><token>{<token_sep>,<token_sep><token>}<new_line>)

General Rules

<comment> must not contain <token_sep>

Lines can contain the comment character # . The subsequent text in this line is treated as a comment.

System Default in VMAKE

Assigned letter (program) | File extension(s)
x(C++) | cpp, hpp
c(C) | c, h
t(PASCAL) | t
a(Assembler) | s
r(Resources) | rc, ico, def, mc, dlg, idl, ycc, lex, rgs


Langinfo (SAP Library - SAP DB)

 Entering content frame

Background documentation Langinfo

Use

Langinfo is an initialization file of the VMAKE tool. The file is used to assign certain tools for unpacking and translating module files to programming languages. The relevant programming language is specified by a letter ( Langextinfo ).

VMAKE uses certain default settings for each language.

If you want to change the existing assignments, create a file with the name Langinfo in the desc directory. All further changes are then made in this file.

If VMAKE finds a Langinfo file, the information contained in the file overrides the system defaults.

Syntax

<langinfo_line> = <comment_line> | (<lang_id><token_sep><unpack_inc_tool><token_sep><unpack exp tool><tokensep><unpack mod tool><tokensep><extension><tokensep><option prefix><tokensep>
<compiler tool>)

<unpack inc tool> = <token>

<unpack exp tool> = <token>

<unpack mod tool> = <token>

<extension> = „."<token>

<option prefix> = <ext character><letter>

<compiler tool> = <token>

General Rules

Lines can contain the comment character #. The subsequent text in this line is treated as a comment.

The scripts for unpacking a module file use the table entry under extension as the file extension.

System Default in VMAKE

# | last char | unpack include | unpack exports | unpack module | extension | option prefix | compiler |
 | t | mfpinc | mfpexp | mfp | . p | %T | comppc | # PASCAL
 | p | mfpinc | mfpexp | mfp | .p | %P | compp | # PASCAL
 | c | mfcinc | mfcexp | mfc | .c | %C | compc | # C
 | x | mfcinc | mfcexp | mfc | .cpp | %X | compc | # C++
 | a | mfainc | mfaexp | mfa | .s | %A | compa | # Assembler
 | r | mfcinc | mfcexp | mfrc | .rc | %R | comprc | # Resources


Extra (SAP Library - SAP DB)

 Entering content frame

Background documentation Extra

Extra is an initialization file of the VMAKE tool.

This file contains assignments between files that do not require translation and their storage location.

Syntax

<extra_line> = <comment_line> | (<extension><token_sep><layer><token_sep><dest_dir><token_sep><option><new_line>)

# | Extension | Layer | Destination directory | Options
 | .ino | xx | usr/env | unpack=no
 | .mp | px | usr/bin | unpack=no nodot
 | .dm | px | tmp | exec

Explanation:

Module files with the file extension .ino belong to the xx layer . They must be copied to the usr/env directory in $INSTROOT . The module file does not contain any textual frame (option unpack=no ).

Module files with the file extension .mp belong to the px layer. These must be copied to the usr/bin directory (relative to $INSTROOT ). The module file does not contain any textual frame. Once the files have been copied, the extension .mp must be removed (option unpack=no dot ).

Module files with the file extension .dm belong to the px layer. These must be copied to the tmp directory (relative to $INSTROOT ). The module file contains a textual frame that must be removed. Once the frame has been removed, the file is identified as executable ( exec option, only relevant for UNIX).

General Rule

Lines can contain the comment character # . The subsequent text in this line is treated as a comment.


DirectoryMapping (SAP Library - SAP DB)

 Entering content frame

Background documentation DirectoryMapping

Use

DirectoryMapping is an initialization file of the VMAKE tool. This file is stored in the <path>/sys/desc directory.

VMAKE uses the second and third letters of the file name to assign module files to a layer . An alternative method of assigning module files to a layer is to use the DirectoryMapping function. This method also allows you to use longer and more meaningful file names.

File names specified with the DirectoryMapping function consist of two parts, which are linked by an underscore. The first part specifies the layer in short. The second part specifies the name of the module file.

<file_name> = <short_layer>_<module_file>

The short form is mapped to the corresponding layer in the DirectoryMapping file.

Syntax

<extra_line> = <comment_line> | (<short_layer>, <full_layer><new_line>)

General Rules

  1. The <full_layer> expression stands for the layers below <path>/sys/src/SAPDB .
  2. Lines can contain the comment character # . The subsequent text in this line is treated as a comment.
  3. The layer requires a compilation description, in which the structure of the layers, including the second last layer, is specified.

The <path>/sys/src/DirectoryMapping file contains the following entries:

# <short_layer>, <directory>
# Component SQLStudio
StudioTD, SQLStudio/TableDefinition # Table Definition

If the StudioTD_TableDef.cpp and StudioTD_Wrapper.cpp files are to be created, the compilation description TableDefinition.com must be stored under <path>/sys/desc/SAPDB/SQLStudio/ .

VMAKE searches for the StudioTD_TableDef.cpp and StudioTD_Wrapper.cpp files in the <path>/sys/src/SAPDB/SQLStudio/TableDefinition layer.


Files That do not Require Translation (SAP Library - SAP DB)

 Entering content frame

Background documentation Files That do not Require Translation

Certain files contain source code that is already in the required text or binary format. These files do not need to be translated. They should simply be copied to the object directory , but can be manipulated, if necessary, using the mfextra tool ( VMAKE Tools ).

Use the ascii or binary options to prevent these files from being translated by VMAKE.

Alternatively, you can add an entry in the EXTRA initialization file.


Date Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Date Files

A date file is created for every target that is to be generated.

The name of the date file comprises the name of the processed file and the file extension .dat : <file_name>.dat

The timestamp is identical to the timestamp of the corresponding module file or link description .

Use

The date file is used during the MAKE operation to determine whether the local targets correspond to the module files/link descriptions that are currently being used. If the two files do not have the same timestamp, the target is regarded as not up to date and is regenerated.

Storing the Date Files

Date files for include files are stored in the $WRK/dates directory within their layer irrespective of the VMAKE version used in the MAKE operation, since include files are not version specific.

Date files for all other module files are stored in the version-specific $WRK/<version>/dates directory, under the relevant subdirectories for the layer in question.

Date files for link descriptions are stored directly in the version-specific $WRK/<version>/dates directory.


Layer (SAP Library - SAP DB)

 Entering content frame

Background documentation Layer

Layers are logical units that represent subdirectories in the module file directory .

Module files are stored in various layers and subordinate layers. In addition to providing a clearer overview, this enables a logical distinction to be drawn between the individual database areas.


Target (SAP Library - SAP DB)

 Entering content frame

Background documentation Target

Targets are all types of output files that are created during the entire software development process.

These can be individual object files , link descriptions , or output files of files that do not require translation .


Debug Mode (SAP Library - SAP DB)

 Entering content frame

Background documentation Debug Mode

If debug mode is activated, all of the module files with a debug option are compiled so that the resulting object files contain additional debugging information. The relevant module files are copied to the version-specific debug directory $WRK/<version>/debug, from where they can be used for subsequent troubleshooting.

You can use the following methods to set a debug option for module files:

  • -e Option for Calling VMAKE
  • VMAKE_OPTION Parameter e
  • with the option for description files debug|d


File Storage (SAP Library - SAP DB)

 Entering content frame

Background documentation File Storage

The module files and description files are stored in the file system of the OS.

The files required to create a program can be stored at different locations in a file system, in different file systems, and on different computers.

The potential paths are specified in the $VMAKE_PATH environment variable. This variable must be adapted accordingly to be able to access older file versions.

There is a separate directory for description files, and a separate directory for module files.

Each of these directories has at least one subdirectory that reflects the logical hierarchy of the files. Files are only stored at the lowest directory level.

The files can also be stored in a database. As a rule, however, databases do not provide adequate support for search operations, with the result that the files cannot be accessed efficiently.


Naming Conventions for Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Naming Conventions for Files

The names of module files and description files are subject to certain conventions.

Basic Elements

<digit> = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<letter> = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | | u | v | w | x | y | z

<extended letter> = all other printable characters, apart from hyphen and period

<character> = <digit> | <letter> | <extended letter>

<token> = <character>{<character>}

Naming Conventions for Module Files

Naming Conventions for Description Files


Naming Conventions for Module Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Naming Conventions for Module Files

<source_spec> = <qual_source> | <std_source> | <ext_std_source> | <map_source>

<qual_source> = :<ext_layer><source>

<std_source> = <source_id><layer><digit><digit>{<digit>}[{<letter>}<lang_id>][<variant>]

<ext_std_source> = <std_source>[<primary_lang_id>]

<map_source> = <shortform>_<specification>

<source> = <token>[<variant>]<primary_lang_id>

<source_id> = g | h | i | v

<ext_layer> = [<ext_layer>]<character><character>{< character >}/

<shortform> = <letter>{<letter>}

<specification> = <letter>{<letter>}[<variant>][<primary_lang_id>]

<lang_id> = <letter>

<layer> = <letter><letter>{<letter>}

<primary_lang_id> = .<token>

<variant> = -<token>

General Rules

  1. <layer> and <ext_layer> can contain a maximum of 256 characters
  2. <source_spec> can contain a maximum of 512 characters

<qual_source> Þ :Demo/Test/demo.cpp

<std_source> Þ hak33c | vbd23x | vkb00

<ext_std_source> Þ hak33.h | vbd23x.cpp | vkb00.hxx

<map_source> Þ StudioTD_TableDef.hpp | StudioTD_Wrapper.cpp


Naming Conventions for Description Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Naming Conventions for Description Files

<desc_spec> = <qual_desc> | <std_desc>

<qual_desc> = ::[<ext_layer>]<std_desc>

<std_desc> = <character>{<character>}<desc_ext>

<desc_ext> = .(mac | prj | shm | lnk | dld | shr | rel | lib | com)

General Rule

<desc_spec> can contain a maximum of 512 characters

<qual_desc> Þ ::x_demo.lnk | ::Kern/diagnose.lnk

<std_desc> Þ ak1.lib | kernel.shm | ak.com


Using VMAKE (SAP Library - SAP DB)

 Entering content frame

Background documentation Using VMAKE

Use

The procedure for creating SAP DB software with VMAKE is divided into two phases:

  • Translation Process
  • Link Operation

The following software components can be generated:

  • Programs
  • Programs that facilitate shared memory access
  • Static libraries
  • Dynamic libraries
  • Program that can be linked to other programs (relocatable)
  • Programs that can be linked to other programs (relocatable) and facilitate shared memory access


MAKE Operation (SAP Library - SAP DB)

 Entering content frame

Background documentation MAKE Operation

The MAKE operation is divided into a collection phase and a make phase.

The individual steps carried out by VMAKE during the MAKE operation are described in the section entitled Process Flow of the MAKE Operation .

Collection Phase

In the collection phase, the description files of a target are collected and analyzed. The interdependencies between all of the files are collected at the same time. The system does not yet search for the module files in the hierarchy.

If errors occur during this phase, VMAKE terminates without starting the MAKE phase.

MAKE Phase

The MAKE phase marks the actual beginning of the creation process for the SAP DB software. During this phase, the module files are created in the order of their interdependency.

If a module file vak10 is dependent on vak00 ( vak10 inc=vak00 ), vak00 is handled first. vak10 cannot be created until this file has been successfully generated.

If an error occurs while a module file is being created, all the targets that are dependent on this module file will not be created either. This applies across all dependency levels.

If an error occurs while vak00 is being created, vak10 will not be processed, as well as other dependent files:
since vak10 is contained in ak1lib.lib , ak1lib.lib is not linked. Since ak1lib.lib is contained in the kernel.shm kernel, the kernel is also not linked in the result.


Process Flow of the MAKE Operation (SAP Library - SAP DB)

 Entering content frame

Background documentation Process Flow of the MAKE Operation

This graphic is explained in the accompanying text

At the beginning of a MAKE operation , VMAKE uses the date files to determine the targets that have to be recreated. The system then searches for all of the relevant module files in the hierarchy (1) and copies them to the temporary working directory tmp ( General Directory Structure ) (2).

The files are then further processed in this directory with VMAKE tools . These tools are essentially Perl scripts (3). VMAKE selects the appropriate Perl scripts on the basis of the programming language in the module files ( Selecting the Translation Tools ). The Perl scripts are platform specific, and call the respective compilers, translators, and unpackers.

The output files produced as a result ( object files and include files ) are initially also stored in the temporary working directory (4). VMAKE then copies the object files to the respective obj directory and the include files to the incl-directory for the relevant layer (5).

If VMAKE is operating in debug mode , the module files are also copied to the corresponding debug directory.

A date file is stored for every module file that is used to create a target.

The relevant tools also perform the link operations in the temporary directory, based on the applicable link descriptions. The output files are also stored here. Following this, VMAKE copies the targets to the relevant directories (6).

The files located in the temporary working directory are deleted once the targets have been successfully created. If an error occurs while the targets are being created, the files are not deleted in the temporary directory.

VMAKE also logs the entire software creation process.

Defining the MAKE Operation

VMAKE Log s

Translation Process

Link Operation


Defining the MAKE Operation (SAP Library - SAP DB)

 Entering content frame

Background documentation Defining the MAKE Operation

VMAKE Versions

Grammar for the VMAKE Call

VMAKE Tools

Creating Description Files


VMAKE Versions (SAP Library - SAP DB)

 Entering content frame

Background documentation VMAKE Versions

There are three VMAKE versions:

  • fast
  • quick
  • slow

The versions relate to the various trace and check levels in the software created.

You specify the required version when you call VMAKE:

If the VMAKE version in the description files for the module groups is different to the one you specified when you called VMAKE, the call version is overridden by the version specified in the validity range of the description file.


fast VMAKE Version (SAP Library - SAP DB)

 Entering content frame

Background documentation fast VMAKE Version

Syntax

imf.pl

Use

When you call VMAKE as a fast version ( VMAKE versions ), the software created in the result does not carry out any additional internal error checks, and does not log any information other than the standard trace output of the database.


quick VMAKE Version (SAP Library - SAP DB)

 Entering content frame

Background documentation quick VMAKE Version

Syntax

imq.pl

Use

When you call VMAKE as a quick version, the software created as a result does carries out additional internal error checks.


slow VMAKE Version (SAP Library - SAP DB)

 Entering content frame

Background documentation slow VMAKE Version

Syntax

ims.pl

Use

When you call VMAKE as a slow version, the software created as a result carries out additional internal error checks, and logs information in addition to the standard trace output of the database.


Grammar for the VMAKE Call (SAP Library - SAP DB)

 Entering content frame

Background documentation Grammar for the VMAKE Call

The VMAKE call is based on the general grammar for description files , the naming conventions for module files , and the naming conventions for description files .

<usage> = vmake<space>{<vmake_opt_list>}<target>[//<ext_option>]{<space><target><ext_option>}

<target> = <source_spec> | <desc_spec>

<vmake_optlist> = [-<vmake_opt>{<vmake_opt>}] [+e]

<vmake_opt> = b | c | d | D<digit> | F | g | i | I | k | K | l | L | m | M | n | p | r | S | u | U | w | x

General Rules

  1. In <ext_option>, <token_sep> = /
  2. <desc_ext> can be omitted in <desc_spec>

vmake -D4i vzz34x//debug/profile

vmake -D4 -l -p demo.mac

vmake demo

Explanation:

You can specify additional Options for Description Files in the VMAKE call for the translation of module files using VMAKE. Where applicable, these options are combined with the options that are specified in the description files used at the same time. The options specified for description files in the VMAKE call must be separated from <target> with two slashes.

The options for description files are separated from each other with one slash.


Options for Calling VMAKE (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options for Calling VMAKE

Option | Description
D<digit> | Information on internal data and program runs is output. The larger <digit> is, the more information is output.
i | interactive VMAKE is executed interactively (default setting for Windows NT). In UNIX systems, VMAKE creates a new process that assumes all of the tasks. The parent process shows all of the messages from the child process, and waits for termination signals. If you use the i option, a new process is not started, and the standard signal handlers are used.
w | This option corresponds to the default setting for UNIX systems, with the exception that the parent process is terminated by a termination signal without a query. Normally, this signal leads to a query asking you to confirm whether you want to terminate or continue.
b | background This option terminates the parent process once the child process has been successfully generated. Note: the child process is generated once all of the descriptions have been collected. Normally, the first child process message is <date> start of <target>. VMAKE is executed interactively before this message, that is, the standard signal handlers are used.
c | print collection only Once all of the description files have been collected, all of the description information is displayed, and VMAKE is terminated. This can be used to check the description files (or the VMAKE tool).
m | print module list only Once all of the description information has been collected, all of the required module files are output.
x | print commands before execution All of the file system commands executed by VMAKE are first displayed.
n | no execution VMAKE functions as normal, but no file system or OS commands are executed. VMAKE assumes that all of these operations have been successfully carried out.
r | unpack module frames only ('retrieve') Normally, module files are 'freed' from their frame and then translated. This option suppresses translation and linking. The unpacked module files remain in the working directory. No further operations are executed.
L | lint This option analyzes C module files using Lint. No further operations are executed.
S | sizeof Size information for types and variables is extracted from PASCAL module files. No further operations are executed.
d | do not make dependencies Only the targets listed in the command line are created (if they are not up to date). Dependent module files are assumed to be up to date. For test purposes, therefore, you can avoid having to update all of the dependent module files.
u | unconditionally make named targets All named module files are explicitly retranslated and linked. All dependent module files are translated and linked as standard, depending on whether they are up to date. All named description files are explicitly relinked.
U | unconditionally make ALL targets (except includes) All named module files, and files that are dependent on them, are translated and linked (exception: include files).
I | unconditionally make includes too (with -U) When this option is used with the -U option, include files are regenerated.
k | keep temporary files Temporary files created by VMAKE are not deleted. These are unpacked module files, object files, and others.
K | keep temporary files Temporary files created by VMAKE are not deleted. In addition, all scripts are assigned the –k option, with the result that they also do not delete their temporary files.
p | include profiling calls into all targets You use this option to specify profiling for all module files.
M | more information (print manual entry) You use this option to display the vmakman file.
l | local make This option prevents object files from smaller path hierarchies from being used. VMAKE only translates module files that originate from the lowest path hierarchy. This option overrides the $VMAKE_OPTION parameter g.
g | global make Use of the complete path hierarchy $VMAKE_PATH for finding object files is initiated. This option overrides the $VMAKE_OPTION parameter I.
R | require To speed up the creation process, the ? require : <source> option in the description files is not evaluated (default setting in VMAKE). If you use the R option, the ? require : <source> option is taken into account.
F | file list for release You use this option to create a distribution list; any obsolete targets, however, are not updated. All files from the called target that have been assigned the distrib or distribute option for description files are entered in a list. This list is saved in a file in the $INSTROOT/etc directory. The name of the file is the same as the name of the called target. The file is given the extension .lst. The all.lst file is created when you enter imf -F all .
+e | If you have specified software creation in debug mode using the $VMAKE_OPTION parameter, you can deactivate debug mode with the +e option.

Integration

Grammar for the VMAKE Call


VMAKE Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation VMAKE Tools

The tools used by VMAKE are essentially scripts . These can be written in any script or prototyping language. The shell used to execute the scripts is defined in the environment variable $TOOLSHELL .

The VMAKE tools accept both absolute and relative path specifications for module files and description files . The targets are created in the current run directory specified by VMAKE and are then stored in the specified target directory.


Storage Location of the VMAKE Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Storage Location of the VMAKE Tools

VMAKE initially assumes that the VMAKE tools are stored in the $TOOL/bin directory. If this is not the case, VMAKE searches every local <path> along the <path>/sys/tool/bin path.


Scripts for the VMAKE Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Scripts for the VMAKE Tools

Script Name | Description
mfainc [-<token>=<value>] source | Extracts the include code from an Assembler include file and writes it to the file < file_name >.h. Further options define conditional compilation
mfcinc [-<token>=<value>] source | Extracts the include code from a C/C++ include file and writes it to the file <file_name>.h. Further options define conditional compilation
mfpinc [-<token>=<value>] source | Extracts the include file from a C/C++ include file. Extracted CONST definitions are written to the file <file_name>.con; extracted TYPE definitions are written to the file <file_name>.typ. Further options define conditional compilation
mfcexp [-<token>=<value>] source | Writes the exported interface (define section of the text frame) to the file <file_name>.h. Further options define conditional compilation
mfa [-trace=<procedure>] [-check=no] [-<token>=<value>] source [includes] | Extracts the code section of an Assembler module file and writes it to the file <file_name>.s. If include files are required, they must be specified in the correct order. The -trace=... and -check=... options are inserted to ensure compatibility with mfp scripts, and are ignored by the mfa script. Further options define conditional compilation
mfc [-trace=<procedure>] [-check=no] [-<token>=<value>] source [includes] | Extracts the code section of a C/C++ module file and writes it to <file_name>(.c |.cpp). If include files are required, they must be specified in the correct order. If $VMAKE_VERSION is defined as slow , #define DEBUG is used as a prefix for the file name. The -trace=... and -check=... options are inserted to ensure compatibility with mfp scripts, and are ignored by the mfc script. Further options define conditional compilation
mfp [-trace=<procedure>] [-check=no] [-<token>=<value>] source [includes] | Extracts the defined section, use section, and code section of a PASCAL module file and writes them to the file <file_name>.p. If include files are required, they must be specified in the correct order. The -trace=<procedure> option specifies the name of the trace procedure, whose call is inserted at the start of every function and procedure. The -check=no option defines whether the name prefixes of exported procedures are to be checked. Further options define conditional compilation
mfsize [include-list] module | Creates a file <file_name>.siz that contains size information on the types of module file used. If include files are required, they must be specified in the correct order.
mfextra [-<token>=<value>] source destination [includes] | Creates files that do not require translation . Further options define conditional compilation and attributes of the files that do not require translation.
compa [as-flags] source | Translates an Assembler module file. The file <file_name>.o is created.
compc [cc-flags] source | Translates a C/C++ module file. The file <file_name>.o is created.
compp [pc-flags] source | Translates a PASCAL module file. The file <file_name>.o is created.
comppc [pc-flags] source | Translates a PASCAL module file into a C module file.
complint [cc-flags] source | Uses LINT to check a C module file.
archive [ar-flags] library objects | Writes object files to the library.
linkrel [ld-flags] relocatable objects | Writes object files to a relocatable object . The name of the created relocatable object is relocatable.
linkshr [ld-flags] relocatable objects | Writes object files to a relocatable object, the global variables of which must be stored in the shared memory. The name of the created relocatable object is relocatable.
linkdll [ld-flags] dll archive objects | Links object files to a dynamic library dll and generates a static library archive.
linklnk [ld-flags] [-o program] objects | Links a program with the name program.
linkshm [ld-flags] [-o program] objects | Links a program with the name program, the global variables of which must be stored in the shared memory.

VMAKE completes the names of the scripts using the $TOOLEXT variable (if available), which defines the file extension of the scripts. If additional parameters are to be sent to $TOOLSHELL , they must be defined in the environment variable $TOOLOPT .


Selecting the Translation Tools (SAP Library - SAP DB)

 Entering content frame

Background documentation Selecting the Translation Tools

Module files can be written in different programming languages.

Special VMAKE tools are provided for translating PASCAL, C/C++, and Assembler, as well as a tool for translating a group of various description languages, such as IDL, Resource, Yak, Lex, and so on.

Names of the Available Tools

 |  | Assembler | PASCAL | C / C++ | Description Language Group
Phase 1 | Unpack imported interface | mfainc | mfpinc | mfcinc | mfcinc
 | Unpack exported interface | mfaexp | mfpexp | mfcexp | mfcexp
 | Unpack module | mfa | mfp | mfc | mfrc
Phase 2 | Translate | compa | comppc | compc | comprc

Each tool consists of a set of scripts that can be modified in the Langinfo initialization file .

Assignment Between File Extension or Last Character and Translation Tool

VMAKE assigns module files to a specific tool on the basis of the file extension. If the file does not have an extension, it is assigned on the basis of the last character in the file name.

 | Assembler | PASCAL | C / C++ | Description Language Class
File extension | s | p, t | c, h / cpp, hpp | rc, ico, def, mc, dlg, idl, ycc, lex, rgs
Last character | a | p, t or a number | c / x | r

The assignment of the translation tools on the basis of the file extension or last character in the file name can be modified in the Langextinfo initialization file .


Options for VMAKE Tools (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options for VMAKE Tools

The following options are transferred by VMAKE

-language=<lang id>

Abbreviation for the programming language of the source code.

The following options can be transferred by VMAKE

-k | Temporary files are not deleted
-p | Profiling is activated (for at least one module file)
-g | Debug mode is activated (for at least one module file)
-Y | Shared global data, PTOC pointer conversion
-unpack=no | The source code does not contain a frame (mf* scripts only)

Depending on the tool in question, these options are either used or ignored.

The specified options for calling VMAKE and options for description files also apply here.


Creating Description Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Creating Description Files

General Grammar for Description Files

Options for Description Files


General Grammar for Description Files (SAP Library - SAP DB)

 Entering content frame

Background documentation General Grammar for Description Files

<debug_opt> = debug | d

<digit> = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<letter> = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | r | u | v | w | x | y | z

<new_line> = explicit line break

<profile_opt> = profile | p

<sign> = + | -

<tabulator> = tab

<vmake_default> = f | q | s

<vmake_version> = f | q | s

<extended_letter> = all other printable characters

<character> = <digit> | <letter> | <extended_ letter>

<identifier> = <token>

<space> = [<space>] | [<space>]<tabulator>

<token_sep> = {<token_sep>}<space>

<token> = <character>{<character>}

<list> = [<list>,],{<character>}<token_sep>

<ext_list> = [<ext_list>,],[<sign>]{<character>}<token_sep>

<comment> = [<comment><token_sep>]<token>

<compile_option> = <extended_letter><token>

<demand_spec> = demand[{<layer>{<layer>}}]

<dep_list> = (obj | inc | dep | <demand spec>)=(<list> | <ext_list> | EMPTY)

<expr> = <character>{<character>} | (<expr>) | not<space><expr> | ![<space>]<expr> | <expr><space>[(not | !)<space> ]in<space>[[<space>]<expr>{[<space>] ,[<space>]<expr>}[<space>]] | <expr>=[=]<expr> | <expr>!=<expr> | <expr>&&<expr> | <expr>||<expr>

<layer> = <letter><letter>{<letter>}

<mf_option> = <token>[=<value>]

<option> = [<option><token_sep>](<dep_list> | <mf_option> | <compile_option> | <target_option>)

<option_block> = ([f | [q | [s) <option> {<option>} (f] | q] | s])

<ext_option> = <option_block> | <option> | EMPTY

<target_option> = uncond | remake | <debug opt> | binary | ascii | exec | definition | interface | <profile opt> | shrglob | noshrglob | noobjcopy | (<vmake_version>[<vmake_default>]) | -><token> | <ext_target_option> | <ext_target_option_list>

<ext_target_option> = ?<token_sep>(default_layer | default_version | require | -><token> | propagate)<token_sep>(: | ([<character>]))<token_sep><token>

<ext_target_option_list> = ?<token_sep>(output | link_with | link_option | tool_option)<token_sep>(: | ([<character>]))<token_sep><token>{<token_sep>,<token_sep><token>}

<ext_target_option_line> = (<ext_target_option> | <ext_target_option_list>) <new_line>

<value> = <character>{<character>}

<def line> = &define | &undef <identifier> [<value>]<new_line>

<comment_line> = #<comment><new_line>

<block> = <instance_block> | <sub_block>

<instance_block> = (<instance_block_start>{<sub_block>}<instance_block_end>) | EMPTY

<instance_block_start> = (&fast | &quick | &slow) <comment><new_line>

<instance_block_end> = (&endfast | &endquick | &endslow) <comment><new_line>

<sub_block> = {<line>} | <sub_block_start>{<line>}<sub_block_end>

<sub_block_start> = &if <expr>{<space>}<new_line> | &ifdef | &ifndef | &ifvar | &ifnvar) <identifier>{<space>}<new_line>

<sub_block_end> = &endif <comment><new_line> | &else <comment><new_line> | &elif <comment><new_line>

<line> Line

For more details, see Grammar for Link Descriptions , Grammar for Compilation Descriptions , or Grammar for Processing Lists .

General Rules

  1. <token> can contain a maximum of 512 characters
  2. <token> must not contain a <space>
  3. If <instance_block_start> contains the string &xxx , <instance_block_stop> must contain the character string &endxxx .
  4. If the <option_block> expression starts with [x , it must end with x] .
  5. In <mf_option> , <token> must start with <letter> or <character> .


Grammar for Link Descriptions (SAP Library - SAP DB)

 Entering content frame

Background documentation Grammar for Link Descriptions

Link descriptions are based on the general grammar for description files , the naming conventions for module files , and the naming conventions for description files .

<link_description> = {<block>} | EMPTY

<line> = <link_desc_line>

<link_desc_line> = <comment_line> | <link_line> | <def_line> | <ext_target_option_line> | <tool_option_line> | <file> | EMPTY

<tool_option_line> = <extended_letter><token><new_line>

<file> = (/ | $)<token>

<link_line> = [<source_spec>|<desc_spec>]<new_line>

General Rule

In <tool_option_line> , <ext_character> must not begin with / | $ | !


Grammar for Compilation Descriptions (SAP Library - SAP DB)

 Entering content frame

Background documentation Grammar for Compilation Descriptions

Compilation descriptions are based on the general grammar for description files and the naming conventions for module files .

<compile_description> = {<block>} | EMPTY

<line> = <comp_desc_line>

<comp_desc_line> = <comment_line> | <comp_line> | <def_line> | <option_line> | EMPTY

<comp_line> = (<source_spec> | <reg_source>)<token_sep>{<option>}<new_line>

<reg_source> = regex(<regex>) | ([<source_id>]*[<lang_id>][<variant>])

<source_id> = g | h | i | v

<regex> = regular expression (GNU)


Grammar for Processing Lists (SAP Library - SAP DB)

 Entering content frame

Background documentation Grammar for Processing Lists

Processing lists are based on the general grammar for description files , the naming conventions for module files , and the naming conventions for description files .

<macro_description> = {<block>} | EMPTY

<line> = <macro_desc_line>

<macro_desc_line> = <comment_line> | <macro_line> | <def_line> | <ext_target_option_line>

| <command_line> | EMPTY

<command_line> = ![! | ?]<command>

<command> = {<character>}

<macro_line> = [<source_spec>|<desc_spec>]<new_line>

General Rule

In <tool_option_line> , <ext_character> must not begin with / | $ | !


Options for Description Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Options for Description Files

By specifying options in description files, you can influence the translation process and link operation , as well as modify the system default for certain processes.

Some of these options differ depending on the type of description file.

Options for Link Descriptions

Options for Compilation Descriptions

Options for Processing Lists


Options for Link Descriptions (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options for Link Descriptions

The following options are available for link descriptions :

? defaultlayer : <layer>

? defaultlayer :

? defaultversion : <vmake_version>

? defaultversion :

? distribute : <list>

? link with : <list>

? linkoption : <list>

? output : <list>

? propagate : <variable>[=<value>]

? require : <target>

? tooloption : <list>

-><output>

ascii

binary

debug|d

definition

demand

demandŒ <relative_path>

demand=<list>

demandŒ <relative_path> =<list>

dep=<list>

distrib

extdep=<list>

inc=<list>

interface

nobind

nodistrib

noobjcopy

noshrglob

obj=<list>

profile|p

remake

shrglob

uncond


Options for Compilation Descriptions (SAP Library - SAP DB)

 Entering content frame

Syntax documentation Options for Compilation Descriptions

The following options are available for compilation descriptions :

? defaultlayer : <layer>

? defaultlayer :

ascii

binary

debug|d

definition

demand=<list>

demandŒ <relative_path> =<list>

dep=<list>

exec

extdep=<list>

inc=<list>

interface

noobjcopy

noshrglob

noversion

obj=<list>

profile|p

remake

shrglob

uncond


Options for Processing Lists (SAP Library - SAP DB)

 Entering content frame

Background documentation Options for Processing Lists

Options

The following options are available for processing lists :

!! <command>

!? <command>

! <command>

? defaultlayer : <layer>

? defaultlayer :

? defaultversion : <vmake_version>

? defaultversion :

? distribute : <list>

? propagate : <variable>[=<value>]

? require : <target>

ascii

binary

debug|d

distrib

nodistrib

remake

shrglob

uncond


! <command> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ! <command>

You can only use this option in processing lists .

VMAKE processes a processing list from top to bottom. When the tool reaches this option, and if VMAKE has updated targets up to this point, the OS command <command> is executed.

If no targets have been updated, this command is ignored.


!! <command> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation !! <command>

You can only use this option in processing lists .

VMAKE processes a processing list from top to bottom. When the tool reaches this option, the operating system command <command> is executed.

Unlike the ! <command> option, the command is executed irrespective of whether targets have been updated up to this point.


!? <command> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation !? <command>

You can only use this option in processing lists .

VMAKE processes a processing list from top to bottom. When the tool reaches this option, the operating system command <command> is only executed if all of the preceding targets have been successfully updated.


? defaultlayer : <layer> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? defaultlayer : <layer>

You can use this option in processing lists , link descriptions , and compilation descriptions .

If the name of a module file does not follow the naming conventions , and if the system cannot determine the corresponding layer as a result, the layer specified in <layer> is accessed.

This option can be repeated several times in a description file.


? defaultlayer : (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? defaultlayer :

You can use this option in processing lists , link descriptions , and compilation descriptions .

If the name of a module file does not follow the naming conventions , and if the system cannot determine the corresponding layer as a result, the layer specified with the ? defaultlayer : <layer> option is accessed.

Use the ? defaultlayer : option if you want to delete the default value for a layer.


? defaultversion : <vmake_version> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? defaultversion : <vmake_version>

You can use this option in processing lists and link descriptions .

This option defines the VMAKE version to be used to process the following listed files.

To specify a different version subsequently, use the ? defaultversion : <vmake_version> option. This option, therefore, can be used repeatedly in a description file.

To reset VMAKE to the VMAKE version specified in the call, use the ? defaultversion : option.


? defaultversion : (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? defaultversion :

You can use this option in processing lists and link descriptions .

You use this option to delete a VMAKE version that was set with ? defaultversion : <vmake_version> .

The system then uses the VMAKE version specified when VMAKE is called.


? distribute : <list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? distribute : <list>

You can use this option in processing lists and link descriptions .

This option can be used to create distribution lists ( -F option for calling VMAKE ). Enter the list of files to be included in the distribution list in <list> .

Specify the file paths in <list> , relative to the $INSTROOT directory (for example pgm/kernel ) .

We recommend that you use the distrib option, if possible, for this purpose.


? link with : <list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? link with : <list>

You can only use this option in link descriptions .

If a target requires additional libraries, these can be included in the link description with the ? link with : <list> option.


? linkoption : <list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? linkoption : <list>

You can only use this option in link descriptions .

You use this option to transfer the list of options specified in <list> to the tool used for the link operation .


? output : <list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? output : <list>

You can only use this option in link descriptions .

Targets of link descriptions are given the name of the link description and are stored in a path specified by VMAKE.

Changing Names and Paths

If you use the ? output : <list> option, you can change the name and/or path of several output files, or create copies of individual files. To do so, you create a list <list>, in which you assign one or more paths to one or more targets. VMAKE then changes the name and path definition specified for this target by the system.

If you specify a directory in the list or end an entry with a slash, the file retains the name assigned by the system and is copied to the specified directory.

If you want to change the name and/or path for one individual output file, use the
-><output> option.

Output Files for Different Platforms

An output file can have different file extensions on different platforms. In this case, specify the file extension * for the target. By doing so, you can avoid having to define individual output files for each platform.

Dynamic libraries have the file extension dll on Windows NT and so or sl (HP-UX) on UNIX. In this case, the option should read:
? output : $DBROOT/misc/libtest.*


? propagate : <variable>[=<value>] (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? propagate : <variable>[=<value>]

You use this option in processing lists and link descriptions to set an environment variable.

The system deletes this variable once the relevant list or link description has been processed.


? require : <target> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? require : <target>

You can use this option in processing lists and link descriptions . It is only effective with the -R option for calling VMAKE .

You use this option to specify whether a link description requires certain targets to be created.

A tool for forwarding a file to the pre-compiler is to be called in a processing list. In this case, you can use this option to ensure that the pre-compiler is generated first.


? tooloption : <list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ? tooloption : <list>

You can only use this option in link descriptions .

The options in the <list> are forwarded to the tool that is responsible for the link operation .


-><output> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation -><output>

You can use this option in link descriptions and compilation descriptions .

Targets of link descriptions are given the name of the link description and are stored in a path specified by VMAKE.

Use

Changing Names and Paths

If you want to change the name and/or path for one individual output file, use the
-><output> option.

If you use the ? output: <list> option, you can change the name and/or path of several output files, or create copies of individual files. To do so, you create a list <list>, in which you assign one or more paths to one or more targets. VMAKE then changes the name and path definition specified for this target by the system.

If you specify a directory in the list or end an entry with a slash, the file retains the name assigned by the system and is copied to the specified directory.

Output Files for Different Platforms

An output file can have different file extensions on different platforms. In this case, specify the file extension * for the target. By doing so, you can avoid having to define individual output files for each platform.

Dynamic libraries have the file extension dll on Windows NT and so or sl (HP-UX) on UNIX. In this case, the option should read:
->$DBROOT/misc/libtest.*


ascii (SAP Library - SAP DB)

 Entering content frame

Syntax documentation ascii

You can use this option in processing lists , link descriptions , and compilation descriptions .

The option prevents module files from being translated. VMAKE creates the corresponding target by copying the module file only to the object directory . In contrast to the binary option, the file is treated as a text file.

If you want to store the file in a different location, use the -><output> option.


binary (SAP Library - SAP DB)

 Entering content frame

Syntax documentation binary

You can use this option in processing lists , link descriptions , and compilation descriptions .

The option prevents module files from being unpacked and translated. VMAKE creates the corresponding target by copying the module file only to the object directory . In contrast to the ascii option, the file is treated as a binary file.

If you want to store the file in a different location, use the ->output option.


debug|d (SAP Library - SAP DB)

 Entering content frame

Syntax documentation debug|d

You can use this option in processing lists , link descriptions , and compilation descriptions .

Module files are translated in debug mode .


definition (SAP Library - SAP DB)

 Entering content frame

Syntax documentation definition

You can use this option in link descriptions and compilation descriptions .

The definition option identifies a module file as a definition file for dynamic libraries on Windows NT. Semantically speaking, this option has the same effect as a combination of the binary and demand options.

When this option is assigned to a module file, the file is copied as a binary file to the current working directory tmp before the link operation takes place.


demand (SAP Library - SAP DB)

 Entering content frame

Syntax documentation demand

You can only use this option in link descriptions .

An object file is copied to the tmp directory before the link operation takes place.

If you assign this option to a module file , the resulting object file is requested for the link operation; in other words, it is copied to the working directory specified by VMAKE. Expression of physical dependency.


demand{<relative path>} (SAP Library - SAP DB)

 Entering content frame

Syntax documentation demand{<relative path>}

You can only use this option in link descriptions .

The object file of the identified module file is requested in a specific path for the link operation ; in other words, it is copied to the specified path relative to the working directory. Expression of physical dependency.


demand=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation demand=<list>

You can use this option in link descriptions and compilation descriptions .

The object files (see also "binary") of the listed files are requested when translation is carried out; in other words, they are copied to the relevant working directory. Expression of physical dependency.


demand{<relative path>}=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation demand{<relative path>}=<list>

You can use this option in link descriptions and compilation descriptions .

The object files (see also "binary") of the listed files are requested to a specific path when translation is carried out; in other words, they are copied to the path relative to the working directory. Expression of physical dependency.


dep=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation dep=<list>

You can use this option in link descriptions and compilation descriptions .

Lists the module files on which the specified module file is dependent, that is,

vco01.idl dep=vco03.idl


distrib (SAP Library - SAP DB)

 Entering content frame

Syntax documentation distrib

You can use this option in processing lists and link descriptions .

This option is required to create distribution lists ( -F option for Calling VMAKE ). The files resulting from the target listed directly above this option are included in the distribution list, provided that they are located in the $INSTROOT directory.


exec (SAP Library - SAP DB)

 Entering content frame

Syntax documentation exec

You can only use this option in compilation descriptions . It is only evaluated on UNIX and in conjunction with the ascii or binary options.

When you specify this option, the corresponding target is assigned the execute access authorization.


extdep=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation extdep=<list>

You can use this option in link descriptions and compilation descriptions .

You use this option to define a logical dependency between targets and/or files.

Translating module file X results in the by-product Y. You can use this option to specify that X should be retranslated as soon as Y no longer exists.


inc=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation inc=<list>

You can use this option in link descriptions and compilation descriptions . You list include files that are used by the module file.

The files in <list> must be identifiable as include files.

Files not identifiable as an include file by the extension .h or 00 , or by the letter h as the first letter in the file name, can be identified as such by appending an (i) .

inc=vma18(i)


interface (SAP Library - SAP DB)

 Entering content frame

Syntax documentation interface

You can use this option in link descriptions and compilation descriptions .

By specifying this option, you can ensure that a module file cannot be updated once it has been translated (for example, a defined interface). For this purpose, a file with the extension .i is created on the computer, on which module files with this option are translated.

This module file can only be translated again when VMAKE no longer finds a file of this name with the extension .i in the path hierarchy ( VMAKE_PATH ).


nobind (SAP Library - SAP DB)

 Entering content frame

Syntax documentation nobind

You can only use this option in link descriptions .

The target that has been assigned this option is created but not linked during the link operation .


nodistrib (SAP Library - SAP DB)

 Entering content frame

Syntax documentation nodistrib

You can use this option in processing lists and link descriptions .

This option is specified after the Target nodistrib or directly after the output file in brackets (nodistrib). In this way, you can exclude individual components or files, that would usually be created during the make run, from the delivery list.


noobjcopy (SAP Library - SAP DB)

 Entering content frame

Syntax documentation noobjcopy

You can use this option in link descriptions and compilation descriptions .

Object files that result from module files with this option are not copied. You use this option, for example, if the object contains information that is computer specific or unique across all departments.


noshrglob (SAP Library - SAP DB)

 Entering content frame

Syntax documentation noshrglob

You can use this option in link descriptions and compilation descriptions .

By specifying this option, you explicitly suppress the calculation of size specifications for global variables in the source code. These size specifications are required to use the shared memory.


noversion (SAP Library - SAP DB)

 Entering content frame

Syntax documentation noversion

You can use this option in compilation descriptions .

If you want to create modules used by the header files in such a way that they are version-independent ( VMAKE Versions ), you must use noversion for these modules. The object files and the date files are then copied directly under the $WRK directory in the obj and date directories. In this way, these files are only created once for all versions (fast, quick, slow).


obj=<list> (SAP Library - SAP DB)

 Entering content frame

Syntax documentation obj=<list>

You can use this option in link descriptions and compilation descriptions .

Normally, the translation process with VMAKE generates exactly one object file . The name of this file comprises the name of the module file and the file extension .o .
You use this option if object files other than those that are normally created are generated. <list> can be empty if no object file is created.


profile|p (SAP Library - SAP DB)

 Entering content frame

Syntax documentation profile|p

You can use this option in link descriptions and compilation descriptions .

You can use this option to insert source code for measuring performance (profiling) in a module file.


remake (SAP Library - SAP DB)

 Entering content frame

Syntax documentation remake

You can use this option in processing lists , link descriptions , and compilation descriptions .

When object files are no longer up to date and the target is to be recreated, you can use this option to force a retranslation of the corresponding module files.


shrglob (SAP Library - SAP DB)

 Entering content frame

Syntax documentation shrglob

You can use this option in processing lists , link descriptions , and compilation descriptions .

With this option, you specify that a file is to be created containing the size specifications for the global variables used in the source code. These size specifications are required to use the shared memory.


uncond (SAP Library - SAP DB)

 Entering content frame

Syntax documentation uncond

You can use this option in processing lists , link descriptions , and compilation descriptions .

You use this option if a module file is to be retranslated with every make operation.


VMAKE Logs (SAP Library - SAP DB)

 Entering content frame

Background documentation VMAKE Logs

The entire MAKE operation is logged by VMAKE. In doing so, VMAKE generates two output logs and stores them in the prot directory ( General Directory Structure ).

These logs are named after the file name specified as a parameter when the required VMAKE version was called. The files have the extension .p0 or .x0.

File extension | Log
.p0 | Normal log; corresponds to the screen outputs during the creation process
.x0 | Contains detailed information on the individual files as well as the options used to call the VMAKE tools

When these logs are created, older logs with the same name are renamed (the last digit is incremented by 1). A log history comprising up to 10 logs ( .p0 - .p9 ) is, therefore, possible.

You can display the current logs in the editor ( $EDITOR ) using the development environment tool ipf.pl .


Translation Process (SAP Library - SAP DB)

 Entering content frame

Background documentation Translation Process

The translation process is divided into two phases:

Unpacking the Module Files

Translating the Module Files


Unpacking the Module Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Unpacking the Module Files

VMAKE uses the options in the compilation descriptions to determine where to unpack the module files . The following additional steps can be carried out:

The parts of the frame that are not relevant for translation are removed

Conditional compilation


Removing Frame Parts that are not Relevant for Translation (SAP Library - SAP DB)

 Entering content frame

Background documentation Removing Frame Parts that are not Relevant for Translation

Module files that have to be unpacked have a text frame that contains the following information:

  • Name of the module
  • Module specification
  • Author, version, release
  • Exported interface
  • Imported interface
  • Source code
  • Control characters

Since some of the text frame does not have to be translated, those parts of the frame that are not relevant for translation are removed when the file is unpacked.


Conditional Compilation (SAP Library - SAP DB)

 Entering content frame

Background documentation Conditional Compilation

VMAKE hides those parts of the source code that are not required under the current conditions, such as unnecessary network connections (UNIX or NT).

The system copies the include files that are to be used to the start of the module file that is awaiting translation.


Translating the Module Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Translating the Module Files

VMAKE translates the module files in the temporary tmp directory.

The system stores the resulting object files in an object directory and deletes the files from the temporary directory.


Link Operation (SAP Library - SAP DB)

 Entering content frame

Background documentation Link Operation

Object files are linked to form a software component in the tmp directory. VMAKE then stores this component in a predefined (see below) directory, or in a target directory specified in the link description. The component is then deleted from the tmp directory.

For the link operation, VMAKE is equipped with various tools ( VMAKE tools ) for each type of object file that can result from the translation process . VMAKE uses the file extension of the description file to decide which tool to use to link the respective object files.

The tool takes the object files and the relevant options to be used from the link description .

Software Component to be Created | Link Script | Target Directory
Program | linklnk | $DBROOT/pgm
Program that facilitates shared memory access | linkshm | $DBROOT/pgm
Static library | archive | $WRK/fast/obj or $WRK/quick/obj or $WRK/slow/obj
Dynamic library | linkdll | $DBROOT/lib(32 bit) $DBROOT/lib/lib64 (64 bit)
Program that can be linked to other programs | linkrel | $WRK/fast/obj or $WRK/quick/obj or $WRK/slow/obj
Program that can be linked to other programs and facilitates shared memory access | linkshr | $WRK/fast/obj or $WRK/quick/obj or $WRK/slow/obj


Working with the SAP DB Development Environment: Examples (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Working with the SAP DB Development Environment: Examples

Operating the Development Environment

Creating DBMCLI with the SAP DB Development Environment


Operating the Development Environment (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Operating the Development Environment

The operation of the development environment can be explained using an example ( objective ).

Process Flow

Explanation of the Process Flow

Logs

Further Options

Further Information on Dependencies

Comparison Between the SAP DB VMAKE Program and a Conventional Make Program


Objective (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Objective

  • The file sys/src/SAPDB/HelloWorld.c is to be translated.
  • The include file sys/src/SAPDB/HelloWorld.h is required for this purpose.
  • The result is linked to an executable program:
    usr/pgm/hello (or usr\pgm\hello.exe on Windows NT).


Process Flow (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Process Flow

imf.pl hello.lnk

Build: 40283

vmake 9.8.5 28-11-2000

VMAKE_PATH=d:\V73\develop,d:\SAPSRC

17-01-01 13:33:46 start of collection phase

17-01-01 13:33:54 end of collection phase

17-01-01 13:33:54 start of hello.lnk fast

HelloWorld.h

HelloWorld.c fast

hello.lnk fast

s100buildnumber_PID854.c

17-01-01 13:33:55 end of hello.lnk fast


Explanation of the Process Flow (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Explanation of the Process Flow

First, all of the required files are determined:

The description file sys/desc/hello.lnk is recognized as the description of an executable program from the file extension .lnk. This description contains only one file:

:SAPDB/HelloWorld.c

The colon stands for the directory with the module files sys/src.

The system recognizes from the file extension .c that the module file sys/src/SAPDB/HelloWorld.c is a module file that has to be translated with the C compiler. The include files required by this module file are listed in the description file sys/desc/SAPDB.com:

HelloWorld.c inc=:SAPDB/HelloWorld.h

This line can contain further compiler options.

The include file sys/src/SAPDB/HelloWorld.h does not require any further files. Otherwise, these dependencies would also have to be entered in SAPDB.com.

Once the required files have been determined, each of these files is updated:

  • Include files

HelloWorld.h

HelloWorld.c fast

hello.lnk fast

These files are copied from the development area ( General Directory Structure ) to a suitable subdirectory sys/wrk/incl, in this case, to sys/wrk/inl/SAPDB/HelloWorld.h.

File names in #include statements, therefore, must always be specified relative to sys/wrk/incl.

  • C sources

HelloWorld.h

HelloWorld.c fast

hello.lnk fast

These are converted to object files using the C compiler.

Object files can be created in three different versions ( VMAKE versions ):

* fast: with optimization

* quick: with assertions

* slow: with assertions and trace outputs

In this case, the file created is written to sys/wrk/fast/obj/SAPDB/HelloWorld.o.

Object files are also assigned the file extension .o on Windows NT(tm).

The source file is copied to the sys/wrk/fast/tmp directory for translation . All of the intermediate results (this is particularly relevant for PASCAL sources) are created in this directory, and can be viewed in the event of an error.

  • Executable programs

HelloWorld.h

HelloWorld.c fast

hello.lnk fast

These are linked and copied to usr/pgm.

On UNIX systems, usr/pgm/hello.f is created and a link to it is entered in the file system, under usr/pgm/hello.

On Windows NT, the file usr\pgm\hello.exe.f is created and copied to usr\pgm\hello.exe.


Logs (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Logs

Using the ipf.pl hello.lnk command, you can display two VMAKE logs .

hello.lnk.p0 is a copy of the information displayed on the screen.

hello.lnk.x0 lists all of the relevant timestamps, as well as the actions that were carried out.

...

HelloWorld.c:

17-01-01 18:27:05 dependencies (d:\V73\develop/sys/wrk/incl/SAPDB/HelloWorld.h)

17-01-01 12:29:20 d:\V73\develop/sys/src/SAPDB/HelloWorld.c

17-01-01 12:29:20 d:\V73\develop/sys/wrk/fast/dates/SAPDB/HelloWorld.c.dat

17-01-01 18:27:07 d:\V73\develop/sys/wrk/fast/obj/SAPDB/HelloWorld.o

unconditional HelloWorld.c

rm d:\V73\develop/sys/wrk/fast/obj/SAPDB/HelloWorld.o

HelloWorld.c fast debug

D:\SAPDevelop\Devtool\Perl\bin\perl.exe D:\SAPDevelop\Devtool/bin/mfc.pl \

-f \

-debug=1 \

-language=c \

-unpack=no \

d:\V73\develop/sys/src/SAPDB/HelloWorld.c \

d:\V73\develop/sys/wrk/incl/SAPDB/HelloWorld.h

touch HelloWorld.c

D:\SAPDevelop\Devtool\Perl\bin\perl.exe D:\SAPDevelop\Devtool/bin/compc.pl \

-g \

-language=c \

HelloWorld.c

HelloWorld.c

touch HelloWorld.o

mv HelloWorld.o d:\V73\develop/sys/wrk/fast/obj/SAPDB/HelloWorld.o

touch d:\V73\develop/sys/wrk/fast/dates/SAPDB/HelloWorld.c.dat (from HelloWorld.c)

17-01-01 06:30:53 PM d:\V73\develop/sys/wrk/fast/obj/SAPDB/HelloWorld.o

...

If you want to find out which options were used to call the compilers or linkers, set the environment variable NOQUIET .

UNIX: NOQUIET=1; export NOQUIET

Windows NT: set NOQUIET=1

imf -u :SAPDB/HelloWorld.c

HelloWorld.c fast

cl -DREL30 -DWIN32 -DI386 -DSAG -Id:\V73\develop\sys\wrk/incl/SAPDB -DDU

MP_ENABLED -D_WIN32 -G6 -D_X86_=1 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nol

ogo -Gy -W2 -MT -DFAST=FAST -Ox -ID:/SAPDevelop/Devtool/incl -FoHelloWor

ld.o -c HelloWorld.c


Further Options (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Further Options

Forced Translation

Working with Debug Information


Forced Translation (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Forced Translation

  • -u option

Creates the specified target as a new target. A new link is created to an executable program.

imf.pl -u hello.lnk

hello.lnk fast

A module file is retranslated.

imf.pl -u :SAPDB/HelloWorld.c

HelloWorld.c fast

  • -U option

Recreates the specified target and all of the necessary module files .

imf.pl -U hello.lnk

HelloWorld.c fast

hello.lnk fast

  • -U –I option

Recreates the specified target, all of the necessary modules, and all of the required include files .

imf.pl -U -I hello.lnk

HelloWorld.h

HelloWorld.c fast

hello.lnk fast


Working with Debug Information (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Working with Debug Information

The -e option instructs VMAKE to generate all targets with debug information ( Debug Mode ).

imf.pl -U -e hello.lnk

HelloWorld.c fast debug

hello.lnk fast debug

usr/pgm/hello can then be started in the debugger. The source files are copied to sys/wrk/fast/debug after the translation process . This is particularly important for PASCAL module files , since these can only be debugged using the generated C file, and not in the source code itself.


Further Information on Dependencies (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Further Information on Dependencies

Displaying the New Targets to be Created

Displaying the Module and Description Files Used

Displaying the Module and Description Files Used, and their Dependencies


Displaying the New Targets to be Generated (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Displaying the New Targets to be Generated

imf.pl -u -n hello.lnk

vmake 9.8.5 28-11-2000

VMAKE_PATH=d:\V73\develop,d:\SAPSRC

17-01-01 04:50:40 PM start of collection phase

17-01-01 04:50:48 PM end of collection phase

17-01-01 04:50:48 PM start of hello.lnk fast

HelloWorld.c fast

hello.lnk fast

17-01-01 04:50:48 PM end of hello.lnk fast

statistics:

macros: 0

programs: 1

dynlinklibs: 0

relocs: 0

libraries: 0

modules: 1

includes: 1

files: 0

commands: 0

extras: 0


Displaying the Module and Description Files Used (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Displaying the Module and Description Files Used

imf.pl -m hello.lnk

desc/Langextinfo

desc/SAPDB.com

desc/hello.lnk

src/SAPDB/HelloWorld.h

src/SAPDB/HelloWorld.c


Displaying the Module and Description Files Used, and Their Depe (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Displaying the Module and Description Files Used, and Their Dependencies

imf.pl -C hello.lnk

program

name 'hello.lnk'

type TT_PGM

version 'f'

language ' '

layer ''

level_i 2

level_s 2

level_p 0

level_c 0

level_o 2

shrglob 0

debug 0

profile 0

uncond 0

forcemake 0

binary 0

ascii 0

definition 0

noobject 0

noobjcopy 0

deptype 0

nodebug 0

file

descriptions

options

dependencies

'HelloWorld.c' 'f'

demands

external dependencies

callers

...


Comparison Between SAP DB VMAKE and a Conventional Make Program (SAP Library - SAP DB)

 Entering content frame

This graphic is explained in the accompanying text Comparison Between SAP DB VMAKE and a Conventional Make Program

To those who are familiar with the traditional UNIX make or Microsoft nmake programs, some of the features of VMAKE might seem a little surprising.

  • Since all of the include files are copied to sys/wrk/incl and all of the source files are copied to a temporary directory before translation, file names in the error messages output by the compiler never point to the actual source file.
  • The program always attempts to generate as much as possible, and does not stop after the first error. This is equivalent to the -k option in make.
  • Each object file has a date file (for example, sys/wrk/fast/dates/SAPDB/HelloWorld.c.dat). An new object file is created:
      • If the existing object file is older than the source file (as in make)
      • If the timestamp of the date file differs from that of the source file.


Creating DBMCLI with the SAP DB Development Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Creating DBMCLI with the SAP DB Development Environment

Database Manager CLI

The Database Manager CLI (Database Manager Command Line Interface, DBMCLI) communicates with the DBM server and can, therefore, be used to administrate an SAP DB instance. The behavior of the Database Manager CLI depends on the call parameters and user entries. For more information about the Database Manager CLI, see the Database Manager CLI documentation.

Database Manager CLI tasks:

  • The Database Manager CLI establishes the connection to the DBM server, and transfers one or more commands to it.
  • The Database Manager CLI accepts and outputs the DBM server response(s).
  • When the Database Manager CLI has been terminated, the connection to the DBM server is closed.

See also:

Structure of the Database Manager CLI

Creating the Database Manager CLI

  1. Follow the instructions in Creating the Database Manager CLI .
  2. Perform a function check .


Structure of the Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

Background documentation Structure of the Database Manager CLI

The Database Manager CLI consists of the following components:

  • Main Components
  • Communication Components
  • DBM Server

Main Components

Tasks of the main components:

  • Accept and evaluate the call parameters and user entries.
  • Transfer the dbm commands to the communication components.
  • Receive the DBM server responses from the communication components.
  • Evaluate and output the DBM server responses.

Communication Components

Tasks of the communication components:

  • Communication with the local DBM server.
  • Communication with a DBM server on a remote host.

The communication components are part of the SAP DB runtime environment (RTE).

DBM Server

A DBM server is integrated in the Database Manager CLI.

If the user requires, this integrated DBM server can be used. In this case, the components required to connect to a separate DBM server are not used.


Creating the Database Manager CLI (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Creating the Database Manager CLI

The Database Manager CLI is created in the SAP DB development environment by processing information from a link description . This link description is a file of the lnk file type, and is called dbmcli.lnk ( $OWN /sys/desc/dbmcli.lnk, see also General Directory Structure of the SAP DB Development Environment ).

Processing this link description leads to the creation of an executable program. The file dbmcli.lnk also defines where the executable program is stored:

  • Windows NT/Windows 2000: The executable program is stored in directory $OWN\usr\pgm.
  • UNIX: The line -> $INSTROOT /bin/dbmcli is inserted in the link description file dbmcli.lnk. As a result, the executable program is stored in the directory $OWN/usr/bin.

Procedure

Enter the following command:

imf dbmcli

For information about the command imf, see ims.pl; imq.pl; imf.pl .

This command instructs the development environment to process the link description dbmcli.lnk .

The link description file does not have to be specified with its type (lnk), since its name is unique. The development environment automatically determines the type of the link description file, and, therefore, the type of processing.

Result

The DBMCLI (Database Manager CLI) software component is created:

  • UNIX: $OWN/usr/bin/dbmcli
  • Windows NT / Windows 2000: $OWN\usr\pgm\dbmcli.exe

Perform a function check .

Integration

Creating DBMCLI with the SAP DB Development Environment


Link Description dbmcli.lnk (SAP Library - SAP DB)

 Entering content frame

Background documentation Link Description dbmcli.lnk

The following extract from the link description dbmcli.lnk contains the main commands required for Creating the Database Manager CLI . Special commands and switches, which may be needed for the link operation on the individual platforms, have been omitted from this example.

To create the Database Manager CLI, you must always use the complete link description file dbmcli.lnk in the source directory (see General Directory Structure of the SAP DB Development Environment ).

&if $OS in [ WIN32, OS2 ]
:Resource/ dbmcli.rc remake
&endif

vcn12.cpp
vcn13.cpp
vcn14.c

cservlib

splib
eoxlib

&if $OS in [ WIN32, OS2 ]
 sqlusr
&else

enalib
enblib

&endif

Further Information

Explanation of the Link Description dbmcli.lnk

Components of DBMCLI


Explanation of the Link Description dbmcli.lnk (SAP Library - SAP DB)

 Entering content frame

Background documentation Explanation of the Link Description dbmcli.lnk

The link description dbmcli.lnk contains references to module files and link descriptions .

  • References to module files cause these module files to be translated. The translation tools are assigned on the basis of the file extension of the module files.
    Module files in this example link description:
    dbmcli.rc, vcn12.cpp, vcn13.cpp, vcn14.c
  • References to link descriptions cause these descriptions to be processed in accordance with their description type.
    Link descriptions in this example:
    cservlib, splib, eoxlib, sqlusr, enalib, enblib

You can find explanations of the module files and link descriptions in the section Components of DBMCLI .


Components of DBMCLI (SAP Library - SAP DB)

 Entering content frame

Background documentation Components of DBMCLI

The Database Manager CLI consists of the following components:

  • Module file dbmcli.rc
  • Module file vcn12.cpp
  • Module file vcn13.cpp
  • Module file vcn14.c
  • Link description cservlib
  • Link description splib
  • Link description eoxlib
  • Link description sqlusr
  • Link description enalib
  • Link description enblib

Other Dependencies

Integration

Link description dbmcli.lnk


dbmcli.rc (SAP Library - SAP DB)

 Entering content frame

Background documentation dbmcli.rc

The module file dbmcli.rc in the link description dbmcli.lnk is only relevant under Windows NT/Windows 2000. For this reason, the module is encapsulated in a condition in the link description file dbmcli.lnk.

The module file dbmcli.rc is a resource file and is stored in the subdirectory $OWN \sys\src\Resource ( General Directory Structure of the SAP DB Development Environment ). If the module file dbmcli.rc is specified in the link description file dbmcli.lnk, the Resource directory must also be specified explicitly:

:Resource/dbmcli.rc

The module file dbmcli.rc contains source code that is specific to Windows NT/Windows 2000. When this file is specified in the link description file, the relevant resources are integrated in the Database Manager CLI.

Integration

Components of DBMCLI


vcn12.cpp, vcn13.cpp, vcn14.c (SAP Library - SAP DB)

 Entering content frame

Background documentation vcn12.cpp, vcn13.cpp, vcn14.c

The module files vcn12.cpp, vcn13.cpp, and vcn14.c from the link description dbmcli.lnk are stored in the directory $OWN /sys/src/cn. This directory name is determined implicitly from the module file name.

These module files are the main components (see Structure of the Database Manager CLI )of the Database Manager CLI, and contain C or C++ source codes.

  • The main function is stored in module file vcn12.cpp.
  • The module file vcn13.cpp contains certain functions required for file access and character set conversion.
  • The module file vcn14.c is used to connect main components with communication components.

In the module files vcn12.cpp, vcn13.cpp and vcn14.c, #include instructions are used to refer to include files .

The dependency of a module file on an include file is described in the compilation description .

Integration

Components of DBMCLI


Compilation Description (SAP Library - SAP DB)

 Entering content frame

Background documentation Compilation Description

In the module files vcn12.cpp, vcn13.cpp, and vcn14.c of the link description dbmcli.lnk , #include instructions are used to refer to include files.

The dependency of a module file on an include file is described in the compilation description . The compilation description appropriate to the module file is determined and evaluated implicitly using the directory in which the module file to be translated is stored.

In addition to the dependency of a module file on include files, the compilation description specifies further properties of the module files that control how they are translated by the development environment.

Further Information

Include Files of the module files vcn12.cpp, vcn13.cpp, and vcn14.c


Include Files (SAP Library - SAP DB)

 Entering content frame

Background documentation Include Files

The dependencies of a module file on include files is explained in the following example of a module file of the link description dbmcli.lnk .

The dependencies for the module file vcn12.cpp in the directory $OWN /sys/src/cn are contained in compilation description $OWN/sys/desc/cn.com. These are described by the following lines in the compilation description:

vcn12.cpp inc=gsp09.h,heo02.h,hcn13.h,hcn14.h,hcn90.h,...

This example only contains the keyword inc. The keyword inc refers to the required include files.

The include files listed after the keyword inc are created by the development environment in include directory $OWN/wrk/incl before the module file is translated. In doing so, the development environment processes the include files according to their file type.

Only type h include files are shown in the example above. Type h include files are copied from the relevant subdirectory under $OWN/sys/src to a subdirectory of the include directory. The name of this subdirectory is determined implicitly by the development environment from the name of the include file.


cservlib (SAP Library - SAP DB)

 Entering content frame

Background documentation cservlib

The link description cservlib ( $OWN /sys/desc/cservlib.lib) is of the type lib. The link description type lib generates a static library.

A lib type link description consists of several module files that are grouped after translation to form the appropriate library. The dependencies and properties of the individual module files are stored in the directory-specific compilation descriptions .

If cservlib is entered in link description dbmcli.lnk , the cservlib library is integrated in the Database Manager CLI.

The cservlib library contains the functionality of the DBM server integrated in the Database Manager CLI (see Structure of the Database Manager CLI ).

Integration

Components of DBMCLI


splib (SAP Library - SAP DB)

 Entering content frame

Background documentation splib

The link description splib ( $OWN /sys/desc/splib.lib) in the link description dbmcli.lnk is of the type lib.

The splib library contains modules with functions that can be used generally.

Integration

Components of DBMCLI


eoxlib (SAP Library - SAP DB)

 Entering content frame

Background documentation eoxlib

The link description eoxlib ( $OWN /sys/desc/eoxlib.lib) in the link description dbmcli.lnk is of the type lib.

The library eoxlib contains communication components of the SAP DB runtime environment (see Structure of the Database Manager CLI ).

Integration

Components of DBMCLI


sqlusr, enalib, enblib (SAP Library - SAP DB)

 Entering content frame

Background documentation sqlusr, enalib, enblib

The link descriptions sqlusr, enalib, enblib ( $OWN /sys/desc/sqlusr.lib, $OWN/sys/desc/enalib.lib, $OWN/sys/desc/enblib.lib) are of the type lib.

The libraries sqlusr, enalib, enblib contain communication components of the SAP DB runtime environment (see Structure of the Database Manager CLI ). Since the SAP DB runtime environment is platform specific, different libraries are used on Windows NT/Windows 2000 and UNIX. For this reason, the link description file is encapsulated in a condition in the link description dbmcli.lnk .

Integration

Components of DBMCLI


Further Dependencies (SAP Library - SAP DB)

 Entering content frame

Background documentation Other Dependencies

If you are using Windows NT or Windows 2000, note that the Database Manager CLI requires a dynamic library. This library must be created explicitly.

To do so, enter the following command:

imf sqltcp

For information about the command imf, see ims.pl; imq.pl; imf.pl .

Integration

Components of DBMCLI


Function Check (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Function Check

You can check the function of the Database Manager CLI by executing a dbm command.

Prerequisites

Creating the Database Manager CLI

Procedure

  1. Check whether you are actually accessing the software component you have just created, the Database Manager CLI ( $OWN /usr/bin/dbmcli, Windows NT/Windows 2000: $OWN\usr\pgm\dbmcli.exe).
  2. Enter the dbm command for displaying the Database Manager version:

dbmcli [-n <server_node>] -d <database_name> -u <dbm_userid>,<dbm_password> dbm_version

dbmcli -d TST -u dbm,dbm dbm_version

You can find more information on the various dbm commands in the documentation
Database Manager CLI.

Result

The output should roughly be as follows:

OK

VERSION = 7.2.4

BUILD = DBMServer 7.2.4 Build 009-000-220-192

OS = UNIX

INSTROOT = /usr/sapdb-srv

LOGON = False

CODE = ASCII

SWAP = full


Source Code for Tools (SAP Library - SAP DB)

 Entering content frame

Component documentation Source Code for Tools

The SAP DB tools Database Manager GUI and SQL Studio were developed using Microsoft Visual Basic 6.0.

This document describes how you install the source code for each of the tools and for the development environment VBMAKE and then create the software for it.

Database Manager GUI

SQL Studio

For a detailed description of the use of these tools, see also: Database Manager GUI and SQL Studio.


Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation Database Manager GUI

The Database Manager GUI is a database management tool. The Database Manager GUI is used to control and monitor the database instance and to execute of backups. The Database Manager allows you to access remote database servers.

The Database Manager GUI was developed exclusively using Microsoft Visual Basic 6.0. The Components of the Database Manager GUI are ActiveX libraries and ActiveX control elements.

Note which Software is required for Installing the Source Code and Creating the Database Manager GUI Software .

In our experience, it is difficult to work with group projects in the development environment of Microsoft Visual Basic because of the very complex structure of the Database Manager GUI program. For this reason, SAP recommends that you use the VBMAKE tool to create the Database Manager GUI, and that you follow the procedure described under Creating the Database Manager GUI Software.


Components of the Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation Components of the Database Manager GUI

The Database Manager GUI was developed exclusively with Microsoft Visual Basic 6.0.

Name of Component | Function | Description
DBMGUI | Client | Main Database Manager GUI program
DBMLIB | Object Library | Extensive object hierarchy for functionality of Database Manager GUI
DBMSOB | Server Object | Object for Database Manager API (dbmapi.dll)
DBMEVE | Event Handler | Global event manager
DBMAPP | Application Server | ActiveX Server that manages a registered database instance
DBMDOC | Documents | Contains a control element for each main function of the Database Manager GUI
DBMRES | Resource Library | All images (images and icons) that are used
DBMCMD | Command Control | Manages command lists from which the menus and toolbars are created
DBMINP | Input Control | Date and time entry
DBMSPL | SplitterBox Control | Manages ActiveX control elements so that the split/size can be changed using a resize bar
DBMREG | Registry Library | Functions for managing the registry
DBMSCR | ScrollBox Control | Manages an ActiveX control element so that you can change the position using a scroll bar
DBMDRT | DrawText Control | Displays text using the Windows API function of the same name
DBMFLB | FloodBar Control | Flood bar to display the fill levels of a database instance
DBMINF | InfoPanel Control | Control element for displaying various information
DBMSEP | SepLine Control | 3D separator
DBMWIZ | Database Creation Wizard | Main program of the wizard to create database instances
DBMTIB | TitleBar Control | Title bar with image, title, time and close button
DBMPWD | Password Library | Encryption and decryption of the user password stored in the registry for a registered database instance (not available as source code).
DBMDBG | Debug Server | Utility for correction (debug). To do so, select database instance, choose Ctrl-D, click the right mouse button on the desired database instance and then choose Trace
DBMINS | Installer | Utility for registration and deregistration of all components of the Database Manager GUI


Software for the Database Manager GUI (SAP Library - SAP DB)

 Entering content frame

Background documentation Software for the Database Manager GUI

You must install the following software on your computer before Installing of the Source Code and Creating the Database Manager GUI Software :

  • Microsoft Windows NT 4.0 Service Pack 5 or higher
  • Microsoft Visual Basic 6.0 Service Pack 3 or higher

You also require the file

  • sapdb-tools-source-73.zip

This contains all of the necessary Components for the installation of the source code and the creation of the Database Manager GUI software.


Installing the Source Code (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Installing the Source Code

Prerequisites

You have the software required for the installation ( Software for the Database Manager GUI , Software for SQL Studio ).

Procedure

  1. Unpack the file sapdb-tools-source-73.zip in a location of your choice on your hard disk.

    This operation creates the following directory structure:

-\SAPDBTools... | Main directory
..\bin | Created components and programs
..\src... | Source code
..\DBMGUI... | Source code components of the Database Manager GUI
..\SQLStudio... | Source code components of SQL Studio
..\VBMAKE... | Source code components of VBMAKE

  2. Enter the TCPIP Port
     sql6 7210/tcp # SAP DB
    in the list of known Services ( filename services) , in order to be able to access databases over the network.

You can find this file in the Microsoft Windows system directory using the following path: ..\system32\drivers\etc.


Creating the Database Manager GUI Software (SAP Library - SAP DB)

 Entering content frame

Background documentation Creating the Database Manager GUI Software

Prerequisites

You have the required Software for the creation of the Database Manager GUI.

You have installed the source code on your computer ( Installing the Source Code ).

Procedure

First of all, register the program files copied to the hard disk during the installation of the source code.

  • To do this, open the bin directory in the Windows NT Explorer
  • Open the DBMIns.exe program contained there by double clicking it (SAP DB Database Manager Installer).
    This program opens the file     DBMIns.ini and displays all of the data contained there
  • Choose Register to register all ActiveX programs, libraries and control elements.

Now run the VBMAKE program ( Execution of the VBMAKE Program ).


Runtime Environment (SAP Library - SAP DB)

 Entering content frame

Background documentation Runtime Environment

The execution of the client program requires that a SAP DB client runtime environment is available. You can find a current version of the runtime environment in the bin directory.


Execution of the Database Manager GUI Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Execution of the Database Manager GUI Program

Prerequisites

If you want to start the Database Manager Project (Name: DBMGUI) program in the Microsoft Visual Basic development environment, the Runtime Environment must be accessible.

There are a number of ways in which you can do this:

  • By entering the bin directory in the system variable Path
  • By calling the Microsoft Visual Basic development environment with the Database Manager Projekt DBMGUI in an environment in which you have temporarily extended the path to the bin directory
  • By copying the following runtime environment files to the ...\src\DBM\DBMGUI directory

Database Manager GUI Files in the SAP DB Client Runtime Environment

dbmapi.dll

sqltcp.dll

sqltcp1.dll

sqltcp2.dll

sqltcpn.dll

sqluser73.dll

sapni.dll


VBMAKE (SAP Library - SAP DB)

 Entering content frame

Background documentation VBMAKE

VBMAKE is a tool developed by SAP DB with which you can manage complex projects in Microsoft Visual Basic. It was created in connection with the development of the SAP DB tools Database Manager GUI and SQL Studio.

Execution of the VBMAKE program


Execution of the VBMAKE Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Execution of the VBMAKE Program

Calling the Program

The program file vbmake.exe is in the bin directory.

Open this file by double clicking it, if you want to work with VBMAKE.
VBMAKE read the file VBMake.ini , in which all of the main components to be managed are listed. Among the project files listed there (file extension . vbp ), there may be a file in the project file directory with the name vbmake.dep . In this file all projects that are dependent on the corresponding project are listed.

After calling the VBMAKE program, you will see a directory structure on the left side of the screen with all projects and their dependent projects as subnodes.
When you choose a project, various information about the project is displayed on the right side of the screen.

Available Functions

Use the toolbar to call the VBMAKE functions.

Function | Description
Open | Open a new input file
Open VB | Open the Microsoft Visual Basic development environment with the chosen project
Edit vbp | Open the project file in the Notepad program
Options | Define options for creating the software Check project file date Takes the project file date into consideration when deciding if a component should be updated (recompiled). Ignore read only attributes on targets Ignore the read only attribute of files to be created Make typelib compatible before compilation Create a project file before compilation in which the type lib information of ActiveX components is reconciled with the information in the registry. This file is then called during compilation. Make winrunner support file before compilation Create a project file before compilation that contains the required information for the WinRunner tool (Mercury Interactive Corporation). This file is then called during compilation.
Make | Compile the selected project Possibility to decide exactly what should be compiled: Make current and all dependent projects Compile all dependent projects and then the selected project Make current projects only Compile only the selected project Make dependent projects only Compile only the dependent projects
Execute | Run the selected project if it is an executable program
Register | Register the selected project (or the created components)
Set | Define selected properties of a project file, for example for Debug purposes
Touch | Set the current time stamp for the selected project file
Cancel | Terminate the current action
Info | General Public Licence Info


SQL Studio (SAP Library - SAP DB)

 Entering content frame

Background documentation SQL Studio

SQL Studio is a tool for creating and changing database objects such as tables, views, and so on, and for creating and executing SQL statements.

SQL Studio was developed using Microsoft Visual Basic 6.0, Microsoft Visual C++ 6.0 and the SAP DB development environment. The components of SQL Studio are ActiveX libraries, ActiveX control elements and dynamic run time libraries (DLLs).

Note which Software is required for Installing the Source Code and Creating the SQL Studio Software .

SAP recommends that you use the VBMAKE tool to create the SQL Studio software, and that you follow the procedure described under Creating the SQL Studio Software.

You can, however, also use the Microsoft Visual Basic development environment and use the group file SQLStudio.vbg in the ...\SQLStudio\Main directory with it.


Components of SQL Studio (SAP Library - SAP DB)

 Entering content frame

Background documentation Components of SQL Studio

SQL Studio was developed using Microsoft Visual Basic 6.0, Microsoft Visual C++ 6.0 and the SAP DB development environment.

If you want to gain an overview of the dependencies between the individual components of SQL Studio, we recommend that you use the VBMAKE tool.

Name of Component | Function | Description | Development Environment Used
SQLStudioUtil | Various help functions | ActiveX library, contains functions such as access to the Microsoft Windows registration database, setting of the SQL Studio position indicator, and the management of the SQL statement history, organized into classes | VB 6.0
SQLStudioDBLayer | Contains database accesses | ActiveX library in which the SQL Studio database accesses occur using ODBC and VB classes (Classes to create a database connection, execution of SQL statements, scrolling in a resulting set). | VB 6.0
SQLStudioMan | SQL Studio Objects | ActiveX library that contains classes with which specific SQL Studio information is stored (such as: user profile, program settings, stored SQL Studio objects, predicates for the QueryByExample dialog) | VB 6.0
SQLStudioCt | User Password | Encryption and decryption of the user password stored in the registry for a registered database instance (not available as source code). | VB 6.0
SQLStudioCCon | General Control Elements | ActiveX component that contains various control elements: Table window for the VisualQuery dialog Navigation bar for the QueryByExample dialog Navigation bar for the results window Suggestion list for the DirectSQL dialog | VB 6.0
SQLStudioQCon | Control elements for creating a database query | ActiveX component for dialogs to execute SQL statements and their results: DirectSQL dialog QueryByExample dialog VisualQuery dialog Result dialog Zoom window for the Result dialog | VB 6.0
SQLStudioCDCon | Control elements for creating database objects | TableDefinition ViewDefinition IndexDefinition SynonymDefinition SequenceDefinition | VB 6.0
CatalogView | Display of the database catalog | Among other things, provides navigation through the database catalog, calling dialogs to create database objects and SQL Studio objects (such as provided SQL statements) | VB 6.0
SQLStudio | Main program | Main SQL Studio program | VB 6.0
DSQLControl | Entry window of the DSQL dialog | Allows, among other things, the setting of different fonts and colors for SQL statements and SQL keywords | VC 6.0
StudioUtil | Help function implemented in C | Conversion UTF8 -> UCS2 Display of ASCII characters as hex values | SAP DB Development Environment
TableDefC | Help function implemented in C | Functions for SQLStudioCDCon | SAP DB Development Environment


Software for SQL Studio (SAP Library - SAP DB)

 Entering content frame

Background documentation Software for SQL Studio

You must install the following software on your computer before Installing of the Source Code and Creating the SQL Studio Software :

  • Microsoft Windows NT 4.0 Service Pack 5 or higher
  • Microsoft Visual Basic 6.0 Service Pack 3 or higher
  • Microsoft Visual C++ 6.0 Service Pack 3 or higher
  • Microsoft ODBC 3.51
    •
  • riched20.dll 5.30.11.2110 (Richedit Version 3.0), oder higher

You also require the file

  • sapdb-tools-source-73.zip

This contains all of the necessary Components for the installation of the source code and the creation of the Database Manager GUI software.


Creating the SQL Studio Software (SAP Library - SAP DB)

 Entering content frame

Background documentation Creating the SQL Studio Software

Prerequisites

You have the required Software for the creation of SQL Studio.

You have installed the source code on your computer ( Installing the Source Code ).

Procedure

First of all, register the program files copied to the hard disk during the installation of the source code.

You must then edit the file SQLSTDREG.bat depending on your operating system:

  • Windows 95/98:

Activate the line rem regsvr32 /s DSQLControl\Win9x\SQLStudioDSQL.dll by removing the character string rem .

  • Windows NT:

Activate the line rem regsvr32 /s DSQLControl\WinNT\SQLStudioDSQL.dll by removing the character string rem .

Then execute the file SQLSTDREG.bat .
The SQL Studio program can now be called or created.

The components of SQL Studio are created in various development environments ( SQL Studio Components ).

To create the component DSQLControl, your require the include file Tom.h and the library riched20.dll 5.3011.2110 (oder höher).
The file Tom.h is part of the Microsoft Platform Software Development Kit (SDK).
If the library riched20.dll 5.3011.2110 is not available to you, copy it from the bin directory to the corresponding Windows directory (for example: ../Winnt/System32 for Windows NT).


Execution of the SQL Studio Program (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Execution of the SQL Studio Program

Prerequisites

If you want to start the SQL Studio program in the Microsoft Visual Basic development environment, the Runtime Environment must be accessible.

You should therefore copy the following runtime environment files to the group file directory ...\SQLStudio\Main .

SQL Studio Files in the SAP DB Client Runtime Environment

sqlod32.dll

sqluser73dll

sapni.dll

sqlsp32.dll

sqltcp2.dll

sqltcp1.dll

sqltcp.dll

sqltcpn.dll

sqlodext.dll

libsqlcls.dll

wapi.dll

dbfsapi.dll

odcompr.dll

StudioUtil.dll

TableDefC.dll


Web-Based Problem Tracking System (SAP Library - SAP DB)

 Entering content frame

Component documentation Web-Based Problem Tracking System: SAP DB

The Web-Based Problem Tracking System (Web PTS) is the Web interface to the internal SAP DB program PTS for documenting problem messages for SAP DB software. The individual settlements from creation of the problem message to solution of the problem are documented here.

With this program, you have only read access to the problem messages recorded in the internal SAP DB program PTS.

An external developer, such as a member of the Open Source Community, sends a problem message to SAP DB. This is recorded in the internal SAP DB program PTS. The URL of this problem message is then sent to the external developer. In this way, the external developer has the possibility to follow the settlement at any time and inform himself or herself about which change in which database version is planned.

System requirements

Terms

Functions of the Web PTS

You can download the Web-Based Problem Tracking System (Web PTS) program free of charge from the SAP DB Homepage http://www.sapdb.org.

For general information about the SAP DB database system, see the documentation for the SAP DB database system and the SAP DB homepage http://www.sapdb.org.


System Requirements (SAP Library - SAP DB)

 Entering content frame

Background documentation System Requirements

The minimum prerequisite for the use of the Web Based Problem Tracking System program is a browser that supports frames, JavaScript, and Cascading Style Sheets (CSS).

If your browser does not support CSS, the display of the program will be impaired. With some browsers (such as Konqueror 2.9.2 with activated Accessibility Stylesheets), it can also mean that the program becomes unusable.

Tests with Microsoft Internet Explorer 5.5, Netscape 4.74, Mozilla 1.1, Netscape 6.1, Netscape 7 (all on Microsoft Windows 2000), and Konqueror 3.0.3 (on Linux SuSE 8.0) produced good results.


Terms (SAP Library - SAP DB)

 Entering content frame

Background documentation Terms

Affected OS

Change Request

Completed

Component

Created

Delivered

Description

Error

Evaluate

Feature

Header Data

Keywords

Message Data

Message Texts

Message Type

Modules

Number

Patch Information

Planned/Delivered

Processed

Rejected

Release Note

Reported

Settlement

Solution

To be done

Waiting


Message Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Message Data

The following message data is recorded for every problem message:

Header Data

Settlement

The content of the problem message is in the message text.


Header Data (SAP Library - SAP DB)

 Entering content frame

Background documentation Header Data

Header data is part of the message data.

The following header data is recorded for every problem message:

Number | Current number of the problem message
Message Type | Type of the problem message Error: The software does not function as intended Change Request: The reported deficiency makes the intended use of the software difficult
Component | SAP DB component
Reported | Database version to which the problem message refers
Settlement | Settlement
Planned/Delivered | Database version in which the problem is/is to be solved
Created | Date on which the message was created
Processed | Date on which the message was processed
Completed | Date on which the processing was completed
Affected OS | Affected operating systems
Keywords | Keywords They correspond to indexes that can be assigned to a problem message when it is created.


Settlement (SAP Library - SAP DB)

 Entering content frame

Background documentation Settlement

Specifications about the settlement of a problem message are part of the message data.

The following settlements are possible:

Waiting | The problem message has been created, but not yet processed.
Evaluate | A SAP DB developer is evaluating the problem message with respect to relevance, work required, and time required.
To be done | The problem message is being processed
Delivered | The result of the work is included in a database version that has been delivered
Rejected | The problem message is not processed


Message Texts (SAP Library - SAP DB)

 Entering content frame

Background documentation Message Texts

Message texts are texts created in the individual phases of the processing of a problem message.
The following types of text can be created:

Description | Description of the problem
Solution | Description of the solution for the problem
Patch Information | Description of the new status after an error has been corrected (Release Note for message type error)
Modules | Software modules affected by the solution to the problem
Feature | Description of the new feature (Release Note for message type change request)


Functions of the Web PTS (SAP Library - SAP DB)

 Entering content frame

Background documentation Functions of the Web PTS

Use

The Web-Based Problem Tracking System (Web PTS) program allows you to search for problem messages created in this program. There are various search templates for doing this, with selection lists and search functions for the message data and message texts.

Available Search Templates

Simple Search | Restrict the search result using free entries
Advanced Search | Restrict the search result using entries that you select from the system proposals
My Release Notes | Restrict the search result to only those messages that contain relevant information for the end customer If you specify the version of your installed software and of a newer version, you restrict the result list to the information relevant to your software installation that was issued up to the specified newer version.


Simple Search (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Simple Search

Use

You can use the Simple Search to display the problem messages recorded in the internal SAP DB program PTS, together with the available information for them. You can restrict the search result by entering suitable freely definable search terms.

The search is performed for the message texts and keywords but not for the message data.

The system displays a maximum of 25 results.

Input Rules

You can enter any combination of letters and numbers. However, you must adhere to the following input rules when doing so:

· Place search strings that consist of several words in quotation marks (such as: “backup history”).

· Place search strings that begin with a minus sign in quotation marks (such as: “-8000”).

· To exclude problem messages from the result list, start the search string with a minus sign as a negation operator (such as: -logging, -"-8000", -"backup history").

Procedure

Choose Simple Search.

...

1. Enter search strings in accordance with the above input rules.

2. Choose the rule that is to be used for the search:

All Words | Every message in the result list is to contain all of the entered search strings.
Any Word | Every message in the result list is to contain at least one of the entered search strings.
Exact Phrase | Every message in the result list is to contain exactly the entered search string.

3. If you want to reset your entries, choose Clear.

When you want to start the search, choose Search.

A negation operator before a search string is most useful in combination with the All Words search rule, as you restrict the result table in this way.

On the other hand, a negation operator before a search string in combination with the search rule Any Words significantly increases the size of the result list.

Result List of the Simple Search


Result List of the Simple Search (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Result List of the Simple Search

Use

You can display the search criteria used for the search; underneath this you can display the total number of hits for the search, and the result list. A maximum of 25 hits are displayed in the list. If the number of hits exceeds 25, we recommend that you restrict the search further.

The system displays the most important message data for every result, as well as the first 160 characters of the description created for the problem message.

Procedure

If you want to display a detailed view for an entry in the result list, click the current number (Number) of the relevant message. By doing this, you display all of the information available for a selected message; that is, all available message data and message texts.
You can save the detailed view as a URL. To do this, click the displayed link with the right mouse button.

If you want to change the search, change the displayed search criteria. Then choose Search.

If you want to start a new search, choose Clear and follow the procedure described under Simple Search.


Advanced Search (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Advanced Search

Use

You can use the Advanced Search to display the problem messages recorded in the internal SAP DB program PTS, together with the available information for them. You can restrict the search result by selecting values for the input fields.

The system informs you how many problem messages were found.

You can define the number of problem messages that are displayed in the result list.

You can save the result table as a URL.

Procedure

...

1. Choose Advanced Search.

Restrict the search result by selecting values from the displayed lists and options or by free input for searching in the message texts:
Header Data

¡ To see a list of all the available keywords, click Keywords. To add a keyword to the list of keywords, click the keyword once. You can specify up to 25 keywords. To copy the selected keywords into the search template, choose Apply.

Settlement
Message Texts

2. Define the display of the result list. You can choose between various combinations of columns and specify the number of problem messages that are to be displayed.

¡ Choose whether the system should display a maximum number of rows (Max Rows) or all rows of the result list (All Rows). If you want to restrict the number of rows, specify the desired number. The number of rows corresponds to the number of problem messages displayed.

¡ Choose which columns are displayed in the result list under Result Column Set. You can choose between three predefined combinations of columns:

Minimum | Number, Message Type, Component, Reported, Created
Standard | as Minimum plus the columns Settlement and Planned/Delivered
Maximum | as Standard plus the columns Processed, Completed, and Affected OS

3. If you want to reset your entries, choose Clear.

When you want to start the search, choose Search.

Result List of the Advanced Search


Result List of the Advanced Search (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Result List of the Advanced Search

Use

The system displays all problem messages that match the defined search criteria. You can call a detailed view for every problem message.

You can save both the result list and the detailed view for a problem message as a URL.

Procedure

If you want to save the displayed result list as a URL, choose the link displayed at the top of the page with the right mouse button.
If you call up this URL later, the system displays exactly this result list. Choose Refresh to update the output.

If you want to display a detailed view for an entry in the result list, click the current number (Number) of the relevant message. By doing this, you display all of the information available for a selected message; that is, all available message data and message texts.
You can also save the detailed view as a URL. To do this, click the link displayed at the top of the page with the right mouse button.

If you want to modify the search for the displayed result list, choose Modify Search.

If you want to define a new search, choose New Search and follow the procedure described under Advanced Search.


My Release Notes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation My Release Notes

Use

With this function, you can determine which errors/change requests reported for a version are corrected/implemented in a particular succeeding version.

In the result list, the system displays the Release Notes prepared for the processed problem messages. Release Notes for corrected errors are called Patch Information. Release Notes for implemented change requests are called Feature.

The system informs you how many Release Notes were found. The display is sorted.

Procedure

...

1. Choose My Release Notes.

2. Restrict the search by selecting values from the displayed lists:

My Version | Version from which the search should be performed
Newer Version | Version to which the search should be performed
Component | SAP DB component

3. If you want to reset your entries, choose Clear.

When you want to start the search, choose Search.

Result List of My Release Notes


Result List of My Release Notes (SAP Library - SAP DB)

 Entering content frame

Procedure documentation Result List of My Release Notes

Use

This list displays all of the Release Notes that match the defined search criteria.

The system displays the most important message data for each Release Note. Among other things, you can find out from this information whether the version in which the problem is solved is still being planned (Planned) or has already been delivered (Delivered), from the point of view of the specified Newer Version.

All Release Notes that the system finds are displayed in the result list, sorted by component. The system differentiates between Patch Information and Feature for each component.

For a particular component, the Release Notes for delivered versions are displayed first (first Features and then Patch Information), and then the Release Notes for planned versions (first Features and then Patch Information).

Procedure

If you want to modify the search for the displayed result list, choose Modify Search.

If you want to define a new search, choose New Search and follow the procedure described under Comparing Versions.


SAP DB (SAP Library - SAP DB)

 Entering content frame

Component documentation SAP DB

SAP DB is a mature and reliable database system that combines extremely high levels of performance and availability with a low cost of ownership. It offers absolute ease of use and almost unsupervised operation. SAP DB can handle a wide range of different types of information, which makes it a suitable server for diverse application scenarios.

SAP DB works with all SAP applications. Newer SAP solutions, such as mySAP Supply Chain Management (Advanced Planner and Optimizer) and mySAP Product Lifecycle Management, use SAP DB exclusively as an integrated database engine for managing complex objects, or as a content server for structured documents. And it is not only SAP customers who can use SAP DB free of charge – at the end of 2000, SAP released its SAP DB database technology as an open source package, available to the open source community on all supported platforms at no charge.

See also: SAP DB Website at the Internet address http://www.sapdb.org.

SAP DB documentation is organized into the following areas:

Basic Information

Installation

Tools

Interfaces

Development