DBMS

Sybase SQL Server 11

By Martin Rennhackkamp
DBMS Server Comparison Supplement, November 1996

A Black Eye Heals as Sybase System 11 Recovers from Performance and Quality Problems in System 10.


Sybase has always been known as one of the most technologically advanced relational DBMSs. However, when Sybase SQL Server 10 was field tested, it met with many negative comments about its quality. Sybase SQL Server 11 was released in October 1995, prima rily in response to the performance demands raised by customers and analysts and pressure from competitors. Sybase SQL Server 11 was developed according to an ISO 9000 certification process in an attempt to ensure its quality. The result is a redesigned DBMS that is scalable and tunable and that performs well, exploiting the power provided by the underlying hardware and operating system.

Relational Data Model

Sybase, similar to the other DBMSs reviewed in this supplement, supports the relational data model to some extent. The data stored in a Sybase database is structured as tables, with integrity constraints to protect the data's accuracy and integrity.

Sybase does not support domains per se, but you can simulate domains by creating rules to support your domain constraints. The rules must then be bound to each of the columns in which the domain would have been used. You can define key, column, and refer ential-integrity constraints declaratively, as part of the CREATE TABLE and ALTER TABLE statements. The constraints can all be named, but you cannot alter the messages returned when the constraint is violated. For referential-integrity constraints, Sybas e only supports the default NO ACTION option when an integrity constraint is violated. More advanced options must be coded using Sybase's powerful triggers and stored procedures.

Database Objects

Over and above the ANSI SQL-92 standard's numeric and character data types, Sybase's Transact-SQL language supports many additional data types, such as BINARY, VARBINARY, IMAGE, BIT, DATETIME, MONEY, TEXT, and TIMESTAMP. You can also create your own user -defined data types, which are defined in terms of the standard data types. You can define rules and bind them to the user-defined data types to create your own domains with domain integrity constraints.

A Sybase table always has a heap structure. If you define a clustered index for the table, the data in the table is physically stored in key order. You can only have one clustered index per table; a non- clustered index for a table is just a fast access path to the data stored in the table. Sybase indexes always have a B-tree structure. For each index, you can specify the fill factor and the number of rows it must store per page. You can spread individua l tables and indexes over different physical storage devices; in fact, you can place the index pages for a non-clustered table on physical devices that are separate from the data itself. You can also partition a table, which creates multiple "page chains " for the table, reduces the access to the last page of the table, and allows parallel I/O for bulk table operations.

A Sybase trigger is a special type of stored procedure that is associated with a specified table and that executes automatically when the table is changed by a SQL INSERT, UPDATE, or DELETE operation. The actions of the trigger are specified in the Sybas e Transact-SQL language as part of the trigger definition. Alternatively, the trigger can call a stored procedure to perform the required processing. A Sybase SQL trigger can contain an if clause, which can be used for conditional trigger firing, based o n the updated column values. A Sybase trigger only fires after the triggering operation has completed. When a trigger fires, the old values (if triggered by an UPDATE or DELETE operation) and the new values (if triggered by an INSERT or UPDATE operation) are available in two logical tables, called Inserted and Deleted respectively. The trigger's statements can then access the logical tables to determine the rows affected by the triggering operation. A table can have a maximum of three triggers - one eac h for INSERT, UPDATE, and DELETE statements. A trigger fires only once per triggering operation, and triggers can be nested up to 16 levels and compiled and stored in the system catalogs in the same manner as stored procedures. A very powerful feature of Sybase triggers is their ability to access database objects outside the currently connected database.

A stored procedure is a named sequence of database operations stored (in an executable form) in the system catalogs by the DBMS, which can be activated by calling its name. A stored procedure can contain SQL iNSERT, UPDATE, DELETE, and SELECT statements, as well as flow-of-control statements, such as if . . . ELSE, WHILE, BREAK, CONTINUE, BEGIN . . . END, GO TO . . . , and RETURN. A stored procedure can return multiple result sets to the client application, and it can call other stored procedures (this feature can be used for modular and reusable code development). The statements of a stored procedure may also reference objects in other databases, as long as the access paths are properly defined.

The closest feature Sybase has to database event alerters is the WAITFOR command. It can be used to instruct the current session to wait for a specified time, time interval (up to 24 hours in advance), event, or the execution of a statement block, stored procedure, or transaction.

Queries

Sybase supports its own proprietary Transact-SQL language, a super-set of the Entry Level ANSI SQL-92 standard, with various extensions for functions, stored procedures, triggers, and performance-improvement features.

Sybase uses locking as its concurrency control mechanism; it can lock data pages or entire tables. Sybase always attempts to use page locks, but once a statement accumulates more locks than specified by the LOCK PROMOTION THRESHOLD server configuration p arameter, it escalates to a table-level lock. You can affect the locking strategy by issuing the HOLDLOCK, NOHOLDLOCK, or SHARED keywords with your query or by changing the transaction's isolation level. Sybase supports four isolation levels. It allows d irty reads on level 0, and you can use optimistic locking for browse-only transactions.

Sybase supports cursors according to the Entry Level ANSI SQL-92 standard, with the addition of the FOR READONLY and FOR UPDATE clauses. You can only read forward through a Sybase cursor.

SQL Server supports left and right outer joins, using a Transact-SQL syntax similar to the well-known Oracle outer join syntax. Left and right outer joins are specified by *= and =* in the WHERE clause of the SELECT statement - not in the FROM clause, as specified in the ANSI SQL-92 syntax.

In addition to Transact-SQL and embedded SQL, Sybase supports DBLIB, CTLIB, and the common ODBC API. DBLIB and CTLIB form part of the OpenClient/OpenServer API used by all of the products in the Sybase family.

Database Administration

Sybase SQL Server Manager is a Windows-based systems management tool with which you can manage all of the Sybase SQL Servers throughout your enterprise. With the Sybase SQL Server Manager, you manage the Sybase SQL Servers as well as all of the objects i n the Sybase databases by clicking, dragging and dropping the icons on the GUI console, and filling in one or two dialog boxes. You use it to manage tables, indexes, views, stored procedures, triggers, and rules. You use the same interface to manage the access privileges of users and groups of users, as well as to perform complete backup and recovery operations. You can manage multiple Sybase SQL Servers or databases simultaneously by applying the change against a collection of servers or against a coll ection of database objects.

A powerful GUI-based monitoring tool, Sybase SQL Monitor doesn't influence the performance of the system because it monitors the server's shared memory. It can be used to record and play back performance statistics. The SQL Monitor also includes an API, which lets you build your own monitoring utilities.

Sybase SQL Server satisfies the C2 level of security specification. It has several protection mechanisms that you can deploy to enforce your security policy. These mechanisms include user identification and authentication through a login mechanism, discr etionary access controls through the SQL GRANT and REVOKE commands, and a configurable audit trail that records events of interest to the security administrator.

Sybase has a separate server, called the Sybase Backup Server, to manage all of the backup and restore activities for the Sybase SQL Server. It can take full online backups of your databases and your transaction logs, and it can address up to 32 backup d evices in parallel. In line with the Sybase SQL Server Manager, it can be used to manage multiple dumps and loads from multiple remote SQL Servers.


Editor's note: The Connectivity and Distribution section and the Replication section are online addendums. They did not appear in the printed article due to lack of space.

Connectivity and Distribution

Sybase has always been known for its extensive connectivity. The Sybase Enterprise Connect family of products provides access to a large set of databases through a heterogeneous connectivity middleware layer called the Sybase Open Client/Open Server arch itecture. All of the Sybase products communicate through the Open Client/Open Server API, which results in a very open and "connectable" architecture.

DirectConnect is Sybase's gateway middleware product. Sybase calls it a single-source data access product. Through DirectConnect you can get full SQL-based read-write access to many databases simultaneously. Supported databases include Adabas, AS/400, DB 2, Informix, CA-OpenIngres, Oracle, and VSAM. A special release of DirectConnect, called MainframeConnect for DB2, works in conjunction with DirectConnect for MVS to give you access to DB2 databases on MVS. In addition to full read-write SQL, dynamic SQL , and cursor-based SQL operations, DirectConnect gives you management and monitoring facilities, integration with additional monitoring services, and full security and integrity controls.

Two related utilities are InfoHub, which makes non-relational mainframe databases appear as relational databases to Sybase client programs, and InfoPump, which is used to move bulk data between various heterogeneous data sources.

In addition, Sybase also offers its well-known remote procedure call (RPC) mechanisms, which can be called from triggers, stored procedures, and application programs. Sybase's RPCs can be located within or outside transaction boundaries and can be comple ted with or without a two-phase commit protocol.

OmniConnect is Sybase's multidatabase offering. Through OmniConnect, a single SQL-based transaction can span multiple, heterogeneous data sources transparently. These data sources are accessed through DirectConnect, the main building block for OmniConnec t. Through OmniConnect you can get common SQL access to data stored in Adabas, AS/400, DB2, IDMS, IMS, Informix, Ingres, ISAM, Microsoft SQL Server, Oracle, Rdb, RMS, sequential files, SQL/DS, Sybase SQL Server, Teradata, and VSAM databases and file syst ems. All of the various data sources are registered in the global data catalog; from then on, the data can be used in full distributed read-write operations, as if it's local. You can access multiple disparate SQL data sources, with full distributed quer y optimization, and integrate the results without even running the Sybase SQL Server. You can also acquire the OmniConnect toolkit, with which you can build your own Omni Access Modules to link your data sources to the OmniConnect family.

Replication

Sybase's Replication Server can be used to asynchronously replicate copies of data in heterogeneous databases through the Sybase Enterprise Connect middleware products I described previously. Instead of using "work-around" mechanisms, such as triggers, b uffer tables, or snapshots in files, the Sybase Replication Server propagates changes from a source database through an API of the logging and journalling subsystem. This technique makes it possible to replicate transactions at OLTP speeds. In addition, the Sybase replicator can perform transformations on the replicated data, and it can replicate fragments of tables to different target sites. These transformations are performed through a conditional subscribe-publish scheme. Subscriptions are performed through customizable SQL-based scripts, which can be adapted for conditional replication, dynamic routing, and operations making use of stored procedures. For example, you can transform an update on the source database to an insert operation in an audit table on the target database, or you can transform a distance in miles to a distance in kilometers, if your target database is in Europe. It is also possible to configure cascading replication, where operations on a target database can be replicated furt her to additional target databases.

At this stage, Sybase can replicate to any of the databases previously mentioned under connectivity, and it can replicate from Oracle, DB2 and Lotus Notes, with replication agents for most of the other data sources supported by DirectConnect in the pipel ine.

The Sybase Replication Server, which is managed through the GUI-based Sybase Replication Server Manager, can be used to manage all of the replication configurations and all of the replication servers from a single console. The Sybase Replication Server M anager can also display replication performance information graphically, a capability that is useful for performance tuning and trouble-shooting. It can also be set to notify an operator of changes in a replication server's operational status or of chang es in the replication configuration.


Internet Support

Sybase SQL Server supports the Internet through web.sql, which lets developers dynamically generate customized HTML pages. You can insert SQL instructions and Perl scripts to access your Sybase database into the text of your HTML pages. When a Web user r equests the HTML page, the database queries are executed and the results are returned to the Web browser as pure HTML text.

Now It Scales Well Too . . .

The improvements in Sybase SQL Server 11 build on the strong availability, distributed database, replication, and connectivity features already present in Sybase SQL Server 10. Sybase SQL Server 11 is extremely streamlined, flexible, scalable, and tunabl e. These capabilities are taken even further with the Sybase MPP and Sybase IQ products and bode well for mixed-workload environments on the same server, where you can perform OLTP, DSS, batch, and Web-originated operations simultaneously, without negati vely affecting each other. This extremely configurable tunability eliminates the need for separate database servers for OLTP, DSS, batch, and Web-based applications.


Martin Rennhackkamp is the owner and principal consultant of The Data Base Approach, a corporation specializing in relational and distributed databases, based in Cape Town, South Africa. You can email Martin at mr@dba.co.za.


* Sybase Inc., 6475 Christie Ave., Emeryville, CA 94608; 800-879-2273, 510-922-3500, or fax 510-922-9441; http://www.sybase.com.

Subscribe to DBMS and Internet Systems -- It's free for qualified readers in the United States
November 1996 Table of Contents | Other Contents | Article Index | Search | Site Index | Home

DBMS and Internet Systems (http://www.dbmsmag.com)
Copyright © 1996 Miller Freeman, Inc. ALL RIGHTS RESERVED
Redistribution without permission is prohibited.
Please send questions or comments to dbms@mfi.com
Updated Wednesday, October 23, 1996