System Administration Guide:: Adaptive Server Enterprise
System Administration Guide:: Adaptive Server Enterprise
System Administration Guide:: Adaptive Server Enterprise
Volume 1
Adaptive Server® Enterprise
15.5
DOCUMENT ID: DC31654-01-1550-01
To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845.
Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other
international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled
software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic,
mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc.
Sybase trademarks can be viewed at the Sybase trademarks page at http://www.sybase.com/detail?id=1011207. Sybase and the marks listed
are trademarks of Sybase, Inc. ® indicates registration in the United States of America.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.
IBM and Tivoli are registered trademarks of International Business Machines Corporation in the United States, other countries, or both.
All other company and product names mentioned may be trademarks of the respective companies with which they are associated.
Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013
for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.
CHAPTER 9 Configuring Character Sets, Sort Orders, and Languages ..... 299
Understanding internationalization and localization ..................... 299
Advantages of internationalized systems ..................................... 300
A sample internationalized system ............................................... 301
Elements of an internationalized system ...................................... 303
Selecting the character set for your server................................... 303
Unicode.................................................................................. 306
Selecting the server default character set ............................. 310
Selecting the sort order ................................................................ 313
Using sort orders ................................................................... 314
Different types of sort orders ................................................. 314
Selecting the default sort order.............................................. 315
Selecting a language for system messages ................................. 321
Setting up your server: examples ................................................. 323
A Spanish-version server....................................................... 323
A U.S.-based company in Japan ........................................... 323
Index............................................................................................................................................ 707
2 Either select the product family and product under Search by Base
Product; or select the platform and product under Search by Platform.
3 Select Search to display the availability and certification report for the
selection.
Element Example
The comma means you may choose as many of the cash, check, credit
options shown as you want. Separate your choices
with commas as part of the command.
The pipe or vertical bar ( | ) means you may select only cash | check | credit
one of the options shown.
An ellipsis (...) means that you can repeat the last unit buy thing = price [cash | check | credit]
as many times as you like. [, thing = price [cash | check | credit]]...
You must buy at least one thing and give its price. You may
choose a method of payment: one of the items enclosed in
square brackets. You may also choose to buy additional
things: as many of them as you like. For each thing you
buy, give its name, its price, and (optionally) a method of
payment.
• Syntax statements (displaying the syntax and all options for a command)
appear as follows:
sp_dropdevice [device_name]
(3 rows affected)
In this manual, most of the examples are in lowercase. However, you can
disregard case when typing Transact-SQL keywords. For example, SELECT,
Select, and select are the same.
Note You might need to configure your accessibility tool for optimal use.
Some screen readers pronounce text based on its case; for example, they
pronounce ALL UPPERCASE TEXT as initials, and MixedCase Text as
words. You might find it helpful to configure your tool to announce syntax
conventions. Consult the documentation for your tool.
• sso_role
• oper_role
• sybase_ts_role
Database owner
The database owner is the creator of a database or someone to whom database
ownership has been transferred. A system administrator can use the grant
command to grant users the authority to create databases.
A database owner logs in to Adaptive Server using his or her assigned login
name and password, and has the “dbo” account. When this user logs in to
databases they did not create, this user is known by his or her regular user
name.
A database owner can:
• Run the system procedure sp_adduser to allow other Adaptive Server
users access to the database
• Use the grant command to give other users permission to create objects
and execute commands within the database
Adding users to databases is discussed in Chapter 14, “Managing Adaptive
Server Logins, Database Users, and Client Connections.” Granting
permissions to users is discussed in Chapter 17, “Managing User
Permissions.”
The database owner does not automatically receive permissions on objects
owned by other users. However, a database owner can temporarily assume the
permissions of other users in the database at any time by using the setuser
command. Using a combination of the setuser and grant commands, the
database owner can acquire permissions on any object in the database.
Note Because the database owner role is so powerful, the system administrator
should plan carefully who should own databases in the server. The system
security officer should consider auditing the database activity of all database
owners.
Note When a database object is owned by someone other than the database
owner, the user (including a system administrator) must qualify the name of
that object with the object owner’s name—ownername.objectname—to access
the object. If an object or a procedure must be accessed by a large number of
users, particularly in ad hoc queries, having these objects owned by “dbo”
greatly simplifies access.
Starting isql
To start isql on most platforms, type this command at an operating system
prompt, where username is the system administrator:
isql -Uusername
Adaptive Server prompts you for your password.
Note Do not use the -P option of isql to specify your password; another user
might then see your password.
You can use isql in command line mode to enter many of the Transact-SQL
examples in this manual.
Entering statements
The statements that you enter in isql can span several lines. isql does not process
statements until you type “go” on a separate line. For example:
1> select *
2> from sysobjects
3> where type = "TR"
4> go
The examples in this manual do not include the go command between
statements. If you are typing the examples, you must enter the go command to
see the sample output.
System tables
The master database contains system tables that keep track of information
about Adaptive Server. In addition, each database (including the master
database) contains system tables that keep track of information specific to that
database.
All the Adaptive Server-supplied tables in the master database (the Adaptive
Server controlling database) are considered system tables. Each user database
is created with a subset of these system tables. The system tables may also be
called the data dictionary or the system catalogs.
A master database and its tables are automatically created when Adaptive
Server is installed. The system tables in a user database are created when the
create database command is issued. The names of all system tables start with
“sys”. You cannot create tables in user databases that have the same names as
system tables. See Reference Manual: Tables for detailed descriptions of
system tables and their columns.
For complete information about the system procedures, see the Reference
Manual: Procedures.
Warning! Some system tables should not be altered by any user under any
circumstances. Some system tables are dynamically built by system
processes, contain encoded information, or display only a portion of their
data when queried. Imprudent, ad hoc updates to certain system tables can
prevent Adaptive Server from running, make database objects
inaccessible, scramble permissions on objects, or terminate a user session.
Moreover, never attempt to alter the definition of the system tables in any
way. For example, do not alter system tables to include constraints.
Triggers, defaults, and rules are not allowed in system tables. If you create
a trigger, bind a rule, or default to a system table, you see an error message.
System procedures
The names of all system procedures begin with “sp_”. They are located in the
sybsystemprocs database, but you can run many of them in any database by
issuing the stored procedure from the database or by qualifying the procedure
name with the database name.
Sybase-supplied system procedures (such as sp_who) are created using the
installmaster installation script. Use sp_version to determine the version of
installmaster was most recently executed. See the Reference Manual: System
Procedures for more information about sp_version.
If you execute a system procedure in a database other than sybsystemprocs, the
procedure operates on the system tables in the database from which it was
executed. For example, if the database owner of pubs2 runs sp_adduser from
pubs2 or issues the command pubs2..sp_adduser, the new user is added to
pubs2..sysusers. However, this does not apply to system procedures that update
only tables in the master database.
Permissions on system procedures are discussed in the Reference Manual:
Procedures.
The spt_values table can be updated only by an upgrade; you cannot modify it.
To see how it is used, execute sp_helptext and look at the text for one of the
system procedures that references it.
The other system procedure tables are spt_monitor, spt_committab, and tables
needed by the catalog stored procedures. (The spt_committab table is located in
the sybsystemdb database.)
In addition, several system procedures create, and then drop, temporary tables.
For example, sp_helpdb creates #spdbdesc, sp_helpdevice creates #spdevtab,
and sp_helpindex creates #spindtab.
Warning! Use caution when you modify system tables. Always test the
procedures that modify system tables in development or test databases,
rather than in your production database.
Invoke a system ESP just like a system procedure. The difference is that a
system ESP executes procedural language code rather than Transact-SQL
statements. All ESPs are implemented by an Open Server™ application called
XP Server™, which runs on the same machine as Adaptive Server. XP Server
starts automatically on the first ESP invocation.
For information about the system ESPs provided with Adaptive Server, see the
Reference Manual: Procedures.
Note On some platforms, such as Windows, Adaptive Server also records error
messages in the operating system event log. See the installation guide and
configuration guide for your platform.
“Connect me
to the TEST
Adaptive Server.”
interfaces
interfaces file
TEST
TEST
Adaptive Server
The name, location, and contents of the interfaces file differ between operating
systems. Also, the format of the Adaptive Server addresses in the interfaces file
differs between network protocols.
The Adaptive Server installation program creates a simple interfaces file that
you can use for local connections to Adaptive Server over one or more network
protocols. As a system administrator, modify the interfaces file and distribute
it to users so that they can connect to Adaptive Server over the network. See
the Configuration Guide for your platform for information about the interfaces
file.
See Chapter 2, “Networks and Performance” in the Performance and Tuning
Series: Basics for more information about the interfaces file and network
listeners.
Directory services
A directory service manages the creation, modification, and retrieval of
network service information. Directory services are provided by platform or
third-party vendors and must be purchased and installed separately from
Adaptive Server. Two examples of directory services are Registry and
Distributed Computing Environment (DCE).
The $SYBASE/$SYBASE_OCS/config/libtcl.cfg file is a Sybase-supplied
configuration file used by servers and clients to determine:
• Which directory service to use, and
• The location of the specified directory service driver.
If no directory services are installed or listed in the libtcl.cfg file, Adaptive
Server defaults to the interfaces file for obtaining network service information.
The system administrator must modify the libtcl.cfg file as appropriate for the
operating environment.
Some directory services are specific to a given platform; others can be used on
several different platforms. Because of the platform-specific nature of
directory services, see the configuration documentation for your platform for
detailed information about configuring for directory services.
User name and password authentication properties establish and end a session
connection to an LDAP server.
Note The default user name and password stored in libtcl.cfg and passed to the
LDAP server for authentication purposes are distinct and different from those
used to access Adaptive Server. The default user name and password allow
access to the LDAP server for administrative tasks.
Performance
Performance when using an LDAP server may be slower than when using an
interfaces file because the LDAP server requires time to make a network
connection and retrieve data. Since this connection is made when Adaptive
Server is started, changes in performance are seen at login time, if at all. During
normal system load, the delay should not be noticeable. During high system
load with many connections, especially repeated connections with short
duration, the overall performance difference of using an LDAP server versus
the traditional interfaces file might be noticeable.
This chapter describes the system databases that reside on all Adaptive
Server systems. It also describes optional Sybase-supplied databases that
you can install, and the sybdiag database, which Sybase Technical Support
may install for diagnostic purposes.
Topic Page
Overview of system databases 23
master database 25
model database 27
sybsystemprocs database 28
tempdb database 28
sybsecurity database 30
sybsystemdb database 30
Chapter , “sybmgmtdb database,” 31
pubs2 and pubs3 sample databases 31
dbccdb database 32
sybdiag database 32
Warning! Do not store user databases on the master device; doing so makes it
difficult to recover both the system databases and any user databases stored on
the master device.
Install the sybsecurity and sybmgmtdb databases on their own devices and
segment. See the installation documentation for your platform.
Install the sybsystemprocs database on a device of your choice. You may want
to modify the installation scripts for pubs2 and pubs3 to share the device you
create for sybsystemprocs.
Use the installjsdb script (located in $SYBASE/ASE-15_0/scripts) to install the
sybmgmtdb database. installjsdb looks for a device named sybmgmtdev on
which to create the sybmgmtdb database and its accompanying tables and
stored procedures. If the sybmgmtdb database already exists, installjsdb creates
the Job Scheduler tables and stored procedures in the existing database. If
installjsdb cannot find either a sybmgmtdev device or a sybmgmtdb database, it
creates sybmgmtdb on the master device. However, Sybase strongly
recommends that you remove the sybmgmtdb database from the master device.
The installpubs2 and the installpubs3 scripts do not specify a device in their
create database statement, so they are created on the default device. During
installation, the master device is the default device. To change this, either edit
the scripts or follow the instructions in Chapter 7, “Initializing Database
Devices.”
master database
The master database controls the operation of Adaptive Server and stores
information about all user databases and their associated database devices.
Table 2-1 describes the information that the master database stores.
Table 2-1: Information the master database stores
Information System table
User accounts syslogins
Remote user accounts sysremotelogins
Remote servers that this server can interact with sysservers
Ongoing processes sysprocesses
Configurable environment variables sysconfigures
System error messages sysmessages
Databases on Adaptive Server sysdatabases
Storage space allocated to each database sysusages
Tapes and disks mounted on the system sysdevices
Active locks syslocks
Character sets syscharsets
Languages syslanguages
Users who hold server-wide roles sysloginroles
Server roles syssrvroles
Adaptive Server engines that are online sysengines
Because the master database stores information about user databases and
devices, you must be in the master database to issue the create database, alter
database, disk init, disk refit, disk reinit, and disk mirroring commands.
The minimum size of your master database depends on your server's logical
page size. The master database must contain at least 6656 logical pages, so its
minimum physical size for each logical page size is:
• 2K page – 13MB
• 4K page – 26MB
• 8K page – 52MB
• 16K page – 104MB
Warning! Do not place user objects in master. Storing user objects in master
causes the transaction log to fill quickly. If the transaction log runs out of space
completely, you cannot use dump transaction commands to free space in
master.
You may also want to use sp_modifylogin to change the default database for
users (the database to which a user is connected when he or she logs in). See
“Adding users to databases” on page 402.
Create any system procedures in the sybsystemprocs database rather than in
master.
model database
Adaptive Server includes the model database, which provides a template, or
prototype, for new user databases. Each time a user enters the create database
command, Adaptive Server makes a copy of the model database and extends
the new database to the size specified by the create database command.
The model database contains the required system tables for each user database.
You can modify model to customize the structure of newly created databases—
everything you do to model is reflected in each new database. Some of the
changes that system administrators commonly make to model are:
• Adding user-defined datatypes, rules, or defaults.
• Adding users who need access to all databases on Adaptive Server.
• Granting default privileges, particularly for “guest” accounts.
• Setting database options such as select into/bulkcopy/pllsort. These settings
are reflected in all new databases. The default settings for these options in
model is off. See Chapter 8, “Setting Database Options.”
Typically, most users do not have permission to modify the model database.
There is not much point in granting read permission either, since Adaptive
Server copies its entire contents into each new user database.
The model database cannot be larger than tempdb. By default, the size of model
is six allocation units (an allocation unit is 256 logical pages.). You see error
message if you increase the size of model without making tempdb at least as
large.
Note Keep a backup copy of the model database, and back up model with dump
database each time you change it. In case of media failure, restore model as you
would a user database.
sybsystemprocs database
Sybase system procedures are stored in the database sybsystemprocs. When a
user in any database executes a system stored procedure (that is, a procedure
whose name begins with sp_), Adaptive Server first looks for that procedure in
the user’s current database. If there is no procedure there with that name,
Adaptive Server looks for it in sybsystemprocs. If there is no procedure in
sybsystemprocs, Adaptive Server looks for the procedure in master.
If the procedure modifies system tables (for example, sp_adduser modifies the
sysusers table), the changes are made in the database from which the procedure
was executed.
To change the default permissions on system procedures, modify those
permissions in sybsystemprocs.
Note Any time you make changes to sybsystemprocs, back up the database.
tempdb database
Adaptive Server has a temporary database, tempdb, that provides a storage
area for temporary tables and other temporary working storage needs. The
space in tempdb is shared among all users of all databases on the server.
The default size of tempdb depends on the logical page size for your server, 2,
4, 8, or 16K. Certain activities may make it necessary for you to increase the
size of tempdb:
• Large temporary tables.
• A lot of activity on temporary tables, which fills up the tempdb logs.
• Large or many simultaneous sorts. Subqueries and aggregates with group
by also cause some tempdb activity.
Use alter database to increase the size of tempdb. tempdb is initially created on
the master device. You can add space to tempdb from the master device or from
any other database device.
If you run update index statistics against large tables, the command fails with
error number 1105 if tempdb is not large enough.
You can create and manage multiple temporary databases in addition to the
system temporary database, tempdb. Multiple temporary databases reduce
contention on system catalogs and logs in tempdb.
If a stored procedure creates temporary tables, the tables are dropped when the
procedure exits. You can also explicitly drop temporary tables before a session
ends.
Warning! Do not create temporary tables with the “tempdb..” prefix from
inside a stored procedure unless you intend to share those tables among other
users and sessions.
Each time you restart Adaptive Server, it copies model to tempdb, which clears
the database. You cannot recover temporary tables.
sybsecurity database
The sybsecurity database, which contains the auditing system for Adaptive
Server, includes :
• The system tables, sysaudits_01, sysaudits_02, ... sysaudits_08, which
contain the audit trail
• The sysauditoptions table, which contains rows describing the global audit
options
• All other default system tables that are derived from model
See Chapter 18, “Auditing.”
sybsystemdb database
The sybsystemdb database stores information about distributed transactions.
Adaptive Server versions 12.0 and later can provide transaction coordination
services for transactions that are propagated to remote servers using remote
procedure calls (RPCs) or Component Integration System (CIS). Information
about remote servers participating in distributed transactions is stored in the
syscoordinations table.
sybmgmtdb database
The sybmgmtdb database stores jobs, schedules, scheduled jobs information,
and data the internal Job Scheduler task needs for processing. sybmgmtdb also
maintains the output and results from these executed tasks. See the Job
Scheduler Users Guide.
dbccdb database
dbcc checkstorage records configuration information for the target database,
operation activity, and the results of the operation in the dbccdb database.
Stored in the database are dbcc stored procedures for creating and maintaining
dbccdb and for generating reports on the results of dbcc checkstorage
operations. See Chapter 10, “Checking Database Consistency,” in the System
Administration Guide: Volume 2.
sybdiag database
Sybase Technical Support may create the sybdiag database on your system for
debugging purposes. This database holds diagnostic configuration data, and
should not be used by customers.
where:
• script_file is the name of the installation script (the default value is
NULL).
• all reports details about each script, such as the date executed, and the
length of time for execution.
If you run sp_version without any parameters, it reports on all scripts.
This example describes what installation scripts were run, what time they were
run, and what time they finished:
sp_version null, ‘all’
Script Version
Status
----------- ------------------------------------------------------------
-----------
installmaster 15.0/EBF XXXXX/B/Sun_svr4/OS 5.8/asemain/1/32-bit/OPT/Thu Sep
23 22:12:12 2004
Complete [Started=Sep 24 2004 3:39PM]-[Completed=Sep 24 2004 3:45PM
This chapter:
• Introduces new system administrators to important topics
• Helps system administrators find information in the Sybase
documentation
Experienced administrators may also find this chapter useful for
organizing ongoing maintenance activities.
Topic Page
Logical page sizes 35
Using “test” servers 36
Considerations when installing Sybase products 37
Allocating physical resources 39
Backup and recovery 41
Ongoing maintenance and troubleshooting 44
Keeping records 45
Additional resources 48
For more information about the dataserver command, which is the command
used to create the master device, see the Utility Guide. For more information
about logical page sizes, see Chapter 3, “Configuring Memory,” in System
Administration Guide: Volume 2.
Planning resources
Using a test server helps you plan the final resource requirements for your
system and helps you discover resource deficiencies that you might not have
anticipated.
In particular, disk resources can have a dramatic effect on the final design of
the production system. For example, you may decide that, in the event of a
media failure, a particular database requires nonstop recovery. This means you
must configure one or more additional database devices to mirror the critical
database. Discovering these resource requirements in a test server allows you
to change the physical layout of databases and tables without affecting
database users.
Use a test server to benchmark both Adaptive Server and your applications
using different hardware configurations. This allows you to determine the
optimal setup for physical resources at both the Adaptive Server level and the
operating system level before bringing the entire system online for general use.
If you are upgrading a server, back up all data (including the master database,
user databases, triggers, and system procedures) offline before you begin. After
upgrading, immediately create a separate, full backup of your data, especially
if there are incompatibilities between older dump files and the newer versions.
Also keep copies of all data definition language (DDL) scripts for user objects,
as described under “Keeping records” on page 45.
Over time, if you discover few or no errors while running dbcc, you may decide
that the risk of database corruption is small and that you need to run dbcc only
occasionally. If the consequences of losing data are too high, continue to run
dbcc commands each time you back up a database.
Note For performance considerations, many sites choose to run dbcc checks
outside of peak hours or on separate servers.
Keeping records
Keeping records about your Adaptive Server system is an important part of
your job as a system administrator. Accurate records of changes and problems
that you have encountered can be a valuable reference when you are contacting
Sybase Technical Support or recovering databases. They can also provide vital
information for administrators who manage the Adaptive Server system in
your absence.
Contact information
Maintain a list of contact information for yourself as well as the System
Security Officer, Operator, and database owners on your system. Also, record
secondary contacts for each role. Make this information available to all
Adaptive Server users so that the appropriate contacts receive enhancement
requests and problem reports.
Configuration information
Ideally, create databases and database objects, and configure Adaptive Server
using script files that you store in a safe place. Storing the script files makes it
possible to re-create your entire system in the event of a disaster. You can also
use script files to quickly re-create database systems for evaluation purposes on
new hardware platforms. If you use a third-party tool to perform system
administration, remember to generate equivalent scripts after performing
administration tasks.
Consider recording the following kinds of information:
• Commands used to create databases and database objects (DDL scripts)
• Commands that add new Adaptive Server logins and database users
• The current Adaptive Server configuration file, as described in “Using
sp_configure with a configuration file” on page 69
• The names, locations, and sizes of all files and raw devices initialized as
database devices
Maintain a dated log of all changes to the Adaptive Server configuration. Mark
each change with a brief description of when and why you made the change, as
well a summary of the end result.
Maintenance schedules
Keep a calendar of regularly scheduled maintenance activities; list any of the
procedures you perform at your site:
• Using dbcc to check database consistency
• Backing up user and system databases
• Monitoring the space left in transaction logs (if this is not done
automatically)
System information
Record information about the hardware and operating system on which you run
Adaptive Server, including:
• Copies of operating system configuration files or start-up files
• Copies of network configuration files (for example, the hosts and services
files)
• Names and permissions for the Adaptive Server executable files and
database devices
• Names and locations of the tape devices used for backups
• Copies of operating system scripts or programs for automated backups,
starting Adaptive Server, or performing other administration activities
Additional resources
The amount of information for system administrators to learn may seem
overwhelming. There are several software tools that can help you learn and
facilitate basic administration tasks. These include Adaptive Server Monitor,
used for monitoring server performance and other activities, and Sybase
Central, which simplifies many administration tasks. There are also many
third-party software packages available designed to help system administrators
manage daily maintenance activities.
• Visually represent objects – You can see the databases and logins in each
Adaptive Server and the objects in each database, and windows expand
and contract to display information about databases and logins. The
Adaptive Server plug-in expands to display information about many
items, including:
• Databases and tables
• Disk devices
• Active processes and locks
• Logins and users
• Data caches
• ASE Replicator, Job Scheduler, and Messaging Services
• Access to other utilities such as Interactive SQL (for sending queries
and displaying query results).
• Navigate between related objects – To get more information about a
database object related to the one whose property sheet you are displaying,
navigate directly through the displayed object’s dialog box to the related
object.
• Create a cluster – The Adaptive Server plug-in allows you to create a
cluster if you have purchased Adaptive Server Cluster Edition. See the
online help and the User Guide to Clusters.
• Generating the SQL text for creating an object (which allows you to
reverse engineer Adaptive Server objects)
• Deleting an object
• Configuring Adaptive Server
• Managing:
• Database devices
• Proxy and temporary databases
• Indexes
• Partitions
• Segments
• Triggers
• Logins and roles
• Views
• ASE Replicator
• Configuring Adaptive Server jobs with Job Scheduler
• Starting and stopping Adaptive Server
• Executing queries
• Logging SQL statements generated by the plug-in, based on a user’s
actions.
If you do not enter a size, Adaptive Server allocates either the value of the
database size configuration variable or the size of the model database,
whichever is larger.
If you have limited storage and must put the transaction log and the data on the
same logical device, specifying With Override allows Adaptive Server to
maintain the log on separate device fragments from the data.
You cannot remove or change a database device after creating the database
unless you first delete the database.
Note Sybase recommends that you back up the master database after you
delete a user database.
Adding a user Database owners can add and delete users in the databases they own.
To create a user:
1 Expand the databases folder (select the “+” icon) and select the Users
folder.
2 Choose File | New | User.
The Add a New User wizard opens and asks for this information:
Table 4-2: Inputs to Add a New User wizard
Input Description
Name A name for the user. The name does not have to be the same as the
login.
Login name Login to which this user is assigned.
Group Optionally, assign a group to the user. Default: public
Note A user can be a member of one assigned group or the default “public”
group.
You can also select the Users folder. In the right pane, double-click the Add
User icon.
Deleting a user You cannot delete a user who owns objects. Since there is no command to
transfer ownership of objects, you must delete objects owned by a user before
you can delete the user. Also, you cannot delete a user who has granted
permissions to other users without first revoking the permissions with cascade.
If appropriate, re-grant the permissions to the other users.
Locking a login is a simple alternative to deleting a user.
To delete a user:
1 Select the user icon.
2 Choose Edit | Delete.
3 Confirm the deletion in the confirmation dialog box.
You can also select the user folder by right-clicking on the user icon and select
Delete.
Before you delete a user:
1 Revoke the user’s command and object permissions with cascade.
2 Re-grant the permissions to the other users, if appropriate.
3 Delete the user’s objects.
Creating a table Only a database owner or a user with create table permission can create a table.
To create a table:
1 In a database you are working in, select the User Tables folder.
2 Choose File | New | Table or click on the Add Table icon in the User Tables
folder.
The Table Editor opens.
3 In the Name box, enter a name.
4 From the Owner list, choose an owner. The default is “dbo”.
You can also select the User Tables folder. In the right pane, double-click the
Add Table icon.
Deleting a table Before you delete a table, be sure that no other objects reference it. If any
objects reference it, edit those objects to avoid errors. To find out if other
objects reference a table, check its dependencies.
Note When you delete a table, Adaptive Server deletes the indexes and triggers
associated with the table and unbinds the rules or defaults that are bound to its
columns.
Getting server status If the Unified Agent is monitoring Adaptive Server, check the server status by
any of the following:
• Click on the server group to which the server belongs. Check the Status
column in the Details pane of the server group.
• Click on the Adaptive Server Enterprise listed under Sybase Central, and
then click on Servers tab on the right hand side panel. The server status is
printed in the Status column.
• A green triangle on the lower right-hand side of the server icon indicates
that Adaptive Server is running. A red square indicates that Adaptive
Server is stopped.
Note By default, the Adaptive Server plug-in does not have Check Server
Status enabled. To enable Unified Agent to monitor Adaptive Server:
• Right click on Adaptive Server Enterprise and select Properties.
• Select Preferences and check “Enable Unified Agent (UA) related
features.”
Getting the server log If the Unified Agent is monitoring Adaptive Server, retrieve the server log by
selecting the server and clicking on the Server Log tab in the right-hand pane.
The server log is retrieved based on how you have configured the filter for the
the server log. To configure the server log filtering, right-click on the server
and select Server Log Filter. By default, the Adaptive Server plug-in retrieves
the last 1000 lines from the server log. You can configure the server filter to
retrieve:
• The entire log file.
• The last n number of lines.
• The log from the last n number of days.
• The lines that match the regular expression
Logging SQL To log all SQL statements executed through the Adaptive Server plug-in:
statements
• Right click on a server and select “Log SQL Statement.”
• Select whether you want SQL statements logged directly to a window or
to a file.
Executing SQL Execute SQL statements from within the Adaptive Server plug-in by using the
statements Interactive SQL query tool. To start the Interactive SQL tool, you can either:
• Right-click the server on which you want to execute the SQL statements
and select Open Interactive SQL from the menu, or
1 Click on Adaptive Server Enterprise.
2 Click the Utilities tab on the right-hand pane and select Interactive SQL
Execute SQL statements simultaneously on a set of servers belonging to a
server group:
1 Right -click the server group and choose Execute SQL.
2 Select the servers on which you want to execute the SQL statements
3 Click Execute.
The result set for each server is listed in the Result Set pane of the SQL
Execution dialog.
Viewing SQL Use the Adaptive Server plug-in to view a GUI version of the SQL execution
execution plan and plan for individual queries (much like a GUI version of showplan) and
cost information
execution plans for all queries in a stored procedure. This GUI display includes
nodes for each of the operators of the execution plan.
To get the GUI plan:
1 Start Interactive SQL.
2 Execute the query or stored procedure
3 Click on the plan tab in the Results pane of Interactive SQL
4 Select a query from the queries drop down list.
5 Click the Details tab to see the GUI plan of the selected query. Click on an
operator node to see the detailed statistics for that node.
6 Click on the XML tab to see an XML representation of the execution plan
for the selected query
7 Click on the Text tab to see the execution plan in a text format for the
submitted queries
For more information about Interactive SQL, see “Starting Interactive
SQL” on page 61.
Viewing and updating View and modify the configuration of any object represented in the Adaptive
object properties Server plug-in using the Property dialog.
To bring up the Property dialog:
1 Click on the object you want to view or modify.
Overview
Configuration parameters are user-definable settings that control various
aspects of Adaptive Server behavior. Adaptive Server supplies default
values for all configuration parameters. Use configuration parameters to
tailor Adaptive Server for an installation’s particular needs.
Read this chapter carefully to determine which configuration parameters
you should reset to optimize server performance.
• allow sendmsg
• auditing
• enable ssl
• select on syscomments.text
Note When you are configuring memory-related parameters, use only the P
(page size) parameter for your unit specification. If you use any other
parameter to configure memory related parameters, Adaptive Server may issue
an arithmetic overflow error message.
number of open indexes sets the maximum number of indexes that can be open at
one time on SQL Server. The default value is 500.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
100 2147483647 500 500 208
Using sp_configure
sp_configure displays and resets configuration parameters. You can restrict the
number of parameters that sp_configure shows by using sp_displaylevel to set
your display level to one of:
• Basic
• Intermediate
• Comprehensive
For information about display levels, see “User-defined subsets of the
parameter hierarchy: display levels” on page 75. For information about
sp_displaylevel, see the Reference Manual: Procedures.
Table 5-1 describes the syntax for sp_configure. The information in the
“Effect” column assumes that your display level is set to “comprehensive.”
Table 5-1: sp_configure syntax
Command Effect
sp_configure Displays all configuration parameters by group, their current values, their
default values, the value to which they have most recently been set, and
the amount of memory used by this particular setting.
sp_configure “parameter” Displays current value, default value, most recently changed value, and
amount of memory used by the specified parameter.
sp_configure “parameter”, value Resets parameter to value.
Command Effect
sp_configure “parameter”, 0, “default” Resets the specified parameter to its default value.
sp_configure “group_name” Displays all configuration parameters in group_name, their current values,
their default values, the values to which they were recently set, and the
amount of memory used by each.
sp_configure “configuration file”, 0, Sets configuration parameters from the configuration file. See “Using
“sub_command”, “file_name” sp_configure with a configuration file” on page 69 for descriptions of the
parameters.
Syntax elements
The commands in Table 5-1 use the following variables:
• parameter – is any valid Adaptive Server configuration parameter or
parameter substring.
• value – is any integer within the valid range for that parameter. (See the
descriptions of the individual parameters for valid range information.)
Parameters that work as toggles have only two valid values: 1 (on) and 0
(off).
• group_name – is the name of any group in the parameter hierarchy.
Parameter parsing
sp_configure parses each parameter (and parameter name fragment) as
“%parameter%”. A string that does not uniquely identify a particular
parameter returns values for all parameters matching the string.
The following example returns values for all configuration parameters that
include “lock,” such as lock shared memory, number of locks, lock promotion
HWM, server clock tick length, print deadlock information, and deadlock retries:
sp_configure "lock"
Note If you attempt to set a parameter value with a nonunique parameter name
fragment, sp_configure returns the current values for all parameters matching
the fragment and asks you to specify a unique parameter name.
• “DEFAULT” – specifies that you want to use the default value for
parameter_name.
Examples Example 1 This example specifies that the transaction can retry its attempt to
acquire a lock one time when deadlocking occurs during an index page split or
shrink:
deadlock retries = 1
Example 2 This example specifies that the default value for the parameter
cpu accounting flush interval should be used:
Note You must set permissions accordingly on each configuration file created.
The syntax for displaying all groups and their associated parameters, and the
current values for the parameters, is:
sp_configure
The following is the syntax for displaying a particular group and its associated
parameter:
sp_configure "group_name"
For example, to display the disk I/O group, enter:
sp_configure "Disk I/O"
Group: Disk I/O
Parameter Name Default Memory Used Config Value Run Value
unit type
-------------- ------- ----------- ------------ ---------
------ -------------
allow sql server async i/o 1 0 1 1
switch static
diable disk mirroring 1 0 1 1
switch static
disk i/o structures 256 0 256 256
number dynamic
number of devices 10 0 10 10
number dynamic
number of large I/O buffers 6 12352 6 6
number dynamic
page utilization percent 95 0 95 95
percent dynamic
The default display level is comprehensive. When you set your display level,
the setting persists across multiple sessions. However, you can reset it at any
time.
• Basic – shows only the most basic parameters, and is appropriate for
general server tuning.
• Intermediate – includes parameters that are somewhat more complex, in
addition to the basic parameters.
• Comprehensive – includes all the parameters, including the most complex
ones. This level is appropriate for users doing highly detailed server
tuning.
The syntax for showing your current display level is:
sp_displaylevel
To set the display level, use:
sp_displaylevel user_name[, basic | intermediate | comprehensive]
where user_name is your Adaptive Server login name.
Parameter Name Default Memory Used Config Value Run Value Unit Type
--------------- ------- ----------- ------------ --------- ---- ----
default character set 1 0 1 1 id static
default language id 0 0 0 0 id dyna
. . .
This represents only a subset of the parameters in the languages group; some
language parameters appear only when your display level is comprehensive.
[Instance:ase1]
max online engines = 5
[Instance:ase2]
max online engines = 3
See the Users Guide to Clusters.
sp_configure output
The sample output below shows the type of information sp_configure prints if
your display level is comprehensive, and you execute sp_configure with no
parameters. The values it prints vary, depending on your platform and on what
values you have already changed.
sp_configure
Group: Configuration Options
Group: Backup/Recovery
Parameter Name Default Memory Used Config Value Run Value Unit Type
-------------- ------- ----------- ------------ --------- ---- ----
allow remote access 1 0 1 1 switch dyn
print recovery info 0 0 0 0 switch dyn
recovery interval in m 5 0 5 5 minutes dyn
...
Where:
• The “Default” column displays the default value. If you do not explicitly
reconfigure a parameter, it retains its default value.
• “Memory Used” shows the amount of memory, in kilobytes, used by the
parameter at its current value. Some related parameters draw from the
same memory pool. For instance, the memory used for stack size and stack
guard size is already accounted for in the memory used for number of user
connections. If you added the memory used by each of these parameters
separately, the sume is more than the amount actually used. Parameters
that “share” memory with other parameters are marked with a hash mark
(“#”).
• “Config Value” displays the most recent value to which the configuration
parameter has been set. When you execute sp_configure to modify a
dynamic parameter:
• The configuration and run values are updated.
• The configuration file is updated.
• The change takes effect immediately.
When you modify a static parameter:
The value column in the sysconfigures table records the last value set from
sp_configure or the configuration file; the value column in syscurconfigs stores
the value currently in use. For dynamic parameters, the two values match; for
static parameters, which require a restart of the server to take effect, the two
values are different if the values have been changed since Adaptive Server was
last started. The values may also be different when the default values are used.
In this case, sysconfigures stores 0, and syscurconfigs stores the value that
Adaptive Server computes and uses.
sp_configure performs a join on sysconfigures and syscurconfigs to display the
values reported by sp_configure.
Configuration parameters
In many cases, the maximum allowable values for configuration parameters are
usually limited by available memory, rather than by sp_configure limitations.
Note To find the maximum supported values for your platform and version of
Adaptive Server, see “Adaptive Server Specifications” in the Installation
Guide for your platform.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
abstract plan cache enables caching of abstract plan hash keys. See Chapter 12,
“Creating and Using Abstract Plans” in the Performance and Tuning Series:
Query Processing and Abstract Plans. abstract plan load must be enabled for
plan caching to take effect.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
abstract plan dump enables the saving of abstract plans to the ap_stdout abstract
plans group. See Chapter 12, “Creating and Using Abstract Plans” in the
Performance and Tuning Series: Query Processing and Abstract Plans.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Summary information
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
abstract plan load enables association of queries with abstract plans in the
ap_stdin abstract plans group. See Chapter 12, “Creating and Using Abstract
Plans” in the Performance and Tuning Series: Query Processing and Abstract
Plans.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
abstract plan replace enables plan replacement for abstract plans in the
ap_stdout abstract plans group. See Chapter 12, “Creating and Using Abstract
Plans” in the Performance and Tuning Series: Query Processing and Abstract
Plans. abstract plan load must be enabled for replace mode to take effect.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication, Physical
Memory
additional network memory sets the maximum size of additional memory that
can be used for network packets that are larger than the default packet size.
Adaptive Server rounds down the value you enter to the nearest 2K value. The
default value indicates that no extra space is allocated for large packets.
When a login requests a large packet size, Adaptive Server verifies it has
sufficient memory available to satisfy the request. If it does not, Adaptive
Server finds the largest available block of memory and tries the appropriate
size (which is a multiple of default network packet size) less than the largest
memory block. If that fails, Adaptive Server decreases the value of the request
by the number of bytes equal to default network packet size, if this is available.
Adaptive Server continues for 10 iterations, or until the size equals the value of
default network packet size, whichever comes first. On the tenth iteration,
Adaptive Server uses the value of the default network packet size for the packet
size.
If you increase max network packet size, you must increase additional network
memory because all allocated network memory is reserved for users at the
default size. Adaptive Server guarantees that every user connection can log in
at the default packet size.
If you increase max network packet size but do not increase additional network
memory, Adaptive Server does not guarantee that clients who request network
packet sizes larger than the default size can login at the requested packet size.
Increasing additional network memory may improve performance for
applications that transfer large amounts of data. To determine the value for
additional network memory when your applications use larger packet sizes:
1 Estimate the number of simultaneous users who will request the large
packet sizes, and the sizes their applications will request,
2 Multiply this sum by three, since each connection needs three buffers,
3 Add two percent for overhead for 32-bit servers, or four percent for 64-bit
servers, and
4 Round the value to the next highest multiple of 2048.
For example, if you estimate these simultaneous needs for larger packet sizes:
Application Packet size Overhead
bcp 8192
Client-Library 8192
Client-Library 4096
Client-Library 4096
Total 24576
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Physical Memory
allocate max shared memory determines whether Adaptive Server allocates all
the memory specified by max memory at start-up or only the amount of memory
the configuration parameter requires.
By setting allocate max shared memory to 0, you ensure that Adaptive Server
uses only the amount of shared memory required by the current configuration,
and allocates only the amount of memory required by the configuration
parameters at start-up, which is a smaller value than max memory.
If you set allocate max shared memory to 1, Adaptive Server allocates all the
memory specified by max memory at start-up. If you set allocate max shared
memory to 1, and if you increase max memory, Adaptive Server attempts to
allocate the memory immediately. If the memory allocation fails, Adaptive
Server writes messages to the error log. Check the error log to verify that no
errors have occurred.
A successful memory allocation means that Adaptive Server always has the
memory required for any memory configuration changes you make and there
is no performance degradation while the server readjusts for additional
memory. However, if you do not predict memory growth accurately, and max
memory is set to a large value, you may waste total physical memory.
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Query Tuning
allow backward scans controls how the optimizer performs select queries that
contain the order by...desc command:
• When the value is set to 1, the optimizer can access the index or table rows
by following the page chain in descending index order.
• When the value is set to 0, the optimizer selects the rows into a worktable
by following the index page pointers in ascending order, and then sorts the
worktable in descending order.
The first method—performing backward scans—can speed access to tables
that need results ordered by descending column values. Some applications,
however, may experience deadlocks due to backward scans. In particular, look
for increased deadlocking if you have delete or update queries that scan
forward using the same index. There may also be deadlocks due to page splits
in the index.
Use print deadlock information to send messages about deadlocks to the error
log. See “print deadlock information” on page 223. Alternatively, you can use
sp_sysmon to check for deadlocking. See the Performance and Tuning Series:
Locking and Concurrency Control.
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
allow nested triggers controls the use of nested triggers. When the value is set
to 1, data modifications made by triggers can fire other triggers. Set allow
nested triggers to 0 to disable nested triggers. A set option, self_recursion,
controls whether the modifications made by a trigger can cause that trigger to
fire again.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System security officer
Configuration group Security Related
allow procedure grouping controls the ability to group stored procedures of the
same name so that they can be dropped with a single drop procedure statement.
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration groups Backup/Recovery, Network Communication
allow remote access controls logins from remote Adaptive Servers. The default
value of 1 allows Adaptive Server to communicate with Backup Server.
Since other system administration actions are required to enable remote servers
other than Backup Server to execute RPCs, leaving this option set to 1 does not
constitute a security risk.
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
allow resource limits controls the use of resource limits. When the value is set to
1, the server allocates internal memory for time ranges, resource limits, and
internal server alarms. The server also internally assigns applicable ranges and
limits to user sessions. The output of showplan and statistics io displays the
optimizer’s cost estimate for a query. Set allow resource limits to 0 to disable all
resource limits.
allow sendmsg
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System security officer
Configuration group Network Communication
Summary information
Default value 1 (on)
Summary information
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Disk I/O
allow sql server async i/o enables Adaptive Server to run with asynchronous
disk I/O. To use asynchronous disk I/O, enable it on both Adaptive Server and
your operating system. See your operating system documentation for
information on enabling asynchronous I/O at the operating system level.
Disk I/O always runs faster asynchronously than synchronously. This is
because when Adaptive Server issues an asynchronous I/O, it does not have to
wait for a response before issuing further I/Os.
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
allow updates to system tables enables users with the system administrator role
to make changes to the system tables and to create stored procedures that can
modify system tables. A database administrator can update system tables in
any tables that he or she owns if allow updates to system tables is enabled.
System tables include:
• All Sybase-supplied tables in the master database
• All tables in user databases that begin with “sys” and that have an ID value
in the sysobjects table of less than or equal to 100
Stored procedures and triggers you create while allow updates to system tables
is set on can update the system tables, even after the parameter has been set off.
When you set allow updates to system tables to on, you create a “window of
vulnerability,” a period of time during which users can alter system tables or
create a stored procedure with which the system tables can be altered in the
future.
Because the system tables are so critical, Sybase suggests that you set this
parameter to on only in highly controlled situations. To guarantee that no other
users can access Adaptive Server while the system tables can be directly
updated, restart Adaptive Server in single-user mode. For details, see
startserver and dataserver in the Utility Guide.
Note The server-wide configuration option allow updates to system tables takes
precedence over the stored procedure settings for allow updates to system
tables. If you do not enable allow updates to system tables at the server level,
individual stored procedure settings determine whether you can modify system
catalogs.
Summary information
Default value 200
Range of values 100 – 10000
Status Static
Display level
Required role
Configuration group Diagnostics
Summary information
Default value 100
Range of values 1 – 65535
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration groups Memory Use, Security Related
The in-memory audit queue holds audit records generated by user processes
until the records can be processed and written to the audit trail. To change the
size of an audit queue, a system security officer can use audit queue size. When
you configure the queue suze, there is a trade-off between performance and
risk. If the queue is too large, records can remain in it for some time. As long
as records are in the queue, they are at risk of being lost if the system fails.
However, if the queue is too small, it can repeatedly become full, which affects
overall system performance; user processes that generate audit records sleep if
the audit queue is full.
Following are some guidelines for determining how big your audit queue
should be. You must also take into account the amount of auditing to be
performed at your site.
• The memory requirement for a single audit record is 424 bytes; however,
a record can be as small as 22 bytes when it is written to a data page.
• The maximum number of audit records that can be lost in a system failure
is the size of the audit queue (in records), plus 20. After records leave the
audit queue, they remain on a buffer page until they are written to the
current audit table on the disk. The pages are flushed to disk every 20
records, less if the audit process is not constantly busy.
• In the system audit tables, the extrainfo field and fields containing names
are of variable length, so audit records that contain complete name
information are generally larger.
The number of audit records that can fit on a page varies from 4 to as many as
80 or more. The memory requirement for the default audit queue size of 100 is
approximately 42K.
auditing
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
Summary information
Default value 1
Valid values 1 (enabled), 0 (disabled)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level
Required role
Configuration group Query tuning
Summary information
Default value 50
Range of values 5 – 50
Status Static
Display level
Required role
Configuration group Diagnostics
Summary information
Default value 0 (off)
Summary information
Range of values 1 (on), 0 (off)
Status Dynamic
Display level 10
Required role System security officer
Configuration group Security Related
The system security officer can tell the server to check for at least one character
or digit in a password using the server-wide configuration parameter check
password for digit. If set, this parameter does not affect existing passwords.
Summary information
Default value 512
Valid values 512 – 2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
CIPC large message pool size specifies the number of large message buffers
allocated by CIPC at start-up time.
Summary information
Default value 8192
Valid values 2048 – 2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
CIPC regular message pool size specifies the number of regular message buffer
allocated by CIPC at start-up time.
Summary information
Default value 50
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
When performing a bulk transfer of data from one Adaptive Server to another
Adaptive Server, CIS internally buffers rows, and asks the Open Client bulk
library to transfer them as a block. The size of the array is controlled by cis bulk
insert array size.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis bulk insert batch size determines how many rows from the source tables are
to be bulk copied into the target table as a single batch using select into.
If you leave cis bulk insert batch size at 0, all rows are copied as a single batch.
Otherwise, after the count of rows specified by this parameter has been copied
to the target table, the server issues a bulk commit to the target server, causing
the batch to be committed.
If a normal client-generated bulk copy operation (such as that produced by the
bcp utility) is received, the client is expected to control the size of the bulk
batch, and the server ignores the value of this configuration parameter.
Summary information
Default value 0
Range of values 0–32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis connect timeout determines the wait time, in seconds, for a successful
Client-Library connection.
Summary information
Default value 50
Range of values 1 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis cursor rows specifies the cursor row count for cursor open and cursor fetch
operations. Increasing this value means more rows are fetched in one
operation. This increases speed but requires more memory.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis idle connection timeout configures Adaptive Server to check for CIS
connections to any remote server that have been unused longer than the
specified number of seconds. Adaptive Server deletes the unused connections
and reallocates their resources.
Although the number you specify is in seconds, the housekeeper task wakes up,
at most , once a minute, so idle connections may be idle for much longer than
the configured value. Adaptive Server does not drop idle connections if a
transaction is active on the connection, and reestablishes the connection
automatically if the user executes any command that accesses the connection.
Summary information
Default value 512
Range of values 512–32768
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis packet size specifies the size of Tabular Data Stream™ (TDS) packets that
are exchanged between the server and a remote server when a connection is
initiated.
The default packet size on most systems is 512 bytes, and this may be adequate
for most applications. However, larger packet sizes may result in significantly
improved query performance, especially when text, unitext, and image or bulk
data is involved.
If you specify a packet size larger than the default, then the target server must
be configured to allow variable-length packet sizes, using:
• additional netmem
Summary information
Default value 0 (off), default value of 1 for the Cluster Edition
Valid values 0 (off), 1 (on)
Summary information
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
cis rpc handling specifies the default method for remote procedural call (RPC)
handling. Setting cis rpc handling to 0 sets the Adaptive Server site handler as
the default RPC handling mechanism. Setting the parameter to 1 forces RPC
handling to use Component Integration Service access methods. See set cis rpc
handling in the Component Integration Services Users Guide.
Summary information
Default value 10
Valid values 1– 127
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared Disk Cluster
cluster heartbeat interval controls the interval that cluster instances use to send
and check the heartbeat status.
Using a lower value for cluster heartbeat interval reduces the failure detection
time but increases the risk of a false failure because of a transient problem
(such as an overloaded CPU). Tuning cluster heartbeat interval to a larger value
reduces the risk of a false failure but increases the time needed to detect a
failure.
Summary information
Default value 1
Valid values 1– 127
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group Shared disk cluster
cluster heartbeat retries controls the number of times an instance retries a failed
cluster heartbeat before entering failure mode.
Tuning cluster heartbeat retries to a lower value reduces the time to detect
failure but increases the risk of a false failure because of a transient problem
(such as an overloaded CPU). Tuning cluster heartbeat retries to a larger value
reduces the risk of a false failure but increases the time needed to detect a
failure.
Summary information
Default value 60
Valid values 1– 127
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
cluster vote timeout controls the maximum amount of time an instance waits for
other instances to vote during the voting period. An instance waits only for
those instances which it believes are running.
Tuning cluster vote timeout to a lower value can reduce failover time, but
increases the risk that an instance that is running is excluded from the new
cluster view. Tuning cluster vote timeout to a larger value reduces the risk that
an running instance is excluded from the new cluster view, but may increase
failover time.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group Physical Memory
configuration file
Summary information
Default value 0 (off)
Range of values One of: 0, verify, read, write, or restore
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group General Information
configuration file specifies the location of the configuration file currently in use.
See “Using sp_configure with a configuration file” on page 69 for a complete
description of configuration files.
In sp_configure output, the “Run Value” column displays only 10 characters, so
the output may not display the entire path and name of your configuration file.
cost of a logical io
Summary information
Default value 2
Range of values 0 – 254
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
cost of a physical io
Summary information
Default value 25
Range of values 0 – 254
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 1000
Range of values 1 – 65534
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 200
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
cpu accounting flush interval specifies the amount of time, in machine clock
ticks (non-Adaptive Server clock ticks), that Adaptive Server waits before
flushing CPU usage statistics for each user from sysprocesses to syslogins, a
procedure used in charge-back accounting.
When a user logs in to Adaptive Server, the server begins accumulating figures
for CPU usage for that user process in sysprocesses. When a user logs off
Adaptive Server, or when the value of cpu accounting flush interval is exceeded,
the accumulated CPU usage statistics are flushed from sysprocesses to
syslogins. These statistics continue accumulating in syslogins until you clear
the totals. Display the current totals from syslogins using sp_reportstats.
The value to which you set cpu accounting flush interval depends on the type of
reporting you intend to do. If you run reports on a monthly basis, set cpu
accounting flush interval to a relatively high value. With infrequent reporting, it
is less critical that the data in syslogins be updated frequently.
However, if you perform periodic ad hoc selects on the totcpu column in
syslogins to determine CPU usage by process, set cpu accounting flush interval
to a lower value to increase the likelihood of the data in syslogins being up-to-
date when you execute your selects.
Setting cpu accounting flush interval to a low value may cause the lock manager
to mistakenly identify processes as potential deadlock victims. When the lock
manager detects a deadlock, it checks the amount of CPU time accumulated by
each competing processes. The process with the lesser amount is chosen as the
deadlock victim and is terminated by the lock manager. Additionally, when cpu
accounting flush interval is set to a low value, the task handlers that store CPU
usage information for processes are initialized more frequently, thus making
processes appear as if they have accumulated less CPU time than they actually
have. Because of this, the lock manager may select a process as the deadlock
victim when, in fact, that process has more accumulated CPU time than the
competing process.
If you do not intend to report on CPU usage at all, set cpu accounting flush
interval to its maximum value. This reduces the number of times syslogins is
updated, and reduces the number of times its pages must be written to disk.
Summary information
Default value 500
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
cpu grace time, together with time slice, specifies the maximum amount of time
that a user process can run without yielding the CPU before Adaptive Server
preempts it and terminates it with a timeslice error. The units for cpu grace time
are time ticks, as defined by sql server clock tick length. See “sql server clock
tick length” on page 244.
When a process exceeds cpu grace time Adaptive Server “infects” it by
removing the process from the internal queues. The process is killed, but
Adaptive Server is not affected. This prevents runaway processes from
monopolizing the CPU. If any of your user processes become infected, you
may be able to temporarily fix the problem by increasing the value of cpu grace
time. However, be sure that the problem really is a process that takes more than
the current value of cpu grace time to complete, rather than a runaway process.
Summary information
Default value 1
Range of values 0–8
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
current audit table establishes the table where Adaptive Server writes audit
rows. A system security officer can change the current audit table, using:
sp_configure "current audit table", n
[, "with truncate"]
where n is an integer that determines the new current audit table, as follows:
• 1 means sysaudits_01, 2 means sysaudits_02, and so forth, up to 8.
• 0 tells Adaptive Server to set the current audit table to the next table. For
example, if your installation has three audit tables, sysaudits_01,
sysaudits_02, and sysaudits_03, Adaptive Server sets the current audit
table to:
• 2 if the current audit table is sysaudits_01
• 3 if the current audit table is sysaudits_02
• 1 if the current audit table is sysaudits_03
"with truncate" specifies that Adaptive Server should truncate the new table if it
is not already empty. sp_configure fails if this option is not specified and the
table is not empty.
Note If Adaptive Server truncates the current audit table, and you have not
archived the data, the table’s audit records are lost. Be sure that the audit data
is archived before using the with truncate option.
To execute sp_configure to change the current audit table, you must have the
sso_role active. You can write a threshold procedure to change the current audit
table automatically.
Summary information
Default value 500
Range of values 0–2147483
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
deadlock retries
Summary information
Default value 5
Range of values 0–2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
sp_sysmon reports on deadlocks and retries. See the Performance and Tuning
Series: Locking and Concurrency Control.
Summary information
Default value 1
Range of values 0–255
Status Static
Display level Intermediate
Required role System administrator
Configuration group Languages
default character set id specifies the number of the default character set used by
the server. The default is set at installation, and can be changed later with the
Sybase installation utilities. See Chapter 9, “Configuring Character Sets, Sort
Orders, and Languages.”
Summary information
Default value 3MB
Range of values 2a –10000
a. Minimum determined by server’s logical page size.
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
default database size sets the default number of megabytes allocated to a new
user database if create database is issued without any size parameters. A
database size given in a create database statement takes precedence over the
value set by this configuration parameter.
If most of the new databases on your Adaptive Server require more than one
logical page size, you may want to increase the default.
Note If you alter the model database, you must also increase the default
database size, because the create database command copies model to create a
new user database.
Summary information
Default value 5
Range of values 0–100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 0
Range of values 0–100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
default fill factor percent determines how full Adaptive Server makes each index
page when it is creating a new index on existing data, unless the fill factor is
specified in the create index statement. The fillfactor percentage is relevant only
when the index is created. As data changes, pages are not maintained at any
particular level of fullness.
default fill factor percent affects:
There is seldom a reason to change default fill factor percent, especially since
you can override it in the create index command. See “create index” in the
Reference Manual: Commands.
default language id
Summary information
Default value 0
Range of values 0–32767
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Languages
default language id is the number of the language that is used to display system
messages unless a user has chosen another language from those available on
the server. us_english always has an ID of NULL. Additional languages are
assigned unique numbers as they are added.
Summary information
Default value 2048
Range of values 512– 65024
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication, User
Environment
default network packet size configures the default packet size for all Adaptive
Server users. You can set default network packet size to any multiple of 512
bytes; values that are not even multiples of 512 are rounded down.
Memory for all users who log in with the default packet size is allocated from
the Adaptive Server memory pool, as set with total logical memory. This
memory is allocated for network packets when Adaptive Server is started.
Each Adaptive Server user connection uses:
• One read buffer
Use sp_sysmon to see how changing the default network packet size parameter
affects network I/O management and task switching. For example, try
increasing default network packet size and then checking sp_sysmon output to
see how this affects bcp for large batches. See the Performance and Tuning
Series: Monitoring Adaptive Server with sp_sysmon.
default sortorder id
Summary information
Default value 50
Range of values 0–255
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Languages
default sortorder id is the number of the sort order that is installed as the default
on the server. To change the default sort order, see Chapter 9, “Configuring
Character Sets, Sort Orders, and Languages.”
Summary information
Default value binary
Range of values Not currently used
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Unicode
default unicode sortorder is a string parameter that uniquely defines the default
Unicode sort order installed on the server. To change the Unicode default sort
order, see Chapter 9, “Configuring Character Sets, Sort Orders, and
Languages.”
Summary information
Default value binary
Range of values (not currently used)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Unicode
default XML sortorder is a string parameter that defines the sort order used by
the XML engine. A string parameter is used rather than a numeric parameter to
guarantee a unique ID. See Chapter 6, “XML Support for I18N” in XML
Services in Adaptive Server Enterprise.
Summary information
Default value 0 (disabled)
Summary information
Range of values 0 to 1
Status dynamic
Required role System administrator
Configuration group Query tuning
Summary information
Default value 0 (enabled)
Valid values 0 (enabled), 1 (disabled)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Languages
Summary information
Default value 1
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Disk I/O
disable disk mirroring enables or disables disk mirroring for Adaptive Server.
This is a global variable; Adaptive Server does not perform any disk mirroring
after this configuration parameter is set to 1 and Adaptive Server is restarted.
Setting disable disk mirroring to 0 enables disk mirroring.
Note You must disable disk mirroring if your Adaptive Server is configured
for failover.
Summary information
Default value 256
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Disk I/O, Memory Use
disk i/o structures specifies the initial number of disk I/O control blocks
Adaptive Server allocates at start-up.
User processes require a disk I/O control block before Adaptive Server can
initiate an I/O request for the process. The memory for disk I/O control blocks
is preallocated when Adaptive Server starts. To minimize the chance of
running out of disk I/O structures, you should configure disk i/o structures to as
high a value as your operating system allows. See your operating system
documentation for information on concurrent disk I/Os.
Use sp_sysmon to determine whether to allocate more disk I/O structures. See
the Performance and Tuning Series: Monitoring Adaptive Server with
sp_sysmon. You can set the max async i/os per server configuration parameter
to the same value as disk i/o structures. See “max async i/os per server” on page
159.
Summary information
Default value 4096
Valid values 2048 – 2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
DMA object pool size specifies the number of DMA (direct memory access)
objects allocated by CIPC at start-up time.
Summary information
Default value 0 (minutes)
Valid values 0 – 2147483647 (minutes)
Status Dynamic
Display level 10
Required role System administrator
Configuration group DTM Administration
dtm detach timeout period sets the amount of time, in minutes, that a distributed
transaction branch can remain in the detached state. In some X/Open XA
environments, a transaction may become detached from its thread of control
(usually to become attached to a different thread of control). Adaptive Server
permits transactions to remain in a detached state for the length of time
specified by dtm detach timeout period. After this time has passed, Adaptive
Server rolls back the detached transaction.
Summary information
Default value 300 (seconds)
Valid values 1 – 2147483647 (seconds)
Status Dynamic
Display level 10
Required role System administrator
Configuration group DTM Administration
dtm lock timeout period sets the maximum amount of time, in seconds, that a
distributed transaction branch waits for lock resources to become available.
After this time has passed, Adaptive Server considers the transaction to be in a
deadlock situation, and rolls back the transaction branch that triggered the
deadlock. This ultimately rolls back the entire distributed transaction.
Distributed transactions may potentially deadlock themselves if they propagate
a transaction to a remote server, and in turn, the remote server propagates a
transaction back to the originating server. This situation is shown in Figure 5-
2. The work of distributed transaction “dxact1” is propagated to Adaptive
Server 2 via “rpc1.” Adaptive Server 2 then propagates the transaction back to
the coordinating server via “rpc2.” “rpc2” and “dxact1” share the same gtrid but
have different branch qualifiers, so they cannot share the same transaction
resources. If “rpc2” is awaiting a lock held by “dxact1,” a deadlock situation
exists.
Figure 5-2: Distributed transaction deadlock
dxact1 ASE1
ASTC
rpc1 rpc2
ASE2
ASTC
The value of dtm lock timeout period applies only to distributed transactions.
Local transactions may use a lock timeout period with the server-wide lock wait
period parameter.
Note Adaptive Server does not use dtm lock timeout period to detect deadlocks
on system tables.
dump on conditions
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Group Diagnostics
Note The dump on conditions parameter is included for use only by Sybase
Technical Support. Do not modify it unless you are instructed to do so by
Sybase Technical Support.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Physical Memory
enable backupserver HA
Summary information
Default value 1
Valid values 1 (enabled), 0 (disabled)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
enable cis
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
enable DTM
Summary information
Default value 0 (off)
Valid values 0 (off), 1(on)
Status Static
Display level 10
Required role System administrator
Configuration groups DTM Administration, SQL Server Administration
Note The license information and the run value for enable DTM are
independent of each other. Whether or not you have a license for DTM, the run
value and the configuration value are set to 1 after you restart Adaptive Server.
You cannot run DTM until you install a valid license. If you have not installed
a valid license, Adaptive Server logs an error message and does not activate the
feature. See the installation guide for your platform for information about
installing license keys.
Summary information
Default value 0 (off)
Range of values 0 (off), 1(on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Security Related
You cannot set enable encrypted columns unless you have purchased, installed,
and registered the ASE_ENCRYPTION license on your server. Any attempt to
set it without such licensing results in Msg. 10834:
Configuration parameter 'enable encrypted columns'
cannot be enabled without license 'ASE_ENCRYPTION'
Note Using encrypted columns increases the logical memory used by 8198
kilobytes.
Summary information
Default value 0 (off)
Range of values 0 (off), 1(on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Java Services
enable enterprise java beans enables and disables EJB Server in the Adaptive
Server database. You cannot use EJB Server until the Adaptive Server is
enabled for EJB Server.
Note The license information and the run value for enable java beans are
independent of each other. Whether or not you have a license for Java, the run
value and the config value are set to 1 after you restart Adaptive Server. You
cannot run EJB Server until you have a license. If you have not installed a valid
license, Adaptive Server logs an error message and does not activate the
feature. See the installation guide for your platform for information about
installing license keys.
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Summary information
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
enable file access enables access through proxy tables to the external file
system. Requires a license for ASE_XFS.
Summary information
Default value 1
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Component Integration Services
enable HA
Summary information
Default value 0 (off)
Range of values 0–2
Status Static
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
Adaptive Server uses Sybase Failover to interact with the high availability
subsystem. You must set enable HA to 1 before you run the installhasvss script
(insthasv on Windows), which installs the system procedures for Sybase
Failover.
Note The license information and the run value for enable HA are independent
of each other. Whether or not you have a license for Sybase Failover, the run
value and the config value are set to 1 when you restart Adaptive Server. Until
you have a license, you cannot run Sybase Failover. If you have not installed a
valid license, Adaptive Server logs an error message and does not activate the
feature. See the installation guide for your platform for information about
installing license keys.
enable housekeeper GC
Summary information
Default value 1 (on)
Range of values 0–5
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
• 0 – disables the housekeeper garbage collection task, but enables the delete
command’s lazy garbage collection. You must use reorg reclaim_space to
deallocate empty pages. This is the cheapest option with the lowest
performance impact, but it may cause performance problems if many
empty pages accumulate. Sybase recommends that you do not use this
value.
• 1 – enables lazy garbage collection for the housekeeper garbage collection
task and the delete command. If more empty pages accumulate than your
application allows, consider options 4 or 5. You can use the optdiag utility
to obtain statistics of empty pages.
• 2 – reserved for future.
• 3 – reserved for future.
• 4 – enables aggressive garbage collection for the housekeeper garbage
collection task and the delete command. This option is the most effective,
but the delete command is expensive. This option is ideal if the deletes on
your DOL tables are in a batch.
• 5 – enables aggressive garbage collection for the housekeeper, and lazy
garbage collection for the delete command. This option is less expensive
for deletes than option 4. This option is suitable when deletes are caused
by concurrent transactions
sp_sysmon reports on how often the housekeeper garbage collection task
performed space reclamation and how many pages were reclaimed. See the
Performance and Tuning Series: Monitoring Adaptive Server with sp_sysmon.
Summary information
Default value 0
Valid values 1 (enabled), 0 (disabled)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
Setting enable i/o fencing to 1 enables I/O fencing for each database device that
supports the SCSI-3 Persistent Group Reservation (PGR) standard.
enable java
Summary information
Default value 0 (disabled)
Range of values 0 (disabled), 1 (enabled)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Java Services
enable java enables and disables Java in the Adaptive Server database. You
cannot install Java classes or perform any Java operations until the server is
enabled for Java.
Note The license information and the run value for enable java are independent
of each other. Whether or not you have a license for java, the run value and the
config value are set to 1 after you restart Adaptive Server. You cannot run Java
until you have a license. If you have not installed a valid license, Adaptive
Server logs an error message and does not activate the feature. See the
installation guide for your platform for information about installing license
keys.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
enable job scheduler determines whether Job Scheduler starts when Adaptive
Server starts.
Summary information
Default value 0 (off)
Valid values 0 (off) – allows only syslogins authentication.
1 (on) – allows both LDAP and syslogins
authentication.
2 (on) – allows only LDAP authentication.
Status Dynamic
Display level Comprehensive
Required role System security officer
Configuration group Security Related
When enable ldap user auth is 1, Adaptive Server searches the LDAP server to
authenticate each user. If the LDAP authentication fails, Adaptive Server
searches syslogins to authenticate the user. Use level 1 when you are migrating
users from Adaptive Server authentication to LDAP authentication.
Summary information
Default value 0
Range of values 1 (enabled), 0 (disabled)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 1
Range of values 0 (enabled), 1 (disabled)
Status Dynamic
Display level Comprehensive
Summary information
Required role System administrator
Configuration group Security Related
Summary information
Default value 2
Range of values 0 – disables merge joins at the server level.
1 – enables merge joins at the server level.
2 – sets merge joins to their default values at the
server level.
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
enable merge join enables or disables merge join at the server level.
The default value for merge join depends on current value of the optimization
goal configuration parameter:
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Summary information
Required role System administrator
Configuration group SQL Server Administration
enable metrics capture enables Adaptive Server to capture metrics at the server
level. Metrics for ad hoc statements are captured in the system catalogs;
metrics for statements in a stored procedure are saved in the procedure cache.
enable monitoring
Summary information
Default value 0 (off)
Range of values 0 (off), 1(on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
Summary information
Default value 0 (off)
Range of values 0 (off) – allows only syslogins authentication.
1 (on) – allows both PAM and syslogins authentication.
2 (on) – allows only PAM authentication.
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
enable pam user auth controls the ability to authenticate users using pluggable
authentication modules (PAM).
When enable pam user auth is set to 1, Adaptive Server uses the PAM provider
to authenticate each user. If the PAM authentication fails, Adaptive Server
searches syslogins to authenticate the user. Use level 1 when you are migrating
users from Adaptive Server authentication to PAM authentication.
enable pci
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on), 2 (on with operating system
override)
Status Dynamic
Display level Intermediate
Required role System Administrator
Configuration group User Environment
enable pci enables or disables the Java PCI Bridge for Adaptive Server.
Note Do not use setting “2” (on with operating system override) unless
instructed to do so by Sybase Technical Support. This setting enables the PCI
Bridge on operating system versions that may not fully or correctly support
PCI functionality.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Query Tuning
enable query tuning mem limit enables the query tuning memory limit.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Intermediate
Display level Intermediate
Required role System administrator
Configuration group Query Tuning
enable query tuning time limit enables the query tuning time limit.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
enable real time messaging enables the real time messaging services.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Rep Agent Thread Administration
enable rep agent threads enables the RepAgent thread within Adaptive Server.
Other steps are also required to enable replication. For more information, see
the Replication Server documentation.
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System security officer
Configuration group Security Related
enable row level access control enables row level access control. You must have
the security services license key enabled before you can configure enable row
level access control.
Summary information
Default value 0
Range of values 1 (enabled), 0 (disabled)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
Enables and disables the Adaptive Server SQL debugger, which allows you to
step through your T-SQL code.
enable ssl
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System security officer
Configuration group Security Related
Summary information
Default value 0 (off)
Summary information
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administration
Configuration group Monitoring
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Unicode
Summary information
Default value 1
Range of values 0 – uses only the built-in character-set conversion.
1 – uses the built-in conversion. If it cannot find a
built-in conversion, Adaptive Server uses the
Unilib character conversion
2 – uses the appropriate Unilib conversion
Status Dynamic
Display level Comprehensive
Summary information
Required role System administrator
Configuration groups Languages, Unicode
enable unicode conversion activates character conversion using Unilib for the
char, varchar, and text datatypes.
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Unicode
Note Once disabled, you can turn normalization on again. This prevents non-
normalized data from entering the data base.
enable webservices
Summary information
Default value 0
Range of values 1 (enabled), 0 (disabled)
Status Dynamic
Summary information
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Enables Webservices.
Summary information
Default value 1 (on)
Valid values 0 (off), 1(on)
Status Static
Display level 10
Required role System administrator
Configuration group DTM Administration
enable xml
Summary information
Default value 0
Range of values 1 (enabled), 0 (disabled)
Status Dynamic
Summary information
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level
Required role
Configuration group Physical Memory
engine memory log size is for diagnostic use only and has no relevance in a
production environment. It should be left at the default setting unless otherwise
requested by Sybase Tech Support.
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
errorlog pipe active controls whether Adaptive Server collects error log
messages. If both errorlog pipe active and errorlog pipe max messages are
enabled, Adaptive Server collects all the messages sent to the error log. Use
monErrorLog to retrieve these error log messages.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
errorlog pipe max messages determines the number of error log messages
Adaptive Server stores per engine. The total number of messages in the
monSQLText table is the value of sql text pipe max messages times the number
of engines running.
Summary information
Default value 8
Range of values 0–15
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Extended Stored Procedure
esp execution priority sets the priority of the XP Server thread for ESP
execution. Over long periods of time ESPs can be CPU-intensive. Also, since
XP Server resides on the same machine as Adaptive Server, XP Server can
impact Adaptive Server performance.
See the Open Server Server-Library/C Reference Manual for information
about scheduling Open Server threads.
Summary information
Default value 34816
Range of values 34816–214
Status Static
Summary information
Display level Comprehensive
Required role System administrator
Configuration group Extended Stored Procedure
esp execution stacksize sets the size of the stack, in bytes, to be allocated for
ESP execution.
Use this parameter if you have your own ESP functions that require a larger
stack size than the default, 34816.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Extended Stored Procedure
esp unload dll specifies whether DLLs that support ESPs should be
automatically unloaded from XP Server memory after the ESP call has
completed.
If esp unload dll is set to 0, DLLs are not automatically unloaded. If it is set to
1, they are automatically unloaded.
If esp unload dll is set to 0, you can still unload individual DLLs explicitly at
runtime, using sp_freedll.
Summary information
Default value 100
Range of values 1–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
event buffers per engine specifies the number of events per Adaptive Server
engine that can be monitored simultaneously by Adaptive Server Monitor.
Events are used by Adaptive Server Monitor for observing Adaptive Server
performance; if you are not using Adaptive Server Monitor, set this parameter
to 1.
The value to which you set event buffers per engine depends on the number of
engines in your configuration, the level of activity on your Adaptive Server,
and the types of applications you are running.
Setting event buffers per engine to a low value may result in the loss of event
information. The default value is likely to be too low for most sites. Values of
2000 and greater may be more reasonable for general monitoring. However,
experiment to determine the appropriate value for your site.
In general, setting event buffers per engine to a high value may reduce the
amount of performance degradation that Adaptive Server Monitor causes
Adaptive Server.
Each event buffer uses 100 bytes of memory. To determine the total amount of
memory used by a particular value for event buffers per engine, multiply the
value by the number of Adaptive Server engines in your configuration.
Summary information
Default value LocalSystem
Valid values • Name of an Windows machine on the network
configured to record Adaptive Server messages
• LocalSystem
• NULL
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Error Log
event log computer name specifies the name of the Windows PC that logs
Adaptive Server messages in its Windows Event Log. This feature is available
on Windows servers only.
A value of LocalSystem or NULL specifies the default local system.
You can also use the Server Config utility to set the event log computer name
parameter by specifying the Event Log Computer Name under Event Logging.
Setting the event log computer name parameter with sp_configure or specifying
the Event Log Computer Name under Event Logging overwrites the effects of
the command line -G option, if it was specified. If Adaptive Server was started
with the -G option, you can change the destination remote machine by setting
event log computer name.
Summary information
Default value 1
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Error Log
event logging enables and disables the logging of Adaptive Server messages in
the Windows Event Log.
The default value of 1 enables Adaptive Server message logging in the
Windows Event Log; a value of 0 disables it.
Use the Server Config utility to set the event logging parameter by selecting Use
Windows Event Logging under Event Logging.
Setting the event logging parameter or selecting Use Windows Event Logging
overwrites the effects of the command line -G option, if it was specified.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Calculated
Display level Basic
Required role System administrator
Configuration group Memory Use
Summary information
Default value 0
Range of values 0 – 31457280
Status Static
Display level Intermediate
Required role System administrator
Configuration group Cache Manager
Summary information
Default value 0
Range of values 0–1
Status Static
Display level Comprehensive
Required role System security officer
Configuration group Security related
Summary information
Default value 10
Range of values 0–100
Summary information
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Cache Manager
global async prefetch limit specifies the percentage of a buffer pool that can hold
the pages brought in by asynchronous prefetch that have not yet been read. This
parameter sets the limit for all pools in all caches for which the limit has not
been set explicitly with sp_poolconfig.
If the limit for a pool is exceeded, asynchronous prefetch is temporarily
disabled until the percentage of unread pages falls below the limit. See Chapter
6, “Tuning Asynchronous Prefetch” in the Performance and Tuning Series:
Basics.
Summary information
Default value 1
Range of values 1 – 64, as powers of 2
Status Static
Display level Intermediate
Required role System administrator
Configuration group Cache Manager
global cache partition number sets the default number of cache partitions for all
data caches. The number of partitions for a particular cache can be set using
sp_cacheconfig; the local value takes precedence over the global value.
Summary information
Default value 4K
Valid values 0 – 2147483647 bytes
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Physical Memory
heap memory per user configures the amount of heap memory per user. A heap
memory pool is an internal memory created at start-up that tasks use to
dynamically allocate memory as needed. This memory pool is important if you
are running tasks that use wide columns, which require a lot of memory from
the stack. The heap memory allocates a temporary buffer that enables these
wide column tasks to finish. The heap memory the task uses is returned to the
heap memory pool when the task is finished.
The size of the memory pool depends on the number of user connections.
Sybase recommends that you set heap memory per user to three times the size
of your logical page.
Summary information
Default value 20
Range of values 1 – 100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
histogram tuning factor controls the number of steps Adaptive Server analyzes
per histogram for update statistics, update index statistics, update all statistics,
and create index. A value of 1 disables the parameter.
Note For Adaptive Server versions 15.0.2 ESD #2 and later, if you set
histogram tuning factor to the default value of 20 and a large number of steps are
requested for the histogram, the actual step count used for the histogram is
limited to the value that reduces the procedure cache usage:
Summary information
Default value 1
Range of values 0–100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
housekeeper free write percent specifies the maximum percentage by which the
housekeeper wash task can increase database writes.
For example, to stop the housekeeper task from working when the frequency
of database writes reaches 5 percent above normal, set housekeeper free write
percent to 5.
When Adaptive Server has no user tasks to process, the housekeeper wash task
automatically begins writing changed pages from cache to disk. These writes
result in improved CPU utilization, decreased need for buffer washing during
transaction processing, and shorter checkpoints.
In applications that repeatedly update the same database page, the housekeeper
wash may initiate some unnecessary database writes. Although these writes
occur only during the server’s idle cycles, they may be unacceptable on
systems with overloaded disks.
The table and index statistics that are used to optimize queries are maintained
in memory structures during query processing. When these statistics change,
the changes are not written to the systabstats table immediately, to reduce I/O
contention and improve performance. Instead, the housekeeper chores task
periodically flushes statistics to disk.
The default value allows the housekeeper wash task to increase disk I/O by a
maximum of 1 percent. This results in improved performance and recovery
speed on most systems.
To disable the housekeeper wash task, set the value of housekeeper free write
percent to 0.
Set this value to 0 only if disk contention on your system is high, and it cannot
tolerate the extra I/O generated by the housekeeper wash task.
If you disable the housekeeper tasks, keep statistics current. Commands that
write statistics to disk are:
• update statistics
• dbcc checkdb (for all tables in a database) or dbcc checktable (for a single
table)
• sp_flushstats
Run one of these commands on any tables that have been updated since the last
time statistics were written to disk, at the following times:
• Before dumping a database
• Before an orderly shutdown
• After restarting, following a failure or orderly shutdown; in these cases,
you cannot use sp_flushstats—you must use update statistics or dbcc
commands
• After any significant changes to a table, such as a large bulk copy
operation, altering the locking scheme, deleting or inserting large numbers
of rows, or performing a truncate table command
To allow the housekeeper wash task to work continuously, regardless of the
percentage of additional database writes, set housekeeper free write percent to
100.
Use sp_sysmon to monitor housekeeper performance. See the Performance
and Tuning Series: Monitoring Adaptive Server with sp_sysmon.
You might also want to look at the number of free checkpoints initiated by the
housekeeper task. The Performance and Tuning Series: Basics describes this
output.
Summary information
Default value 1000
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
i/o accounting flush interval specifies the amount of time, in machine clock ticks,
that Adaptive Server waits before flushing I/O statistics for each user from
sysprocesses to syslogins. This is used for charge-back accounting.
When a user logs in to Adaptive Server, the server begins accumulating I/O
statistics for that user process in sysprocesses. When the value of i/o accounting
statistics interval is exceeded, or a user logs off Adaptive Server, the
accumulated I/O statistics for that user are flushed from sysprocesses to
syslogins. These statistics continue accumulating in syslogins until you clear
the totals by using sp_clearstats. You can display the current totals from
syslogins by using sp_reportstats.
The value to which you set i/o accounting flush interval depends on the type of
reporting you intend to do. If you run reports on a monthly basis, set i/o
accounting flush interval to a relatively high value. With infrequent reporting, it
is less critical that the data in syslogins be updated frequently.
If you perform periodic ad hoc selects on the totio column syslogins to
determine I/O volume by process, set i/o accounting flush interval to a lower
value. Doing so increases the likelihood of the data in syslogins being current
when you execute your selects.
If you do not report on I/O statistics at all, set i/o accounting flush interval to its
maximum value. This reduces the number of times syslogins is updated and the
number of times its pages must be written to disk.
Summary information
Default value 100
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
i/o batch size sets the number of writes issued in a batch before the task goes to
sleep. Once this batch is completed, the task is woken up, and the next batch of
writes are issued, ensuring that the I/O subsystem is not flooded with many
simultaneous writes. Setting i/o batch size to the appropriate value can improve
the performance of operations like checkpoint, dump database, select into, and
so on.
Summary information
Default value 10
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
i/o polling process count specifies the maximum number of processes that
Adaptive Server can run before the scheduler checks for disk and network I/O
completions. Tuning i/o polling process count affects both the response time and
throughput of Adaptive Server.
Adaptive Server checks for disk or network I/O completions:
• If the number of tasks run since the last time Adaptive Server checked for
I/O completions equals the value for i/o polling process count, and
• At every Adaptive Server clock tick.
As a general rule, increasing the value of i/o polling process count increases
throughput for applications that generate a lot of disk and network I/O.
Conversely, decreasing the value improves process response time in these
applications, possibly at the risk of lowering throughput.
If your applications create both I/O and CPU-bound tasks, tuning i/o polling
process count to a low value (1 – 2) ensures that I/O-bound tasks get access to
CPU cycles.
For OLTP applications (or any I/O-bound application with user connections
and short transactions), tuning i/o polling process count to a value in the range
of 20 – 30 may increase throughput, but may also increase response time.
When tuning i/o polling process count, consider three other parameters:
• sql server clock tick length, which specifies the duration of the Adaptive
Server clock tick in microseconds. See “sql server clock tick length” on
page 244.
• time slice, which specifies the number of clock ticks the the Adaptive
Server scheduler allows a user process to run. See “time slice” on page
258.
• cpu grace time, which specifies the maximum amount of time, in clock
ticks, a user process can run without yielding the CPU before Adaptive
Server preempts it and terminates it with a timeslice error. See “cpu grace
time” on page 103.
Use sp_sysmon to determine the effect of changing i/o polling process count.
See the Performance and Tuning Series: Monitoring Adaptive Server with
sp_sysmon.
Summary information
Default value 5000
Range of values 1–9999999
Status Static
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
IDENTITY columns are of type numeric and scale zero whose values are
generated by Adaptive Server. Column values can range from a low of 1 to a
high determined by the column precision.
For each table with an IDENTITY column, Adaptive Server divides the set of
possible column values into blocks of consecutive numbers, and makes one
block at a time available in memory. Each time you insert a row into a table,
Adaptive Server assigns the IDENTITY column the next available value from
the block. When all the numbers in a block have been used, the next block
becomes available.
This method of choosing IDENTITY column values improves server
performance. When Adaptive Server assigns a new column value, it reads the
current maximum value from memory and adds 1. Disk access becomes
necessary only after all values within the block have been used. Because all
remaining numbers in a block are discarded in the event of server failure (or
shutdown with nowait), this method can lead to gaps in IDENTITY column
values.
Use identity burning set factor to change the percentage of potential column
values that is made available in each block. This number should be high
enough for good performance, but not so high that gaps in column values are
unacceptably large. The default value, 5000, releases .05 percent of the
potential IDENTITY column values for use at one time.
To get the correct value for sp_configure, express the percentage in decimal
form, and then multiply it by 10 7 (10,000,000). For example, to release 15
percent (.15) of the potential IDENTITY column values at a time, specify a
value of .15 times 107 (or 1,500,000) in sp_configure.
Summary information
Default value 1
Range of values 1–2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
identity grab size allows each Adaptive Server process to reserve a block of
IDENTITY column values for inserts into tables that have an IDENTITY
column.
This is useful if you are performing inserts, and you want all the inserted data
to have contiguous IDENTITY numbers. For instance, if you are entering
payroll data, and you want all records associated with a particular department
to be located within the same block of rows, set identity grab size to the number
of records for that department.
identity grab size applies to all users on Adaptive Server. Large identity grab size
values result in large gaps in the IDENTITY column when many users insert
data into tables with IDENTITY columns.
Sybase recommends that you set identity grab size to a value large enough to
accommodate the largest group of records you want to insert into contiguous
rows.
Summary information
Default value 1
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group SQL Server Administration
identity reservation size sets a limit for the number of identity values.
Summary information
Default value 60
Valid values 0 – 32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
idle migration timeout specifies the amount of time after which an idle
connection is closed without invalidating the migration request sent to the
client, allowing you to stop an instance after a specified period of time without
waiting for idle client connections to migrate.
Setting idle migration timeout to a high value slows down a graceful shutdown
because the instance must wait the specified period of time for all idle
connections that issued a migration request without the client having initiated
migration.
Summary information
Default value 1 (in minutes)
Range of values 1 – 600
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
job scheduler interval sets the interval when the Job Scheduler checks which
scheduled jobs are due to be executed.
Summary information
Default value 32
Range of values 1 – 640
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
job scheduler tasks sets the maximum number of jobs that can run
simultaneously through Job Scheduler.
license information
Summary information
Default value 25
Valid values 0–231
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 100
Range of values 1–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
For Adaptive Servers running with multiple engines, the address lock spinlock
ratio sets the number of rows in the internal address locks hash table that are
protected by one spinlock.
Adaptive Server manages the acquiring and releasing of address locks using an
internal hash table with 1031 rows (known as hash buckets). This table can use
one or more spinlocks to serialize access between processes running on
different engines.
The default value for address lock spinlock ratio defines 11 spinlocks for the
address locks hash table. The first 10 spinlocks protect 100 rows each, and the
eleventh spinlock protects the remaining 31 rows. If you specify a value of
1031 or greater for address lock spinlock ratio, Adaptive Server uses only 1
spinlock for the entire table.
Summary information
Default value 2048
Range of values 1–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Lock Manager, Memory Use
lock hashtable size specifies the number of hash buckets in the lock hash table.
This table manages all row, page, and table locks, and all lock requests. Each
time a task acquires a lock, the lock is assigned to a hash bucket, and each lock
request for that lock checks the same hash bucket. Setting this value too low
results in large numbers of locks in each hash bucket and slows the searches.
On Adaptive Servers with multiple engines, setting this value too low can also
lead to increased spinlock contention. Do not set the value to less than the
default value, 2048.
lock hashtable size must be a power of 2. If the value you specify is not a power
of 2, sp_configure rounds the value to the next highest power of 2 and prints an
informational message.
The optimal hash table size is a function of the number of distinct objects
(pages, tables, and rows) that can be locked concurrently. The optimal hash
table size is at least 20 percent of the number of distinct objects that need to be
locked concurrently. See the Performance and Tuning Series: Locking and
Concurrency Control.
lock scheme
Summary information
Default value allpages
Range of values allpages, datapages, datarows
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
lock scheme sets the default locking scheme to be used by create table and
select into commands when a lock scheme is not specified in the command.
The values for lock scheme are character data, so you must use 0 as a
placeholder for the second parameter, which must be numeric, and specify
allpages, datapages, or datarows as the third parameter:
Summary information
Default value 0 (off)
Summary information
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Physical Memory
lock shared memory disallows swapping of Adaptive Server pages to disk and
allows the operating system kernel to avoid the server’s internal page locking
code. This can reduce disk reads, which are expensive.
Not all platforms support shared memory locking. Even if your platform does,
lock shared memory may fail due to incorrectly set permissions, insufficient
physical memory, or for other reasons. See operating system documentation for
your platform for information on shared memory locking.
Summary information
Default value 85
Range of values 1–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Lock Manager, Memory Use
Adaptive Server manages the acquiring and releasing of locks using an internal
hash table with a configurable number of hash buckets. On SMP systems, this
hash table can use one or more spinlocks to serialize access between processes
running on different engines. To set the number of hash buckets, use lock
hashtable size.
For Adaptive Servers running with multiple engines, lock spinlock ratio sets a
ratio that determines the number of lock hash buckets that are protected by one
spinlock. If you increase lock hashtable size, the number of spinlocks
increases, so the number of hash buckets protected by one spinlock remains the
same.
The Adaptive Server default value for lock spinlock ratio is 85. With lock
hashtable size set to the default value of 2048, the default spinlock ratio defines
26 spinlocks for the lock hash table. See Chapter 5, Managing Mulitprocessor
Servers,” in System Administration Guide: Volume 2.
sp_sysmon reports on the average length of the hash chains in the lock hash
table. See the Performance and Tuning Series: Monitoring Adaptive Server
with sp_sysmon.
Summary information
Default value 20
Range of values 1–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
For Adaptive Servers running with multiple engines, table lock spinlock ratio
sets the number of rows in the internal table locks hash table that are protected
by one spinlock.
Adaptive Server manages the acquiring and releasing of table locks using an
internal hash table with 101 rows (known as hash buckets). This table can use
one or more spinlocks to serialize access between processes running on
different engines.
The Adaptive Server default value for table lock spinlock ratio is 20, which
defines 6 spinlocks for the table locks hash table. The first 5 spinlocks protect
20 rows each; the sixth spinlock protects the last row. If you specify a value of
101 or greater for table lock spinlock ratio, Adaptive Server uses only 1 spinlock
for the entire table.
Summary information
Default value 2147483647
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
lock wait period limits the number of seconds that tasks wait to acquire a lock
on a table, data page, or data row. If the task does not acquire the lock within
the specified time period, Adaptive Server returns error message 12205 to the
user and rolls back the transaction.
The lock wait option of the set command sets a session-level number of seconds
that a task waits for a lock. It overrides the server-level setting for the session.
lock wait period, used with the session-level setting set lock wait nnn, is
applicable only to user-defined tables. These settings have no influence on
system tables.
At the default value, all processes wait indefinitely for locks. To restore the
default value, reset the value to 2147483647 or enter:
sp_configure "lock wait period", 0, "default"
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Error Log
log audit logon failure specifies whether to log unsuccessful Adaptive Server
logins to the Adaptive Server error log and, on Windows servers, to the
Windows Event Log, if event logging is enabled.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Error Log
log audit logon success specifies whether to log successful Adaptive Server
logins to the Adaptive Server error log and, on Windows servers, to the
Windows Event Log, if event logging is enabled.
Summary information
Default value Platform dependent
Range of values 1– platform-dependent value
Status Static
Display level Comprehensive
Required role System administrator
Configuration group O/S Resources
max async i/os per engine specifies the maximum number of outstanding
asynchronous disk I/O requests for a single engine at one time.
Summary information
Default value Platform dependent
Range of values 1– platform dependent value
Status Static
Display level Comprehensive
Required role System administrator
Configuration group O/S Resources
max async i/os per server specifies the maximum number of asynchronous disk
I/O requests that can be outstanding for Adaptive Server at one time. This limit
is not affected by the number of online engines per Adaptive Server. max async
i/os per engine limits the number of outstanding I/Os per engine.
Most operating systems limit the number of asynchronous disk I/Os that can be
processed at any one time; some operating systems limit the number per
operating system process, some limit the number per system, and some do
both. If an application exceeds these limits, the operating system returns an
error message. Because operating system calls are relatively expensive, it is
inefficient for Adaptive Server to attempt to perform asynchronous I/Os that
get rejected by the operating system.
To avoid this, Adaptive Server maintains a count of the outstanding
asynchronous I/Os per engine and per server; if an engine issues an
asynchronous I/O that would exceed either max async i/os per engine or max
async i/os per server, Adaptive Server delays the I/O until enough outstanding
I/Os have completed to fall below the exceeded limit.
For example, assume an operating system limit of 200 asynchronous I/Os per
system and 75 per process and an Adaptive Server with three online engines.
The engines currently have a total of 200 asynchronous I/Os pending,
distributed according to the following table:
Number of
Engine I/Os pending Outcome
0 60 Engine 0 delays any further asynchronous I/Os until the total for the server is under the
operating system per-system limit and then continues issuing asynchronous I/Os.
Number of
Engine I/Os pending Outcome
1 75 Engine 1 delays any further asynchronous I/Os until the per-engine total is under the
operating system per-process limit and then continues issuing asynchronous I/Os.
2 65 Engine 2 delays any further asynchronous I/Os until the total for server is under the
operating system per-system limit and then continues issuing asynchronous I/Os.
All I/Os (both asynchronous and synchronous) require a disk I/O structure, so
the total number of outstanding disk I/Os is limited by the value of disk i/o
structures. It is slightly more efficient for Adaptive Server to delay the I/O
because it cannot get a disk I/O structure than because the I/O request exceeds
max i/os per server. Set max async i/os per server equal to the value of disk i/o
structures. See “disk i/o structures” on page 115.
If the limits for asynchronous I/O can be tuned on your operating system, make
sure they are set high enough for Adaptive Server. There is no penalty for
setting them as high as needed.
Use sp_sysmon to see if the per server or per engine limits are delaying I/O on
your system. If sp_sysmon shows that Adaptive Server exceeded the limit for
outstanding requests per engine or per server, raise the value of the
corresponding parameter. See the Performance and Tuning Series: Monitoring
Adaptive Server with sp_sysmon.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration group Component Integration Services
If this number does not meet the needs of your installation, you can override
the setting by specifying exactly how many outgoing Client-Library
connections you want the server to be able to make at one time.
Summary information
Default value 0
Valid values 1– number of engines at start-up minus 1
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Backup/Recovery
max memory
Summary information
Default value Platform-dependent
Range of values Platform-dependent minimum – 2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Physical Memory
max memory specifies the maximum amount of total physical memory that you
can configure Adaptive Server to allocate. max memory must be greater than
the total logical memory consumed by the current configuration of Adaptive
Server.
There is no performance penalty for configuring Adaptive Server to use the
maximum memory available to it on your computer. However, assess the other
memory needs on your system, or Adaptive Server may not be able to acquire
enough memory to start.
You may also want to reduce the values for other configuration parameters that
require large amounts of memory. Then restart Adaptive Server to use the
memory specified by the new values. If Adaptive Server fails to start because
the total of other configuration parameter values is higher than the max memory
value, see Chapter 3, “Configuring Memory,” in System Administration Guide:
Volume 2 for information about configuration parameters that use memory.
Summary information
Default value 50
Maximum values 50 – 1000
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group User Environment
max native threads per engine defines the maximum number of native threads
the server spawns per engine. When the limit for the native threads is reached,
Adaptive Server sessions that require a native thread sleep until another session
releases a native thread.
Summary information
Range of values 16 – 100
Status Static
Display level Comprehensive
Required role System administrator
Configuration group User environment
maximum nesting level sets the maximum nesting level for stored procedures
and triggers. Each increased nesting level requires about 160 bytes of
additional memory. For example, if you increase the nesting level from 16 to
26, Adaptive Server requires an additional 1600 bytes of memory.
Summary information
Default value 512
Range of values 512–65024
Status Static
Display level Intermediate
Required role System administrator
Configuration group Network Communication
max network packet size specifies the maximum network packet size that can
be requested by clients communicating with Adaptive Server.
If some of your applications send or receive large amounts of data across the
network, these applications can achieve significant performance improvement
by using larger packet sizes. Two examples are large bulk copy operations and
applications that read or write large text, unitext, and image values.
Generally, you want:
• default network packet size to be small for users who perform short queries,
and
• max network packet size to be large enough to allow users who send or
receive large volumes of data to request larger packet sizes.
max network packet size must always be as large as, or larger than, the default
network packet size. Values that are not even multiples of 512 are rounded
down.
For client applications that explicitly request a larger network packet size to
receive, you must also configure additional network memory. See “additional
network memory” on page 83.
Open Client Server cannot accept a network packet size greater than 64K.
See bcp and isql in the Utility Guide for information on using larger packet sizes
from these programs. Open Client Client-Library documentation includes
information on using variable packet sizes.
After you determine the available data space of the underlying packets on your
network, perform your own benchmark tests to determine the optimum size for
your configuration.
Use sp_sysmon to see how changing max network packet size affects network
I/O management and task switching. For example, try increasing max network
packet size and then checking sp_sysmon output to see how this affects bcp for
large batches. See the Performance and Tuning Series: Monitoring Adaptive
Server with sp_sysmon.
Summary information
Default value 5
Range of values 0–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Network Communication
Summary information
Default value 1
Range of values 1–128
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Processors
The role of max online engines is to set a high value of engines to be taken
online at any one time in an SMP environment. It does not take the number of
CPUs available at start-up into account, and allows users to add CPUs at a later
date.
max engines online specifies the maximum number of Adaptive Server engines
that can be online at any one time in an SMP environment. See Chapter 5,
Managing Mulitprocessor Servers,” in System Administration Guide: Volume
2 for a detailed discussion of how to set this parameter for your SMP
environment.
At start-up, Adaptive Server starts with a single engine and completes its
initialization, including recovery of all databases. Its final task is to allocate
additional server engines. Each engine accesses common data structures in
shared memory.
When tuning the max engines online parameter:
• Never have more online engines than there are CPUs.
• Depending on overall system load (including applications other than
Adaptive Server), you may achieve optimal throughput by leaving some
CPUs free to run non-Adaptive Server processes.
• You can achieve better throughput by running fewer engines with high
CPU use, rather than by running more engines with low CPU use.
• Scalability is application-dependent. Conduct extensive benchmarks on
your application to determine the best configuration of online engines.
• You can use sp_engine to take engines offline or to bring them online. You
can take all engines offline except engine zero.
See Chapter 3, “Using Engines and CPUs” in the Performance and Tuning
Series: Basics .
Summary information
Default value 0
Range of values 0 – 127
Status static
Display level Comprehensive
Required role System administrator
Configuration group
max online Q engines required for MQ. Specifies the maximum number of Q
engines you can have online. You may need to increase max online engines to
accommodate the number of max online Q engines.
Summary information
Default value 1
Range of values 1–255
Status Dynamic
Display level Basic
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 0
Range of values 0 – 30
Status Static
Summary information
Display level Comprehensive
Required role System administrator
Configuration group User Environment
Sets the maximum number of PCI slots Adaptive Server allows. The values
are:
• 0, 1 – default bridge with one PCA.
Note JVM support requires a single slot. Do not increase the number of
slots.
Summary information
Default value 1
Range of values 1 – 255
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 1
Range of values 1 – value of max parallel degree
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 10
Range of values 1 – 100
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 1
Summary information
Range of values 1–255
Status Dynamic
Display level Basic
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 0
Range of values 0–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
max SQL text monitored specifies the amount of memory allocated per user
connection for saving SQL text to memory shared by Adaptive Server Monitor.
If you do not allocate enough memory for the batch statements, the text you
want to view may be truncated. Sybase recommends that you use an initial
value of 1024 bytes of memory per user connection.
The total memory allocated from shared memory for the SQL text is the
product of max SQL text monitored multiplied by the currently configured
number of user connections.
See “Configuring Adaptive Server to save SQL batch text” on page 373.
Summary information
Default value 10
Range of values 1 – 255
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Adaptive Server Administration
max transfer history controls how many transfer history entries Adaptive Server
retains in the spt_TableTransfer table in each database. For each table tracked,
spt_TableTransfer retains:
Lowering this parameter does not automatically remove any entries from
spt_TableTransfer. Entries are removed for a given transferred table the next
time you initiate a transfer for that table. The table’s successful transfer entries
are cleared if the transfer succeeds. If the transfer is unsuccessful, its failed
transfer entries are cleared.
For example, if a table has 12 successful and 9 unsuccessful history entries in
spt_configure, and you change max transfer history to 5, the next successful
transfer of that table places 5 successful entries in spt_configure, but
spt_configure retains the previous 9 failed entries.
Summary information
Default value 10
Range of values 10–100
Status Static
Display level Intermediate
Required role System administrator
Configuration group Group Diagnostics
maximum dump conditions sets the maximum number of conditions you can
specify under which Adaptive Server generates a dump of data in shared
memory.
Note This parameter is included for use only by Sybase Technical Support. Do
not modify it unless you are instructed to do so by Sybase Technical Support.
Summary information
Default value 2048
Range of values 500 – 65535
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
maximum buffers per lava opeator sets an upper limit for the number of buffers
used by Lava operators that perform sorting or hashing (which are “expensive”
in terms of processing). Lava operators use buffers from the session’s tempdb
data cache pool as a work area for processing rows.
Lava operators often recurse through their input streams. Sorting requires
subsequent merge passes until there are enough buffers available to merge all
of the remaining runs. Hashing requires subsequent passes to build hash tables
on any spilled sets until all of the remaining data can fit into an in-memory hash
table. Some queries require less I/O if you increase max buffers per lava
operator. This is particularly true for queries that use the HASH DISTINCT,
HASH VECTOR AGGREGATE, and HASH UNION operators.
Be careful when you increase the default value of maximum buffers per lava
operator for servers with many concurrent users: Adaptive Server may allocate
more buffers solely for expensive operators, reducing the number of buffers
available for caching user’s tables and other session’s worktables. Use
sp_sysmon to analyze tempdb's data caching effectiveness.
maximum buffers per lava operator works with max resource granularity to limit
the number of buffers used. The limit is set to the minimum of:
• The value of maximum buffers per lava operator, or,
• (max resource granularity) X (the number of data buffers in tempdb’s
pagesize pool)
See “number of sort buffers” on page 206 for information about setting the
amount of memory allocated for sort buffers.
Summary information
Default value 0
Range of values -1 – 32767
Status Dynamic
Display level 10
Required role System security officer
Configuration group Security Related
maximum failed logins allows you to set the server-wide maximum number of
failed login attempts for logins and roles.
A value of -1 indicates that the failed login count in the syslogins column
logincount is updated whenever an authentication failure occurs, but that the
account is not locked. Compare with a 0 (zero) value, which avoids
incrementing the column for every failed authentication and avoids locking the
account due to authentication failures.
See the Reference Manual: Procedures for information about using
sp_modifylogin to change the maximum failed logins for a specific role. See the
Reference Manual: Commands for information about using alter role to change
the maxiumum failed logins.
Summary information
Default value 32768
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
maximum job output sets limit, in bytes, on the maximum output a single job can
produce. If a job produces more output than specified in maximum job output,
all the data returned above the value you enter is discarded.
Summary information
Default value Logical page size
Range of values 2048a – 16384
a. Minimum determined by server’s logical page size
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Cache Manager
Some machines perform I/O more efficiently when structures are aligned on a
particular memory address boundary. To preserve this alignment, values for
memory alignment boundary should always be powers of two between the
logical page size and 2048K.
Summary information
Default value 1024
Range of values 1024–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration group Memory Use
memory per worker process specifies the amount of memory, in bytes, used by
worker processes. Each worker process requires memory for messaging during
query processing. This memory is allocated from a shared memory pool; the
size of this pool is memory per worker process multiplied by number of worker
processes. For most query processing, the default size is more than adequate.
If you use dbcc checkstorage, and have set number of worker processes to 1, you
may need to increase memory per worker process to 1792 bytes.
See Chapter 3, “Configuring Memory,” in System Administration Guide:
Volume 2.
messaging memory
Summary information
Default value 400
Range of values 60 – 2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Memory Use, Physical Memory
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
metrics elap max configures maximum elapsed time and thresholds for QP
metrics
Summary information
Default value 0
Range of values 0 – 2147483647
Status dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
metrics exec max configures maximum execution time and thresholds for QP
metrics.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
metrics lio max configures maximum logical I/O and thresholds for QP metrics.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group
metrics pio max configures maximum physical I/O and thresholds for QP
metrics.
Summary information
Default value 200
Range of values 20 - 2147483647
Status dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
min pages for parallel scan controls the number of tables and indexes that
Adaptive Server can access in parallel. If the number of pages in a table is
below the value you set, the table is accessed serially. min pages for parallel scan
does not consider page size. If Adaptive Server accesses the indexes and tables,
Adaptive Server attempts to repartition the data, if that is appropriate, and to
use parallelism above the scans, if that is appropriate.
Summary information
Default value 6
Range of values 0 – 30
Status Dynamic
Summary information
Display level 10
Required role System security officer
Configuration group Security Related
To change the value of the overrides for minimum password length for all logins
to 2 characters, enter:
sp_modifylogin "all overrides", "minimum password length", @value="2"
To remove the overrides for minimum password length for all logins, enter:
mnc_full_index_filter
Summary information
Default value 2
Range of values 0–2
• 0 – disable.
• 1 – enable.
• 2 – set according to the optimization goal setting.
Status Dynamic
Display level Comprehensive
Required roles System administrator
Configuration group Query Tuning
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
msg confidentiality reqd requires that all messages into and out of Adaptive
Server be encrypted. The use security services parameter must be 1 for
messages to be encrypted.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
msg integrity reqd requires that all messages be checked for data integrity. use
security services must be 1 for message integrity checks to occur. If msg
integrity reqd is set to 1, Adaptive Server allows the client connection to
succeed unless the client is using one of the following security services:
message integrity, replay detection, origin checks, or out-of-seq checks.
Summary information
Default value 0
Range of values 0–2
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
net password encryption reqd restricts login authentication to use only RSA
encryption algorithm or the Sybase proprietary algorithm. Table 5-3 describes
valid values for net password encryption reqd.
Table 5-3: Values and descriptions for net password encryption reqd
Value Description
0 Allows the client to choose the encryption algorithm used for login passwords on the network,
including no password encryption.
1 Restricts clients to use either RSA or Sybase proprietary encryption algorithms to encrypt login
passwords on the network. This provides an incrementally restrictive setting that allows clients who
have previously connect to reconnect with the Sybase proprietary algorithm and new clients to
connect with the stronger RSA algorithm. A client that attempts to connect without using password
encryption fails.
2 Restricts clients to use only the RSA encryption algorithms to encrypt login passwords on the
network. This provides strong RSA encryption of passwords. Clients that attempt to connect without
using the RSA encryption fail.
number of alarms
Summary information
Default value 40
Range of values 40 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
When Adaptive Server needs more alarms than are currently allocated, this
message is written to the error log:
uasetalarm: no more alarms available
The number of bytes of memory required for each alarm structure is small. If
you raise the number of alarms value significantly, adjust max memory
accordingly.
Summary information
Default value 200
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
number of aux scan descriptors sets the number of auxiliary scan descriptors
available in a pool shared by all users on a server.
Each user connection and each worker process has 48 scan descriptors
exclusively allocated to it. Of these, 16 are reserved for user tables, 12 are
reserved for worktables, and 20 are reserved for system tables (with 4 of these
set aside for rollback conditions). A descriptor is needed for each table
referenced, directly or indirectly, by a query. For user tables, a table reference
includes:
• All tables referenced in the from clause of the query
• All tables referenced in a view named in the query (the view itself is not
counted)
• All tables referenced in a subquery
• All tables that need to be checked for referential integrity (these are used
only for inserts, updates, and deletes)
• A table created with select...into
• All worktables created for the query
If a table is referenced more than once (for example, in a self-join, in more than
one view, or in more than one subquery) the table is counted each time. If the
query includes a union, each select statement in the union query is a separate
scan. If a query runs in parallel, the coordinating process and each worker
process needs a scan descriptor for each table reference.
When the number of user tables referenced by a query scan exceeds 16, or the
number of worktables exceeds 12, scan descriptors from the shared pool are
allocated. Data-only-locked tables also require a system table descriptor for
each data-only-locked table accessed with a table scan (but not those accessed
with an index scan). If more than 16 data-only-locked tables are scanned using
table scans in a query, auxiliary scan descriptors are allocated for them.
If a scan needs auxiliary scan descriptors after it has used its allotted number,
and there are no descriptors available in the shared pool, Adaptive Server
displays an error message and rolls back the user transaction.
If none of your queries need additional scan descriptors, you may still want to
leave number of aux scan descriptors set to the default value in case your system
requirements grow. Set it to 0 only if you are sure that users on your system will
never run queries on more than 16 tables and that your tables will always have
few or no referential integrity constraints. See “Monitoring scan descriptor
usage” on page 185.
If your queries need more scan descriptors, use one of these methods to remedy
the problem:
• Rewrite the query, or break it into steps using temporary tables. For data-
only-locked tables, consider adding indexes if there are many table scans.
• Redesign the table’s schema so that it uses fewer scan descriptors, if it uses
a large number of referential integrity constraints. You can find how many
scan descriptors a query would use by enabling set showplan, noexec on
before running the query.
• Increase the number of aux scan descriptors setting.
The following sections describe how to use sp_monitorconfig to monitor the
current and high-water-mark usage to avoid running out of descriptors, and
how to estimate the number of scan descriptors you need.
Only 240 auxiliary scan descriptors are being used, leaving 260 free. However,
the maximum number of scan descriptors used at any one time since the last
time Adaptive Server was started is 427, leaving about 20 percent for growth
in use and exceptionally heavy use periods. “Re-used” does not apply to scan
descriptors.
Summary information
Default value 0
Range of values 1 – 32768
Status Dynamic
Display level Basic
Required role System administrator
Configuration group User Environment
number of ccbs
Summary information
Default value 0
Range of values 0 – 100
Status Static
Display level
Required role
Configuration group Diagnostics
Summary information
Default value 1
Valid values 1– 8
Status Dynamic
Summary information
Display level Comprehensive
Required role System administrator
Configuration group Backup/Recovery
number of devices
Summary information
Default value 10
Range of values 1–2,147,483,647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Disk I/O, Memory Use
number of devices controls the number of database devices Adaptive Server can
use. It does not include devices used for database or transaction log dumps.
When you execute disk init, you can also assign the virtual device number (the
vdevno), although this value is optional. If you do not assign the vdevno,
Adaptive Server assigns the next available virtual device number.
If you do assign the virtual device number, each device number must be unique
among the device numbers used by Adaptive Server. The number 0 is reserved
for the master device. You can enter any unused device number that falls in the
valid range of values.
To determine which numbers are currently in use, enter:
select vdevno from master..sysdevices
where status & 2 = 2
Note On UNIX platforms: If you are using a large number of devices, Sybase
recommends that you set the appropriate number of devices and user
connections in the configuration file and then restart Adaptive Server.
Attempting to configure a large number of devices dynamically using
sp_configure may fail.
Summary information
Default value 500
Valid values 100 – 2147483647
Status Dynamic
Display level 10
Required role System administrator
Configuration groups DTM Administration, Memory Use
number of dtx participants sets the total number of remote transactions that the
Adaptive Server transaction coordination service can propagate and coordinate
simultaneously. A DTX participant is an internal memory structure that the
coordination service uses to manage a remote transaction branch. As
transactions are propagated to remote servers, the coordination service must
obtain new DTX participants to manage those branches.
Setting number of dtx participants to a number smaller than the default reduces
the number of remote transactions that the server can manage. If no DTX
participants are available, new distributed transactions cannot start. In-progress
distributed transactions may abort if no DTX participants are available to
propagate a new remote transaction.
Setting number of dtx participants to a number larger than the default increases
the number of remote transaction branches that Adaptive Server can handle,
but also consumes more memory.
If the num_free value is zero or very low, new distributed transactions may be
unable to start due to a lack of DTX participants. Consider increasing the
number of dtx participants value.
A low Max_used value may indicate that unused DTX participants are
consuming memory that could be used by other server functions. Consider
reducing the value of number of dtx participants.
Summary information
Default value Disabled
Range of values 1 (disabled, no parallelism) – 8 (fully parallel)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Group Diagnostics
number of dump threads controls the number of threads that Adaptive Server
spawns to perform a memory dump. Using the appropriate value for number of
dump threads can reduce the amount of time the engines are halted during the
memory dump.
When you are determining the number of threads for memory:
• Use a value of 8 if the machine has enough free memory for the file system
cache to hold the entire memory dump.
• If you do not know whether the machine has enough free memory, the
value for number of dump threads depends on many factors, including the
speed of the I/O system, the speed of the disks, the controller’s cache,
whether the dump file lives in a logical volume manager created on several
disks, and so on.
• Disable parallel processing (by assigning a value of 1) if you do not halt
the engines when performing memory dumps, described below.
Summary information
Default value 1
Range of values 1 – number of CPUs on machine
Status Static
Display level Basic
Required role System administrator
Configuration groups Java Services, Memory Use, Processors
Adaptive Server allows users to take all engines offline, except engine zero.
number of engines at startup is used exclusively during start-up to set the
number of engines brought online. It allows great flexibility in the number of
engines brought online, subject to the restriction that you cannot set the value
of number of engines at startup to a value greater than the number of CPUs on
your machine, or to a value greater than the configuration of max online
engines. Users who do not intend to bring engines online after start-up should
set max online engines and number of engines at startup to the same value. A
difference between number of engines at startup and max online engines wastes
approximately 1.8 MB of memory per engine.
Summary information
Default value 20
Range of values 3 – 2147483647
Status Dynamic
Display level Comprehensive
Summary information
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 0
Range of values 0–65535
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Cache Manager
number of index trips specifies the number of times an aged index page traverses
the most recently used/least recently used (MRU/LRU) chain before it is
considered for swapping out. As you increase the value of number of index trips,
index pages stay in cache for longer periods of time.
A data cache is implemented as an MRU/LRU chain. As the user threads
access data and index pages, these pages are placed on the MRU end of the
cache’s MRU/LRU chain. In some high transaction environments (and in some
benchmarks), you may want to keep index pages in cache, since they will
probably be needed again soon. Setting number of index trips higher keeps index
pages in cache longer; setting it lower allows index pages to be swapped out of
cache sooner.
You need not set the number of index trips for relaxed LRU pages. See Chapter
4, “Configuring Data Caches,” in the System Administration Guide: Volume 2.
Before changing the value of number of index trips to a number other than 0,
make sure the application has sufficient cache to store all index, OAM, and
data pages. Consult Sybase Technical Support before changing the value of
number of index trips.
Summary information
Default value 0
Valid values 0 – 32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Java Services, Memory Use
number of java sockets enables the Java VM and the java.net classes Sybase
supports.
Summary information
Default value 6
Valid values 1–256
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Disk I/O, Memory Use, SQL Server Administration
number of large i/o buffers sets the number of allocation unit-sized buffers
reserved for performing large I/O for certain Adaptive Server utilities. These
large I/O buffers are used primarily by the load database command, which uses
one buffer to load the database, regardless of the number of stripes it specifies.
load database then uses as many as 32 buffers to clear the pages for the
database it is loading. These buffers are not used by load transaction. To
perform more than six load database commands concurrently, configure one
large I/O buffer for each load database command.
create database and alter database use these buffers for large I/O while clearing
database pages. Each instance of create database or load database can use as
many as 32 large I/O buffers.
These buffers are also used by disk mirroring and by some dbcc commands.
Note In Adaptive Server version 12.5.0.3 and later, the size of the large I/O
buffers is one allocation (256 pages), not one extent (8 pages). The server thus
requires more memory allocation for large buffers. For example, a disk buffer
that required memory for 8 pages in earlier versions now requires memory for
256 pages.
number of locks
Summary information
Default value 5000
Range of values 1000–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Lock Manager, Memory Use
number of locks sets the total number of available locks for all users on
Adaptive Server.
The total number of locks needed by Adaptive Server depends on the number
of concurrent and parallel processes, and the types of actions performed by the
transactions. To see how many locks are in use at a particular time, use sp_lock.
For serial operation, Sybase suggests that you start by assigning 20 locks for
each active, concurrent connection.
Parallel execution requires more locks than serial execution. For example, if
you find that queries use an average of five worker processes, try increasing by
one-third the number of locks configured for serial operation.
If the system runs out of locks, Adaptive Server displays a server-level error
message. If users report lock errors, you may need to increase number of locks;
but remember that locks use memory. See Chapter 3, “Configuring Memory,”
in the System Administration Guide Volume 2.
Note Datarows locking may require that you change the value for number of
locks. See the Performance and Tuning Series: Locking and Concurrency
Control.
number of mailboxes
Summary information
Default value 30
Range of values 30–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
number of messages
Summary information
Default value 64
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
Summary information
Default value 0
Range of values 0–65535
Status Dynamic
Display level Comprehensive
Required role System administrator
number of oam trips specifies the number of times an object allocation map
(OAM) page traverses the MRU/LRU chain before it is considered for
swapping out. The higher the value of number of oam trips, the longer aged
OAM pages stay in cache.
Each table, and each index on a table, has an OAM page, which holds
information on pages allocated to the table or index and is checked when a new
page is needed for the index or table. (See “page utilization percent” on page
216. ) A single OAM page can hold allocation mapping for between 2,000 and
63,750 data or index pages.
The OAM pages point to the allocation page for each allocation unit where the
object uses space. The allocation pages, in turn, track the information about
extent and page usage within the allocation unit.
Note If the cache is relatively small and used by a large number of objects, do
not set number of oam trips too high. This may result in the cache being flooded
with OAM pages that do not age out, and user threads may begin to time out.
Before changing the value of number of oam trips to a number other than 0,
make sure the application has sufficient cache to store all index, OAM, and
data pages. Consult Sybase Technical Support before changing the value of
number of oam trips.
Summary information
Default value 12
Range of values 6 –2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Meta-Data Caches, SQL Server
Administration
number of open databases sets the maximum number of databases that can be
open simultaneously on Adaptive Server.
When you calculate a value, include the system databases master, model,
sybsystemprocs, and tempdb. If you have installed auditing, include the
sybsecurity database. Also, count the sample databases pubs2 and pubs3, the
syntax database sybsyntax, and the dbcc database dbccdb if they are installed.
If you are planning to make a substantial change, such as loading a large
database from another server, use sp_helpconfig to calculate an estimated
metadata cache size by using sp_helpconfig. sp_helpconfig displays the amount
of memory required for a given number of metadata descriptors, as well as the
number of descriptors that can be accommodated by a given amount of
memory. A database metadata descriptor represents the state of the database
while it is in use or cached between uses.
If there is a lot of activity on the server, for example, if databases are being
added or dropped, periodically run sp_monitorconfig. Reset the cache size
as the number of active descriptors changes.
Summary information
Default value 500
Range of values 100–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Meta-Data Caches
number of open indexes sets the maximum number of indexes that can be used
simultaneously on Adaptive Server.
If you are planning to make a substantial change, such as loading databases
with a large number of indexes from another server, use sp_helpconfig to
calculate an estimated metadata cache size. sp_helpconfig displays the amount
of memory required for a given number of metadata descriptors, as well as the
number of descriptors that can be accommodated by a given amount of
memory. An index metadata descriptor represents the state of an index while it
is in use or cached between uses.
Summary information
Default value 500
Range of values 100–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Meta-Data Caches, SQL Server
Administration
number of open objects sets the maximum number of objects that can be open
simultaneously on Adaptive Server.
If you are planning to make a substantial change, such as loading databases
with a large number of objects from another server, use sp_helpconfig to
recalculate an estimated metadata cache size. sp_helpconfig displays the
amount of memory required for a given number of metadata descriptors, as
well as the number of descriptors that can be accommodated by a given amount
of memory. An object metadata descriptor represents the state of an object
while it is in use, or cached between uses.
Summary information
Default value 500
Range of values 100 – 2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Meta-Data Caches
Specifies the number of partitions that Adaptive Server can access at one time.
Optimizing the If the default value of number of open partitions is insufficient, Adaptive Server
number of open displays a message after trying to reuse active partition descriptors. You must
partitions parameter
for your system adjust this value.
1 Use sp_countmetadata to find the total number of open partitions. For
example:
sp_countmetadata "open partitions"
The best time to run sp_countmetadata is when there is little activity in the
server. Running sp_countmetadata during a peak time can cause
contention with other processes.
Suppose Adaptive Server reports the following information:
There are 42 user partitions in all database(s),
requiring 109 Kbytes of memory. The 'open
Summary information
Default value 2
Range of values 1–32
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
• reorg rebuild
When you run these command on tables larger than 240 pages, Adaptive Server
reserves an entire allocation unit (32 extents), which greatly improves
performance, particularly when you run them concurrently on multiple nodes.
The value of number of pre-allocated extents continues to be observed for the
above commands for tables with fewer than 240 pages, and for all commands
(such as select into, bcp, alter table partition) for tables of all sizes.
Summary information
Default value 0
Range of values 0 – 127
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Processors
number of Q engines at startu, which specifies the number of Q engines that are
online when the server starts, is required for MQ. You may need to increase
max online engines to accommodate the number of max online Q engines.
Summary information
Default value 20
Range of values 5–32767
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication
Summary information
Default value 20
Range of values 0–32767
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication
number of remote logins controls the number of active user connections from
Adaptive Server to remote servers. Each simultaneous connection to XP Server
for ESP execution uses up to one remote login each. Set this parameter to the
same (or a lower) value as number of remote connections. See Chapter 15,
“Managing Remote Servers.”
Summary information
Default value 10
Range of values 0–32767
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication
number of remote sites determines the maximum number of remote sites that
can simultaneously access Adaptive Server. Each Adaptive Server-to-XP
Server connection uses one remote site connection.
Internally, number of remote sites determines the number of site handlers that
can be active at any one time; all server accesses from a single site are managed
with a single site handler. For example, if you set number of remote sites to 5,
and each site initiates three remote procedure calls, sp_who shows 5 site
handler processes for the 15 processes. See Chapter 15, “Managing Remote
Servers.”
Summary information
Default value 500
Range of values 0–32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
number of sort buffers specifies the amount of memory allocated for buffers
used to hold pages read from input tables and perform index merges during
sorts. number of sort buffers is used only for parallel sorting. Parallel sorts are
used when you:
• Run updates statistics
• Create indexes
See Chapter 10, “Using Statistics to Improve Performance,” in the
Performance and Tuning Series: Query Processing and Abstract Plans.
The value you use for number of sort buffers depends on the page size of the
server.
Sybase recommends that you leave this parameter set to the default except
when you are creating indexes in parallel.
Setting the value too high can rob nonsorting processes of access to the buffer
pool in caches being used to perform sorts.
If you configure a high number of sort buffers, a sort on a large table may
require more procedure cache. The effect is more pronounced with tables that
have smaller row sizes, because the number of rows per page is higher.
This equation estimates the amount of procedure cache required (in bytes):
(Number of sort buffers) X (rows per page) X 100
If you do not configure enough procedure cache for the number of sort buffers,
the sort may fail with error message 701. If this occurs, reconfigure Adaptive
Server with a lower number of sort buffers and retry the sort.
See “max buffers per lava operator” on page 173 for information about setting
an upper limit for the number of buffers used by an operator.
Summary information
Default value 25
Range of values 5–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, User Environment
number of user connections sets the maximum number of user connections that
can simultaneously be connected to Adaptive Server. It does not refer to the
maximum number of processes; that number depends not only on the value of
this parameter but also on other system activity.
Upper limit to the The maximum allowable number of file descriptors per process is operating-
maximum number of system-dependent; see the configuration documentation for your platform.
user connections
The number of file descriptors available for Adaptive Server connections is
stored in the global variable @@max_connections. You can report the
maximum number of file descriptors your system can use with:
select @@max_connections
The return value represents the maximum number of file descriptors allowed
by the system for your processes, minus overhead. Overhead increases with the
number of engines. For more information on how multiprocessing affects the
number file descriptors available for Adaptive Server connections, see Chapter
5, Managing Mulitprocessor Servers,” in System Administration Guide:
Volume 2.
In addition, you must reserve a number of connections for the following items,
which you also set with configuration parameters:
• The database devices, including mirror devices
• Site handlers
• Network listeners
The number of user connections + (number of devices * max online engines * 2)
+ number of remote sites + max number network listeners cannot be greater than
the value of @@max_connections.
Reserved connections One connection from the configured number of connections is reserved for
temporary administrative tasks to make sure that database administrators can
connect to Adaptive Server. A reserved connection has a total login time of 15
minutes, and can be is allocated only to a user who has the sa_role. Adaptive
Server terminates the connection after 15 minutes to ensure the availability of
the reserved connection at an installation with multiple database
administrators.
Adaptive Server also automatically uses this reserved connection when a client
uses the last resource for connecting to Adaptive Server.
If Adaptive Server is using a reserved connection, the following informational
message appears when the user logs in to Adaptive Server:
There are not enough user connections available; you are being connected
using a temporary administrative connection which will time out after '15'
minutes. Increase the value of th 'number of user connections' parameter
Adaptive Server also prints a message similar to the following to the error log
when the final connection to Adaptive Server terminates due to a timeout:
00:00000:00008:2003/03/14 11:25:31.36 server Process '16' has been
terminated as it exceeded the maximum login time allowed for such processes.
This process used a connection reserved for system administrators and has a
maximum login period of '15' minutes
Optimizing max There is no formula to determine how many connections to allow for each user.
number of user You must estimate this number, based on the system and user requirements.
connections
You must also take into account that on a system with many users, connections
needed only occasionally or transiently can generally be shared among users.
The following processes require user connections:
• One connection is needed for each user running isql.
• Application developers use one connection for each editing session.
Certain other configuration parameters, including stack size and default network
packet size, affect the amount of memory for each user connection.
User connections for Adaptive Server uses the value of number of user connections to establish the
shared memory—EJB number of shared-memory connections for EJB Server. Thus, if number of user
Server
connections is 30, Adaptive Server establishes 10 shared-memory connections
for EJB Server. Shared-memory connections are not a subset of user
connections, and are not subtracted from the number of user connections.
To increase the number of user connections for shared memory, you must:
1 Increase number of user connections to a number one-third of which is the
number of desired shared-memory connections.
2 Restart Adaptive Server.
Although number of user connections is a dynamic configuration parameter,
you must restart the server to change the number of user connections for shared
memory. See the EJB Server Users Guide.
With Adaptive Server version 12.5.3 ESD #2, no sockets are automatically
reserved for EJB. However, you can enable trace flag 1642 to revert to the
functionality of earlier version, reserving one-third of the sockets for EJB.
Enable traceflag 1642 to set up the EJB server. For this version of Adaptive
Server, you can ignore this message, "hbc_ninit: No sockets
available for HBC", in the error log if the EJB server is not configured.
In Adaptive Server version 12.5.3 and later, if the EJB server is enabled and
HBC sockets are not available, "hbc_ninit: No sockets available
for HBC" is reported. If traceflag 1642 is not enabled, set the flag, and restart
Adaptive Server. If the EJB server is not enabled, then no message is reported
and Adaptive Server automatically disables the sockets reserved for EJB
server.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Query Tuning
If you have not configured number of worker processes for a sufficient number
of threads from the worker thread pool, Adaptive Server adjusts query plans at
runtime to use fewer worker threads. If Adaptive Server cannot adjust the
queries at runtime, the queries recompile serially. However, alter table and
execute immediate commands are aborted if they do not have sufficient worker
threads.
Summary information
Default value 0
Range of values Site-specific
Status Read-only
Display level Comprehensive
Required role System administrator
Configuration group O/S Resources
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
Summary information
Default value 100
Range of values 1–2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, Meta-Data Cache
open index hash spinlock ratio sets the number of index metadata descriptor
hash tables that are protected by one spinlock. This parameter is used only in
multiprocessing systems only.
All the index descriptors belonging to a table are accessible through a hash
table. When you run a query on the table, Adaptive Server uses hash tables to
look up the necessary index information in its sysindexes rows. A hash table is
an internal mechanism used by Adaptive Server to retrieve information
quickly.
Usually, you do not need to change this parameter. In rare instances, however,
you may need to reset it if Adaptive Server demonstrates contention from hash
spinlocks. See the Performance and Tuning Series: Monitoring Adaptive
Server with sp_sysmon.
For more information about configuring spinlock ratios, see Chapter 5,
“Managing Multiprocessor Servers,” in the System Administration Guide:
Volume 2.
Summary information
Default value 100
Range of values 1–214748364
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Meta-Data Cache
open index spinlock ratio specifies the number of index metadata descriptors
that are protected by one spinlock.
Adaptive Server uses a spinlock to protect an index descriptor, since more than
one process can access the contents of the index descriptor. open index spinlock
ratio is used only in multiprocessing systems.
The value specified for this parameter defines the ratio of index descriptors per
spinlock.
If one spinlock is shared by too many index descriptors, it can cause spinlock
contention. Use sp_sysmon to get a report on spinlock contention. See the
Performance and Tuning Series: Monitoring Adaptive Server with sp_sysmon.
If sp_sysmon output indicates an index descriptor spinlock contention of more
than 3 percent, try decreasing the value of open index spinlock ratio.
See Chapter 5, Managing Mulitprocessor Servers,” in System Administration
Guide: Volume 2.
Summary information
Default value 100
Summary information
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Meta-Data Cache
open object spinlock ratio specifies the number of object descriptors that are
protected by one spinlock. Adaptive Server uses a spinlock to protect an object
descriptor, since more than one process can access the contents of the object
descriptor. open object spinlock ratio is used only in multiprocessing systems..
The default value for this parameter is 100; 1 spinlock for each 100 object
descriptors configured for your server. If your server is configured with only
one engine, Adaptive Server sets only 1 object descriptor spinlock, regardless
of the number of object descriptors.
If one spinlock is shared by too many object descriptors, it causes spinlock
contention. Use sp_sysmon to get a report on spinlock contention. See the
Performance and Tuning Series: Monitoring Adaptive Server with sp_sysmon.
If sp_sysmon output indicates an object descriptor spinlock contention of more
than 3 percent, try decreasing the value of the open object spinlock ratio
parameter.
See Chapter 5, Managing Mulitprocessor Servers,” in System Administration
Guide: Volume 2.
optimization goal
Summary information
Default value allrows_mix
Range of values allrows_oltp, allrows_dss
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Optimization goals are a convenient way to match user query demands with the
best optimization techniques, ensuring optimal use of the optimizer’s time and
resources. Adaptive Server allows users to configure for two optimization
goals, which you can specify at three tiers: server level, session level, and
query level.
The server-level optimization goal is overridden at the session level, which is
overridden at the query level.
These optimization goals allow you to choose an optimization strategy that best
fits your query environment:
• allrows_oltp – the most useful goal for purely OLTP queries.
Summary information
Default value 10
Range of values 0 – 1000
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
Summary information
Default value 200
Range of values 2–2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
page lock promotion HWM (high-water mark), with page lock promotion LWM
(low-water mark) and page lock promotion PCT (percentage), specifies the
number of page locks permitted during a single scan session of a page-locked
table or index before Adaptive Server attempts to escalate from page locks to
a table lock.
When the number of page locks acquired during a scan session exceeds page
lock promotion HWM, Adaptive Server attempts to acquire a table lock. page
lock promotion HWM value cannot be higher than number of locks.
For more detailed information on scan sessions and setting up page lock
promotion limits, see Chapter 2, “Locking Configuration and Tuning,” in the
Performance and Tuning Series: Locking and Concurrency Control.
The default value for page lock promotion HWM is appropriate for most
applications. To avoid table locking, you may want to increase the value. For
example, if you know that there are regular updates to 500 pages of an allpages-
locked or datapages-locked table containing thousands of pages, increase
concurrency for the tables by setting page lock promotion HWM to 500.
You can also configure lock promotion of page-locked tables and views at the
object level. See sp_setrowlockpromote in the Reference Manual: Procedures.
Use sp_sysmon to see how changing page lock promotion HWM affects the
number of lock promotions. sp_sysmon reports the ratio of exclusive page to
exclusive table lock promotions and the ratio of shared page to shared table
lock promotions. See the Performance and Tuning Series: Monitoring
Adaptive Server with sp_sysmon.
Summary information
Default value 200
Range of values 2–value of page lock promotion HWM
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
page lock promotion LWM (low-water mark), with page lock promotion HWM
(high-water mark) and the page lock promotion PCT, specify the number of page
locks permitted during a single scan session of a page locked table or an index
before Adaptive Server attempts to promote from page locks to a table lock.
The page lock promotion LWM sets the number of page locks below which
Adaptive Server does not attempt to issue a table lock on an object. page lock
promotion LWM must be less than or equal to page lock promotion HWM.
The default value for page lock promotion LWM is sufficient for most
applications. If Adaptive Server runs out of locks (except for an isolated
incident), increase number of locks.
See the Performance and Tuning Series: Locking and Concurrency Control.
You can also configure page lock promotion at the object level. See
sp_setpglockpromote in the Reference Manual: Procedures.
Summary information
Default value 100
Range of values 1–100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
If the number of locks held on an object is between page lock promotion LWM
(low-water mark) and page lock promotion HWM (high-water mark). page lock
promotion PCT sets the percentage of page locks (based on the table size) above
which Adaptive Server attempts to acquire a table lock.
See Chapter 2, “Locking Configuration and Tuning,” in the Performance and
Tuning Series: Locking and Concurrency Control.
The default value for page lock promotion PCT is appropriate for most
applications.
You can also configure lock promotion at the object level for page locked
objects. See sp_setpglockpromote in the Reference Manual: Procedures.
Summary information
Default value 95
Range of values 1–100
Status Dynamic
Summary information
Display level Comprehensive
Required role System administrator
Configuration group Disk I/O
partition groups
Summary information
Default value 1024
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Meta-Data Cache
partition groups specifies the maximum number of partition groups that can be
allocated by Adaptive Server. Partition groups are internal structures used by
Adaptive Server to control access to individual partitions of a table. Partition
groups are used while upgrading or during a load database upgrade to
unpartition Adaptive Server 12.5.x and earlier partitions.
The default value allows a maximum 1024 open partition groups and a
maximum of 2147483647 open partitions. The actual number of partitions may
be slightly less, due to the grouping of partitions.
Summary information
Default value 10
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Meta-Data Cache
For Adaptive Servers running with multiple engines, partition spinlock ratio sets
the number of rows in the partition descriptors that are protected by one
spinlock.
Adaptive Server manages access to table partitions using partition descriptors.
Each partition descriptor stores information about a partition (for example, the
last page of the partition) that processes must use when accessing that partition.
Configure partition descriptors using number of open partitions.
The default value of partition spinlock ratio sets 1 spinlock for every 10 partition
caches. Decreasing the value of partition spinlock ratio may have little impact on
the performance of Adaptive Server. The default setting is correct for most
servers.
See Chapter 5, Managing Mulitprocessor Servers,” in System Administration
Guide: Volume 2.
Summary information
Default value 64MB
Valid values 0 – 2147483647
Status Dynamic
Display level Intermediate
Required role System Administrator
Configuration group User Environment
pci memory size sets the size of the pluggable component interface (PCI)
memory pool. All pluggable component adapter (PCA) and JVM plug-ins
running under the PCI Bridge share a single dedicated PCI memory pool. If
you set pci memory size to less than the default, Adaptive Server uses the
default size.
This memory pool is fully dedicated to the PCI bridge and any running
pluggable component. Like all other memory pools, Adaptive Server controls
this memory pool. However, unlike other memory pools, the PCI memory pool
is allocated when you initialize the PCI Bridge and does not grow after that
time.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
per object statistic active controls whether Adaptive Server collects statistics for
each object.
Summary information
Default value 20
Valid values 0 – 100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
percent database for history specifies the percentage of the total space available
in sybmgmtdb that is reserved for the js_history table. Increase percent database
for history if there are more jobs running, or to store historical records about
executed jobs for future queries.
Summary information
Default value 30
Valid values 0 – 100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
percent database for output specifies the percentage of the total space available
in sybmgmtdb that is reserved for job output. Increase the default value if there
are more jobs running or jobs that produce lot of output that must be stored for
querying.
Summary information
Default value 30
Valid values 0 – 100
Summary information
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 50
Valid values 0 – 100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
performance monitoring option enables the license for the BMC DBXray
graphical performance monitoring and diagnostic tool .
Summary information
Default value 15
Range of values 1–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, User Environment
permission cache entries determines the number of cache protectors per task,
increasing the amount of memory for each user connection and worker process.
Information about user permissions is held in the permission cache. When
Adaptive Server checks permissions, it looks first in the permission cache; if it
does not find what it needs, it looks in the sysprotects table. This process is
significantly faster if Adaptive Server finds the information it needs in the
permission cache and does not have to read sysprotects.
However, Adaptive Server looks in the permission cache only when it is
checking user permissions, not when permissions are being granted or revoked.
When a permission is granted or revoked, the entire permission cache is
flushed. This is because existing permissions have timestamps that become
outdated when new permissions are granted or revoked.
If users on your Adaptive Server frequently perform operations that require
their permissions to be checked, you may see a small performance gain by
increasing the value of permission cache entries. This effect is not likely to be
significant enough to warrant extensive tuning.
If users on your Adaptive Server frequently grant or revoke permissions, avoid
setting permission cache entries to a large value. The space used for the
permission cache would be wasted, since the cache is flushed with each grant
and revoke command.
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level Comprehensive
Summary information
Required role System administrator
Configuration group Monitoring
plan text pipe active determines whether Adaptive Server collects query plan
text. If both plan text pipe active and plan text pipe max messages are enabled,
Adaptive Server collects the plan text for each query. You can use
monSysPlanText to retrieve the query plan text for all user tasks.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
plan text pipe max messages determines the number of query plan text
messages Adaptive Server stores per engine. The total number of messages in
the monSQLText table is the value of sql text pipe max messages multiplied by
the number of engines running.
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on), 2 (on, print summary)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Backup/Recovery
Summary information
Default value 7000
Range of values 7000 – 2147483647
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
Specifies the size of the procedure cache, in 2K pages. Adaptive Server uses
the procedure cache while running stored procedures. If the server finds a copy
of a procedure already in the cache, it does not need to read it from the disk.
Adaptive Server also uses space in the procedure cache to compile queries
while creating stored procedures.
Since the optimum value for procedure cache size differs from application to
application, resetting it may improve Adaptive Server performance. For
example, if you run many different procedures or ad hoc queries, your
application uses the procedure cache more heavily, so you may want to
increase this value.
If you are upgrading, procedure cache size is set to the size of the original
procedure cache at the time of upgrade.
Summary information
Default value 1(enabled)
Range of values 0–1
Status dynamic
Display level
Required role System administrator
Configuration groups Query tuning
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
process wait events controls whether Adaptive Server collect statistics for each
wait event for every task. You can get wait information for a specific task using
monProcessWaits.
See Chapter 17, “Using Stored Procedures,” in the Transact-SQL Users Guide.
Summary information
Default value 20
Range of values
Status dynamic
Display level Comprehensive
Required role System administrator
Configuration group
Summary information
Default value 5
Valid values 1 – 60
Summary information
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
Summary information
Default value 2
Valid values 0 – 32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
Summary information
Default value 0 (off)
Valid values 0 (off), 1(on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Lock Manager
Summary information
Default value 5
Range of values 1–32767
Status Dynamic
Display level Basic
Required role System administrator
Configuration group Backup/Recovery
recovery interval in minutes sets the maximum number of minutes per database
that Adaptive Server uses to complete its recovery procedures in case of a
system failure. The recovery procedure rolls transactions backward or forward,
starting from the transaction that the checkpoint process indicates as the oldest
active transaction. The recovery process has more or less work to do,
depending on the value of recovery interval in minutes.
Adaptive Server estimates that 6000 rows in the transaction log require 1
minute of recovery time. However, different types of log records can take more
or less time to recover. If you set recovery interval in minutes to 3, the checkpoint
process writes changed pages to disk only when syslogs contains more than
18,000 rows since the last checkpoint.
Adaptive Server uses the recovery interval in minutes setting and the amount of
activity on each database to decide when to checkpoint each database. When
Adaptive Server checkpoints a database, it writes all dirty pages (data pages
in cache that have been modified) to disk. This may create a brief period of high
I/O, called a checkpoint spike. The checkpoint also performs other
maintenance tasks, including truncating the transaction log for each database
for which the truncate log on chkpt option has been set. About once per minute,
the sleeping checkpoint process “wakes up,” checks the truncate log on chkpt
setting, and checks the recovery interval to determine if a checkpoint is needed.
Figure 5-4 shows the logic used by Adaptive Server during this process.
Sleep
Checkpoint
process
wakes up
and polls
each database
No
No Time to Logs
checkpoint? truncated
Yes
Checkpoint
performed
You may want to change the recovery interval if your application and its use
change. For example, you may want to shorten the recovery interval when
there is an increase in update activity on Adaptive Server. Shortening the
recovery interval causes more frequent checkpoints, with smaller, more
frequent checkpoint spikes, and slows the system slightly. However, setting the
recovery interval too high may cause the recovery time to be unacceptably
long. You can reduce the spikes caused by checkpointing by reconfiguring the
housekeeper freewrite percent parameter. See “housekeeper free write percent”
on page 145. For more information on the performance implications of
recovery interval in minutes, see Chapter 5, “Memory Use and Performance,” in
the Performance and Tuning Series: Basics.
Use sp_sysmon to determine how a particular recovery interval affects the
system. See the Performance and Tuning Series: Monitoring Adaptive Server
with sp_sysmon.
Summary information
Default value 3
Range of values 3–255
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Network Communication
remote server pre-read packets determines the number of packets that are “pre-
read” by a site handler during connections with remote servers.
To reduce the required number of connections, communication between two
servers is managed through a single site handler. The site handler can pre-read
and keep track of data packets for each user process before the receiving
process is ready to accept them.
The default value for remote server pre-read packets is appropriate for most
servers. Increasing the value uses more memory; decreasing the value can slow
network traffic between servers. See Chapter 15, “Managing Remote Servers.”
Summary information
Default value 0
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Basic
Required role System security officer
Configuration group Security Related
Summary information
Default value 200
Range of values 2–2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
row lock promotion HWM (high-water mark), with row lock promotion LWM (low-
water mark) and row lock promotion PCT specifies the maximum number of row
locks permitted during a single scan session of a table or an index before
Adaptive Server attempts to escalate from row locks to a table lock.
When the number of locks acquired during a scan session exceeds row lock
promotion HWM, Adaptive Server attempts to acquire a table lock. The lock
promotion HWM value cannot be higher than the number of locks value.
Summary information
Default value 200
Range of values 2–value of row lock promotion HWM
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
row lock promotion LWM (low-water mark), with the row lock promotion HWM
(high-water mark) and row lock promotion PCT specifies the number of row
locks permitted during a single scan session of a table or an index before
Adaptive Server attempts to promote from row locks to a table lock.
row lock promotion LWM sets the number of locks below which Adaptive Server
does not attempt to acquire a table lock on the object. The row lock promotion
LWM must be less than or equal to row lock promotion HWM.
The default value for row lock promotion LWM is sufficient for most
applications. If Adaptive Server runs out of locks (except for an isolated
incident), increase number of locks.
See the Performance and Tuning Series: Locking and Concurrency Control.
You can also configure lock promotion at the object level. See
sp_setpglockpromote in the Reference Manual: Procedures.
Summary information
Default value 100
Range of values 1–100
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups Lock Manager, SQL Server Administration
If the number of locks held on an object is between row lock promotion LWM
(low-water mark) and row lock promotion HWM (high-water mark), row lock
promotion PCT sets the percentage of row locks (based on the number of rows
in the table) above which Adaptive Server attempts to acquire a table lock.
The default value for row lock promotion PCT is appropriate for most
applications.
For more information on setting up lock promotion limits, see Chapter 2,
“Locking Configuration and Tuning,” in Performance and Tuning Series:
Locking and Concurrency Control.
You can also configure row lock promotion at the per-object level. See
sp_sterowlockpromote in the Reference Manual: Procedures.
Summary information
Default value 600
Range of values 600 – 4026531839
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration groups SQL Server Administration
rtm thread idle wait period defines the time, in seconds, a native thread used by
Adaptive Server waits when it has no work to do. When the time set for a native
thread is reached, the thread automatically fades out.
Summary information
Default value 2000 (default value of 3 for the Cluster Edition)
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
runnable process search count specifies the number of times an engine loops
while looking for a runnable task before relinquishing the CPU to the operating
system.
Adaptive Server engines check the run queue for runnable tasks whenever a
task completes or exceeds its allotted time on the engine. At times, there are no
tasks in the run queues. An engine can either relinquish the CPU to the
operating system or continue to check for a task to run. Setting runnable
process search count higher causes the engine to loop more times, thus holding
the CPU for a longer time. Setting the runnable process search count lower
causes the engine to release the CPU sooner.
If your machine is a uniprocessor that depends on helper threads to perform
I/O, you may see some performance benefit from setting runnable process
search to perform network I/O, disk I/O, or other operating system tasks. If a
client, such as a bulk-copy operation, is running on the same machine as a
single CPU server that uses helper threads, you may need to allow both the
server and the client access to the CPU.
Note If you are having performance problems, try setting runnable process
search count to 3.
For Adaptive Servers running on uniprocessor machines that do not use helper
threads, and for multiprocessor machines, the default value provides good
performance.
With a runnable process search count value of 3, the Cluster Edition can better
share the system CPU with other processes running on the same machine.
However, if runnable process search count is 3 and Adaptive Server is running
as a stand-alone process, users may experience delays in server response times.
In this case, reset runnable process search count to 2000.
Use sp_sysmon to determine how the runnable process search count parameter
affects the Adaptive Server use of CPU cycles, engine yields to the operating
system, and blocking network checks. See the Performance and Tuning Series:
Monitoring Adaptive Server with sp_sysmon.
sampling percent
Summary information
Default value 0
Range of values 0 – 100 percent
Status Dynamic
Display level Comprehensive
Required role System or database administrator
Configuration group Query Tuning
sampling percent is the numeric value of the sampling percentage, such as 5 for
5%, 10 for 10%, and so on.
To reduce I/O contention and resources, run update statistics using a sampling
method, which can reduce the I/O and time when your maintenance window is
small and the data set is large. If you are updating a large data set or table that
is in constant use, being truncated and repopulated, you may want to perform
a statistical sampling to reduce the time and the size of the I/O.
Use caution with sampling, since the results are not fully accurate. Balance
changes to histogram values against the savings in I/O.
Although a sampling of the data set may not be completely accurate, usually
the histograms and density values are reasonable within an acceptable range.
When you are deciding whether or not to use sampling, consider the size of the
data set, the time constraints you are working with, and if the histogram
produced is as accurate as needed.
The percentage to use when sampling depends on your needs. Test various
percentages until you receive a result that reflects the most accurate
information on a particular data set.
Statistics are stored in the system tables systabstats and sysstatistics.
Summary information
Default value 0
Range of values 0 (followed by another parameter naming the default
login)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
secure default login specifies a default login for all users who are
preauthenticated but who do not have a login in master..syslogins.
Establish the secure default login with:
sp_configure "secure default login", 0, default_login_name
where:
• secure default login – is the name of the parameter.
select on syscomments.text
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System security officer
Configuration group Security Related
Summary information
Default value 1 (on)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Network Communication
Summary information
Default value 600
Valid values 0 – 32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Shared disk cluster
session migration timeout specifies the amount of time available for a client to
complete a migration by connecting to the target instance. If the client does not
migrate to the target instance in the time alloted, Adaptive Server fails the
connection.
Summary information
Default value The logical page size
Range of values The logical page size up to 2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration group User Environment
session tempdb log cache size configures the size of the user log cache (ULC),
helping to determine how often it needs flushing.
Summary information
Default value 0
Range of values Platform-specific
Status Static
Display level Comprehensive
Required role System administrator
Configuration group Physical Memory
shared memory starting address determines the virtual address where Adaptive
Server starts its shared memory region.
It is unlikely that you will ever have to reconfigure shared memory starting
address. Do so only after consulting with Sybase Technical Support.
number of worker processes, max parallel degree, and max scan parallel degree
control parallel query processing at the server level. Using the parallel_degree,
process_limit_action, and scan_parallel_degree options to the set command can
limit parallel optimization at the session level, and using the parallel keyword
of the select command can limit parallel optimization of specific queries.
Summary information
Default value 10
Range of values 1–38
Summary information
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
size of auto identity column sets the precision of IDENTITY columns that are
automatically created with the sp_dboption auto identity and unique
auto_identity index options.
Summary information
Default values 150 pages (32-bit version)
300 pages (64-bit version)
Minimum values 10 pages (32-bit version)
20 pages (64-bit version)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Java Services, Memory Use
size of global fixed heap specifies the memory space for internal data structures
and other needs.
If you change size of the global fixed heap, change the total logical memory by
the same amount.
Summary information
Default values 1500 pages (32-bit version)
3000 pages (64-bit version)
Minimum values 45 pages (32-bit version)
90 pages (64-bit version)
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Java Services, Memory Use
size of process object fixed heap specifies the total memory space for all
processes using the Java VM.
If you change size of process object fixed heap, change the total logical memory
by the same amount.
Summary information
Default values 1536 pages (32-bit version)
3072 pages (64-bit version)
Minimum values 650 pages (32-bit version)
1300 pages (64-bit version)
Status Dynamic
Display level Basic
Required role System administrator
Configuration groups Java Services, Memory Use
size of shared class heap specifies the shared memory space for all Java classes
called into the Java VM. Adaptive Server maintains the shared class heap
server-wide for both user-defined and system-provided Java classes.
If you change the size of shared class heap, change the total logical memory by
the same amount.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Unicode
size of unilib cache specifies the memory used in bytes rounded up to the nearest
1K in addition to the minimum overhead size, which provides enough memory
to load a single copy of the largest Unilib conversion table plus the largest
Unilib sort table. Asian clients may need to increase size of unilib cache by an
extra 100K for every additional character set they want to support via Unicode-
based conversion.
Summary information
Default value 40
Range of values 0 – 4000
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
sproc optimize timeout limit specifies the amount of time Adaptive Server can
spend optimizing a stored procedure as a fraction of the estimated execution
time.
Summary information
Default value 0 (off)
Range of values 0 (off), 1(on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group Monitoring
SQL batch capture controls whether Adaptive Server collects SQL text. If both
SQL batch capture and max SQL text monitored are enabled, Adaptive Server
collects the SQL text for each batch for each user task.
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
SQL Perfmon Integration enables and disables the ability to monitor Adaptive
Server statistics from the Windows Performance Monitor.
Adaptive Server must be registered as a Windows Service to support monitor
integration. This occurs automatically when:
• You start Adaptive Server using the Services Manager in the Sybase for
the Windows program group.
• You use the Services option in the Control Panel.
• You have configured Windows to start Adaptive Server as an automatic
service.
See Configuring Guide for Windows for a list of the Adaptive Server counters
you can monitor.
Summary information
Default value Platform-specific
Range of values Platform-specific minimum–1000000, in multiples of
default value
Status Static
Display level Comprehensive
Summary information
Required role System administrator
Configuration group SQL Server Administration
sql server clock tick length specifies the duration of the server’s clock tick, in
microseconds. Both the default value and the minimum value are platform-
specific. Adaptive Server rounds values up to an even multiple of n, where n is
the platform-specific clock-tick default value. Use sp_helpconfig or
sp_configure to find the current values for sql server clock tick length.
Note Changing the value of sql server clock tick length can have serious effects
on Adaptive Server performance. Consult with Sybase Technical Support
before resetting this value.
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group Monitoring
sql text pipe active controls whether Adaptive Server collects SQL text. If this
option is enabled and sql text pipe max messages is set, Adaptive Server
collects the SQL text for each query. Use monSysSQLText to retrieve the SQL
text for all user tasks.
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
sql text pipe max messages specifies the number of SQL text messages
Adaptive Server stores per engine. The total number of messages in the
monSQLText table is the value of sql text pipe max messages multiplied by the
number of engines running.
Summary information
Default value 4096
Range of values 0–2147483647
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, User Environment
stack guard size sets the size, in bytes, of the stack guard area, which is an
overflow stack of configurable size at the end of each stack. Adaptive Server
allocates one stack for each user connection and worker process when it starts.
These stacks are located contiguously in the same area of memory, with a guard
area at the end of each stack. At the end of each stack guard area is a
guardword, which is a 4-byte structure with a known pattern. Figure 5-5
illustrates how a process can corrupt a stack guardword.
Figure 5-5: Process about to corrupt stack guardword
Stack 2
guard area
Stack guardwords
Stack 2
Stack 1
guard area Process overflowing stack
area, about to corrupt
stack guardword
Stack 1
Process begins
executing
Adaptive Server periodically checks to see whether the stack pointer for a user
connection has entered the stack guard area associated with that user
connection’s stack. If it has, Adaptive Server aborts the transaction, returns
control to the application that generated the transaction, and generates error
3626:
The transaction was aborted because it used too much
In the first message, “limit” is the address of the end of the stack guard area,
and “sp” is the current value of the stack pointer.
In addition, Adaptive Server periodically checks the stack pointer to see
whether it is completely outside both the stack and the stack guard area for the
pointer’s process. If it is, Adaptive Server shuts down, even if the guardword
is not corrupted. When this happens, Adaptive Server prints the following
messages to the error log:
kernel: *** Stack overflow detected: limit: 0x%lx sp: 0x%lx
kernel: *** Stack corrupted, server aborting
The default value for stack guard size is appropriate for most applications.
However, if you experience server shutdown from either stack guardword
corruption or stack overflow, increase stack guard size by a 2K increment. Each
configured user connection and worker process has a stack guard area; thus,
when you increase stack guard size, you use up that amount of memory,
multiplied by the number of user connections and worker processes you have
configured.
Rather than increasing stack guard size to avoid stack overflow problems,
consider increasing stack size (see “stack size” on page 249). The stack guard
area is intended as an overflow area, not as an extension to the regular stack.
Adaptive Server allocates stack space for each task by adding the values of the
stack size and stack guard size parameters. stack guard size must be configured
in multiples of 2K. If the value you specify is not a multiple of 2K, sp_configure
verification routines round the value up to the next highest multiple.
stack size
Summary information
Default value Platform-specific
Range of values Platform-specific minimum–2147483647
Status Static
Display level Basic
Required role System administrator
Configuration group User Environment
stack size specifies the size, in bytes, of the execution stacks used by each user
process on Adaptive Server. To find the stack size values for your platform, use
sp_helpconfig or sp_configure. stack size must be configured in multiples of 2K.
If the value you specify is not a multiple of 2K, sp_configure verification
routines round the value up to the next highest multiple.
An execution stack is an area of Adaptive Server memory where user processes
keep track of their process context and store local data.
Certain queries can contribute to the probability of a stack overflow. Examples
include queries with extremely long where clauses, long select lists, deeply
nested stored procedures, and multiple selects and updates that holdlock. When
a stack overflow occurs, Adaptive Server prints an error message and rolls back
the transaction. See “stack guard size” on page 246, and see the
Troubleshooting and Error Messages Guide for more information on specific
error messages.
The two options for remedying stack overflows are to break the large queries
into smaller queries and to increase stack size. Changing stack size affects the
amount of memory required for each configured user connection and worker
process. See “total logical memory” on page 260.
If you have queries that exceed the size of the execution stack, you may want
to rewrite them as a series of smaller queries, especially if there are only a small
number of such queries, or if you run them infrequently.
There is no way to determine how much stack space a query requires without
actually running the query. Stack space for each user connection and worker
process is preallocated at start-up.
Summary information
Default value 0 (off)
Valid values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Extended Stored Procedure
start mail session enables and disables the automatic initiation of an Adaptive
Server mail session when you start Adaptive Server.
A value of 1 configures Adaptive Server to start a mail session the next time
Adaptive Server is started. A value of 0 configures Adaptive Server not to start
a mail session at the next restart.
If start mail session is 0, you can start an Adaptive Server mail session
explicitly, using the xp_startmail system ESP.
Before setting start mail session, you must prepare your Windows system by
creating a mailbox and mail profile for Adaptive Server. Then, create an
Adaptive Server account for Sybmail. See the Configuration Guide for
Windows.
Summary information
Default value 0 (off)
Summary information
Range of values 0 (off), 1 (on)
Status Static
Display level
Required role
Configuration group Extended Stored Procedures
start xp server during boot determines whether XP Server starts when Adaptive
Server starts.
When set to 1, XP Server starts when Adaptive Server starts. If you set start xp
server during boot to 0, XP Server does not start until you run xp_cmdshell.
startup delay
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Query Tuning
startup delay controls when RepAgent is started during the server start. By
default, RepAgent starts at the same time as Adaptive Server. Adaptive Server
writes a message to the error log stating the wait time.
Summary information
Default value 0
Valid values Size of cache in 2K pages
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, SQL Server Administration
Note If you enable the statement cache, you must configure set chained on/off
in its own batch.
Because cached statements are transformed into lightweight stored procedures,
statement caching requires additional open object descriptors.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
Summary information
Default value 0
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Monitoring
Summary information
Default value 0 (off)
Valid values 0 (off), 1(on)
Status Static
Display level 10
Required role System administrator
Configuration group DTM Administration
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
suspend audit when device full determines what Adaptive Server does when an
audit device becomes completely full.
Note If you have two or more audit tables, each on a separate device other than
the master device, and you have a threshold procedure for each audit table
segment, the audit devices should never become full. Only if a threshold
procedure is not functioning properly does the “full” condition occur.
Summary information
Default value 0
Valid values 0, or 1024–65535, or system limit
Status Dynamic
Display level Comprehensive
Summary information
Required role System administrator
Configuration group Network Communication
syb_sendmsg port number specifies the port number that Adaptive Server uses
to send messages to a UDP (User Datagram Protocol) port with sp_sendmsg or
syb_sendmsg.
If more than one engine is configured, a port is used for each engine, numbered
consecutively from the port number specified. If the port number is set to the
default value, 0 Adaptive Server assigns port numbers.
A system security officer must set the allow sendmsg configuration parameter
to 1 to enable sending messages to UDP ports. To enable UDP messaging, a
system administrator must set allow sendmsg to 1. See “allow sendmsg” on
page 88. For more information on UDP messaging, see sp_sendmsg in the
Reference Manual: Procedures.
Summary information
Default value 0
Valid values 0 – 32767
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
The in-memory statistics are always flushed to disk during a polite shutdown
of the server. You can configure sysstatistics flush interval to flush these in-
memory statistics to disk by the house keeper task at regular intervals. Set
sysstatistics flush interval to 0 to disable this housekeeper task.
Summary information
Default value 0
Range of values 0–32767
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
systemwide password expiration sets the number of days that passwords remain
in effect after they are changed. If systemwide password expiration is set to 0,
passwords do not expire.
The password expires when the number of specified days passes. For example,
if you create a new login on August 1, 2007 at 10:30 a.m., with a password
expiration interval of 30 days, the password expires on August 31, 2007 at
10:30 a.m.
An account’s password is considered expired if an interval greater than
number_of_days has passed since the last time the password for that account
was changed.
When the number of days remaining before expiration is less than 25 percent
of the value of systemwide password expiration or 7 days, whichever is greater,
each time the user logs in, a message displays, giving the number of days
remaining before expiration. Users can change their passwords anytime before
expiration.
When an account’s password has expired, the user can still log in to Adaptive
Server but cannot execute any commands until he or she has used sp_password
to change his or her password. If the system security officer changes the user’s
password while the account is in sp_password-only mode, the account returns
to normal after the new password is assigned.
This restriction applies only to login sessions established after the password
has expired. Users who are logged in when their passwords expire are not
affected until the next time they log in.
Summary information
Default value 0
Range of values 0–365
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group Backup/Recovery
tape retention in days specifies the number of days you intend to retain each
tape after it has been used for either a database or a transaction log dump. This
parameter can keep you from accidentally overwriting a dump tape.
For example, if you have set tape retention in days to 7 days, and you attempt
to use the tape before 7 days have elapsed since the last time you dumped to
that tape, Backup Server issues a warning message.
You can override the warning using the with init option when executing the
dump command. Doing this causes the tape to be overwritten and all data on
the tape to be lost.
Both the dump database and dump transaction commands provide a retaindays
option, which overrides the tape retention in days value for a particular dump.
See Chapter 12, “Backing Upa and Restoring User Databases,” in System
Administration Guide: Volume 2.
tcp no delay
Summary information
Default value 1 (on)
Valid values 0 (off), 1 (on)
Status Static
Display level Comprehensive
Required role System administrator
Configuration groups Network Communication, O/S Resources
TCP normally batches small logical packets into single, larger, physical
packets, and fills physical network frames with as much data as possible, which
improves network throughput in terminal emulation environments where users
mostly send keystrokes across the network.
However, applications that use small TDS (Tabular Data Stream) packets may
benefit from disabling TCP packet batching.
Note Disabling TCP packet batching means that packets are sent, regardless
of size; this increases the volume of network traffic.
Summary information
Default value 16
Valid values 0–65535
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration Group Network Communications
text prefetch size limits the number of pages of text, unitext, and image data that
can be prefetched into an existing buffer pool. Adaptive Server prefetches only
text, unitext, and image data that was created with Adaptive Server 12.x or was
upgraded using dbcc rebuild_text.
time slice
Summary information
Default value 100
Range of values 50–1000
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
time slice sets the number of milliseconds that the Adaptive Server scheduler
allows a task to run. If time slice is set too low, Adaptive Server may spend too
much time switching between tasks, which increases response time. If it is set
too high, CPU-intensive tasks may monopolize engines, which also increases
response time. The default value allows each task to run for 1/10 of a second
before relinquishing the CPU to another task.
See Chapter 3, “Using Engines and CPUs” in the Performance and Tuning
Series: Basics.
Use sp_sysmon to determine how time slice affects voluntary yields by
Adaptive Server engines. See the Performance and Tuning Series: Monitoring
Adaptive Server with sp_sysmon.
Summary information
Default value 0
Range of values 0 – 2147483647
Status Calculated
Display level Basic
Required role System administrator
Configuration groups Cache Manager, Memory Use
total data cache size reports the amount of memory, in kilobytes, that is
currently available for data, index, and log pages. This parameter is a
calculated value that is not directly user-configurable.
The amount of memory available for the data cache can be affected by a
number of factors, including:
• The amount of physical memory available on your machine
• The values to which the following parameters are set:
• total logical memory
• number of devices
A number of other parameters also affect the amount of available memory, but
to a lesser extent.
For information on how Adaptive Server allocates memory and for information
on data caches, see “Configuration parameters” on page 81.
Summary information
Default value N/A
Range of values N/A
Status Read-only
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, Physical Memory
total logical memory displays the total logical memory for the current
configuration of Adaptive Server. The total logical memory is the amount of
memory that the Adaptive Server current configuration uses. total logical
memory displays the memory that is required to be available, but which may or
may not be in use at any given moment. For information about the amount of
memory in use at a given moment, see total physical memory. You cannot use
total logical memory to set any of the memory configuration parameters.
Summary information
Default value N/A
Range of values N/A
Status Read-only
Display level Intermediate
Required role System administrator
Configuration group Memory Use
Summary information
Default value 4096
Range of values 0 – 2147483647
Status Dynamic
Display level Intermediate
Required role System administrator
Configuration group SQL Server Administration
Adaptive Server maintains a memory pool for the transfer table command and
for tables marked for incremental transfer. This pool provides memory for
maintaining state information about current and past transfers, and for memory
used to write to and read from transfer files. transfer utility memory size
determines the size of this memory pool.
The units for this pool are in memory pages, which are blocks of 2048 bytes.
The default size is large enough to accommodate over 100 tables marked for
incremental transfer, all transferring simultaneously.
If your installation does not include tables marked for incremental transfer, and
does not use the transfer table command, you may set the size of this memory
pool to zero to reclaim this memory.
Summary information
Default value 16
Valid values 1 – 2147483647
Status Static
Display level 1
Required role System administrator
Configuration groups DTM Administration, Memory Use
Note You can have as many databases in a user transaction as there are in your
Adaptive Server installation. For example, if your Adaptive Server has 25
databases, you can include 25 databases in your user transactions.
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Dynamic
Display level Intermediate
Required role System security officer
Configuration group Security Related
unified login required requires that all users who log in to Adaptive Server be
authenticated by a security mechanism. The use security services parameter
must be 1 to use the unified login security service.
upgrade version
Summary information
Default value 1100
Range of values 0–2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group SQL Server Administration
upgrade version reports the version of the upgrade utility that upgraded your
master device. The upgrade utility checks and modifies this parameter during
an upgrade.
Warning! Do not reset upgrade version. Doing so may cause serious problems
with Adaptive Server.
You can determine whether an upgrade has been done on your master device
by using upgrade version without specifying a value:
sp_configure "upgrade version"
Summary information
Default value 0 (off)
Range of values 0 (off), 1 (on)
Status Static
Display level Intermediate
Required role System security officer
Configuration group Security Related
Summary information
Default value Logical page size
Range of values 2048a –2147483647
a. Minimum determined by server’s logical page size
Status Static
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, User Environment
user log cache size specifies the size, in bytes, for each user’s log cache. Its size
is determined by the server’s logical page size. There is one user log cache for
each configured user connection and worker process. Adaptive Server uses
these caches to buffer the user transaction log records, which reduces the
contention at the end of the transaction log.
When a user log cache becomes full or another event occurs (such as when the
transaction completes), Adaptive Server “flushes” all log records from the user
log cache to the database transaction log. By first consolidating the log records
in each user’s log cache, rather than immediately adding each record to the
database’s transaction log, Adaptive Server reduces contention of processes
writing to the log, especially for SMP systems that are configured with more
than one engine.
Note For transactions using a database with mixed data and log segments, the
user log cache is flushed to the transaction log after each log record. No
buffering takes place. If your databases do not have dedicated log segments, do
not increase the user log cache size.
Do not configure user log cache size to be larger than the maximum amount of
log information written by an application’s transaction. Since Adaptive Server
flushes the user log cache when the transaction completes, any additional
memory allocated to the user log cache is wasted. If no transaction in your
server generates more than 4000 bytes of transaction log records, set user log
cache size no higher than that value. For example:
sp_configure "user log cache size", 4000
Setting user log cache size too high wastes memory. Setting it too low can
cause the user log cache to fill up and flush more than once per transaction,
increasing the contention for the transaction log. If the volume of transactions
is low, the amount of contention for the transaction log may not be significant.
Use sp_sysmon to understand how this parameter affects cache behavior. See
the Performance and Tuning Series: Monitoring Adaptive Server with
sp_sysmon.
Summary information
Default value 20
Range of values 1–2147483647
Status Dynamic
Summary information
Display level Intermediate
Required role System administrator
Configuration groups Memory Use, User Environment
For Adaptive Servers running with multiple engines, user log cache spinlock
ratio specifies the ratio of user log caches per user log cache spinlock. There is
one user log cache for each configured user connection.
The default specifies 1 spinlock for each 20 user connections configured for
your server.
Use sp_sysmon to understand how this parameter affects cache behavior. See
the Performance and Tuning Series: Monitoring Adaptive Server with
sp_sysmon.
Summary information
Default value 0
Range of values 0–1
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration groups Memory Use, Monitoring
wait event timing controls whether Adaptive Server collects statistics for
individual wait events. A task may have to wait for a variety of reasons (for
example, waiting for a buffer read to complete). The monSysWaits table
contains the statistics for each wait event. The monWaitEventInfo table contains
a complete list of wait events.
Summary information
Default value 80
Valid values 80 – 2147483647
Status Dynamic
Display level Comprehensive
Required role System administrator
Summary information
Configuration group Shared disk cluster
Summary information
Default value 60 (seconds)
Valid values 1 – 2147483647 (seconds)
Status Dynamic
Display level 10
Required role System administrator
Configuration group DTM Administration
xact coordination interval defines the length of time between attempts to resolve
transaction branches have been propagated to remote servers.
The coordinating Adaptive Server makes regular attempts to resolve the work
of remote servers participating in a distributed transaction. The coordinating
server contacts each remote server participating in the distributed transaction
in a serial manner, as shown in Figure 5-6. The coordination service may be
unable to resolve a transaction branch for a variety of reasons. For example, if
the remote server is not reachable due to network problems, the coordinating
server reattempts the connection after the time specified by xact coordination
level.
Adaptive Server
Coordination Service
With the default value of xact coordination interval, 60, Adaptive Server
attempts to resolve remote transactions once every minute. Decreasing the
value may speed the completion of distributed transactions, but only if the
transactions are themselves resolved in less than a minute. Under normal
circumstances, there is no performance penalty to decreasing the value of xact
coordination interval.
Setting xact coordination interval to a higher number can slow the completion of
distributed transactions, and cause transaction branches to hold resources
longer than they normally would. Under normal circumstances, do not increase
the value of xact coordination interval beyond its default.
xp_cmdshell context
Summary information
Default value 1
Valid values 0, 1, 2
Status Dynamic
Display level Comprehensive
Required role System administrator
Configuration group Extended Stored Procedure
xp_cmdshell context sets the security context for the operating system
command to be executed using the xp_cmdshell system ESP. The values for the
context determines under which account the command runs:
• 0 – command runs under XP Server’s account.
• 1 – command runs under user’s account.
Topic Page
Device allocation and object placement 271
Commands for managing disk resources 272
Considerations in storage management decisions 274
Status and defaults at installation time 275
System tables that manage storage 276
Many Adaptive Server defaults are set to reasonable values for aspects of
storage management, such as database, table, and index location, and how
much space is allocated for each one. Responsibility for storage allocation
and management is often centralized, and usually, the system
administrator has ultimate control over the allocation of disk resources to
Adaptive Server and the physical placement of databases, tables, and
indexes on those resources.
After the initial disk resources have been allocated to Adaptive Server, the
system administrator, database owner, and object owners should consider how
to place databases and database objects on specific database devices. These
object placement issues determine where database objects reside on your
system and whether or not the objects share devices. Object placement tasks
are discussed throughout this manual, including the chapters shown in Table 6-
2.
Table 6-2: Object placement topics
Task Chapter
Place databases on specific database devices Chapter 6, “Creating and Managing User
Databases,” in System Administration Guide:
Volume 2
Place tables and indexes on specific database devices Chapter 6, “Creating and Managing User
Databases,” in System Administration Guide:
Volume 2
Table 6-4 lists the commands used in object placement. For information about
how object placement affects performance, see Chapter 1, “Controlling
Physical Data Placement,” in the Performance and Tuning Series: Physical
Database Tuning.
Table 6-4: Commands for placing objects on disk resources
Command Task See
create database...on dev_name Makes database devices available to a particular Chapter 6,
or Adaptive Server database. The log on clause to “Creating and
alter database...on dev_name create database places the database’s logs on a Managing User
particular database device. Databases,” in
System
Administration
Guide: Volume 2
create database... When used without the on dev_name clause, Chapter 6,
or these commands allocate space on the default “Creating and
alter database... database devices. Managing User
Databases,” in
System
Administration
Guide: Volume 2
sp_addsegment seg_name, Creates a segment—a named collection of Chapter 8, “Creating
dbname, devname space—from the devices available to a and Using Segments
and particular database. in System
sp_extendsegment seg_name, Administration
dbname, devname Guide: Volume 2
create table...on seg_name Creates database objects, placing them on a Chapter 8, “Creating
or specific segment of the database’s assigned disk and Using Segments
create index...on seg_name space. in System
Administration
Guide: Volume 2
Recovery
Recovery is the key motivation for using several disk devices. You can mirror
database devices to achieve nonstop recovery. You can also ensure full
recovery by storing a database’s log on a separate physical device.
Mirroring
Nonstop recovery in the event of a hard disk failure is guaranteed by mirroring
all Adaptive Server devices to a separate physical disk. See Chapter 2,
“Mirroring Database Devices,” in System Administration Guide: Volume 2.
Performance
You can improve system performance by placing logs and database objects on
separate devices:
• Placing a table on one hard disk and nonclustered indexes on another
ensures that physical reads and writes are faster, since the work is split
between two disk drives.
• Splitting large tables across two disks can improve performance,
particularly for multiuser applications.
• When log and data share devices, user log cache buffering of transaction
log records is disabled.
• Partitioning provides multiple insertion points for a heap table, adds a
degree of parallelism to systems configured to perform parallel query
processing, and makes it possible to distribute a table’s I/O across multiple
database devices.
See Chapter 1, “Controlling Physical Data Placement,” in the Performance and
Tuning Series: Physical Database Tuning for a detailed discussion of how
object placement affects performance.
• The master device is the default storage device for all user-created
databases.
Note After initializing new devices for default storage, remove the master
device from the default storage area with sp_diskdefault. Do not store user
databases and objects on the master device. See “Designating default
devices” on page 290.
• If you install the audit database, sybsecurity, it is located on its own device.
SYSUSAGES
Transactions SYSDEVICES
Transactions
One row
for each N 1
fragment
One row for
Master N segmap each device
database
User
database N segmap
SYSSEGMENTS
Transactions SYSINDEXES
Student Info
1 N
One row segment segment
for each
segment
The disk init command adds entries for database devices to master..sysdevices.
Dump devices, added using sp_addumpdevice, are discussed in Chapter 11,
“Developing a Backup and Recovery Plan,” in the System Administration
Guide: Volume 2
sysdevices stores two names for each device:
Topic Page
Database devices 281
Using the disk init command 282
disk init syntax 282
Getting information about devices 288
Dropping devices 290
Designating default devices 290
Increasing the size of devices with disk resize 292
Database devices
A database device stores the objects that make up databases. The term
device does not necessarily refer to a distinct physical device: it can refer
to any piece of a disk (such as a disk partition) or a file in the file system
that is used to store databases and their objects.
Each database device or file must be prepared and made known to
Adaptive Server before it can be used for database storage. This process
is called initialization.
After a database device has been initialized, it can be:
• Allocated to the default pool of devices for the create and alter
database commands
Note Before you run disk init, see the installation documentation for your
platform for information about choosing a database device and preparing it for
use with Adaptive Server. You may want to repartition the disks on your
computer to provide maximum performance for your Sybase databases.
disk init divides the database devices into allocation units, groups of 256
logical pages. The size of the allocation unit depends on which logical page
size your server is configured for (2, 4, 8, or 16K). In each allocation unit, the
disk init command initializes the first page as the allocation page, which
contains information about the database (if any) that resides on the allocation
unit.
Warning! After you run the disk init command, dump the master database. This
makes recovery easier and safer in case master is damaged. See Chapter 13,
“Restoring the System Databases,” in System Administration Guide: Volume 2.
You cannot have a database smaller than the model database. A model database
larger than the minimums listed above, determines the minimum database size.
Adaptive Server allocates and manages database space in allocation units,
which are groups of 256 logical pages. The smallest database you can create
(using create database) is 1MB; therefore, the size of the smallest usable
database device is the larger of 1MB or 256 logical pages (for a 2K or 4K
logical page size, this is 1MB for a 8K logical page size, this is 2MB, for a 16K
logical page size, this is 4MB.
Keep this grouping of 256 pages in mind when you decide how large to make
a device to avoid wasting space. For example, if your installation uses a 16k
logical page size, specifying a device as size = '31M' leaves 3MB wasted at
the end of the device, since an allocation unit is 4MB.
If you are initializing a raw device, determine the size of the device from your
operating system, as described in the installation guide for your platform. Use
the total size available, up to the maximum for your platform. After you have
initialized the disk for use by Adaptive Server, you cannot use any space on that
raw device for any other purpose.
disk init uses size to compute the value for the high virtual page number in
sysdevices.high. The values for sysdevices.high and sysdevices.low are virtual
page numbers in 2K-byte blocks, which is the Adaptive Server unit of physical
disk management. This may not be the same as your installation's logical page
size
Note If the physical device does not contain the number of blocks specified by
the size parameter, disk init fails. If you use the optional vstart parameter, the
physical device must contain the sum of the blocks specified by both the vstart
and size parameters, or the command fails.
Note The dsync setting is ignored for devices initialized on raw partitions.
Instead, writes to the database device take place directly to the physical media.
• The directio and dsync parameters are mutually exclusive. If a device has
dsync set to true, you cannot set directio to true for the same device. To
enable directio for a device, you must first reset dsync to false.
Note directio is not available on all platforms. If you issue disk init with the
directio parameter on a platform on which it is not supported, Adaptive Server
issues the message No such parameter: 'directio'.
By default, the directio option is set to false (off) for all platforms.
Note Devices used for databases for which recovery is not important (for
example, tempdb), may, by default, have dsync set to false. For these devices,
enabling directio may have an adverse performance effect, so carefully review
device use before you enable directio.
This example creates a device named “user_disk” that uses directio to write data
directly to disk:
disk init
name = "user_disk",
physname = "/usr/u/sybase/data/userfile1.dat",
size = 5120, directio = true
To initializes 10MB of a disk on a UNIX operating system file, enter:
disk reinit
name = "user_disk",
physname = "/usr/u/sybase/data/userfile1.dat",
size = 5120, directio = true
By default, directio is disabled for all existing devices; enable it using
sp_deviceattr:
Note To perform disk initialization, the user who started Adaptive Server must
have the appropriate operating system permissions on the device that is being
initialized.
When used without a device name, sp_helpdevice lists all the devices available
on Adaptive Server. When used with a device name, it lists information about
that device. Here, sp_helpdevice is used to report information about the master
device:
sp_helpdevice master
device_name physical_name description
----------- -------------- ------------------------------------------
master d_master special, default disk, physical disk, 30 MB
Bit Meaning
64 Device mirrored
128 Reads mirrored
256 Secondary mirror side only
512 Mirror enabled
2048 Used internally; set after disk unmirror, side = retain
4096 Primary device needs to be unmirrored (used internally)
8192 Secondary device needs to be unmirrored (used internally)
16384 UNIX file device uses dsync setting (writes occur directly to
physical media)
For more information about dump devices and sp_addumpdevice, See Chapter
11, “Developing a Backup and Recovery Plan in the System Administration
Guide: Volume 2.
Dropping devices
To drop database and dump devices, use sp_dropdevice:
sp_dropdevice logicalname
You cannot drop a device that is in use by a database. You must drop the
database first.
sp_dropdevice removes the device name from sysdevices. sp_dropdevice does
not remove an operating system file; it only makes the file inaccessible to
Adaptive Server. Use operating system commands to delete a file after using
sp_dropdevice.
Note After initializing a set of database devices, you may want to assign them
to specific databases or database objects rather than adding them to the default
pool of devices. For example, you may want to make sure a table never grows
beyond the size of a particular device.
Note If you are using disk mirroring or segments, exercise caution in deciding
which devices you add to the default list. In most cases, devices that are to be
mirrored, or databases that contain objects placed on segments should
specifically allocate devices, rather than being made part of default storage.
Use disk resize to increase the size for both devices on raw partitions and for
file systems. The minimum amount of space by which you can increase a
device is 1MB or an allocation unit, whichever is greater.
Page size Allocation unit size Minimum incremental size
2K 0.5MB 1MB
4K 1MB 1MB
8K 2MB 2MB
16K 4MB 4MB
Topic Page
Using the sp_dboption procedure 295
Database option descriptions 296
Viewing the options on a database 297
sp_dboption
Settable database options.
--------------------
abort tran on log full
allow nulls by default
async log service
auto identity
dbo use only
ddl in tran
delayed commit
identity in nonunique index
no chkpt on recovery
no free space acctg
read only
select into/bulkcopy/pllsort
single user
trunc log on chkpt
trunc. log on chkpt.
unique auto_identity index
For a report on which options have been set in a particular database,
execute sp_helpdb in that database.
See the Commands Reference: Procedures for information about each
database option in detail.
sp_helpdb mydb
name db_size owner dbid created status
----- ------- ----- ---- ------------ -------------------
mydb 20.0 MB sa 5 Mar 05, 2005 read only
device segment
------------------------------ ------------------------------
master default
master logsegment
master system
To display a summary of the options for all databases, use sp_helpdb
without specifying a database:
sp_helpdb
name db_size owner dbid created status
------------- -------- ----- ---- ------------ -------------------
master 48.0 MB sa 1 Apr 12, 2005 mixed log and data
model 8.0 MB sa 3 Apr 12, 2005 mixed log and data
pubs2 20.0 MB sa 6 Apr 12, 2005 select into/
bulkcopy/pllsort, trunc log on chkpt, mixed log and data
sybsystemdb 8.0 MB sa 5 Apr 12, 2005 mixed log and data
sybsystemprocs 112.0 MB sa 4 Apr 12, 2005 trunc log on chkpt,
mixed log and data
tempdb 8.0 MB sa 2 Apr 12, 2005 select into/
bulkcopy/pllsort, trunc log on chkpt, mixed log and data
In this example, all applications and servers use local languages and character
sets to accept input and output messages.
Note The English language is supported by all character sets because the first
128 (decimal) characters of any character set include the Latin alphabet
(defined as “ASCll-7”). The characters beyond the first 128 differ between
character sets and are used to support the characters in different native
languages. For example, code points 0-127 of CP 932 and CP 874 both support
English and the Latin alphabet. However, code points 128-255 support
Japanese characters in CP 932 and code points 128-255 support Thai characters
in CP 874.
The following character sets support the European currency symbol, the
“euro”: CP 1252 (Western Europe); CP 1250 (Eastern Europe); CP 1251
(Cyrillic); CP 1256 (Arabic); CP 1253 (Greek); CP 1255 (Hebrew); CP 1254
(Turkish); CP 874 (Thai); iso15, roman9 and CP858. Unicode UTF-8 also
supports:
• Traditional Chinese on the Windows and Solaris platforms
• Arabic, Hebrew, Thai, and Russian on the Linux platform
Note iso_1 and ISO 8859-1 are different names for the same character set.
To mix languages from different language groups you must use Unicode. If
your server character set is Unicode, you can support more than 650 languages
in a single server and mix languages from any language group.
Unicode
Unicode is the first character set that enables all the world’s languages to be
encoded in the same data set. Prior to the introduction of Unicode, if you
wanted to store data in, for example, Chinese, you had to choose a character set
appropriate for that language—to the exclusion of most other languages. It was
either impossible or impractical to mix character sets, and thus diverse
languages, in the same data set.
Sybase supported Unicode in the form of three datatypes: unichar, univarchar,
and unitext. These datatypes store data in the UTF-16 encoding of Unicode.
UTF-16 is an encoding wherein Unicode scalar values are represented by a
single 16-bit value (or, in rare cases, as a pair of 16-bit values). The three
encodings are equivalent insofar as either encoding can be used to represent
any Unicode character. The choice of UTF-16 datatypes, rather than a UTF-16
server default character set, promotes easy, step-wise migration for existing
database applications.
Adaptive Server supports Unicode literals in SQL queries and a wide range of
sort orders for UTF-8.
Configuration parameters
The UTF-16 encoding of Unicode includes “surrogate pairs,” which are pairs
of 16-bit values that represent infrequently used characters. Additional
checking is built in to Adaptive Server to ensure the integrity of surrogate pairs.
You can switch this checking off by setting the configuration parameter
“enable surrogate processing” to 0. This yields slightly higher performance,
although the integrity of surrogate pairs is no longer guaranteed.
Functions
All functions taking char parameters have been overloaded to accept unichar as
well. Functions with more than one parameter, when called with at least one
unichar parameter, results in implicit conversion of any non-unichar parameters
to unichar.
To guarantee the integrity of surrogate pairs when enable surrogate processing
is set to 1 (the default), the string functions do not allow surrogate pairs to be
split. Positions are modified to fall at the beginning of a surrogate pair.
Several functions have been added to round out the unichar support. Included
are the functions to_unichar() and uscalar(), which are analogous to char() and
ascii(). The functions uhighsurr() and ulowsurr() allow the explicit handling of
surrogate pairs in user code.
There are restrictions when using unitext with functions. For information, see
the restriction description under the “Usage” section for each function.
Using unitext
The variable-length unitext datatype can hold up to 1,073,741,823 Unicode
characters (2,147,483,646 bytes). You can use unitext anywhere you use the text
datatype, with the same semantics. unitext columns are stored in UTF-16
encoding, regardless of the Adaptive Server default character set.
Java interoperability
The internal JDBC driver efficiently transfers unichar data between SQL and
Java contexts.
Going from SQL to Java, the class java.sql.ResultSet provides a number of
“get” methods to retrieve data from the columns of a result set. Any of these
get methods work with columns defined as unichar, unitext, or univarchar. The
method getString() is particularly efficient since no conversion needs to be
performed.
Limitations
Because the earlier releases of Adaptive Server did not include a
Unicode-based language parser, a restriction was imposed on the use of the
new Unicode datatypes. To use the new datatypes, the server required its
default character set to be configured as UTF-8. This restriction has been
removed in Adaptive Server release 12.5.1 and later. Unicode datatypes can be
used regardless of the server’s default character set.
Note Sybase strongly recommends that you decide which character set to use
as your default before you create any databases or make any changes to the
Sybase-supplied databases.
In the example below (Figure 9-2), 175 clients all access the same Adaptive
Server. The clients are on different platforms and use different character sets.
The critical factor that allows these clients to function together is that all of the
character sets in the client/server system belong to the same language group
(see Table 9-1 on page 305). The default language for the Adaptive Server is
CP 850, which is the character set used by the largest number of clients. This
allows the server to operate most efficiently, with the least amount of character
set conversion.
Figure 9-2: Clients using different character sets in the same language
group
CP 850
100 Clients
Macintosh Roman
25 Clients
To help you choose the default character set for your server, the following
tables list the most commonly used character sets by platform and language.
Each character set comes with one or more sort orders that Adaptive Server
uses to collate data. A sort order is tied to a particular language or set of
languages and to a specific character set. The same sort orders can be used for
English, French, and German because they sort the same characters identically,
for example, A, a, B, b, and so on. Or the characters are specific to one of the
languages—for example, the accented characters, é , à, and á, are used in
French but not in English or German—and therefore, there is no conflict in
how those characters are sorted. The same is not true for Spanish however,
where the double letters ch and ll are sorted differently. Therefore, although the
same character sets support all four languages, there is one set of sort orders for
English, French and German, and a different set of sort orders for Spanish.
In addition, a sort order is tied to a particular character set. Therefore, there is
one set of sort orders for English, French, and German in the ISO 8859-1
character set, another set in the CP 850 character set, and so on. The sort orders
available for a particular character set are located in sort order definition files
(*.srt files) in the character set directory. For a list of character sets and their
available sort orders, see Table 9-5 on page 316.
You can use the sortkey function to setup customized alternative sort orders for
your data—one for each language.These sort orders can be selected
dynamically to meet the needs of different users. The sortkey function is
separate from the default sort order, but can coexist in the same server. The
range and depth of sort orders provided by the sortkey function is better than
those provided by the default sort order mechanism. For more information, see
sortkey and compare in the Reference Manual: Building Blocks.
Table 9-5: Available sort orders
Language or script Character sets Sort orders
All languages UTF-8 Multiple sort orders, see Table 9-7 for list
Cyrillic: Bulgarian, CP 855, CP 866, CP 1251, ISO Dictionary order, case sensitive, accent sensitive
Byelorussian, 8859-5, Koi8, Macintosh Cyrillic
Macedonian, Russian,
Serbian, Ukrainian
Eastern European: CP 852, ISO 8859-2, CP 1250 Dictionary order, case sensitive, accent sensitive
Czech, Slovak Dictionary order, case insensitive, accent sensitive
Dictionary order, case sensitive, accent sensitive,
with preference
Dictionary order, case insensitive, accent insensitive
English, French, ASCII 8, CP 437, CP850, CP 860, Dictionary order, case sensitive, accent sensitive
German CP 863, CP 1252a, ISO 8859-1, Dictionary order, case insensitive, accent sensitive
ISO 8859-15, Macintosh Roman,
Dictionary order, case sensitive, accent sensitive,
ROMAN8, ROMAN9, ISO 15
with preference
Dictionary order, case insensitive, accent insensitive
English, French, CP 850, CP 858 Alternate dictionary order, case sensitive
German Alternate dictionary order, case sensitive, accent
insensitive
Alternate dictionary order, case sensitive, with
preference
Greek ISO 8859-7 Dictionary order, case sensitive, accent sensitive
Hungarian ISO 8859-2 Dictionary order, case sensitive, accent sensitive
Dictionary order, case insensitive, accent sensitive
Dictionary order, case insensitive, accent insensitive
Japanese EUCJIS, SJIS, DECKANJI General purpose case-insensitive dictionary
ordering
Kazakh 87 50
Russian CP 866, CP 1251, ISO 8859-5, Dictionary order, case sensitive, accent sensitive
Koi8, Macintosh Cyrillic Dictionary order, case insensitive, accent sensitive
Scandinavian CP 850 Dictionary order, case sensitive, accent sensitive
Dictionary order, case insensitive, with preference
If your language does not appear here, there is no language-specific sort order
for your language. Select a binary sort order and then investigate whether the
sortkey function meets your needs. As this table illustrates, many languages
have more than one sort order.
Selecting case-insensitive sort orders for Chinese and Japanese character sets
Use two stored procedures to select case-insensitive sort orders:
• sp_helpsort
• sp_configure
sp_helpsort
sp_helpsort lists the available case-insensitive sort orders.
sp_helpsort
-----------
Name ID
-------------------------
nocase_eucgb 52
nocase_cp936 52
nocase_gb18030 52
nocase_eucjis 52
nocase_sjis 52
nocase_deckanji 52
sp_configure
To switch to a case-insensitive sort order, enter:
sp_configure 'default sortorder id', 52
To view this sort order list in Adaptive Server, use sp_helpsort. See the
Reference Manual: Procedures.
You can add sort orders using external files in the $SYBASE/collate/Unicode
directory. The names and collation IDs are stored in syscharsets. The names of
external Unicode sort orders do not have to be in syscharsets before you can
set the default Unicode sort order.
Note External Unicode sort orders are provided by Sybase. Do not attempt to
create external Unicode sort orders.
Sort order associated with Unicode data is completely independent of the sort
order associated with traditional character data. All relational expressions
involving the Unicode datatypes are performed using the Unicode sort order.
This includes mixed-mode expressions involving Unicode and non-Unicode
data. For example, in the following query the varchar character constant ‘Mü’
is implicitly cast to unichar and the comparison is performed according to the
Unicode sort order:
select * from authors where unicode_name > 'Mü'
The same holds true for all other comparison operators, as well as the
concatenation operator “+”, the operator “in”, and the operator “between.”
Once again, the goal is to retain compatibility with existing database
applications.
Tables joins based on equality (equijoins) deserve special mention. These are
generally optimized by the server to take advantage of indexes that defined on
the participating columns. When a unichar column is joined with a char
column, the latter requires a conversion, and since the character sort order and
the Unicode sort order are distinct, the optimizer will ignore the index on the
char column.
In Adaptive Server version 12.5.1 and later, when the server’s default character
set is configured to UTF-8, you can configure the server's default sort order (for
char data) to be any of the above sort orders. Prior to this version, the binary
sort order “bin_utf8” (ID=50) was the only well-behaved sort order for UTF-8.
Although not required, the sort order for char data in UTF-8 can be selected so
that it corresponds with the sort order for unichar.
There is a potential confusion regarding choice of binary sort orders for
Unicode. The sort order named “binary” is the most efficient one for unichar
data (UTF-16), and is thus the default. This order is based on the Unicode
scalar value, meaning that all 32-bit surrogate pairs are placed after all 16-bit
Unicode values. The sort order named “utf8bin” is designed to match the order
of the default (most efficient) binary order for UTF-8 char data, namely
“bin_utf8”. The recommended matching combinations are thus “binary” for
unichar and “binary” for UTF-8 char, or “utf8bin” for unichar and “bin_utf8”
for UTF-8 char. The former favors unichar efficiency, while the latter favors
char efficiency. Avoid using “utf8bin” for UTF-8 char, since it is equivalent to
“bin_utf8” but less efficient.
Each client can choose to view messages in their own language at the same
time, from the same server; for example, one client views system messages in
French, another in Spanish, and another in German. To do this, however, all
selected languages must be part of the same language group. For example,
French, Spanish and German are all part of language group 1. Japanese, on the
other hand, is part of language group 101, which contains no other languages.
Therefore, if Japanese is your server language, you can display system
messages only in Japanese or English. Remember that all language groups can
display messages in English. There is also a server-wide default language, used
if the user has not selected a specific language. If you use Unicode, you can
view system messages in any of the supported languages.
You can select the language for your system messages in one of two ways:
• Select a language as part of your user profile
• Enter a language in the locales.dat file
Table 9-8 displays the supported system message languages and their language
groups. Each user can select only one language per session for system
messages.
Table 9-8: Supported system messages
Language group System message languages Character sets
Group 1 French, German, Spanish, Brazilian Portuguese ASCII 8, CP 437, CP 850, CP 860,
CP 863, CP 1252, ISO 8859-1, ISO
8859-15, Macintosh Roman, ROMAN8
Group 2 Polish Cp 1250, CP 852, ISO 8859-2
Group 101 Japanese CP 932, DEC Kanji, EUC-JIS, Shift-JIS
Group 102 Simplified Chinese (PRC) CP 936, EUC-GB, GB18030
Group 104 Korean EUC-KSC, CP 949
Group 105 Thai CP 874, TIS 620
Unicode French, German, Spanish, Brazilian Portuguese, UTF-8
Japanese, Simplified Chinese, Korean
All Other Language English
Groups
Install Language Modules for all languages in which clients will receive
messages. These Language Modules, located in the locales subdirectory of the
Adaptive Server installation directory, are part of a group of files called
localization files. For information about localization files and the software
message directory structure, see “Types of localization files” on page 338.
A Spanish-version server
This examples shows how to set up a new server with all clients using the same
language. To do this:
1 Select the server language, in this case, Spanish. By reviewing Table 9-1
on page 305, you see that Spanish is part of language group 1. Based on
your platform, select a character set from language group 1. Sybase
recommends that you select the character set used by the greatest number
of clients. Or, if you think your company might someday expand into other
countries and languages, you might consider installing Unicode (see
“Selecting the character set for your server” on page 303).
2 Install the Spanish Language Module in the server. This allows clients to
view system messages in Spanish.
3 Select the default sort order. By referring to Table 9-5 on page 316, you
see that Spanish has three possible sort orders, in addition to binary sort
order. Select a sort order.
4 Restart the server.
3 Select the sort order. By referring to Table 9-5 on page 316, you can see
that a binary sort order is the only sort order available for Japanese.
Therefore, both the English and Japanese clients have a default binary sort
order. Consider using the sortkey function to provide solutions for both
audiences.
4 Make sure that each Japanese user requests Japanese messages by default.
Since you are using a character set from language group 101, and you have
already installed the Japanese Language Module, your client in Japan sees
messages in Japanese, while clients in the U.S. can choose to see messages
in either English or Japanese.
Warning! Read the following carefully, and exercise caution when changing
the default character set in Adaptive Server. Sybase strongly recommends that
you perform backups before you change a default character set.
When you change the default character set in Adaptive Server, you must
convert any existing data to the new default character set. Conversion is
unnecessary only if:
• There is no user data in the server.
• It is acceptable to destroy user data in the server.
• You are absolutely certain that data in the server uses only ASCll-7. In this
case, you can change the default without first copying your data out of the
server.
In all other cases, you must convert the existing data as follows:
1 Copy the data out using bcp.
2 Change the default character set.
3 Use bcp with the appropriate flags for data conversion to copy the data
back into the server.
See the Utility Guide for more information about using bcp to copy data.
Code conversion between the character set of the existing data and the new
default character set must be supported. If it is not, conversion errors will occur
and the data is not converted correctly. See Chapter 10, “Configuring
Client/Server Character Set Conversions,” for more information about
supported character set conversions.
Even if conversions are supported between the character sets, some errors may
occur due to minor differences between the character sets, or because some
characters do not have equivalents in other character sets. Rows containing
problematic data may not get copied back into the database, or data may
contain partial or invalid characters.
# sqlsrv.default_language: french
# sqlsrv.language_install_list: spanish,german
# sqlsrv.language_remove_list: USE_DEFAULT
# sqlsrv.default_characterset: cp437
# sqlsrv.characterset_install_list: mac,cp850
# sqlsrv.characterset_remove_list: USE_DEFAULT
# sqlsrv.sort_order: dictionary
• You change the default character set, and either the old or the new sort
order is not binary. You cannot load a database dump that was made before
you changed the character set.
You cannot reload your data from a database dump once you have reconfigured
the default character set and sort order (unless both old and new character sets
use a binary sort order and no conversion is required between the old and new
character sets). See “Changing the default character set” on page 325 for more
information,
Unicode examples
In the following example, a fictitious database named xpubs is modified to use
univarchar columns.
Schema
Assume a database was created using the following script on a server that has
all the installation defaults, namely character set “iso_1” and default sort order
ID 50, “binary_iso_1”.
> create database xpubs
> go
> use xpubs
> go
> create table authors (au_id int, au_lname
varchar(255), au_fname varchar(255))
> go
> create index au_idx on authors(au_lname, au_fname)
> go
Then the data was loaded into the server using a series of inserts and updates.
Converting to UTF-8
The first step towards using Unicode is to extract the data and convert it to
UTF-8 form.
% bcp xpubs..authors out authors.utf8.bcp -c -Jutf8 -Usa -P
The next step to install UTF-8 as the default character set in the server:
% charset -Usa -P binary.srt utf8
% isql -Usa -P
> sp_configure 'default sortorder id', 50, 'utf8'
> go
> shutdown
> go
Restart the server to modify the default character set and re-create indexes on
the system tables. Restart the server a second time, then reload the data:
% isql -Usa -P
> sp_dboption xpubs, 'select into', true
> go
> use xpubs
> go
> checkpoint
> go
> delete from authors
> go
> quit
% bcp xpubs..authors in authors.utf8.bcp -c -Jutf8 -Usa -P
Preliminary steps
Before you run the installation program to reconfigure Adaptive Server:
1 Dump all user databases and the master database. If you have made
changes to model or sybsystemprocs, dump them also.
2 Load the Language Module if it is not already loaded (see the
configuration documentation for your platform for complete instructions).
3 If you are changing the Adaptive Server default character set, and your
current databases contain non ASCII-7 data, use bcp to copy the existing
data out of your databases.
Once you have loaded the Language Module, you can run the Adaptive Server
installation program, which allows you to:
• Install or remove message languages and character sets included with
Adaptive Server
• Change the default message language or character set
• Select a different sort order
See the configuration documentation for your platform for instructions on
using the installation program
Note Before you change the character set or sort order, Adaptive Server must
have as many open databases as there are databases managed by the server. If
Adaptive Server does not have a sufficient number of open databases when it
is re-started after a change in sort order, Adaptive Server prints this message to
the error log and the server will revert to the former sort order:
The configuration parameter 'number of open databases'
must be at least as large as the number of databases,
in order to change the character set or sort order." Re-
start Adaptive Server, use sp_configure to increase
'number of open databases' to at least %d, then re-
configure the character set or sort order
To reconfigure the language, character set, or sort order, use the sqlloc utility,
described in Utility Guide. If you are using Windows, use the Server Config
utility, described in Chapter 3, “Default Adaptive Server Configuration,” in the
Configuration Guide.
If you installed additional languages but did not change the Adaptive Server
character set or sort order, you have completed the reconfiguration process.
If you changed the Adaptive Server default character set, and your current
databases contain non ASCII-7 data, copy your data back into your databases,
using bcp with the necessary flags to enable conversion.
If you changed the Adaptive Server default sort order or character set, see
“Reconfiguring the character set, sort order, or message language” on page
327.
Next, the new sort order information replaces the old information in the area of
the disk that holds configuration information. Adaptive Server then shuts down
so that it starts for the next session with a complete and accurate set of system
information.
If the indexes for a table are already correct, or if there are no indexes for the
table, dbcc reindex does not rebuild any indexes. It displays a message instead.
If a table is suspected of containing corrupt data, the command is aborted. If
that happens, an error message instructs the user to run dbcc checktable.
When dbcc reindex finishes successfully, all “suspect” marks on the table’s
indexes are removed. The “read-only” mark on the table is also removed, and
the table can be updated. These marks are removed whether or not any indexes
have to be rebuilt.
dbcc reindex does not reindex system tables. System indexes are checked and
rebuilt, if necessary, as an automatic part of recovery after Adaptive Server is
restarted following a sort order change.
If you run out of log space, clear out your log (see Chapter 12, “Backing Upa
and Restoring User Databases,” in System Administration Guide: Volume 2).
Then restart dbcc fix_text, using the same table that was being upgraded when
the original dbcc fix_text halted. Each multibyte text value contains information
that indicates whether it has been upgraded, so dbcc fix_text upgrades only the
text values that were not processed in earlier passes.
If your database stores its log on a separate segment, you can use thresholds to
manage clearing the log. See Chapter 16, “Managing Free Space with
Thresholds,” in System Administration Guide: Volume 2.
If dbcc fix_text cannot acquire a needed lock on a text page, it reports the
problem and continues with the work, like this:
Unable to acquire an exclusive lock on text page 408.
This text value has not been recalculated. In order to
recalculate those TEXT pages you must release the lock
and reissue the dbcc fix_text command.
charsets
Warning! Do not alter any of the localization files. If you need to alter any
information in those files, contact your local Sybase office or distributor.
locales
locales.dat
us_english language2
Topic Page
Character set conversion 341
Supported character set conversions 342
Choosing a conversion type 344
Enabling and disabling character set conversion 347
Error handling in character set conversion 348
Conversions and changes to data lengths 349
Specifying the character set for utility programs 350
Display and file character set command line options 350
For a list of the language groups and supported character sets, see Table 9-1 on
page 305.
Each client can view data only in the language supported by its character set.
Therefore, the Japanese client can view any Japanese data on the server, but it
cannot view Arabic or French data. Likewise, the French client can view
French or any other Western European language supported by its character set,
but not Japanese or Arabic.
Figure 10-3: Viewing Unicode data
ASE
Japanese data Japanese: CP 932
UTF-8
Arabic data
Arabic: CP 1256
Sybase recommends that you do not configure a server for ASCII-7. You can
achieve the same benefits of compatibility by restricting each client to use only
the first 128 characters of each native character set.
Unicode conversions
Unicode conversions exists for all native character sets. When converting
between two native character sets, Unicode conversion uses Unicode as an
intermediate character set. For example, to convert between the server default
character set (CP 437), and the client character set (CP 860), CP 437 is first
converted to Unicode; Unicode is then converted to CP 860.
Unicode conversions may be used either when the default character set of the
server is UTF-8, or a native character set. You must specifically configure your
server to use Unicode conversions (unless the server’s default character set is
UTF-8).
Earlier versions of Adaptive Server used direct conversions, and it is the
default method for character set conversions. However, Unicode conversions
allow easier and less complex character set conversion. While Adaptive Server
direct conversions are still supported, Sybase now also uses Unicode
conversions to provide complete conversion support for all character sets and
has no plans to add new direct conversions.
For Adaptive Server version 15.0 and later, the default value for enable unicode
conversions is 1.
You can control character set conversion at the connection level using the set
char_convert command from within a client session. set char_convert off turns
conversion off between a particular client and the server. You may want to set
char_convert off if the client and the server use the same character set, which
makes conversion unnecessary. set char_convert on turns conversion back on.
• The character exists (is encoded) in the source character set, but does not
exist in the target character set. For example, the OE ligature is part of the
Macintosh character set (code point 0xCE). This character does not exist
in the ISO 8859-1 character set. If the OE ligature exists in data that is
being converted from the Macintosh to the ISO 8859-1 character set, it
causes a conversion error.
• The character exists in both the source and the target character set, but in
the target character set, the character is represented by a different number
of bytes than in the source character set.
For example, 1-byte accented characters (such as á, è) are 2-byte
characters in UTF-8; 2-byte Thai characters are 3-byte characters in UTF-
8. Avoid this limitation by configuring the enable unicode conversion
option to 1 or 2.
CS_DATA_LCHAR,&capval)
3 When conversions result in an increase in data length, char and varchar
data are converted to the client’s character set and are sent to the client as
CS_LONGCHAR data. The client application must be coded to extract the
data received as CS_LONGCHAR.
-a display_charset
-J client_charset
Terminal
display
Client Adaptive
-q datafile_charset Server
File (bcp only)
system
The -J or /clientcharset command line option specifies the character set used by
the client when it sends and receives character data to and from Adaptive
Server.
There may be more than one error message for a single query. If there is more
than one error in a batch or query, Adaptive Server usually reports only the first
one. Subsequent errors are reported the next time you execute the batch or
query.
Error messages are stored in master..sysmessages, which is updated with each
new version of Adaptive Server. Here are the first few rows (from an Adaptive
Server that uses us_english as the default language):
select error, severity, description
from sysmessages
where error >=101 and error <=106
and langid is null
error severity description
----- -------- --------------------------------------------------
101 15 Line %d: SQL syntax error.
102 15 Incorrect syntax near '%.*s'.
103 15 The %S_MSG that starts with ’%.*s’ is too long.
Maximum length is %d.
104 15 Order-by items must appear in the select-list if
the statement contains set operators.
105 15 Unclosed quote before the character string '%.*s'.
106 16 Too many table names in the query. The maximum
allowable is %d.
(6 rows affected)
You can query sysmessages. to generate a custom list of error messages:
• If your server supports more than one language, sysmessages stores each
message in each language. The column langid is NULL for us_english and
matches the syslanguages.langid for other languages installed on the
server.
• The dlevel column in sysmessages is currently unused.
• The sqlstate column stores the SQLSTATE value for error conditions and
exceptions defined in ANSI SQL92.
• Message numbers 17000 and higher are system procedure error messages
and message strings.
(3 rows affected)
The error message text describes the problem. The descriptions often include a
line number, a reference to a type of database object (a table, column, stored
procedure, and so forth), or the name of a particular database object.
In the description field of sysmessages, a percent sign (%) followed by a
character or character string serves as a placeholder for these pieces of data,
which Adaptive Server supplies when it encounters the problem and generates
the error message. “%d” is a placeholder for a number; “%S_MSG” is a
placeholder for a type of database object; “%.*s”—all within quotes—is a
placeholder for the name of a particular database object. Table 11-1 on
page 356 lists placeholders and what they represent.
For example, the description field for message number 103 is:
The %S_MSG that starts with '%.*s' is too long. Maximum
length is %d.
The actual error message that appears to a user might be:
The column that starts with 'title' is too long. Maximum
length is 80.
For errors that you report to Technical Support, include the numbers, object
types, and object names. (See “Reporting errors” on page 364.)
Note The error log file is owned by the user who installed Adaptive Server (or
the person who started Adaptive Server after an error log was removed).
Permissions or ownership problems with the error log at the operating system
level can block successful start-up of Adaptive Server.
Adaptive Server creates an error log for you if one does not already exist.
Specify the location of the error log at start-up with the errorlogfile parameter
in the runserver file or at the command line. The Sybase installer utility
configures the runserver file with $SYBASE/install as the location of the error
log if you do not choose an alternate location. If you do not specify the location
in the runserver file or at the command line, the location of the error log is the
directory from which you start Adaptive Server. For more information about
specifying the location of the error log, see dataserver in the Utility Guide.
Note Always start Adaptive Server from the same directory, or with the
runserver file or the error log flag, so that you can locate your error log.
Each time you start a server, messages in the error log provide information on
the success (or failure) of the start and the recovery of each database on the
server. Subsequent fatal error messages and all kernel error messages are
appended to the error log file. To reduce the size of the error log by deleting old
or unneeded messages, “prune” the log while Adaptive Server is shut down.
Family ID
Severity levels
The severity level of a message indicates the type and severity of the problem
that Adaptive Server has encountered. For maximum integrity, when Adaptive
Server responds to error conditions, it displays messages from sysmessages,
but takes action according to an internal table. A few corresponding messages
differ in severity levels, so you may occasionally notice a difference in
expected behavior if you are developing applications or procedures that refer
to Adaptive Server messages and severity levels.
Warning! You can create your own error numbers and messages based on
Adaptive Server error numbers (for example, by adding 20,000 to the Adaptive
Server value). However, you cannot alter the Adaptive Server-supplied system
messages in the sysmessages system table.
Severity levels 10 – 18
Error messages with severity levels 10–16 are generated by problems that are
caused by user errors. These problems can be corrected by the user. Severity
levels 17 and 18 do not terminate the user’s session.
Error messages with severity levels 17 and higher should be reported to the
system administrator or database owner.
For example, the user may have tried to update a view in a way that violates the
restrictions. Another error that falls into this category is unqualified column
names in a command that includes more than one table with that column name.
Adaptive Server has no way to determine which one the user intends. Check
the command syntax and working database context.
Messages that ordinarily have severities greater than 16 show severity 16 when
they are raised by dbcc checktable or dbcc checkalloc so that checks can
continue to the next object. When you are running the dbcc utility, check the
Error Messages and Troubleshooting Guide for information about error
messages between 2500 and 2599 with a severity level of 16.
Note Levels 17 and 18 are usually not reported in the error log. Users should
be instructed to notify the system administrator when level 17 and 18 errors
occur.
Since problems that generate such messages do not keep users from their work,
users tend not to report them. However, users should be instructed to inform
the system administrator every time an error message with this severity level
(or higher) occurs so that the system administrator can report them.
Severity levels 19 – 26
Fatal problems generate error messages with severity levels 19 and higher.
They break the user’s connection to Adaptive Server (some of the higher
severity levels shut down Adaptive Server). To continue working, the user
must restart the client program.
When a fatal error occurs, the process freezes its state before it stops, recording
information about what has happened. The process is then killed and
disappears.
When the user’s connection is broken, he or she may or may not be able to
reconnect and resume working. Some problems with severity levels in this
range affect only one user and one process. Others affect all the processes in
the database. In some cases, the system administrator must restart Adaptive
Server. These problems do not necessarily damage a database or its objects, but
they can. They may also result from earlier damage to a database or its objects.
Other problems are caused by hardware malfunctions.
Error messages from the kernel are directed to the error log file.
Reporting errors
When you report an error to Sybase Technical Support, include:
• The message number, level number, and state number.
• Any numbers, database object types, or database object names that are
included in the error message.
• The context in which the message was generated, that is, the command that
was running at the time. You can help by providing a hard copy of the error
log.
Killing processes
A process is a unit of execution carried out by Adaptive Server. Each process
is assigned a unique process identification number when it starts. This number
is called a spid. These numbers are stored, along with other information about
each process, in master..sysprocesses. Processes running in a parallel-
processes environment create child processes, each of which has its own spids.
Several processes create and assign spids: starting Adaptive Server, login tasks,
checkpoints, the housekeeper tasks, and so on. You can see most of the
information by running sp_who.
Running sp_who on a single-engine server shows the sp_who process running
and all other processes that are “runnable” or in one of the sleep states. In multi-
engine servers, there can be a process running for each engine.
The kill command gets rid of an ongoing process. The most frequent reason for
killing a process is that it interferes with other users, and the person responsible
for running it is not available. The process may hold locks that block access to
database objects, or there may be many sleeping processes occupying the
available user connections. A system administrator can kill most running or
"runnable" processes, including those that are waiting for:
• An alarm, such as a waitfor command
• Network sends or receives
• A lock
• Synchronization messages from another process in a family
Adaptive Server allows you to kill processes only if it can cleanly roll back any
uncompleted transactions and release all system resources that are used by the
process. For processes that are part of a family, killing any of the child
processes also kills all other processes in the family. However, it is easiest to
kill the parent process. For a family of processes, the kill command is detected
more quickly if the status of the child processes is sync sleep.
Table 11-2 shows the status values that sp_who reports and when the kill
command takes effect.
Table 11-2: Status values reported by sp_who
Status Indicates Effects of kill command
recv sleep Waiting on a network read. Immediate.
send sleep Waiting on a network send. Immediate.
alarm sleep Waiting on an alarm such as: Immediate.
waitfor delay "10:00"
lock sleep Waiting on a lock acquisition. Immediate.
sync sleep Waiting on a synchronization message from Immediate. Other processes in the family
another process in the family. must also be brought to state in which they
can be killed.
sleeping Waiting on a disk I/O, or some other resource. Killed when it “wakes up,” usually
Probably indicates a process that is running, but immediate; a few sleeping processes do not
doing extensive disk I/O wake up and require a server restart to clear.
runnable In the queue of runnable processes. Immediate.
running Actively running on one of the server engines. Immediate.
infected Server has detected serious error condition; kill command not recommended. Server
extremely rare. restart probably required to clear process.
background A process, such as a threshold procedure, run by Immediate; use kill with extreme care.
Adaptive Server rather than by a user process. Recommend a careful check of
sysprocesses before killing a background
process.
log suspend Processes suspended by reaching the last-chance Immediate.
threshold on the log.
Only system administrators can issue the kill command; permission to use it
cannot be transferred.
The syntax is:
kill spid
You can kill only one process at a time, but you can perform a series of kill
commands in a batch. For example:
1> kill 7
2> kill 8
3> kill 9
4> go
A kill command is irreversible and cannot be included in a user-defined
transaction. spid must be a numeric constant; you cannot use a variable. Here
is some sample output from sp_who:
fid spid status loginame origname hostname blk dbname cmd
--- ---- --------- -------- -------- -------- --- ------ ----------------
0 1 recv sleep howard howard svr30eng 0 master AWAITING COMMAND
0 2 sleeping NULL NULL 0 master NETWORK HANDLER
0 3 sleeping NULL NULL 0 master DEADLOCK TUNE
0 4 sleeping NULL NULL 0 master MIRROR HANDLER
0 5 sleeping NULL NULL 0 master CHECKPOINT SLEEP
0 6 sleeping NULL NULL 0 master HOUSEKEEPER
0 7 recv sleep bill bill bigblue 0 master AWAITING COMMAND
0 8 recv sleep wilbur wilbur hazel 0 master AWAITING COMMAND
0 9 recv sleep joan joan luv2work 0 master AWAITING COMMAND
0 10 running foote foote svr47hum 0 master SELECT
(10 rows affected, return status = 0)
In the example above, processes 2–6 cannot be killed: they are system
processes. The login name NULL and the lack of a host name identify
processes them as system processes. NETWORK HANDLER, MIRROR
HANDLER, HOUSEKEEPER, and CHECKPOINT SLEEP (or, rarely,
CHECKPOINT) always appear in sp_who output. AUDIT PROCESS appears
if auditing is available.
Processes 1, 8, 9, and 10 can be killed, since they have the status values “recv
sleep,” “send sleep,” “alarm sleep,” and “lock sleep.”
In sp_who output, you cannot tell whether a is “recv sleep” belongs to a user
who is using Adaptive Server and may be pausing to examine the results of a
command, or whether a user has restarted a PC or other terminal, and left a
stranded process. Query the sysprocesses table to learn more about
questionable processes. For example, this query shows the host process ID and
client software used by process 8:
select hostprocess, program_name
from sysprocesses
where spid = 8
hostprocess program_name
----------- ----------------
3993 isql
This query, plus the information about the user and host from the sp_who
results, provides additional information for tracking down the process from the
operating system level.
Housekeeper functionality
The housekeeper task provides important functionalities:
• The housekeeper consists of three tasks: housekeeper wash, housekeeper
garbage collection, and housekeeper chores. sp_who recognizes all three
tasks, as the following output shows:
fid spid status loginame origname hostname blk_sp
id dbname cmd block_xloid
---- ----- ---------- ---------- --------- ---------- ------
------- --------- ------------- -------------
0 5 sleeping henry NULL luv2work 0
master tempdb select 0
0 6 sleeping joe NULL NULL 0
master tempdb HK GC 0
0 7 sleeping NULL NULL NULL 0
master tempdb HK CHORES 0
Housekeeper wash
Washing buffers is an optional task that, if enabled, runs only during idle times.
You can turn off this task using the configuration parameter housekeeper free
write percent. The housekeeper wash task is the only housekeeper task for
which you use this configuration parameter.
Housekeeper chores
The housekeeper chores task th runs only at idle times, and does not use a
common configuration parameter. It manages miscellaneous chores, such as:
When the server is shut down or crashes, requests to deallocate pages that the
housekeeper garbage collection task has not yet serviced are lost. These pages,
empty but not deallocated by the housekeeper garbage collection task, remain
allocated until you remove them by running reorg.
See Chapter 9, Using the reorg Command,” in the System Administration
Guide: Volume 2.
You must restart Adaptive Server for this parameter to take effect.
The total memory allocated for the SQL text from shared memory is the
product of bytes_per_connection multiplied by the number of user
connections.
Presentation
Client-Library routine DB-Library routine Presentation name data
ct_cursor N/A OPEN_CURSOR Cursor name,
statement
ct_cursor N/A UPDATE_AT_CURSOR Cursor name,
statement
ct_command (CS_RPC_CMD) (default dbrpcinit (only in DBLIB_RPC RPC name
behavior) version 10.0.1 or later)
ct_dynamic N/A DYNAMIC_SQL Dynamic
statement name,
statement
ct_command (CS_MSG_CMD N/A MESSAGE None
ct_param dbrpcparam PARAM_FORMAT None
ct_param dbrpcparam PARAMS None
ct_command (CS_RPC_CMD) (only dbrpcparam (in RPC RPC name
when a TDS version earlier than 5.0 is DB-Library versions
used) earlier than 10.0.1)
For more information about SQL commands not represented by text, see your
Open Client documentation.
Adaptive Server uses the unique batch ID to synchronize the query plan with
the batch text and other data retrieved by Adaptive Server Monitor.
For example, to see the query plan for the current statement for spid 99, enter:
declare @batch int
declare @context int
declare @statement int
exec sp_showplan 99, @batch output, @context output, @statement output
You can run the query plan procedure independently of Adaptive Server
Monitor, regardless of whether or not Adaptive Server has allocated shared
memory for SQL text.
Note You do not need the sa_role to run this select statement.
If you use shutdown with nowait during a load of any kind, and you did not
receive the message indicating that the load completed, you may not be able to
issue further load transaction commands on the database. Run a full database
consistency check (dbcc) on the database before you use it. You may have to
reissue the full set of load commands, starting with load database.
.
Topic Page
Introduction to security 383
What is “information security?” 383
Information security standards 384
Introduction to security
Information is possibly your company's greatest asset. Information needs
protection just like any other asset. As a system administrator, determine
how best to protect the information contained in company databases, and
who may access the information. Individual database servers need strong,
yet flexible, security support.
Users and the data they access may be located anywhere in the world,
connected by untrusted networks. Ensuring the confidentiality and
integrity of sensitive data and transactions in this environment is critical.
Information is useful only if it gets to the people who need it, when they
need it. With complex and dynamically changing business relationships,
it is critical that information gets only to authorized users.
• The system should enforce integrity – the server should enforce rules and
constraints to ensure that information remains accurate and complete.
• The information should be available – even with all the safeguards in
place, anybody who needs access to the information should have it
available when the information is needed.
Identify what is it that your organization wants to protect, and what the outside
world requires from your organization:
• Identify the information assets and the security risks associated with them
if they become vulnerable or compromised.
• Identify and understand any laws, statutes, regulations, and contractual
agreements that apply to your organization and the information assets.
• Identify your organization’s business processes and the requirements they
impose on information assets, to balance practical considerations with the
security risks.
Security requirements change over time. Periodically reassess security
requirements to make sure they still reflect your organization’s needs.
Next, set up a series of controls and policies that meet the company's security
objectives, the result of which is an information security policy document that
clarifies decisions made for information security.
Adaptive Server contains a set of security features that help you enforce your
company’s security policies. For more information about security features in
Adaptive Server, see Chapter 13, “Getting Started With Security
Administration in Adaptive Server.”
Note A Security and Directory Services license is required to use SSL and to
enable the FIPS login password encryption parameter. If the parameter is not
enabled, OpenSSL security provider is used to perform login password
encryption.
Note You must have an encrypted columns license to use the Adaptive Server
encrypted columns feature.
Topic Page
General process of security administration 387
Recommendations for setting up security 388
An example of setting up security 389
Discretionary access control 392
Security features in Adaptive Server 391
Identification and authentication 391
External authentication 392
Managing remote servers 392
Discretionary access control 392
Division of roles 393
Auditing for accountability 394
Confidentiality of data 395
Use the “sa” login only during initial setup. Instead of allowing several
users to use the “sa” account, establish individual accountability by
assigning specific roles to individual administrators.
• Changing the “sa” login password – the “sa” login is configured initially
with a “NULL” password. Use sp_password to change the password
immediately after installation.
Table 13-3 shows the sequence of commands you might use to set up a secure
operating environment for Adaptive Server, based on the role assignments
shown in Table 13-2. After logging in to the operating system, issue these
commands using the initial “sa” account.
Note Before you enable auditing, set up a threshold procedure for the audit trail and determine how to handle the
transaction log in sybsecurity. See Chapter 18, “Auditing.”
• sp_addlogin rsmith, js&2P3d, Adds logins and passwords for Rajnish, Catherine, Soshi, and Julio.
@fullname = "Rajnish Smith"
• sp_addlogin cmacar, Fr3ds#1, A default database is not specified for any of these users, so their default
@fullname = "Catherine Macar-Swan" database is master.
• sp_addlogin sikedo, mi5pd1s,
@fullname = "Soshi Ikedo"
• sp_addlogin jrozan, w1seCrkr,
@fullname = "Julio Rozanski"
• grant role sso_role to rsmith Grants the sso_role to Rajnish, the sa_role to Soshi and Catherine, and
• grant role sa_role to sikedo the oper_role to Julio.
• grant role sa_role to cmacar
• grant role oper_role to jrozan
• use sybsecurity Grants access to the auditing database, sybsecurity, by making Rajnish,
• sp_changedbowner rsmith who is the system security officer, the database owner. Alan is not
granted any system-defined roles.
use master Creates a new database sales_summary and makes Alan the owner of
sp_addlogin ajohnson, j06n50n, this database. Because he is the database owner, Alan can now create
@fullname = "Alan Johnson" users, create new database objects, and grant permissions to other users
in this database.
create database sales_summary
use sales_summary
sp_changedbowner ajohnson
sp_modifylogin ajohnson, 'defdb',
sales_summary
sp_locklogin sa,"lock" Locks the “sa” login so that no one can log in as “sa.” Individuals can
assume only the roles that are configured for them.
Note Do not lock the “sa” login until you have granted individual users the sa_role and sso_role roles and have
verified that the roles operate successfully.
External authentication
Security is often enhanced in large, heterogeneous applications by
authenticating logins with a central repository. Adaptive Server supports a
variety of external authentication methods:
• Kerberos – provides a centralized and secure authentication mechanism in
enterprise environments that includes the Kerberos infrastructure.
Authentication occurs with a trusted, third-party server called a key
distribution center to verify both the client and the server.
• LDAP user authentication – Lightweight Directory Access Protocol
(LDAP) provides a centralized authentication mechanism based on a
user’s login name and password.
• PAM user authentication – Pluggable Authentication Module (PAM)
provides a centralized authentication mechanism that uses operating
system interfaces for both administration and runtime application
operations.
For more information about each of these methods of external authentication,
see Chapter 16, “External Authentication.”
The ability to assign permissions for the commands that can be granted and
revoked is determined by each user’s status (as system administrator, system
security officer, database owner, or database object owner), and whether a
particular user is granted a permission with the option to grant that permission
to other users.
Discretionary access control are discussed in Chapter 17, “Managing User
Permissions.”
Division of roles
The roles supported by Adaptive Server enable you to enforce and maintain
individual accountability. Adaptive Server provides system roles, such as
system administrator and system security officer, and user-defined roles, which
are created by a system security officer.
Roles provide individual accountability for users performing operational and
administrative tasks, and allow you to audit and attribute actions to these users.
Role hierarchy
A system security officer can define role hierarchies such that if a user has one
role, the user automatically has roles lower in the hierarchy. For example, the
“chief_financial_officer” role might contain both the “financial_analyst” and
the “salary_administrator” roles. The chief financial officer can perform all
tasks and see all data that can be viewed by salary administrators and financial
analysts.
Mutual exclusivity
You can define roles to be mutually exclusive either at the membership level,
or at the activation level. For example:
• You may not want to grant both the “payment_requestor” and
“payment_approver” roles to the same user.
• A user might be granted both the “senior_auditor” and the
“equipment_buyer” roles, but you may not want to permit the user to have
both roles enabled at the same time.
You can define system roles, as well as user-defined roles, to be in a role
hierarchy or to be mutually exclusive. For example, you might want a
“super_user” role to contain the system administrator, operator, and technical
support roles. Additionally, you may want to define the system administrator
and system security officer roles to be mutually exclusive for membership; that
is, a single user cannot be granted both roles.
See “Creating and assigning roles to users” on page 408.
When you install auditing, you can specify the number of audit tables that
Adaptive Server uses for the audit trail. If you use two or more tables to store
the audit trail, you can set up a smoothly running audit system with no manual
intervention and no loss of records.
A system security officer manages the audit system and is the only user who
can start and stop auditing, set up auditing options, and process the audit data.
As a system security officer, you can establish auditing for events such as:
• Server-wide, security-relevant events
• Creating, dropping, and modifying database objects
• All actions by a particular user or all actions by users with a particular role
active
• Granting or revoking database access
• Importing or exporting data
• Logins and logouts
• All actions related to encryption keys
Auditing functionality is discussed in Chapter 18, “Auditing.”
Confidentiality of data
Adaptive server allows you to maintain the confidentiality of data by
encrypting client-server communications using the Secure Sockets Layer
(SSL) standard or using Kerberos. You can protect the confidentiality of data
by using column-level encryption in the database and encrypting backups for
offline data.
For more information see:
• SSL – Chapter 19, “Confidentiality of Data”
• Kerberos – Chapter 16, “External Authentication”
• Encrypted columns – Encrypted Columns Users Guide
.
Topic Page
Choosing and creating a password 398
Adding logins to Adaptive Server 399
Login failure 400
Creating groups 401
Adding users to databases 402
Number of user and login IDs 405
Creating and assigning roles to users 408
Dropping users, groups, and user-defined roles 420
Locking or dropping Adaptive Server login accounts 422
Changing user information 423
Using aliases in databases 429
Getting information about users 431
Establishing a password and login policy 438
Monitoring license use 473
Getting information about usage: chargeback accounting 476
• Do not use information such as your birthday, street address, or any other
word or number that has anything to do with your personal life.
• Do not use names of pets or loved ones.
• Do not use words that appear in the dictionary or words spelled
backwards.
The most difficult passwords to guess are those that combine uppercase and
lowercase letters and numbers. Never give anyone your password, and never
write it down where anyone can see it.
Passwords must:
• Be at least 6 characters long.
• Consist of any printable letters, numbers, or symbols.
• Be enclosed in quotation marks in sp_addlogin if they:
• Includes any character other than A – Z, a – z, 0 – 9,_, #, valid
single-byte or multibyte alphabetic characters, or accented alphabetic
characters
• Begin with a number 0 – 9
See “Password complexity checks” on page 446.
Login failure
Adaptive Server must successfully authenticate a user before he or she can
access data in Adaptive Server. If the authentication attempt fails, Adaptive
Server returns the following message and the network connection is
terminated:
isql -U bob -P badpass
Msg 4002, Level 14, State 1:
Server 'ACCOUNTING'
Login failed.
CT-LIBRARY error:
ct_connect(): protocol specific layer: external error:
The attempt to connect to the server failed
This message is a generic login failure message that does not tell the
connecting user whether the failure resulted from a bad user name or a bad
password.
Although the client sees a generic message for a login failure to avoid giving
information to a malicious user, the system administrator may find the reason
for the failure to be important to help detect intrusion attempts and diagnose
user authentication problems.
Adaptive Server provides the reason for the login failure in the
Errornumber.Severity.State of the Other Information section of
sysaudits.extrainfo column. Login failure audits have event number 45 and
eventmod 2.
Set the sp_audit login parameter to on or fail to enable auditing for login failure:
sp_audit "login", "all", "all", "fail"
sp_audit "login", "all", "all", "on"
See “Auditing login failures.”
Creating groups
Groups let you grant and revoke permissions to more than one user in a single
statement, as well as allow you to provide a collective name to a group of users.
They are especially useful if you administer an Adaptive Server installation
that has a large numbers of users.
Create groups before adding users to a database, since sp_adduser can assign
users to groups as well as add them to the database.
You must have the system administrator or system security officer role, or be
the database owner to create a group with sp_addgroup. The syntax is:
sp_addgroup grpname
The group name, a required parameter, must adhere to the rules for identifiers.
The system administrator, system security officer, or the database owner can
use sp_changegroup to assign or reassign users to groups.
For examle, to set up the Senior Engineering group, use this command while
using the database to which you want to add the group:
sp_addgroup senioreng
Note Although more than one individual can be a guest user in a database,
Adaptive Server can still use the user’s server user ID, which is unique within
the server, to audit each user’s activity. See Chapter 18, “Auditing.”
• create table, create view, create rule, create default, and create procedure
permissions
Warning! A visitor user account is not the same as the “guest” user account.
All users of the visitor account have the same server user ID; therefore, you
cannot audit individual activity. Each “guest” user has a unique server ID, so
you can audit individual activity and maintain individual accountability.
Sybase recommends that you do not set up a visitor account to be used by more
than one user because you cannot maintain individual accountability.
You can use sp_login to add a visitor user account named “guest” to
master..syslogins. This “guest” user account takes precedence over the system
“guest” user account. If you add a visitor user named “guest” with sp_adduser,
this impacts system databases such as sybsystemprocs and sybsystemdb, which
are designed to work with system “guest” user in them.
Figure 14-1 illustrates the limits and ranges for logins, users, and groups.
Figure 14-1: Users, groups, and logins available in Adaptive Server
-32768 2 billion
(@@minsuid) 0 1 2 16383 1048576 (@@maxsuid)
sa
suid
probe
User IDs suid Group or role IDs
16384 1048576
(@@mingroupid) (@@maxgroupid)
• Number of file descriptors available for Adaptive Server. Each login uses
one file descriptor for the connection.
Note Before Adaptive Server can have more than 64K logins and
simultaneous connections, you must first configure the operating system
for more than 64K file descriptors. See your operating system
documentation for information about increasing the number of file
descriptors.
Table 14-3 lists the global variables for the server limits of logins, users, and
groups:
Table 14-3: Global variables for logins, users, and groups
Name of variable What it displays Value
@@invaliduserid Invalid user ID -1
@@minuserid Lowest user ID -32768
@@guestuserid Guest user ID 2
@@mingroupid Lowest group or role user ID 16384
@@maxgroupid Highest group or role user ID 1048576
@@maxuserid Highest user ID 2147483647
@@minsuid Lowest server user ID -32768
@@probesuid Probe server user ID 2
@@maxsuid Highest server user ID 2147483647
System-defined roles
Table 14-4 lists the system roles, the value to use for the role_granted option
of the grant role or revoke role command, and the tasks usually performed by a
person with that role.
Table 14-4: System roles and related tasks
Value for
Role role_granted Description
System administrator sa_role Manages and maintains Adaptive Server
databases and disk storage
System security officer sso_role Performs security-related tasks
Operator oper_role Backs up and loads databases server-wide
Sybase Technical sybase_ts_role Analysis and repair of database structures
Support
Replication replication_role Replicate user data
Distributed transaction dtm_tm_role Coordinate transactions across servers
manager
High availability ha_role Administer and execute failover
Monitor and diagnosis mon_role Administer and execute performance and
diagnostic monitoring
Job Scheduler js_admin_role Administer Job Scheduler
administration
Job Scheduler user js_user_role, Create and run jobs through Job
js_client_role Scheduler
Real-time messaging messaging_role Administer and executer real-time
messaging
Web Services webservices_role Administer Web services
Key custodian keycustodian_role Create and manage encryption keys
• Dropping logins
• Locking and unlocking login accounts
• Creating and granting user-defined roles
• Administering network-based security
• Granting permission to use the set proxy or set session authorization
commands
The system security officer can access any database—to enable auditing —but,
in general, has no special permissions on database objects (except for
encryption keys and decrypt permission on encrypted columns. See the Users
Guide for Encrypted Columns). An exception is the sybsecurity database,
where only a system security officer can access the sysaudits table. There are
also several system procedures that can be executed only by a system security
officer.
System security officers can repair any changes inadvertently done to the
protection system by a user. For example, if the database owner forgets his or
her password, a system security officer can change the password to allow the
database owner to log in.
The system security officers share login management responsibilities with
system administrators. System security officers are responsible for adding,
locking, and unlocking logins.
System security officers can also create and grant user-defined roles to users,
other roles, or groups. See “Creating and assigning roles to users” on page 408.
Operator privileges
Users who have been granted the operator role can back up and restore
databases on a server-wide basis without having to be the owner of each
database. The operator role allows a user to use these commands on any
database:
• dump database
• dump transaction
• load database
• load transaction
• checkpoint
• online database
The system security officer grants the operator role.
Replication role
The user maintaining Replication Server and ASE Replicator requires the
replication role. See the Replication Server Administration Guide and the ASE
Replicator Users Guide for information about this role.
User-defined roles
The example above restricts users who have membership in intern_role from
also being members of specialist_role.
To define the sso_role and sa_role as mutually exclusive at the activation level,
enter the following command, which prohibits a user who is a member of
sso_role and sa_role from assuming both roles simultaneously:
alter role sso_role add exclusive activation sa_role
Note If a role requires a password to be contained within another role, the user
with the role that contains the other does not need to use the password for the
contained role. In the example above, assume that the “doctor” role usually
requires a password. The user who has the “specialist” role does not need to
enter the “doctor” password because “doctor” is contained within “specialist.”
Role passwords are only required for the highest level role.
For example, in Figure 14-2, you can grant the “intern” role to the
“specialist” role, even though “specialist” already contains the “doctor”
role, which contains “intern.” If you subsequently dropped “doctor” from
“specialist,” then “specialist” still contains “intern.”
In Figure 14-2, “doctor” has “consultant” role permissions because
“consultant” has been granted to “doctor.” The “specialist” role also has
“consultant” role permissions because “specialist” contains the “doctor”
role, which in turn contains the “consultant.”
However, “intern” does not have “consultant” role privileges, because
“intern” does not contain the “consultant” role, either directly or indirectly.
Figure 14-2: Explicitly and implicitly granted privileges
specialist
doctor
consultant intern
• You cannot grant a role to another role that is contained by the first role.
This prevents “loops” within the hierarchy.
For example, in Figure 14-3, you cannot grant the “specialist” role to the
“consultant” role; “consultant” is already contained in “specialist.”
Figure 14-3: Granting a role to a role contained by grantor
NOT ALLOWED
specialist
doctor
consultant intern
• When the system security officer grants to a user a role that contains other
roles, the user implicitly gets membership in all roles contained by the
granted role. However, a role can be activated or deactivated directly only
if the user has explicit membership in that role.
• The system security officer cannot grant one role to another role that is
explicitly or implicitly mutually exclusive at the membership level with
the first role.
specialist
doctor
consultant
intern
When a user logs in to Adaptive Server, the user’s roles are not necessarily
active, depending upon how the role is set up as a default role. If a role has a
password associated with it, the user must use the set role command to activate
the role.
The system security officer or user determines whether to activate any roles
granted by default at login. sp_modifylogin sets the default status of user roles
individually for each user. sp_modifylogin only affects user roles, not system
roles.
By default, user-defined roles that are granted are not activated at login, but
system roles that are granted are automatically activated, if they do not have
passwords associated with them.
To set up a role to activate at login:
sp_modifylogin loginname, "add default role", role_name
To assign more than one default role to a user, use multiple sp_modifylogin
commands.
To ensure that a role is inactive at login:
sp_modifylogin loginname, "drop default role", role_name
For example, to change the default setting for Ralph’s intern_role to be active
automatically at login, execute:
sp_modifylogin ralph, "add default role", intern_role
Activate roles only when you need them, and turn them off when you no longer
need them. For example, when the sa_role is active, you assume the identity of
database owner within any database that you use. To turn off the system
administrator role and assume your “real” user identity, use:
set role sa_role off
If you are granted a role during a session, and you want to activate it
immediately, use set role to turn it on.
Dropping users
A database owner, system security officer, or a system administrator can use
sp_dropuser to deny an Adaptive Server user access to the database in which
sp_dropuser is executed. (If a “guest” user is defined in that database, the user
can still access that database as “guest.”)
The following is the syntax, where name_in_db is usually the login name,
unless another name has been assigned with sp_adduser:
sp_dropuser name_in_db
You cannot drop a user who owns objects. Since there is no command to
transfer ownership of objects, you must drop objects owned by a user before
you drop the user. To deny access to a user who owns objects, use sp_locklogin
to lock his or her account.
You also cannot drop a user who has granted permissions to other users. Use
revoke with cascade to revoke permissions from all users who were granted
permissions by the user to be dropped, then drop the user. You must then grant
permissions to the users again, if appropriate.
Dropping groups
The system security officer, the system administrator, or the database
administrator uses sp_dropgroup to drop a group. The syntax is:
sp_dropgroup grpname
You cannot drop a group that has members. If you try to do so, the error report
displays a list of the members of the group you are attempting to drop. To
remove users from a group, use sp_changegroup, discussed in “Changing a
user’s group membership” on page 427.
Warning! Adaptive Server may reuse the server user ID (suid) of a dropped
login account when the next login account is created. This occurs only when
the dropped login holds the highest suid in syslogins; however, it can
compromise accountability if execution of sp_droplogin is not being audited.
Also, it is possible for a user with the reused suid to access database objects that
were authorized for the old suid.
You can lock an account that is currently logged in, and the user is not locked
out of the account until he or she logs out. You can lock the account of a
database owner, and a locked account can own objects in databases. In
addition, you can use sp_changedbowner to specify a locked account as the
owner of a database.
Adaptive Server ensures that there is always at least one unlocked system
security officer’s account and one unlocked system administrator’s account.
Changing passwords
All users can change their passwords at any time using sp_password. The
system security officer can use sp_password to change any user’s password.
See the Reference Manual: Procedures for the sp_password syntax.
For example, a user can change his or her own password from “3blindmice” to
“2mediumhot” using:
sp_password "3blindmice", "2mediumhot"
These passwords are enclosed in quotes because they begin with numbers.
In the following example, the system security officer whose password is
“2tomato” changes Victoria’s password to “sesame1”:
sp_password "2tomato", sesame1, victoria
Null passwords
Do not assign a null password. When Adaptive Server is installed, the default
“sa” account has a null password. The following example shows how to change
a null password to a valid one:
sp_password null, "8M4LNCH"
Sybase strongly recommends that you change the password when the server
restarts. For example, to reset the password for user rsmith who has sa_role:
dataserver -prsmith
Where client_name is the name you are assigning the client, host_name is the
name of the host from which the client is connecting, and application_name is
the application that is connecting to Adaptive Server. These parameters are
stored in the clientname, clienthostname, and clientapplname columns of the
sysprocesses table.
For example, if a user logs in to Adaptive Server as “client1,” you can assign
them an individual client name, host name, and application name using
commands similar to:
set clientname 'alison'
set clienthostname 'money1'
set clientapplname 'webserver2'
This user now appears in the sysprocesses table as user “alison” logging in
from host “money1” and using the “webserver2” application. However,
although the new names appear in sysprocesses, they are not used for
permission checks, and sp_who still shows the client connection as belonging
to the original login (in the case above, client1). set clientname does not
perform the same function as set proxy, which allows you to assume the
permissions, login name, and suid of another user.
You can set a client name, host name, or application name for only your current
client session (although you can view the connection information for any client
connection). Also, this information is lost when a user logs out. These
parameters must be reassigned each time a user logs in. For example, the user
“alison” cannot set the client name, host name, or application name for any
other client connection.
Use the client’s system process ID to view their connection information. For
example, if the user “alison” described above connects with a spid of 13, issue
the following command to view all the connection information for this user:
select * from sysprocesses where spid = 13
To view the connection information for the current client connection (for
example, if the user “alison” wanted to view her own connection information),
enter:
select * from sysprocesses where spid = @@spid
Note Although more than one individual can use the alias in a database, you
can still maintain individual accountability by auditing the database operations
performed by each user. See Chapter 18, “Auditing.”
The collective user identity from using aliases implies set-ownership for
database objects. For example, if user “loginA” is aliased to dbo in in database
db1, all objects created by “loginA” in db1 are owned by dbo. However,
Adaptive Server concretely records an object’s ownership in terms of the login
name and the creator’s database user ID. See “Concrete identification” on page
569. An alias cannot be dropped from a database if he or she concretely owns
objects in that database.
Note You cannot drop the alias of a login if that login created objects in the
database. In most cases, use aliases only for users who do not own tables,
procedures, views, or triggers.
Adding aliases
To add an alias for a user, use sp_addalias:
sp_addalias loginame, name_in_db
where:
• loginame – is the name of the user who wants an alias in the current
database. This user must have an account in Adaptive Server but cannot be
a user in the current database.
• name_in_db – is the name of the database user to whom the user specified
by loginame is to be linked. The name_in_db must exist in sysusers in the
current database.
Executing sp_addalias maps the user name specified by loginame to the user
name specified by name_in_db. It does this by adding a row to the system table
sysalternates.
When a user tries to use a database, Adaptive Server checks for the user’s
server user ID number (suid) in sysusers. If it is not found, Adaptive Server
then checks sysalternates. If the user’s suid is found there, and it is mapped to
a database user’s suid, the first user is treated as the second user while the first
user is using the database.
For example, suppose that Mary owns a database. She wants to allow both Jane
and Sarah to use the database as if they were its owner. Jane and Sarah have
logins on Adaptive Server but are not authorized to use Mary’s database. Mary
executes the following commands:
sp_addalias jane, dbo
exec sp_addalias sarah, dbo
Warning! Users who are aliased to the database owner have all the permissions
and can perform all the actions that can be performed by the database owner,
with respect to the database in question. A database owner should carefully
consider the implications of vesting another user with full access to a database.
Dropping aliases
Use sp_dropalias to drop the mapping of an alternate suid to a user ID. Doing
this deletes the relevant row from sysalternates. The syntax is the following,
where loginame is the name of the user specified by loginame when the name
was mapped with sp_addalias:
sp_dropalias loginame
After a user’s alias is dropped, the user no longer has access to the database.
You cannot drop an alias if the aliased login created any objects or thresholds.
Before using sp_dropalias to remove an alias that has performed these actions,
remove the objects or procedures. If you still need them after dropping the
alias, re-create them with a different owner.
(1 row affected)
Users aliased to user.
Login_name
----------------------
andy
christa
howard
linda
(return status = 0)
The arguments for these system functions are optional. If you do not provide
one, Adaptive Server displays information about the current user.
This example shows how to find the server user ID for the user “sandy:”
select suser_id("sandy")
------
3
This example shows how a system administrator whose login name is “mary”
issues the commands without arguments:
select suser_name(), suser_id()
------------------------------ ------
mary 4
To find a user’s ID number or name inside a database, use user_id and
user_name.
Table 14-8: System functions user_id and user_name
To find Use With the argument
User ID user_id ([“db_user_name”])
User name user_name ([db_user_ID])
The arguments for these functions are optional. If you do not provide one,
Adaptive Server displays information about the current user. For example:
select user_name(10)
----------------------------------------------------
NULL
(1 row affected)
select user_name( )
----------------------------------------------------
dbo
(1 row affected)
select user_id("joe")
----------------------------------------------------
NULL
(1 row affected)
To find a role name when you know the role ID, use role_name:
role_name(role_id)
Any user can execute role_name.
Note The show_role function does not include information about user-defined
roles.
This example creates the new login “joe” with the password “Djdiek3”
and sets the maximum number of failed login attempts for the login “joe”
to 2:
sp_addlogin joe, "Djdiek3", pubs2, null, null, null,
null, 2
See sp_addlogin in Reference Manual: Procedures.
This example creates the intern_role role with the password “temp244”,
and sets the maximum failed logins for intern_role to 20:
create role intern_role with passwd "temp244",
maximum failed logins 20
See create role Reference Manual: Commands.
sp_modifylogin only effects user roles, not system roles. For details on the
syntax and rules, see sp_modifylogin.
See sp_modifylogin in Reference Manual: Procedures.
Note Adaptive Server uses a default value of 6 for minimum password length.
Sybase recommends that you use a value of 6 or more for this parameter.
This example creates the new login “joe” with the password “Djdiek3”,
and sets the minimum password length for “joe” to 8:
sp_addlogin joe, "Djdiek3", @minpwdlen=8
For details on the syntax and rules for using minimum password length, see
sp_addlogin in the Reference Manual: Procedures.
This example creates the new role intern_role with the password
“temp244” and sets minimum password length for intern_role to 0:
create role intern_role with passwd "temp244", min
passwd length 0
The original password is seven characters, but the password can be
changed to one of any length because minimum password length is set to 0.
See create role in the Reference Manual: Commands.
However, if you change the login password entering the following, the login
johnd is now a substring of the new password johnd123, and the command
fails:
sp_password 'old_complex_password', johnd123, johnd
• min upper char in password – the minimum number of uppercase letters for
a password. Disabled by default. Valid values are:
• 0 through 16 – the number of uppercase letters required for a
password.
• -1 – the password cannot contain uppercase characters.
• min lower char in password – the minimum number of lowercase letters for
a password. Valid values are:
• 0 through 16 – the number of uppercase letters required for a
password.
• -1 – the password cannot contain uppercase characters.
• minimum password length – the minimum password length. You can set a
minimum password length from 0 to 30. The value you specify with must
be at least the sum of all other minimum requirements. For example,
minimum password length must be set to at least 10 if you have set:
• min alpha in password must be at least the sum of min upper char in
password and min lower char in password.
These global options for login “johnd” create two minimum password length
requirements for login “johnd”, and sets restrictions about digits in the
password:
sp_configure 'minimum password length', 8
sp_configure 'check password for digit', 'true'
sp_passwordpolicy 'set', 'min digits in password', 2
If you then try to create a password for login “johnd”:
sp_password @caller_password = 'old_complex_password',
@new_password = 'abcd123', @login_name = 'johnd'
Adaptive Server checks the password in the following order:
1 Per-login existing options check: minimum password length must be
greater than 6. This is true and the check passes.
2 New options: minimum digits in password must be greater than 2. This is
true and the check passes.
3 Existing global options: minimum password length specified here is not
checked because there is already a per-login check for the login “johnd”.
4 The check password for digit option is redundant because it is already
checked when the minimum number of digits is turned on and set to 2.
Once Adaptive Server checks the designated sequence, and the new password
for login “johnd” passes these checks, the new password is successfully
created.
Example 2 If you enter the following for user “johnd”, Adaptive Server first
checks the per-login existing options, and determines the minimum password
length is set to 6, but that you have attempted to create a password with only 4
characters:
sp_password @caller_password = 'old_complex_password',
@new_password = 'abcd', @login_name = 'johnd'
The check fails, and Adaptive Server prints an error message. Once one
password complexity check fails, no additional options are checked.
Example 3 This example creates a new login with the following password
configuration options and sets the minimum password length for login johnd
to 4:
sp_addlogin @login_name = 'johnd', @passwd =
'complex_password', @minpwdlen = 4
This is a per-login, existing option. When you add the following, you have
created a global requirement that the minimum number of digits for a password
must be 1:
sp_passwordpolicy 'set', 'min digits in password', 1
If you then attempt to create the password for login johnd as follows:
sp_password @caller_password = 'old_complex_password',
@ new_password = 'abcde', @login_name = 'johnd'
Adaptive Server performs the checks in the following order:
1 Per-login existing options check: the minimum password length of a new
password is 4. The password “abcde” is greater than 4, so this check
passes.
2 New global requirement check: the minimum digits in a password is set to
1, globally. This check fails.
Adaptive Server does not create a new password and prints an error message.
To create a new password, all the checks must pass.
begin
declare @current_time datetime,
@encrypted_pwd varbinary(30),
@changedby varchar(30),
@cutoffdate datetime
delete master..pwdhistory
where name = @loginame
and pwdate < @cutoffdate
(
@loginame varchar(30)
-- user to change password on
)
as
begin
delete master..pwdhistory
where name = @loginame
end
go
Once the two procedures above are defined and installed in the master
database, they are called dynamically during the password complexity checks.
The following rules apply to password expiration for logins and roles:
• A password expiration interval assigned to individual login accounts or
roles overrides the global password expiration value. This allows you to
specify shorter expiration intervals for sensitive accounts or roles, such as
system security officer passwords, and more relaxed intervals for less
sensitive accounts such as an anonymous login.
• A login or role for which the password has expired is not directly
activated.
• The password expires at the time of day when the password was last
changed after the number of days specified by password expiration interval
has passed.
For details on the syntax and rules for the commands and system procedures,
see the appropriate Reference Manual.
The key pair is kept in memory. A message is recorded in the error log and in
the audit trail when the key pair is regenerated.
To generate the key pair on demand, use:
sp_passwordpolicy "regenerate keypair"
Note Depending on the system load, there may be a delay between the time
this command is executed and the time the key pair is actually generated. This
is because the housekeeper task runs at a low priority and may be delayed by
higher priority tasks.
Adaptive Server uses either RSA or Sybase proprietary algorithms when this
server option is set to true. The command to enable net password encryption is:
sp_serveroption server, "net password encryption",
"true"
The setting is stored in master..sysservers and you can display the value of
server options using the sp_helpserver stored procedure.
The default value for net password encryption is true for any new server added
using sp_addserver. During upgrade, Adaptive Server sets net password
encryption to true for sysservers entries with an ASEnterprise class value. No
other server classes are modified. This improves password security between
two communicating Adaptive Servers.
Note The administrator can optionally reset net password encryption to false if
you encounter problems establishing a connection to a server. However, if the
option is set to false, passwords are transmitted in clear text on the network.
Backward compatibility
• Sybase recommends that you use the RSA algorithm to protect passwords
on the network.
• To use the RSA algorithm, you must have Adaptive Server version 15.0.2
and new Connectivity SDK clients (version 15.0 ESD #7 and later.)
Sybase provides the net password encryption reqd configuration parameter
and the net password encryption server option to allow settings equivalent
to versions earlier than 15.0.2 and maintain backward compatibility with
older clients and older servers.
• Older clients that do not support the RSA algorithm can set the property to
encrypt passwords using the Sybase proprietary algorithm, which has been
available version 12.0. Adaptive Server then uses the Sybase proprietary
algorithm.
• New clients that support both RSA and Sybase proprietary algorithms can
set properties for both algorithms. When communicating with such clients,
Adaptive Server 15.0.2 uses RSA encryption. A pre-15.0.2 Adaptive
Server uses the Sybase proprietary algorithm.
• The value of each password column in syslogins is rewritten to use only the
new password on-disk structure.
• The logins that have not transitioned to the new algorithm have the
password reset to a new server-generated password in SHA-256 format,
and the login is locked. The generated password is displayed only to the
administrator executing the sp_passwordpolicy procedure above. The lock
reason is set to 3 (“Login or role not transitioned to SHA-256”).
After the sp_passwordpolicy procedure completes:
• Login authentication uses only SHA-256.
• Only the new password on-disk structure for the password column is used.
• Attempts to use the locked logins fail authentication. To use the locked
logins, you must unlock the login with sp_locklogin and the user must use
the password generated by sp_passwordpolicy. Alternatively, you may
prefer to assign a new password instead of the generated password for
locked login accounts.
Example 1 This example prepares an upgraded server to use only SHA-256. Examine
login accounts to determine which encryption is used by the account using
sp_displaylogin.
1> sp_displaylogin login993
2> go
Suid: 70
Loginame: login933
Fullname:
Default Database: master
Default Language:
Auto Login Script:
Configured Authorization:
Locked: NO
Date of Last Password Change: Apr 20 2007 2:55PM
Password expiration interval: 0
Password expired: NO
Minimum password length: 0
Maximum failed logins: 3
Current failed login attempts:
Authenticate with: ANY
Login Password Encryption: SYB-PROP
Last login date:
(return status = 0)
The value SYB-PROP from the line Login Password Encryption: SYB-PROP
indicates that only the Sybase-proprietary encryption is used for this account.
This login has not been used before they upgrade to Adaptive Server version
15.0.2, and will be locked, and its password reset if sp_passwordpolicy 'set',
'allow password downgrade', 0 is executed.
After the first login to the account after upgrading to Adaptive Server 15.0.2,
the line changes to show that both old and new encryption is used:
Login Password Encryption: SYB-PROP,SHA-256
This is the desired state for all active login accounts, so that executing
sp_passwordpolicy 'set', 'allow password downgrade', 0 does not lock and reset
the password for accounts.
After you execute sp_passwordpolicy 'set', 'allow password downgrade', 0, only
SHA-256 encryption is used, and you see:
Login Password Encryption: SHA-256
Login accounts that show this value are now using the stronger, on-disk
encryption algorithm.
When all passwords have been changed to use the new algorithm, reexecuting
sp_passwordpolicy shows no accounts reset or locked:
Note The login name, suid, and generated password appear to the
administrator executing the procedure. The output of the command shows all
10 accounts that have not transitioned are reset (and locked).
Note Running sp_downgrade, shutting down the server, then restarting the
same version of Adaptive Server from which you downgraded removes the
changes made by sp_downgrade. You must re-run sp_downgrade to redo the
changes. See the Installation Guide for information about running
sp_downgrade.
• Decrease the ratio of rows per page from about 16 rows per 2K page to 12
rows per 2K page between Adaptive Server versions 15.0.1 and 15.0.2.
There is a period of time during the downgrade when the value for allow
password downgrade is 1 (when both old and new password encryption
algorithms are used); the ratio further decreases to about 10 rows per 2K
page.
For example, if Adaptive Server 15.0.1 has 1,000 login accounts, and the
data fits into 59 pages, the same number of login accounts may require
approximately 19 additional pages in Adaptive Server 15.0.2 on a new
master database, or 33 additional pages if you upgraded from 15.0.1 (with
allow password downgrade set to 1).
The transaction log requires additional space for the updated password column.
When users first log in, Adaptive Server requires about 829 2K pages per 1,000
logins, and about 343 pages per 1,000 logins for password changes users make
during the upgrade and downgrade. To ensure there is sufficient log space,
verify that there is approximately one 2K page of free log space per login
before starting the password upgrade or downgrade, and when users first login
to Adaptive Server version 15.0.2 and later.
Downgrading
Adaptive Server supports downgrading from version 15.0.2 or later to version
15.0 or 15.0.1. If you are downgrading to an earlier version of Adaptive Server,
you may need to perform additional actions.
If allow password downgrade is 0 or NULL, or if a password has been stored in
syslogins with only the SHA-256 algorithm, use sp_displaylogin on login
accounts to determine which algorithm is used, or sp_downgrade "prepare" to
determine which accounts are reset.
The prepare option reports whether the server is ready to be downgraded. If the
prepare option fails, it reports errors that must be fixed. If a downgrade is
performed on the server before the errors are fixed, the downgrade fails. For
login passwords, prepare reports which passwords are reset during the
downgrade.
Run sp_downgrade "prepare" to verify whether you should run sp_downgrade:
sp_downgrade 'prepare','15.0.1',1
Checking databases for downgrade readiness.
databases minor
upgrade version.
00:00000:00006:2007/05/21 05:36:03.90 server ASE downgrade completed.
sp_downgrade makes catalog changes, and modifies password data. The server
must be in single user mode to successfully execute sp_downgrade. To start the
server in single user mode, and to allow only the System Administrator to log
in, use the -m command line option to start the server.
After running sp_downgrade, shut down the 15.0.2 server to avoid new logins
or other actions that may modify data or system catalogs. If you restart
Adaptive Server at version 15.0.2 after running sp_downgrade, the earlier
version shuts down and you are again upgraded to the version 15.0.2 or later
level.
The result set includes the current value, and a message indicating its meaning.
If you have upgraded the master database, and are maintaining passwords with
the old and new encodings, the result is:
sp_passwordpolicy list, "allow password downgrade"
go
value message
-------- -----------------------------------------------------
1 Password downgrade is allowed.
(1 row affected)
For an upgraded master database that only uses new password encryption, the
result is:
sp_passwordpolicy list, "allow password downgrade"
go
value message
-------- -----------------------------------------------------
0 Last Password downgrade was allowed on <datetime>.
(1 row affected)
For a new master database on Adaptive Server 15.0.2 that only uses new
password encryption, the result is:
sp_passwordpolicy list, "allow password downgrade"
go
value message
-------- -----------------------------------------------------
NULL New master database.
(1 row affected)
The lockreason column specifies the reason a login was locked. The value of
the lockdate column is set to the current datetime.
When an account is unlocked, columns lockreason, lockdate, and locksuid are
reset to NULL.
The lockdate, locksuid, and lockreason columns are set internally by Adaptive
Server. Table 14-11 describes the lockreasons and the value of locksuid.
Table 14-11: The reasons and values of locksuid
lockreason
value locksuid value Explanation of lockreason value
NULL NULL Account has not been locked.
0 suid of caller of sp_locklogin Account locked by locksuid by manually executing
sp_locklogin.
lockreason
value locksuid value Explanation of lockreason value
1 suid of caller of sp_locklogin Account locked due to account inactivity, locksuid has
manually executed sp_locklogin 'all', 'lock', 'ndays'.
2 suid of attempted login Account locked by Adaptive Server due to failed login
attempts reaching maximum failed logins.
3 suid of caller of sp_passwordpolicy Account locked by locksuid as the password downgrade
set, "allow password downgrade", 0 period has ended, and login or role has not transitioned to
SHA-256.
High-availability configuration
The primary and companion servers must have equivalent allow password
downgrade values before you configure them for high availability. The allow
password downgrade quorum attribute checks whether the value of allow
password downgrade is the same on both primary, and secondary servers.
(1 row affected)
(return status = 1)
A value of 2 in the Advisory column indicates that the user cannot proceed with
the cluster operation unless the values on both companions match.
sp_companion do_advisory also lists the difference in the value of allow
password downgrade on both servers.
• If the number of licenses in use is greater than the number allowed by the
license agreement, the License Use Monitor issues this message to the
error log:
Exceeded license usage limit. Contact Sybase Sales
for additional licenses.
The housekeeper chores task runs during Adaptive Server idle cycles. Both the
housekeeper free write percent and the license information configuration
parameter must be set to values greater than or equal to 1 for the License Use
Monitor to track license use.
For more information about the housekeeper chores task, see Chapter 3, “Using
Engines and CPUs,” in the Performance and Tuning Series:Basics.
In this example, the number of user licenses used exceeded the limit on July
19, 1998.
For detailed information about these stored procedures, see the Reference
Manual: Procedures.
This chapter discusses the steps the system administrator and system
security officer of each Adaptive Server must execute to enable remote
procedure calls (RPCs).
Topic Page
Overview 479
Managing remote servers 480
Adding remote logins 486
Password checking for remote users 490
Getting information about remote logins 491
Configuration parameters for remote logins 491
Overview
Users on a local Adaptive Server can execute stored procedures on a
remote Adaptive Server. Executing an RPC sends the results of the remote
process to the calling process, which usually appears on the user’s screen.
To enable RPCs, the system administrator and system security officer of
each Adaptive Server must execute the following steps:
• On the local server:
• System security officer – use sp_addserver to list the local server
and remote server in the system table master..sysservers.
• List the remote server in the interfaces file or directory service
for the local server.
• Restart the local server so the global variable @@servername is
set to the name of the local server. If this variable is not set
properly, users cannot execute RPCs from the local server on any
remote server.
• On the remote server:
• local – identifies the server being added as a local server. The local value is
used only after starting up, or after a restart, to identify the local server
name so that it can appear in messages printed out by Adaptive Server. null
specifies that this server is a remote server.
Note For users to successfully run RPCs from the local server, add the
local server using the local option, and restart it. The restarting is required
to set the global variable @@servername.
• pname – is the remote server listed in the interfaces file for the server
named lname. This optional argument permits you to establish local
aliases for any other Adaptive Server, Open Server, or Backup Server that
you may need to communicate with. If you do not specify pname, to lname
is the default.
• srvname is the unique server name that users must supply when executing
remote procedure calls.
• srvnetname is the server’s network name, which must match the name in
the interfaces file.
To add or drop servers from your network, use sp_addserver to update the
server’s network name in srvnetname.
For example, to remove the server MAIN from the network, and move your
remote applications to a server named TEMP, use the following statement to
change the network name, while keeping the local alias:
sp_addserver MAIN, null, TEMP
sp_addserver displays a message telling you that it is changing the network
name of an existing server entry.
Warning! Do not map more than one remote login to a single local login, as it
reduces individual accountability on the server. Audited actions can be traced
only to the local server login, not to the individual logins on the remote server.
If you are using If users are logged in to the remote server using unified login, the logins must
network-based be designated as trusted on the local server, or they must specify passwords for
security
the server when they log in to the remote server.
1 joe 1
1 nancy 2
1 NULL 3
3 NULL 4
4 NULL -1
By matching the value of remoteserverid in this result and the value of srvid in
the previous result, you can find the name of the server for which the
remoteusername is valid. For example, in the first result, srvid 1 indicates the
CORPORATE server; in the second result, remoteserverid 1 indicates that same
server. Therefore, the remote user login names “joe” and “nancy” are valid on
the CORPORATE server.
The following statement shows the entries in master..syslogins:
select suid, name from syslogins
suid name
------ ------------
1 sa
2 vp
3 admin
4 writer
The results of all three queries together show:
• The remote user name “joe” (suid 1) on the remote CORPORATE server
(srvid and remoteserverid 1) is mapped to the “sa” login (suid 1).
• The remote user name “nancy” (suid 2) on the remote CORPORATE
server (srvid and remoteserverid 1) is mapped to the “vp” login (suid 2).
• The other logins from the CORPORATE server (remoteusername
“NULL”) are mapped to the “admin” login (suid 3).
• All logins from the PUBLICATIONS server (srvid and remoteserverid 3)
are mapped to the “writer” login (suid 4).
• All logins from the ENGINEERING server (srvid and remoteserverid 4)
are looked up in master..syslogins by their remote user names (suid -1).
• There is no remoteserverid entry for the MARKETING server in
sysremotelogins. Therefore, users who log in to the MARKETING server
cannot run remote procedure calls from that server.
The remote user mapping procedures and the ability to set permissions for
individual stored procedures give you control over which remote users can
access local procedures. For example, you can allow the “vp” login from the
CORPORATE server to execute certain local procedures and all other logins
from CORPORATE to execute the procedures for which the “admin” login has
permission.
Note Typically, the passwords for users on the remote server must match
passwords on the local server.
To change your password in “untrusted” mode, you must first change it on all
the remote systems you access before you can change it on your local server. If
you change your password on the local server first, when you issue the remote
procedure call to execute sp_password on the remote server, your passwords no
longer match.
The syntax for changing your password on the remote server is:
remote_server...sp_password caller_passwd, new_passwd
On the local server, the syntax is:
sp_password caller_passwd, new_passwd
See “Changing passwords” on page 424.
This chapter describes the Adaptive Server features that enable you to
authenticate users with authentication data stored in repositories that are
external to Adaptive Server.
Topic Page
Configuring Adaptive Server for network-based security 494
Concurrent Kerberos authentication 530
Configuring Adaptive Server for LDAP user authentication 530
Configuring Adaptive Server for authentication using PAM 551
LDAPS user authentication enhancements 548
Enhanced login controls 555
Security mechanism
connection
Note The security mechanism you are using may not employ all of these
services. See “Getting information about available security services” on
page 517.
For a detailed description of the configuration files, see the Open Client/Server
Configuration Guide for your platform.
Note The dsedit tool, which helps you create entries for either the
interfaces file or a Directory Service, is available on UNIX platforms.
However, it does not support the creation of secmech entries for security
mechanisms.
For more information about dscp, see the Open Client/Server Configuration
Guide for UNIX.
Note If you do not specify a network driver, an appropriate driver for your
application and platform is automatically used. For example, for UNIX
platforms, a driver that can handle threads is automatically chosen when
security services are being used.
• provider – is the local name for the security mechanism. The mapping of
the local name to a global object identifier is defined in objectid.dat.
The default local names are:
• “dce” – for the DCE security mechanism.
• “csfkrb5” – for the CyberSAFE or MIT Kerberos security
mechanism.
• “LIBSMSSP” – for Windows LAN Manager on Windows NT or
Windows 95 (clients only).
If you use a local mechanism name other than the default, change the local
name in the objectid.dat file (For an example, see “The objectid.dat file”
on page 502).
• driver – is the name of the security driver. The default location of all
drivers for UNIX platforms is $SYBASE/$SYBASE_OCS/lib. The default
location for Windows platform is %SYBASE%\%SYBASE_OCS%\dll.
• init-string – is an initialization string for the driver. This element is
optional. The value for init-string varies by driver:
• DCE driver – the following is the syntax for init-string, where
cell_name is the name of your DCE cell:
secbase=/.../cell_name
• Kerberos driver – the following is the syntax for init-string, where
realm is the default Kerberos realm name:
secbase=@realm
• Windows NT LAN Manager – init-string is not applicable.
Make sure that the entries you do not want to use are commented (begin with
“;”) and the entries you want are uncommented (do not begin with “;”).
For more information, see the Open Client/Server Configuration Guide for
UNIX
[DIRECTORY]
;dce=libsybddce.so ditbase=/.:/subsys/sybase/dataservers
;dce=libsybddce.so ditbase=/.:/users/cfrank
[SECURITY]
dce=libsybsdce.so secbase=/.../svrsole4_cell
This libtcl.cfg file uses the DCE security service. This file does not use
Directory Services because all [DIRECTORY] section entries are commented.
Because all entries in the [DRIVERS] section for network drivers are also
commented, appropriate drivers are automatically chosen by the system.
Adaptive Server automatically chooses a threaded driver when you use
security services, and chooses an unthreaded driver for applications that cannot
work with threaded drivers. For example, Backup Server does not support
security services and does not work with a threaded driver.
[DRIVERS]
NLWNSCK=TCP Winsock TCP/IP Net-Lib driver
NLMSNMP=NAMEPIPE Named Pipe Net-Lib driver
NLNWLINK=SPX NT NWLINK SPX/IPX Net-Lib driver
NLDECNET=DECNET DecNET Net-Lib driver
[SECURITY]
NTLM=LIBSMSSP
Note You can specify only one local name per security mechanism.
Note In a production environment, control access to files that contain the keys
of the servers and users. If users can access the keys, they can create a server
that impersonates your server.
See the documentation available from the third-party provider of the security
mechanism for detailed information about how to perform required
administrative tasks.
Note More than one user can assume the suid associated with the secure
default login. Therefore, you might want to activate auditing for all
activities of the default login. You may also want to consider using
sp_addlogin to add all users to the server.
See “Adding logins to support unified login” on page 507 and “Adding logins
to Adaptive Server” on page 399.
Security model A
In security model A, which is the default, Adaptive Server does not support
security services such as message confidentiality via encryption between the
two servers.
Security model B
In security model B, the local Adaptive Server receives a credential from the
security mechanism and uses the credential to establish a secure physical
connection with the remote Adaptive Server. You can use one or more of these
security services with model B:
• Mutual authentication – the local server authenticates the remote server by
retrieving the credential of the remote server and verifying it with the
security mechanism. The credentials of both servers are authenticated and
verified.
• Message confidentiality via encryption – messages are encrypted when
sent to the remote server, and results from the remote server are encrypted.
• Message integrity – messages between the servers are checked for
tampering.
For example, to set security model B for remote server TEST3, execute:
sp_serveroption test3, "rpc security model B", true
The default model is “A.” No server options need to be set for model A.
See Reference Manual: Procedures.
## lcl_serv (3201)
lcl_serv
master tli tcp /dev/tcp \x00020c8182d655110000000000000000
query tli tcp /dev/tcp \x00020c8182d655110000000000000000
secmech 1.3.6.1.4.1.897.4.6.1
## rem_serv (3519)
rem_serv
master tli tcp /dev/tcp \x000214ad82d655110000000000000000
query tli tcp /dev/tcp \x000214ad82d655110000000000000000
secmech 1.3.6.1.4.1.897.4.6.1
System security officer on remote server “rem_serv” issues:
sp_addserver ’lcl_serv’
sp_addlogin user1, "eracg12"
sp_addlogin user2, "esirpret"
sp_addlogin user3, "drabmok"
sp_configure "use security services", 1
sp_serveroption lcl_serv, "rpc security model B", true
sp_serveroption lcl_serv, "security mechanism", dce
System administrator on remote server “rem_serv” issues:
sp_remoteoption lcl_serv, user1, user1, trusted, true
sp_remoteoption lcl_serv, user2, user2, trusted, true
System security officer on local server “lcl_serv” issues::
sp_addserver lcl_serv, local
sp_addserver rem_serv
sp_addlogin user1, "eracg12"
sp_addlogin user2, "esirpret"
sp_addlogin user3, "drabmo1"
sp_configure "use security services", 1
sp_configure rem_serv, "rpc security model B", true
sp_serveroption rem_serv, "security mechanism", dce
sp_serveroption rem_serv, "mutual authentication" true
sp_serveroption rem_serv, "use message integrity" true
Note To use the security services on either server, you must restart the server
so the use security services static parameter takes effect.
• -R remote_server_principal
• -V security_options
• -Z security_mechanism
If you are using Client-Library to connect to Adaptive Server, you can define
security properties before connecting to the server. For example, to check
message sequencing, set the CS_SEC_DETECTSEQ property. For
information about using security services with Client-Library, see the Open
Client Client-Library/C Reference Manual.
--------------------------------------------------
unifiedlogin mutualauth confidentiality
(1 row affected)
Using Kerberos
Kerberos is a network authentication protocol that uses secret-key
cryptography so that a client can prove its identity to a server across a network
connection. User credentials are obtained when the user logs in to the operating
system, or by executing an authentication program. Each application uses these
credentials to perform authentication. Users only have to log in once, instead
of having to log in to each application.
Kerberos assumes the key distribution center (KDC) is running and properly
configured for your realm, and the client libraries are installed under or on each
client host in your realm. For configuration information, consult the
documentation and the reference pages that come with the Kerberos software.
Adaptive Server supports Kerberos through:
• CyberSafe Kerberos libraries
• MIT Kerberos libraries, version 1.3.1
• Native libraries
Note To enable Kerberos security options, you must have ASE_SECDIR, the
“Security and directory services” package.
Kerberos compatibility
Table 16-7 shows which variation of Kerberos is supported on which
platforms.
Table 16-7: Adaptive Server Kerberos interoperability
Generic security
Hardware platforms KDC server standard (GSS) client
Solaris 32 CSF, AD, MIT CSF, MIT, Native
Solaris 64 CSF, AD, MIT CSF, MIT, Native
Linux 32 CSF, AD, MIT MIT, Native
Windows 32 CSF, AD CSF
AIX 32 CSF CSF
Disconnected.
Configuring Kerberos
The configuration process is similar, regardless of which variety of Kerberos
you use.
1 Set up Kerberos third-party software and create a Kerberos administrative
user. To do this, you must:
a Install Kerberos client software on machines where Open Client
Server clients or Adaptive Server will run. The following client
packages have been verified to work with:
• CyberSafe TrustBroker 4.0
• MIT Kerberos version 1.3.1
b Install the Kerberos KDC server on a separate, dedicated machine.
The following UNIX examples use the command line tool kadmin,
available with CyberSafe or MIT Kerberos (there are also GUI tools
available to administer Kerberos and users):
CyberSafe Kadmin:
% kadmin aseadmin
Principal - aseadmin@MYREALM
Enter password:
Connected to csfA5v01 in realm ASE.
Command: add ase120srv
Enter password:
Re-enter password for verification:
Principal added.
Command: ext -n ase120srv
Service Key Table File Name (/krb5/v5srvtab):
Key extracted.
Command: quit
Disconnected.
In a production environment, control the access to the keytab file. If a user
can read the keytab file, he or she can create a server that impersonates
your server.
Use chmod and chgrp so that /krb5/v5srvtab is:
-rw-r----- 1 root sybase 45 Feb 27 15:42 /krb5/v5srvtab
When using Active Directory as the KDC, log in to the Domain Controller
to add users and Adaptive Server principals. Use the Active Directory
Users and Computers wizard to guide you through creating users and
principals.
Extracting the keytab file for use with Adaptive Server requires an
optional tool called ktpass, which is included in the Microsoft Support
Tools package.
With Active Directory, extracting the keytab with ktpass is a separate step
from creating the principal. The keytab file on Windows for Adaptive
Server is located with the CyberSafe program files. For example,
c:\Program Files\CyberSafe\v5srvtab is the expected location of the
Adaptive Server keytab file when CyberSafe software is installed on the
C: drive.
4 Add a Kerberos principal for the user “sybuser1” as
“sybuser1@MYREALM”.
5 Start Adaptive Server and use isql to log in as “sa”. The following steps
configure Adaptive Server parameters to use Kerberos security services,
and create the user login account. These are the same on both Windows or
UNIX machines:
• Change configuration parameter use security services to 1:
sp_configure 'use security services', 1
• Add a new login for user, “sybuser1” and then add the user:
sp_addlogin sybuser1, password
6 Shut down Adaptive Server and modify administrative files and
connectivity configuration files.
• On UNIX platforms, the interfaces file is under $SYBASE/ and has an
entry that looks similar to:
ase120srv
master tli tcp myhost 2524
query tli tcp myhost 2524
secmech 1.3.6.1.4.1.897.4.6.6
On Windows platforms, the sql.ini file is in %SYBASE%\ini, and has
an equivalent server entry that looks like:
[ase120srv]
master=TCP,myhost,2524
query=TCP,myhost,2524
secmech=1.3.6.1.4.1.897.4.6.6
[SECURITY]
csfkrb5=libsybskrb.so
secbase=@MYREALM
libgss=/opt/mitkrb5/lib/libgssapi_krb5.so
For a machine that uses Native OS provided libraries, such as Linux,
it looks similar to:
[SECURITY]
csfkrb5=libsybskrb.so secbase=@MYREALM
libgss=/usr/kerberos/lib/libgssapi_krb5.so
On Windows, the %SYBASE%\%SYBASE_OCS%\ini\libtcl.cfg file
contains an entry like:
[SECURITY]
csfkrb5=libskrb secbase=@MYREALM
libgss=C:\WinNT\System32\gssapi32.dll
You may may need to modify the environment variable for dynamic
library search paths. On UNIX, the most commonly used environment
variable is LD_LIBRARY_PATH; on Windows, PATH is typically set to
include DLL locations. You may need to modify these environment
variables to enable applications to load the third-party objects correctly.
For example, this command adds the location of CyberSafe 32-bit
libgss.so shared object to the search path in a C-shell environment:
% set path = ( /krb5/lib $path )
8 Restart Adaptive Server. You should see:
00:00000:00000:2001/07/25 11:43:09.91 server
Successfully initialized the security mechanism
'csfkrb5'. The SQL Server will support use of this
security mechanism.
9 Use isql as UNIX user “sybuser1” (without the -U and -P arguments) to
connect:
% $SYBASE/$SYBASE_OCS/bin/isql -Sase120srv -V
1>...
You can also use the encryption option:
$SYBASE/$SYBASE_OCS/bin/isql -Sase120srv –Vc
Use either the setenv command or the -k dataserver option to set the principal
name.
By default, the principal name is the name of Adaptive Server. To specify a
different name, set SYBASE_PRINCIPAL before starting Adaptive Server to
use Kerberos:
setenv SYBASE_PRINCIPAL <name of principal>
Once you have set an Adaptive Server principal name, Adaptive Server uses
the value of this variable to authenticate itself to Kerberos.
To specify an Adaptive Server principal name when starting Adaptive Server,
use:
-k <server principal name>
When you start an Adaptive Server with the Kerberos security mechanism
enabled, Adaptive Server first uses the principal name specified with the -k
option for Kerberos authentication. If the -k option is not specified, Adaptive
Server looks for the principal name in the environment variable
SYBASE_PRINCIPAL. If neither is specified, Adaptive Server uses the server
name for authentication.
Adaptive Server accepts Kerberos Open Client connections that use different
server principal names if the entry for the principal name is present in the
keytab file. To allow connections with different principal names:
• Pass an empty string as a parameter for the -k option, or
• Set the SYBASE_PRINCIPAL environment variable to "". For example:
export SYBASE_PRINCIPAL=""
Example In this example, the Adaptive Server name is “secure_ase” and the realm name
is “MYREALM.COM.” The Adaptive Server name is specified on the
command line with -s parameter to the dataserver. The current realm is
specified in libtcl.cfg by a secbase attribute value:
[SECURITY]
csfkrb5=libskrb.so libgss=/krb5/lib/libgss.so
secbase=@MYREALM.COM
The default Adaptive Server principal name is
“secure_ase@MYREALM.COM.” If the principal name defined in the
Adaptive Server keytab file is “aseprincipal@MYREALM.COM,” you can
override the default Adaptive Server principal name by setting a server
principal name using options 1 or 2 below:
• Option 1, specify -k '':
%
$SYBASE/$SYBASE_ASE/bin/dataserver -dmaster.dat
-s secure_ase -k aseprincipal@MYREALM.COM
The Adaptive Server principal name used to authenticate with Kerberos is
“aseprincipal@MYREALM.COM.”
• Option 2, set SYBASE_PRINCIPAL:
Note Sybase recommends that only the “sybase” user is allowed read and
execute permissions, and that all other access should be denied.
Example 2 If the client principal name is user, and the corresponding entry
in syslogins table is USER, then sybmapname can be coded to accept the input
string user and convert this string to uppercase string USER.
sybmapname is loaded by Adaptive Server at runtime and uses its logic to do
the necessary mapping.
The following actions and output illustrate the sybmapname function described
in Example 2. The sybmapname.c file containing the customized definition for
syb__map_name() should be compiled and built as a shared object (or DLL),
and finally placed in the appropriate path location. Start Adaptive Server with
the Kerberos security mechanism enabled.
To initialize the Ticket Granted Ticket (TGT), which is a encrypted file that
provides identification:
$ /krb5/bin/kinit johnd@public
Password for johnd@public:
$
To list the TGT:
$ /krb5/bin/klist
Cache Type: Kerberos V5 credentials cache
Cache Name: /krb5/tmp/cc/krb5cc_9781
Default principal: johnd@public
Log in as “sa” and verify the user login for “johnd”:
$ $SYBASE/$SYBASE_OCS/bin/isql -Usa -P
-Ipwd`/interfaces
1>
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts:
Authenticate with: ANY
(return status = 0)
Successful Kerberos authentication, maps lower-case johnd to uppercase
JOHND using the sybmapname utility, and allows user johnd to log in to
Adaptive Server:
$ $SYBASE/$SYBASE_OCS/bin/isql -V -I'pwd'/interfaces
1>
Composed DN algorithm
This is the login sequence when you use the composed DN algorithm:
1 Open Client connects to an Adaptive Server listener port.
2 The Adaptive Server listener accepts the connection.
3 Open Client sends an internal login record.
4 Adaptive Server reads the login record..
5 Adaptive Server binds to the LDAP server with a DN composed from the
primary URL and the login name from the login record. This bind also
uses the password from the login record.
6 The LDAP server authenticates the user, returning either a success or
failure message.
7 If the Primary URL specifies a search, then Adaptive Server sends the
search request to the LDAP server.
Searched DN algorithm
This is the login sequence when you use the searched DN algorithm:
1 Open Client connects to an Adaptive Server listener port.
2 The Adaptive Server listener accepts the connection.
3 Open Client sends an internal login record.
4 Adaptive Server reads the login record.
5 Adaptive Server binds to the LDAP server with a directory server access
account.
The connection established in steps 5 and 6 may persist between
authentication attempts from Adaptive Server to reuse connections to DN
searches.
6 The LDAP server authenticates the user, returning either a success or
failure message.
7 Adaptive Server sends search requests to the LDAP server based on the
login name from the login record and the DN lookup URL.
8 The LDAP server returns the results of the search.
9 Adaptive Server reads the results to obtain an a value of attribute from the
DN lookup URL.
10 Adaptive Server uses the value of attribute as the DN and the password
from the login record to bind to the LDAP server.
11 The LDAP server authenticates the user, returning either a success or
failure message.
12 If the primary URL specifies a search, Adaptive Server sends the search
request to the LDAP server.
13 The LDAP server returns the results of the search.
14 Adaptive Server accepts or rejects the login, based on the search results.
Adaptive Server reports a generic login failure to the client if any of these
authentication criteria are not met.
You may skip steps 12 and 13 by not specifying search criteria in the primary
or secondary URL strings. The authentication completes, displaying the
success or failure returned by step 11.
Configuring LDAP
These are the steps for configuring Adaptive Server for LDAP authentication.
Configuring LDAP in 1 Specify the Adaptive Server LDAP URL search strings and access account
new Adaptive Server values.
installations
2 Set enable ldap user auth to 2.
3 Add users in the LDAP directory server using LDAP vendor-supplied
tools.
4 Add users to Adaptive Server using sp_addlogin. You can also use
sp_maplogin to automatically create login accounts upon authentication or
apply other login controls.
Migrating existing To avoid disruption of service in existing server installations, migrate Adaptive
Adaptive Servers to Server to LDAP:
LDAP
• Specify an LDAP URL search string to Adaptive Server.
• Set the configuration parameter enable ldap user auth to 1.
• Add users in the LDAP directory server.
• When all users are added to the LDAP server, set enable ldap user auth to
2 to require all authentications to be performed with LDAP, or use
sp_maplogin to override configuration parameters with login controls.
Composed DN If you use a simple LDAP server topology and schema, you can use a
examples composed DN algorithm for user authentication. If you use commercially
available schemas (for example, iPlanet Directory Servers or OpenLDAP
Directory Servers), users are created as objects in the same container in the
LDAP server tree, and Adaptive Server determines the user’s DN from the
object’s location. However, there are restrictions on the LDAP server’s
schema:
• You must specify the filter with the attribute name that uniquely identifies
the user to be authenticated.
• You must specify the filter with the attribute name=*. The asterisk is a
wildcard character. The appropriate attribute name to use in the filter
depends on the schema used by the LDAP server.
• The Adaptive Server login name is the same as the short user name for
example, a UNIX user name.
• The DN uses the short user name rather than a full name with embedded
spaces or punctuation. For example, jqpublic meets the restriction for a DN,
but “John Q. Public” does not.
iPlanet example LDAP vendors may use different object names, schema, and attributes than
those used in these examples. There are many possible LDAP URL search
strings, and valid sites may also extend schemas locally or use them in ways
that differ from each other:
• This example uses the uid=* filter. To compose the DN, Adaptive Server
replaces the wildcard with the Adaptive Server login name to be
authenticated, and appends the resulting filter to the node parameter in the
LDAP URL. The resulting DN is:
uid=myloginname,ou=People,dc=mycomany,dc=com
• After a successful bind operation, Adaptive Server uses the connection to
search for attribute names, such as uid, that are equal to the login name:
sp_ldapadmin set_primary_url,
'ldap://myhost:389/ou=People,dc=mycompany,dc=com??sub?uid=*'
• This example uses the schema defined in OpenLDAP 2.0.25, with an
attribute name of cn.
The composed DN is cn=myloginname,dc=mycompany,dc=com:
sp_ldapadmin set_primary_url,
'ldap://myhost:389/dc=mycompany,dc=com??sub?cn=*'
Searched DN Use the searched DN to use an Active Directory server or other LDAP server
examples environment that does not meet the restrictions to use the composed DN
algorithm.
• Perform these steps for an Active Directory server using a commercially
available user schema from a Windows 2000 Server.
a Set the access account information:
sp_ldapadmin set_access_acct,
'cn=Admin Account, cn=Users, dc=mycompany, dc=com',
'Admin Account secret password'
b Set the primary URL:
sp_ldapadmin set_primary_url, 'ldap://hostname:389/
c Set the DN lookup URL search string:
sp_ldapadmin set_dn_lookup_url,
'ldap://hostname:389/cn=Users,dc=mycompany,dc=com?distinguishedName
?one?samaccountname=*'
On Windows 2000, the short name is typically referred to as the “User Logon
Name” and is given the attribute name samaccountname in the default schema.
This is the attribute name used to match the Adaptive Server login name. The
DN for a user contains a full name with punctuation and embedded spaces (for
example, cn=John Q. Public, cn=Users, dc=mycomany, dc=com. The
DN on Windows does not use the short name, so the searched DN algorithm is
appropriate for sites using the Active Directory schema (the default) as the
LDAP server. The primary URL does not specify a search. Instead, it relies on
the bind operation for authentication.
Examples using You can use LDAP URL search strings to restrict access to groups of users on
search filters to LDAP servers. For example, to restrict logins to users in an accounting group.
restrict Adaptive
Server access use a compound filter to restrict access to the group of users where attribute
group=accounting.
• The following LDAP URL string uses the composed DN algorithm for an
iPlanet server:
sp_ldapadmin set_primary_url,
'ldap://myhost:389/ou=People,dc=mycompany,
dc=com??sub?(&(uid=*)(group=accounting))'
Adaptive Server binds with DN
uid=mylogin,ou=People,dc=mycompany,dc=com. After successfully
binding with this identity, it searches for:
"ou=People,dc=mycompany,dc=com??sub?(&(uid=mylogin)(group=accounting))"
Failover support
When a major failure occurs in the LDAP directory server specified by the
primary URL, and the server no longer responds to network requests, Adaptive
Server attempts to connect to the secondary LDAP directory server specified
by the secondary URL. Adaptive Server uses the LDAP function ldap_init to
determine if it can open a connection to the LDAP directory server. A null or
invalid primary URL string causes Adaptive Server to attempt to fail over to a
secondary URL. Failures returned by LDAP bind or search operations do not
cause Adaptive Server to fail over to the secondary URL.
Note Once Adaptive Server has failed over to the secondary LDAP server, a
database administrator must manually activate the primary LDAP server
before it can be used again.
• Access account DN
• Active [true | false]
• Status [ready | active | failed | suspended | reset]
Adaptive Server version 12.5.4 and later includes the following sp_ldapadmin
options that support secondary servers.
• To display DN lookup URLs for the secondary server, enter:
sp_ldapadmin list_urls
Table 16-9 shows the state transitions when you execute sp_ldapadmin
set_URL, where set_URL represents one of these commands:
• set_dn_lookup_url
• set_primary_url
• set_secondary_dn_lookup_url
• set_secondary_url
Table 16-10 shows the state transitions when you execute sp_ldapadmin
suspend.
Table 16-10: State transitions when sp_ldapadmin suspend is executed
Initial state Final state
INITIAL Error
RESET SUSPENDED
READY SUSPENDED
ACTIVE SUSPENDED
FAILED SUSPENDED
SUSPENDED SUSPENDED
Table 16-11 shows the state transitions when you execute sp_ldapadmin
activate.
The following tables show the LDAP server state transitions carried out
implicitly by Adaptive Server.
Table 16-12 shows the state transitions when Adaptive Server is restarted:
Table 16-14 shows the state transitions when an LDAP login fails:
Table 16-14: State transitions when an LDAP login fails
Initial state Final state
READY FAILED
ACTIVE FAILED
Use these sp_ldapadmin options to configure the LDAP server for better
performance:
• set_max_ldapua_desc – manages the concurrency of the LDAPUA
connection requests. If you are using a distinguished name algorithm,
setting set_max_ldapua_desc to a larger number expedites the LDAPUA
connections Adaptive Server is processing.
• set_num_retries – sets the number of attempts. Tune this number according
to the number of transient errors between Adaptive Server and the LDAP
server. You can nullify transient errors by configuring the number of
retries.
• set_log_interval – controls the number of messages sent to the Adaptive
Server error log for diagnostic purposes. Using a low number clutters the
error log may be helpful in identifying specific errors. Using a large
number sends fewer messages to the error log, but does not have the same
investigative value. Tune set_log_interval according to your error log size.
Only users with sso_role can create or modify login mappings using
sp_maplogin.
Example 2 Uses both PAM and LDAP to map users to application logins. A
company has adopted both PAM and LDAP authentication but for different
purposes. The company security policy defines LDAP as the authentication
mechanism for general user accounts, and PAM for special users, such as for a
middle-tier application. A middle-tier application may establish a pool of
connections to Adaptive Server to handle requests on behalf of users of the
middle-tier application.
Configure Adaptive Server for both LDAP and PAM user authentication:
sp_configure 'enable ldap user auth', 2
go
sp_configure 'enable pam user auth', 2
go
Establish an Adaptive Server login appX locally with permissions that are
appropriate for the middle-tier application:
sp_addlogin 'appX', password
go
sp_modifylogin appX, 'authenticate with', PAM
go
Instead of hard-coding a simple password in “appX” and maintaining the
password consistently in several different Adaptive Servers, develop a custom
PAM module to authenticate the application in a centralized repository using
additional facts to verify the middle-tier application.
Client application login “appY” requires LDAP authentication of the user with
its LDAP identity and password. Use sp_maplogin to map all LDAP
authenticated users to login “appY,”
sp_addlogin 'appY', password
go
sp_maplogin LDAP, NULL, 'appY'
go
Users of “appY” are authenticated with their company identity and password,
then mapped to a local Adaptive Server login “appY” to execute database
actions. Authentication has occurred with the identity of the LDAP user, which
is recorded in the audit trail, and executes with permissions appropriate to the
application login “appY.”
Note LDAP server connections do not have a connect timeout option; if the
LDAP server stops responding, all login connections also stop responding.
Examples
This example sets the LDAP failback time interval to 60 minutes:
sp_ldapadmin 'set_failback_interval' 60
This example sets the LDAP failback
time interval to the default, 15 minutes:
sp_ldapadmin 'set_failback_interval' -1
This example displays the value to which the failback interval is set:
sp_ldapadmin 'set_failback_interval'
The LDAP property 'set_failback_interval' is set to '15
minutes'.
user_ldappasswd
2 Adaptive Server has a one to one mapping for user_ldap to user_ase.
Authentication syslogins
Account management
Password management
Session management
LDAP Server
Authentication
PAM
Account management
Integrated
PAM API PAM SPI login, DCE
and so on
Custom
authentication
Adaptive Server passes the login name and credentials obtained from the login
packet to the PAM API. PAM loads a service provider module as specified in
the operating system configuration files and calls appropriate functions to
complete the authentication process.
Note PAM modules you create should comply with RFC 86.0 “Unified Login
With Pluggable Authentication Modules (PAM).” Adaptive Server supports
the authentication management module of the RFC. It does not support the
account management, session management, or password management
modules.
$ ls /usr/lib/security/sparcv9/pam_sec.so.1
pam_sec.so.1 -> /SYBASE/pam_sec_64bits.so.1
Forcing authentication
You can force a login to use a specific authentication process by using these
parameters for sp_modifylogin and sp_addlogin:
• ASE – use Adaptive Server internal authentication using passwords from
syslogins table.
1 LDAP.
2 Pluggable Authentication Modules (PAM). If both LDAP and PAM are
enabled, PAM authentication is never attempted for a user.
3 If neither PAM nor LDAP is enabled, Adaptive Server uses syslogins to
authenticate the login.
Login accounts such as “sa” continue to be validated using the syslogins
catalog. Only the SSO role can set authenticate for a login.
For example, the following authenticates the login with sp_modifylogin:
sp_modifylogin "nightlyjob", "authenticate with", "ASE"
sp_displaylogin "nightlyjob"
Displays output similar to:
Suid: 1234
Loginname: nightlyjob
Fullname: Batch Login
Default Database: master
. . .
Date of Last Password Change: Oct 2 2003 7:38 PM
Password expiration interval: 0
Password expired: N
Minimum password length:
Maximum failed logins: 0
Current failed login attempts:
Authenticate with: ASE
• action – indicates create login or drop. When you use create login, the login
is created as soon as is authenticated. Use drop to remove logins.
• login_name is an Adaptive Server login that already exists in syslogins.
This example maps external user “jsmith” to the Adaptive Server user “guest.”
Once authenticated, “jsmith” has the privileges of “guest.” The audit login
record shows both the client_username and the Adaptive Server user name:
sp_maplogin NULL, "jsmith", "guest"
This example tells Adaptive Server to create a new login for all external users
authenticated with LDAP, if a login does not already exist:
sp_maplogin LDAP, NULL, "create login"
For example, if Adaptive Server is enabled for LDAP user authentication with
failover (enable ldap user auth = 2) and user “Joe” is an external user with
authentication set to ANY, when Joe logs in, Adaptive Server attempts to
authenticate Joe, using LDAP user authentication. If Joe fails authentication as
a user in LDAP, Adaptive Server authenticates Joe using Adaptive Server
authentication, and if that succeeds, he logs in successfully.
@@authmech global has this value:
select @@authmech
----------------------------------
ase
If Adaptive Server is configured for strict LDAP user authentication (enable
ldap user auth = 2) and Joe is added as a valid user in LDAP, when Joe logs in,
the value for @@authmech is:
select @@authmech----------------------------------
ldap
Overview
Discretionary access controls (DACs) allow you to restrict access to
objects and commands based on a user’s identity, group membership and
active roles. The controls are “discretionary” because a user with a certain
access permission, such as an object owner, can choose whether to pass
that access permission on to other users.
Adaptive Server’s discretionary access control system recognizes the
following types of users:
• Users possessing one or more system defined roles: system
administrator, system security officer, operator, and other roles
• Database owners
• Database object owners
• Other users
System administrators operate outside the DAC system and have access
permissions on all database objects at all times except encryption keys (see
User Guide for Encrypted Columns). System security officers can always
access the audit trail tables in the sybsecurity database.
Database owners do not automatically receive permissions on objects owned
by other users; however, they can:
• Temporarily acquire all permissions of a user in the database by using the
setuser command to assume the identity of that user.
You can also use views and stored procedures as security mechanisms. See
“Using views and stored procedures as security mechanisms” on page 596.
This example makes “albert” the owner of the current database and drops
aliases of users who could act as the old “dbo:”
sp_changedbowner albert
Include the true parameter to transfer aliases and their permissions to the new
“dbo.”
Note You cannot change the ownership of the master, model, tempdb, or
sybsystemprocs databases and should not change the ownership of any other
system databases.
• dbcc
• alter database
• online database
• drop database
• dump database
• dump transaction
• load database
• load transaction
• setuser
Database owners can grant permission to use create database, set tracing,
and connect if they have the sa_role and are in the master database.
Database owners can grant permission to use set session authorization,
create trigger, and create encryption key if they have the sso_role.
• all – if you are the database owner, all grants permisions for all create
commands except create database, create trigger and create encryption key.
If you have the sa_role, all grants permissions for create database, set
tracing, and connect as well, if you issue the grant command in the master
database.
• default permissions on system tables
• Use dbcc commands:checkalloc, checkcatalog, checkdb, checkindex,
checkstorage, checktable, checkverify, fix_text, indexalloc, reindex,
tablealloc, textalloc, tune
Initially, object access permissions on new_authors belong only to Joe. Joe can
grant or revoke object access permissions for this table to other users.
The following object altering permissions default to the owner of a table and
cannot be transferred to other users:
• alter table
• drop table
• create index
Permission to use the grant and revoke commands to grant specific users select,
insert, update, delete, references, decrypt, truncate table, update statistics, delete
statistics, and execute permissions on specific database objects can be
transferred, using the grant with grant option command.
Permission to drop an object—a table, view, index, stored procedure, rule,
encryption key, trigger, or default—defaults to the object owner and cannot be
transferred.
Note insert, update statistics, delete statistics, truncate table, and delete
permissions do not apply to columns, so you cannot include them in a
permission list (or use the keyword all) if you specify a column list.
• permission_list is the list of permissions that you are granting. If you name
more than one permission, separate them with commas. Table 17-2
illustrates the access permissions that can be granted on each type of
object:
Table 17-2: Object access permissions
Object permission_list can include
Table or view select, insert, delete, update, references, truncate table, update statistics, decrypt, delete statistics
references applies to tables but not views; the other permissions apply to both tables and views.
update statistics, delete statistics, and truncate table apply to tables on, not views.
Column select, update, references
Stored procedure execute
Encryption key select
You can specify columns in the permission_list or the column_list, but not
both.
• on specifies the object for which the permission is being granted or
revoked. You can grant or revoke permissions for only one table, view,
encryption key, or stored procedure object at a time. You can grant or
revoke permissions for more than one column at a time, but all the
columns must be in the same table or view. You can grant or revoke
permissions only on objects in your current database.
• public refers to the group “public,” which includes all Adaptive Server
users. public means slightly different things for grant and revoke:
• For grant, public includes the object owner. Therefore, if you have
revoked permissions from yourself on your object, and later you grant
permissions to public, you regain the permissions along with the rest
of “public.”
• For revoke, public excludes the owner.
• name_list includes:
• Group names
• User names
• A combination of user and group names, each separated from the next
by a comma
• role_name is an Adaptive Server system-defined or user-defined role. You
can create and define a hierarchy of user-defined roles and grant them
privileges based on the specific role granted. System-defined roles include
sa_role (system administrator), sso_role (system security officer), and
oper_role (operator). You cannot create or modify system-defined roles.
• with grant option in a grant statement allows the users specified in name_list
to grant the specified object access permissions to other users. If a user has
with grant option permission on an object, that permission is not revoked
when permissions on the object are revoked from public or a group of
which the user is a member.
• grant option for revokes with grant option permissions, so that the users
specified in name_list can no longer grant the specified permissions to
other users. If those other users have granted permissions to other users,
you must use the cascade option to revoke permissions from them as well.
The user specified in name_list retains permission to access the object, but
can no longer grant access to other users. grant option for applies only to
object access permissions, not to object creation permissions.
• The cascade option in a revoke statement removes the specified object
access permissions from the user(s) specified in name_list, and also from
any users they granted those permissions to.
You may grant and revoke permissions only on objects in the current database.
If several users grant access to an object to a particular user, the user’s access
remains until access is revoked by all those who granted access or until a
system administrator revokes the access. That is, if a system administrator
revokes access, the user is denied access even though other users have granted
access.
Only a system security officer can grant or revoke permission to create
encryption keys. The database owner can create triggers on any user table.
Users can create triggers only on tables that they own.
Permission to issue the create trigger command is granted to users by default.
When the system security officer revokes permission for a user to create
triggers, a revoke row is added in the sysprotects table for that user. To grant
permission to that user to issue create trigger, issue two grant commands: the
first command removes the revoke row from sysprotects; the second inserts a
grant row. The system security officer must grant permission to create triggers.
If permission to create triggers is revoked, the user cannot create triggers even
on tables that the user owns. Revoking permission to create triggers from a user
affects only the database where the revoke command was issued.
Concrete identification
Adaptive Server identifies users during a session by login name. This
identification applies to all databases in the server. When the user creates an
object, the server associates both the owner’s database user ID (uid) and the
creator’s login name with the object in the sysobjects table. This information
concretely identifies the object as belonging to that user, which allows the
server to recognize when permissions on the object can be granted implicitly.
If an Adaptive Server user creates a table and then creates a procedure that
accesses the table, any user who is granted permission to execute the procedure
does not need permission to access the object directly. For example, by giving
user “mary” permission on proc1, she can see the id and descr columns from
table1, though she does not have explicit select permission on the table:
create table table1 (id int,
amount money,
descr varchar(100))
create procedure proc1 as select id, descr from table1
grant execute on proc1 to mary
There are, however, some cases where implicit permissions are only useful if
the objects can be concretely identified. One case is where aliases and
cross-database object access are both involved.
Granting and revoking permissions for update statistics, delete statistics, and
truncate table
Adaptive Server allows you to grant and revoke permissions for users, roles,
and groups for the update statistics, delete statistics, and truncate table
commands. Table owners can also provide permissions through an implicit
grant by adding update statistics, delete statistics, and truncate table to a stored
procedure and then granting execute permissions on that procedure to a user or
role.
You cannot grant or revoke permissions for update statistics at the column
level. You must have the sso_role to run update statistics or delete statistics on
sysroles, syssrvroles, and sysloginroles security tables.
By default, users with the sa_role have permission to run update statistics and
delete statistics on system tables other than sysroles, syssrvroles and
sysloginroles, and can transfer this privilege to other users.
For example, the following allows user “harry” to use truncate table and
updates statistics on the authors table:
grant truncate table on authors to harry
grant update statistics on authors to harry
The following revokes truncate table and update statistics privileges from
“harry” on the authors table:
revoke truncate table on authors from harry
revoke update statistics on authors from harry
The following allows user “billy” to use the delete statistics command on the
authors table:
Note Once you grant permission to execute update statistics to a user, they also
have permission to execute variations of this command, such as update all
statistics, update partition statistics, update index statistics, update statistics table,
and so on. For example, the following grants “billy” permission to run all
variations of update statistics on the authors table:
grant update statistics on authors to billy
If you revoke a user’s permission to execute update statistics, you also revoke
their ability to execute the variations of this command.
You cannot grant variants of update statistics (for example, update index
statistics) separately. That is, you cannot issue:
grant update all statistics to harry
However, you can write stored procedures that control who executes these
commands. For example, the following grants “billy” execute permission for
update index statistics on the authors table:
• create database
• create default
• create procedure
• create rule
• create table
• create view
The syntax for command permissions differs slightly from the syntax for object
access permissions. The syntax for grant is:
grant {all [privileges] | command_list}
to {public | name_list | role_name}
The syntax for revoke is:
revoke {all [privileges] | command_list}
from {public | name_list | role_name}
where:
• all or all privileges – can be used only by a system administrator or the
database owner. When used by a system administrator in the master
database, grant all assigns all create permissions, including create database
(except create encryption key and create trigger). If the system
administrator executes grant all from another database, all create
permissions are granted except create database, create trigger and create
encryption key. When the database owner uses grant all, Adaptive Server
grants all create permissions except create database, create trigger, and
create encryption key, and prints an informational message.
• public – is all users except the database owner (who “owns” object creation
permissions within the database).
• name_list – is a list of user or group names, separated by commas.
• role_name – is the name of an Adaptive Server system or user-defined
role. You can create and define a hierarchy of user-defined roles and grant
them privileges based on the specific role granted.
Since roles are automatically added as users in a database on their first grant in
a database, there are no additional requirements when roles are granted dbcc
privileges. Logins must be valid users in the database where permissions are
granted. Valid users include “guest.”
For server-wide dbcc commands, the login must be a valid user in master, and
the system administrator must be in master when granting the permission.
For database-specific dbcc commands the login should be a valid user in the
target database.
sp_helprotect syssrvroles
go
The default situation is that no users—including database owners—can modify
the system tables directly. Instead, the T-SQL commands and the system
procedures supplied with Adaptive Server modify the system tables. This helps
guarantee integrity.
Note Under SQL rules, you must use the grant command before using the
revoke command, but the two commands cannot be used within the same
transaction. Therefore, when you grant “public” access to objects, and then
revoke that access from an individual, there is a short period of time during
which the individual has access to the objects in question. To prevent this
situation, use the create schema command to include the grant and revoke
clauses within one transaction.
Granting roles
To grant roles to users or other roles, use:
grant role role_granted [{, role_granted}...]
to grantee [{, grantee}...]
where:
• role_granted – is the role being granted. You can specify any number of
roles to be granted.
• grantee – is the name of the user or role. You can specify any number of
grantees.
All roles listed in the grant statement are granted to all grantees. If you grant
one role to another, it creates a role hierarchy.
For example, to grant Susan, Mary, and John the “financial_analyst” and the
“payroll_specialist” roles, enter:
grant role financial_analyst, payroll_specialist
to susan, mary, john
Revoking roles
Use revoke role to revoke roles from users and other roles:
revoke role role_name [{, role_name}...]from grantee [{, grantee}...]
where:
• role_name – is the role being revoked. You can specify any number of
roles to be revoked.
• grantee – is the name of the user or role. You can specify any number of
grantees.
All roles listed in the revoke statement are revoked from all grantees.
You cannot revoke a role from a user while the user is logged in.
Using setuser
A database owner may use setuser to:
• Access an object owned by another user
• Grant permissions on an object owned by another user
• Create an object that will be owned by another user
• Temporarily assume the DAC permissions of another user for some other
reason
A user executing set proxy or set session authorization operates with both the
login name and server user ID of the user being impersonated. The login name
is stored in the name column of master..syslogins and the server user ID is
stored in the suid column of master..syslogins. These values are active across
the entire server in all databases.
Note set proxy and set session authorization are identical in function and can
be used interchangeably. The only difference between them is that set session
authorization is ANSI-SQL92-compatible, and set proxy is a Transact-SQL
extension.
After setting proxy, check your login name in the server and your user name in
the database. For example, assume that your login is “ralph” and that you have
been granted set proxy authorization. You want to execute some commands as
“sallyn” and as “rudolph” in pubs2 database. “sallyn” has a valid name
(“sally”) in the database, but Ralph and Rudolph do not. However, pubs2 has a
“guest” user defined. You can execute:
set proxy "sallyn"
go
use pubs2
go
select suser_name(), user_name()
go
------------------------------ -------------------
sallyn sally
To change to Rudolph, you must first change back to your own identity. To do
so, execute:
set proxy "ralph"
select suser_name(), user_name()
go
------------------------------ --------------------
ralph guest
Notice that Ralph is a “guest” in the database.
Then execute:
set proxy "rudolph"
go
select suser_name(), user_name()
go
------------------------------ --------------------
rudolph guest
Rudolph is also a guest in the database because Rudolph is not a valid user in
the database.
Now, impersonate the “sa” account. Execute:
set proxy "ralph"
go
set proxy "sa"
go
select suser_name(), user_name()
go
--------------------------- --------------------
sa dbo
Tom, Sue, and John establish sessions The application server (“appl”) on
with the Application Server: Adaptive Server executes:
Tom Sue John
set proxy "tom"
Application Server (SQL command for Tom)
logs in as “appl”
with set proxy set proxy "sue"
permission. (SQL command for Sue)
Reporting on permissions
Table 17-5 lists the system procedures for reporting information about proxies,
object creation, and object access permissions:
To determine the permissions Judy now has on each column in the titles table,
enter:
sp_helprotect titles, judy
grantor grantee type action object column grantable
------- ------ ----- ------ ------ ------ -------
dbo judy Grant Select titles All FALSE
dbo judy Grant Update titles advance FALSE
dbo judy Grant Update titles notes FALSE
dbo judy Grant Update titles price FALSE
dbo judy Grant Update titles pub_id FALSE
dbo judy Grant Update titles pubdate FALSE
dbo judy Grant Update titles title FALSE
dbo judy Grant Update titles title_id FALSE
dbo judy Grant Update titles total_sales FALSE
dbo judy Grant Update titles type FALSE
The first row shows that the database owner (“dbo”) gave Judy permission to
select all columns of the titles table. The rest of the lines indicate that she can
update only the columns listed in the display. Judy cannot give select or update
permissions to any other user.
To see Judy’s permissions on the publishers table, enter:
sp_helprotect publishers, judy
In this display, the grantable column indicates TRUE, meaning that Judy can
grant the permission to other users.
grantor grantee type action object column grantable
------- ------ ----- ------ ------ ------ -------
dbo judy Grant Select publishers all TRUE
• The rows that qualify for a join of more than one base table. For example,
you might define a view that joins the titles, authors, and titleauthor tables.
This view hides personal data about authors and financial information
about the books.
• A statistical summary of data in a base table. For example, you might
define a view that contains only the average price of each type of book.
• A subset of another view, or of some combination of views and base tables.
Let’s say you want to prevent some users from accessing the columns in the
titles table that display money and sales amounts. You can create a view of the
titles table that omits those columns, and then give all users permission on the
view but only the Sales Department permission on the table:
grant all on bookview to public
grant all on titles to sales
An equivalent way of setting up these privilege conditions, without using a
view, is to use the following statements:
grant all on titles to public
revoke select, update on titles (price, advance,
total_sales)
from public
grant select, update on titles (price, advance,
total_sales)
to sales
One possible problem with the second solution is that users not in the sales
group who enter the select * from titles command might be surprised to see the
message that includes the phrase:
permission denied
Adaptive Server expands the asterisk into a list of all the columns in the titles
table, and since permission on some of these columns has been revoked from
nonsales users, access to these columns is denied. The error message lists the
columns for which the user does not have access.
To see all the columns for which they do have permission, the nonsales users
must name them explicitly. For this reason, creating a view and granting the
appropriate permissions on it is a better solution.
You can also use views for context-sensitive protection. For example, you can
create a view that gives a data entry clerk permission to access only those rows
that he or she has added or updated. To do so, add a column to a table in which
the user ID of the user entering each row is automatically recorded with a
default. You can define this default in the create table statement, like this:
However, if all objects are not owned by the same user, Adaptive Server checks
object permissions when the ownership chain is broken. That is, if object A
references object B, and B is not owned by the user who owns object A,
Adaptive Server checks the permissions for object B. In this way, Adaptive
Server allows the owner of the original data to retain control over who is
authorized to access it.
Ordinarily, a user who creates a view needs to worry only about granting
permissions on that view. For example, say Mary has created a view called
auview1 on the authors table, which she also owns. If Mary grants select
permission to Sue on auview1, Adaptive Server allows Sue to access it without
checking permissions on authors.
However, a user who creates a view or stored procedure that depends on an
object owned by another user must be aware that any permissions he or she
grants depend on the permissions allowed by those other owners.
Adaptive Server checks the permissions on auview2 and auview1, and finds that
Sue can use them. Adaptive Server checks ownership on auview1 and authors
and finds that they have the same owner. Therefore, Sue can use auview2.
Taking this example a step further, suppose that Joe’s view, auview2, depends
on auview1, which depends on authors. Mary decides she likes Joe’s auview2
and creates auview3 on top of it. Both auview1 and authors are owned by Mary.
The ownership chain looks like this:
Figure 17-3: Ownership chains and permission checking for views,
case 2
To execute proc4, Sue must have permission to execute proc4, proc2, and proc1.
Permission to execute proc3 is not necessary because proc3 and proc4 have the
same owner.
Adaptive Server checks Sue’s permissions on proc4 and all objects it references
each time she executes proc4. Adaptive Server knows which referenced objects
to check: it determined this the first time Sue executed proc4, and it saved the
information with the procedure’s execution plan. Unless one of the objects
referenced by the procedure is dropped or redefined, Adaptive Server does not
change its initial decision about which objects to check.
This protection hierarchy allows every object’s owner to fully control access to
the object. Owners can control access to views and stored procedures, as well
as to tables.
Permissions on triggers
A trigger is a special kind of stored procedure used to enforce integrity,
especially referential integrity. Triggers are never executed directly, but only as
a side effect of modifying a table. You cannot grant or revoke permissions for
triggers.
Only an object owner can create a trigger. However, the ownership chain can
be broken if a trigger on a table references objects owned by different users.
The protection hierarchy rules that apply to procedures also apply to triggers.
While the objects that a trigger affects are usually owned by the user who owns
the trigger, you can write a trigger that modifies an object owned by another
user. If this is the case, any users modifying your object in a way that activates
the trigger must have permission on the other object as well.
If Adaptive Server denies permission on a data modification command because
a trigger affects an object for which the user does not have permission, the
entire data modification transaction is rolled back.
See Chapter 19, “Triggers: Enforcing Referential Integrity,” in the
Transact-SQL User’s Guide.
Adaptive Server enforces row-level access control for all data manipulation
languages (DMLs), preventing users from bypassing the access control to get
to the data.
The syntax for configuring your system for row-level access control is:
sp_configure "enable row level access", 1
This option slightly increases the amount of memory Adaptive Server uses, and
you need an ASE_RLAC license option. Row-level access control is a dynamic
option, so you need not restart Adaptive Server.
Access rules
To use the row-level access control feature, add the access option to the
existing create rule syntax. Access rules restrict any rows that can be viewed or
modified.
Access rules are similar to domain rules, which allow table owners to control
the values users can insert or update on a column. The domain rule applies
restrictions to added data, functioning on update and insert commands.
Access rules apply restrictions to retrieved data, enforced on select, update, and
delete operations. Adaptive Server enforces the access rules on all columns that
are read by a query, even if the columns are not included in the select list. In
other words, in a given query, Adaptive Server enforces the domain rule on the
table that is updated, and the access rule on all tables that are read.
For example:
insert into orders_table
select * from old_orders_table
In this query, if there are domain rules on the orders_table and access rules on
the old_orders_table, Adaptive Server enforces the domain rule on the
orders_table, because it is updated, and the access rule on the old_orders_table,
because it is read.
Using access rules is similar to using views, or using an ad hoc query with
where clauses. The query is compiled and optimized after the access rules are
attached, so it does not cause performance degradation. Access rules provide a
virtual view of the table data, the view depending on the specific access rules
bound to the columns.
Adaptive Server processes the access rule that is bound to the username
column on table T and attaches it to the query tree. The tree is then optimized
and an execution plan is generated and executed, as though the user had
executed the query with the filter clause given in the access rule. In other
words, Adaptive Server attaches the access rule and executes the query as:
select * from T where T.username = suser_name().
The condition where T.username = suser_name() is enforced by the
server. The user cannot bypass the access rule.
The result of an Administrative Assistant executing the select query is:
AA, "Administrative Assistant","Memo to President"
AA, "Administrative Assistant","Tracking Stock
Movements"
Dropping an access Before you drop an access rule, you must unbind it from any columns or
rule datatypes, using sp_unbindrule, as in the following example:
sp_unbindrule "T.username",
NULL, "all"
sp_unbindrule unbinds any domain rules attached to the column by default.
You can bind AND access rules and OR access rules to a column or user-defined
datatype. With the extended access rule syntax, you can bind multiple access
rules to the table, although you can bind only one per column. When the table
is accessed, the access rules go into effect, the AND rules bound first by default,
and then the OR access rules.
If you bind multiple access rules to a table without defining AND or OR access,
the default access rule is AND.
If there is only one access rule on a row of the table and it is defined as an OR
access rule, it behaves as an AND access rule.
sp_bindrule phone_access,"testtab1.phone"
/*Rule bound to table column.*/
(return status = 0)
Insert data into table The following steps insert values into the test table:
insert testtab1 values (1,1,"smith","3245")
(1 row affected)
insert testtab1 values(2,1,"jones","0283")
(1 row affected)
insert testtab1 values(1,2,"smith","8282")(1 row
affected)
insert testtab1 values(2,2,"smith","9999")
(1 row affected)
(2 rows affected)
/* unbind access rule from specific column */
sp_unbindrule "testtab1.empno",NULL,"accessrule"
/*Rule unbound from table column.*/
(return status = 0)
Example 2 This example returns information from four rows:
(4 rows affected)
pstmt = null;
Class.forName("sybase.asejdbc.ASEDriver");
con = DriverManager.getConnection(_url);
if (con == null)
{
return (-1);
}
if (pstmt == null)
{
return (-1);
}
pstmt.setInt(1, c1);
rs = pstmt.executeQuery();
rs.next();
pno_val = rs.getInt(1);
rs.close();
pstmt.close();
con.close();
return (pno_val);
}
catch (SQLException sqe)
{
return(sqe.getErrorCode());
}
catch (ClassNotFoundException e)
{
return (-1);
}
catch (Exception e)
{
System.out.println("Unexpected exception : " +
e.toString());
e.printStackTrace();
return (-1);
}
}
}
After compiling the Java code, you can run the same program from isql, as
follows.
For example:
javac sec_class.java
jar cufo sec_class. jar sec_class.class
installjava -Usa -Password -
f/work/work/FGAC/sec_class.jar -
-D testdb
From isql:
/*to create new user datatype class_level*/
sp_addtype class_level, int
/*to create the sample secure data table*/
create table sec_data (c1 varchar(30),
c2 varchar(30),
c3 varchar(30),
clevel class_level)
/*to create the classification table for each user*/
create table sec_tab (userid int, clevel class-level
int)
The attributes that enable this coding comprise an application context. The
Application Context Facility (ACF) consists of three built-in functions that
provide a secure environment for data access, by allowing access rules to
compare against the intrinsic values assigned to users in a session.
An application context consists of context_name, attribute_name, and
attribute_value. Users define the context name, the attributes, and the values for
each context. You can use the default read-only application context that Sybase
provides, SYS_SESSION, to access some session-specific information. This
application context is shown as Table 17-6 on page 621. You can also create
your own application contexts, as described in “Creating and using application
contexts” on page 616.
The user profile, combined with the application profile, which is defined in a
table created by the system administrator, permits cumulative and overlapping
security schemes.
ACF allows users to define, store, and retrieve:
• User profiles (the roles authorized to a user and the groups to which the
user belongs)
• Application profiles currently in use
Any number of application contexts per session are possible, and any context
can define any number of attribute/value pairs. ACF context rows are specific
to a session, and not persistent across sessions; however, unlike local variables,
they are available across nested levels of statement execution. ACF provides
built-in functions that set, get, list, and remove these context rows.
• get_appcontext
• list_appcontext
• rm_appcontext
set_appcontext
Sets an application context name, attribute name, and attribute value, defined
by the attributes of an application, for a specified user session.
set_appcontext ("context_name", "attribute_name", "attribute_value")
• context_name – a row that specifies an application context name, saved as
the datatype char(30).
• attribute_name – a row that specifies an application context name, saved
as the datatype char(30)
• attribute_value – a row that specifies an application attribute value, saved
as the datatype char(255).
Examples
This example creates an application context called CONTEXT1, with an
attribute ATTR1 that has the value VALUE1:
select set_appcontext ("CONTEXT1", "ATTR1", "VALUE1")
---------------
0
This example shows an attempt to override the existing application context.
The attempt fails, returning -1:
select set_appcontext("CONTEXT1", "ATTR1", "VALUE1")
--------------
-1
This example shows how set_appcontext can include a datatype conversion in
the value:
declare@val numeric
select @val = 20
Usage
• set_appcontext returns 0 for success and -1 for failure.
• If you set values that already exist in the current session, set_appcontext
returns -1.
• set_appcontext cannot override the values of an existing application
context. To assign new values to a context, remove the context and re-
create it using the new values.
• set_appcontext saves attributes as char datatypes. If you create an access
rule that must compare the attribute value to another datatype, the rule
should convert the char data to the appropriate datatype.
• All arguments in this function are required.
get_appcontext
Returns the value of the attribute in a specified context.
get_appcontext ("context_name", "attribute_name")
• context_name – a row specifying an application context name, saved as
datatype char(30).
• attribute_name – a row specifying an application context attribute name,
saved as datatype char(30).
Examples
This example shows VALUE1 returned for ATTR1:
select get_appcontext ("CONTEXT1", "ATTR1")
-----------
VALUE1
Usage
• get_appcontext returns 0 for success and -1 for failure.
• If the attribute you require does not exist in the application context,
get_appcontext returns “null.”
list_appcontext
Lists all the attributes of all the contexts in the current session.
list_appcontext ("context_name")
• context_name – names all the application context attributes in the session.
list_appcontext has a datatype of char(30).
Examples
To use list_appcontext, the user must have appropriate permissions. For more
information, see “Setting permissions for using application context functions”
on page 614.
This example shows the results of a user with appropriate permissions listing
the application contexts:
select list_appcontext ("*", "*")
Context Name: (CONTEXT1)
Attribute Name: (ATTR1) Value: (VALUE2)
Usage
• list_appcontext returns 0 for success and -1 for failure.
• Since built-in functions do not return multiple result sets, the client
application receives list_appcontext returns as messages.
rm_appcontext
Removes a specific application context, or all application contexts.
rm_appcontext ("context_name", "attribute_name")
• context_name – a row specifying an application context name, saved as
datatype char(30).
• attribute_name – a row specifying an application context attribute name,
saved as datatype char(30).
Examples
The following three examples show how to remove an application context by
specifying some or all attributes. Use an asterisk ("*") to remove all attributes
in the specified context.
select rm_appcontext("CONTEXT1", "*")
---------
0
Use an asterisk ("*") to remove all the contexts and attributes.
select rm_appcontext("*", "*")
---------
0
Usage
• rm_appcontext returns 0 for success, -1 for failure.
Note Some information in this section is from the article “Login Triggers in
ASE 12.5”. Copyright 1998–2002, Rob Verschoor/ Sypron B.V., at
http://www.sypron.nl/logtrig.html.
Login triggers execute a specified stored procedure every time a user logs in.
The login trigger is an ordinary stored procedure, except it executes in the
background. It is the last step in a successful login process, and sets the
application context for the user logging in.
Only the system security officer can register a login trigger to users in the
server.
To provide a secure environment, the system administrator must:
1 Revoke select privilege on the set_appcontext function. The owner of a
login trigger must have explicit permission to use set_appcontext, even if
the owner has sa_role.
2 Configure a login trigger from a stored procedure for each user, and
register the login trigger to the user.
3 Provide execute privilege to the login trigger that the user executes.
While (@@sqlstatus = 0)
begin
select f@retval =
set_appcontext (rtrim (@appname),
rtrim(@attr), rtrim(@value))
fetch apctx into @appname, @attr, @value
end
go
dayofweek tinyint,
shiftstart time,
shiftend time)
2 As system administrator, insert the following rows in table access_times.
These rows indicate that user “bob” is allowed to log into Adaptive Server
on Mondays between 9:00am and 5:00pm, and user “mark” is allowed to
login to Adaptive Server on Tuesdays between 9:00Am and 5:00PM
insert into access_times
select suser_id(‘bob’), 1, ‘9:00’, ‘17:00’
go
insert into access_times
select suser_id(‘mark’), 2, ‘9:00’, ‘17:00’
go
3 As system administrator, create the limit_access_time stored procedure,
which references the access_time table to determine if login access should
be granted:
create procedure limit_access_time as
declare @curdate date,
@curdow tinyint,
@curtime time,
@cnt int,
@loginname varchar(32)
if @cnt = 0
begin
select @loginname = suser_name()
print "Aborting login [%1!]: login attempt past
normal working hours", @loginname
end
go
For example, dividing by zero aborts the login trigger stored procedure,
terminates the session, and causes a message to appear.
Note If the login trigger returns a minus number, the login fails.
• arithignore [overflow]
• colnames
• format
• statistics io
• procid
• rowcount
• altnames
• nocount
• quoted_identifier
• forceplan
• fmtonly
• close on endtran
• fipsflagger
• self_recursion
• ansinull
• dup_in_subquery
• or_strategy
• flushmessage
• ansi_permissions
• string_rtruncation
• prefetch
• triggers
• replication
• sort_resources
• transactional_rpc
• cis_rpc_handling
• strict_dtm_enforcement
• raw_object_serialization
• textptr_parameters
• remote_indexes
• explicit_transaction_required
• statement_cache
• command_status_reporting
• proc_return_status
• proc_output_params
Note You can activate this option by setting trace flag -T4073.
Figure 18-1 shows how the auditing process works with multiple audit tables.
User processes
Audit queue
Audit process
pool of empty audit tables currently active audit tables pool of full audit tables
Archive
The auditing system writes audit records from the in-memory audit queue to
the current audit table. When the current audit table is nearly full, a threshold
procedure can automatically archive the table to another database. The archive
database can be backed up and restored with the dump and load commands. Use
archive database access for read-only access to archived audit tables from
backup. See Chapter 14, “Archive Database Access,” in the System
Administration Guide, Volume 2. For more information about managing the
audit trail, see “Setting up audit trail management” on page 644.
Before you configure the size of the audit queue, consider the trade-off
between the risk of losing records in the queue if the system crashes and the
loss of performance when the queue is full. As long as an audit record is in the
queue, it can be lost if the system crashes. However, if the queue repeatedly
becomes full, overall system performance is affected. If the audit queue is full
when a user process tries to generate an audit record, the process sleeps until
space in the queue becomes available.
Note Because audit records are not written directly to the audit trail, you
cannot count on an audit record’s being stored immediately in the current audit
table.
Note This example assumes a server that uses a logical page size of 2K.
physname = "/dev/dsk/c2d0s5",
size = "2M"
create database sybsecurity on auditdev
log on auditlogdev
2 Use isql to execute the installsecurity script:
cd $SYBASE/ASE-12_5/scripts
setenv DSQUERY server_name
isql -Usa -Ppassword -Sserver_name < installsecurity
3 Shut down and restart Adaptive Server.
When you have completed these steps, the sybsecurity database has one audit
table (sysaudits_01) created on its own segment. You can enable auditing at this
time, but should add more auditing tables with sp_addaudittable. For
information about disk init, create database, and sp_addaudittable, see the
Reference Manual: Procedures.
Note These steps include dropping the sybsecurity database, which destroys all
audit records and global audit settings previously recorded in sybsecurity.
Before you drop the sybsecurity database, make sure you archive existing
records with a backup or by following instructions in “Archiving the audit
table” on page 645 to avoid losing any historical data that remains in the
sybsecurity tables.
To move the sybsecurity database without saving the global audit settings:
1 Execute the following to remove any information related to logins from
the syslogins system table:
sp_audit "all","all","all","off"
❖ To move the sybsecurity database and save the global audit settings
1 Dump the sybsecurity database:
dump database sybsecurity to "/remote/sec_file"
2 Drop the sybsecurity database:
drop database sybsecurity
3 Initialize the first device on which you want to place the sybsecurity
database:
disk init name = "auditdev",
physname = "/dev/dsk/c2d0s4",
size = "10M"
4 Initialize the device where you want to place the security log:
disk init name = "auditlogdev",
physname = "/dev/dsk/c2d0s5",
size = "2M"
5 Create the new sybsecurity database:
create database sybsecurity on auditdev
log on auditlogdev
6 Load the contents of the old sybsecurity database into the new database.
The global audit settings are preserved:
load database sybsecurity from "/remote/sec_file"
7 Run online database, which upgrades sysaudits and sysauditoptions if
necessary:
online database sybsecurity
• Archive the audit table that is almost full using the insert...select command.
Note If Adaptive Server truncates the current audit table and you have not
archived the data, the table’s audit records are lost. Archive the audit data
before you use the with truncate option.
To execute sp_configure to change the current audit table, you must have the
sso_role active. You can write a threshold procedure to automatically change
the current audit table.
begin
insert aud_db.sso_user.sysaudits
select * from sysaudits_01
truncate table sysaudits_01
end
else if @audit_table_number = 2
begin
insert aud_db.sso_user.sysaudits
select * from sysaudits_02
truncate table sysaudits_02
end
return(0)
• suspend audit when device full determines what Adaptive Server does if the
current audit table becomes completely full. The full condition occurs only
if the threshold procedure attached to the current table segment is not
functioning properly.
If the trunc log on chkpt database option is active, Adaptive Server truncates
syslogs every time it performs an automatic checkpoint. After auditing is
installed, the value of trunc log on chkpt is on, but you can use sp_dboption to
change its value.
Adaptive Server does not supply a default procedure, but Chapter 16,
“Managing Free Space with Thresholds,” in System Administration Guide:
Volume 2 contains examples of last-chance threshold procedures. The
procedure should execute the dump transaction command, which truncates the
log. When the transaction log reaches the last-chance threshold point, any
transaction that is running is suspended until space is available. The suspension
occurs because the option abort xact when log is full is always set to false for the
sybsecurity database. You cannot change this option.
With the trunc log on chkpt option disable, you can use standard backup and
recovery procedures for the sybsecurity database, but be aware that the audit
tables in the restored database may not be in sync with their status during a
device failure.
• 0 – disables auditing.
Single-table auditing
Sybase strongly recommends that you not use single-device auditing for
production systems. If you use only a single audit table, you create a window
of time while you are archiving audit data and truncating the audit table during
which incoming audit records are lost. There is no way to avoid this when using
only a single audit table.
If you use only a single audit table, your audit table is likely to fill up. The
consequences of this depend on how you have set suspend audit when device
full. If you have suspend audit when device full set to on, the audit process is
suspended, as are all user processes that cause auditable events. If suspend
audit when device full is off, the audit table is truncated, and you lose all the
audit records that were in the audit table.
For non-production systems, where the loss of a small number of audit records
may be acceptable, you can use a single table for auditing, if you cannot spare
the additional disk space for multiple audit tables, or you do not have additional
devices to use.
The procedure for using a single audit table is similar to using multiple audit
tables, with these exceptions:
• During installation, you specify only one system table to use for auditing.
• During installation, you specify only one device for the audit system table.
• The threshold procedure you create for archiving audit records is different
from the one you would create if you were using multiple audit tables.
Figure 18-2 shows how the auditing process works with a single audit table.
User processes
Audit queue
Audit process
threshold procedure
Archive
audit table
• Truncate the audit table to create space for new audit records, using the
truncate table command.
Before you can archive your audit records, create an archive table that has the
same columns as your audit table. After you have done this, your threshold
procedure can use insert with select to copy the audit records into the archive
table.
Here is a sample threshold procedure for use with a single audit table:
create procedure audit_thresh as
/*
** copy the audit records from the audit table to
** the archive table
*/
insert aud_db.sso_user.audit_data
select * from sysaudits_01
return(0)
go
/*
** truncate the audit table to make room for new
** audit records
*/
truncate table “sysaudits_01”
go
After you have created your threshold procedure, you will need to attach the
procedure to the audit table segment. For instructions, see “Attaching the
threshold procedure to each audit segment” on page 647.
Warning! On a multiprocessor, the audit table may fill up even if you have a
threshold procedure that triggers before the audit table is full. For example, if
the threshold procedure is running on a heavily loaded CPU, and a user process
performing auditable events is running on a less heavily loaded CPU, the audit
table may fill up before the threshold procedure triggers. The configuration
parameter suspend audit when device full determines what happens when the
audit table fills up. For information about setting this parameter, see
“Suspending auditing if devices are full” on page 650.
Restarting auditing
If the audit process is forced to terminate due to an error, sp_audit can be
manually restarted by entering:
sp_audit restart
The audit process can be restarted provided that no audit was currently running,
but the audit process must be enabled with sp_configure “auditing” 1.
Note Auditing does not occur until you activate auditing for the server. For
information on how to start auditing, see “Enabling and disabling auditing” on
page 652.
• Global options apply to commands that affect the entire server, such as
booting the server, disk commands, and allowing ad hoc, user-defined
audit records. Option settings for global events are stored in the
sybsecurity..sysauditoptions system table.
• Valid values for the option and the type of each option – global, database-
specific, object-specific, or user-specific
• Valid values for the login_name and object_name parameters for each
option
• The database to be in when you set the auditing option
• The command or access that is audited when you set the option
• An example for each option
The default value for all options is off.
Table 18-2: Auditing options, requirements, and examples
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
adhoc all all Any Allows users to use sp_addauditrecord
(user-specific) Example: sp_audit "adhoc", "all", "all", "on"
(Enables ad hoc user-defined auditing records.)
all A login name all Any All actions of a particular user or by
(user-specific) or role users with a particular role active
Example sp_audit "all", "sa_role", "all", "on"
(Turns auditing on for all actions in which the sa_role is active.)
alter all Database to be Any alter database, alter table
(database-specific) audited
Example sp_audit @option = "alter", @login_name = "all",
@object_name = "master", @setting = "on"
(Turns auditing on for all executions of alter database and alter table in the master database.)
bcp all Database to be Any bcp in
(database-specific) audited
Example sp_audit "bcp", "all", "pubs2"
(Returns the status of bcp auditing in the pubs2 database. If you do not specify a value for
setting, Adaptive Server returns the status of auditing for the option you specify)
bind all Database to be Any sp_bindefault, sp_bindmsg, sp_bindrule
(database-specific) audited
Example sp_audit "bind", "all", "planning", "off"
(Turns bind auditing off for the planning database.)
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
cmdtext Login name all Any SQL text entered by a user.
(user-specific) of the user to (Does not reflect whether or not the text
be audited in question passed permission checks or
not. eventmod always has a value of 1.)
Example sp_audit "cmdtext", "sa", "all", "off"
(Turns text auditing off for database owners.)
create all Database to be Any create database, create table, create
(database-specific) audited procedure, create trigger, create rule,
create default, sp_addmessage, create
view, create index, create function
Note Specify master for object_name to audit create database. You are also auditing the
creation of other objects in master.
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
drop all Database to be Any drop database, drop table, drop
(database-specific) audited procedure, drop index, drop trigger, drop
rule, drop default, sp_dropmessage,
drop view, drop function
Example sp_audit "drop", "all", "financial", "fail"
(Audits all drop commands in the financial database that fail permission checks.)
dump all Database to be Any dump database, dump transaction
(database-specific) audited
Example sp_audit "dump", "all", "pubs2", "on"
(Audits dump commands in the pubs2 database.)
encryption_key all Database to be Any alter encryption key
(database-specific) audited create encryption key
drop encryption key
sp_encryption
Example Audits all the above commands in the pubs2 database:
sp_audit "encryption_key", "all", "pubs2", "on"
errors all all Any Fatal error, non-fatal error
(global) Example sp_audit "errors", "all", "all", "on"
(Audits errors throughout the server.)
errorlog all all Any sp_errorlog or the errorlog_admin
function
Example sp_audit "errorlog", "all", "all", "on"
(Audits attempts to "change log" to move to a new Adaptive Server error log file.)
exec_procedure all Name of the The database of execute
(object-specific) procedure to be the procedure
audited or (except tempdb)
default
procedure
Example sp_audit "exec_procedure", "all", "default procedure", "off"
(Turns automatic auditing off for new procedures in the current database.)
exec_trigger all Name of the The database of Any command that fires the trigger
(object-specific) trigger to be the trigger
audited or (except tempdb)
default trigger
Example sp_audit "exec_trigger", "all", "trig_fix_plan", "fail"
(Audits all failed executions of the trig_fix_plan trigger in the current database.)
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
func_dbaccess all Name of the Any Access to the database using the
(database-specific) database you following functions:
are auditing curunreserved_pgs, db_name, db_id,
lct_admin, setdbrepstat, setrepstatus,
setrepdefmode, is_repagent_enabled,
rep_agent_config, rep_agent_admin
Example sp_audit @option="func_dbaccess", @login_name="all",
@object_name = "strategy", @setting = "on"
(Audits accesses to the strategy database via built-in functions.)
func_obj_access all Name of any Any Access to an object using the following
(object-specific) object that has functions: schema_inc, col_length,
an entry in col_name, data_pgs, index_col,
sysobjects object_id, object_name, reserved_pgs,
rowcnt, used_pgs, has_subquery
Example sp_audit @option="func_obj_access", @login_name="all",
@object_name = "customer", @setting = "on"
(Audits accesses to the customer table via built-in functions.)
grant all Name of the Any grant
(database-specific) database to be
audited
Example sp_audit @option="grant", @login_name="all", @object_name =
"planning", @setting = "on"
(Audits all grants in the planning database.)
insert all Name of the The database of insert into a table, insert into a view
(object-specific) view or table to the object
which you are (except tempdb)
inserting rows,
or default view
or default table
Example sp_audit "insert", "all", "dpt_101_view", "on"
(Audits all inserts into the dpt_101_view view in the current database.)
install all Database to be Any install java
(database-specific) audited
Example sp_audit "install", "all", "planning", "on"
(Audits the installation of java classes in database planning)
load all Database to be Any load database, load transaction
(database-specific) audited
Example sp_audit "load", "all", "projects_db", "fail"
(Audits all failed executions of database and transaction loads in the projects_db database.)
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
login all all Any Any login to Adaptive Server
(global) Example sp_audit "login", "all", "all", "fail"
(Audits all failed attempts to log in to the server.)
login_locked all all Any
(global) Example sp_audit "login_locked", "all", "all", "on"
(Login is locked because of exceeding the configured number of failed login attempts.)
logout all all Any Any logout from Adaptive Server
Example sp_audit "logout", "all", "all", "off"
(Turns auditing off of logouts from the server.)
mount all all Any mount database
(global) Example sp_audit "mount", "all", "all", "on"
(Audits all mount database commands issued.)
password all all Any Setting of global password and login
policy options
Example sp_audit "password", "all", "all", "on"
quiesce all all Any quiesce database
(global) Example sp_audit "quiesce", "all", "all", "on"
(Turns auditing on for quiesce database commands.)
reference all Name of the Any create table, alter table
(object-specific) view or table to
which you are
inserting rows,
or default view
or default table
Example sp_audit "reference", "all", "titles", "off"
(Turns off auditing of the creation of references to the titles table.)
remove all all Any Audits the removal of Java classes
(database-specific) Example sp_audit "remove", "all", "planning", "on"
(Audits the removal of Java classes in the planning database.)
revoke all Database to be Any revoke
(database-specific) audited
Example sp_audit "revoke", "all", "payments_db", "off"
(Turns off auditing of the execution of revoke in the payments_db database.)
rpc all all Any Remote procedure calls (either in or
(global) out)
Example sp_audit "rpc", "all", "all", "on"
(Audits all remote procedure calls out of or into the server.)
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
security all all Any Server-wide security-relevant events.
(global) See the “security” option in Table 18-5.
Example sp_audit "security", "all", "all", "on"
(Audits server-wide security-relevant events in the server.)
select all Name of the The database of select from a table, select from a view
(object-specific) view or table to the object
which you are (except tempdb)
inserting rows,
or default view
or default table
Example sp_audit "select", "all", "customer", "fail"
(Audits all failed selects from the customer table in the current database.)
setuser all all Any setuser
(database-specific) Example sp_audit "setuser", "all", "projdb", "on"
(Audits all executions of setuser in the projdb database.)
table_access Login name all Any select, delete, update, or insert access in
(user-specific) of the user to a table
be audited.
Example sp_audit "table_access", "smithson", "all", "on"
(Audits all table accesses by the login named “smithson”.)
transfer_table all all Any Server-wide option. Does not appear in
(global) sysauditoptions.
Example sp_audit "transfer_table", "tdb1.table1", "all", "on"
(Audits server-wide transfer-relevant events in the server.)
truncate all Database to be Any truncate table
(database-specific) audited
Example sp_audit "truncate", "all", "customer", "on"
(Audits all table truncations in the customer database.)
unbind all Database to be Any sp_unbindefault, sp_unbindrule,
(database-specific) audited sp_unbindmsg
Example sp_audit "unbind", "all", "master", "fail"
(Audits all failed attempts of unbinding in the master database.)
unmount all all Any unmount database
(global) Example sp_audit "unmount", "all", "all", "on"
(audits all attempts to unmount or create a manifest file with any database.)
Database to
Option be in to set Command or access being
(option type) login_name object_name the option audited
update all Name The database of update to a table, update to a view
(object-specific) specifying the the object
object to be (except tempdb)
audited, default
table or default
view
Example sp_audit "update", "all", "projects", "on"
(Audits all attempts by users to update the projects table in the current database.)
view_access Login name all Any select, delete, insert, or update to a view
(user-specific) of the user to
be audited
Example sp_audit "view_access", "joe", "all", "off"
(Turns off view auditing of user “joe”.)
This example shows an extrainfo column entry for the event of changing an
auditing configuration parameter.
sso_role;suspend audit when device full;1;0;;ralph;
This entry indicates that a system security officer changed suspend audit when
device full from 1 to 0. There is no “other information” for this entry. The sixth
category indicates that the user “ralph” was operating with a proxy login. No
principal name is provided.
The other fields in the audit record give other pertinent information. For
example, the record contains the server user ID (suid) and the login name
(loginname).
Table 18-5 lists the values that appear in the event column, arranged by
sp_audit option. The “Information in extrainfo” column describes information
that might appear in the extrainfo column of an audit table, based on the
categories described in Table 18-4.
Table 18-5: Values in event and extrainfo columns
Command or access to be
Audit option audited event Information in extrainfo
(Automatically Enabling auditing with: 73 —
audited event not sp_configure auditing
controlled by an
option)
(Automatically Disabling auditing with: 74 —
audited event not sp_configure auditing
controlled by an
option)
Unlocking Disabling auditing with: 74 —
Administrator’s sp_configure auditing
account
adhoc User-defined audit record 1 extrainfo is filled by the text parameter of
sp_addauditrecord
Command or access to be
Audit option audited event Information in extrainfo
alter alter database 2 Subcommand keywords:
alter maxhold
alter size
inmemory
alter table 3 Subcommand keywords:
add/drop/modify column
replace columns
replace decrypt default
replace/add decrypt default
add constraint
drop constraint
If one or more encrypted columns are added,
extrainfo contains:
add/drop/modify column column1/keyname1,
[,column2/keyname2]
where keyname is the fully qualified name of
the key.
bcp bcp in 4 —
bind sp_bindefault 6 Other information: Name of the default
sp_bindmsg 7 Other information: Message ID
sp_bindrule 8 Other information: Name of the rule
all, create create database 9 Keywords or options: inmemory
cmdtext All commands 92 Full text of command, as sent by the client
create create database 9 —
create default 14 —
create procedure 11 —
create rule 13 —
create table 10 For encrypted columns, extrainfo contains
column names and keynames.
EK column1/keyname1[,column2 keyname2]
where EK is a prefix indicating that subsequent
information refers to encryption keys and
keyname is the fully qualified name of the key.
create trigger 12 —
create view 16 —
create index 104 Other information: Name of the index
create function 97 —
sp_addmessage 15 Other information: Message number
Command or access to be
Audit option audited event Information in extrainfo
dbaccess Any access to the database by any 17 Keywords or options:
user use cmd
outside reference
dbcc dbcc all keywords 81 Keywords or options: Any of the dbcc
keywords such as checkstorage and the options
for that keyword.
delete delete from a table 18 Keywords or options: delete
delete from a view 19 Keywords or options: delete
disk disk init 20 Keywords or options: disk init
Other information: Name of the disk
disk mirror 23 Keywords or options: disk mirror
Other information: Name of the disk
disk refit 21 Keywords or options: disk refit
Other information: Name of the disk
disk reinit 22 Keywords or options: disk reinit
Other information: Name of the disk
disk release 87 Keywords or options: disk release
Other information: Name of the disk
disk remirror 25 Keywords or options: disk remirror
Other information: Name of the disk
disk unmirror 24 Keywords or options: disk unmirror
Other information: Name of the disk
disk resize 100 Keywords or options: disk resize
Other information: Name of the disk
drop drop database 26 —
drop default 31 —
drop procedure 28 —
drop table 27 —
drop trigger 29 —
drop rule 30 —
drop view 33 —
drop index 105 Other information: Index name
drop function 98 —
sp_dropmessage 32 Other information: Message number
dump dump database 34 —
dump transaction 35 —
Command or access to be
Audit option audited event Information in extrainfo
encryption_key sp_encryption 106 If password is set the first time:
ENCR_ADMIN system_encr_passwd
password ********
If the password is subsequently changed:
ENCR_ADMIN system_encr_passwd
password ******** ********
create encryption key 107 Keywords contain:
algorithm name-bitlength/IV
[random|NULL]/pad [random |NULL]
user/system
For example:
AES-128/IV RANDOM/PAD NULL USER
alter encryption key 108 default/not default
drop encryption key 109
AEK modify encryption 118 modify encryption
with user passwd
| for user username
{with login passwd
| with user passwd
| with keyvalue}
[for recovery
Note that keyvalue is displayed only for
replication of alter encryption key modify
encryption. For example, when user “stephen”
modifies his key copy, the following
information is saved:
MODIFY ENCRYPTION for user
stephen WITH USER PASSWD
AEK add encryption 119 add encryption for user user_name
for login association | recovery|with
keyvalue]
Note that keyvalue is displayed only for
replication of alter encryption key add
encryption.
alter encryption key drop encryption 120 drop encryption [for recovery | for user
user_name
See the Encrypted Columns Users Guide.
alter encryption key modify owner 121 modify owner [new owner user_name]
See the Encrypted Columns Users Guide.
Command or access to be
Audit option audited event Information in extrainfo
alter encryption key recover key 122 recovery key [with key_value]
with keyvalue is only used during replication of
alter encryption key
See the Encrypted Columns Users Guide.
errorlog errorlog or errorlog_admin function 127 The parameters passed to errorlog_admin are
logged to identify the subcommand:
errorlog_admin (param1, param2,...).
errors Fatal error 36 Other information:
Error number.Severity.State
Non-fatal error 37 Other information:
Error number.Severity.State
exec_procedure Execution of a procedure 38 Other information: All input parameters
exec_trigger Execution of a trigger 39 —
func_obj_access, Accesses to objects and databases 86 —
func_dbaccess via Transact-SQL functions.
(Auditing must be enabled for the
sa_role to audit functions).
grant grant 40 —
insert insert into a table 41 Keywords or option:
• If insert is used: insert
• If select into is used: insert into followed by
the fully qualified object name
insert into a view 42 Keywords or options: insert
install install 93 —
load load database 43 —
load transaction 44 —
login Any login to the server 45 Other information:
• Host name and IP address of the machine
from which the login was performed.
• Error number.Severity.State for failed
logins.
login_locked Login locked due to exceeding the 112
configured number of failed login
attempts
logout Any logouts from the server 46 Other information: Host name
mount mount database 101 —
password sp_passwordpolicy and all its 115 Parameters for sp_passwordpolicy
actions except list.
Command or access to be
Audit option audited event Information in extrainfo
quiesce quiesce database 96 —
reference Creation of references to tables 91 Keywords or options: reference
Other information: Name of the referencing
table
remove remove java 94 —
revoke revoke 47 —
rpc Remote procedure call from 48 Keywords or options: Name of client program
another server Other information: Server name, host name of
the machine from which the RPC was
executed.
Remote procedure call to another 49 Keywords or options: Procedure name
server
security connect to (CIS only) 90 Keywords or options: connect to
online database 83 —
proc_role function (executed from 80 Other information: Required roles
within a system procedure)
Regeneration of a password by an 76 Keywords or options: Setting SSO password
sso Other information: Login name
Role toggling 55 Previous value: on or off
Current value: on or off
Other information: Name of the role being set
Server start 50 Other information:
-dmasterdevicename
-iinterfaces file path
-Sservername
-eerrorfilename
sp_webservices 111 Keywords or options: deploy if deploying a
web service. deploy_all if deploying all web
services
sp_webservices 111 Keywords or options: undeploy if undeploying
a web service. undeploy_all if undeploying all
web services
Server shutdown 51 Keywords or options: shutdown
set proxy or 88 Previous value: Previous suid
set session authorization Current value: New suid
Command or access to be
Audit option audited event Information in extrainfo
sp_configure 82 Keywords or options: SETCONFIG
Other information:
• If a parameter is being set: number of
configuration parameter
• If a configuration file is being used to set
parameters: name of the configuration file
sp_ssladmin administration 99 Keywords contains SSL_ADMIN addcert, if
enabled adding a certification.
Audit table access 61 —
create login, drop login 103 Keywords or options: create login, drop login
create, drop, alter, grant, or revoke 85 Keywords or options: create, drop, alter, grant,
role or revoke role
built-in functions 86 Keywords or options: Name of function
Security command or access to be 95 Other information contains 'Unlocking admin
audited, specifically, starting account'
Adaptive Server with -u option to
unlock the administrator’s
account..
Changes to the LDAP state changes 123 Keywords or options: Primary URL state and
secondary URL state
• Previous value
• Current value
Additional information indicates whether the
state change happened automatically or
because of a manually entered command.
The regeneration of asymmetric 117 Information in extrainfo
keypairs for network password
encryption by the system or
sp_passwordpolicy
select select from a table 62 Keywords or options:
select into
select
readtext
select from a view 63 Keywords or options:
select into
select
readtext
setuser setuser 84 Other information: Name of the user being set
Command or access to be
Audit option audited event Information in extrainfo
table_access delete 18 Keywords or options: delete
insert 41 Keywords or options: insert
select 62 Keywords or options:
select into
select
readtext
update 70 Keywords or options:
update
writetext
truncate truncate table 64 —
transfer_table transfer table 136 transfer table
unbind sp_unbindefault 67 —
sp_unbindmsg 69 —
sp_unbindrule 68 —
unmount unmount database 102 —
create manifest file 116 Information in extrainfo
update update to a table 70 Keywords or options:
update
writetext
update to a view 71 Keywords or options:
update
writetext
view_access delete 19 Keywords or options: delete
insert 42 Keywords or options: insert
select 63 Keywords or options:
select into
select
readtext
update 71 Keywords or options:
update
writetext
Table 18-6 lists the values that appear in the event column, arranged by the
audit event.
Table 18-6: Audit event values
Audit event ID Command name Audit event ID Command name
1 ad hoc audit record 62 select table
• Using Adaptive Server for Windows with the Trusted Login or Unified
Login configuration, but the specified user is not a trusted administrator
(that is, an authentication failure).
• Adaptive Server does not support the SQL interface requested by the
client.
• A user is attempting to log into Adaptive Server when it is in single-user
mode. In single-user mode, exactly one user with the sa_role is allowed to
log in to Adaptive Server. Additional logins are prevented, even if they
have the sa_role.
• The syslogins table in the master database fails to open, indicating the
master database has an internal error.
• A client attempts a remote login, but sysremotelogins cannot be opened, or
there is no entry for the specified user account and no guest account exists.
• A client attempts a remote login and, although it finds an entry referring to
a local account for the specified user in sysremotelogins, the referenced
local account does not exist.
• A client program requests a security session (for example, a Kerberos
authentication), but the security session could not be established because:
• The Adaptive Server security subsystem was not initialized at startup.
• Insufficient memory resources for allocated structures.
• The authentication negotiation failed.
• An authentication mechanism is not found for the specified user.
• The specified password was not correct.
• syslogins does not contain the required entry for the specified login.
• A shutdown is in progress, but the specified user does not have the sa role.
• Adaptive Server could not open the default database for a login, and this
login does not have access to the master database.
• A client makes a high availability login fail over request, but the high
availability subsystem is does not have a high availability session for this
login, or the login is unable to wait for the fail over to complete.
• A client requests a high availability login setup, but the high availability
subsystem is unable to create the session or is unable to complete the TDS
protocol negotiations for the high availability session.
• Adaptive Server fails to setup tempdb for a login.
• TDS Login Protocol errors are detected.
This chapter describes how to configure Adaptive Server to ensure that all
data is secure and confidential.
Topic Page
Secure Sockets Layer (SSL) in Adaptive Server 683
Kerberos confidentiality 704
Dumping and loading databases with password protection 704
Public-key cryptography
Several mechanisms, known collectively as public-key cryptography, have
been developed and implemented to protect sensitive data during transmission
over the Internet. Public-key cryptography consists of encryption, key
exchange, digital signatures, and digital certificates.
Encryption Encryption is a process wherein a cryptographic algorithm is used to encode
information to safeguard it from anyone except the intended recipient. There
are two types of keys used for encryption:
• Symmetric-key encryption – is where the same algorithm (key) is used
to encrypt and decrypt the message. This form of encryption provides
minimal security because the key is simple, and therefore easy to decipher.
However, transfer of data that is encrypted with a symmetric key is fast
because the computation required to encrypt and decrypt the message is
minimal.
• Public/private key encryption – also known as asymmetric-key, is a pair
of keys that are made up of public and private components to encrypt and
decrypt messages. Typically, the message is encrypted by the sender with
a private key, and decrypted by the recipient with the sender’s public key,
although this may vary. You can use a recipient’s public key to encrypt a
message, who then uses his private key to decrypt the message.
The algorithms used to create public and private keys are more complex,
and therefore harder to decipher. However, public/private key encryption
requires more computation, sends more data over the connection, and
noticeably slows data transfer.
Key exchange The solution for reducing computation overhead and speeding transactions
without sacrificing security is to use a combination of both symmetric key and
public/private key encryption in what is known as a key exchange.
For large amounts of data, a symmetric key is used to encrypt the original
message. The sender then uses either his private key or the recipient’s public
key to encrypt the symmetric key. Both the encrypted message and the
encrypted symmetric key are sent to the recipient. Depending on what key was
used to encrypt the message (public or private) the recipient uses the opposite
to decrypt the symmetric key. Once the key has been exchanged, the recipient
uses the symmetric key to decrypt the message.
Digital signatures Digital signatures are used for tamper detection and non-repudiation. Digital
signatures are created with a mathematical algorithm that generates a unique,
fixed-length string of numbers from a text message; the result is called a hash
or message digest.
To ensure message integrity, the message digest is encrypted by the signer’s
private key, then sent to the recipient along with information about the hashing
algorithm. The recipient decrypts the message with the signer’s public key.
This process also regenerates the original message digest. If the digests match,
the message proves to be intact and tamper free. If they do not match, the data
has either been modified in transit, or the data was signed by an imposter.
Further, the digital signature provides non-repudiation—senders cannot deny,
or repudiate, that they sent a message, because their private key encrypted the
message. Obviously, if the private key has been compromised (stolen or
deciphered), the digital signature is worthless for non-repudiation.
Digital certificates Digital Certificates are like passports: once you have been assigned one, the
authorities have all your identification information in the system. Like a
passport, the certificate is used to verify the identity of one entity (server,
router, Web sites, and so on) to another.
Adaptive Server uses two types of certificates:
• Server certificates – a server certificate authenticates the server that holds
it. Certificates are issued by a trusted third-party Certificate Authority
(CA). The CA validates the holder’s identity, and embeds the holder’s
public key and other identification information into the digital certificate.
Certificates also contain the digital signature of the issuing CA, verifying
the integrity of the data contained therein and validating its use.
• CA certificates (also known as trusted root certificates) – is a list of
trusted CAs loaded by the server at start-up. CA certificates are used by
servers when they function as a client, such as during remote procedure
calls (RPCs). Adaptive Server loads its CA trusted root certificate at
start-up. When connecting to a remote server for RPCs, Adaptive Server
verifies that the CA that signed the remote server’s certificate is a “trusted”
CA listed in its own CA trusted roots file. If it is not, the connection fails.
Certificates are valid for a period of time and can be revoked by the CA for
various reasons, such as when a security breach has occurred. If a certificate is
revoked during a session, the session connection continues. Subsequent
attempts to login fail. Likewise, when a certificate expires, login attempts fail.
The combination of these mechanisms protect data transmitted over the
Internet from eavesdropping and tampering. These mechanisms also protect
users from impersonation, where one entity pretends to be another (spoofing),
or where a person or an organization says it is set up for a specific purpose
when the real intent is to capture private information (misrepresentation).
SSL overview
SSL is an industry standard for sending wire- or socket-level encrypted data
over secure network connections.
Before the SSL connection is established, the server and the client exchange a
series of I/O round trips to negotiate and agree upon a secure encrypted session.
This is called the SSL handshake.
SSL handshake When a client requests a connection, the SSL-enabled server presents its
certificate to prove its identity before data is transmitted. Essentially, the
handshake consists of the following steps:
• The client sends a connection request to the server. The request includes
the SSL (or Transport Layer Security, TLS) options that the client
supports.
• The server returns its certificate and a list of supported cipher suites, which
includes SSL/TLS support options, algorithms used for key exchange, and
digital signatures.
• A secure, encrypted session is established when both client and server
have agreed upon a CipherSuite.
For more specific information about the SSL handshake and the SSL/TLS
protocol, see the Internet Engineering Task Force Web site at http://www.ietf.org.
For a list of cipher suites that Adaptive Server supports, see “Cipher Suites” on
page 696.
SSL filter
The Adaptive Server directory service, such as the interfaces file, Windows
Registry, or LDAP service, defines the server address and port numbers, and
determines the security protocols that are enforced for client connections.
Adaptive Server implements the SSL protocol as a filter that is appended to the
master and query lines of the directory services.
The addresses and port numbers on which Adaptive Server accepts
connections are configurable, so you can enable multiple network and security
protocols for a single server. Server connection attributes are specified with
directory services, such as LDAP, or with the traditional Sybase interfaces file.
See “Creating server directory entries” on page 693.
All connection attempts to a master or query entry in the interfaces file with an
SSL filter must support the SSL protocol. A server can be configured to accept
SSL connections and have other connections that accept clear text
(unencrypted data), or use other security mechanisms.
For example, the interfaces file on UNIX that supports both SSL-based
connections and clear-text connections looks like this:
SYBSRV1
master tcp ether myhostname myport1 ssl
query tcp ether myhostname myport1 ssl
master tcp ether myhostname myport2
The SSL filter is different from other security mechanisms, such as DCE and
Kerberos, which are defined with SECMECH (security mechanism) lines in
the interfaces file (sql.ini on Windows).
The CA trusted roots The list of trusted CAs is loaded by Adaptive Server at start-up from the trusted
certificate roots file. The trusted roots file is similar in format to a certificate file, except
that it contains certificates for CAs known to Adaptive Server. A trusted roots
file is accessible by the local Adaptive Server in the following, where
servername is the name of the server:
• UNIX – $SYBASE/$SYBASE_ASE/certificates/servername.txt
• Windows – %SYBASE%\%SYBASE_ASE\certificates\servername.txt
The trusted roots file is only used by Adaptive Server when it is functioning as
a client, such as when performing RPC calls or Component Integration
Services (CIS) connections.
The system security officer adds and deletes CAs that are to be accepted by
Adaptive Server, using a standard ASCII-text editor.
Warning! Use the system security officer role (sso_role) within Adaptive
Server to restrict access and execution on security-sensitive objects.
Connection types
This section describes various client-to-server and server-to-server
connections.
Client login to Open Client applications establish a socket connection to Adaptive Server
Adaptive Server similarly to the way that existing client connections are established. Before any
user data is transmitted, an SSL handshake occurs on the socket when the
network transport-level connect call completes on the client side and the accept
call completes on the server side.
Server-to-server Adaptive Server establishes a socket connection to another server for RPCs in
remote procedure the same way that existing RPC connections are established. Before any user
calls
data is transmitted, an SSL handshake occurs on the socket when the network
transport-level connect call completes. If the server-to-server socket
connection has already been established, the existing socket connection and
security context is reused.
When functioning as a client during RPCs, Adaptive Server requests the
remote server’s certificate during connection. Adaptive Server then verifies
that the CA that signed the remote server’s certificate is trusted; that is to say,
on its own list of trusted CAs in the trusted roots file. It also verifies that the
common name in the server certificate matches the common name used when
establishing the connection.
Companion server You can use a companion server to configure Adaptive Server for failover. You
and SSL must configure both the primary and secondary servers with the same SSL and
RPC configuration. When connections fail over or fail back, security sessions
are reestablished with the connections.
Open Client Component Integration Services, RepAgent, Distributed Transaction
connections Management, and other modules in Adaptive Server use Client-Library to
establish connections to servers other than Adaptive Server. The remote server
is authenticated by its certificate. The remote server authenticates the Adaptive
Server client connection for RPCs with user name and password.
Enabling SSL
Adaptive Server determines which security service it will use for a port based
on the interface file (sql.ini on Windows).
❖ Enabling SSL
1 Generate a certificate for the server.
2 Create a trusted roots file.
3 Use sp_configure to enable SSL. From a command prompt, enter:
sp_configure "enable ssl", 1
• 1 – enables the SSL subsystem at start-up, allocates memory, and SSL
performs wire-level encryption of data across the network.
• 0 (the default) – disables SSL. This value is the default.
4 Add the SSL filter to the interfaces file. See “Creating server directory
entries” on page 693.
5 Use sp_ssladmin to add a certificate to the certificates file. See
“Administering certificates” on page 693.
6 Shut down and restart Adaptive Server.
Note To request, authorize, and convert third-party certificates, see the Utility
Guide for information on the certauth, certreq, and certpk12 tools.
Unlike other security services, such as DCE, Kerberos, and NTLAN, SSL
relies neither on the “Security” section of the Open Client/Open Server
configuration file libtcl.cfg, nor on objects in objectid.dat.
The system administrator should consider memory use by SSL when planning
for total physical memory. You need approximately 40K per connection
(connections include user connections, remote servers, and network listeners)
in Adaptive Server for SSL connections. The memory is reserved and
preallocated within a memory pool and is used internally by Adaptive Server
and SSL Plus libraries as requested.
Obtaining a certificate
The system security officer installs server certificates and private keys for
Adaptive Server by:
Using Adaptive Server Adaptive Server provides two tools for requesting and authorizing certificates.
tools to request and certreq generates public and private key pairs and certificate requests. certauth
authorize certificates
converts a server certificate request to a CA-signed certificate.
Warning! Use certauth only for testing purposes. Sybase recommends that you
use the services of a commercial CA because it provides protection for the
integrity of the root certificate, and because a certificate that is signed by a
widely accepted CA facilitates the migration to the use of client certificates for
authentication.
Preparing the server’s trusted root certificate is a five-step process. Perform the
first two steps to create a test trusted root certificate so you can verify that you
are able to create server certificates. Once you have a test CA certificate
(trusted roots certificate) repeat steps three through five to sign server
certificates.
1 Use certreq to request a certificate.
2 Use certauth to convert the certificate request to a CA self-signed
certificate (trusted root certificate).
3 Use certreq to request a server certificate and private key.
4 Use certauth to convert the certificate request to a CA-signed server
certificate.
5 Append the private key text to the server certificate and store the
certificate in the server’s installation directory.
For information about Sybase utilities, certauth, certreq, and certpk12 for
requesting, authorizing and converting third-party certificates, see the Utility
Guide.
Note certauth and certreq are dependent on RSA and DSA algorithms. These
tools only work with crypto modules that use RSA and DSA algorithms to
construct the certificate request.
Administering certificates
To administer SSL and certificates in Adaptive Server, use sp_ssladmin.
sso_role is required to execute the stored procedure.
• Add local server certificates. You can add certificates and specify the
password used to encrypt private keys, or require input of the password at
the command line during start-up.
• Delete local server certificates.
• List server certificates.
The syntax for sp_ssladmin is:
sp_ssladmin {[addcert, certificate_path [, password|NULL]]
[dropcert, certificate_path]
[lscert]
[help]}
[lsciphers]
[setciphers, {"FIPS" | "Strong" | "Weak" | "All"
| quoted_list_of_ciphersuites}]
For example:
sp_ssladmin addcert, "/sybase/ASE-12_5/certificates/Server1.crt",
"mypassword"
This adds an entry for the local server, Server1.crt, in the certificates file in the
absolute path to /sybase/ASE-12_5/certificates
(x:\sybase\ASE-12_5\certificates on Windows). The private key is encrypted
with the password “mypassword”. The password should be the one specified
when you created the private key.
Before accepting the certificate, sp_ssladmin verifies that:
• The private key can be decrypted using the provided password (except
when NULL is specified).
• The private key and public key in the certificate match.
• The certificate chain, from root CA to the server certificate, is valid.
• The common name in the certificate matches the common name in the
interfaces file.
If the common names do not match, sp_ssladmin issues a warning. If the other
criteria fails, the certificate is not added to the certificates file.
The use of NULL as the password is intended to protect passwords during the
initial configuration of SSL, before the SSL-encrypted session begins. Since
you have not yet configured SSL, the password travels unencrypted over the
connection. You can avoid this by specifying the password as NULL during the
first login.
When NULL is the password, you must start dataserver with a -y flag, which
prompts the administrator for the private-key password at the command line.
After restarting Adaptive Server with an SSL connection established, use
sp_ssladmin again, this time using the actual password. The password is then
encrypted and stored by Adaptive Server. Any subsequent starts of Adaptive
Server from the command line use the encrypted password; you do not have to
specify the password on the command line during start-up.
An alternative to using a NULL password during the first login is to avoid a
remote connection to Adaptive Server via isql. You can specify “localhost” as
the hostname in the interfaces file (sql.ini on Windows) to prevent clients from
connecting remotely. Only a local connection can be established, and the
password is never transmitted over a network connection.
Note Adaptive Server has sufficient memory in its network memory pool to
allow sp_ssladmin addcert to set the certificate and private key password with
its default memory allocations. However, if another network memory
consumer has already allocated the default network memory, sp_ssladmin may
fail and display this error to the client:
Msg 12823, Level 16, State 1:
Server 'servername', Procedure 'sp_ssladmin', Line 72:
Performance
There is additional overhead required to establish a secure session, because
data increases in size when it is encrypted, and it requires additional
computation to encrypt or decrypt information. The additional memory
requirements for SSL increases the overhead by 50-60 percent for network
throughput or for establishing a connection. You must have approximately 40K
more memory for each user connection.
Cipher Suites
During the SSL handshake, the client and server negotiate a common security
protocol via a CipherSuite. Cipher Suites are preferential lists of
key-exchange algorithms, hashing methods, and encryption methods used by
SSL-enabled applications. For a complete description of Cipher Suites, visit
the Internet Engineering Task Force (IETF) organization at
http://www.ietf.org/rfc/rfc2246.txt.
By default, the strongest CipherSuite supported by both the client and the
server is the CipherSuite that is used for the SSL-based session.
Adaptive Server supports the Cipher Suites that are available with the SSL Plus
library API and the cryptographic engine, Security Builder™, both from
Certicom Corp.
Note The Cipher Suites listed conform to the Transport Layer Specification
(TLS). TLS is an enhanced version of SSL 3.0, and is an alias for the SSL
version 3.0 Cipher Suites.
@@ssl_ciphersuite
The Transact-SQL global variable @@ssl_ciphersuite allows users to know
which cipher suite was chosen by the SSL handshake and verify that an SSL or
a non-SSL connection was established.
Adaptive Server sets @@ssl_ciphersuite when the SSL handshake completes.
The value is either NULL, indicating a non-SSL connection, or a string
containing the name of the cipher suite chosen by the SSL handshake.
For example, an isql connection using SSL protocol displays the cipher suite
chosen for it.
1> select @@ssl_ciphersuite
2> go
Output:
------------------------------
TLS_RSA_WITH_AES_128_CBC_SHA
(1 row affected)
sp_ssladmin lsciphers
To set a specific cipher suite preference, enter:
sp_ssladmin setciphers, {"FIPS" | "Strong" | "Weak" |
"All" | quoted_list_of_ciphersuites }
where:
• “FIPS” – is the set of encryptions, hash, and key exchange algorithms that
are FIPS-compliant. The algorithms included in this list are AES, 3DES,
DES, and SHA1.
• “Strong” – is the set of encryption algorithms using keys longer than 64
bits.
• “Weak” – is the set of encryption algorithms from the set of all supported
cipher suites that are not included in the strong set.
• “All” – is the set of default cipher suites.
Set
name Cipher suite names included in the set
All TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
TLS_DHE_DSS_WITH_RC4_128_SHA
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_DES_CBC_SHA
TLS_DHE_DSS_WITH_DES_CBC_SHA
TLS_DHE_RSA_WITH_DES_CBC_SHA
TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA
TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA
TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA
TLS_RSA_EXPORT_WITH_RC4_40_MD5
TLS_RSA_EXPORT_WITH_DES40_CBC_SHA
TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
Table 19-2 describes Cipher suites no longer supported for Adaptive Server
15.0 and later. 15.0. Attempts to use use any dropped cipher suite results in an
SSLHandshake failure and a failure to connect to Adaptive Server.
Examples sp_ssladmin
On initial startup, before any cipher suite preferences have been set, no
preferences are shown by sp_ssladmin lscipher.
1> sp_ssladmin lscipher
2> go
Output:
Cipher Suite Name Preference
----------------- ----------
(0 rows affected)
(return status = 0)
The following example specifies the set of cipher suites that use FIPS
algorithms.
1> sp_ssladmin setcipher, 'FIPS'
The following cipher suites and order of preference are set for SSL connections:
Cipher Suite Name Preference
---------------------------------------------------------------- -----------
TLS_RSA_WITH_AES_256_CBC_SHA 1
TLS_RSA_WITH_AES_128_CBC_SHA 2
TLS_RSA_WITH_3DES_EDE_CBC_SHA 3
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA 4
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 5
TLS_RSA_WITH_DES_CBC_SHA 6
TLS_DHE_DSS_WITH_DES_CBC_SHA 7
TLS_DHE_RSA_WITH_DES_CBC_SHA 8
TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA 9
TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 10
A preference of 0 (zero) sp_ssladmin output indicates a cipher suite is not used
by Adaptive Server. The other, non-zero numbers, indicate the preference order
that Adaptive Server uses the algorithm during the SSL handshake. The client
side of the SSL handshake chooses one of these cipher suites that matches its
list of accepted cipher suites.
This example uses a quoted list of cipher suites to set preferences in Adaptive
Server:
1> sp_ssladmin setcipher, 'TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_256_CBC_SHA'
2> go
The following cipher suites and order of preference are set for SSL connections:
Cipher Suite Name Preference
---------------------------------------------------------------- -----------
TLS_RSA_WITH_AES_128_CBC_SHA 1
TLS_RSA_WITH_AES_256_CBC_SHA 2
Other considerations
When you upgrade to Adaptive Server version 12.5.3 and later, the cipher suite
preferences are the server defaults, and sp_ssladmin option lscipher displays no
preferences. The server uses its default preferences, those defined by “All”. The
system security officer should consider the security policies employed at his or
her site and the available SSL cipher suites to decide whether to restrict cipher
suites and which cipher suites are appropriate for the security policies.
If you upgrade from Adaptive Server version 12.5.3 and later and have set
cipher suite preferences, those preferences remain after upgrade. After the
upgrade is complete, review your server's cipher suite preferences with current
security policies and the lists of supported and unsupported cipher suites found
in tables Table 19-1. Omit any cipher suites that are not supported.
If you have set SSL cipher suite preferences and want to remove all preferences
from the server and use default preferences, delete the preferences from their
storage location in system catalogs using the following commands:
1> sp_configure 'allow updates to system tables', 1
2> go
Kerberos confidentiality
You can also ensure the confidentiality of all messages with Adaptive Server.
To require all messages into and out of Adaptive Server to be encrypted, set the
msg confidentiality reqd configuration parameter to 1. If this parameter is 0 (the
default), message confidentiality is not required but may be established by the
client.
For example, to require that all messages be encrypted, execute:
sp_configure "msg confidentiality reqd", 1
For more information about using Message Confidentiality with Kerberos and
other Security Services supported, see “Administering network-based
security” on page 496.
data dictionary. See system tables name inside database 421, 430
database administration 3–7 objects not transferred between 421
database device password forgotten by 410
space See segments; space allocation permissions granted by 575
database devices 281 permissions of 6, 560, 562
See also disk mirroring; dump devices; master See also database object owners 559
device setuser command and 586–587
adding 282–288 several users as same 429
default 290–291 tasks of 6
dropping 290 permissions
fragments 278 database size configuration variable 55
information about 289 databases
initializing 281–288 See also database objects; user databases
names of 276, 283 adding users 402–405
number of server-usable 187 auditing 641
placing objects on 275 backing up 27, 42, 55
database dumps creating 54
password-protected 704 creation permission 561
database object owners 6 default 26, 400, 426
See also database owners default storage for 24, 290
permissions 7, 560, 587 dropping users from 420
status not transferable 421 dumping 42
tasks of 6 errors affecting 363
database objects guest users 55
See also individual object names integrity concerns 363
access permissions for 7, 566 loading after character set change 327
assigning to devices 274 loading after sort order change 327
controlling user creation of 26 new 27
creating 26, 273, 563 number of open 196
dependent 600 options 295–297
dropping 563, 564 ownership of 561
dropping users who own 421 size 27
errors affecting 363 system 23
finding 359 database-specific dbcc, master and 579
maximum number of open 200 dataserver command
ownership 6, 421, 563 using to unlock logins and roles 442
permissions on 563 date parts
triggers on 603 alternate language 335
database options 295–297 dates
listing 296 adding date parts 335
setting 296 alternate language 335
showing settings 296 display formats 339
database owners 6 format in error messages 357
changing 561 days
error responsibilities of 359, 361 alternate language 335
login name 4, 6 dbcc and storage_admin_role command 579
E enabling
auditing 639
Eastern Europe
SSL 690
character set support 305
encoding characters 341
empty pages, accumulating 371
encryption
enable backupserver HA configuration parameter 119
key exchange 684
enable cis configuration parameter 119, 121, 122, 132
public/private key 684
enable DTM configuration parameter 120
public-key cryptography 684
enable encrypted columns configuration parameter 120
symmetric key 684
enable HA configuration parameter for high availability
encryption, password 141
122
engine memory log size configuration parameter 136
enable housekeeper GC configuration parameter 123,
engines
372
identification numbers 357
enable i/o fencing configuration parameter 124
number of 167
enable java configuration parameter 121, 125
enivronment variable
enable job scheduler configuration parameter 125
$ISA 553
enable ldap user auth configuration parameter 126
error logs 45, 362
enable literal autoparam configuration parameter 126
creation and ownership 356
enable logins during recovery configuration parameter
format 357
126, 127
location 15
enable merge join configuration parameter 127
purging 357
enable metrics capture configuration parameter 127, 128
error messages 355–364
enable monitoring configuration parameter 128
altering server-provided 339, 358
enable pam user auth configuration parameter 128
character conversion 348
enable query tuning mem limit configuration parameter
creating user-defined 358
129, 130
for fatal errors 362–364
enable real time messaging configuration parameter 130
numbering of 355
enable rep agent threads configuration parameter 130
severity levels of 358–364
enable row level access control configuration parameter
user-defined 358
131
errorlog pipe active configuration parameter 136
enable semantic partitioning configuration parameter
errorlog pipe max messages configuration parameter
131
137
enable sort-merge join and JTC configuration parameter
errors
132
See also error logs; error messages
enable SQL debugger configuration parameter 132
character conversion 347
enable stmt cache monitoring configuration parameter
fatal 362–364
133
logging 356
enable surrogate processing configuration parameter
multiple 354
133
reporting of 364
enable unicode conversion configuration parameter 133
server responses to 353–364
enable unicode conversions configuration parameter
state numbers 353
346
types of information logged 15
enable unicode normalization configuration parameter
user 359, 359–362
134
esp execution priority configuration parameter 137
enable webservices configuration parameter 134
esp execution stacksize configuration parameter 137
enable xact coordination configuration parameter 135
esp unload dll configuration parameter 138
enable xml configuration parameter 135
F
failures, media 364
fatal errors G
backtrace from kernel 356, 362 garbage collection
error messages for 362–364 aggressive test 371
severity levels 19 and up 362–364 lazy test 371
file descriptors 207 garbage collector
maximum per-process configured for your configuring aggressive 372
operating system 210 housekeeper utility 371
files German
character set translation (.xlt) 337 character set support 305
Closed Problem Reports (CPRs) 380 get_appcontext 616, 617
deleting 290 global async prefetch limit configuration parameter
error log 15, 356 141
interfaces 16 global cache partition number configuration parameter
internationalization 337 142
libtcl.cfg file 17 global login triggers 633
localization 338–339 grant command 560, 565–583
System Problem Reports (SPRs) 380 all keyword 575
See also database devices; space allocation sort order consistency among 327
creating 276 stopping 378
default 276 syntax errors 360
logsegment 276 unlocking logins or roles at startup 442
syssegments table 279 user connections to 209
system segment 276 user information 431–477
select * command values for configuration parameters 63
error message 597 server-wide dbcc, master and 579
select into/bulkcopy/pllsort database option session authorization option, set 589
model database and 27 session migration timeout configuration parameter
select on syscomments.text column configuration 239
parameter 239 set command
send doneinproc tokens 239 roles and 419
sensitive information, views of 596 set options
separation of roles 393 exportable 631
sequence checks 495 set_appcontext 616
server aliases 482 setting timeout for LDAP user authentication 542
server authentication setuser command
server certificates 688 show_role and 436
server certificates 685 setuser, using 586
location of 688 7-bit ASCII character data, character set conversion for
server authentication 688 343
server information options. See information (server) severity levels, error 353, 358
server user name and ID 434 Backup Server 365
server.loc file 339 levels 10-18 (user errors) 359
server_name.cfg, default name of configuration file 64 levels 19-24 (fatal) 362
servers shared memory starting address configuration
See also processes (server tasks); remote servers parameter 240
adding new logins to 399–400 show_role system function 436
adding users to 399–400 show_sec_services security function 517
connecting 16 shutdown command 378–380
dropping logins from 423 shutting down servers 378
error message severity levels 358–364 simplified Chinese
error messages 356 character set support 305
fatal errors and 362–364 single-user mode 90, 331
installing 37, 275 size
interfaces files 16 See also space
local 482 dbcc fix_text transaction 333
monitoring performance 77 error log 15
names of 482 model database 109, 284
nonfatal internal errors 361–362 new database 27
passwords on 484, 490 tempdb database 28
remote 481–487 size of auto identity column configuration parameter
scheduler 259 241
shutting down 378 size of global fixed heap configuration parameter 241
single-user mode 90
size of process object fixed heap configuration sp_dropalias system procedure 430, 431
parameter 242 sp_dropdevice system procedure 290
size of shared class heap configuration parameter sp_dropgroup system procedure 421
242 sp_droplogin system procedure 423
size of unilib cache configuration parameter 243 sp_dropremotelogin system procedure 486
sjis (Shift-JIS) character set. See Japanese character sets sp_dropsegment system procedure
slash (/) sysusages and 278
converted to pound sign in login names 506 sp_dropserver system procedure 485
sort order sp_dropuser system procedure 420
changing 327–331 sp_extendsegment system procedure
consistency among servers 327 sysusages and 278
default sortorder id 112, 113 sp_helpconfig system procedure 196, 198, 200
default XML sortorder 113 sp_helpdb system procedure 13
definition files 337 database option information 296
installing new 337 sp_helpdevice system procedure 13, 288
numbers 112 sp_helpindex system procedure 13
rebuilding indexes after changing 332 sp_helpjoins system procedure 11
sp_activeroles system procedure 437 sp_helpkey system procedure 11
sp_addalias system procedure 429 sp_helpremotelogin system procedure 491
sp_addauditrecord system procedure 665 sp_helprotect system procedure 593–594
sp_addgroup system procedure 401 sp_helpserver system procedure 485
sp_addlanguage system procedure 335 sp_helptext system procedure 13
sp_addlogin system procedure 399–400, 454, 456 sp_helpuser system procedure 431
sp_addremotelogin system procedure 486–488 sp_indsuspect system procedure 332
sp_addsegment system procedure sp_ldapadmin 539
sysusages and 278 sp_listener, specifying a common name 703
sp_addserver sp_locklogin system procedure 422
includes filter parameter 704 sp_logintrigger 633
sp_addserver system procedure 481–483 sp_maplogin 543
sp_adduser system procedure 27, 402–404 sp_modifylogin system procedure 331, 426, 454, 457
sp_audit system procedure sp_monitorconfig system procedure
setting options with 657 configuring number of open databases and 197
sp_changedbowner system procedure 561 configuring number of open indexes and 199
sp_changegroup system procedure 401, 427 configuring number of open objects and 200,
sp_column_privileges catalog stored procedure 595 202
sp_configure system procedure 67 sp_password system procedure 424
See also individual configuration parameter names sp_passwordpolicy syntax 458
configuring server for security services 503 sp_remoteoption system procedure 490–491
remote logins and 491 sp_reportstats system procedure 476
sp_countmetadata system procedure 197, 198, 200, sp_serveroption net password encryption description
201 458
sp_dboption system procedure 295–297 sp_serveroption system procedure 483
sp_deviceattr system procedure 272, 286 sp_showplan system procedure 376
sp_diskdefault system procedure 272, 290–291 sp_showpsexe system command, housekeeper output
sp_displaylogin system procedure 433 370
sp_displayroles system procedure 437 sp_table_privileges catalog stored procedure 594
checking for roles in 438 sys_session application context table 620, 621
creating 14 sysalternates table 430
granting execution permission to roles 438 See also sysusers table
ownership chains 599 sysconfigures table 80–81
permissions granted 567 syscurconfigs table 80–81
permissions on 490, 563, 567 sysdevices table 277, 288
procedure cache and 225 disk init and 278
remote user access to 490 sp_dropdevice and 290
roles and 598 sp_helpdevice and 288
as security mechanisms 598 status bits 289
system tables changes and 14 sysindexes table 279, 331
strict dtm enforcement configuration parameter 253 syslogins table
structure sp_addlogin effect on 400
internationalization files directory 338 syslogs table
localization files directory 339 modification of 11
suffix names, temporary table 29 syslogs transaction log for sybsecurity 650
suid (server user ID) 400 sysmessages table 354, 355
sun character set 108 sysobjects table 331
suser_id system function 434–435 sysremotelogins table 488
suser_name system function 434–435 syssegments table 279
suspect partitions, in cross-platform dump and load sysservers table 479, 480, 481, 485
335 sp_helpserver and 485, 514
suspend audit when device full configuration srvname column 483
parameter 254, 650 srvnetname column 483
syb__map_name 526 system administration tasks
syb_sendmsg port number configuration parameter accomplishing with Sybase Central 8
254, 255 System Administrator
Sybase Central, using for system administration tasks error responsibilities of 358, 361–364
8 resolving system problems 358, 361
SYBASE_PRINCIPAL 524 tasks for beginners 35–47
syblicenseslog table 475 system administrator 3–7
sybmapname 526 permissions 560–561
sybsecurity database 30, 636 system audit tables 667
sybsystemdb database 30 system catalogs. See system tables
sybsystemprocs database 12, 14, 28 system databases 23–30
See also databases system extended stored procedures 14
permissions and 565 system messages. See error messages 353
symbols system problems
in SQL statements xxii See also errors
symmetric key encryption 684 Server responses to 353–364
syntax severity levels 10 to 18 359–362
disk resize 292 severity levels 19 to 24 362–364
dump database 704 System Problem Reports (SPRs) 380
errors in 360 system procedure
load database 704 tables 13
syntax conventions, Transact-SQL xxii system procedures 12–14
X
X/Open XA 120
xact 267
.xlt files 337
XP Server
freeing memory from 138
priority 137
xp_cmdshell context configuration parameter 268
xp_cmdshell system extended stored procedure 14