IBM Informix Dynamic Server Administrator's Guide
IBM Informix Dynamic Server Administrator's Guide
Version 10.0
G251-2267-02
DB2 IBM Informix
®
Version 10.0
G251-2267-02
Note:
Before using this information and the product it supports, read the information in “Notices” on page B-1.
Contents v
Initialization Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Process Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Create Shared-Memory Portions . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Initialize or Restart Shared-Memory . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Initialize Disk Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Start All Required Virtual Processors . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Make Necessary Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Start Fast Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Start a Checkpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Document Configuration Changes . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Create the oncfg_servername.servernum File . . . . . . . . . . . . . . . . . . . . . . . 4-6
Drop Temporary Tblspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Set Forced Residency If Specified . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Return Control to User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Create sysmaster Database and Prepare SMI Tables . . . . . . . . . . . . . . . . . . . . . 4-6
Create the sysutils Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Monitor Maximum Number of User Connections . . . . . . . . . . . . . . . . . . . . . 4-7
Database Server Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Changing Database Server Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . 4-8
Users Permitted to Change Modes . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
ISA Options for Changing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
ON-Monitor Options for Changing Modes (UNIX) . . . . . . . . . . . . . . . . . . . . . 4-10
Command-Line Options for Changing Modes . . . . . . . . . . . . . . . . . . . . . . 4-10
Contents vii
Concurrency Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20
Shared-Memory Mutexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Shared-Memory Buffer Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Database Server Thread Access to Shared Buffers . . . . . . . . . . . . . . . . . . . . . . 8-21
FIFO/LRU Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-21
Configuring the Database Server to Read Ahead . . . . . . . . . . . . . . . . . . . . . 8-25
Database Server Thread Access to Buffer Pages . . . . . . . . . . . . . . . . . . . . . . 8-25
Flushing Data to Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
Flushing Buffer-Pool Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
Flushing Before-Images First . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
Flushing the Physical-Log Buffer. . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
Synchronizing Buffer Flushing . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
Describing Flushing Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
Flushing the Logical-Log Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-28
Buffering Large-Object Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
Writing Simple Large Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
Accessing Smart Large Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-31
Memory Use on 64-Bit Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-32
Semaphores (UNIX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9-3
Setting Database Server Shared-Memory Configuration Parameters . . . . . . . . . . . . . . . .
9-3
Setting Parameters for Resident Shared Memory . . . . . . . . . . . . . . . . . . . . . .
9-4
Setting Parameters for Virtual Shared Memory . . . . . . . . . . . . . . . . . . . . . .
9-4
Setting Parameters for Shared-Memory Performance . . . . . . . . . . . . . . . . . . . .
9-5
Setting Shared-Memory Parameters with a Text Editor . . . . . . . . . . . . . . . . . . . .
9-5
Setting Shared-Memory Parameters with ISA . . . . . . . . . . . . . . . . . . . . . . .
9-5
Setting Shared-Memory Parameters with ON-Monitor (UNIX) . . . . . . . . . . . . . . . . .
9-6
Setting SQL Statement Cache Parameters . . . . . . . . . . . . . . . . . . . . . . . . .
9-6
Setting Up Shared Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9-7
Turning Residency On or Off for Resident Shared Memory . . . . . . . . . . . . . . . . . . .
9-7
Turning Residency On or Off in Online Mode . . . . . . . . . . . . . . . . . . . . . .
9-7
Turning Residency On or Off When Restarting the Database Server . . . . . . . . . . . . . . .
9-7
Adding a Segment to the Virtual Portion of Shared Memory . . . . . . . . . . . . . . . . . . .
9-7
Monitoring Shared Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9-8
Monitoring Shared-Memory Segments . . . . . . . . . . . . . . . . . . . . . . . . .
9-8
Monitoring the Shared-Memory Profile and Latches . . . . . . . . . . . . . . . . . . . .
9-8
Monitoring Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9-9
Monitoring Buffer-Pool Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11
Contents ix
Creating an Sbspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-22
Sizing Sbspace Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23
Adding a Chunk to an Sbspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23
Altering Storage Characteristics of Smart Large Objects . . . . . . . . . . . . . . . . . . . 11-24
Creating a Temporary Sbspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25
Dropping a Chunk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25
Verifying Whether a Chunk Is Empty . . . . . . . . . . . . . . . . . . . . . . . . . 11-26
Dropping a Chunk from a Dbspace with onspaces . . . . . . . . . . . . . . . . . . . . 11-26
Dropping a Chunk from a Blobspace . . . . . . . . . . . . . . . . . . . . . . . . . 11-26
Dropping a Chunk from an Sbspace with onspaces . . . . . . . . . . . . . . . . . . . . 11-26
Dropping a Storage Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27
Preparing to Drop a Storage Space . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27
Dropping a Mirrored Storage Space . . . . . . . . . . . . . . . . . . . . . . . . . 11-28
Dropping a Storage Space with onspaces . . . . . . . . . . . . . . . . . . . . . . . 11-28
Dropping a Dbspace or Blobspace with ON-Monitor (UNIX) . . . . . . . . . . . . . . . . . 11-28
Backing Up After Dropping a Storage Space . . . . . . . . . . . . . . . . . . . . . . 11-28
Managing Extspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-29
Creating an Extspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-29
Dropping an Extspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-29
Skipping Inaccessible Fragments . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-29
Using the DATASKIP Configuration Parameter . . . . . . . . . . . . . . . . . . . . . 11-30
Using the Dataskip Feature of onspaces . . . . . . . . . . . . . . . . . . . . . . . . 11-30
Using onstat to Check Dataskip Status . . . . . . . . . . . . . . . . . . . . . . . . 11-30
Using the SQL Statement SET DATASKIP . . . . . . . . . . . . . . . . . . . . . . . 11-30
Effect of the Dataskip Feature on Transactions . . . . . . . . . . . . . . . . . . . . . . 11-31
Determining When to Use Dataskip . . . . . . . . . . . . . . . . . . . . . . . . . 11-31
Monitoring Fragmentation Use . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-31
Displaying Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
Using SMI Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
Using ISA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
Using ON-Monitor (UNIX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
Monitoring Disk Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32
Monitoring Chunks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-33
Monitoring Tblspaces and Extents . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36
Monitoring Simple Large Objects in a Blobspace . . . . . . . . . . . . . . . . . . . . . 11-37
Monitoring Sbspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-39
Loading Data Into a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44
Contents xi
Freeing a Log File with Status U-C or U-C-L. . . . . . . . . . . . . . . . . . . . . . . 15-6
Freeing a Log File with Status U-B-L . . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Monitoring Logging Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Monitoring the Logical Log for Fullness . . . . . . . . . . . . . . . . . . . . . . . . 15-6
Monitoring Temporary Logical Logs . . . . . . . . . . . . . . . . . . . . . . . . . 15-7
Using SMI Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-7
Using ON-Monitor (UNIX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Monitoring Log-Backup Status . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Allocating Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Adding Logs Dynamically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-8
Adding Logical-Log Files Manually . . . . . . . . . . . . . . . . . . . . . . . . . 15-10
Dropping Logical-Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-11
Changing the Size of Logical-Log Files . . . . . . . . . . . . . . . . . . . . . . . . . 15-12
Moving a Logical-Log File to Another Dbspace . . . . . . . . . . . . . . . . . . . . . . 15-12
Changing Logging Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . 15-13
Using ON-Monitor to Change LOGFILES (UNIX). . . . . . . . . . . . . . . . . . . . . 15-14
Displaying Logical-Log Records . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-14
Monitoring Events for Dynamically Added Logs . . . . . . . . . . . . . . . . . . . . . . 15-14
Setting High-Watermarks for Rolling Back Long Transactions . . . . . . . . . . . . . . . . . . 15-15
Long-Transaction High-Watermark (LTXHWM) . . . . . . . . . . . . . . . . . . . . . 15-16
Exclusive Access, Long-Transaction High-Watermark (LTXEHWM) . . . . . . . . . . . . . . . 15-16
Adjusting the Size of Log Files to Prevent Long Transactions . . . . . . . . . . . . . . . . . 15-16
Recovering from a Long Transaction Hang . . . . . . . . . . . . . . . . . . . . . . . 15-16
Contents xiii
Directing Clients Automatically with DBPATH . . . . . . . . . . . . . . . . . . . . . 20-14
Directing Clients with the Connectivity Information . . . . . . . . . . . . . . . . . . . . 20-15
Directing Clients with INFORMIXSERVER . . . . . . . . . . . . . . . . . . . . . . . 20-18
Handling Redirection Within an Application . . . . . . . . . . . . . . . . . . . . . . 20-19
Comparing Different Redirection Mechanisms . . . . . . . . . . . . . . . . . . . . . . 20-20
Designing HDR Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-20
Setting Lock Mode to Wait for Access to Primary Database Server . . . . . . . . . . . . . . . 20-20
Designing Clients to Use the Secondary Database Server . . . . . . . . . . . . . . . . . . 20-21
Part 6. Appendixes
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X-1
Contents xv
xvi IBM Informix Dynamic Server Administrator’s Guide
Introduction
In This Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Types of Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Software Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Assumptions About Your Locale. . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Demonstration Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
New Features in Dynamic Server, Version 10.0 . . . . . . . . . . . . . . . . . . . . . . . xix
Database Server Security and Usability Enhancements . . . . . . . . . . . . . . . . . . . . xix
New Features in Previous Versions of Dynamic Server . . . . . . . . . . . . . . . . . . . . . xxi
Features in Dynamic Server, Version 9.4. . . . . . . . . . . . . . . . . . . . . . . . . xxi
Database Server Usability Enhancements . . . . . . . . . . . . . . . . . . . . . . . xxi
Security Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Features in Dynamic Server, Version 9.3 . . . . . . . . . . . . . . . . . . . . . . . . xxii
Performance Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
SQL Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Other Significant Changes in Version 9.3 . . . . . . . . . . . . . . . . . . . . . . . xxiii
Features in Dynamic Server, Version 9.21 . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Organizational Changes to This Manual In Version 9.2 . . . . . . . . . . . . . . . . . . . xxiii
Documentation Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Feature, Product, and Platform Markup . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Syntax Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
How to Read a Command-Line Syntax Diagram . . . . . . . . . . . . . . . . . . . . xxvi
Keywords and Punctuation . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Identifiers and Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Example Code Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Additional Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
IBM Informix Information Center . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
Installation Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
Online Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
Locating Online Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Online Notes Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
Informix Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
Online Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
Printed Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Accessibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
IBM Informix Dynamic Server Version 10.0 and CSDK Version 2.90 Documentation Set . . . . . . . . . xxxi
Compliance with Industry Standards . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
IBM Welcomes Your Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiii
In This Introduction
This introduction provides an overview of the information in this manual and
describes the conventions it uses.
This section discusses the organization of the manual, the intended audience, and
the associated software products that you must have to use the database server.
Types of Users
This manual is written for the following users:
v Database users
v Database administrators
v Database server administrators
v Performance engineers
v Programmers in the following categories
– Application developers
– DataBlade module developers
– Authors of user-defined routines
This manual is written with the assumption that you have the following
background:
v A working knowledge of your computer, your operating system, and the utilities
that your operating system provides
v Some experience working with relational databases or exposure to database
concepts
v Some experience with computer programming
v Some experience with database server administration, operating-system
administration, or network administration
If you have limited experience with relational databases, SQL, or your operating
system, see the IBM Informix Dynamic Server Getting Started Guide for your database
server for a list of supplementary titles.
Software Dependencies
This manual is written with the assumption that you are using IBM Informix
Dynamic Server Version 10.0 as your database server.
The examples in this manual are written with the assumption that you are using
the default locale, en_us.8859-1. This locale supports U.S. English format
conventions for date, time, and currency. In addition, this locale supports the ISO
8859-1 code set, which includes the ASCII code set plus many 8-bit characters such
as é, è, and ñ.
For instructions on how to specify a nondefault locale, additional syntax, and other
considerations related to GLS locales, see the IBM Informix GLS User's Guide.
Demonstration Database
The DB–Access utility, which is provided with your Informix database server
products, includes one or more of the following demonstration databases:
v The stores_demo database illustrates a relational schema with information about
a fictitious wholesale sporting-goods distributor. Many examples in IBM
Informix manuals are based on the stores_demo database.
v The superstores_demo database illustrates an object-relational schema. The
superstores_demo database contains examples of extended data types, type and
table inheritance, and user-defined routines.
For information about how to create and populate the demonstration databases,
see the IBM Informix DB–Access User's Guide. For descriptions of the databases and
their contents, see the IBM Informix Guide to SQL: Reference.
The scripts that you use to install the demonstration databases reside in the
$INFORMIXDIR/bin directory on UNIX and in the %INFORMIXDIR%\bin
directory on Windows.
Introduction xix
New Features Reference
A new default role that you can assign to individual users “User Roles” on page 5-6
or to the PUBLIC group for a particular database. The
default role is automatically applied when a user establishes
a connection with the database.
3 New configuration parameters that you can use on UNIX, “Limiting Denial-of-Service Flood Attacks” on page 5-7
3 Linux, and Windows platforms to reduce the incomplete
3 connection timeout period and restrict the number of
3 incomplete requests for connections, thus reducing the risk
3 of a hostile, denial-of-service (DOS) flood attack
Options for implementing column-level encryption, as well “Encryption” on page 5-8
as password and data-transmission encryption
A configuration parameter that a database server security “Security for External Routines (UDRs)” on page 5-32
administrator can use to restrict the users who can register
an external routine
A new event-alarm parameter to use if you want the “Event-Alarm Parameters” on page 2-9
event-alarm program to operate for all events that are
logged in the MSGPATH, not just noteworthy events
Rename-dbspace functionality “Renaming Dbspaces” on page 11-17
Single-user mode, a new database server mode to use when “Database Server Operating Modes” on page 4-7 and
performing maintenance tasks involving the execution of “Changing Database Server Operating Modes” on page
SQL and DDL statements 4-8
The DRAUTO configuration parameter to use to automate “Actions When an HDR Failure Is Detected” on page
switching High-Availability Data Replication database 20-11, “Actions to Take If the Primary Database Server
servers if the primary server fails Fails” on page 20-12, “Changing the Database Server
Mode” on page 21-13, “Critical Media Failure on the
Primary Database Server” on page 21-18, and “The
Secondary Database Server Is Changed to a Standard
Database Server Automatically” on page 21-21
External back up and restore functionality to use when “Starting HDR for the First Time” on page 21-6
setting up HDR
Two configuration parameters that enable the database “Alternative Fast Restart Recovery Options for Fuzzy
server to perform physical logging on fuzzy checkpoints Operations” on page 16-17
during the roll-forward phase of recovery, thus reducing the
time required for recovery
The DS_NONPDQ_QUERY_MEM configuration parameter “Size of the Virtual Portion of Shared Memory” on
to use to increase the amount of sort memory that is page 8-14 and the IBM Informix Dynamic Server
available for a query that is not a Parallel Database Query Performance Guide
(PDQ)
Functionality for either manually or automatically “Replicating An Index to the Secondary Server” on
replicating a High-Availability Data Replication (HDR) page 21-18
index to the secondary server when an index on the
secondary server becomes corrupt
Functionality for creating multiple partitions of a table or “Managing Dbspace Partitions” on page 11-18
index within a single dbspace for fragmented tables that use
expression-based or round-robin distribution schemes
New configuration parameters and onspaces options for “Specifying the First and Next Extent Sizes for the
specifying the first and next extent sizes for the tblspace tblspace tblspace” on page 11-10
tblspace in the dbspace
Important: HDR is available with the standard version of Dynamic Server. HDR
does not work with the IBM Informix Dynamic Server Express Edition.
Introduction xxi
New Features Reference
The ability to use chunks and extents to a maximum size of “Using Large Chunks” on page 1-5.
4 terabytes.
“Creating Storage Spaces and Chunks” on page 1-16.
Security Enhancements
Version 9.4 adds the encryption communication support module (ENCCSM), which
enables you to encrypt data transmissions over the network. This option provides
complete data encryption with the OpenSSL library, with many configurable
options.
This product includes software developed by the OpenSSL Project for use in the
OpenSSL Toolkit ([Link]
Performance Enhancements
Version 9.3 includes many new features that help you monitor and improve the
performance of your database.
SQL Enhancements
Version 9.3 includes several new SQL statements that ease migration from
non-Informix databases to Dynamic Server, Version 9.4.
Features Reference
Nonlogging (RAW) tables “Table Types for Dynamic Server” on page 10-23
onpladm utility “Loading Data Into a Table” on page 11-44
SQL statement cache enhancements: “Setting SQL Statement Cache Parameters” on page 9-6
v new configuration parameters
v new onstat -g ssc options
v new onmode -W options for changing SQL statement
cache parameters
Documentation Conventions
This section describes the conventions that this manual uses. These conventions
make it easier to gather information from this and other volumes in the
documentation set.
Introduction xxiii
Typographical Conventions
This manual uses the following conventions to introduce new terms, illustrate
screen displays, describe command syntax, and so forth.
Convention Meaning
KEYWORD Keywords of SQL, SPL, and some other programming languages appear
in uppercase letters in a serif font.
italics Within text, new terms and emphasized words appear in italics. Within
syntax and code examples, variable values that you are to specify
appear in italics.
boldface Names of program entities (such as classes, events, and tables),
environment variables, file and pathnames, and interface elements (such
as icons, menu items, and buttons) appear in boldface.
monospace Information that the product displays and information that you enter
appear in a monospace typeface.
KEYSTROKE Keys that you are to press appear in uppercase letters in a sans serif
font.
> This symbol indicates a menu item. For example, “Choose Tools >
Options” means choose the Options item from the Tools menu.
Dynamic Server
Windows Only
This markup can apply to one or more paragraphs within a section. When an
entire section applies to a particular product or platform, this is noted as part of
the heading text, for example:
Table Sorting (Linux)
Syntax Diagrams
This guide uses syntax diagrams built with the following components to describe
the syntax for statements and all commands other than system-level commands.
Syntax diagrams depicting SQL and command-line statements have changed in the
following ways:
Introduction xxv
Component represented in PDF Component represented in HTML Meaning
Table Reference Syntax segment.
|--+-----view--------+--|
+------table------+
’----synonym------’
-t table
(1)
Setting the Run Mode
-S server -T target
Notes:
1 See page Z-1
The second line in this diagram has a segment named “Setting the Run Mode,”
which according to the diagram footnote, is on page Z-1. If this was an actual
cross-reference, you would find this segment in on the first page of Appendix Z.
Instead, this segment is shown in the following segment diagram. Notice that the
diagram uses segment start and end components.
l
c
-f
d u n N
p
a
To see how to construct a command correctly, start at the top left of the main
diagram. Follow the diagram to the right, including the elements that you want.
The elements in this diagram are case sensitive because the illustrates utility
syntax. Other types of syntax, such as SQL, are not case sensitive.
You must also use any punctuation in your statements and commands exactly as
shown in the syntax diagrams.
The following syntax diagram uses variables to illustrate the general form of a
simple SELECT statement.
When you write a SELECT statement of this form, you replace the variables
column_name and table_name with the name of a specific column and table.
If only SQL statements are listed in the example, they are not delimited by
semicolons. For instance, you might see the code in the following example:
CONNECT TO stores_demo
...
Introduction xxvii
DELETE FROM customer
WHERE customer_num = 121
...
COMMIT WORK
DISCONNECT CURRENT
To use this SQL code for a specific product, you must apply the syntax rules for
that product. For example, if you are using DB–Access, you must delimit multiple
statements with semicolons. If you are using an SQL API, you must use EXEC SQL
at the start of each statement and a semicolon (or other appropriate delimiter) at
the end of the statement.
Tip: Ellipsis points in a code example indicate that more code would be added in
a full application, but it is not necessary to show it to describe the concept
being discussed.
Additional Documentation
For additional information, refer to the following types of documentation:
v Installation guides
v Online notes
v Informix error messages
v Manuals
v Online help
Installation Guides
Installation guides are located in the /doc directory of the product CD or in the
/doc directory of the product‘s compressed file if you downloaded it from the IBM
Web site. Alternatively, you can obtain installation guides from the IBM Informix
Online Documentation site at
[Link] or the IBM Informix
Information Center at
[Link]
Online Notes
The following sections describe the online files that supplement the information in
this manual. Please examine these files before you begin using your IBM Informix
product. They contain vital information about application and performance issues.
Before Installation
All online notes are located in the /doc directory of the product CD. The easiest
way to access the documentation notes, the release notes, and the fixed and known
defects file is through the hyperlinks from the TOC notes file.
The machine notes file and the fixed and known defects file are only provided in
text format.
After Installation
On UNIX platforms in the default locale, the documentation notes, release notes,
and machine notes files appear under the $INFORMIXDIR/release/en_us/0333
directory.
Dynamic Server
On Windows the documentation and release notes files appear in the Informix
folder. To display this folder, choose Start > Programs > IBM product name
version > Documentation Notes or Release Notes from the taskbar.
Introduction xxix
Machine notes do not apply to Windows platforms.
End of Dynamic Server
ids_win_fixed_and_known ids_win_fixed_and_known
_defects_version.txt _defects_10.[Link]
On UNIX platforms, use the finderr command to read the error messages and their
corrective actions.
Dynamic Server
On Windows, use the Informix Error Messages utility to read error messages and
their corrective actions. To display this utility, choose Start > Programs > IBM
product name version > Informix Error Messages from the taskbar.
End of Dynamic Server
You can also access these files from the IBM Informix Online Documentation site at
[Link] or in the IBM
Informix Information Center at
[Link]
Manuals
Online Manuals
A CD that contains your manuals in electronic format is provided with your IBM
Informix products. You can install the documentation or access it directly from the
CD. For information about how to install, read, and print online manuals, see the
installation insert that accompanies your CD. You can also obtain the same online
manuals from the IBM Informix Online Documentation site at
[Link] or in the IBM
Informix Information Center at
[Link]
Online Help
IBM Informix online help, provided with each graphical user interface (GUI),
displays information about those interfaces and the functions that they perform.
Use the help facilities that each GUI provides to display the online help.
Accessibility
IBM is committed to making our documentation accessible to persons with
disabilities. Our books are available in HTML format so that they can be accessed
with assistive technology such as screen reader software. The syntax diagrams in
our manuals are available in dotted decimal format, which is an accessible format
that is available only if you are using a screen reader. For more information about
the dotted decimal format, see the Accessibility appendix.
IBM Informix Dynamic Server Version 10.0 and CSDK Version 2.90
Documentation Set
The following tables list the manuals that are part of the IBM Informix Dynamic
Server, Version 10.0 and the CSDK Version 2.90, documentation set. PDF and
HTML versions of these manuals are available at
[Link] or in the IBM
Informix Information Center at
[Link] You can order
hardcopy versions of these manuals from the IBM Publications Center at
[Link]
Table 1. Database Server Manuals
Manual Subject
Administrator’s Guide Understanding, configuring, and administering your database server.
Administrator’s Reference Reference material for Informix Dynamic Server, such as the syntax of database
server utilities onmode and onstat, and descriptions of configuration parameters,
the sysmaster tables, and logical-log records.
Backup and Restore Guide The concepts and methods you need to understand when you use the ON-Bar
and ontape utilities to back up and restore data.
Built-In DataBlade Modules Using the following DataBlade modules that are included with Dynamic Server:
User’s Guide v MQ DataBlade module, to allow IBM Informix database applications to
communicate with other MQSeries applications.
v Large Object Locator, a foundation DataBlade module that can be used by other
modules that create or store large-object data.
DB-Access User’s Guide Using the DB-Access utility to access, modify, and retrieve data from Informix
databases.
DataBlade API The DataBlade API functions and the subset of ESQL/C functions that the
Function Reference DataBlade API supports. You can use the DataBlade API to develop client LIBMI
applications and C user-defined routines that access data in Informix databases.
DataBlade API The DataBlade API, which is the C-language application-programming interface
Programmer’s Guide provided with Dynamic Server. You use the DataBlade API to develop client and
server applications that access data stored in Informix databases.
Introduction xxxi
Table 1. Database Server Manuals (continued)
Manual Subject
Database Design and Designing, implementing, and managing your Informix databases.
Implementation Guide
Enterprise Replication Guide How to design, implement, and manage an Enterprise Replication system to
replicate data between multiple database servers.
Error Messages file Causes and solutions for numbered error messages you might receive when you
work with IBM Informix products.
Getting Started Guide Describes the products bundled with IBM Informix Dynamic Server and
interoperability with other IBM products. Summarizes important features of
Dynamic Server and the new features for each version.
Guide to SQL: Reference Information about Informix databases, data types, system catalog tables,
environment variables, and the stores_demo demonstration database.
Guide to SQL: Syntax Detailed descriptions of the syntax for all Informix SQL and SPL statements.
Guide to SQL: Tutorial A tutorial on SQL, as implemented by Informix products, that describes the basic
ideas and terms that are used when you work with a relational database.
High-Performance Loader Accessing and using the High-Performance Loader (HPL), to load and unload
User’s Guide large quantities of data to and from Informix databases.
Installation Guide for Instructions for installing IBM Informix Dynamic Server on Windows.
Microsoft Windows
Installation Guide for Instructions for installing IBM Informix Dynamic Server on UNIX and Linux.
UNIX and Linux
J/Foundation Developer’s Writing user-defined routines (UDRs) in the Java programming language for
Guide Informix Dynamic Server with J/Foundation.
Migration Guide Conversion to and reversion from the latest versions of Informix database servers.
Migration between different Informix database servers.
Optical Subsystem Guide The Optical Subsystem, a utility that supports the storage of BYTE and TEXT data
on optical disk.
Performance Guide Configuring and operating IBM Informix Dynamic Server to achieve optimum
performance.
R-Tree Index User’s Guide Creating R-tree indexes on appropriate data types, creating new operator classes
that use the R-tree access method, and managing databases that use the R-tree
secondary access method.
SNMP Subagent Guide The IBM Informix subagent that allows a Simple Network Management Protocol
(SNMP) network manager to monitor the status of Informix servers.
Storage Manager Informix Storage Manager (ISM), which manages storage devices and media for
Administrator’s Guide your Informix database server.
Trusted Facility Guide The secure-auditing capabilities of Dynamic Server, including the creation and
maintenance of audit logs.
User-Defined Routines and How to define new data types and enable user-defined routines (UDRs) to extend
Data Types Developer’s Guide IBM Informix Dynamic Server.
Virtual-Index Interface Creating a secondary access method (index) with the Virtual-Index Interface (VII)
Programmer’s Guide to extend the built-in indexing schemes of IBM Informix Dynamic Server.
Typically used with a DataBlade module.
Virtual-Table Interface Creating a primary access method with the Virtual-Table Interface (VTI) so that
Programmer’s Guide users have a single SQL interface to Informix tables and to data that does not
conform to the storage scheme of Informix Dynamic Server.
Introduction xxxiii
docinf@[Link]
This email address is reserved for reporting errors and omissions in our
documentation. For immediate help with a technical problem, contact IBM
Technical Support. For instructions, see the IBM Informix Technical Support
website at [Link]
[Link]/software/data/informix/support/[Link].
In This Chapter
When you install Version 10.0 of the IBM Informix Dynamic Server, you should
follow the installation instructions to ensure the permissions of all key files and
directories are set appropriately. The install instructions are in the IBM Informix
Dynamic Server Installation Guide for UNIX and Linux and the IBM Informix Dynamic
Server Installation Guide for Microsoft Windows.
After you install a new version of the database server, you must configure it.
The following list identifies the basic configuration requirements that are described
in this chapter:
v Planning for the database server
v Configuring the operating system
v Allocating disk space
v Setting environment variables
v Configuring connectivity information
v Preparing the ONCONFIG configuration file
v Using Server Setup to customize configuration
v Starting and administering the database server
v Monitoring database server activity
You can customize the database server so that it functions optimally in your
particular data-processing environment. For example, using a database server to
serve 1000 users who execute frequent, short transactions is very different from
using a database server to serve a few users making long and complicated
searches.
When you are planning for your database server, consider your priorities and your
environment.
The 32-bit version of Dynamic Server runs on a 64-bit or 32-bit operating system.
The 64-bit version of Dynamic Server must run on a 64-bit operating system. For
more information, see “Memory Use on 64-Bit Platforms” on page 8-32.
You can use the /userva=xxxx switch for more precise tuning of user and kernel
virtual memory space. Use this switch with the 3-gigabyte switch in the [Link]
file to tune the user-mode space to a value that is between 2 and 3 gigabytes, with
the difference (3,072 less xxxx) given back to the kernel mode. Note that xxxx is a
value expressed in megabytes.
The following sample [Link] file shows how to use the new switch to tune a
computer to allocate 2,900 megabytes of user-mode virtual memory and 1,196
megabytes of kernel-mode virtual memory. This increases the available kernel
space by 172 megabytes.
[Boot Loader]
Timeout=30
Default=multi(0)disk(0)rdisk(0)partition(2)\WINNT
[Operating Systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT="Microsoft Windows Server 2003"
/fastdetect /3GB /Userva=2900
If the recommended values for the database server differ significantly from your
current environment, consider modifying your operating-system configuration. For
more information, see your IBM Informix Dynamic Server Performance Guide.
On some operating systems, you can specify the amount of shared memory
allocated to the database server. The amount of available memory influences the
For background information on the role of the UNIX kernel parameters, see
Chapter 9, “Managing Shared Memory,” on page 9-1.
To activate the creation of large chunks, you must use the onmode utility. The
onmode utility uses a -BC flag to control the availability of large chunks, chunks
greater than 2 gigabytes.
When the database server is first migrated to a new version of Dynamic Server,
large chunks are not allowed. Run onmode -BC 1 to allow large chunks to be
created.
If necessary to convert older versions of Dynamic Server to the large chunk format,
execute onmode -BC 2.
If the root chunk is a large chunk at the time the server starts, the onmode -BC 1
step is skipped and -BC 2 mode starts automatically.
The database server uses raw disk access to improve the speed and reliability of
disk I/O operations. Raw disk access bypasses the file-buffering mechanism that
the operating system provides. The database server itself manages the data
transfers between disk and memory. The database server optimizes table access by
guaranteeing that rows are stored contiguously.
Important: While you should use raw disk devices on UNIX to achieve better
performance, recent advances in I/O caching for cooked writes can
provide similar if not better performance. To determine the best device
performance, perform benchmark testing on the system with both
types of devices for the dbspace and table layout.
Cooked Files
If optimum performance is unimportant, you can configure the database server to
store data in cooked files. Cooked files are easier to set up than raw disk devices.
If all of your partitions are FAT partitions, you need to convert at least one
partition to NTFS. You can use the Windows convert utility, as the following
example shows:
convert /fs:ntfs
UNIX Only
On UNIX, the owner and group must be informix, and the permissions must be
set to read and write for both the user and the group (but not for others).
If you want users other than informix or root to execute ON–Bar commands,
create a bargroup group. Only members of bargroup can execute ON–Bar
commands. The bargroup group is not created automatically during database
server installation. For instructions on creating a group, see the IBM Informix
Dynamic Server Installation Guide for UNIX and Linux or your UNIX documentation.
End of UNIX Only
Windows Only
To create a link between the character-special device name and another filename,
use the UNIX link command (usually ln).
Tip: Set the environment variables in the appropriate startup file for your shell file
or Windows.
The IBM Informix Guide to SQL: Reference contains a complete list of environment
variables. For information on how setting environment variables can affect
performance, see your IBM Informix Dynamic Server Performance Guide.
Table 1-1 shows the environment variables that you must set before you access the
database server or perform most administrative tasks.
Table 1-1. Required Environment Variables
Environment Variable Description
CLASSPATH If you are using J/Foundation, specifies the location of jvphome/[Link] file so that
Java Development Kit (JDK) can compile the Java source files.
INFORMIXDIR Specifies the directory where you installed your IBM Informix database server.
INFORMIXSERVER Specifies the name of the default database server. It has the value specified for the
DBSERVERNAME or DBSERVERALIASES configuration parameter.
JVPHOME If you are using J/Foundation, specifies the directory where you installed the IBM
Informix JDBC Driver.
ONCONFIG Specifies the name of the active ONCONFIG file. All users who use database server
utilities such as onstat must set the ONCONFIG environment variable. Users running
client applications do not need to set the ONCONFIG environment variable.
If the ONCONFIG environment variable is not present, the database server uses
configuration values from the onconfig file:
On UNIX: $INFORMIXDIR/etc/onconfig
On Windows: %INFORMIXDIR%\etc\[Link]
On UNIX: $INFORMIXDIR/bin
On Windows: %INFORMIXDIR%\bin
TERM Enables DB–Access to recognize and communicate with the terminal that you are using.
This environment variable is not required for initialization or start up, but it must be set
before you can run an application.
TERMCAP Specifies whether DB–Access should use the information in the termcap file or the
TERMINFO terminfo directory. If required for your system, you might need assistance from the UNIX
INFORMIXTERM system administrator to set these variables because they are highly system dependent.
For more information, see the IBM Informix GLS User's Guide.
To override environment variables that have been automatically set, use a private
environment-variable file, ~/.informix, or assign new values to environment
variables individually. For information about the .informix and [Link] files,
see the IBM Informix Dynamic Server Administrator's Reference.
Figure 1-1 shows a sample setup file that contains environment variables for the
miami database server. LD_LIBRARY_PATH is set to the location of the database
server and ESQL/C library files.
You can set environment variables or override environment variables that have
been automatically set in the following places:
v On Windows, System > Environment > User Variables
v In a command-prompt session
v %INFORMIXDIR%\[Link] batch file
Use this batch file to configure command-prompt utilities.
For more information, see the IBM Informix Guide to SQL: Reference and “Creating
an ONCONFIG File on Windows” on page 1-11.
Configuring Connectivity
The connectivity information allows a client application to connect to any IBM
Informix database server on the network. The connectivity data for a particular
database server includes the database server name, the type of connection that a
client can use to connect to it, the host name of the computer or node on which the
database server runs, and the service name by which it is known.
You must prepare the connectivity information even if the client application and
the database server are on the same computer or node.
You do not need to specify all possible network connections in the sqlhosts file or
registry before you start the database server. But to make a new connection
available, you must take the database server offline and then bring it back to
online mode once again.
If you set up several database servers to use distributed queries, use one of the
following ways to store the sqlhosts information for all the databases:
v In one sqlhosts file, pointed to by INFORMIXSQLHOSTS
v In separate sqlhosts files in each database server directory
Use a text editor or ISA to edit the sqlhosts file. For more information, see
“Configuring Connectivity Using ISA” on page 1-10.
Network-Configuration Files
In addition to the sqlhosts files, TCP/IP connections require entries in the
/etc/hosts and /etc/services files. For IPX/SPX connections, the names of the
auxiliary files depend on the hardware vendor.
Network-Security Files
IBM Informix database servers follow UNIX security requirements for making
connections. Thus, the UNIX system administrator might need to make
modifications to the /etc/passwd, etc/hosts, ~/.rhosts, and other related files.
Use setnet32 to manage sqlhosts information. For information about setnet32, see
the installation information in your client documentation. However, setnet32 does
not allow you to assign a database server to a database server group.
For information about the configuration parameters and how to monitor them, see
Chapter 2, “Configuration Parameters,” on page 2-1 and the chapter on
configuration parameters in the IBM Informix Dynamic Server Administrator's
Reference. For information on the order of files that the database server checks for
configuration values, see “Process Configuration File” on page 4-3.
The template files contain initial values for many of the configuration parameters.
You can use a text editor or ISA to change the configuration parameters in your
ONCONFIG file.
Important: Do not modify or delete the template files. The database server
provides these files as templates and not as functional configuration
files.
Note: If you omit parameters in your copy of the ONCONFIG file, the database
server uses values in the [Link] file for the missing parameters when
the server starts.
After you rename the server instance, you can start the instance.
If starting a new database server, use the oninit command with the -i flag to
initialize the disk space and bring the database server online.
On Windows
On Windows, the database server runs as a service. Use the Service control
application to bring the database server to online mode. To initialize the database
server, click the Dynamic Server service and enter -iy in the Startup Parameters
box.
Another way to initialize the database server on Windows is to use the following
command where dbservername is the database server name:
starts dbservername -iy
To prepare the UNIX startup script, add UNIX and database server utility
commands to the UNIX startup script so that the script performs the following
steps.
ISA provides a sample UNIX script for startup and shutdown that you can
customize in $INFORMIXDIR/etc/[Link].
If different versions of the database server are installed in different directories, you
must reset INFORMIXDIR and repeat the preceding steps for each different
version.
To shut down the database server in a controlled manner whenever UNIX shuts
down, add UNIX and database server utility commands to the UNIX shutdown
script so that the script performs the following steps.
If different versions of the database server are installed in different directories, you
must reset INFORMIXDIR and repeat the preceding steps for each version.
In the UNIX shutdown script, the database server shutdown commands should
execute after all client applications have completed their transactions and exited.
For information about creating databases, see IBM Informix Database Design and
Implementation Guide and IBM Informix Guide to SQL: Tutorial. For information about
how to use client applications, see the IBM Informix DB–Access User's Guide, IBM
Informix ESQL/C Programmer's Manual, IBM Informix ODBC Driver Programmer's
Manual, or IBM Informix JDBC Driver Programmer's Guide.
Tip: To take advantage of the large limit of 4 terabytes per chunk, assign a single
chunk per disk drive. This way of distributing data increases performance.
After the database server is initialized, you can create storage spaces such as
dbspaces, blobspaces, or sbspaces. Use the onspaces utility or ISA to create storage
spaces and chunks.
You must create an sbspace if you are using the following functions:
v J/Foundation (to hold Java JAR files)
v Enterprise Replication (to hold spooled row data)
v Smart large objects (BLOB and CLOB data types)
v Multirepresentational data types (such as DataBlades or HTML data types)
For a description of storage spaces and other physical units such as tblspaces and
extents, see Chapter 10, “Data Storage,” on page 10-1. For a discussion of the
allocation and management of storage spaces, see “Disk-Space Parameters” on
page 2-2 and Chapter 11, “Managing Disk Space,” on page 11-1.
For more information, see the IBM Informix Dynamic Server Enterprise Replication
Guide and J/Foundation Developer's Guide.
You can test your data in the onmode -BC 1 mode. When you are satisfied that
your data has converted correctly, then you can run onmode -BC 2 and thereby
put the server in large -chunk-only mode.
After running onmode -BC 2, reversion is no longer supported. After support for
large chunks is enabled, it cannot be disabled.
Setting Up ontape
If you use ontape as your backup tool, you must set up storage devices (tape
drives) before you can back up and restore data. The ontape utility does not
require a storage manager.
ON–Bar is packaged with IBM Informix Storage Manager (ISM). The storage
manager is an application that manages the storage devices and media that contain
backups. The storage manager handles all media labeling, mount requests, and
storage volumes. ISM can back up data to as many as four storage devices at a
time. ISM stores data on simple tape drives, optical disk devices, and file systems.
However, you can purchase a third-party storage manager if you want to use more
sophisticated storage devices, backups to more than four storage devices at a time,
or backups over a network.
When you plan your storage-space and logical-log backup schedule, make sure
that the storage devices and backup operators are available to perform backups.
For information about configuring and managing storage devices and media, see
the IBM Informix Storage Manager Administrator's Guide or to your third-party
storage-manager documentation.
How often you back up the storage spaces depends on how frequently the data is
updated and how critical it is. A backup schedule might include a complete
(level-0) backup once a week, incremental (level-1) backups daily, and level-2
backups hourly. You also need to perform a level-0 backup after performing
administrative tasks such as adding a dbspace, deleting a logical-log file, or
enabling mirroring.
Monitoring Activity
The IBM Informix database server design lets you monitor every aspect of the
database server. “Monitoring Database Server Activity” on page 1-21 provides
descriptions of the available information, instructions for obtaining information,
and suggestions for its use.
Using Mirroring
When you use disk mirroring, the database server writes data to two locations.
Mirroring eliminates data loss due to storage device failures. If mirrored data
becomes unavailable for any reason, the mirror of the data is available immediately
and transparently to users. For information on mirroring, see Chapter 18,
“Mirroring,” on page 18-1. For instructions on tasks related to mirroring, see
Chapter 19, “Using Mirroring,” on page 19-1.
Important: You should mirror critical dbspaces that contain logical-log files, the
physical log, and the root dbspace.
For more information, see “Temporary Tables” on page 10-26 and Chapter 12,
“Logging,” on page 12-1. For information on how to change logging options, see
Chapter 13, “Managing the Database-Logging Mode,” on page 13-1.
For more information, see “Logging Parameters” on page 2-3 and Chapter 14,
“Logical Log,” on page 14-1. For instructions on creating and modifying the
logical-log configuration, see Chapter 15, “Managing Logical-Log Files,” on page
15-1. For information on backing up the logical log, see the IBM Informix Backup
and Restore Guide.
When the database server starts up, it checks whether the physical log is empty,
because that implies that it shut down in a controlled fashion. If the physical log is
not empty, the database server automatically performs an operation called fast
recovery. Fast recovery automatically restores databases to a state of physical and
logical consistency after a system failure that might have left one or more
transactions uncommitted.
For information on how the database server uses shared memory, see Chapter 8,
“Shared Memory,” on page 8-1. For additional information, see “Shared-Memory
Parameters” on page 2-5 and Chapter 9, “Managing Shared Memory,” on page 9-1.
Enterprise Replication
Enterprise Replication supports asynchronous data replication over geographically
distributed database servers and allows you to replicate both entire databases and
subsets of databases and tables. Enterprise Replication offers limited support of
user-defined data types. For detailed information on Enterprise Replication, see the
IBM Informix Dynamic Server Enterprise Replication Guide.
Using Auditing
If you intend to use database server auditing, you need to specify where audit
records are stored, how to handle error conditions, and so on. You also might want
to change how users are audited if you suspect that they are abusing their access
privileges. For information on tasks related to auditing, see “Auditing Parameters
(UNIX)” on page 2-10 and the IBM Informix Trusted Facility Guide.
For more information on distributed queries, see the IBM Informix Database Design
and Implementation Guide and IBM Informix Guide to SQL: Tutorial.
Informix uses a two-phase commit protocol to ensure that distributed queries are
uniformly committed or rolled back across multiple database servers. For more
information, see Chapter 23, “Multiphase Commit Protocols,” on page 23-1.
Event Alarms
To report situations that require your immediate attention, the database server uses
the event-alarm feature. To use the event-alarm feature, set the ALARMPROGRAM
configuration parameter to the full pathname of an executable file that performs
the necessary administrative actions.
For more information, see the appendix on event alarms and the chapter on
configuration parameters in the IBM Informix Dynamic Server Administrator's
Reference.
For more information on ISA, see the IBM Informix Dynamic Server Administrator's
Reference and the ISA online help.
Message Log
The database server message log is an operating-system file. The messages
contained in the database server message log do not usually require immediate
action. To report situations that require your immediate attention, the database
server uses the event-alarm feature. See “Event Alarms” on page 1-21. You can
view the message log in ISA.
Monitor the message-log size, because the database server appends new entries to
this file. Edit the log as needed, or back it up to tape and delete it.
If the database server experiences a failure, the message log serves as an audit trail
for retracing the events that develop later into an unanticipated problem. Often the
database server provides the exact nature of the problem and the suggested
corrective action in the message log.
You can read the database server message log for a minute-by-minute account of
database server processing in order to catch events before a problem develops.
However, you do not need to perform this kind of monitoring.
For more information, see the chapter on the messages in the IBM Informix
Dynamic Server Administrator's Reference. Also, see IBM Informix Error Messages.
ON-Monitor (UNIX)
ON–Monitor provides a simple way to monitor many aspects of the database
server. Most of the monitoring functions are available under the Status menu. For
more information, see the section about ON–Monitor in the IBM Informix Dynamic
Server Administrator's Reference.
oncheck Utility
The oncheck utility displays information about the database disk configuration
and usage, such as the number of pages used for a table, the contents of the
reserved pages, and the number of extents in a table. For more information about
oncheck, see the IBM Informix Dynamic Server Administrator's Reference.
For more information about the onperf tool, see your IBM Informix Dynamic Server
Performance Guide.
SMI Tables
The system-monitoring interface (SMI) tables are special tables managed by the
database server that contain dynamic information about the state of the database
server. You can use SELECT statements on them to determine almost anything you
might want to know about your database server. For a description of the SMI
tables, see the chapter about the sysmaster database in the IBM Informix Dynamic
Server Administrator's Reference.
System Console
The database server sends messages that are useful to the database server
administrator by way of the system console. To specify the destination pathname of
console messages, set the CONSOLE configuration parameter. For more
information about CONSOLE, see the chapter about configuration parameters in
the IBM Informix Dynamic Server Administrator's Reference.
The changes to CONSOLE take effect after you shut down and restart the database
server.
Windows Only
A database server system administrator can log in to the console from any node to
perform system management and monitoring tasks.
End of Windows Only
Windows Utilities
The following Informix utilities simplify administration of the database server on
Windows.
If you are logged on locally and run ixpasswd, it changes the password for services that
log on as the local informix user. If you are logged on domain and run ixpasswd, it changes
the password for services that log on as domain\informix.
To configure Advanced User Rights on Windows NT, select User Manager > Policies >
User Rights and check the Advanced User Rights option. If you change the Advanced User
Rights for the current user, you need to log off and log back on for the new rights to take
effect.
The ixsu utility is equivalent to the Windows 2000 runas command. To use runas to run a
command shell as another user:
In This Chapter
This chapter provides an overview of the ONCONFIG configuration parameters
that the database server uses and describes different ways of monitoring
configuration information. The chapter can help you decide which parameters are
most crucial for your particular environment and which parameters you can defer
until you are tuning the performance of your database server. For details on each
parameter, see the chapter on configuration parameters in the IBM Informix
Dynamic Server Administrator's Reference.
Disk-Space Parameters
The disk-space parameters control how the database server manages storage space.
Root Dbspace
The first storage space that you allocate is called the root database space, or root
dbspace. It stores all the basic information that describes your database server. Use
the following parameters to describe the root dbspace.
Logging Parameters
Use the logging parameters to control the logical and physical logs.
Logical Log
The logical log contains a record of changes made to a database server instance.
The logical-log records are used to roll back transactions, recover from system
failures, and so on. The following parameters describe logical logging.
If you use the ontape utility, use the following parameters to describe your tape
devices. To use a tape to its full physical capacity, set TAPESIZE and LTAPESIZE to
0 to read/write to the end of the medium.
Message-Log Parameters
The message files provide information about how the database server is
functioning.
Shared-Memory Parameters
The shared-memory parameters affect database server performance.
Information that was specified with the BUFFERS, LRUS, LRU_MAX_DIRTY, and
LRU_MIN_DIRTY configuration parameters prior to Version 10.0 is now specified
using the BUFFERPOOL configuration parameter.
CKPTINTVL Specifies the maximum time interval allowed to elapse before a checkpoint. For
more information, see Chapter 16, “Physical Logging, Checkpoints, and Fast
Recovery,” on page 16-1.
DD_HASHMAX Specifies the maximum number of entries for each hash bucket in the
data-dictionary cache. For more information about setting DD_HASHMAX, see your
IBM Informix Performance Guide.
DD_HASHSIZE Specifies the number of hash buckets in the data-dictionary cache. For more
information about setting DD_HASHSIZE, see your IBM Informix Performance Guide.
Decision-Support Parameters
When you configure virtual shared memory on your system, you must decide
what portion to reserve for decision-support queries. Decision-support queries use
large amounts of the virtual portion of shared memory to perform joins and sort
operations.
2-6 IBM Informix Dynamic Server Administrator’s Guide
Use the following parameters to control how decision-support queries are
processed and to control the amount of memory that the database server allocates
to decision-support queries. For more information about tuning these configuration
parameters, see your IBM Informix Dynamic Server Performance Guide.
You need to set the following parameters to specific values, depending upon the
number of processors on your platform:
v MULTIPROCESSOR
v SINGLE_CPU_VP
v VPCLASS
Restore Parameters
Use the following parameters to control the number of threads that the database
server allocates to offline and online logical recovery. For more information, see
your IBM Informix Dynamic Server Performance Guide.
You can set the ALARMPROGRAM parameter to back up logs automatically as they
fill. For more information, see the IBM Informix Backup and Restore Guide.
Directives Parameters
You can use the following configuration parameters to turn on or off directives that
the database server encounters.
Security-Related Parameters
The following security-related parameters are discussed more fully in Chapter 5,
“Security.”
Specialized Parameters
Some parameters appear in the configuration file only when you use specialized
features of the database server.
UNIX Parameters
Some UNIX platforms have additional configuration parameters. For a description
of these specialized parameters and instructions on using them, see your machine
notes.
Figure 2-1 shows sample output from the oncheck -pr command.
In This Chapter
This chapter explains the concepts and terms that you need to understand in order
to configure client/server communications. The chapter consists of the following
parts:
v Description of client/server architecture
v Database server connection types
v Communication services
v Connectivity files
v ONCONFIG connectivity parameters
v Connectivity environment variables
v Examples of client/server configurations
Client/Server Architecture
IBM Informix products conform to a software design model called client/server. The
client/server model allows you to place an application or client on one computer
and the database server on another computer, but they can also reside on the same
computer. Client applications issue requests for services and data from the
database server. The database server responds by providing the services and data
that the client requested.
You use a network protocol together with a network programming interface to connect
and transfer data between the client and the database server. The following
sections define these terms in detail.
Network Protocol
A network protocol is a set of rules that govern how data is transferred between
applications and, in this context, between a client and a database server. These
rules specify, among other things, what format data takes when it is sent across the
network. An example of a network protocol is TCP/IP.
Clients and database servers gain access to a network driver by way of a network
programming interface. A network programming interface contains system calls or
library routines that provide access to network-communications facilities. An
example of a network programming interface for UNIX is TLI (Transport Layer
Interface). An example of a network programming interface for Windows is
WINSOCK (sockets programming interface).
You can configure the database server to support more than one protocol, but
consider this option only if some clients use TCP/IP and some use IPX/SPX.
To determine the supported protocols for your operating system, see “Database
Server Connection” on page 3-4.
Both client and database server environments must be configured with the same
protocol if client/server communication is to succeed. However, some network
protocols can be accessed through more than one network programming interface.
For example, TCP/IP can be accessed through either TLI or sockets, depending on
which programming interface is available on the operating-system platform.
Therefore, a client using TCP/IP through TLI on one computer can communicate
with a database server using TCP/IP with sockets on another computer, or vice
versa. For an example, see “Using a Network Connection” on page 3-33.
For more information on the CONNECT and DATABASE statements, see the IBM
Informix Guide to SQL: Syntax.
Multiplexed Connection
Some applications connect multiple times to the same database server on behalf of
one user. A multiplexed connection uses a single network connection between the
database server and a client to handle multiple database connections from the client.
Client applications can establish multiple connections to a database server to access
more than one database on behalf of a single user. If the connections are not
multiplexed, each database connection establishes a separate network connection to
the database server. Each additional network connection consumes additional
computer memory and CPU time, even for connections that are not active.
Multiplexed connections enable the database server to create multiple database
connections without consuming the additional computer resources that are
required for additional network connections.
You do not need to make any changes to the sqlhosts file or registry that the
database server uses. The client program does not need to make any special SQL
calls to enable connections multiplexing. Connection multiplexing is enabled
UNIX Only
The following sections describe database server connection types in more detail.
For detailed information about implementing the connections described in the
following sections, see the following topics:
v “Connectivity Files” on page 3-8
v “The sqlhosts Information” on page 3-15
v “ONCONFIG Parameters for Connectivity” on page 3-29
v “Environment Variables for Network Connections” on page 3-31
Local Connections
A local connection is a connection between a client and the database server on the
same computer. The following sections describe these types of local connections.
Shared
Database server
memory
Client
application
Computer
Shared memory provides fast access to a database server, but it poses some
security risks. Errant or malicious applications could destroy or view message
buffers of their own or of other local users. Shared-memory communication is also
vulnerable to programming errors if the client application performs explicit
memory addressing or overindexes data arrays. Such errors do not affect the
database server if you use network communication or stream pipes. For an
example of a shared-memory connection, see “Using a Shared-Memory Connection
(UNIX)” on page 3-31.
For information about the portion of shared memory that the database server uses
for client/server communications, see “Communications Portion of Shared
Memory (UNIX)” on page 8-20. For additional information, you can also see “How
a Client Attaches to the Communications Portion (UNIX)” on page 8-6.
Named pipes are supported for local connections to the database server.
Local-Loopback Connections
A network connection between a client application and a database server on the
same computer is called a local-loopback connection. The networking facilities used
are the same as if the client application and the database server were on different
computers. You can make a local-loopback connection provided your computer is
equipped to process network transactions. Local-loopback connections are not as
fast as shared-memory connections, but they do not pose the security risks of
shared memory.
Communication support services can also include other processing such as data
compression or traffic-based accounting.
Connectivity Files
The connectivity files contain the information that enables client/server
communication. These files also enable a database server to communicate with
another database server. The connectivity configuration files can be divided into
three groups:
v Network-configuration files
v Network security files
v The sqlhosts file or SQLHOSTS registry
Network-Configuration Files
This section identifies and explains the use of network-configuration files on
TCP/IP and IPX/SPX networks.
The network administrator maintains these files. When you add a host or a
software service such as a database server, you need to inform the network
administrator so that person can make sure the information in these files is
accurate.
Although the length of the host name is not limited in the hosts file, Informix
limits the host name to 256 bytes. Table 3-4 on page 3-25 includes a sample hosts
file.
The services file contains an entry for each service available through TCP/IP. Each
entry is a single line that contains the following information:
v Service name
IBM Informix products use this name to determine the port number and
protocol for making client/server connections. The service name can have up to
128 bytes.
v Port number and protocol
The port number is the computer port, and the protocol for TCP/IP is tcp.
The operating system imposes restrictions on the port number. User informix
must use a port number equal to or greater than 1024. Only root users are
allowed to use a port number less than 1024.
v Aliases (optional)
The service name and port number are arbitrary. However, they must be unique
within the context of the file and must be identical on all computers that are
running IBM Informix client/server products. The aliases field is optional. For
example, a services file might include the following entry for a database server:
server2 1526/tcp
This entry makes server2 known as the service name for TCP port 1526. A database
server can then use this port to service connection requests. Figure 3-4 on page 3-19
includes a sample services file.
Important: For database servers that communicate with other database servers,
you must define a TCP/IP connection in DBSERVERNAME or
DBSERVERALIAS even when both instances reside on the same
machine.
For information about the hosts and services files, see your operating system
documentation.
TCP/IP Connectivity Files on UNIX: On UNIX, the hosts and services files are in
the /etc directory. The files must be present on each computer that runs an IBM
Informix client/server product, or on the NIS server if your network uses Network
Information Service (NIS).
Warning: On systems that use NIS, the /etc/hosts and /etc/services files are
maintained on the NIS server. The /etc/hosts and /etc/services files that
reside on your local computer might not be used and might not be up to
date. To view the contents of the NIS files, enter the following
commands on the command line:
ypcat hosts
ypcat services
Alternately, you can configure TCP/IP to use the Domain Name Service (DNS) for
host name resolutions. For information about these files, see your operating-system
documentation.
For advice on how to set configuration files for these software products, consult
the manuals that accompany your IPX/SPX software.
On some networks, the host name that a remote host uses to connect to a
particular computer might not be the same as the host name that the computer
uses to refer to itself. For example, the network host name might contain the fully
qualified domain name (FQDN), as in the following example:
fully_qualified_domain_name.[Link]
By contrast, the computer might refer to itself with the local host name, as the
following example shows:
viking
As an alternative, an individual user can list hosts from which he or she can
connect as a trusted user in the .rhosts file. This file resides in the user’s home
directory on the computer on which the database server resides.
Windows Only
On UNIX, the netrc information resides in the .netrc file in the user’s home
directory. Use any standard text editor to prepare the .netrc file. Windows
maintains the netrc information in the registry keys. Use the Host Information tab
of setnet32 to edit the netrc information.
If you do not explicitly provide the user password in an application for a remote
server (that is, through the USER clause of the CONNECT statement or the user
name and password prompts in DB–Access), the client application looks for the
user name and password in the netrc information. If the user has explicitly
specified the password in the application, or if the database server is not remote,
the netrc information is not consulted.
The database server uses the netrc information regardless of whether it uses the
default authentication policy or a communications support module.
For information about the specific content of this file, see your operating system
documentation.
Windows Only
The following examples show how you can provide a password to impersonate a
client.
File or Statement Example
netrc information machine trngpc3 login bruce password im4golf
CONNECT statement CONNECT TO ol_trngpc3 USER bruce USING
″im4golf″
Each entry (each line) in the sqlhosts file contains the sqlhosts information for one
database server. Use white space (spaces, tabs, or both) to separate the fields. Do not
include any spaces or tabs within a field. To put comments in the sqlhosts file, start
a line with the comment character (#). You can also leave lines completely blank
for readability. Additional syntax rules for each of the fields are provided in the
following sections, which describe the entries in the sqlhosts file. Use any standard
text editor to enter information in the sqlhosts file.
Each computer that hosts a database server or a client must include the
connectivity information either in the sqlhosts registry key or in a central registry.
When the client application runs on the same computer as the database server,
they share a single sqlhosts registry key.
Location of the SQLHOSTS Registry Key: When you install the database server,
the installation program asks where you want to store the SQLHOSTS registry key.
You can specify one of the following two options:
v The local computer where you are installing the database server
v Another computer in the network that serves as a central, shared repository of
sqlhosts information for multiple database servers in the network
Using a shared SQLHOSTS registry key relieves you of the necessity to maintain
the same sqlhosts information on multiple computers. However, the hosts and
services files on each computer must contain information about all computers that
have database servers.
If you specify a shared sqlhosts registry key, you must set the
INFORMIXSQLHOSTS environment variable on your local computer to the name
of the Windows computer that stores the registry. The database server first looks
for the sqlhosts registry key on the INFORMIXSQLHOSTS computer. If the
database server does not find an sqlhosts registry key on the
INFORMIXSQLHOSTS computer, or if INFORMIXSQLHOSTS is not set, the
database server looks for an sqlhosts registry key on the local computer.
You must comply with Windows network-access conventions and file permissions
to ensure that the local computer has access to the shared sqlhosts registry key. For
information about network-access conventions and file permissions, see your
Windows documentation.
Figure 3-2 illustrates the location and contents of the SQLHOSTS registry key for
the database server payroll.
HARDWARE HOST:REG_SZ:dewar
OPTIONS:REG_SZ:
SAM
PROTOCOL:REG_SZ:onsoctcp
SECURITY SERVICE:REG_SZ:py1
SOFTWARE
Classes
Description
INFORMIX
ESQL/C
OnLine
SQLHOSTS
payroll
Microsoft
The connectivity information for each database server includes four fields of
required information and one optional field. The group information contains
information in only three of its fields.
The five fields of connectivity information form one line in the UNIX sqlhosts file.
On Windows, the database server name is assigned to a key in the SQLHOSTS
registry key, and the other fields are values of that key. The following table
summarizes the fields used for the sqlhosts information.
Description of Description of
UNIX Windows Connectivity Group
Field Name Field Name Information Information
dbservername Database server name key or Database server name Database server group name
database server group key
nettype PROTOCOL Connection type The word group
hostname HOST Host computer for the No information.
database server Use a hyphen as a
placeholder in this field.
servicename SERVICE Alias for the port number No information.
Use a hyphen as a
placeholder in this field.
options OPTIONS Options that describe or limit Group options
the connection
If you install IBM Informix Enterprise Gateway with DRDA in the same directory
as the database server, your sqlhosts file also contains entries for the Gateway and
non-Informix database servers. However, this manual covers only the entries for
the database server. For information about other entries in the sqlhosts file, see the
IBM Informix Enterprise Gateway with DRDA User Manual.
End of UNIX Only
Connectivity Information
The next section describes the connectivity information that is in each field of the
sqlhosts file or SQLHOSTS registry key.
The dbservername field can include any printable character other than an
uppercase character, a field delimiter, a new line character, or a comment character.
This field is limited to 128 bytes.
UNIX Only
If the sqlhosts file has multiple entries with the same dbservername, only the first
one is used.
End of UNIX Only
d d i i i p p p
Database Server Product: The first two letters of the connection-type field
represent the database server product.
Interface Type: The middle three letters of the connection-type field represent the
network programming interface that enables communications. For more
information, see “Network Programming Interface” on page 3-3.
Interface
Subfield Type of Interface
ipc IPC (interprocess communications)
soc Sockets
tli TLI (transport layer interface)
Interprocess communications (IPC) are used only for communications between two
processes running on the same computer.
Network Protocol Entry: The final three letters of the connection-type field
represent the network protocol or specific IPC mechanism.
Protocol
Subfield Type of Protocol
imc TCP/IP network protocol used with IBM Informix MaxConnect
nmp Named-pipe communication
shm Shared-memory communication
spx IPX/SPX network protocol
str Stream-pipe communication
tcp TCP/IP network protocol
IPC connections use shared memory or stream pipes. The database server supports
two network protocols: TCP/IP and IPX/SPX.
Table 3-2 summarizes the possible connection-type values for database server
connections. For more information on MaxConnect protocols, see “Using IBM
Informix MaxConnect” on page 3-35.
For information on the connection types for your platform, see “Connections That
the Database Server Supports” on page 3-5.
The following sections explain how client applications derive the values used in
the host name field.
Network Communication with TCP/IP: When you use the TCP/IP network
protocol, the host name field is a key to the hosts file, which provides the network
address of the computer. The name that you use in the host name field must
correspond to the name in the hosts file. In most cases, the host name in the hosts
file is the same as the name of the computer. For information about the hosts file,
see “TCP/IP Connectivity Files” on page 3-8.
In some situations, you might want to use the actual Internet IP address in the
host name field. For information about using the IP address, see “IP Addresses for
TCP/IP Connections” on page 3-25.
Network Communication with IPX/SPX (UNIX): When you use the IPX/SPX
network protocol, the hostname field must contain the name of the NetWare file
server. The name of the NetWare file server is usually the UNIX hostname of the
computer. However, this is not always the case. You might need to ask the
NetWare administrator for the correct NetWare file server names.
Network Communication with TCP/IP: When you use the TCP/IP connection
protocol, the service name field must correspond to a service name entry in the
services file. The port number in the services file tells the network software how to
find the database server on the specified host. It does not matter what service
name you choose, as long as you agree on a name with the network administrator.
Figure 3-4 shows the relationship between the sqlhosts file or registry and the
hosts file, as well as the relationship of sqlhosts to the services file.
hosts file
IP address hostname alias
[Link] knight
services file
service name port#/protocol
sales_ol 1543/tcp
Figure 3-4. Relationship of sqlhosts File or Registry to hosts and services Files
In some cases, you might use the actual TCP listen-port number in the service
name field. For information about using the port number, see “Port Numbers for
TCP/IP Connections” on page 3-28.
Options Field
The options field includes entries for the following features.
When you change the values in the options field, those changes affect the next
connection that a client application makes. You do not need to stop and restart the
client application to allow the changes to take effect. However, a database server
reads its own connectivity information only during initialization or database-server
restart. If you change the options for the database server, you must restart the
database server to allow the changes to take effect.
Syntax Rules for the Options Field: Each item in the options field has the
following format:
letter=value
You can combine several items in the options field, and you can include them in
any order. The maximum length of the options field is 256 bytes.
You can use either a comma or white space as the separator between options. You
cannot use white space within an option.
The database server evaluates the options field as a series of columns. A comma or
white space in the options field represents an end of a column. Client and
database server applications check each column to determine whether the option is
supported. If an option is not supported, you are not notified. It is merely ignored.
Buffer-Size Option: Use the buffer-size option (b=value) to specify in bytes the
size of the communications buffer space. The buffer-size option applies only to
connections that use the TCP/IP network protocol. Other types of connections
ignore the buffer-size setting. You can use this option when the default size is not
efficient for a particular application. The default buffer size for the database server
using TCP/IP is 4096 bytes.
Adjusting the buffer size allows you to use system and network resources more
efficiently; however, if the buffer size is set too high, the user receives a
connection-reject error because no memory can be allocated. For example, if you
set b=64000 on a system that has 1000 users, the system might require 64
megabytes of memory for the communications buffers. This setting might exhaust
the memory resources of the computer.
On many operating systems, the maximum buffer size supported for TCP/IP is 16
kilobytes. To determine the maximum allowable buffer size, see the documentation
for your operating system or contact the technical-support services for the vendor
of your platform.
Tip: Use the default size for the communications buffer. If you choose to set the
buffer size to a different value, set the client-side communications buffer and
the database server-side communications buffer to the same size.
The following table shows the possible settings for the connection-redirection
option.
Setting Result
c=0 By default, a client application connects to the first database server
instance listed in the dbserver group in the sqlhosts file. If the
client cannot connect to the first instance, it attempts to connect to
the second instance and so on.
The value of csmname must match a csmname entry in the [Link] file. The
connection-options parameter overrides the default csm-connection options specified
in the [Link] file.
The following example specifies that the ENCCSM communication support module
will be used for the connection:
csm=(ENCCSM)
If no end-of-group option is specified for a group, the group members are assumed
to be contiguous. The end of group is determined when an entry is reached that
does not belong to the group, or at the end of file, whichever comes first. For an
example of the end-of-group option, see Table 3-3 on page 3-23.
Group Option: When you define database server groups in the sqlhosts file or
registry, you can use multiple related entries as one logical entity to establish or
change client/server connections.
For more information, see preparing the replication environment in the IBM
Informix Dynamic Server Enterprise Replication Guide.
Important: Database server groups cannot be nested inside other database server
groups, and database server group members cannot belong to more
than one group.
The example in Table 3-3 shows the following two groups: asia and peru. Group
asia includes the following members:
v asia.1
v asia.2
v asia.3
Because group asia uses the end-of-group option (e=asia.3), the database server
searches for group members until it reaches asia.3, so the group includes usa.2.
Because group peru does not use the end-of-group option, the database server
continues to include all members until it reaches the end of file.
Table 3-3 shows examples of database server groups in the sqlhosts file.
Table 3-3. Database Server Groups in sqlhosts File or Registry
dbservername nettype hostname servicename options
asia group – – e=asia.3
asia.1 ontlitcp node6 svc8 g=asia
asia.2 onsoctcp node0 svc1 g=asia
usa.2 ontlispx node9 sv2
asia.3 onsoctcp node1 svc9 g=asia
peru group – –
peru.1 ontlitcp node4 svc4
peru.2 ontlitcp node5 svc5 g=peru
peru.3 ontlitcp node7 svc6
usa.1 onsoctcp [Link] sales_ol k=1, s=0
For more information on the use of the identifier option, see the IBM Informix
Dynamic Server Enterprise Replication Guide.
Keep-Alive Option: The keep-alive option is a network option that TCP/IP uses.
It does not affect other types of connections. If you do not include the keep-alive
option in the options field, the keep-alive feature is enabled by default. To set the
keep-alive option on the database server side only, the client side only, or on both
sides, specify k=1 in the fifth column of the sqlhosts file. For most cases, you
should enable the keep-alive option.
When a connected client and server are not exchanging data and the keep-alive
option is enabled, the network service checks the connection periodically. If the
receiving end of the connection does not respond within the time specified by the
parameters of your operating system, the network service immediately detects the
broken connection and frees resources.
When the keep-alive option is disabled, the network service does not check
periodically whether the connection is still active. If the opposite end of the
connection terminates unexpectedly without any notification, as when a PC
reboots, for example, the network service might never detect that the connection is
broken.
The security options let you control the way that a client (user) gains access to a
database server. By default, an Informix database server uses the following
information on the client computer to determine whether the client host computer
is trusted:
v [Link]
v rhosts information
With the security options, you can specifically enable or disable the use of either or
both files.
For example, if you want to prevent end users from specifying trusted hosts in
rhosts, you can set s=1 in the options field of the sqlhosts file or SQLHOSTS
registry key for the database server to disable the rhosts lookup.
Important: Do not disable the [Link] lookup in database servers that are
used in distributed database operations. That is, if you expect to use
the database server in distributed processing, do not set s=0 or s=2.
Group Information
The following section describes the fields of the sqlhosts file or registry for groups.
UNIX Only
You can find the IP address in the net address field of the hosts file, or you can
use the UNIX arp or ypmatch command.
End of UNIX Only
Windows Only
You can configure Windows to use either of the following mechanisms to resolve
Internet Domain Addresses ([Link]) to Internet Protocol
addresses ([Link]):
v Windows Internet Name Service
v Domain Name Server
If the preceding conditions are met, you can use an asterisk (*) as a wildcard in the
host name field that the database server uses. When you enter a wildcard in the
host name field, the database server can accept connections at any valid IP address
on its host computer.
Each IP address is associated with a unique host name. When a computer has
multiple network-interface cards (NICs), as in Figure 3-5 on page 3-27, the hosts
file must have an entry for each interface card. For example, the hosts file for the
texas computer might include these entries.
You can use the wildcard (*) alone or as a prefix for a host name or IP address, as
shown in Table 3-5 on page 3-27.
If the client application and database server share connectivity information (the
sqlhosts file or the SQLHOSTS registry key), you can specify both the wildcard
The wildcard format allows the listen thread of the database server to wait for a
client connection using the same service port number on each of the valid
network-interface cards. However, waiting for connections at multiple IP addresses
might require slightly more CPU time than waiting for connections with a specific
host name or IP address.
Figure 3-5 shows a database server on a computer (texas) that has two
network-interface cards. The two client sites use different network cards to
communicate with the database server.
iowa
Client
texas
texas_srvr
kansas
Client
Network
programming
interfaces
Table 3-5 shows the connectivity information for the texas_srvr database server.
Table 3-5. Possible Connectivity Entries for the texas_srvr Database Server
database server name connection type host name service name
texas_srvr ontlitcp *texas1 pd1_on
texas_srvr ontlitcp *[Link] pd1_on
texas_srvr ontlitcp *texas2 pd1_on
texas_srvr ontlitcp *[Link] pd1_on
texas_srvr ontlitcp * pd1_on
Tip: For clarity and ease of maintenance, you should include a host name when
you use the wildcard in the host name field (that is, use *host instead of
simply *).
The client application on kansas can use any of the following host names: texas2,
*texas2, [Link], or *[Link].
For example, if the port number for the sales database server in the services file is
1543/tcp, you can write an entry in the sqlhosts file as follows:
Using the actual port number might save time when you make a connection in
some circumstances. However, as with the IP address in the host name field, using
the actual port number might make administration of the connectivity information
less convenient.
4 IBM Informix Dynamic Server Version 10.00.UC4 and CSDK 2.90.UC4 initially
4 check to determine whether IPv6 is supported in the underlying operating system.
4 If IPv6 is supported, the IPv6 address is used. If the underlying operating system
4 does not support IPv6, the IPv4 address is used. Dynamic Server and CSDK
4 retrieve the IP address from the name service.
You can treat Dynamic Server that runs on a host with both IPv4 and IPv6
addresses the same way you treat a server running on a multi-homed host. You
can configure Dynamic Server on a host with both IPv4 and IPv6 addresses in
either of the following ways:
v Create aliases (using the DBSERVERALIASES configuration parameter) and
assign an IPv6 address to one of them and an IPv4 address to the other.
Note the asterisk in front of the hostname. This is the same naming scheme that
currently exists for the servers in a multi-homed host. Starting with Dynamic
Server Version 10.0, the hostname entry in the SQLHOSTS file maps to an IPv6
address if the host has a configured IPv6 address. If the host does not have a
configured IPv6 address, the hostname entry maps to an IPv4 address. The
hostname with a preceding asterisk maps to a wildcard address.
Client applications specify the name of the database server in one of the following
places:
v In the INFORMIXSERVER environment variable
v In SQL statements such as CONNECT, DATABASE, CREATE TABLE, and
ALTER TABLE, which let you specify a database environment
v In the DBPATH environment variable
Windows Only
DBSERVERNAME sockets_srvr
DBSERVERALIASES ipx_srvr,shm_srvr
The sqlhosts entries associated with the dbservernames from Figure 3-6 could
include those shown in Figure 3-7. Because each dbservername has a
corresponding entry in the sqlhosts file or SQLHOSTS registry key, you can
associate multiple connection types with one database server.
Figure 3-7. Three Entries in the sqlhosts File for One Database Server in UNIX format
Using the sqlhosts file shown in Figure 3-7, a client application uses the following
statement to connect to the database server using shared-memory communication:
CONNECT TO ’@shm_srvr’
A client application can initiate a TCP/IP sockets connection to the same database
server using the following statement:
CONNECT TO ’@sockets_srvr’
DBSERVERALIASES must begin with a lowercase letter and can contain other
lowercase letters, digits, and underscores. DBSERVERALIASES should not include
uppercase characters, a field delimiter (space or tab), or a new line character. Other
characters from the basic ASCII code set are not necessarily reliable. For example, a
hyphen or minus sign can create problems and a colon might not work reliably.
The @ character is reserved to separate the database from the server (as in
dbase@server).
For more information on environment variables, see the IBM Informix Guide to SQL:
Reference.
river
river_shm
Shared
Database server
memory
Client
The table below shows a sample entry in the sqlhosts file or SQLHOSTS registry
key for the connection shown above in Figure 3-8.
Table 3-6. sqlhosts entry
dbservername nettype hostname servicename
river_shm onipcshm river rivershm
The client application connects to this database server using the following
statement:
CONNECT TO ’@river_shm’
river
TCP/IP network
river_soc programming
interface
Client Database server
SOC - TCP
The following table shows the correct entry for the sqlhosts file or SQLHOSTS
registry key for the connection shown above in Figure 3-9.
Table 3-7. sqlhosts entry
dbservername nettype hostname servicename
river_soc onsoctcp river riverol
If the network connection uses TLI instead of sockets, only the nettype entry in
this example changes. In that case, the nettype entry is ontlitcp instead of
onsoctcp.
river
sqlhosts entry on river
dbservername nettype hostname servicename options
Client
valley_ds onsoctcp valley valleyol
SOC - TCP
TLI - TCP
sqlhosts entry on valley
valley
An entry for the valley_ds database server is in the sqlhosts files or registries on
both computers. Each entry in the sqlhosts file or SQLHOSTS registry key on the
computer where the database server resides has a corresponding entry on the
computer where the client application resides.
UNIX Only
Both computers are on the same TCP/IP network, but the host river uses sockets
for its network programming interface, while the host valley uses TLI for its
network programming interface. The nettype field must reflect the type of network
programming interface used by the computer on which sqlhosts resides. In this
example, the nettype field for the valley_ds database server on host river is
onsoctcp, and the nettype field for the valley_ds database server on host valley is
ontlitcp.
End of UNIX Only
When you want the database server to accept more than one type of connection,
you must take the following actions:
v Put DBSERVERNAME and DBSERVERALIASES entries in the ONCONFIG
configuration file.
v Put an entry in the sqlhosts file or SQLHOSTS registry key for each database
server/connection type pair.
For the configuration in Figure 3-11, the database server has two dbservernames:
river_net and river_shm. The ONCONFIG configuration file includes the following
entries:
DBSERVERNAME river_net
DBSERVERALIASES river_shm
river
Database server A
SOC - TCP
valley TLI - TCP
sqlhosts entries on valley
In the sqlhosts file or registry, the nettype value associated with river_net specifies
a network (TCP/IP) connection, so client B uses a network connection.
river
Shared memory riverA_shm
Database server A
Client
SOC - TCP riverB_soc
Database server B
For the configuration in Figure 3-12, you must prepare two ONCONFIG
configuration files, one for database server A and the other for database server B.
The sqlhosts file or SQLHOSTS registry key includes the connectivity information
for both database servers.
The ONCONFIG configuration file for database server A includes the following
line:
DBSERVERNAME riverA_shm
The ONCONFIG configuration file for database server B includes the following
line:
DBSERVERNAME riverB_soc
Install MaxConnect separately from your Informix database server and client
applications. For maximum performance benefit, install MaxConnect either on a
separate computer to which Informix clients connect or on the client application
server. You can install MaxConnect in the following configurations:
v On a dedicated server to which Informix clients connect
v On the client application server
v On the database server computer
Two protocols for multiplexing connections, ontliimc and onsocimc, are available
for MaxConnect users. You can use the ontliimc and onsocimc protocols in the
following two configurations:
v To connect MaxConnect to the database server.
In this configuration, the client connections are multiplexed and use packet
aggregation.
v To connect the client applications directly to the database server without going
through MaxConnect.
In this configuration, the client does not get the benefits of connection
multiplexing or packet aggregation. Choose this configuration when the client
application is transferring simple- or smart-large-object data, because a direct
connection to the database server is best.
For more information on how to configure MaxConnect and monitor it with the
onstat -g imc and imcadmin commands, see the IBM Informix MaxConnect User's
Guide.
Important: MaxConnect and the IBM Informix MaxConnect User's Guide ship
separately from the Informix database server.
In This Chapter
This chapter tells how to initialize the database server, describes the activities that
take place during initialization, describes database server operating modes, and
provides information on changing operating modes.
Types of Initialization
Initialization of the database server refers to two related activities: shared-memory
initialization and disk-space initialization.
Disk-space initialization uses the values stored in the configuration file to create the
initial chunk of the root dbspace on disk. When you initialize disk space, the
database server automatically initializes shared memory as part of the process.
Disk space is initialized the first time the database server starts up. It is only
initialized thereafter during a cold restore or at the request of the database server
administrator.
Warning: When you initialize disk space, you overwrite whatever is on that disk
space. If you reinitialize disk space for an existing database server, all
the data in the earlier database server becomes inaccessible and, in
effect, is destroyed.
If you are starting a database server for the first time or you want to remove all
dbspaces and their associated data, use the following methods to initialize the disk
space and to bring the database server into online mode.
Warning: When you execute these commands, all existing data in the database
server disk space is destroyed. Use the -i flag only when you are starting
a new instance of the database server.
You can use the oninit -s option to initialize shared memory and leave the
database server in quiescent mode.
Windows Only
When you install the database server and choose to initialize a new instance of the
database server, or when you use the instance manager program to create a new
instance of the database server, the database server is initialized for you.
Recommendation: Do not use the oninit -iy command to initialize the database
server unless you are diagnosing a problem.
End of Windows Only
For information on using these utilities to initialize the database server and change
the database server mode, see “Starting the Database Server and Initializing Disk
Space” on page 1-14.
Initialization Steps
Disk-space initialization always includes the initialization of shared memory.
However, some activities that normally take place during shared-memory
initialization, such as recording configuration changes, are not required during disk
initialization because those activities are not relevant with a newly initialized disk.
Table 4-1 shows the main tasks completed during the two types of initialization.
The following sections discuss each step.
Table 4-1. Initialization Steps
Shared-Memory Initialization Disk Initialization
Process configuration file. Process configuration file.
Create shared-memory segments. Create shared-memory segments.
Initialize shared-memory structures. Initialize shared-memory structures.
Initialize disk space.
Start all required virtual processors. Start all required virtual processors.
Make necessary conversions.
Initiate fast recovery.
Initiate a checkpoint. Initiate a checkpoint.
Document configuration changes.
Update oncfg_servername.servernum file. Update oncfg_servername.servernum file.
Change to quiescent mode. Change to quiescent mode.
Drop temporary tblspaces (optional).
Set forced residency, if requested. Set forced residency, if specified.
Change to online mode and return control to user. Change to online mode and return control to user.
If the SMI tables are not current, update the tables. Create sysmaster database that contains the SMI tables.
Create the sysutils database.
Monitor maximum number of user connections at each Monitor maximum number of user connections at each
checkpoint. checkpoint.
You should always set the ONCONFIG environment variable before you initialize
or restart the database server. The default configuration files are intended as
templates and not as functional configurations. However, the server will not
initialize if onconfig_std is missing. For more information about the configuration
file, see “Configuring the Database Server” on page 1-11.
The restart process compares the values in the current configuration file with the
previous values, if any, that are stored in the root dbspace reserved page,
PAGE_CONFIG. When differences exist, the database server uses the values from
the current ONCONFIG configuration file when the database server is restarted.
To create shared memory, the database server acquires the shared-memory space
from the operating system for three different types of memory:
v Resident portion, used for data buffers and internal tables
v Virtual portion, used for most system and user-session memory requirements
UNIX Only
Next, the database server attaches shared-memory segments to its virtual address
space and initializes shared-memory structures. For more information about
shared-memory structures, see “Virtual Portion of Shared Memory” on page 8-13.
After initialization is complete and the database server is running, it can create
additional shared-memory segments as needed. The database server creates
segments in increments of the page size.
After the database server remaps the shared-memory space, it registers the new
starting addresses and sizes of each structure in the new shared-memory header.
During shared-memory initialization, disk structures and disk layout are not
affected. The database server reads essential address information, such as the
locations of the logical and physical logs, from disk and uses this information to
update pointers in shared memory.
Fast recovery is not performed during disk-space initialization because there is not
yet anything to recover.
Start a Checkpoint
After fast recovery executes, the database server starts a full checkpoint. As part of
the checkpoint procedure, the database server writes a checkpoint-complete
message in the message log. For more information about checkpoints, see
“Checkpoints” on page 16-7.
The database server now moves to quiescent mode or online mode, depending on
how you started the initialization or database-server restart process.
For more information about the oncfg_servername.servernum file, see the section
on files that the database server uses in the IBM Informix Dynamic Server
Administrator's Reference.
This task is performed when the database server is restarted; it is not performed
during disk-space initialization.
At this point, control returns to the user. Any error messages generated by the
initialization procedure are displayed in the following locations:
v The command line
v The database server message log file, specified by the MSGPATH configuration
parameter
For more information about the MSGPATH parameter, see the IBM Informix
Dynamic Server Administrator's Reference.
v Summary section of IBM Informix Server Administrator (ISA)
If you shut down the database server before it finishes building the SMI tables, the
process of building the tables stops. This condition does not damage the database
server. The database server simply builds the SMI tables the next time that you
bring the database server online. However, if you do not allow the SMI tables to
finish building, you cannot run any queries against those tables, and you cannot
use ON–Bar for backups.
After the SMI tables have been created, the database server is ready for use. The
database server runs until you stop it or, possibly, until a malfunction.
The number displayed is reset when the customer reinitializes the database server.
Table 4-2 shows the principal modes of operation of the database server.
Administrators use this mode to perform Other users can view database-server status
maintenance functions that do not require information, but they cannot access the
the execution of SQL and DDL statements. database server.
Single-User mode This mode is an intermediary mode Only the administrator (user informix) can
between Quiescent mode and Online mode. access the database server.
Administrators use this mode to perform Other users can view database-server status
any maintenance task, including tasks information, but they cannot access the
requiring the execution of SQL and DDL database server.
statements. Administrators can also
perform all other functions available in
Online mode.
Online mode This is the normal operating mode of the Any authorized user can connect with the
database server. database server and perform all database
activities.
In addition, the database server can also be in one of the following modes:
v Read-only mode is used by the secondary database server in an HDR pair. An
application can query a database server that is in read-only mode, but the
application cannot write to a read-only database.
v Recovery mode is transitory. It occurs when the database server performs fast
recovery or recovers from a system archive or system restore. Recovery occurs
during the change from offline to quiescent mode.
v Shutdown mode is transitory. It occurs when the database server is moving from
online to quiescent mode or from online (or quiescent) to offline mode. Current
users access the system, but no new users are allowed access.
After shutdown mode is initiated, it cannot be cancelled.
Windows Only
To start and stop the database server, you can use other Windows tools, such as
the NET command and the Server Manager tool. For more information about these
methods, consult your Windows operating-system documentation.
Tip: After you change the mode of your database server, execute the onstat
command to verify the current server status.
Only users who are logged in as root or informix can change the operating mode
of the database server.
End of UNIX Only
Windows Only
Table 4-2 on page 4-8 shows which users can change the operating mode of the
database server in Windows. If you use ISA, you can log in to the operating
system as any user but you must log in to Apache as user informix. The Apache
server runs as a member of the Informix-Admin group.
Table 4-3. Changing Operating Modes in Windows
Changing Operating Mode Administrators Group Informix-Admin Group
command-line utilities X
such as starts
ISA X
Services control panel X
If you have already taken the database server from online mode to quiescent mode
and you are now returning the database server to online mode, any users who
were interrupted in earlier processing must reselect their database and redeclare
their cursors.
Operating System Action
UNIX or Windows
v Execute onmode -m.
Windows only
v With the Services tool, choose the database
server service and click Continue.
After you perform this task, the database server sets a flag that prevents new
sessions from gaining access to the database server. Current sessions are allowed to
finish processing.
After you initiate the mode change, it cannot be cancelled. During the mode
change from online to quiescent, the database server is considered to be in
Shutdown mode.
Operating System Action
UNIX or Windows
v Execute onmode -s or onmode -sy.
Windows only
A prompt asks for confirmation of the immediate shutdown. If you confirm, the
database server sends a disconnect signal to all sessions that are attached to shared
memory. If a session does not receive the disconnect signal or is not able to comply
automatically within 10 seconds, the database server terminates the session.
The database server users receive either error message -459 indicating that the
database server was shut down or error message -457 indicating that their session
was unexpectedly terminated.
The database server cleans up all sessions that the database server terminated.
Active transactions are rolled back.
Operating System Action
UNIX or Windows
v Execute onmode -u or onmode -uy.
The -y option eliminates the need to confirm the
prompt.
If you begin in online mode, the database server automatically disconnects any
users who are connected with any user ID that is not user informix and the users
receive an error message. If a connection is terminated during a transaction, the
database server rolls back the transaction.
Change to single-user mode when you want to execute SQL and DLL commands
when no other users are connected.
Operating System Action
UNIX or Windows
v Execute onmode -j.
A prompt asks for confirmation to go offline. If you confirm, the database server
initiates a checkpoint request and sends a disconnect signal to all sessions that are
attached to shared memory. If a session does not receive the disconnect signal or is
not able to comply automatically within 10 seconds, the database server terminates
this session.
The database server users receive either error message -459 indicating that the
database server was shut down or error message -457 indicating that their session
was unexpectedly terminated.
After you take the database server to offline mode, restart the database server in
quiescent, single-user, or online mode. When you restart the database server, it
performs a fast recovery to ensure that the data is logically consistent.
The database server cleans up all sessions that were terminated by the database
server. Active transactions are rolled back.
Operating System Action
UNIX or Windows
v Execute onmode -k or onmode -ky. The -y
option eliminates the automatic prompt that
confirms an immediate shutdown.
Windows only
v With the Services tool, choose the database
server service and click Stop.
In This Chapter
This chapter contains information on these database server security features:
v A server utilities check for a secure environment before Dynamic Server starts on
UNIX or Linux
v A default role that you can assign to individual users or to the PUBLIC group
for a particular database
v Configuration parameters that you can use to reduce the incomplete connection
timeout period and restrict the number of incomplete requests for connections,
thus reducing the risk of a hostile, denial-of-service (DOS) flood attack
v Password, data-transmission, and column-level encryption options
v The Pluggable Authentication Module (PAM) for Dynamic Server systems
running on UNIX or Linux
v The Lightweight Directory Access Protocol (LDAP) Authentication Support for
Dynamic Server systems running on Windows
v The Enterprise Replication and High-Availability Data Replication connection
security option
v A security option that you can use to prevent unauthorized users from
registering external routines
Warning: The database server does not read configuration files if they are publicly
writable, unless the INFORMIXDIR environment variable is designated
as secure in the /etc/informix directory. See information on “Disabling
Security Checking” and “Securing an Insecure Environment.”
Note: You can specify the value of INFORMIXDIR on the command line as an
argument to the script. Thus, you do not need to set INFORMIXDIR in the
root user environment.
Note: The format of the contents of the [Link] files might change in
future releases.
If you choose to disable the security checking even though it is recommended that
you never do so, you should use the ibmifmx_security.sh script to limit the
number of SUID and SGID programs on your system.
Although user informix has permission to run the script, the script cannot fix the
problems unless the directory is owned by user informix. However, the error
messages indicate what still needs to be fixed. The script also shows files and
directories under $INFORMIXDIR that belong to an unexpected owner or group or
have public write permission.
For the following problems, one of the following messages displays and the utility
continues:
For the following problems, the utility exits and displays one of the following
messages:
v User informix not found.
v Group informix not found.
v Could not access logical-file filename.
v Logical-file filename is not owned by user with id UID.
v Logical-file filename not owned by group with id GID.
v Logical-file filename has insecure mode mode.
v Could not access logical-file filename.
The following table defines the variables used in the messages above.
Variable Explanation
filename A name of the file or directory
logical-file Either ONCONFIG, INFORMIXSQLHOSTS, INFORMIXDIR, or
INFORMIXDIR/xxx (where xxx is one of a number of subdirectories
under $INFORMIXDIR).
See the IBM Informix Trusted Facility Guide for more information about database
server administrator (DBSA), audit analysis officer (AAO), and database system
security officer (DBSSO) groups.
For detailed information on auditing, see the IBM Informix Trusted Facility Guide.
3 The informix user always has permission to create databases. To restrict the ability
3 to create databases to the informix user, add the following line to the ONCONFIG
3 file:
3 DBCREATE_PERMISSION informix
After you create a role, you use the GRANT statement to grant privileges to one or
more users associated with the role name. The CREATE ROLE and GRANT ROLE
statements enable you to create one set of privileges for a role and then grant the
role to many users, instead of granting the same set of privileges to each user in a
group.
When a role is granted to a user, the role grantor or the role grantee (user) must
use the SET ROLE statement to activate the role. Only then does the user have the
privileges of the role.
For more information on creating and using roles, see the see the IBM Informix
Guide to SQL: Syntax.
Default Roles
An administrator can define a default role to assign to individual users or to the
PUBLIC group for a particular database. The default role is automatically applied
Each user has whatever privileges are granted to the user individually, as well as
the privileges of the default role. A user can switch from the current individual
role to the default role using the SET ROLE DEFAULT statement.
If different default roles are assigned to a user and to PUBLIC, the default role of
the user takes precedence. If a default role is not assigned to a user, the user only
has individually granted and public privileges.
Use the REVOKE DEFAULT ROLE statement to disassociate a default role from a
user.
A user must use the SET ROLE DEFAULT statement to change any other current
role to the default role.
See the IBM Informix Guide to SQL: Syntax for more information on using these
statements.
DOS attacks can occur when you use external mechanisms such as Telnet to
connect to the port reserved for a database server. For example, if you use Telnet to
connect to the port reserved for a database server service, but do not send data,
and a separate session attempts to connect to the server through an application
such as DB-Access, the listener thread is blocked while waiting for information
from the Telnet session and the listener thread cannot accept the connection to the
application used in the second session. If during the waiting period, an attacker
launches a distributed DOS (DDOS) attack in a loop, you can receive a flood attack
on the connection leading to poor connection performance.
Depending on the machine capability of holding the threads (in number), you can
configure MAX_INCOMPLETE_CONNECTIONS to a higher value and depending
on the network traffic, you can set LISTEN_TIMEOUT to a lower value to reduce
the chance that the attack can reach the maximum limit.
To specify a new value for either configuration parameter for the current session,
use this syntax:
To change the value of either configuration parameter in the ONCONFIG file, use
this syntax:
Encryption
Dynamic Server provides the means for encrypting passwords, data that is being
transmitted, and data in specified columns.
The Triple DES (DES3) is a variation of DES in which three 64-bit keys are used for
a 192-bit key. DES3 works by first encrypting the plain text using the first 64-bits of
the key. Then the cipher text is decrypted using the next part of the key. Finally the
resulting cipher text is re-encrypted using the last part of the key.
A blowfish is a block cipher that operates on 64-bit (8-byte) blocks of data. It uses a
variable size key, but typically, 128-bit (16-byte) keys are considered to be good for
strong encryption. Blowfish can be used in the same modes as DES.
The Dynamic Server options that you can use for encryption are shown in the table
below.
“ “ , “ “ )
global_options conn_options
Option Description
client=clientlib Specifies the full path and name of the shared library
that is the CSM on the client computer.
SMI Tables and [Link] Setting: If you want to build the SMI tables when
you bring up the database server (oninit -i), do not specify the p=1 option in the
database server CSM entry in the [Link] file. The oninit process does not have
a password for the informix or root user ID. If you specify the p=1 option in the
[Link] file for the database server, you receive the following error message:
-5013 CSM: cannot obtain credential:
authentication error.
To specify that the password is mandatory for the database server CSM when
the SMI tables are not yet built:
1. Do not specify the p=1 option in the [Link] entry.
2. Bring up the database server with the oninit -i command to build the SMI
tables.
3. Bring down the database server.
4. Specify the p=1 option in the database server CSM entry in the [Link] file.
5. Start the database server again with the oninit command.
SPWDCSM("/usr/informix/lib/csm/
[Link]", "", "")
“ “ )
config = encrypt_config
(1) (2) (3)
Cipher Tag Mac Tag Switch Tag
Notes:
1 See “The Cipher Tag” on page 5-17.
2 See “The Mac Tag” on page 5-18.
3 See “The Switch Tag” on page 5-19.
Option Description
client=clientlib The full path and name of the shared library that is the
CSM on the client computer.
Ciphers and Modes: You must specify which ciphers and mode to use during
encryption. The cipher and mode that is used is randomly chosen among the
ciphers that are common between the two servers. Make sure that all servers and
client computers that participate in encrypted communication have ciphers and
modes in common. Encryption is more secure if you include more ciphers and
modes that the database server can switch between. For information on how to
switch between ciphers, see “Switch Frequency” on page 5-15.
Use the allbut option to list ciphers and modes to exclude. Enclose the allbut list
in angled brackets (<>). The list can include unique, abbreviated entries. For
example, bf can represent bf1, bf2, and bf3. However, if the abbreviation is the
name of an actual cipher, then only that cipher is eliminated. Therefore, des
eliminates only the DES cipher, but de eliminates des, ede, and desx.
Mode Explanation
ecb Electronic Code Book
cbc Cipher Block Chaining
cfb Cipher Feedback
ofb Output Feedback
MAC Key Files: The MAC key files contain encryption keys that are used to
encrypt messages. All database servers and client computers that participate in
encryption should have MAC key files in common. For information on how to
switch between MAC keys, see “Switch Frequency” on page 5-15.
The default MAC key file is the built-in file provided by Dynamic Server. This file
provides limited message verification (some validation of the received message and
determination that it appears to have come from an IBM Informix Dynamic Server
client or server). A site-generated MAC key file performs the strongest verification.
You can generate key files with the GenMacKey utility.
Tip: If there are no MAC key files present, the built-in MAC key is used by
default. However, by using a MAC key file, the default built-in MAC key is
disabled.
MAC Levels: MAC levels determine the type of MAC key generation.
The level is prioritized to the highest value. For example, if one database server
has a level of high and medium enabled and the other database server has only
low enabled, then the connection attempt will fail. The off entry should only be
used between servers when it is guaranteed that there is a secure network
connection.
Make sure that all servers and client computers that participated in encrypted
communication have MAC levels in common.
Switch Frequency: The switch frequency defines when ciphers and or secret keys
are renegotiated. The longer that the secret key and encryption cipher remain in
use, the more likely that the encryption rules might be broken by an attacker. To
avoid this, cryptologists recommend periodically changing the secret key and
cipher on long-term connections. The default time that this renegotiation occurs is
once an hour. By using switch options, you can set the time in minutes when the
renegotiation occurs.
ENCCSM_CIPHERS:
syntax ENCCSM_CIPHERS
all|allbut:<list of ciphers and
modes>|cipher:mode{,cipher:mode ...}
v all
Specifies to include all available ciphers and modes, except ECB mode. For
example: ENCCSM_CIPHERS all
v allbut:<list of ciphers and modes>
Specifies to include all ciphers and modes except the ones in the list. Separate
ciphers or modes with a comma. For example: ENCCSM_CIPHERS
allbut:<cbc,bf>
v cipher:mode
Specifies the ciphers and modes. Separate cipher-mode pairs with a comma. For
example: ENCCSM_CIPHERS des3:cbc,des3:ofb
The ENCCSM_CIPHERS parameter specifies the ciphers and modes to use during
encryption. For more information on ciphers and mode, see “Ciphers and Modes”
on page 5-13.
ENCCSM_MAC:
default value medium
range of values One or more of the following options, separated by commas:
v off does not use MAC generation.
v low uses XOR folding on all messages.
v medium uses SHA1 MAC generation for all messages greater than
20 bytes long and XOR folding on smaller messages.
v high uses SHA1 MAC generation on all messages.
For example: ENCCSM_MAC medium,high
ENCCSM_MACFILES:
default value builtin
units pathnames, up to 1536 bytes in length
range of values One or more full path and filenames separated by commas, and
the optional builtin keyword. For example: ENCCSM_MACFILES
/usr/local/bin/[Link],/usr/local/bin/[Link],builtin
The ENCCSM_MACFILES parameter specifies the MAC key files to use. For more
information, see “MAC Key Files” on page 5-14.
ENCCSM_SWITCH:
syntax ENCCSM_SWITCH
cipher_switch_time,key_switch_time
v cipher_switch_time specifies the minutes between cipher
renegotiation
v key_switch_time specifies the minutes between secret key
renegotiation
default value 60,60
units minutes
range of values positive integers
The following example illustrates a line in the [Link] file to specify encryption
with a parameter file:
ENCCSM("usr/informix/lib/cms/[Link]",
"config=/usr/lib/[Link]")
Using Encryption Tags: You can use encryption tags to specify encryption options
in the [Link] file.
The Cipher Tag: The cipher tag can include the cipher options shown in the
following syntax diagram.
cipher [ all ]
,
cipher:mode
For example:
cipher[allbut:<ecb,des>],...
cipher[allbut:<cbc,bf>]
cipher:mode Specifies one or more cipher and mode. For example:
cipher[des:cbc,des:ofb]
For more information on ciphers and modes, see “Ciphers and Modes” on page
5-13.
The Mac Tag: The mac tag defines the MAC key files and the level of MAC
generation to be used during the MAC generation.
The mac tag can include the MAC options shown in the following syntax diagram.
mac [
levels: < high >
medium
low
off
For example:
mac[levels:<high,low>,files:
</usr/local/bin/[Link],
/usr/local/bin/[Link],builtin>]
The switch tag can include the switch options shown in the following syntax
diagram.
switch [ ]
cipher: minutes
key: minutes
cipher: minutes , key: minutes
For example:
switch[cipher:120,key:20]
For more information on switching ciphers and modes, see “Switch Frequency” on
page 5-15.
Examples Using Encryption Tags: The following two examples illustrate alternatives
for tags you enter in the [Link] file to define the encryption CSM. For
example:
ENCCSM(“$INFORMIXDIR/lib/csm/[Link]”,
“cipher[allbut:<ecb,bf>]”)
This configuration string states to use all available ciphers except for any of the
blowfish ciphers, and to not use any cipher in ECB mode.
Another example:
ENCCSM(“/$INFORMIXDIR/lib/csm/[Link]”,
“cipher[des:cbc,ede:ofb,desx:cbc],switch[cipher:120,key:15]”)
You can also use the SET ENCRYPTION PASSWORD statement to set an
encryption password for a session. If you do this, only users who can provide a
secret password can view, copy, or modify encrypted data.
When you set an encryption password for a session, you can also specify a
password hint. If you specify a hint, you can store the hint with the encrypted
password or in another location. The password must be a minimum of 6 bytes and
can be a maximum of 128 bytes. The password used for decryption must match
the password used for encryption.
When you set encryption passwords for column data, you can specify these types
of encryption:
v Column Level Encryption. All values in a specific column of a database table
are encrypted with the same password (word or phrase), the same encryption
algorithm, and the same cipher mode. For column-level encryption, you can
store the hint outside the encrypted column, rather than repeating it in every
row.
Tip: If encryption functions are not used, end users could enter unencrypted
data into columns that are meant to contain encrypted data. To ensure that
data entered into a field is always encrypted, use views and ″instead-of″
triggers.
v Cell-Level Encryption (also called Row-Column and Set-Column Level Encryption).
Within a column of encrypted data, many different passwords, encryption
algorithms, or modes are used. This type of encryption might be necessary to
protect personal data.
Passwords and hints that you declare with SET ENCRYPTION PASSWORD are not
stored as plain text in any table of the system catalog. To prevent other users from
accessing the plain text of encrypted data or of a password, you must avoid
actions that might compromise the secrecy of a password:
v Unless your database is accessible only by a secure network, you must enable
the Encryption Communication Support Module (ENCCSM) to protect data
transmission between the database server and any client system.
v Do not create a functional index using the DECRYPT_CHAR() function. This
would store plain-text data in the database, defeating the purpose of encryption.
v Do not store passwords in a trigger or in a user-defined routine (UDR) that
exposes the password to the public. Use the session password before you
activate the trigger, invoke the UDR, or pass any password as a parameter to a
UDR.
When you set a password, Dynamic Server transfers the password and any hint to
a 128-bit key that is used to encrypt the password and hint. Passwords and hints
are not stored as clear text. The key is a time-based random value per instance.
The database server starts the key when the server starts; the key is destroyed
when the database server shuts down.
When the database server is in online mode, you can use the onmode -p command
to add or drop Encrypt VPs. For example, to add four more Encrypt VPs, use:
onmode -p 4 encrypt
For more information, see the onmode utility chapter in the IBM Informix Dynamic
Server Administrator's Reference.
Storage Considerations
An encrypted value uses more storage space than the corresponding plain text
value. This occurs because all of the information needed to decrypt the value,
except the encryption key, is stored with the value. Therefore, embedding zero
bytes in the encrypted result is not recommended.
To encrypt a column:
1. Calculate the size of the encrypted column. If necessary, modify the column.
For examples of two methods for calculating the size of an encrypted column,
see “Example Showing How to Determine the Size of an Encrypted Column.”
2. Insert information on the encryption password into your code. Use the SET
ENCRYPTION PASSWORD SQL statement to specify either a password or a
password and a hint. Use the ENCRYPT_AES() or the ENCRYPT_TDES()
function to define encrypted data.
For an example of how to insert a password into your code and use the
ENCRYPT function, see “Example Showing How to Encrypt a Column” on
page 5-22.
See the IBM Informix Guide to SQL: Syntax for more informations about:
v The SET ENCRYPTION PASSWORD statement and the syntax to use to specify
the password and the hint
v The ENCRYPT and DECRYPT functions
If the hint is not stored in the column, the total size in the previous example is 55
bytes.
Important: If the column size is smaller than the returned data size from
ENCRYPT/DECRYPT functions, the encrypted data is truncated when
it is inserted and it is not possible to decrypt the data (because the
header will indicate that the length should be longer than the data
received).
Authentication Modules
Depending on your platform, you can use one of the following authentication
modules:
v Pluggable Authentication Module (PAM) for Dynamic Server systems running
on UNIX or Linux. These modules enable you to implement different
authentication modules for different applications. For more information, see
“Pluggable Authentication Modules for Systems Running on UNIX or Linux”
below.
v Lightweight Directory Access Protocol (LDAP) Authentication Support for
Windows. Use the LDAP Authentication Support module when you want to use
an LDAP server to authenticate users. For more information, see “LDAP
Authentication Support on Windows” on page 5-25.
The system administrator can enable or disable the use of PAM. By default, the
database server uses the traditional Informix authentication mechanism (which is
based on the BSD rhosts mechanism) in order to avoid forcing major changes on
users.
Supported Platforms
PAM is supported on Solaris and Linux, in both 32- and 64-bit modes.
Authentication Mode
The PAM module determines whether a simple password is sufficient or other
challenges are required. The PAM implementation in Dynamic Server takes
advantage of the fact that for explicit connections, a password is sent to the server
by the client. This password can be used to satisfy PAM in cases where a simple
password is used. If the authentication mode involves responding to challenges,
the applications must be prepared to respond to them. The application must be
aware that the PAM module might raise multiple challenges.
On Linux, the default value is 128 KB plus the value of the STACKSIZE
configuration parameter.
Therefore, implicit connections can work under PAM only in challenge mode.
Implicit connections in password mode will result in failure.
Application Development
The process for preparing an application to respond to challenges raised by PAM is
the same process to use when responding to challenges raised by LDAP
Authentication Support modules. For more information, see “Application
Development for Authentication Modules” on page 5-27.
Your LDAP client-side system typically includes LDAP libraries and header files.
These libraries and header files are required to compile the LDAP module.
Authentication Mode
The LDAP Authentication Support module determines whether a simple password
is sufficient or other challenges are required. Implementation of the module in
Dynamic Server takes advantage of the fact that for explicit connections, a
password is sent to the server by the client. This password can be used to satisfy
the LDAP Authentication Support module in cases where a simple password is
used. If the authentication mode involves responding to single or multiple
challenges, the applications must be able to respond to the challenges.
Implicit Connections
The LDAP Authentication Support module is a challenge oriented system, in that
the authentication response (the password) is supplied in response to an LDAP
Authentication Support module message. In implicit connections to the database
server, there is no password.
Implicit connections can work under the LDAP Authentication Support module
only in challenge mode. Implicit connections in password mode result in failure.
Application Development
The process for preparing an application to respond to challenges raised by LDAP
Authentication Support modules is the same process to use when responding to
challenges raised by PAM modules. For more information, see “Application
Development for Authentication Modules.”
The client application must register the callback function before making the first
connection. If the callback function is not registered when the first connection is
made to the database server, and the server responds, then ESQL/C returns error
-1809.
The example below shows a very simple program that first registers a callback
function and then unregister it.
#include <stdio.h>
#include <security/pam_appl.h>
int main(void)
{
EXEC SQL char passwd[]="password";
int retval = 0;
if (retval == -1)
{
printf("Error in registering callback\n");
return (-1);
}
else
{
EXEC SQL database test; /* successful connection */
/* Note that this is an implicit connection. So, the
* application should be ready to respond to challenges.*/
printf ("sqlcode on pam connect = %d\n", SQLCODE);
}
case PAM_ERROR_MSG:
case PAM_TEXT_INFO:
default:
printf("%s: %d\n", challenge, msg_style);
break;
}
return 0;
}
Distributed Transactions
Distributed connections cannot respond to challenges, because when a distributed
connection can be made cannot be predicted. Authentication on the remote servers
must be done within the database. A new database, called sysusers, can be used to
administer remote connections.
Database: sysusers
Table: sysauth
The sysauth table in the sysusers database has the following structure:
Column Structure
Username char(32)
Groupname char(32)
Servers char(128)
Hosts char(128)
The following example enables the server to accept distributed transactions from
user user1, belonging to group group1, from database server server1, and from
host [Link]:
insert into sysauth values ("user1", "group1", "server1",
"[Link]");
The other APIs do not support PAM and LDAP Authentication Support modules.
To use them against a version of Dynamic Server that has an enabled
authentication module, connect to a DBSERVERALIAS that does not have the PAM
parameters in the sqlhosts file.
The following client APIs, tools and applications do not support PAM or LDAP
Authentication Support modules:
v LibC++
v Libdmi
v OLEDB
v VB Applications using ODBC
v Ilogin, dbping and ODBC Test connection
v ISA
Compatibility Issues
Not all IBM Informix products and tools support PAM or LDAP authentication:
v IBM Informix-4GL does not directly support PAM or LDAP authentication
because it has no mechanism for identifying callback functions. However, if IBM
Informix-4GL uses the correct version of CSDK, you can write C code that can
be called from IBM Informix-4GL to handle the challenge and response protocol.
To implement PAM, migrate to the new CSDK version, modify your applications
to register a callback that can handle challenges and responses, and recompile
your application.
v Products such as Informix SQL will not handle the challenge and response
protocol.
v The DB-Access, dbexport, dbimport, dbload, and dbschema utilities support
PAM. If they receive a challenge, they pass the challenge to the user and wait for
a response. This is repeated for each challenge that the PAM module raises.
v The onmode, onstat, and oncheck server administration utilities do not use
PAM. However, because these utilities operate on all Dynamic Server ports, the
utilities can function with a PAM-enabled port.
v Other server utilities do not support PAM.
Add s=6 to the options (fifth) field in the INFORMIXSQLHOSTS files to indicate
that the corresponding port accepts only Enterprise Replication or HDR connection
requests. Any other type of connection request will be rejected with error number
-25539, invalid connection type.
For example:
ifxer1 oltlitcp mc001 er_port s=6,Other_ER_Parameters
When you set s=6, the Enterprise Replication (ER) or HDR connection requests are
authenticated using a new mechanism. The system administrator should create a
file [Link] file in the $INFORMIXDIR/etc directory and add the names of the
participating Enterprise Replication and HDR nodes (host names, as would be
found in the third column of the INFORMIXSQLHOSTS file) in that file, one per
line. The format of the file is similar to the UNIX /etc/[Link] file. The file
should be owned by user informix, belong to group informix, and the permissions
should be restricted so that at most user informix can modify the file (using octal
permissions, one of the values 644, 640, 444, or 440 is appropriate).
If the configuration is such that the replicating servers are on the same machine,
then the $INFORMIXDIR/etc/[Link] file is not needed.
Recommendation: Dedicate the database server name or a database server alias for
administering the secure connectivity. For example, if you are using HDR, execute
the onmode -d primary secondary_servername command with INFORMIXSERVER
set to the secure database server or alias name. Then execute the ontape or onbar
restore commands (for example, ontape -p) that are part of HDR initialization
using a different, non-secure INFORMIXSERVER setting. Likewise, use a different,
non-secure INFORMIXSERVER for other client applications, such as DB-Access.
After you set the IFX_EXTEND_ROLE configuration parameter to On, a DBSA can
use the following syntax to grant and revoke privileges to and from specific users.
v GRANT extend To username
v REVOKE extend From username
For more information, see the IBM Informix Guide to SQL: Syntax.
4 You should include in the DB_LIBRARY_PATH settings every file system in which
4 your security policy authorizes DataBlades and UDRs to reside. DataBlades
4 provided with Dynamic Server are stored under the $INFORMIXDIR/extend
4 directory. For extensibility to work properly when security is turned on, the string
4 ″$INFORMIXDIR/extend″ must be part of DB_LIBRARY_PATH.
In This Chapter
This chapter explains how the database server uses virtual processors and threads
within virtual processors to improve performance. It explains the types of virtual
processors and how threads run within the virtual processors.
Virtual Processors
Database server processes are called virtual processors because the way they
function is similar to the way that a CPU functions in a computer. Just as a CPU
runs multiple operating-system processes to service multiple users, a database
server virtual processor runs multiple threads to service multiple SQL client
applications.
A virtual processor is a process that the operating system schedules for processing.
Client applications
Virtual processors
Threads
A thread is a task for a virtual processor in the same way that the virtual processor
is a task for the CPU. The virtual processor is a task that the operating system
schedules for execution on the CPU; a database server thread is a task that the
virtual processor schedules internally for processing. Threads are sometimes called
lightweight processes because they are like processes, but they make fewer demands
on the operating system.
Important: Throughout this chapter, all references to “thread” refer to the threads
created, scheduled, and destroyed by the database server. All references
to “Windows threads” refer to the threads created, scheduled, and
destroyed by Windows.
A user thread is a database server thread that services requests from client
applications. User threads include session threads, called sqlexec threads, which
are the primary threads that the database server runs to service client applications.
User threads also include a thread to service requests from the onmode utility,
threads for recovery, B-tree scanner threads, and page-cleaner threads.
To display active user threads, use onstat -u. For more information on monitoring
sessions and threads, refer to your IBM Informix Dynamic Server Performance Guide.
The number of virtual processors of each class that you configure depends on the
availability of physical processors (CPUs), hardware memory, and the database
applications in use.
Table 6-1. Virtual-Processor Classes
Virtual-
Processor
Class Category Purpose
CPU Central processing Runs all session threads and some system threads. Runs thread for
kernel asynchronous I/O (KAIO) where available. Can run a single poll
thread, depending on configuration.
PIO Disk I/O Writes to the physical-log file (internal class) if it is in cooked disk space.
Figure 6-2 illustrates the major components and the extensibility of the database
server.
Client applications
DataBlade API
DataBlade
DataBlade
DataBlade
DataBlade
Generally, the database server tries to keep a thread running on the same virtual
processor because moving it to a different virtual processor can require some data
from the memory of the processor to be transferred on the bus. When a thread is
waiting to run, however, the database server can migrate the thread to another
virtual processor because the benefit of balancing the processing load outweighs
the amount of overhead incurred in transferring the data.
Generally, a virtual processor can switch from one thread to another faster than the
operating system can switch from one process to another. When the operating
system switches between processes, it must stop one process from running on the
processor, save its current processing state (or context), and start another process.
Both processes must enter and exit the operating-system kernel, and the contents
of portions of physical memory might need to be replaced. Threads, on the other
hand, share the same virtual memory and file descriptors. When a virtual
processor switches from one thread to another, the switch is simply from one path
of execution to another. The virtual processor, which is a process, continues to run
on the CPU without interruption. For a description of how a virtual processor
switches from one thread to another, refer to “Context Switching” on page 6-8.
Processing in Parallel
In the following cases, virtual processors of the CPU class can run multiple session
threads, working in parallel, for a single client:
v Index building
v Sorting
v Recovery
v Scanning
v Joining
v Aggregation
v Grouping
v User-defined-routine (UDR) execution
Figure 6-3 illustrates parallel processing. When a client initiates index building,
sorting, or logical recovery, the database server spawns multiple threads to work
on the task in parallel, using as much of the computer resources as possible. While
one thread is waiting for I/O, another can be working.
Indexing
Client sorting
recovery
Virtual processors
You can add virtual processors for any of the classes while the database server is
running. For more information, see “Adding Virtual Processors in Online Mode”
on page 7-3.
Windows Only
While the database server is running, you can drop virtual processors of the CPU
or a user-defined class. For more information, see “Setting Virtual-Processor
Configuration Parameters” on page 7-1.
This section describes how virtual processors use these structures and methods.
Control Structures
When a client connects to the database server, the database server creates a session
structure, which is called a session control block, to hold information about the
connection and the user. A session begins when a client connects to the database
server, and it ends when the connection terminates.
Next, the database server creates a thread structure, which is called a thread-control
block (TCB) for the session, and initiates a primary thread (sqlexec) to process the
client request. When a thread yields—that is, when it pauses and allows another
thread to run—the virtual processor saves information about the state of the thread
in the thread-control block. This information includes the content of the process
system registers, the program counter (address of the next instruction to execute),
and the stack pointer. This information constitutes the context of the thread.
In most cases, the database server runs one primary thread per session. In cases
where it performs parallel processing, however, it creates multiple session threads
for a single client, and, likewise, multiple corresponding thread-control blocks.
Context Switching
A virtual processor switches from running one thread to running another one by
context switching. The database server does not preempt a running thread, as the
When the amount of processing required to complete a task would cause other
threads to wait for an undue length of time, a thread yields at a predetermined
point. The code for such long-running tasks includes calls to the yield function at
strategic points in the processing. When a thread performs one of these tasks, it
yields when it encounters a yield function call. Other threads in the ready queue
then get a chance to run. When the original thread next gets a turn, it resumes
executing code at the point immediately after the call to the yield function.
Predetermined calls to the yield function allow the database server to interrupt
threads at points that are most advantageous for performance.
A thread also yields when it can no longer continue its task until some condition
occurs. For example, a thread yields when it is waiting for disk I/O to complete,
when it is waiting for data from the client, or when it is waiting for a lock or other
resource.
When a thread yields, the virtual processor saves its context in the thread-control
block. Then the virtual processor selects a new thread to run from a queue of
ready threads, loads the context of the new thread from its thread-control block,
and begins executing at the new address in the program counter. Figure 6-4
illustrates how a virtual processor accomplishes a context switch.
Thread-control blocks
registers registers
etc. etc.
Save Restore
Time
Virtual processor
Figure 6-4. Context Switch: How a Virtual Processor Switches from One Thread to Another
Stacks
The database server allocates an area in the virtual portion of shared memory to
store nonshared data for the functions that a thread executes. This area is called
the stack. For information on how to set the size of the stack, refer to “Stacks” on
page 8-18.
When a virtual processor switches to a new thread, it loads a stack pointer for that
thread from a field in the thread-control block. The stack pointer stores the
beginning address of the stack. The virtual processor can then specify offsets to the
beginning address to access data within the stack. Figure 6-5 illustrates how a
virtual processor uses the stack to segregate nonshared data for session threads.
Threads t0 t1 t2 t3
Thread-control blocks
t3 prgm ctr
t2 prgm ctr Stack Stack Stack Stack
t1 prgm ctr
t0 prgm ctr
registers
stack ptr
etc.
Virtual processor
Figure 6-5. Virtual Processors Segregate Nonshared Data for Each User
Queues
The database server uses three types of queues to schedule the processing of
multiple, concurrently running threads:
v Ready queues
v Sleep queues
v Wait queues
Virtual processors of the same class share queues. This fact, in part, enables a
thread to migrate from one virtual processor in a class to another when necessary.
Ready Queues
Ready queues hold threads that are ready to run when the current (running)
thread yields. When a thread yields, the virtual processor picks the next thread
with the appropriate priority from the ready queue. Within the queue, the virtual
processor processes threads that have the same priority on a first-in-first-out (FIFO)
basis.
The administration class (ADM) of virtual processors runs the system timer and
special utility threads. Virtual processors in this class are created and run
automatically. No configuration parameters impact this class of virtual processors.
The ADM virtual processor wakes up threads that have slept for the specified time.
A thread that runs in the ADM virtual processor checks on sleeping threads at
one-second intervals. If a sleeping thread has slept for its specified time, the ADM
virtual processor moves it into the appropriate ready queue. A thread that is
sleeping for a specified time can also be explicitly awakened by another thread.
A thread that is sleeping forever is awakened when it has more work to do. For
example, when a thread that is running on a CPU virtual processor needs to access
a disk, it issues an I/O request, places itself in a sleep queue for the CPU virtual
processor, and yields. When the I/O thread notifies the CPU virtual processor that
the I/O is complete, the CPU virtual processor schedules the original thread to
continue processing by moving it from the sleep queue to a ready queue.
Figure 6-6 illustrates how the database server threads are queued to perform
database I/O.
Ready queue
I/O requests Sleep queue Partially
for threads t4 t4 executed
and t6 t2 threads, t2, t4,
t6 and t6, waiting
t4 for completion
of their disk I/O
t6 requests
Figure 6-6. How Database Server Threads Are Queued to Perform Database I/O
Wait Queues
Wait queues hold threads that need to wait for a particular event before they can
continue to run. For example, wait queues coordinate access to shared data by
threads. When a user thread tries to acquire the logical-log latch but finds that the
latch is held by another user, the thread that was denied access puts itself in the
logical-log wait queue. When the thread that owns the lock is ready to release the
latch, it checks for waiting threads, and, if threads are waiting, it wakes up the
next thread in the wait queue.
Virtual-Processor Classes
A virtual processor of a given class can run only threads of that class. This section
describes the types of threads, or the types of processing, that each class of virtual
processor performs. It also explains how to determine the number of virtual
processors that you need to run for each class.
To evaluate the performance of the CPU virtual processors while the database
server is running, repeat the following command at regular intervals over a set
period of time:
onstat -g glo
If the accumulated usercpu and syscpu times, taken together, approach 100 percent
of the actual elapsed time for the period of the test, add another CPU virtual
processor if you have a CPU available to run it.
For information on deciding how many CPU virtual processors you need, see
“Running Poll Threads on CPU or Network Virtual Processors” on page 6-21.
The VPCLASS parameter allows you to specify all of the following information:
v The number of virtual processors to start initially for a class
v The maximum number of virtual processors to run for the class
v Processor affinity for CPU class virtual processors
v Disabling of priority aging, if applicable
In addition to considering the number of CPUs in the computer and the number of
users who will connect to the database server, also consider the fact that
user-defined routines and DataBlade modules, which are collections of
user-defined routines, run on either CPU virtual processors or user-defined virtual
processors. For information on how you assign a user-defined routine to a virtual
processor, refer to “Assigning a UDR to a User-Defined Virtual-Processor Class” on
page 6-16.
If your operating system allows you to disable priority aging, You can disable it by
specifying noage for the priority entry in the VPCLASS configuration parameter.
For more information, refer to the IBM Informix Dynamic Server Administrator's
Reference.
Use the VPCLASS configuration parameter with the aff option to implement
processor affinity on multiprocessor computers that support it.
Virtual processor
Starting CPU = 1
In the following example, the database server assigns two virtual processors to
CPUs 5 and 6, and one virtual processor to CPU 7:
VPCLASS CPU,num=3,aff=5-7
Functions that run in a user-defined virtual-processor class need not yield the
processor, and they might issue direct file-system calls that block further
processing by the virtual processor until the I/O is complete.
To execute this function, the ONCONFIG file must include a VPCLASS parameter
that defines the UDR class. If not, calls to the GreaterThanEqual function will fail.
Tip: The CLASS routine modifier can specify any name for the VP class. This class
name need not exist when you register the UDR. However, when you try to
run a UDR that specifies a user-defined VP class for its execution, this class
must exist and have virtual processors assigned to it.
To configure the UDR class, include a line similar to the following one in the
ONCONFIG file. This line configures the UDR class with two virtual processors
and with no priority aging.
VPCLASS UDR ,num=2,noage
The preceding line defines the UDR VP class as a yielding VP class; that is, this VP
class allows the C-language UDR to yield to other threads that need access to the
For more information on the CREATE FUNCTION statement, refer to the IBM
Informix Guide to SQL: Syntax.
You can specify as many JVPs as your operating system will allow. If you run
many Java UDRs or parallel PDQ queries with Java UDRs, you should configure
more JVPs. For more information about UDRs written in Java, refer to J/Foundation
Developer's Guide.
Use the VPCLASS configuration parameter with the jvp keyword to configure
JVPs. For more information, see the configuration parameters chapter in the IBM
Informix Dynamic Server Administrator's Reference.
The PIO class performs all I/O to the physical-log file, and the LIO class performs
all I/O to the logical-log files, unless those files reside in raw disk space and the
database server has implemented KAIO.
On operating systems that do not support KAIO, the database server uses the AIO
class of virtual processors to perform database I/O that is not related to physical
or logical logging.
The database server uses the CPU class to perform KAIO when it is available on a
platform. If the database server implements KAIO, a KAIO thread performs all I/O
UNIX Only
To find out if your UNIX platform supports KAIO, refer to the machine notes file.
End of UNIX Only
Windows Only
For more information about nonlogging I/O, refer to “Asynchronous I/O” on page
6-19.
I/O Priorities
In general, the database server prioritizes disk I/O by assigning different types of
I/O to different classes of virtual processors and by assigning priorities to the
nonlogging I/O queues. Prioritizing ensures that a high-priority log I/O, for
example, is never queued behind a write to a temporary file, which has a low
priority. The database server prioritizes the different types of disk I/O that it
performs, as Table 6-2 shows.
Table 6-2. How Database Server Prioritizes Disk I/O
Priority Type of I/O VP Class
1st Logical-log I/O CPU or LIO
2nd Physical-log I/O CPU or PIO
3rd Database I/O CPU or AIO
3rd Page-cleaning I/O CPU or AIO
3rd Read-ahead I/O CPU or AIO
Logical-Log I/O
The LIO class of virtual processors performs I/O to the logical-log files in the
following cases:
v KAIO is not implemented.
v The logical-log files are in cooked disk space.
Only when KAIO is implemented and the logical-log files are in raw disk space
does the database server use a KAIO thread in the CPU virtual processor to
perform I/O to the logical log.
The logical-log files store the data that enables the database server to roll back
transactions and recover from system failures. I/O to the logical-log files is the
highest priority disk I/O that the database server performs.
If the logical-log files are in a dbspace that is not mirrored, the database server
runs only one LIO virtual processor. If the logical-log files are in a dbspace that is
mirrored, the database server runs two LIO virtual processors. This class of virtual
processors has no parameters associated with it.
Only when KAIO is implemented and the physical-log file is in raw disk space
does the database server use a KAIO thread in the CPU virtual processor to
perform I/O to the physical log. The physical-log file stores before-images of
dbspace pages that have changed since the last checkpoint. (For more information
on checkpoints, refer to “Checkpoints” on page 16-7.) At the start of recovery, prior
to processing transactions from the logical log, the database server uses the
physical-log file to restore before-images to dbspace pages that have changed since
the last checkpoint. I/O to the physical-log file is the second-highest priority I/O
after I/O to the logical-log files.
If the physical-log file is in a dbspace that is not mirrored, the database server runs
only one PIO virtual processor. If the physical-log file is in a dbspace that is
mirrored, the database server runs two PIO virtual processors. This class of virtual
processors has no parameters associated with it.
Asynchronous I/O
The database server performs database I/O asynchronously, meaning that I/O is
queued and performed independently of the thread that requests the I/O.
Performing I/O asynchronously allows the thread that makes the request to
continue working while the I/O is being performed.
The database server performs all database I/O asynchronously, using one of the
following facilities:
v AIO virtual processors
v KAIO on platforms that support it
Database I/O includes I/O for SQL statements, read-ahead, page cleaning, and
checkpoints, as well as other I/O.
Kernel-Asynchronous I/O: The database server uses KAIO when the following
conditions exist:
v The computer and operating system support it.
v A performance gain is realized.
v The I/O is to raw disk space.
The database server implements KAIO by running a KAIO thread on the CPU
virtual processor. The KAIO thread performs I/O by making system calls to the
operating system, which performs the I/O independently of the virtual processor.
The KAIO thread can produce better performance for disk I/O than the AIO
virtual processor can, because it does not require a switch between the CPU and
AIO virtual processors.
UNIX Only
Informix implements KAIO when it ports the database server to a platform that
supports this feature. The database server administrator does not configure KAIO.
AIO Virtual Processors: If the platform does not support KAIO or if the I/O is to
buffered-file chunks, the database server performs database I/O through the AIO
class of virtual processors. All AIO virtual processors service all I/O requests
equally within their class.
The database server assigns each disk chunk a queue, sometimes known as a gfd
queue, based on the filename of the chunk. The database server orders I/O requests
within a queue according to an algorithm that minimizes disk-head movement.
The AIO virtual processors service queues that have work pending in round-robin
fashion.
Use the VPCLASS parameter with the aio keyword to specify the number of AIO
virtual processors that the database server starts initially. For information about
VPCLASS, refer to the chapter on configuration parameters in the IBM Informix
Dynamic Server Administrator's Reference.
You can start additional AIO virtual processors while the database server is in
online mode. For more information, refer to “Adding Virtual Processors in Online
Mode” on page 7-3.
You cannot drop AIO virtual processors while the database server is in online
mode.
Number of AIO Virtual Processors Needed: The goal in allocating AIO virtual
processors is to allocate enough of them so that the lengths of the I/O request
queues are kept short; that is, the queues have as few I/O requests in them as
possible. When the gfd queues are consistently short, it indicates that I/O to the
disk devices is being processed as fast as the requests occur. The onstat -g ioq
command allows you to monitor the length of the gfd queues for the AIO virtual
processors. For more information, refer to “Monitoring Virtual Processors” on page
7-5.
If the database server implements KAIO on your platform, and all of your
dbspaces are composed of raw disk space, one AIO virtual processor might be
sufficient.
If the database server implements KAIO, but you are using some buffered files for
chunks, allocate two AIO virtual processors per active dbspace that is composed of
buffered file chunks. If KAIO is not implemented on your platform, allocate two
AIO virtual processors for each disk that the database server accesses frequently.
Allocate enough AIO virtual processors to accommodate the peak number of I/O
requests. Generally, it is not detrimental to allocate too many AIO virtual
processors.
UNIX Only
The NETTYPE parameter has an optional entry, called vp class, that allows you to
specify either CPU or NET, for CPU or network virtual-processor classes,
respectively.
While the database server is in online mode, you cannot drop a CPU virtual
processor that is running a poll thread.
Note: You should carefully distinguish between poll threads for network
connections and poll threads for shared memory connections, which should
run one per CPU virtual processor. TCP connections should only be in
network virtual processors, and you should only have the minimum needed
to maintain responsiveness. Shared memory connections should only be in
CPU virtual processors and should run in every CPU virtual processor.
For most systems, one poll thread and consequently one virtual processor per
network interface/protocol combination is sufficient. For systems with 200 or more
network users, running additional network virtual processors might improve
throughput. In this case, you need to experiment to determine the optimal number
of virtual processors for each interface/protocol combination.
The listen thread opens the port and requests one of the poll threads for the
specified interface/protocol combination to monitor the port for client requests.
The poll thread runs either in the CPU virtual processor or in the network virtual
processor for the connection that is being used. For information on the number of
poll threads, refer to “Specifying the Number of Networking Virtual Processors” on
page 6-22.
When a poll thread receives a connection request from a client, it passes the
request to the listen thread for the port. The listen thread authenticates the user,
establishes the connection to the database server, and starts an sqlexec thread, the
session thread that performs the primary processing for the client. Figure 6-8
illustrates the roles of the listen and poll threads in establishing a connection with
a client application.
Accept client
Pass request to connection
listen thread Key
Figure 6-8. The Roles of the Poll and the Listen Threads in Connecting to a Client
A poll thread waits for requests from the client and places them in shared memory
to be processed by the sqlexec thread. For network connections, the poll thread
places the message in a queue in the shared-memory global pool. The poll thread
then wakes up the sqlexec thread of the client to process the request. Whenever
possible, the sqlexec thread writes directly back to the client without the help of
the poll thread. In general, the poll thread reads data from the client, and the
sqlexec thread sends data to the client.
UNIX Only
For a shared-memory connection, the poll thread places the message in the
communications portion of shared memory.
End of UNIX Only
Figure 6-9 illustrates the basic tasks that the poll thread and the sqlexec thread
perform in communicating with a client application.
Read data
Send
data
to client
Pass request
and data
Poll to sqlexec sqlexec Process
thread thread
Read data
from client
Database server
Application Thread Data
process process
Figure 6-9. The Roles of the Poll and sqlexec Threads in Communicating with the Client
Application
Adding Listen Threads: As stated previously, the database server starts a listen
thread for each dbservername that you specify with the DBSERVERNAME and
DBSERVERALIASES configuration parameters.
To add listen threads for additional ports, you must first use the
DBSERVERALIASES parameter to specify dbservernames for each of the ports. For
example, the DBSERVERALIASES parameter in Figure 6-10 defines two additional
dbservernames, soc_ol2 and soc_ol3, for the database server instance identified as
soc_ol1.
Figure 6-10. Defining Multiple dbservernames for Multiple Connections of the Same Type
After you define additional dbservernames for the database server, you must
specify an interface/protocol combination and port for each of them in the
sqlhosts file or registry. Each port is identified by a unique combination of
hostname and servicename entries. For example, the sqlhosts entries shown in
Table 6-4 cause the database server to start three listen threads for the onsoctcp
interface/protocol combination, one for each of the ports defined.
Table 6-4. sqlhosts Entries to Listen to Multiple Ports for a Single Interface/Protocol
Combination
dbservername nettype hostname service name
soc_ol1 onsoctcp myhost port1
soc_ol2 onsoctcp myhost port2
soc_ol3 onsoctcp myhost port3
To support multiple network-interface cards, you must assign each card a unique
hostname (network address) in sqlhosts. For example, using the same
dbservernames shown in Figure 6-10, the sqlhosts file or registry entries shown in
Table 6-5 on page 6-25 cause the database server to start three listen threads for the
same interface/protocol combination (as did the entries in Table 6-4). In this case,
however, two of the threads are listening to ports on one interface card (myhost1),
and the third thread is listening to a port on the second interface card (myhost2).
Table 6-5. Example of sqlhosts Entries to Support Two Network-Interface Cards for the
onsoctcp Interface/Protocol Combination
dbservername nettype hostname service name
soc_ol1 onsoctcp myhost1 port1
soc_ol2 onsoctcp myhost1 port2
soc_ol3 onsoctcp myhost2 port1
The database server starts the same number of CSM virtual processors as the
number of CPU virtual processors that it starts.
Use the VPCLASS configuration parameter with the encrypt keyword to configure
encryption VPs. For example, to add five ENCRYPT VPs, add information in the
ONCONFIG file as follows:
VPCLASS encrypt,num=5
You can modify the same information using the onmode utility, as follows:
onmode -p 5 encrypt
For more information, see the configuration parameters and the onmode utility
chapter in the IBM Informix Dynamic Server Administrator's Reference. For more
information on column-level encryption, see “Using Column-Level Encryption” on
page 5-19.
In This Chapter
This chapter describes how to set the configuration parameters that affect database
server virtual processors, and how to start and stop virtual processors.
For descriptions of the virtual-processor classes and for advice on how many
virtual processors you should specify for each class, refer to Chapter 6, “Virtual
Processors and Threads,” on page 6-1
UNIX Only
v ON–Monitor
End of UNIX Only
To implement any changes that you make to configuration parameters, you must
shut down and restart the database server. For more information, refer to “Setting
Up Shared Memory” on page 9-7.
Specifying VPCLASS
You should use the VPCLASS parameter instead of the NUMCPUVPS,
NUMAIOVPS, NOAGE, AFF_SPROC, and AFF_NPROCS parameters. You can
specify a VPCLASS name of up to 128 bytes. The VPCLASS name must begin with
a letter or underscore, and must contain letters, digits, underscores, or $ characters.
You specify user-defined classes of virtual processors and Java virtual processors in
the VPCLASS configuration parameter. For more information on the VPCLASS
configuration parameter, including the defaults and value ranges, see the IBM
Informix Dynamic Server Administrator's Reference, “User-Defined Classes of Virtual
Processors” on page 6-15, and “Java Virtual Processors” on page 6-17.
For recommended values for these database server parameters on UNIX, refer to
your machine notes file.
To specify network virtual processors, enter the number of virtual processors and
then enter one of the following interface/protocol combinations: ipcshm, ipcstr,
tlitcp, tlispx, or soctcp.
The database server allows you to start a maximum of 1000 virtual processors.
After the database server is in online mode, you can start additional virtual
processors to improve performance, if necessary. For more information, refer to
Adding Virtual Processors in Online Mode below.
While the database server is in online mode, you can drop virtual processors of the
CPU and user-defined classes. For more information, refer to “Dropping CPU and
User-Defined Virtual Processors” on page 7-4.
To terminate the database server and thereby terminate all virtual processors, use
the onmode -k command. For more information on using onmode -k, see the IBM
Informix Dynamic Server Administrator's Reference.
You can start these additional virtual processors with one of the following
methods:
v The -p option of the onmode utility
v ISA
You can also start additional virtual processors for user-defined classes to run
user-defined routines. For more information about user-defined virtual processors,
refer to “Assigning a UDR to a User-Defined Virtual-Processor Class” on page 6-16.
onmode -p +4 aio
You can add virtual processors to only one class at a time. To add virtual
processors for another class, you must run onmode again.
To specify network virtual processors, first enter the number of virtual processors
and then enter one of the following interface/protocol combinations: ipcshm,
ipcstr, tlitcp, tlispx, or soctcp.
In the following example, the poll threads handle a total of 240 connections:
Following the onmode command, specify a negative number that is the number of
virtual processors that you want to drop, and then specify the CPU class in
lowercase letters. For example, the following command drops two CPU virtual
processors:
% onmode -p -2 cpu
If you attempt to drop a CPU virtual processor that is running a poll thread, you
receive the following message:
onmode: failed when trying to change the number of cpu virtual processor by -number.
For more information, refer to “Running Poll Threads on CPU or Network Virtual
Processors” on page 6-21.
Windows Only
In Windows, you can have only one user-defined virtual processor class at a time.
Omit the number parameter in the onmode -p vpclass command.
End of Windows Only
For examples of output for the onstat -g commands, see information on the onstat
utility in the IBM Informix Administrator's Reference.
onstat -g ath
The onstat -g ath command displays information on system threads and the
virtual-processor classes.
onstat -g glo
Use the onstat -g glo command to display information about each virtual processor
that is currently running, as well as cumulative statistics for each virtual processor
class. For an example of onstat -g glo output, see information on the onstat utility
in the IBM Informix Administrator's Reference.
onstat -g ioq
Use the onstat -g ioq option to determine whether you need to allocate additional
virtual processors. The command onstat -g ioq displays the length and other
statistics about I/O queues.
If the length of the I/O queue is growing, I/O requests are accumulating faster
than the AIO virtual processors can process them. If the length of the I/O queue
continues to show that I/O requests are accumulating, consider adding AIO virtual
processors.
onstat -g rea
Use the onstat -g rea option to monitor the number of threads in the ready queue.
If the number of threads in the ready queue is growing for a class of virtual
processors (for example, the CPU class), you might need to add more virtual
processors to your configuration.
For an example of onstat -g rea output, see information in the IBM Informix
Administrator's Reference.
In This Chapter
This chapter describes the content of database server shared memory, the factors
that determine the sizes of shared-memory areas, and how data moves into and
out of shared memory. For information on how to change the database server
configuration parameters that determine shared memory allocations, refer to
Chapter 9, “Managing Shared Memory,” on page 9-1.
Shared Memory
Shared memory is an operating-system feature that allows the database server
threads and processes to share data by sharing access to pools of memory. The
database server uses shared memory for the following purposes:
v To reduce memory usage and disk I/O
v To perform high-speed communication between processes
Shared memory enables the database server to reduce overall memory usage
because the participating processes, in this case, virtual processors, do not need to
maintain private copies of the data that is in shared memory.
Shared memory reduces disk I/O, because buffers, which are managed as a
common pool, are flushed on a database server-wide basis instead of a per-process
basis. Furthermore, a virtual processor can often avoid reading data from disk
because the data is already in shared memory as a result of an earlier read
operation. The reduction in disk I/O reduces execution time.
Shared-Memory Use
The database server uses shared memory for the following purposes:
v To enable virtual processors and utilities to share data
Client
Client
Client
Client
Shared-Memory Allocation
The database server creates the following portions of shared memory:
v The resident portion
v The virtual portion
UNIX Only
The database server adds operating-system segments as needed to the virtual and
virtual-extension portions of shared memory.
For more information on shared-memory settings for your platform, see the
machine notes. Figure 8-2 on page 8-4 shows the contents of each portion of shared
memory.
Virtual portion
Big buffers
Global pool
Unallocated memory
Shared-Memory Size
Each portion of the database server shared memory consists of one or more
operating-system segments of memory, each one divided into a series of blocks
that are 4 kilobytes in size and managed by a bitmap.
The header-line output by the onstat utility contains the size of the database server
shared memory, expressed in kilobytes. You can also use onstat -g seg to monitor
You can set the SHMTOTAL parameter in the ONCONFIG file to limit the amount
of memory overhead that the database server can place on your computer or node.
The SHMTOTAL parameter specifies the total amount of shared memory that the
database server can use for all memory allocations. However, certain operations
might fail if the database server needs more memory than the amount set in
SHMTOTAL. If this condition occurs, the database server displays the following
message in the message log:
size of resident + virtual segments x + y > z
total allowed by configuration parameter SHMTOTAL
In addition, the database server returns an error message to the application that
initiated the offending operation. For example, if the database server needs more
memory than you specify in SHMTOTAL while it tries to perform an operation
such as an index build or a hash join, it returns an error message to the application
that is similar to one of the following:
-567 Cannot write sorted rows.
-116 ISAM error: cannot allocate memory.
After the database server sends these messages, it rolls back any partial results
performed by the offending query.
Internal operations, such as page-cleaner or checkpoint activity, can also cause the
database server to exceed the SHMTOTAL ceiling. When this situation occurs, the
database server sends a message to the message log. For example, suppose that the
database server attempts and fails to allocate additional memory for page-cleaner
activity. As a consequence, the database server sends a message to the message log
that is similar to the following:
17:19:13 Assert Failed: WARNING! No memory available for page cleaners
17:19:13 Who: Thread(11, flush_sub(0), 9a8444, 1)
17:19:13 Results: Database server may be unable to complete a checkpoint
17:19:13 Action: Make more virtual memory available to database server
17:19:13 See Also: /tmp/af.c4
After the database server informs you about the failure to allocate additional
memory, it rolls back the transactions that caused it to exceed the SHMTOTAL
limit. Immediately after the rollback, operations no longer fail from lack of
memory, and the database server continues to process transactions as usual.
If messages indicate on a regular basis that the database server needs more
memory than SHMTOTAL allows, you have not configured the database server
correctly. Lowering DS_TOTAL_MEMORY or the buffers value in the
BUFFERPOOL configuration parameter is one possible solution; increasing the
value of SHMTOTAL is another.
UNIX Only
The following sections describe how each type of process attaches to the database
server shared memory.
The oninit process reads the ONCONFIG file and creates the file .[Link]
when it starts the database server. The file is removed when the database server
terminates.
The following sections describe how the database server uses the values of the
SERVERNUM and SHMBASE configuration parameters in the process of attaching
shared-memory segments.
To see the key values for shared-memory segments, run the onstat -g seg
command. For more information, see the sections on SHMADD and the buffer pool
in your IBM Informix Dynamic Server Performance Guide.
When a virtual processor requests that the operating system attach the first
shared-memory segment, it supplies the unique key value to identify the segment.
In return, the operating system passes back a shared-memory segment identifier
associated with the key value. Using this identifier, the virtual processor requests
that the operating system attach the segment of shared memory to the
virtual-processor address space.
UNIX Only
The virtual processor repeats this process until it has acquired the total amount of
shared memory.
Given the initial key value of (SERVERNUM * 65536) + shmkey, the database server
can request up to 65,536 shared-memory segments before it could request a
shared-memory key value used by another database server instance on the same
computer.
To correct the problem, check the operating-system kernel parameter that specifies
the lower-boundary address or reconfigure the kernel to allow larger
shared-memory segments.
Operating-system memory
Virtual processor
SHMBASE
Shared-memory
segment
The next segment of shared
memory should attach here.
Gap
The database server requests that the operating system keep the virtual portions in
physical memory when the following two conditions exist:
v The operating system supports shared-memory residency.
v The RESIDENT parameter in the ONCONFIG file is set to -1 or a value that is
greater than 0.
Warning: You must consider the use of shared memory by all applications when
you consider whether to set the RESIDENT parameter to -1. Locking all
For more information on the RESIDENT configuration parameter, refer to the IBM
Informix Dynamic Server Administrator's Reference.
Shared-Memory Header
The shared-memory header contains a description of all other structures in shared
memory, including internal tables and the buffer pool.
The size of the shared-memory header is about 200 kilobytes, but the size varies
depending on the computer platform. You cannot tune the size of the header.
Figure 8-4 illustrates the shared-memory header and the buffer pool.
Buffer pool
If a buffer pool for a non-default page size does not exist, the database server will
automatically create a large-page buffer.
If you are creating a dbspace with a non-default page size, the dbspace must have
a corresponding buffer pool. For example, if you create a dbspace with a page size
of 6 kilobytes, you must create a buffer pool with a size of 6 kilobytes.
The status of the buffers is tracked through the buffer table. Within shared
memory, buffers are organized into FIFO/LRU buffer queues. Buffer acquisition is
managed through the use of latches, called mutexes, and lock-access information.
For a description of how LRU queues work, refer to “FIFO/LRU Queues” on page
8-21. For a description of mutexes, refer to “Mutexes” on page 6-12.
Buffer Size
Each buffer is the size of one database server page.
In general, the database server performs I/O in full-page units, the size of a buffer.
The exceptions are I/O performed from big buffers, from blobspace buffers, or
from lightweight I/O buffers. (See “Big Buffers” on page 8-17 and “Creation of
Blobpage Buffers” on page 8-30.) For information about when to use private
buffers, see information about lightweight I/O operations in the IBM Informix
Dynamic Server Performance Guide.
The onstat -b command displays information about the buffers. For information on
onstat, see the IBM Informix Dynamic Server Administrator's Reference.
Logical-Log Buffer
The database server uses the logical log to store a record of changes to the
database server data since the last dbspace backup. The logical log stores records
that represent logical units of work for the database server. The logical log contains
the following five types of log records, in addition to many others:
v SQL data definition statements for all databases
v SQL data manipulation statements for databases that were created with logging
v Record of a change to the logging status of a database
v Record of a full or fuzzy checkpoint
v Record of a change to the configuration
Logical-log buffers
Writes performed by
Current user thread
logical-log buffer
(now filling)
Current
logical-log
Logical-log file
buffer (ready to
accept data)
Free
logical-log
file
Logical-log
buffer
(flushing) Free
logical-log
file
Figure 8-5. The Logical-Log Buffer and Its Relation to the Logical-Log Files on Disk
For a description of how the database server flushes the logical-log buffer, refer to
“Flushing the Logical-Log Buffer” on page 8-28.
The LOGBUFF parameter in the ONCONFIG file specifies the size of the
logical-log buffers. Small buffers can create problems if you store records larger
than the size of the buffers (for example, TEXT or BYTE data in dbspaces). For the
possible values that you can assign to this configuration parameter, refer to the
IBM Informix Dynamic Server Administrator's Reference.
For information on the impact of TEXT and BYTE data on shared memory buffers,
refer to “Buffering Large-Object Data” on page 8-29.
Physical-Log Buffer
The database server uses the physical-log buffer to hold before-images of some of
the modified dbspace pages. The before-images in the physical log and the
logical-log records enable the database server to restore consistency to its databases
after a system failure.
The physical-log buffer is actually two buffers. Double buffering permits the
database server processes to write to the active physical-log buffer while the other
buffer is being flushed to the physical log on disk. For a description of how the
database server flushes the physical-log buffer, refer to “Flushing the Physical-Log
Buffer” on page 8-26. For information on monitoring the physical-log file, refer to
“Monitoring Physical and Logical-Logging Activity” on page 17-3.
The PHYSBUFF parameter in the ONCONFIG file specifies the size of the
physical-log buffers. A write to the physical-log buffer writes exactly one page. If
the specified size of the physical-log buffer is not evenly divisible by the page size,
the database server rounds the size down to the nearest value that is evenly
divisible by the page size. Although some operations require the buffer to be
flushed sooner, in general the database server flushes the buffer to the physical-log
8-12 IBM Informix Dynamic Server Administrator’s Guide
file on disk when the buffer fills. Thus, the size of the buffer determines how
frequently the database server needs to flush it to disk. For more information on
this configuration parameter, refer to the IBM Informix Dynamic Server
Administrator's Reference.
Lock Table
A lock is created when a user thread writes an entry in the lock table. The lock
table is the pool of available locks. Each lock is 44 bytes. A single transaction can
own multiple locks. For an explanation of locking and the SQL statements
associated with locking, see the IBM Informix Guide to SQL: Tutorial.
The following information, which is stored in the lock table, describes the lock:
v The address of the transaction that owns the lock
v The type of lock (exclusive, update, shared, byte, or intent)
v The page and rowid that is locked
v The tblspace where the lock is placed
v Information about the bytes locked (byte-range locks for smart large objects):
– Smart-large-object ID
– Offset into the smart large object where the locked bytes begin
– The number of bytes locked, starting at the offset
To specify the initial size of the lock table, set the LOCKS configuration parameter.
If the number of locks allocated by sessions exceeds the value of LOCKS, the
database server doubles the size of the lock table, up to 15 times. The maximum
value of LOCKS is 8,000,000. Use the DEF_TABLE_LOCKMODE configuration
parameter to set the lock mode to page or row for new tables.
For more information on using and monitoring locks, see the chapter on locking in
your IBM Informix Dynamic Server Performance Guide and the IBM Informix Guide to
SQL: Tutorial. For more information on using LOCKS to specify the number of
locks for a session, see the chapter on configuration parameters in the IBM Informix
Dynamic Server Administrator's Reference and the chapter on configuration effects on
memory utilization in your IBM Informix Dynamic Server Performance Guide.
All sessions have one or more memory pools. When the database server needs
memory, it looks first in the specified pool. If insufficient memory is available in a
pool to satisfy a request, the database server adds memory from the system pool. If
the database server cannot find enough memory in the system pool, it dynamically
allocates more segments to the virtual portion.
The database server allocates virtual shared memory for each of its subsystems
(session pools, stacks, heaps, control blocks, system catalog, SPL routine caches,
SQL statement cache, sort pools, and message buffers) from pools that track free
space through a linked list. When the database server allocates a portion of
memory, it first searches the pool free-list for a fragment of sufficient size. If it finds
none, it brings new blocks into the pool from the virtual portion. When memory is
freed, it goes back to the pool as a free fragment and remains there until the pool
is destroyed. When the database server starts a session for a client application, for
example, it allocates memory for the session pool. When the session terminates, the
database server returns the allocated memory as free fragments.
To specify the amount of memory available for PDQ queries, set the
DS_TOTAL_MEMORY parameter.
If you want to increase the amount of memory that is available for a query that is
not a PDQ query and the PDQ priority is set to 0 (zero), you can change the
amount using any of the following options:
v The DS_NONPDQ_QUERY_MEM configuration parameter
v The onmode -wm or onmode -wf commands
v The Non PDQ Query Memory option on the ON-Monitor pdQ menu.
For example, if you use the onmode utility, specify a value as shown in the
following example:
onmode -wf DS_NONPDQ_QUERY_MEM=500
Buffer Table: The buffer table tracks the addresses and status of the individual
buffers in the shared-memory pool. When a buffer is used, it contains an image of
a data or index page from disk. For more information on the purpose and content
of a disk page, refer to “Pages” on page 10-5.
Each buffer in the buffer table contains the following control information, which is
needed for buffer management:
v Buffer status
Buffer status is described as empty, unmodified, or modified. An unmodified
buffer contains data, but the data can be overwritten. A modified (dirty) buffer
contains data that must be written to disk before it can be overwritten.
v Current lock-access level
Buffers receive lock-access levels depending on the type of operation that the
user thread is executing. The database server supports two buffer lock-access
levels: shared and exclusive.
v Threads waiting for the buffer
Each buffer header maintains a list of the threads that are waiting for the buffer
and the lock-access level that each waiting thread requires.
Each database server buffer has one entry in the buffer table.
For information on the database server buffers, refer to “Resident Portion of Shared
Memory” on page 8-10. For information on how to monitor the buffers, refer to
“Monitoring Buffers” on page 9-9.
Chunk Table: The chunk table tracks all chunks in the database server. If
mirroring has been enabled, a corresponding mirror chunk table is also created
when shared memory is set up. The mirror chunk table tracks all mirror chunks.
The chunk table in shared memory contains information that enables the database
server to locate chunks on disk. This information includes the number of the initial
chunk and the number of the next chunk in the dbspace. Flags also describe chunk
status: mirror or primary; offline, online, or recovery mode; and whether this
chunk is part of a blobspace. For information on monitoring chunks, refer to
“Monitoring Chunks” on page 11-33.
The maximum number of entries in the chunk table might be limited by the
maximum number of file descriptors that your operating system allows per
process. You can usually specify the number of file descriptors per process with an
operating-system kernel-configuration parameter. For details, consult your
operating-system manuals.
Dbspace Table: The dbspace table tracks storage spaces in the database server.
The dbspace-table information includes the following information about each
dbspace:
v Dbspace number
v Dbspace name and owner
v Dbspace mirror status (mirrored or not)
v Date and time that the dbspace was created
If the storage space is a blobspace, flags indicate the media where the blobspace is
located: magnetic, removable, or optical media. If the storage space is an sbspace, it
contains internal tables that track metadata for smart large objects and large
contiguous blocks of pages containing user data.
Page-Cleaner Table: The page-cleaner table tracks the state and location of each
of the page-cleaner threads. The number of page-cleaner threads is specified by the
CLEANERS configuration parameter in the ONCONFIG file. For advice on how
many page-cleaner threads to specify, refer to the chapter on configuration
parameters in the IBM Informix Dynamic Server Administrator's Reference.
The page-cleaner table always contains 128 entries, regardless of the number of
page-cleaner threads specified by the CLEANERS parameter in the ONCONFIG
file.
Tblspace Table: The tblspace table tracks all active tblspaces in a database server
instance. An active tblspace is one that is currently in use by a database session.
Each active table accounts for one entry in the tblspace table. Active tblspaces
include database tables, temporary tables, and internal control tables, such as
The database server manages one tblspace table for each dbspace.
Transaction Table: The transaction table tracks all transactions in the database
server.
Tracking information derived from the transaction table appears in the onstat -x
display. For an example of the output that onstat -x displays, refer to monitoring
transactions in your IBM Informix Dynamic Server Performance Guide.
For more information on transactions and the SQL statements that you use with
transactions, refer to the IBM Informix Guide to SQL: Tutorial, the IBM Informix Guide
to SQL: Reference, and the IBM Informix Guide to SQL: Syntax.
UNIX Only
The transaction table also specifically supports the X/Open environment. Support
for the X/Open environment requires TP/XA. For a description of a transaction in
this environment, refer to the IBM Informix TP/XA Programmer's Manual.
End of UNIX Only
User Table: The user table tracks all user threads and system threads. Each client
session has one primary thread and zero-to-many secondary threads, depending on
the level of parallelism specified. System threads include one to monitor and
control checkpoints, one to process onmode commands, the B-tree scanner threads,
and page-cleaner threads.
The database server increases the number of entries in the user table as needed.
You can monitor user threads with the onstat -u command.
Big Buffers
A big buffer is a single buffer that is made up of several pages. The actual number
of pages is platform dependent. The database server allocates big buffers to
improve performance on large reads and writes.
The database server uses a big buffer whenever it writes to disk multiple pages
that are physically contiguous. For example, the database server tries to use a big
buffer to perform a series of sequential reads (light scans) or to read into shared
memory simple large objects that are stored in a dbspace.
Users do not have control over the big buffers. If the database server uses light
scans, it allocates big buffers from shared memory.
For information on monitoring big buffers with the onstat command, refer to the
chapter on configuration effects on I/O activity in your IBM Informix Dynamic
Server Performance Guide.
Thread Data
When a client connects to the database server, in addition to starting a session, the
database server starts a primary session thread and creates a thread-control block for
it in shared memory.
The database server also starts internal threads on its own behalf and creates
thread-control blocks for them. When the database server switches from running
one thread to running another one (a context switch), it saves information about
the thread— such as the register contents, program counter (address of the next
instruction), and global pointers—in the thread-control block. For more information
on the thread-control block and how it is used, refer to “Context Switching” on
page 6-8.
Stacks: Each thread in the database server has its own stack area in the virtual
portion of shared memory. For a description of how threads use stacks, refer to
“Stacks” on page 6-9. For information on how to monitor the size of the stack for a
session, refer to monitoring sessions and threads section in your IBM Informix
Dynamic Server Performance Guide.
The size of the stack space for user threads is specified by the STACKSIZE
parameter in the ONCONFIG file. The default size of the stack is 32 kilobytes. You
can change the size of the stack for all user threads, if necessary, by changing the
value of STACKSIZE. For information and a warning on setting the size of the
stack, refer to STACKSIZE in the chapter on configuration parameters in the IBM
Informix Dynamic Server Administrator's Reference.
To alter the size of the stack for the primary thread of a specific session, set the
INFORMIXSTACKSIZE environment variable. The value of
INFORMIXSTACKSIZEoverrides the value of STACKSIZE for a particular user.
For information on how to override the stack size for a particular user, refer to the
description of the INFORMIXSTACKSIZE environment variable in the IBM
Informix Guide to SQL: Reference.
To more safely alter the size of stack space, use the INFORMIXSTACKSIZE
environment variable rather than alter the configuration parameter STACKSIZE.
The INFORMIXSTACKSIZE environment variable affects the stack space for only
one user, and it is less likely to affect new client applications that initially were not
measured.
Heaps: Each thread has a heap to hold data structures that it creates while it is
running. A heap is dynamically allocated when the thread is created. The size of
the thread heap is not configurable.
Performance improves if these statistics are efficiently stored and accessed from the
data-distribution cache. You can configure the size of the data-distribution cache
with the DS_HASHSIZE and DS_POOLSIZE configuration parameters. For
information about changing the default size of the data-distribution cache, refer to
the chapter on queries and the query optimizer in your IBM Informix Dynamic
Server Performance Guide.
Dictionary Cache
When a session executes an SQL statement that requires access to a system catalog
table, the database server reads data from the system catalog tables. The database
server stores the catalog data for each queried table in structures that it can access
more efficiently during subsequent queries on that table. These structures are
created in the virtual portion of shared memory for use by all sessions. These
structures constitute the dictionary cache.
You can configure the size of the dictionary cache with the DD_HASHSIZE and
DD_HASHMAX configuration parameters. For more information about these
parameters, refer to the chapter on configuration effects on memory in your IBM
Informix Dynamic Server Performance Guide.
For more information, see “Setting SQL Statement Cache Parameters” on page 9-6.
For details on how these parameters affect the performance of the SQL statement
cache, refer to the IBM Informix Dynamic Server Performance Guide.
Sorting Memory
The following database operations can use large amounts of the virtual portion of
shared memory to sort data:
v Decision-support queries that involve joins, groups, aggregates and sort
operations
v Index builds
v UPDATE STATISTICS statement in SQL
The amount of virtual shared memory that the database server allocates for a sort
depends on the number of rows to be sorted and the size of the row, along with
other factors.
For information on parallel sorts, refer to your IBM Informix Dynamic Server
Performance Guide.
When a session needs to access an SPL routine or other user-defined routine for
the first time, the database server reads the definition from the system catalog
tables and stores the definition in the UDR cache.
You can configure the size of the UDR cache with the PC_HASHSIZE and
PC_POOLSIZE configuration parameters. For information about changing the
default size of the UDR cache, refer to the chapter on queries and the query
optimizer in your IBM Informix Dynamic Server Performance Guide.
Global Pool
The global pool stores structures that are global to the database server. For
example, the global pool contains the message queues where poll threads for
network communications deposit messages from clients. The sqlexec threads pick
up the messages from the global pool and process them.
For more information, see the sections on network buffer pools and virtual portion
of shared memory in your IBM Informix Dynamic Server Performance Guide.
Concurrency Control
The database server threads that run on the same virtual processor and on separate
virtual processors share access to resources in shared memory. When a thread
writes to shared memory, it uses mechanisms called mutexes and locks to prevent
other threads from simultaneously writing to the same area. A mutex gives a
Shared-Memory Mutexes
The database server uses mutexes to coordinate threads as they attempt to modify
data in shared memory. Every modifiable shared-memory resource is associated
with a mutex. Before a thread can modify a shared-memory resource, it must first
acquire the mutex associated with that resource. After the thread acquires the
mutex, it can modify the resource. When the modification is complete, the thread
releases the mutex.
If a thread tries to obtain a mutex and finds that it is held by another thread, the
incoming thread must wait for the mutex to be released.
For example, two threads can attempt to access the same slot in the chunk table,
but only one can acquire the mutex associated with the chunk table. Only the
thread that holds the mutex can write its entry in the chunk table. The second
thread must wait for the mutex to be released and then acquire it.
For information on monitoring mutexes (which are also referred to as latches), refer
to “Monitoring the Shared-Memory Profile and Latches” on page 9-8.
Each of these lock types enforces the required level of thread isolation during
execution.
Share Lock: A buffer is in share mode, or has a share lock, if multiple threads
have access to the buffer to read the data but none intends to modify the data.
FIFO/LRU Queues
A buffer holds data for the purpose of caching. The database server uses the
least-recently used (LRU) queues to replace the cached data. Dynamic Server also
The free or unmodified page list is referred to as the FLRU queue of the queue
pair, and the modified page list is referred to as the MLRU queue. The two
separate lists eliminate the need to search a queue for a free or unmodified page.
Figure 8-6 illustrates the structure of the LRU queues.
FLRU 1
LRU queue
(composed of two
MLRU 1 queues)
If the FLRU queue is locked, and the end page cannot be latched, the database
server randomly selects another FLRU queue.
If a user thread is searching for a specific page in shared memory, it obtains the
LRU-queue location of the page from the control information stored in the buffer
table.
After an executing thread finishes its work, it releases the buffer. If the page has
been modified, the buffer is placed at the most-recently used end of an MLRU
queue. If the page was read but not modified, the buffer is returned to the FLRU
queue at its most-recently used end. For information on how to monitor LRU
queues, refer to “Monitoring Buffer-Pool Activity” on page 9-11.
Initial values for the LRUS are recommended based on the number of CPUs that
are available on your computer. If your computer is a uniprocessor, start by setting
the lrus value in the BUFFERPOOL configuration parameter to 4. If your computer
is a multiprocessor, use the following formula:
LRUS = max(4, (NUMCPUVPS))
After you provide an initial value for lrus in the BUFFERPOOL configuration
parameter, monitor your LRU queues with onstat -R. If you find that the
percentage of dirty LRU queues consistently exceeds the value specified for
lru_max_dirty, increase the value specified for lrus to add more LRU queues.
For example, suppose you set lru_max_dirty to 70 and find that your LRU queues
are consistently 75 percent dirty. Consider increasing the value of the lrus. If you
increase the number of LRU queues, you shorten the length of the queues, thereby
reducing the work of the page cleaners. However, you must allocate a sufficient
number of page cleaners with the CLEANERS configuration parameter, as
discussed in the following section.
In addition to insufficient LRU queues, another factor that influences whether page
cleaners keep up with the number of pages that require cleaning is whether you
have enough page-cleaner threads allocated. The percent of dirty pages might
For example, suppose that the CLEANERS parameter is set to 8, and you increase
the number of LRU queues from 8 to 12. You can expect little in the way of a
performance gain because the 8 cleaners must now share the work of cleaning an
additional 4 queues. If you increase the number of CLEANERS to 12, each of the
now-shortened queues can be more efficiently cleaned by a single cleaner.
By specifying when page cleaning begins, the lru_max_dirty value limits the
number of page buffers that can be appended to an MLRU queue. The initial
setting of lru_max_dirty is 60.00, so page cleaning begins when 60 percent of the
buffers managed by a queue are modified.
In practice, page cleaning begins under several conditions, only one of which is
when an MLRU queue reaches the value of lru_max_dirty. For more information
on how the database server performs buffer-pool flushing, refer to “Flushing Data
to Disk” on page 8-26.
Figure 8-7 shows how the value of lru_max_dirty is applied to an LRU queue to
specify when page cleaning begins and thereby limit the number of buffers in an
MLRU queue.
Figure 8-7. How the lru_max_dirty Value Initiates Page Cleaning to Limit the Size of the
MLRU Queue
Figure 8-8 shows how the value of lru_min_dirty is applied to the LRU queue to
specify the acceptable percent of buffers in an MLRU queue and the point at which
page cleaning ends.
Figure 8-8. How the lru_min_dirty Value Specifies the Point at Which Page Cleaning Can
End
You can use decimals for the lru_max_dirty and the lru_min_dirty values. For
example, if you set lru_max_dirty to 1.0333 and lru_min_dirty to 1.0, this triggers
the LRU to write at 3,100 dirty buffers and to stop at 3,000 dirty buffers.
For more information on how the database server flushes the buffer pool, refer to
“Flushing Data to Disk” on page 8-26.
The database server performs a read-ahead whenever it detects the need for it
during sequential data or index reads.
The RA_PAGES parameter in the ONCONFIG file specifies the number of pages to
read from disk or the index when the database server performs a read-ahead.
For more information on using the onstat -p command to monitor the database
server use of read-ahead, see “Monitoring the Shared-Memory Profile and Latches”
on page 9-8. For an example of onstat -p output, see the IBM Informix
Administrator's Reference.
Page-cleaner threads manage buffer flushing. The database server always runs at
least one page-cleaner thread. If the database server is configured for more than
one page-cleaner thread, the LRU queues are divided among the page cleaners for
more efficient flushing. For information on specifying how many page-cleaner
threads the database server runs, refer to the CLEANERS configuration parameter
in the IBM Informix Dynamic Server Administrator's Reference.
Flushing the physical-log buffer, the modified shared-memory page buffers, and
the logical-log buffer must be synchronized with page-cleaner activity according to
specific rules designed to maintain data consistency.
In practice, the physical-log buffer is flushed first and then the buffers that contain
modified pages. Therefore, even when a shared-memory buffer page needs to be
flushed because a user thread is trying to acquire a buffer but none is available (a
foreground write), the buffer pages cannot be flushed until the before-image of the
page has been written to disk.
The contents of the physical-log buffer must always be flushed to disk before any
data buffers. This rule is required for the fast-recovery feature.
The database server uses only one of the two physical-log buffers at a time. This
buffer is the current physical-log buffer. Before the database server flushes the
current physical-log buffer to disk, it makes the other buffer the current buffer so
that it can continue writing while the first buffer is being flushed.
To display the write counts that the database server maintains, use onstat -F as
described in the IBM Informix Dynamic Server Administrator's Reference.
If you implement mirroring for the database server, data is always written to the
primary chunk first. The write is then repeated on the mirror chunk. Writes to a
mirror chunk are included in the counts. For more information on monitoring the
types of writes that the database server performs, refer to “Monitoring Buffer-Pool
Activity” on page 9-11.
Foreground Write
Whenever an sqlexec thread writes a buffer to disk, it is termed a foreground write.
A foreground write occurs when an sqlexec thread searches through the LRU
queues on behalf of a user but cannot locate an empty or unmodified buffer. To
make space, the sqlexec thread flushes pages, one at a time, to hold the data to be
read from disk. (For more information, refer to “FIFO/LRU Queues” on page 8-21.)
If the sqlexec thread must perform buffer flushing just to acquire a shared-memory
buffer, performance can suffer. Foreground writes should be avoided. To display a
count of the number of foreground writes, run onstat -F. If you find that
foreground writes are occurring on a regular basis, tune the value of the
page-cleaning parameters. Either increase the number of page cleaners or decrease
the BUFFERPOOL lru_max_dirty value.
Chapter 8. Shared Memory 8-27
LRU Write
Unlike foreground writes, LRU writes are performed by page cleaners rather than
by sqlexec threads. The database server performs LRU writes as background
writes that typically occur when the percentage of dirty buffers exceeds the percent
you that specified for lru_max_dirty in the BUFFERPOOL configuration parameter.
In addition, a foreground write can trigger an LRU write. When a foreground write
occurs, the sqlexec thread that performed the write alerts a page-cleaner to wake
up and clean the LRU for which it performed the foreground write.
In a properly tuned system, page cleaners ensure that enough unmodified buffer
pages are available for storing pages to be read from disk. Thus, sqlexec threads
that perform a query do not need to flush a page to disk before they read in the
disk pages required by the query. This condition can result in significant
performance gains for queries that do not make use of foreground writes.
LRU writes are preferred over foreground writes because page-cleaner threads
perform buffer writes much more efficiently than sqlexec threads do. To monitor
both types of writes, use onstat -F.
Chunk Write
Chunk writes are commonly performed by page-cleaner threads during a checkpoint
or, possibly, when every page in the shared-memory buffer pool is modified.
Chunk writes, which are performed as sorted writes, are the most efficient writes
available to the database server.
During a chunk write, each page-cleaner thread is assigned to one or more chunks.
Each page-cleaner thread reads through the buffer headers and creates an array of
pointers to pages that are associated with its specific chunk. (The page cleaners
have access to this information because the chunk number is contained within the
physical page number address, which is part of the page header.) This sorting
minimizes head movement (disk seek time) on the disk and enables the
page-cleaner threads to use the big buffers during the write, if possible.
In addition, because user threads must wait for the checkpoint to complete, the
page-cleaner threads are not competing with a large number of threads for CPU
time. As a result, the page-cleaner threads can finish their work with less context
switching.
For a comparison of buffered versus unbuffered logging, refer to the SET LOG
statement in the IBM Informix Guide to SQL: Syntax.
You can also assign simple large objects to a blobspace. The database server writes
simple large objects to a blobspace differently from the way that it writes other
data to a shared-memory buffer and then flushes it to disk. For a description of
blobspaces, refer to the chapter on disk structure and storage in the IBM Informix
Dynamic Server Administrator's Reference.
If blobspace data passed through the shared-memory pool, it might dilute the
effectiveness of the pool by driving out index pages and data pages. Instead,
blobpage data is written directly to disk when it is created.
Chapter 8. Shared Memory 8-29
To reduce logical-log and physical-log traffic, the database server writes blobpages
from magnetic media to dbspace backup tapes and logical-log backup tapes in a
different way than it writes dbspace pages. For a description of how blobspaces are
logged, refer to “Logging Blobspaces and Simple Large Objects” on page 14-6.
Blobpages stored on optical media are not written to dbspace and logical-log
backup tapes due to the high reliability of optical media.
Simple large object data is transferred from the client-application process to the
database server in 1-kilobyte segments. The database server begins filling the
blobspace buffers with the 1-kilobyte pieces and attempts to buffer two blobpages
at a time. The database server buffers two blobpages so that it can determine when
to add a forwarding pointer from one page to the next. When it fills the first buffer
and discovers that more data remains to transfer, it adds a forward pointer to the
next page before it writes the page to disk. When no more data remains to transfer,
the database server writes the last page to disk without a forward pointer.
When the thread begins writing the first blobspace buffer to disk, it attempts to
perform the I/O based on the user-defined blobpage size. For example, if the
blobpage size is 32 kilobytes, the database server attempts to read or write the data
in 32,768-byte increments. If the underlying hardware (such as the disk controller)
cannot transfer this amount of data in a single operation, the operating-system
kernel loops internally (in kernel mode) until the transfer is complete.
The blobspace buffers remain until the thread that created them is finished. When
the simple large object is written to disk, the database server deallocates the pair of
blobspace buffers. Figure 8-9 illustrates the process of writing a simple large object
to a blobspace.
Client
Blobspace
Virtual processor Temporary blobpage
buffers
Blobspace blobpages are allocated and tracked with the free-map page. Links that
connect the blobpages and pointers to the next blobpage segments are created as
needed.
A smart large object is stored in an sbspace. You cannot store simple large objects
in an sbspace, and you cannot store smart large objects in a blobspace. An sbspace
consists of a user-data area and a metadata area. The user-data area contains the
smart-large-object data. The metadata area contains information about the content
of the sbspace. For more information on sbspaces, refer to “Sbspaces” on page
10-13.
Because smart large objects pass through the shared-memory buffer pool and can
be logged, you must consider them when you allocate buffers. Use the
BUFFERPOOL configuration parameter to allocate shared-memory buffers. As a
general rule, try to have enough buffers to hold two smart-large-object pages for
each concurrently open smart large object. (The additional page is available for
read-ahead purposes.) For more information about tuning buffers for smart large
objects, refer to your IBM Informix Dynamic Server Performance Guide.
Use the LOGBUFF configuration parameter to specify the size of the logical-log
buffer. For information about setting each of the following configuration
parameters, refer to the IBM Informix Dynamic Server Administrator's Reference:
v BUFFERPOOL
v LOGBUFF
The user-data area of smart large objects that are logged does not pass through the
physical log, so the PHYSBUFF parameter need not be adjusted for smart large
objects.
The machine notes for each 64-bit platform lists the maximum values for these
configuration parameters and platform-specific parameters such as SHMMAX. For
more information about the configuration parameters, see the IBM Informix
Dynamic Server Administrator's Reference and the chapter on shared memory in the
IBM Informix Dynamic Server Performance Guide.
In This Chapter
This chapter tells you how to perform the following tasks, which concern
managing shared memory:
v Setting the shared-memory configuration parameters
v Setting up shared memory
v Turning residency on or off for the resident portion of the database server
shared memory
v Adding a segment to the virtual portion of shared memory
v Monitoring shared memory
UNIX Only
v Maximum number of semaphore identifiers
v Maximum number of semaphores
v Maximum number of semaphores per identifier
On UNIX, the machine notes file contains recommended values that you use to
configure operating-system resources. Use these recommended values when you
configure the operating system. For information on how to set these
operating-system parameters, consult your operating-system manuals.
The database server receives an error from the operating system if the requested
segment size exceeds the maximum size allowed. If the database server receives an
error, it divides the requested size by two and tries again. Attempts at acquisition
continue until the largest segment size that is a multiple of 8 kilobytes can be
created. Then the database server creates as many additional segments as it
requires.
To add the entry, edit the [Link] file (located in the top level, or root directory).
You can either add a new boot option or use the currently existing boot option. To
enable support for more than two gigabytes, add the following text to the end of
the boot line:
/3GB
You might be able to calculate the maximum amount of shared memory that the
operating system can allocate by multiplying the number of shared-memory
identifiers by the maximum shared-memory segment size.
Semaphores (UNIX)
The database server operation requires one UNIX semaphore for each virtual
processor, one for each user who connects to the database server through shared
memory (ipcshm protocol), six for database server utilities, and sixteen for other
purposes.
UNIX Only
v Using ON–Monitor
End of UNIX Only
On UNIX, you must be root or user informix to use either method. On Windows,
you must be a user in the Informix Admin group.
To determine the page size for your system, choose the Parameters >
Shared-memory option in ON–Monitor. The database server page size is the last
entry on the page.
Use the following onstat options to monitor the SQL statement cache:
v onstat -g ssc (same as onstat -g cac stmt)
v onstat -g ssc all
v onstat -g ssc pool
For more information on using the SQL statement cache, monitoring it with the
onstat -g options, and tuning the configuration parameters, see improving query
To turn off residency immediately for the resident portion of shared memory,
execute the following command:
% onmode -n
These commands do not change the value of the RESIDENT parameter in the
ONCONFIG file. That is, this change is not permanent, and residency reverts to
the state specified by the RESIDENT parameter the next time that you set up
shared memory. On UNIX, you must be root or user informix to turn residency on
or off. On Windows, you must be a user in the Informix Admin group to turn
residency on or off.
The option to add a segment with the onmode utility is useful if the number of
operating-system segments is limited, and the initial segment size is so low,
relative to the amount that is required, that the operating-system limit of
shared-memory segments is nearly exceeded.
You can use the onstat -o utility to capture a static snapshot of database server
shared memory for later analysis and comparison.
The onstat -g seg command lists information for each shared-memory segment,
including the address and size of the segment, and the amount of memory that is
free or in use. For an example of onstat -g seg output, see information on the
onstat utility in the IBM Informix Administrator's Reference.
You can obtain statistics on latch use and information on specific latches. These
statistics provide a measure of the system activity.
onstat -p: Execute onstat -p to display statistics on database server activity and
waiting latches (in the lchwaits field). For an example of onstat -p output, see
information on the onstat utility in the IBM Informix Administrator's Reference.
Monitoring Buffers
You can obtain both statistics on buffer use and information on specific buffers.
The statistical information includes the percentage of data writes that are cached to
buffers and the number of times that threads had to wait to obtain a buffer. The
percentage of writes cached is an important measure of performance. (For
information on how to use this statistic to tune the database server, see your IBM
Informix Dynamic Server Performance Guide.)
onstat -p: Execute onstat -p to obtain statistics about cached reads and writes. The
following caching statistics appear in four fields on the top row of the output
display:
v The number of reads from shared-memory buffers (bufreads)
v The percentage of reads cached (%cached)
v The number of writes to shared memory (bufwrits)
v The percentage of writes cached (%cached)
v Information on generic pages (nonstandard pages in the buffer pool)
In the output, the number of reads or writes can appear as a negative number if
the number of occurrences exceeds 232 (depends on the platform).
The onstat -p option also displays a statistic (bufwaits) that indicates the number
of times that sessions had to wait for a buffer.
For an example of onstat -p output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
onstat -B: Execute onstat -B to obtain information on all buffers currently in use,
including:
v The address of every regular shared-memory buffer
For an example of onstat -B output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
onstat -b: Execute onstat -b to obtain the following information about each buffer:
v Address of each buffer currently held by a thread
v Page numbers for the page held in the buffer
v Type of page held in the buffer (for example, data page, tblspace page, and so
on)
v Type of lock placed on the buffer (exclusive or shared)
v Address of the thread that is currently holding the buffer
v Address of the first thread that is waiting for each buffer
v Information on buffer pools
You can compare the addresses of the user threads to the addresses that appear in
the onstat -u display to obtain the session ID number.
For more information on the fields that onstat displays, see information on the
onstat utility in the IBM Informix Dynamic Server Administrator's Reference
onstat -X: Execute onstat -X to obtain the same information as for onstat -b, along
with the complete list of all threads that are waiting for buffers, not just the first
waiting thread.
onstat -R: Use onstat -R to display information about buffer pools, including
information about buffers.
Here is an example of cached read and write statistics in the Profile option of the
ON-Monitor Status menu:
...
Disk Reads Buff. Reads %Cached Disk Writes Buff. Writes %Cached
177 330 46.36 4 0 0.00
...
The statistical information includes the number of times that the database server
attempted to exceed the maximum number of buffers and the number of writes to
disk (categorized by the event that caused the buffers to flush). These statistics
help you determine if the number of buffers is appropriate. For information on
tuning database server buffers, see your IBM Informix Dynamic Server Performance
Guide.
Information on the buffers in each LRU queue consists of the length of the queue
and the percentage of the buffers in the queue that have been modified.
For more information about the onstat options, see information on the onstat
utility in the IBM Informix Dynamic Server Administrator's Reference.
onstat -p: The onstat -p output contains a statistic (ovbuff) that indicates the
number of times the database server attempted to exceed the maximum number of
shared buffers specified by buffers value in the BUFFERPOOL configuration
parameter.
onstat -F: Execute onstat -F to obtain a count by write type of the writes
performed. (For an explanation of the different write types, see “Describing
Flushing Activity” on page 8-27.
The onstat -F command displays totals for the following write types:
v Foreground write
v LRU write
v Chunk write
The onstat -F command also lists the following information about the page
cleaners:
v Page-cleaner number
v Page-cleaner shared-memory address
v Current state of the page cleaner
v LRU queue to which the page cleaner was assigned
For an example of onstat -F output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
onstat -R: Execute onstat -R to obtain information about the number of buffers in
each LRU queue and the number and percentage of the buffers that are modified
or free.
For an example of onstat -R output, see information on the onstat utility in the
IBM Informix Administrator's Reference
In This Chapter
This chapter defines terms and explains the concepts that you must understand to
perform the tasks described in Chapter 11, “Managing Disk Space,” on page 11-1.
This chapter covers the following topics:
v Definitions of the physical and logical units that the database server uses to
store data on disk
v Instructions on how to calculate the amount of disk space that you need to store
your data
v Guidelines on how to lay out your disk space and where to place your
databases and tables
See the current Dynamic Server release notes for any supplementary information
on the maximum values related to the storage units discussed in this chapter.
The following sections describe the various data-storage units that the database
server supports and the relationships between those units. For information about
reserved pages, see the disk structures and storage chapter in the IBM Informix
Dynamic Server Administrator's Reference.
Chunks
A chunk is the largest unit of physical disk dedicated to database server data
storage. Chunks provide administrators with a significantly large unit for
allocating disk space. The maximum size of an individual chunk is 4 terabytes. The
number of allowable chunks is 32,766. You must run onmode -BC to enable the
maximum size of a chunk and the maximum number allowable. If onmode -BC is
not run, then the maximum chunk size is 2 gigabytes.
The database server administrator adds one or more chunks to the following
storage spaces when they approach full capacity:
v Dbspace (see page 10-9)
v Blobspace (see page 10-12)
v Sbspace (see page 10-13)
For information on chunk names, size, and number, see “Specifying Names for
Storage Spaces and Chunks” on page 11-7 and “Specifying the Maximum Size of
Chunks” on page 11-7.
The database server also uses chunks for mirroring. A primary chunk is a chunk
from which the database server copies data to a mirror chunk. If the primary chunk
fails, the database server brings the mirror chunk online automatically. For more
information, see Chapter 18, “Mirroring,” on page 18-1.
An Informix storage space can reside on an NFS-mounted file system using regular
operating-system files.
Raw Disk Space on Windows: On Windows, raw disk space can be either a
physical drive without a drive letter or a logical disk partition that has been
NTFS Files: You must use NTFS files, not FAT files, for disk space on Windows.
For more information, see “Allocating NTFS File Space on Windows” on page 11-6.
When dbspaces reside on raw disk devices (also called character-special devices), the
database server uses unbuffered disk access. Performance is much better when you
use raw disk devices than cooked files because the database server has direct I/O
access to the devices. A raw disk directly transfers data between the database
server memory and disk without also copying data.
To create a raw device, configure a block device (hard disk) with a raw interface.
The storage space that the device provides is called raw disk space. A chunk of raw
disk space is physically contiguous.
The name of the chunk is the name of the character-special file in the /dev
directory. In many operating systems, you can distinguish the character-special file
from the block-special file by the first letter in the filename (typically r). For
example, /dev/rsd0f is the character-special device that corresponds to the
/dev/sd0f block-special device.
For more information, see “Allocating Raw Disk Space on UNIX” on page 11-5.
A cooked file is a regular file that the operating system manages. Cooked file chunks
and raw disk chunks are equally reliable. Unlike raw disk space, the logically
contiguous blocks of a cooked file might not be physically contiguous.
You can more easily allocate cooked files than raw disk space. To allocate a cooked
file, you need only create the file on any existing partition. The name of the chunk
is the complete pathname of the file. These steps are described in detail in
“Allocating Cooked File Spaces on UNIX” on page 11-4.
For cooked file chunks, the operating system processes all chunk I/O from its own
buffer pool and ensures that all writes to chunks are physically written to the disk.
Important: While you should use raw disk devices on UNIX to achieve better
performance, recent advances in I/O caching for cooked writes can
provide similar if not better performance. To determine the best device
performance, perform benchmark testing on the system with both
types of devices for the dbspace and table layout.
Offsets
The system administrator might divide a physical disk into partitions, which are
different parts of a disk that have separate pathnames. Although you should use
an entire disk partition when you allocate a chunk on a raw disk device, you can
subdivide partitions or cooked files into smaller chunks using offsets. For more
information, see “Disk-Layout Guidelines” on page 10-33.
Tip: With a 4-terabyte limit to the size of a chunk, you can avoid partitioning a
disk by assigning a single chunk per disk drive.
An offset allows you to indicate the location of a given chunk on the disk partition,
file, or device. For example, suppose that you create a 1000-kilobyte chunk that
you want to divide into two chunks of 500 kilobytes each. You can use an offset of
zero kilobytes to mark the beginning of the first chunk and an offset of 500
kilobytes to mark the beginning of the second chunk.
You can specify an offset whenever you create, add, or drop a chunk from a
dbspace, blobspace, or sbspace.
You might also need to specify an offset to prevent the database server from
overwriting partition information. “Allocating Raw Disk Space on UNIX” on page
11-5 explains when and how to specify an offset.
Pages
A page is the physical unit of disk storage that the database server uses to read
from and write to Informix databases. Figure 10-1 illustrates the concept of a page,
represented by a darkened sector of a disk platter.
On most UNIX platforms, the page size is 2 kilobytes. On Windows, the page size
is 4 kilobytes. Because your hardware determines the size of your page, you cannot
alter this value.
Page
For information on how the database server structures data within a page, see the
chapter on disk structures and storage in the IBM Informix Dynamic Server
Administrator's Reference
Blobpages
A blobpage is the unit of disk-space allocation that the database server uses to
store simple large objects (TEXT or BYTE data) within a blobspace. For a
description of blobspaces, refer to “Blobspaces” on page 10-12.
You specify blobpage size as a multiple of the database server page size. Because
the database server allocates blobpages as contiguous spaces, it is more efficient to
store simple large objects in blobpages that are as close to the size of the data as
possible. Figure 10-3 illustrates the concept of a blobpage, represented as a multiple
(three) of a data page.
For information about how Dynamic Server structures data stored in a blobpage,
see structure of a blobspace blobpage in the disk structures and storage chapter of
the IBM Informix Dynamic Server Administrator's Reference.
Sbpages
An sbpage is the type of page that the database server uses to store smart large
objects within a sbspace. For a description of sbspaces, refer to “Sbspaces” on page
10-13. Unlike blobpages, sbpages are not configurable. An sbpage is the same size
as the database server page, which is usually 2 kilobytes on UNIX and 4 kilobytes
on Windows.
Chunk
Smart-large-object extent
(size calculated by
database server)
The database server calculates the extent size for a smart large object from a set of
heuristics, such as the number of bytes in a write operation. For more information,
see “Extent Sizes for Sbspaces” on page 10-16.
Extents
When you create a table, the database server allocates a fixed amount of space to
contain the data to be stored in that table. When this space fills, the database
server must allocate space for additional storage. The physical unit of storage that
the database server uses to allocate both the initial and subsequent storage space is
called an extent. Figure 10-6 illustrates the concept of an extent.
Chunk
Page
Extent
Figure 10-6. An Extent That Consists of Six Contiguous Pages on a Raw Disk Device
An extent consists of a collection of contiguous pages that store data for a given
table. (See “Tables” on page 10-22.) Every permanent database table has two extent
sizes associated with it. The initial-extent size is the number of kilobytes allocated
to the table when it is first created. The next-extent size is the number of kilobytes
allocated to the table when the initial extent (and any subsequent extents) becomes
full. For permanent tables and user-defined temporary tables, the next-extent size
begins to double after 16 extents have been added. For system-created temporary
tables, the next-extent size begins to double after 4 extents have been added.
To specify the initial-extent size and next-extent size, use the CREATE TABLE and
ALTER TABLE statements. For more information, see the IBM Informix Guide to
SQL: Syntax and disk structures in the IBM Informix Dynamic Server Administrator's
Reference.
When you create a table with a column for CLOB or BLOB data types, you also
define extents for an sbspace. For more information, refer to “Storage
Characteristics of Sbspaces” on page 10-15.
Figure 10-7 shows how the database server allocates six pages for an extent:
v An extent is always entirely contained in a chunk; an extent cannot cross chunk
boundaries.
Dbspaces
A dbspace is a logical unit that can contain between 1 and 32,767 chunks. Place
databases, tables, logical-log files, and the physical log in dbspaces.
As Figure 10-8 shows, to control the placement of databases or tables, you can use
the IN dbspace option of the CREATE DATABASE or CREATE TABLE statements.
(For more information, see “Tables” on page 10-22.)
/dev/rsd0f
Figure 10-8. Controlling Table Placement with the CREATE TABLE... IN Statement
Before you create a database or table in a dbspace, you must first create the
dbspace. For more information on how to create a dbspace, see “Creating a
Dbspace that Uses the Default Page Size” on page 11-8.
A dbspace includes one or more chunks, as Figure 10-9 shows. You can add more
chunks at any time. It is a high-priority task of a database server administrator to
monitor dbspace chunks for fullness and to anticipate the need to allocate more
chunks to a dbspace. (See “Monitoring Disk Usage” on page 11-32.) When a
dbspace contains more than one chunk, you cannot specify the chunk in which the
data resides.
Chunks
Database
System catalog
Dbspace 1 Chunk 1
Table 1
Dbspace 2 Chunk 2
Table 2
Dbspace 3 Chunk 3
Chunk 4
Figure 10-9. Dbspaces That Link Logical and Physical Units of Storage
The database server uses the dbspace to store databases and tables. (See “Tables”
on page 10-22.)
When you create a standard or temporary dbspace, you can specify the page size
for the dbspace. You cannot specify a page size for blobspaces, sbspaces, or
external spaces. If you do not specify a page size, the size of the root dbspace is
the default page size. For more information, see “Creating a Dbspace with a
Non-Default Page Size” on page 11-11.
You can mirror every chunk in a mirrored dbspace. As soon as the database server
allocates a mirror chunk, it flags all space in that mirror chunk as full. See
“Monitoring Disk Usage” on page 11-32.
For information on using ISA or onspaces to perform the following tasks, see
Chapter 11, “Managing Disk Space,” on page 11-1.
v Creating a dbspace
v Adding a chunk to a dbspace
v Renaming a dbspace
v Dropping a chunk
v Dropping a dbspace, blobspace, or sbspace
Root Dbspace
The root dbspace is the initial dbspace that the database server creates. The root
dbspace is special because it contains reserved pages and internal tables that
describe and track all physical and logical units of storage. (For more information
on these topics, see “Tables” on page 10-22 and the disk structures and storage
chapter in the IBM Informix Dynamic Server Administrator's Reference.) The initial
chunk of the root dbspace and its mirror are the only chunks created during
disk-space setup. You can add other chunks to the root dbspace after disk-space
setup.
The root dbspace is also the default dbspace location for any database created with
the CREATE DATABASE statement.
The root dbspace is the default location for all temporary tables created by the
database server to perform requested data management.
See “Size of the Root Dbspace” on page 10-31 for information on how much space
to allocate for the root dbspace. You can also add extra chunks to the root dbspace
after you set up database server disk space.
Temporary Dbspaces
A temporary dbspace is a dbspace reserved exclusively for the storage of
temporary tables. You cannot mirror a temporary dbspace.
Whenever you set up the database server, all temporary dbspaces are set up. The
database server clears any tables that might remain since the last time that the
database server shut down.
The database server does not perform logical or physical logging for temporary
dbspaces. Because temporary dbspaces are not physically logged, fewer
checkpoints and I/O operations occur, which improves performance.
The database server logs table creation, the allocation of extents, and the dropping
of the table for a temporary table in a standard dbspace. In contrast, the database
server does not log tables stored in temporary dbspaces. Logical-log suppression in
temporary dbspaces reduces the number of log records to roll forward during
logical recovery as well, thus improving the performance during critical down
time.
Using temporary dbspaces to store temporary tables also reduces the size of your
storage-space backup, because the database server does not back up temporary
dbspaces.
If you have more than one temporary dbspace and execute a SELECT statement
into a temporary table, the results of the query are inserted in round robin order.
Blobspaces
A blobspace is a logical storage unit composed of one or more chunks that store
only TEXT and BYTE data. A blobspace stores TEXT and BYTE data in the most
efficient way possible. You can store TEXT and BYTE columns associated with
distinct tables (see “Tables” on page 10-22) in the same blobspace.
The database server writes data stored in a blobspace directly to disk. This data
does not pass through resident shared memory. If it did, the volume of data could
occupy so many of the buffer-pool pages that other data and index pages would be
forced out. For the same reason, the database server does not write TEXT or BYTE
objects that are assigned to a blobspace to either the logical or physical log. The
database server logs blobspace objects by writing them directly from disk to the
logical-log backup tapes when you back up the logical logs. Blobspace objects
never pass through the logical-log files.
When you create a blobspace, you assign to it one or more chunks. You can add
more chunks at any time. One of the tasks of a database server administrator is to
monitor the chunks for fullness and anticipate the need to allocate more chunks to
a blobspace. For instructions on how to monitor chunks for fullness, see
“Monitoring Simple Large Objects in a Blobspace” on page 11-37. For instructions
For information about the structure of a blobspace, see the chapter on disk
structures and storage in the IBM Informix Dynamic Server Administrator's Reference.
Sbspaces
An sbspace is a logical storage unit composed of one or more chunks that store
smart large objects. Smart large objects consist of CLOB (character large object) and
BLOB (binary large object) data types. User-defined data types can also use
sbspaces. For more information about data types, refer to the IBM Informix Guide to
SQL: Reference.
For information on correctly allocating metadata and user data for sbspaces, see
“Sizing Sbspace Metadata” on page 11-23 and the IBM Informix Dynamic Server
Performance Guide.
When you add a chunk to an sbspace, you can specify whether it contains a
metadata area and user-data area or whether to reserve the chunk exclusively for
user data. You can add more chunks at any time. If you are updating smart large
objects, I/O to the user data is much faster on raw disks than cooked chunk files.
For instructions on how to create a sbspace, add chunks to a sbspace, or drop a
chunk from a sbspace, see Chapter 11, “Managing Disk Space,” on page 11-1.
sbspace on UNIX
% onspaces -c -S s9_sbspc -g 4 -p./s9_sbspc -o 0 -s 2000
s9_sbspc
Before you specify an sbspace in a PUT clause, you must first create the sbspace.
For more information on how to create an sbspace with the onspaces -c -S
command, see “Adding a Chunk to a Dbspace or Blobspace” on page 11-16. For
more information on how to specify smart large object characteristics in the PUT
clause, refer to the CREATE TABLE statement in the IBM Informix Guide to SQL:
Syntax.
If you do not specify the PUT clause, the database server stores the smart large
objects in the default sbspace that you specify in the SBSPACENAME configuration
An sbspace includes one or more chunks, as Figure 10-11 shows. When an sbspace
contains more than one chunk, you cannot specify the chunk in which the data
resides.
You can add more chunks at any time. It is a high-priority task of a database
server administrator to monitor sbspace chunks for fullness and to anticipate the
need to allocate more chunks to a sbspace. For more information on monitoring
sbspaces, refer to your IBM Informix Dynamic Server Performance Guide.
Chunks
Table
Dbspace 1 Chunk 1
Column Data Type
1 SERIAL
2 SMALLINT
3 INTEGER
Chunk 2
Figure 10-11. Sbspaces That Link Logical and Physical Units of Storage
The database server uses sbspaces to store table columns that contain smart large
objects. The database server uses dbspaces to store the rest of the table columns.
You can mirror an sbspace to speed recovery in event of a media failure. For more
information, refer to “Mirroring” on page 18-1.
For information on using onspaces to perform the following tasks, see Chapter 11,
“Managing Disk Space,” on page 11-1.
v Creating an sbspace
v Adding a chunk to an sbspace
v Altering storage characteristics of smart large objects
v Creating a temporary sbspace
v Dropping an sbspace
The unit of allocation in an sbspace is an extent. The database server calculates the
extent size for a smart large object from a set of heuristics, such as the number of
bytes in a write operation. For example, if an operation asks to write 30 kilobytes,
the database server tries to allocate an extent the size of 30 kilobytes.
Important: For most applications, you should use the values that the database
server calculates for the extent size.
If you know the size of the smart large object, you can use one of the following
functions to set the extent size. The database server allocates the entire smart large
object as one extent (if an extent of that size is available in the chunk):
v The DataBlade API mi_lo_specset_estbytes() function
For more information on the DataBlade API functions for smart large objects,
refer to the IBM Informix DataBlade API Function Reference.
v The ESQL/C ifx_lo_specset_estbytes function
For more information on the ESQL/C functions for smart large objects, refer to
the IBM Informix ESQL/C Programmer's Manual.
For information about tuning extent sizes, see smart large objects in the chapter on
configuration effects on I/O utilization in your IBM Informix Dynamic Server
Performance Guide.
To specify the size and location of the metadata area, specify the -Ms and -Mo
flags in the onspaces command. If you do not use the -Ms flag, the database server
uses the value of AVG_LO_SIZE to estimate the amount of space to allocate for the
metadata area. For more information, refer to “Sizing Sbspace Metadata” on page
11-23.
Buffering Mode
When you create an sbspace, the default buffering mode is on, which means to use
the buffer pool in the resident portion of shared memory.
As the database administrator, you can specify the buffering mode with the
BUFFERING tag of the onspaces -c -Df option. The default is “buffering=ON”,
which means to use the buffer pool. If you turn off buffering, the database server
uses private buffers in the virtual portion of shared memory.
Important: In general, if read and write operations to the smart large objects are
less than 8 kilobytes, do not specify a buffering mode when you create
the sbspace. If you are reading or writing short blocks of data, such as
2 kilobytes or 4 kilobytes, leave the default of “buffering=ON” to
obtain better performance.
Last-Access Time
When you create an sbspace, you can specify whether or not the database server
should keep the last time that the smart large object was read or updated with the
ACCESSTIME tag of the onspaces -c -Df option. The default is
“ACCESSTIME=OFF”. The database server keeps this last-access time in the
metadata area.
For more information on how programmers use this last-access time, refer to the
IBM Informix DataBlade API Programmer's Guide and IBM Informix ESQL/C
Programmer's Manual.
Lock Mode
When you create an sbspace, you can specify whether or not the database server
should lock the whole smart large object or a range of bytes within a smart large
object with the LOCK_MODE tag of the onspaces -c -Df option. The default is
“LOCK_MODE=BLOB”, which means to lock the entire smart large object. For
more information, refer to the locking chapter in your IBM Informix Dynamic Server
Performance Guide.
Logging
When you create an sbspace, you can specify whether or not to turn on logging for
the smart large objects. The default is no logging. For more information, refer to
“Logging Sbspaces and Smart Large Objects” on page 14-7.
Important: When you use logging databases, turn logging on for the sbspaces. If a
failure occurs that requires log recovery, you can keep the smart large
objects consistent with the rest of the database.
You specify the logging status with the LOGGING tag of the onspaces -c -Df
option. The default is “LOGGING=off”. You can change the logging status with the
onspaces -ch -Df option. You can override this logging status with the PUT clause
in the SQL statements CREATE TABLE or ALTER TABLE. For more information
about these SQL statements, refer to the IBM Informix Guide to SQL: Syntax.
The programmer can override this logging status with functions that the DataBlade
API and ESQL/C provide. For more information on the DataBlade API functions
for smart large objects, refer to the IBM Informix DataBlade API Function Reference.
For more information on the ESQL/C functions for smart large objects, refer to the
IBM Informix ESQL/C Programmer's Manual.
When you turn on logging for an sbspace, the smart large objects pass through the
resident portion of shared memory. Although applications can retrieve pieces of a
smart large object, you still need to consider the larger size of data that might pass
through the buffer pool and logical-log buffers. For more information, refer to
“Accessing Smart Large Objects” on page 8-31.
System-specified
storage characteristics
Sbspace storage characteristics
when the sbspace is created with the onspaces utility or
when you change the sbspace with onspaces -ch)
Figure 10-12 shows that you can override the system default in the following ways:
v Use the -Df tags of the onspaces -c -S command to override the system default
for a specific sbspace.
You can later change these sbspace attributes for the sbspace with the onspaces
-ch option. For more information on valid ranges for the -Df tags, refer to the
onspaces section in the IBM Informix Dynamic Server Administrator's Reference.
v You override the system default for a specific column when you specify these
attributes in the PUT clause of the CREATE TABLE or ALTER TABLE
statements.
For more information on these SQL statements, refer to the IBM Informix Guide to
SQL: Syntax.
v The programmer can override the default values for sbspace attributes for
specific smart large objects with functions that the DataBlade API and ESQL/C
programming interface provide.
Temporary Sbspaces
Use a temporary sbspace to store temporary smart large objects without metadata
logging and user-data logging. If you store temporary smart large objects in a
standard sbspace, the metadata is logged. Temporary sbspaces are similar to
temporary dbspaces. To create a temporary sbspace, use the onspaces -c -S
command with the -t option. For more information, see “Creating a Temporary
Sbspace” on page 11-25.
You can store temporary large objects in a standard sbspace or temporary sbspace.
v If you specify a temporary sbspace in the SBSPACETEMP parameter, you can
store temporary smart large objects there.
v If you specify a standard sbspace in the SBSPACENAME parameter, you can
store temporary and permanent smart large objects there.
v If you specify a temporary sbspace name in the CREATE TEMP TABLE
statement, you can store temporary smart large objects there.
v If you specify a permanent sbspace name in the CREATE TABLE statement, you
can store temporary smart large objects there.
You create a temporary smart large object in the same way as a permanent smart
large object, except you set the LO_CREATE_TEMP flag in the ifx_lo_specset_flags
or mi_lo_specset_flags function. Use mi_lo_copy or ifx_lo_copy to create a
permanent smart large object from a temporary smart large object. For details on
creating temporary smart large objects, see the IBM Informix DataBlade API
Programmer's Guide.
Extspaces
An extspace is a logical name associated with an arbitrary string that signifies the
location of external data. The resource that the extspace references depends on a
user-defined access method for accessing its contents.
For example, a database user might require access to binary files encoded in a
proprietary format. First, a developer creates an access method, which is a set of
routines that access the data. These routines are responsible for all interaction
between the database server and the external file. A DBA then adds an extspace
that has the file as its target to the database. After the DBA creates a table in the
extspace, the users can access the data in the proprietary files via SQL statements.
To locate those files, use the extspace information.
An extspace need not be a filename. For example, it can be a network location. The
routines that access the data can use information found in the string associated
with the extspace in any manner.
For more information on user-defined access methods, see the IBM Informix
Virtual-Table Interface Programmer's Guide. For more information on creating
functions and primary access methods, see the IBM Informix Guide to SQL: Syntax.
Databases
A database is a logical storage unit that contains tables and indexes. (See “Tables”
on page 10-22.) Each database also contains a system catalog that tracks
information about many of the elements in the database, including tables, indexes,
SPL routines, and integrity constraints.
The size limits that apply to databases are related to their location in a dbspace. To
be certain that all tables in a database are created on a specific physical device,
assign only one chunk to the device, and create a dbspace that contains only that
chunk. Place your database in that dbspace. When you place a database in a chunk
assigned to a specific physical device, the database size is limited to the size of that
chunk.
For instructions on how to list the databases that you create, see “Displaying
Databases” on page 11-32.
Tables
In relational database systems, a table is a row of column headings together with
zero or more rows of data values. The row of column headings identifies one or
more columns and a data type for each column.
When you create a table, the database server allocates disk space for the table in a
block of pages called an extent. (See “Extents” on page 10-8.) You can specify the
size of both the first and any subsequent extents.
You can place the table in a specific dbspace by naming the dbspace when they
create the table (usually with the IN dbspace option of CREATE TABLE). When you
do not specify the dbspace, the database server places the table in the dbspace
where the database resides.
For more information about distribution schemes, see the IBM Informix Database
Design and Implementation Guide. For information on how to fragment tables and
indexes over multiple disks to improve performance, concurrency, data availability,
and backups, refer to your IBM Informix Dynamic Server Performance Guide.
A table, composed of extents, can span multiple chunks, as Figure 10-14 shows.
Chunk 1 Chunk 2
Extent 1 Extent 2
Simple large objects reside in blobpages in either the dbspace with the data pages
of the table or in a separate blobspace. When you use the Optical Subsystem, you
can also store simple large objects in an optical storage subsystem.
For advice on where to store your tables, see “Disk-Layout Guidelines” on page
10-33 and your IBM Informix Dynamic Server Performance Guide.
Table 10-4 lists the properties of the types of tables available with Dynamic Server.
The flag values are the hexadecimal values for each table type in the flags column
of systables.
A STANDARD table is the default type on both logging and nonlogging databases.
STANDARD tables are logged if stored in a logging database but are not logged if
stored in a nonlogging database.
RAW Tables
RAW tables are nonlogging permanent tables and are similar to tables in a
nonlogging database. RAW tables use light appends, which add rows quickly to the
end of each table fragments. Updates, inserts, and deletes in a RAW table are
supported but not logged. RAW tables do not support indexes, referential
constraints, or rollback. You can restore a RAW table from the last physical backup
if it has not been updated since that backup. Fast recovery rolls back incomplete
transactions on STANDARD tables but not on RAW tables. A RAW table has the
same attributes whether stored in a logging or nonlogging database.
RAW tables are intended for the initial loading and validation of data. To load
RAW tables, you can use any loading utility, including dbexport or the
High-Performance Loader (HPL) in express mode. If an error or failure occurs
while loading a RAW table, the resulting data is whatever was on the disk at the
time of the failure.
Recommendation: Do not use RAW tables within a transaction. After you have
loaded the data, use the ALTER TABLE statement to change the table to type
STANDARD and perform a level-0 backup before you use the table in a
transaction.
Temp Tables
Temp tables are temporary, logged tables that are dropped when the user session
closes, the database server shuts down, or on reboot after a failure. Temp tables
For more information about how to improve the performance of loading very large
tables, see your IBM Informix Dynamic Server Performance Guide. For more
information on using ALTER TABLE to change a table from logging to nonlogging,
see the IBM Informix Guide to SQL: Syntax.
Inserts, updates, and deletions that occurred after the last checkpoint are lost.
Important: After you load a RAW table or change a RAW table to type
STANDARD, you must perform a level-0 backup.
Temporary Tables
The database server needs to provide disk space for temporary tables of the
following two kinds:
v Temporary tables that you create with an SQL statement, such as CREATE
TEMP TABLE... or SELECT .... INTO SCRATCH
v Temporary tables that the database server creates as it processes a query
Make sure that your database server has configured enough temporary space for
both user-created and database server-created temporary tables. Some uses of the
database server might require as much temporary storage space as permanent
storage space, or more.
By default, the database server stores temporary tables in the root dbspace. If you
decide not to store your temporary tables in the root dbspace, use the
DBSPACETEMP environment variable or the DBSPACETEMP configuration
parameter to specify a list of dbspaces for temporary tables.
Only the session that creates a temporary table can use the table. When the session
exits, the table is dropped automatically.
When you create a temporary table, the database server uses the following criteria:
v If the query used to populate the TEMP table produces no rows, the database
server creates an empty, unfragmented table.
v If the rows that the query produces do not exceed 8 kilobytes, the temporary
table resides in only one dbspace.
v If the rows exceed 8 kilobytes, the database server creates multiple fragments
and uses a round-robin fragmentation scheme to populate them unless you
specify a fragmentation method and location for the table.
If you use the CREATE TEMP and SELECT...INTO TEMP SQL statements and
DBSPACETEMP has been set:
v LOGGING dbspaces in the list are used to create the tables that specify or imply
the WITH LOG clause.
v NON-LOGGING temporary dbspaces in the list are used to create the tables that
specify the WITH NO LOG clause.
Where User-Created Temporary Tables are Stored: If your application lets you
specify the location of a temporary table, you can specify either logging spaces or
nonlogging spaces that you create exclusively for temporary tables. SCRATCH
tables are not logged and must be created in temporary spaces.
For information about creating temporary dbspaces and dbslices, refer to the
onspaces section in t.
If you do not specify the location of a temporary table, the database server stores
the temporary table in one of the spaces that you specify as an argument to the
DBSPACETEMP configuration parameter or environment variable. The database
server keeps track of the name of the last dbspace that it used for a temporary
table. When the database server receives another request for temporary storage
space, it uses the next available dbspace to spread I/O evenly across the temporary
storage space.
For information about where the database stores temporary tables when you do
not list any spaces as an argument to DBSPACETEMP, see the DBSPACETEMP
section in the IBM Informix Administrator's Reference.
When you use an application to create a temporary table, you can use the
temporary table until the application exits or performs one of the following
actions:
v Closes the database in which the table was created and opens a database in a
different database server
v Closes the database in which the table was created
v Explicitly drops the temporary table
When the process that initiated the creation of the table is complete, the database
server deletes the temporary tables that it creates.
Tblspaces
Database server administrators sometimes need to track disk use by a particular
table. A tblspace contains all the disk space allocated to a given table or table
fragment (if the table is fragmented). A separate tblspace contains the disk space
allocated for the associated index.
A tblspace, for example, does not correspond to any particular part of a chunk or
even to any particular chunk. The indexes and data that make up a tblspace might
be scattered throughout your chunks. The tblspace, however, represents a
convenient accounting entity for space across chunks devoted to a particular table.
(See “Tables” on page 10-22.)
Figure 10-15 illustrates the tblspaces for three tables that form part of the
stores_demo database. Only one table (or table fragment) exists per tblspace. An
index resides in a separate tblspace from the associated table. Blobpages represent
TEXT or BYTE data stored in a dbspace.
stores_demo Database
customer catalog orders
data tblspace data tblspace data tblspace
Data Data Data Data Data Data Data Data Data
page page page page page page page page page
Data Data Data Data Data Data Data Data Data
page page page page page page page page page
Data Data Data Data Data Data Data Data Data
page page page page page page page page page
Bitmap Blob- Blob- Blob- Index Index Bitmap
page page page page page page page
Blob- Blob- Bitmap Index
page page page page
Extent Interleaving
The database server allocates the pages that belong to a tblspace as extents.
Although the pages within an extent are contiguous, extents might be scattered
throughout the dbspace where the table resides (even on different chunks).
Figure 10-16 depicts this situation with two noncontiguous extents that belong to
the tblspace for table_1 and a third extent that belongs to the tblspace for table_2.
A table_2 extent is positioned between the first table_1 extent and the second
table_1 extent. When this situation occurs, the extents are interleaved. Because
sequential access searches across table_1 require the disk head to seek across the
table_2 extent, performance is worse than if the table_1 extents were contiguous.
For instructions on how to avoid and eliminate interleaving extents, see your IBM
Informix Dynamic Server Performance Guide.
Figure 10-16. Three Extents That Belong to Two Different Tblspaces in a Single Dbspace
Usually you fragment a table when you initially create it. The CREATE TABLE
statement takes one of the following forms:
CREATE TABLE tablename ... FRAGMENT BY ROUND ROBIN IN dbspace1,
dbspace2, dbspace3;
When you fragment a table, you can also create multiple partitions of the table
within the same dbspace, as shown in this example:
CREATE TABLE tb1(a int)
FRAGMENT BY EXPRESSION
PARTITION part1 (a >=0 AND a < 5) in dbs1,
PARTITION part2 (a >=5 AND a < 10) in dbs1
...
;
Figure 10-17 illustrates the role of fragments in specifying the location of data.
Dbspace 1 Chunk 1
Table 1
Dbspace 2 Chunk 2
Table 2
Fragment 1
Dbspace 3 Chunk 3
Fragment 2
Fragment 3
Figure 10-17. Dbspaces That Link Logical Units (Including Table Fragments) and Physical
Units of Storage
For information on spaces and partitions, see Chapter 11, “Managing Disk Space,”
on page 11-1.
For more information about fragmentation, refer to the IBM Informix Database
Design and Implementation Guide and the IBM Informix Dynamic Server Performance
Guide.
This estimate is the initial root dbspace size before you initialize the database
server. The initial size of the root dbspace depends on whether you plan to store
the physical log, logical logs, and temporary tables in the root dbspace or in
another dbspace. The root dbspace must be large enough for the minimum size
configuration during disk initialization.
Recommendation: Set up the system with a small log size (for example, three
1000-kilobyte log files, or 3000 kilobytes for the total log size). After setup is
complete, create new dbspaces, move and resize the logical-log files, and drop the
original logs in the root dbspace. Then move the physical log to another dbspace.
This procedure minimizes the impact of the logs in the root dbspace because:
v A large amount of space is not left unused in the root dbspace after you move
the logs (if your root dbspace does not grow).
v The logs do not contend for space and I/O on the same disk as the root dbspace
(if your root dbspace does grow).
For details on how to move the logs, see “Moving a Logical-Log File to Another
Dbspace” on page 15-12 and “Changing the Physical-Log Location and Size” on
page 17-1.
You can add chunks and drop empty chunks in the root dbspace. Start with a
small root dbspace and expand it as your system grows. However, you cannot start
with a large initial root chunk and shrink it.
To calculate the size of the logical-log files, multiply the value of the ONCONFIG
parameter LOGSIZE by the number of logical-log files. For advice on sizing your
logical log, see “Estimating the Size and Number of Log Files” on page 15-2.
Temporary Tables
Analyze end-user applications to estimate the amount of disk space that the
database server might require for temporary tables. Try to estimate how many of
these statements are to run concurrently. The space occupied by the rows and
columns that are returned provides a good basis for estimating the amount of
space required.
The largest temporary table that the database server creates during a warm restore
is equal to the size of your logical log. You calculate the size of your logical log by
adding the sizes of all logical-log files.
You must also analyze end-user applications to estimate the amount of disk space
that the database server might require for explicit temporary tables.
For more information, including a list of statements that require temporary space,
see “Temporary Tables” on page 10-26.
Extra Space
Allow extra space in the root dbspace for the system databases to grow, for the
extended reserved pages, and ample free space. The number of extended reserved
pages depends on the number of primary chunks, mirror chunks, logical-log files,
and storage spaces in the database server.
For instructions about calculating the size of your tables, refer to your IBM Informix
Dynamic Server Performance Guide.
Disk-Layout Guidelines
The following are typical goals for efficient disk layout:
v Limiting disk-head movement
v Reducing disk contention
v Balancing the load
v Maximizing availability
You must make some trade-offs among these goals when you design your disk
layout. For example, separating the system catalog tables, the logical log, and the
physical log can help reduce contention for these resources. However, this action
can also increase the chances that you have to perform a system restore. For
detailed disk-layout guidelines, see the IBM Informix Dynamic Server Performance
Guide.
Tip: With the 4-terabyte maximum size of a chunk, you can avoid partitioning
by assigning a chunk per disk drive.
Table-Location Guidelines
This section lists some strategies for optimizing the disk layout, given certain
characteristics about the tables in a database. You can implement many of these
strategies with a higher degree of control using table fragmentation:
v Isolate high-use tables on a separate disk.
To isolate a high-use table on its own disk device, assign the device to a chunk,
and assign the same chunk to a dbspace. Finally, place the frequently used table
in the dbspace just created using the IN dbspace option of CREATE TABLE.
To display the level of I/O operations against each chunk, run the onstat -g iof
option.
v Fragment high-use tables over multiple disks.
v Group related tables in a dbspace.
If a device that contains a dbspace fails, all tables in that dbspace are
inaccessible. However, tables in other dbspaces remain accessible. Although you
must perform a cold restore if a dbspace that contains critical information fails,
you need only perform a warm restore if a noncritical dbspace fails.
v Place high-use tables on the middle partition of a disk.
v Optimize table extent sizes.
For more information, see the chapter on table performance considerations in your
IBM Informix Performance Guide. For information on onstat options, see the IBM
Informix Administrator's Reference.
Meeting any one of these objectives has trade-offs. For example, configuring your
system for high performance usually results in taking risks regarding the
availability of data. The sections that follow present an example in which the
database server administrator must make disk-layout choices given limited disk
resources. These sections describe two different disk-layout solutions. The first
solution represents a performance optimization, and the second solution represents
an availability-and-restore optimization.
The setting for the sample disk layouts is a fictitious sporting goods database that
uses the structure (but not the volume) of the stores_demo database. In this
example, the database server is configured to handle approximately 350 users and
3 gigabytes of data. The disk space resources are shown in the following table.
The database includes two large tables: cust_calls and items. Assume that both of
these tables contain more than 1,000,000 rows. The cust_calls table represents a
record of all customer calls made to the distributor. The items table contains a line
item of every order that the distributor ever shipped.
The database includes two high-use tables: items and orders. Both of these tables
are subject to constant access from users around the country.
The remaining tables are low-volume tables that the database server uses to look
up data such as postal code or manufacturer.
Disks
Database rootdbs
phys_log_space
Disk 1
(2.5 gigabyte)
cust_calls
cust_calls_space
log_log_space
Disk 2
(3 gigabyte, high
items performance)
items_space
look_up2
orders
orders_space
Disk 4
(1.5 gigabyte)
Database Disks
stock catalog manufact
look_up1
Disk 1
rootdbs (2.5 gigabyte)
phys_log_space
log_log_space
state call_type customer
Disk 4
look_up2 (1.5 gigabyte)
cust_calls
cust_calls_space
orders
orders_space
Disk 2
(3 gigabyte, high
performance)
items
items_space
Disk 3
(2 gigabyte, high
performance)
Logical-Volume Manager
A logical-volume manager (LVM) is a utility that allows you to manage your disk
space through user-defined logical volumes.
Many computer manufacturers ship their computers with a proprietary LVM. You
can use the database server to store and retrieve data on disks that are managed
by most proprietary LVMs. Logical-volume managers provide some advantages
and some disadvantages, as discussed in the remainder of this section.
Most LVMs can manage multiple gigabytes of disk space. The database server
chunks are limited to a size of 4 terabytes, and this size can be attained only when
Because LVMs allow you to partition a disk drive into multiple volumes, you can
control where data is placed on a given disk. You can improve performance by
defining a volume that consists of the middle-most cylinders of a disk drive and
placing high-use tables in that volume. (Technically, you do not place a table
directly in a volume. You must first allocate a chunk as a volume, then assign the
chunk to a dbspace, and finally place the table in the dbspace. For more
information, see “Control of Where Data Is Stored” on page 10-9.)
Tip: If you choose to use large disk drives, you can assign a chunk to one drive
and eliminate the need to partition the disk.
You can also improve performance by using a logical volume manager to define a
volume that spreads across multiple disks and then placing a table in that volume.
Many logical volume managers also allow a degree of flexibility that standard
operating-system format utilities do not. One such feature is the ability to
reposition logical volumes after you define them. Thus getting the layout of your
disk space right the first time is not so critical as with operating-system format
utilities.
In This Chapter
This chapter provides the instructions on managing effectively the disk spaces and
data that the database server controls. It assumes you are familiar with the terms
and concepts contained in Chapter 10, “Data Storage,” on page 10-1.
Your IBM Informix Dynamic Server Performance Guide also contains information
about managing disk space. In particular, it describes how to eliminate interleaved
extents, how to reclaim space in an empty extent, and how to improve disk I/O.
Before you can create a storage space or chunk, or mirror an existing storage space,
you must allocate disk space for the chunk file. You can allocate either an empty
file or a portion of raw disk for database server disk space.
UNIX Only
On UNIX, if you allocate raw disk space, you should use the UNIX ln command to
create a link between the character-special device name and another filename. For
more information on this topic, see “Creating Symbolic Links to Raw Devices
(UNIX)” on page 11-5.
Using a UNIX file and its inherent operating-system interface for database server
disk space also is referred to as using cooked space.
End of UNIX Only
Windows Only
On Windows, you should use NTFS files for database server disk space. For more
information on this recommendation, see “Unbuffered or Buffered Disk Access on
UNIX” on page 10-4.
End of Windows Only
You can balance chunks over disks and controllers. Placing multiple chunks on a
single disk can improve throughput.
Specifying an Offset
When you allocate a chunk of disk space to the database server, specify an offset
for one of the following two purposes:
v To prevent the database server from overwriting the partition information
v To define multiple chunks on a partition, disk device, or cooked file
Many computer systems and some disk-drive manufacturers keep information for
a physical disk drive on the drive itself. This information is sometimes referred to
as a volume table of contents (VTOC) or disk label. The VTOC is commonly stored
on the first track of the drive. A table of alternate sectors and bad-sector mappings
(also called a revectoring table) might also be stored on the first track.
If you plan to allocate partitions at the start of a disk, you might need to use
offsets to prevent the database server from overwriting critical information
required by the operating system. For the exact offset required, refer to your
disk-drive manuals.
Warning: If you are running two or more instances of the database server, be
extremely careful not to define chunks that overlap. Overlapping chunks
can cause the database server to overwrite data in one chunk with
unrelated data from an overlapping chunk. This overwrite effectively
destroys overlapping data.
For the first chunk, assign any initial offset, if necessary, and specify the size as an
amount that is less than the total size of the allocated disk space. For each
additional chunk, specify the offset to include the sizes of all previously assigned
chunks, plus the initial offset, and assign a size that is less than or equal to the
amount of space remaining in the allocation.
For information on how to create a storage space using the file you have allocated,
refer to “Creating a Dbspace that Uses the Default Page Size” on page 11-8,
“Creating a Blobspace” on page 11-20, and “Creating an Sbspace” on page 11-22.
Warning: After you create the raw device that the database server uses for disk
space, do not create file systems on the same raw device that you
allocate for the database server disk space. Also, do not use the same
raw device as swap space that you allocate for the database server disk
space.
Symbolic links simplify recovery from disk failure and enable you to replace
quickly the disk where the chunk is located. You can replace a failed device with
another device, link the new device pathname to the same filename that you
previously created for the failed device, and restore the data. You do not need to
wait for the original device to be repaired.
To allocate NTFS file space for database server disk space or mirrored space, the
first step is to create a null (zero bytes) file.
After you have allocated the file space, you can create the dbspace or other storage
space as you normally would, using onspaces. For information on how to create a
dbspace or a blobspace, refer to “Creating a Dbspace that Uses the Default Page
Size” on page 11-8 and “Creating a Blobspace” on page 11-20.
You must be a member of the Informix-Admin group when you create a storage
space or add a chunk. The raw disk space can be formatted or unformatted disk
space.
Warning: If you allocate a formatted drive or disk partition as raw disk space and
it contains data, the database server overwrites the data when it begins
to use the disk space. You must ensure that any data on raw disk space
is expendable before you allocate the disk space to the database server.
UNIX Only
v If you are using raw disks on UNIX, you should use a linked pathname. (See
“Creating Symbolic Links to Raw Devices (UNIX)” on page 11-5.)
End of UNIX Only
Windows Only
v If you are using raw disks on Windows, the pathname takes the following form,
where x specifies the disk drive or partition:
\\.\x:
Use these naming rules when you create storage spaces or add a chunk. The
filename must have the following characteristics:
v Be unique and not exceed 128 bytes
v Begin with a letter or underscore
v Contain only letters, digits, underscores, or $ characters
The name is case insensitive unless you use quotes around it. By default, the
database server converts uppercase characters in the name to lowercase. If you
want to use uppercase in names, put quotes around them and set the
DELIMIDENT environment variable to ON.
Considering all limits that can apply to the size of an instance of the database
server, the maximum size of an instance is approximately 8 petabytes.
You must run onmode -BC to enable the maximum number of chunks and storage
spaces.
Important: When you add a new logical log, you no longer need to perform a
level-0 backup of the root dbspace and modified dbspace to use the
new logical log. However, you should perform the level-0 backup to
prevent level-1 and level-2 backups from failing.
You must perform a level-0 backup of the modified storage spaces to ensure that
you can restore the unlogged data before you switch to a logging table type:
v When you convert a nonlogging database to a logging database
v When you convert a RAW table to standard
Managing Dbspaces
This section contains information on creating standard and temporary dbspaces
with and without the default page size, specifying the first and next extent sizes
for the tblspace tblspace in a dbspace when you create the dbspace, and adding a
chunk to a dbspace or blobspace.
For information on using ISA to create a dbspace, see the ISA online help.
Any newly added dbspace (and its mirror, if one exists) is available immediately. If
you are using mirroring, you can mirror the dbspace when you create it. Mirroring
takes effect immediately.
The following example shows how to create a 5-megabyte dbspace, dbspc3, with
an offset of 200 kilobytes, from raw disk space (drive e:) on Windows:
onspaces -c -d dbspc3 \\.\e: -o 200 -s 5120
For more information, refer to the ON–Monitor chapter in the IBM Informix
Administrator's Reference.
Specifying the First and Next Extent Sizes for the tblspace
tblspace
Specify first and next extent sizes if you want to reduce the number of tblspace
tblspace extents and reduce the frequency of situations when you need to place
the tblspace tblspace extents in non-primary chunks. (A primary chunk is the initial
chunk in a dbspace.)
You can choose to specify the first extent size, the next extent size, both the first
and the next extent size, or neither extent size. If you do not specify first or next
extent sizes for the tblspace tblspace, Dynamic Server uses the existing default
extent sizes.
You can use the onspaces utility to specify the first and next extent sizes for the
tblspace tblspace in non-root dbspaces.
You can only specify the first and next extent sizes when you create dbspace. You
cannot alter the specification of the first and next extent sizes after the creation of
the dbspace. In addition, you cannot specify extent sizes for temporary dbspaces,
sbspaces, blobspaces, or external spaces. You cannot alter the specification of the
first and next extents sizes after the creation of the dbspace.
You use the following onspaces utility -ef and -en options to specify the first and
next extent sizes for the tblspace tblspace in non-root dbspaces:
v First extent size: -ef size_in_kbytes
v Next extent size: -en size_in_kbytes
You can use Oncheck -pt and oncheck -pT to show the first and next extent sizes
of a tblspace tblspace.
If HDR is being used and a dbspace is created on the primary database server, the
first and next extent sizes are passed to the secondary database server via the
ADDCHK log record.
For more information on the onspaces utility, oncheck commands, and specifying
the first and next extent sizes for the tblspace tblspace, see the IBM Informix
Administrator's Reference.
For systems with sufficient storage, the performance advantages of a larger page
size include:
v Reduced depth of b-tree indexes, even for smaller index keys.
v Decreased checkpoint time, which typically occurs with larger page sizes.
You can use the BUFFERPOOL configuration parameter to create a buffer pool that
corresponds to the page size of the dbspace. (You might want to do this to
implement a form of ″private buffer pool.″)
A table can be in one dbspace and the index for that table can be in another
dbspace. The page size for these partitions can be different.
If you want to specify the page size for the dbspace, perform these tasks:
1. Use the onmode -BC command to enable the large chunk mode if this mode is
not enabled. By default, when Dynamic Server Version 10.0 is first initialized or
restarted, Dynamic Server starts with the large chunk mode enabled. For
information on the onmode utility in the IBM Informix Dynamic Server
Administrator's Reference.
2. Create a buffer pool that corresponds to the page size of the dbspace. You can
use the onparams utility or the BUFFERPOOL configuration parameter. You
should do this before you create the dbspace.
If you create a dbspace with a page size that does not have a corresponding
buffer pool, Dynamic Server automatically creates a buffer pool using the
default parameters defined in the ONCONFIG configuration file.
You cannot have multiple buffer pools with the same page size.
For more information, see “Creating a Dbspace with a Non-Default Page Size”
on page 11-11.
3. Define the page size of the dbspace when you create the dbspace. You can use
the onspaces utility or ON-Monitor. For more information, see “Defining the
Page Size” on page 11-15.
For example, if you create a dbspace with a page size of 6 kilobytes, you must
create a buffer pool with a size of 6 kilobytes. If you do not specify a page size for
the new buffer pool, Dynamic Server uses the operating system default page size
(4 kilobytes on Windows and 2 kilobytes on most UNIX platforms) as the default
page size for the buffer pool.
Note: If you use non-default page sizes, you might need to increase the size of
your physical log. If you perform many updates to non-default pages you
might need a 150 to 200 percent increase of the physical log size. Some
experimentation might be needed to tune the physical log. You can adjust
the size of the physical log as necessary according to how frequently the
filling of the physical log triggers checkpoints.
The top line specifies the default values that are used if you create a dbspace with
a page size that does not have a corresponding buffer pool that was created when
the database server started. The line below the default line specifies the database
server default values for the buffer pool. These values are based on the default
page size of the database server.
When you add a dbspace with a different page size with the onspaces utility or
when you add a new buffer pool with the onparams utility, a new line is added to
the BUFFERPOOL configuration parameter in the ONCONFIG file. The page size
for each buffer pool must be a multiple of the default page size for your operating
system. The following example shows a third BUFFERPOOL line that was added
to the ONCONFIG file:
BUFFERPOOL default,lrus=8,buffers=5000,lru_min_dirty=50,lru_max_dirty=60
BUFFERPOOL size=2K,buffers=5000,lrus=8,lru_min_dirty=50,lru_max_dirty=60
BUFFERPOOL size=6K,buffers=3000,lrus=8,lru_min_dirty=50,lru_max_dirty=60
The fields in the BUFFERPOOL lines are not case sensitive, so you can specify lrus
or Lrus or LRUS). These fields can appear in any order.
If you do not specify a page size for a new buffer pool, Dynamic Server uses the
operating system default page size (4 kilobytes on Windows and 2 kilobytes on
most UNIX platforms) as the default page size for the buffer pool.
If the value of buffers is zero (0) or if the value of buffers is missing in the
BUFFERPOOL configuration parameter, Dynamic Server will not create the buffer
pool of the specified page size.
The table below provides an explanation of the values that you specify using the
BUFFERPOOL configuration parameter or the onparams utility.
If the database server is in online, quiescent, or single user mode, you can also use
the onparams utility to add a new buffer pool of a different size. When you use
the onparams utility, the information you specify is automatically transferred to the
ONCONFIG file and new values are specified using the BUFFERPOOL keyword.
You cannot change the values by editing the [Link] file.
When you use the onparams utility, you specify information as follows:
For example:
onparams -b -g 6 -n 3000 -r 2 -x 2.0 -m 1.0
This adds 3000 buffers of size 6K bytes each with 2 LRUS and lru_max_dirty set at
2 percent and lru_min_dirty set at 1 percent.
For more information on the onparams utility, see the IBM Informix Dynamic Server
Administrator's Reference.
The LG_ADDBPOOL log record and the sysbufpool system catalog table contain
information on each buffer pool.
Buffer pools that are added while the database server is running go into virtual
memory, not into resident memory. Only those buffer pool entries that are specified
in the ONCONFIG file at startup go into resident memory, depending on the
availability of the memory you are using.
Resizing an Existing Buffer Pool: If you need to resize an existing buffer pool,
you must bring down the database server. Then change the buffer pool size in the
ONCONFIG file.
Deleting an Existing Buffer Pool: If you need to delete an existing buffer pool,
you must bring down the database server. Then, in the ONCONFIG file, delete the
buffer pool.
If you specify a page size, the page size must be a multiple of the default page
size, but not greater than 16 kilobytes.
If you are using ON-Monitor to create a dbspace, be sure to enter the page size in
kilobytes in the Page Size field.
For more information about using the ON-Monitor and onspaces utilities, see the
IBM Informix Dynamic Server Administrator's Reference.
If you are creating a temporary dbspace, you must make the database server aware
of the existence of the newly created temporary dbspace by setting the
DBSPACETEMP configuration variable, the DBSPACETEMP environment variable,
or both. The database server does not begin to use the temporary dbspace until
you take both of the following steps:
v Set the DBSPACETEMP configuration parameter, the DBSPACETEMP
environment variable, or both.
v Restart the database server.
The following example shows how to create 5-megabyte temporary dbspace named
temp_space with an offset of 5000 kilobytes:
onspaces -c -t -d temp_space -p /dev/raw_dev1 -o 5000 -s 5120
Important: The newly added chunk (and its associated mirror, if one exists) is
available immediately. If you are adding a chunk to a mirrored storage
space, you must also add a mirror chunk.
The next example adds a 5-megabyte chunk of raw disk space, at an offset of 5200
kilobytes, to dbspace dbspc3.
onspaces -a dbspc3 \\.\e: -o 5200 -s 5120
Renaming Dbspaces
You can use the onspaces utility to rename a dbspace if you are user informix or
have DBA privileges and the database server is in quiescent mode (and not any
other mode).
You can rename standard dbspaces and all other spaces, including blobspaces,
smart blobspaces, temporary spaces, and external spaces. However, you cannot
rename any critical dbspace, such as a root dbspace or a dbspace that contains
physical logs.
The rename dbspace operation only changes the dbspace name; it does not
reorganize data.
The rename dbspace command updates the dbspace name in all places where that
name is stored. This includes reserved pages on disk, system catalogs, the
ONCONFIG configuration file, and in-memory data structures.
If you create a fragmented table with partitions, each row in the sysfragments
system catalog contains a partition name in the Partition column. If you create a
fragmented table without partitions, the name of the dbspace appears in the
Partition column. The Flags column in the sysfragments catalog tells you if the
fragmentation scheme has partitions.
You can create tables and indexes with partitions, and you can create, drop, and
alter partition fragments using the PARTITION keyword and the partition name.
To create a fragmented table with partitions, use SQL syntax as shown in the
following example:
If you created a table or index fragment containing partitions, you must use syntax
containing the partition name when you use the ALTER FRAGMENT statement, as
shown in the following examples.
ALTER FRAGMENT ON TABLE tb1 INIT FRAGMENT BY EXPRESSION
PARTITION part_1 (a >=0 AND a < 5) IN dbspace1,
PARTITION part_2 (a >=5 AND a < 10) IN dbspace1;
ALTER FRAGMENT ON INDEX ind1 INIT FRAGMENT BY EXPRESSION
PARTITION part_1 (a >=0 AND a < 5) IN dbspace1,
PARTITION part_2 (a >=5 AND a < 10) IN dbspace1;
You can use the PARTITION BY EXPRESSION clause instead of the FRAGMENT
BY EXPRESSION clause in CREATE TABLE, CREATE INDEX, and ALTER
FRAGMENT ON INDEX statements as shown in this example:
ALTER FRAGMENT ON INDEX idx1 INIT PARTITION BY EXPRESSION
PARTITION part1 (a <= 10) IN idxdbspc1,
PARTITION part2 (a <= 20) IN idxdbspc1,
PARTITION part3 (a <= 30) IN idxdbspc1;
Use ALTER FRAGMENT syntax to change fragmented tables and indexes that do
not have partitions into tables and indexes that have partitions. For example, the
syntax below shows how you might The syntax below shows how you might
convert a fragmented table with multiple dbspaces into one using partitions.
CREATE TABLE t1 (c1 int) FRAGMENT BY EXPRESSION
(c1=10) IN dbs1,
(c1=20) IN dbs2;
ALTER FRAGMENT ON TABLE t1 MODIFY dbs2 TO PARTITION part_3 (c1=20)
IN dbs1
The syntax below shows how you might convert a fragmented index into an index
that contains partitions:
CREATE TABLE t1 (c1 int) FRAGMENT BY EXPRESSION
(c1=10) IN dbs1, (c1=20) IN dbs2, (c1=30) IN dbs3
CREATE INDEX ind1 ON t1 (c1) FRAGMENT BY EXPRESSION
(c1=10) IN dbs1, (c1=20) IN dbs2, (c1=30) IN dbs3
ALTER FRAGMENT ON INDEX ind1 INIT FRAGMENT BY EXPRESSION
PARTITION part_1 (c1=10) IN dbs1, PARTITION part_2 (c1=20) IN dbs1,
PARTITION part_3 (c1=30) IN dbs1,
See the IBM Informix Dynamic Server Performance Guide for more information on
fragmentation, including fragmentation guidelines, procedures for fragmenting
indexes, procedures for creating attached and detached indexes with partitions,
and examples of SQL statements used to create attached and detached indexes
containing partitions.
See the IBM Informix Guide to SQL: Syntax for more syntax details, including
information on partitions in GRANT FRAGMENT, REVOKE FRAGMENT
statements and details for using the DROP, DETACH and MODIFY clauses of the
ALTER FRAGMENT statement.
Creating a Blobspace
You can use onspaces, ISA, or ON–Monitor to create a blobspace. Specify a
blobspace name of up to 128 bytes. The name must be unique and must begin with
a letter or underscore. You can use letters, digits, underscores, and $ characters in
the name.
Important: You can mirror the blobspace when you create it if mirroring is
enabled for the database server. Mirroring takes effect immediately.
If a table has more than one TEXT or BYTE column, and the objects are not close
in size, store each column in a different blobspace, each with an appropriately
sized blobpage. See “Tables” on page 10-22.
The oncheck -pe command provides background information about the objects
stored in a blobspace:
v Complete ownership information (displayed as database:[Link]) for each table
that has data stored in the blobspace chunk
v The total number of pages used by each table to store its associated TEXT and
BYTE data
v The total free and total overhead pages in the blobspace
The oncheck -pB command lists the following statistics for each table or database:
v The number of blobpages used by the table or database in each blobspace
v The average fullness of the blobpages used by each simple large object stored as
part of the table or database
For more information, see “Monitoring Blobspace Usage with oncheck -pe” on
page 11-38, “Determining Blobpage Fullness with oncheck -pB” on page 11-38, and
optimizing blobspace blobpage size in the chapter on table performance
considerations in the IBM Informix Dynamic Server Performance Guide.
Managing Sbspaces
This section describes how to create a standard or temporary sbspace, monitor the
metadata and user-data areas, add a chunk to an sbspace, and alter storage
characteristics of smart large objects.
Creating an Sbspace
Use the onspaces utility or ISA to create an sbspace.
This shows how to create a 20-megabyte mirrored sbspace, sbsp4. Offsets of 500
kilobytes for the primary and 500 kilobytes for the mirror chunks are specified, as
well as a metadata size of 150 kilobytes with a 200 kilobyte offset. The
AVG_LO_SIZE -Df tag specifies an expected average smart-large-object size of 32
kilobytes.
onspaces -c -S sbsp4 -p /dev/rawdev1 -o 500 -s 20480 -m /dev/rawdev2 500
-Ms 150 -Mo 200 -Df "AVG_LO_SIZE=32"
For information about creating an sbspace and default options for smart large
objects, see information on the onspaces utility in the IBM Informix Administrator's
Reference. For information on creating smart large objects, see the IBM Informix
DataBlade API Programmer's Guide and IBM Informix ESQL/C Programmer's Manual.
It is important to size the metadata area for an sbspace correctly to ensure that the
sbspace does not run out of metadata space. You can either:
v Let the database server calculate the size of the metadata area for the new
sbspace chunk.
v Specify the size of the metadata area explicitly.
For instructions on estimating the size of the sbspace and metadata area, see table
performance considerations in the IBM Informix Dynamic Server Performance Guide.
Also see “Monitoring the Metadata and User-Data Areas” on page 11-43.
For information on creating smart large objects, see the IBM Informix DataBlade API
Programmer's Guide and IBM Informix ESQL/C Programmer's Manual.
Dropping a Chunk
Use onspaces or ISA to drop a chunk from a dbspace.
Before you drop a chunk, ensure that the database server is in the correct mode,
using the following table as a guideline.
Database Server in
Database Server in Single-User or Database Server in
Chunk Type Online Mode Quiescent Mode Offline Mode
Dbspace chunk Yes Yes No
Temporary dbspace chunk Yes Yes No
Blobspace chunk No Yes No
Sbspace or temporary Yes Yes No
sbspace chunk
If any pages remain allocated to nonoverhead entities, the utility returns the
following error:
Chunk is not empty.
In addition, when a dbspace consists of two or more chunks and the additional
chunks do not contain user data, the additional chunks cannot be deleted if the
chunks contain a tblspace tblspace.
If you receive the ″Chunk is not empty″ message, you must determine which table
or other entity still occupies space in the chunk by executing oncheck -pe to list
contents of the extent.
Usually, the pages can be removed when you drop the table that owns them. Then
reenter the utility command.
You cannot drop the initial chunk of a dbspace with the syntax in the previous
example. Instead, you must drop the dbspace. Use the fchunk column of onstat -d
to determine which is the initial chunk of a dbspace. For more information about
onstat, see information on the onspaces utility in the IBM Informix Administrator's
Reference.
For information about dropping a chunk from a dbspace with onspaces, see the
IBM Informix Administrator's Reference.
You cannot drop the initial chunk of an sbspace with the syntax in the previous
example. Instead, you must drop the sbspace. Use the fchunk column of onstat -d
to determine which chunk is the initial chunk of an sbspace.
Warning: If you force the drop of an sbspace, you might introduce consistency
problems between tables and sbspaces.
Rarely, a smart large object with a reference count of 0 remains. You can use the
onspaces -cl command to delete all smart large objects that have a reference count
of 0, if it is not open by any application.
For information on using onspaces -cl, see information on the onspaces utility in
the IBM Informix Administrator's Reference.
You can drop a storage space only when the database server is in online,
single-user, or quiescent mode.
Before you drop a blobspace, you must drop all tables that have a TEXT or BYTE
column that references the blobspace.
Execute oncheck -pe to verify that no tables or log files reside in the dbspace or
blobspace.
Before you drop an sbspace, you must drop all tables that have a CLOB or BLOB
column that reference objects that are stored in the sbspace. For sbspaces, you need
not delete columns that point to an sbspace, but these columns must be null; that
is, all smart large objects must be deallocated from the sbspace.
Tip: If you drop tables on dbspaces where light appends are occurring, the light
appends might be slower than you expect. The symptom of this problem is
physical logging activity. If light appends are slower than you expect, make
sure that no tables are dropped in the dbspace either before or during the
light appends. If you have dropped tables, force a checkpoint with onmode -c
before you perform the light append.
If you want to drop only a storage-space mirror, turn off mirroring. (See “Ending
Mirroring” on page 19-7.) This action drops the dbspace, blobspace, or sbspace
mirrors and frees the chunks for other uses.
Use the -d option with the -f option if you want to drop an sbspace that contains
data. If you omit the -f option, you cannot drop an sbspace that contains data. This
example drops an sbspace called sbspc4 and its mirrors.
onspaces -d sbspc4 -f
Warning: If you use the -f option, the tables in the database server might have
dead pointers to the deleted smart large objects.
For information on dropping a storage space with onspaces, see information on the
onspaces utility in the IBM Informix Administrator's Reference.
You are asked to confirm that you want to drop the dbspace or blobspace.
Warning: After you drop a dbspace, blobspace, or sbspace, the newly freed chunks
are available for reassignment to other dbspaces, blobspaces, or sbspaces.
However, before you reassign the newly freed chunks, you must
perform a level-0 backup of the root dbspace and the modified storage
space. If you do not perform this backup, and you subsequently need to
perform a restore, the restore might fail because the backup reserved
pages are not up-to-date.
Creating an Extspace
You create an extspace with the onspaces utility. But you should first have a valid
data source and a valid access method with which to access that data source.
Although you can create an extspace without a valid access method or a valid data
source, any attempts to retrieve data from the extspace will generate an error. For
information on access methods, see the IBM Informix Virtual-Table Interface
Programmer's Guide.
Specify an extspace name of up to 128 bytes. The name must be unique and begin
with a letter or underscore. You can use letters, digits, underscores, and $
characters in the name.
Important: The preceding example assumes that you have coded a routine that
provides functions for correctly accessing the file passwd and that the
file itself exists. After you have created the extspace, you must use the
appropriate commands to allow access to the data in the file passwd.
For more information on user-defined access methods, see the IBM
Informix Virtual-Table Interface Programmer's Guide.
Dropping an Extspace
To drop an extspace with onspaces, use the -d option as illustrated in the following
examples. An extspace cannot be dropped if it is associated with an existing table
or index.
For the complete syntax of this onspaces option, see information on the onspaces
utility in the IBM Informix Administrator's Reference.
When you execute onstat -f, you receive a message that tells you whether the
DATASKIP configuration parameter is set to on for all dbspaces, off for all
dbspaces, or on for specific dbspaces.
This statement causes the database server to skip dbspace1 or dbspace5 whenever
both of these conditions are met:
v The application attempts to access one of the dbspaces.
v The database server finds that one of the dbspaces is unavailable.
If the database server finds that both dbspace1 and dbspace5 are unavailable, it
skips both dbspaces.
The DEFAULT setting for the SET DATASKIP statement allows a database server
administrator to control the dataskip feature. Suppose that an application
developer includes the following statement in an application:
SET DATASKIP DEFAULT
When a query is executed subsequent to this SQL statement, the database server
checks the value of the configuration parameter DATASKIP. Encouraging end users
to use this setting allows the database server administrator to specify which
When you want to skip fragments, use the ON dbspace-list setting to specify a list
of dbspaces with the fragments that the database server should skip.
The administrator can monitor the distribution of data over table fragments. If the
goal of fragmentation is improved single-user response time, it is important for
data to be distributed evenly over the fragments. To monitor fragmentation disk
use, you must monitor database server tblspaces, because the unit of disk storage
for a fragment is a tblspace. (For information on how to monitor the data
distribution for a fragmented table, see “Monitoring Tblspaces and Extents” on
page 11-36.)
The administrator must monitor I/O request queues for data that is contained in
fragments. When I/O queues become unbalanced, the administrator should work
with the DBA to tune the fragmentation strategy. (For a discussion of how to
monitor chunk use, including the I/O queues for each chunk, see “Monitoring
Chunks” on page 11-33.)
The administrator must monitor fragments for availability and take appropriate
steps when a dbspace that contains one or more fragments fails. For how to
determine if a chunk is down, see “Monitoring Chunks” on page 11-33.
Displaying Databases
You can display databases that you create with the following tools:
v SMI tables
v ISA
v ON–Monitor
Using ISA
To query sysdatabases using ISA, follow these steps:
1. Choose SQL > Query.
2. Select the sysmaster data in the Database list.
3. Enter the following command and click Submit:
select * from sysdatabases;
Monitoring Chunks
You can monitor chunks for the following information:
v Chunk size
v Number of free pages
v Tables within the chunk
This information allows you to track the disk space used by chunks, monitor
chunk I/O activity, and check for fragmentation.
onstat -d
The onstat -d utility lists all dbspaces, blobspaces, and sbspaces and the following
information for the chunks within those spaces.
v The address of the chunk
v The chunk number and associated dbspace number
v The offset into the device (in pages)
v The size of the chunk (in pages)
v The number of free pages in the chunk
v The pathname of the physical device
If you issue the onstat -d command on an instance with blobspace chunks, the
number of free pages shown is out of date. The tilde (~) that precedes the free
value indicates that this number is approximate. The onstat -d command does not
register a blobpage as available until the logical log in which a deletion occurred is
backed up and the blobpage is freed. Therefore, if you delete 25 simple large
objects and immediately execute onstat -d, the newly freed space does not appear
in the onstat output.
In onstat -d update output, the flags column in the chunk section provides the
following information:
v Whether the chunk is the primary chunk or the mirror chunk
v Whether the chunk is online, is down, is being recovered, or is a new chunk
For an example of onstat -d output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
Important: You must perform a level-0 backup of the root dbspace and the
modified dbspace before mirroring can become active and after turning
off mirroring.
onstat -d update
The onstat -d update option displays the same information as onstat -d and an
accurate number of free blobpages for each blobspace chunk.
onstat -D
The onstat -D option displays the same information as onstat -d, plus the number
of pages read from the chunk (in the page Rd field).
For an example of onstat -g iof output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
oncheck -pr
The database server stores chunk information in the reserved pages
PAGE_1PCHUNK and PAGE_2PCHUNK.
To list the contents of the reserve pages, execute oncheck -pr. Figure 11-1 shows
sample output for oncheck -pr. This output is essentially the same as the onstat -d
output; however, if the chunk information has changed since the last checkpoint,
these changes do not appear in the oncheck -pr output.
DBspace number 1
DBspace name rootdbs
Flags 0x20001 No mirror chunks
Number of chunks 2
First chunk 1
Date/Time created 07/28/2000 14:46:55
Partition table page number 14
Logical Log Unique Id 0
Logical Log Position 0
Oldest Logical Log Unique Id 0
Last Logical Log Unique Id 0
Dbspace archive status No archives have occurred
.
.
Validating PAGE_1PCHUNK & PAGE_2PCHUNK...
Using primary chunk page PAGE_2PCHUNK.
Chunk number 1
Flags 0x40 Chunk is online
Chunk path /home/server/root_chunk
Chunk offset 0 (p)
Chunk size 75000 (p)
Number of free pages 40502
DBSpace number 1
.
.
.
Figure 11-1. oncheck -pr Output Showing Dbspace and Chunk Information
oncheck -pe
To obtain the physical layout of information in the chunk, execute oncheck -pe.
The dbspaces, blobspaces, and sbspaces are listed. Figure 11-2 on page 11-35 shows
sample output for oncheck -pe.
The tables within a chunk are listed sequentially. This output is useful for
determining chunk fragmentation. If the database server is unable to allocate an
extent in a chunk despite an adequate number of free pages, the chunk might be
badly fragmented.
Execute oncheck -pt to obtain extent information. The oncheck -pT option returns
all the information from the oncheck -pt option as well as the additional
information about page and index usage.
Query the sysextents table to obtain information about each extent. The sysextents
table has columns that indicate the database and the table that the extent belongs
to, as well as the physical address and size of the extent.
onstat -O
The onstat -O option displays information about the staging-area blobspace and
the Optical Subsystem memory cache. The totals shown in the display accumulate
from session to session. The database server resets the totals to 0 only when you
execute onstat -z.
For an example of onstat -O output, see information on the onstat utility in the
IBM Informix Administrator's Reference.
The first section of the display describes the following system-cache totals
information.
Column Description
size Size specified in the OPCACHEMAX configuration parameter
alloc Number of 1-kilobyte pieces that the database server allocated to
the cache
avail Portion of alloc (in kilobytes) not used
number Number of simple large objects that the database server
successfully put into the cache without overflowing
kbytes Number of kilobytes of the simple large objects that the database
server put into the cache without overflowing
number Number of simple large objects that the database server wrote to
the staging-area blobspace
kbytes Number of kilobytes of simple large objects that the database
server wrote to the staging-area blobspace
Although the size output indicates the amount of memory that is specified in the
configuration parameter OPCACHEMAX, the database server does not allocate
memory to OPCACHEMAX until necessary. Therefore, the alloc output reflects
only the number of 1-kilobyte pieces of the largest simple large object that has
been processed. When the values in the alloc and avail output are equal, the cache
is empty.
The second section of the display describes the following user-cache totals
information.
Column Description
SID Session ID for the user
user User ID of the client
size Size specified in the INFORMIXOPCACHE environment variable,
if set
If you do not set the INFORMIXOPCACHE environment variable,
the database server uses the size that you specify in the
configuration parameter OPCACHEMAX.
number Number of simple large objects that the database server put into
cache without overflowing
Execute oncheck -pB with either a database name or a table name as a parameter.
The following example retrieves storage information for all simple large objects
stored in the table [Link] in the stores_demo database:
oncheck -pB stores_demo:[Link]
For detailed information about interpreting the oncheck -pB output, see optimizing
blobspace blobpage size in the chapter on table performance considerations in the
IBM Informix Dynamic Server Performance Guide.
This command takes a database name or a table name as a parameter. For each
table in the database, or for the specified table, the database server displays a
general tblspace report.
Following the general report is a detailed breakdown of page use in the extent, by
page type. See the Type column for information on TEXT and BYTE data.
Average Average
Level Total No. Keys Free Bytes
----- -------- -------- ----------
1 1 74 1058
----- -------- -------- ----------
Total 1 74 1058
Average Average
Level Total No. Keys Free Bytes
----- -------- -------- ----------
1 1 74 984
----- -------- -------- ----------
Total 1 74 984
Figure 11-4. Sample output from oncheck -pT with TEXT or BYTE data
Monitoring Sbspaces
One of the most important areas to monitor in an sbspace is the metadata page
use. When you create an sbspace, you specify the size of the metadata area. Also,
any time that you add a chunk to the sbspace, you can specify that metadata space
be added to the chunk.
If you attempt to insert a new smart large object, but no metadata space is
available, you receive an error. The administrator should monitor metadata space
availability to prevent this situation from occurring.
See “Using oncheck -ce and oncheck -pe” on page 11-41 and “Monitoring the Metadata and
User-Data Areas” on page 11-43.
onstat -d Displays the following information about the chunks in each sbspace:
v Number of free sbpages in each sbspace chunk, in the metadata area, and in the user-data
areas
v Total number of sbpages in each sbspace chunk, in the metadata area, and in the user-data
areas
Using onstat -d
Use the onstat -d option to display the following information about the chunks in
each sbspace:
v Number of free sbpages in each sbspace chunk, in the metadata area, and in the
user-data area
v Total number of sbpages in each sbspace chunk, in the metadata area, and in the
user-data area
To find out the total amount of used space, execute the oncheck -pe command. For
more information, see “Using oncheck -ce and oncheck -pe” on page 11-41.
The onstat -d option does not register an sbpage as available until the logical log
in which a deletion occurred is backed up and the sbpage is freed. Therefore, if
you delete 25 smart large objects and immediately execute onstat -d, the newly
freed space does not appear in the onstat output.
Tip: The oncheck -pe option provides information about sbspace use in terms of
database server pages, not sbpages.
Figure 11-5 shows sample output. In this example, the sbspace s9_sbspc has a total
of 214 used pages, 60 free pages in the metadata area, and 726 free pages in the
user-data area.
Use the oncheck -cs output to see how much space is left in the metadata area. If
it is full, allocate another chunk with adequate space for the metadata area. To find
the number of used pages in the metadata area, total the numbers in the Used
column. To find the number of free pages in the metadata area, total the numbers
in the Free column.
For example, based on the field values displayed in Figure 11-6, the total number
of used pages in the metadata area for s9_sbspc is 33 two-kilobyte pages (or 66
kilobytes). The metadata area contains a total of 62 free pages (or 124 kilobytes).
To monitor the amount of free metadata space, run the following command:
oncheck -ps spacename
If you run oncheck -ps for the dbspace that contains the tables where the smart
large objects are stored, you can find the number of rows in the table.
When all of the reserve area is used up, the database server cannot move space to
the metadata area, even if the user-data area contains free space.
1. As you add smart large objects to the sbspace, use oncheck -pe or onstat -g
smb c to monitor the space in the metadata area, user-data area, and reserved
area. For an example, see “Using oncheck -ce and oncheck -pe” on page 11-41.
2. Use the message log to monitor metadata stealing.
The database server prints messages about the number of pages allocated from
the reserved area to the metadata area.
3. Add another chunk to the sbspace before the sbspace runs out of space in the
metadata and reserved areas.
For more information, see “Adding a Chunk to an Sbspace” on page 11-23.
4. The database server writes the FREE_RE and CHKADJUP log records when it
moves space from the reserve area to the metadata or user-data area.
The output of this command shows the number of used pages (usr pgs) and free
pages (free pg) in an sbspace chunk. The metadata area Md area includes
information that shows the starting page offset and the number of pages.
Method to Load Data TEXT or BYTE Data CLOB or BLOB Data Reference
DB–Access LOAD statement Yes Yes LOAD statement in the IBM
Informix Guide to SQL: Syntax
dbload utility Yes Yes IBM Informix Migration Guide
dbimport utility Yes Yes IBM Informix Migration Guide
ESQL/C programs Yes Yes IBM Informix ESQL/C Programmer's
Manual
onload utility No No IBM Informix Migration Guide
onpladm utility Yes, deluxe mode Yes, deluxe mode IBM Informix Server
Administrator
High-Performance Loader (HPL) Yes, deluxe mode Yes, deluxe mode IBM Informix High-Performance
Loader User's Guide
Important: The database server does not contain any mechanisms for compressing
TEXT and BYTE data after the data has been loaded into a database.
In This Chapter
This chapter describes logging of Informix databases and addresses the following
questions:
v Which database server processes require logging?
v What is transaction logging?
v What database server activity is logged?
v What is the database-logging status?
v Who can set or change the database logging status?
All the databases managed by a single database server instance store their log
records in the same logical log, regardless of whether they use transaction logging.
Most database users might be concerned with whether transaction logging is
buffered or whether a table uses logging.
If you want to change the database-logging status, see “Settings or Changes for
Logging Status or Mode” on page 12-7.
The database server stores the logical-log records in a logical log. The logical log is
made up of logical-log files that the database server manages on disk until they
have been safely transferred offline (backed up). The database server administrator
keeps the backed up logical-log files until they are needed during a data restore, or
until the administrator decides that the records are no longer needed for a restore.
See Chapter 14, “Logical Log,” on page 14-1 for more information on logical logs.
The database server uses logical-log records when it performs various functions
that recover data and ensure data consistency, as follows:
v Transaction rollback. If a database is using transaction logging and a transaction
must be rolled back, the database server uses the logical-log records to reverse
the changes made during the transaction. For more information, see “Transaction
Logging” on page 12-3.
v Fast recovery. If the database server shuts down in an uncontrolled manner, the
database server uses the logical-log records to recover all transactions that
occurred since the oldest update not yet flushed to disk and to roll back any
uncommitted transactions. (When all the data in shared memory and on disk are
the same, they are physically consistent.) The database server uses the logical-log
records in fast recovery when it returns the entire database server to a state of
logical consistency up to the point of the most recent logical-log record. (For
more information, see “Details of Fast Recovery After A Full Checkpoint” on
page 16-12.)
v Data restoration. The database server uses the most recent storage-space and
logical-log backups to re-create the database server system up to the point of the
most recently backed-up logical-log record. The logical restore applies all the log
records since the last storage-space backup.
v Deferred checking. If a transaction uses the SET CONSTRAINTS statement to
set checking to DEFERRED, the database server does not check the constraints
until the transaction is committed. If a constraint error occurs while the
transaction is being committed, the database server uses logical-log records to
roll back the transaction. For more information, see SET Database Object Mode
in the IBM Informix Guide to SQL: Syntax.
v Cascading deletes. Cascading deletes on referential constraints use logical-log
records to ensure that a transaction can be rolled back if a parent row is deleted
and the system fails before the children rows are deleted. For information on
table inheritance, see the IBM Informix Database Design and Implementation Guide.
For information on primary key and foreign key constraints, see the IBM
Informix Guide to SQL: Tutorial.
v Distributed transactions. Each database server involved in a distributed
transaction keeps logical-log records of the transaction. This process ensures data
integrity and consistency, even if a failure occurs on one of the database servers
that is performing the transaction. For more information, see “Two-Phase
Commit and Logical-Log Records” on page 23-15.
v High-Availability Data Replication (HDR). High-Availability Data Replication
uses logical-log records to maintain consistent data on two different database
servers so that one of the database servers can be used quickly as a backup
database server if the other fails. For more details, see “How HDR Works” on
page 20-6.
v Enterprise Replication. You must use database logging with Enterprise
Replication because it replicates the data from the logical-log records. For more
information, see the IBM Informix Dynamic Server Enterprise Replication Guide.
When you create a database, you specify whether it uses transaction logging and, if
it does, what log-buffering mechanism it uses. After the database is created, you
can turn off database logging or change to buffered logging, for example. Even if
you turn off transaction logging for all databases, the database server always logs
some events. For more information, see “Activity That is Always Logged” on page
12-3 and “Database Logging in an X/Open DTP Environment” on page 12-7.
You can use logging or nonlogging tables within a database. The user who creates
the table specifies the type of table. Even if you use nonlogging tables, the
database server always logs some events. For more information, see “Table Types
for Dynamic Server” on page 10-23.
For temporary tables in temporary dbspaces, nothing is logged, not even the SQL
statements listed in “Activity That is Always Logged” on page 12-3. If you include
temporary (nonlogging) dbspaces in DBSPACETEMP, the database server places
nonlogging tables in these temporary dbspaces first. For more information, see
“Temporary Tables” on page 10-32.
Database-Logging Status
You must use transaction logging with a database to take advantage of any of the
features listed in “Database Server Processes That Require Logging” on page 12-1.
Every database that the database server manages has a logging status. The logging
status indicates whether the database uses transaction logging and, if so, which
log-buffering mechanism the database employs. To find out the transaction-logging
status of a database, use the database server utilities, as explained in “Monitoring
the Logging Mode of a Database” on page 13-5. The database-logging status
indicates any of the following types of logging:
v Unbuffered transaction logging
v Buffered transaction logging
v ANSI-compliant transaction logging
v No logging
All logical-log records pass through the logical-log buffer in shared memory before
the database server writes them to the logical log on disk. However, the point at
which the database server flushes the logical-log buffer is different for buffered
transaction logging and unbuffered transaction logging. For more information, see
Figure 8-1 on page 8-3 and “Flushing the Logical-Log Buffer” on page 8-28.
When the database server flushes the buffer, only the used pages are written to
disk. Used pages include pages that are only partially full, however, so some space
is wasted. For this reason, the logical-log files on disk fill up faster than if all the
databases on the same database server use buffered logging.
Chapter 12. Logging 12-5
Unbuffered logging is the best choice for most databases because it guarantees that
all committed transactions can be recovered. In the event of a failure, only
uncommitted transactions at the time of the failure are lost. However, with
unbuffered logging, the database server flushes the logical-log buffer to disk more
frequently, and the buffer contains many more partially full pages, so it fills the
logical log faster than buffered logging does.
If you use buffered logging and a failure occurs, you cannot expect the database
server to recover the transactions that were in the logical-log buffer when the
failure occurred. Thus, you could lose some committed transactions. In return for
this risk, performance during alterations improves slightly. Buffered logging is best
for databases that are updated frequently (when the speed of updating is
important), as long as you can re-create the updates in the event of failure. You can
tune the size of the logical-log buffer to find an acceptable balance for your system
between performance and the risk of losing transactions to system failure.
No Database Logging
If you turn off logging for a database, transactions are not logged, but other
operations are logged. For more information, see “Activity That is Always Logged”
on page 12-3. Usually, you would turn off logging for a database when you are
loading data, or just executing queries.
If you are satisfied with your recovery source, you can decide not to use
transaction logging for a database to reduce the amount of database server
processing. For example, if you are loading many rows into a database from a
recoverable source such as tape or an ASCII file, you might not need transaction
logging, and the loading would proceed faster without it. However, if other users
are active in the database, you would not have logical-log records of their
transactions until you reinitiate logging, which must wait for a level-0 backup.
If the CREATE DATABASE statement does not specify a logging status, the
database is created without logging.
Only the database server administrator can change logging status. Chapter 13,
“Managing the Database-Logging Mode,” on page 13-1, describes this topic.
Ordinary end users cannot change database-logging status.
If a database does not use logging, you do not need to consider whether buffered
or unbuffered logging is more appropriate. If you specify logging but do not
specify the buffering mode for a database, the default is unbuffered logging.
End users can switch from unbuffered to buffered (but not ANSI-compliant)
logging and from buffered to unbuffered logging for the duration of a session. The
SET LOG statement performs this change within an application. For more
information on the SET LOG statement, see the IBM Informix Guide to SQL: Syntax.
In This Chapter
This chapter covers the following topics on changing the database-logging mode:
v Understanding database-logging mode
v Modifying database-logging mode with ondblog
v Modifying database-logging mode with ontape
v Modifying database-logging mode with ON–Monitor
v Monitoring transaction logging
As a database server administrator, you can alter the logging mode of a database
as follows:
v Change transaction logging from buffered to unbuffered.
v Change transaction logging from unbuffered to buffered.
v Make a database ANSI compliant.
v Add transaction logging (buffered or unbuffered) to a database.
v End transaction logging for a database.
For information on ON–Bar and ontape, see the IBM Informix Backup and Restore
Guide.
Table 13-1 shows how the database server administrator can change the
database-logging mode. Certain logging mode changes take place immediately,
while other changes require a level-0 backup.
Table 13-1. Logging Mode Transitions
Converting to Converting to Converting to Converting to
Converting from: No Logging Unbuffered Logging Buffered Logging ANSI Compliant
No logging Not applicable Level-0 backup (of Level-0 backup (of Level-0 backup (of
affected storage affected storage affected storage
spaces) spaces) spaces)
Unbuffered Yes Not applicable Yes Yes
logging
Buffered logging Yes Yes Not applicable Yes
ANSI compliant Illegal Illegal Illegal Not applicable
You cannot cancel the logging changes that are executed immediately.
You add logging to a database with ontape at the same time that you create a
level-0 backup.
Tip: With ontape, you must perform a level-0 backup of all storage spaces.
To make a database called stores_demo, which does not already use transaction
logging, into an ANSI-compliant database with ontape, execute the following
command:
ontape -s -A stores_demo
Tip: After you change the logging mode to ANSI compliant, you cannot easily
change it again. To change the logging mode of ANSI-compliant databases,
unload the data, re-create the database with the new logging mode, and
reload the data. For details, see “Changing the Logging Mode of an
ANSI-Compliant Database” on page 13-3.
To change the log-buffering mode for a database, select the Logical-Logs >
Databases option.
Warning: When you alter a table to STANDARD, you turn logging on for that
table. After you alter the table, perform a level-0 backup if you need to
be able to restore the table.
Monitoring Transactions
This section contains references for information on ways to monitor transactions.
In This Chapter
The information in Chapter 12, “Logging,” on page 12-1, and this chapter will help
you understand how the database server uses the logical log. For information on
how to perform logical-log tasks, see Chapter 15, “Managing Logical-Log Files,” on
page 15-1, and Chapter 13, “Managing the Database-Logging Mode,” on page 13-1
As the database server administrator, you must configure and manage the logical
log. For example, if you do not back up the log files regularly, the logical log fills
and the database server suspends processing.
To improve performance further, separate the logical-log files into two groups and
store them on two separate disks (neither of which contains data). For example, if
you have six logical-log files, you might locate files 1, 3, and 5 on disk 1, and files
2, 4, and 6 on disk 2. This arrangement improves performance because the same
disk drive never has to handle writes to the current logical-log file and backups to
tape at the same time.
The logical-log files contain critical information and should be mirrored for
maximum data protection. If you move logical-log files to a different dbspace, plan
to start mirroring on that dbspace.
The actual disk space allocated for each logical-log file has an identification
number known as the log file number. For example, if you configure six logical-log
files, these files have log numbers one through six. The log numbers might be out
of sequence. As logical-log files are backed up and freed, the database server
reuses the disk space for the logical-log files.
Table 14-1 illustrates the relationship between the log numbers and the unique ID
numbers. Log 7 is inserted after log 5 and used for the first time in the second
rotation.
A logical-log file is freed after it is backed up, all transactions within the
logical-log file are closed, and the oldest update stored in this file is flushed to
disk.
U Log file has been used but not backed up.
U-B---- Log file is backed up but still needed for recovery. (The log file is freed when it
is no longer needed for recovery.)
U-B---L Log is backed up but still needed for recovery. Contains the last checkpoint
record.
U---C The database server is currently filling the log file.
U---C-L This current log file contains the last checkpoint record.
Use the onstat -l command to list the log files by number and monitor the status
flags and percentage of log space used. For more details, see “onstat -l” on page
15-6.
Performance Considerations
For a given level of system activity, the less logical-log disk space that you allocate,
the sooner that logical-log space fills up, and the greater the likelihood that user
activity is blocked due to backups and checkpoints. Tune the logical-log size to
find the optimum value for your system.
v Logical-log backups
When the logical-log files fill, you have to back them up. The backup process
can hinder transaction processing that involves data located on the same disk as
the logical-log files. Put the physical log, logical logs, and user data on separate
disks. (See the IBM Informix Backup and Restore Guide.)
v Checkpoints
Checkpoints block user processing briefly. If log files are backed up and freed
more frequently, the checkpoints occur more frequently.
v Size of the logical log
A smaller logical log fills faster than a larger logical log. You can add a larger
logical-log file, as explained in “Adding Logical-Log Files Manually” on page
15-10.
v Size of individual logical-log records
The sizes of the logical-log records vary, depending on both the processing
operation and the database server environment. In general, the longer the data
rows, the larger the logical-log records. The logical log contains images of rows
that have been inserted, updated, or deleted. Updates can use up to twice as
much space as inserts and deletes because they might contain both
before-images and after-images. (Inserts store only the after-image and deletes
store only the before-image.)
v Number of logical-log records
The more logical-log records written to the logical log, the faster it fills.
Databases with transaction logging fill the logical log faster than transactions
against databases without transaction logging.
v Type of log buffering
Databases that use unbuffered transaction logging fill the logical log faster than
databases that use buffered transaction logging.
v Enterprise Replication on a table
Because Enterprise Replication generates before-images and after-images of the
replicated tables, it could cause the logical log to fill.
v Frequency of rollbacks
The database server automatically (dynamically) allocates a log file after the
current log file when the next log file contains an open transaction. Dynamic log
allocation allows you to do the following actions:
v Add a log file while the system is active
v Insert a log file after the current log file
v Immediately access new log files even if the root dbspace is not backed up
The best way to test dynamic log allocation is to produce a transaction that spans
all the log files and then use onstat -l to check for newly added log files. For more
information, see “Allocating Log Files” on page 15-8.
Important: You still must back up log files to prevent them from filling. If the log
files fill, the system hangs until you perform a backup.
The logical-log file might be in use for any of the following reasons:
v The file contains the latest checkpoint or the oldest update not yet flushed to
disk.
Issue the onmode -c command to perform a full checkpoint and free the
logical-log file. For more information, see “Forcing a Full Checkpoint” on page
17-5.
v The file contains an open transaction.
The database server assumes that you designed your databases so that smaller
simple large objects are stored in dbspaces and larger simple large objects are
stored in blobspaces:
v The database server includes simple-large-object data in log records for simple
large objects stored in dbspaces.
v The database server does not include simple-large-object data in log records for
simple large objects stored in blobspaces. The logical log records blobspace data
only when you back up the logical logs.
To obtain better overall performance for applications that perform frequent updates
of simple large objects in blobspaces, reduce the size of the logical log. Smaller logs
can improve access to simple large objects that must be reused. For more
information, see the chapter on configuration effects on I/O utilization in your IBM
Informix Dynamic Server Performance Guide.
The database server requires that the statement that creates a blobspace, the
statement that creates a chunk in the blobspace, and the statements that insert
For instructions on switching to the next log file, see “Switching to the Next
Logical-Log File” on page 15-4.
Metadata in a standard sbspace is always logged, even if logging is turned off for a
database. Logging sbspace metadata ensures that the metadata can always be
recovered to a consistent transaction state. However, metadata in a temporary
sbspace is not logged.
When you turn on logging for a database, the database server does not begin
logging until you perform a level-0 backup. However, when you turn on logging
for a smart large object, the database server begins logging changes to it
immediately. To reduce the volume of log entries, you could load smart large
objects with logging turned off and then turn logging back on to capture updates
to the smart large objects.
Warning: When you turn logging on for a smart large object, you must
immediately perform a level-0 backup to be able to recover and restore
the smart large object.
Chapter 14. Logical Log 14-7
For more information, see “Backing Up Sbspaces” on page 15-4 and the IBM
Informix Backup and Restore Guide.
To increase performance, turn off logging for smart large objects. Also turn off
logging if users are primarily analyzing the data and updating it infrequently, or if
the data is not critical to recover.
To verify that smart large objects in an sbspace are logged, use the following
command:
oncheck -pS sbspace | grep “Create Flags”
If you create smart large objects in the sbspace with the default logging option and
you see the LO_NOLOG flag in the output, the smart large objects in this sbspace
are not logged. If you see the LO_LOG flag in the output, all smart large objects in
this sbspace are logged.
You can modify the logging status of an sbspace in any of the following ways.
Warning: Be careful about enabling logging for smart large objects that are
updated frequently. This logging overhead might significantly slow
down the database server.
For information on the log records for smart large objects, see the chapter on
interpreting logical-log records in the IBM Informix Dynamic Server Administrator's
Reference.
Logging Process
This section describes in detail the logging process for dbspaces, blobspaces, and
sbspaces. This information is not required for performing normal database server
administration tasks.
Dbspace Logging
The database server uses the following logging process for operations that involve
data stored in dbspaces:
Blobspace Logging
The database server logs blobspace data, but the data does not pass through either
shared memory or the logical-log files on disk. The database server copies data
stored in a blobspace directly from disk to tape. Records of modifications to the
blobspace overhead pages (the free-map and bitmap pages) are the only blobspace
data that reaches the logical log.
In This Chapter
You must manage logical-log files even if none of your databases uses transaction
logging. See Chapter 14, “Logical Log,” on page 14-1 for background information
on logical logs.
You must log in as either informix or root on UNIX to make any of the changes
described in this chapter. You must be a member of the Informix-Admin group on
Windows.
The easiest way to increase the amount of space for the logical log is to add
another logical-log file. See “Adding Logical-Log Files Manually” on page 15-10.
If the database server contains log files of different sizes, you cannot use the
(LOGFILES * LOGSIZE) expression to calculate the size of the logical log. Instead,
you need to add the sizes for each individual log file on disk. Check the size field
in the onstat -l output. For more information, see “onstat -l” on page 15-6.
Warning: If you do not back up these blobspaces and logical logs, you might not
be able to restore the blobspace data. If you wait until a blobspace is
down to perform the log backup, the database server cannot access the
blobspace to copy the changed data into the logical log.
Backing Up Sbspaces
When you turn on logging for smart large objects, you must perform a level-0
backup of the sbspace.
Figure 15-1 shows what happens if you turn on logging in an sbspace that is not
backed up. The unlogged changes to smart large object LO1 are lost during the
failure, although the logged changes are recoverable. You will not be able to fully
restore LO1.
During fast recovery, the database server rolls forward all committed transactions
for LO1. If LO1 is unlogged, the database server would be unable to roll back
uncommitted transactions. Then the LO1 contents would be incorrect. For more
information, refer to “Fast Recovery” on page 16-11.
Logging is off
Turn on logging
The database server can be in online mode to make this change. Execute the
following command to switch to the next available log file:
onmode -l
The change takes effect immediately. (Be sure that you type a lowercase L on the
command line, not a number 1.)
You might want to free a logical-log file for the following reasons:
v So that the database server does not stop processing
v To free the space used by deleted blobpages
The procedures for freeing log files vary, depending on the status of the log file.
Each procedure is described in the following sections. To find out the status of
logical-log files, see “Status Flags of Logical-Log Files” on page 14-3 and
“Monitoring Logging Activity” on page 15-6.
Tip: For information using ON–Bar or ontape to back up storage spaces and
logical logs, refer to the IBM Informix Backup and Restore Guide.
To delete the log file, create a level-0 backup of all storage spaces.
If backing up the log file does not change the status to free (F), its status changes
to either U-B or U-B-L. See “Freeing a Log File with Status U-B or F,” following, or
“Freeing a Log File with Status U-B-L” on page 15-6.
A log file that is backed up but not in use (status U-B) does not need to be freed.
In the following example, log 34 does not need to be freed, but logs 35 and 36 do.
Log 35 contains the last checkpoint, and log 36 is backed up but still in use.
Tip: You can free a logical log with a status of U-B (and not L) only if it is not
spanned by an active transaction and does not contain the oldest update.
After you free the current log file, if the log file has status U-B or U-B-L, refer to
“Freeing a Log File with Status U-B or F” on page 15-5 or “Freeing a Log File with
Status U-B-L.”
To free log files with a status U-B-L, the database server must create a new
checkpoint. You can execute the following command to force a checkpoint:
onmode -c
UNIX Only
onstat -l
The onstat -l command displays information about physical and logical logs.
The output section that contains information on each logical-log file includes the
following information:
For more information on and an example of onstat -l output, see the IBM Informix
Administrator's Reference.
oncheck -pr
The database server stores logical-log file information in the reserved pages
dedicated to checkpoint information. Because the database server updates this
information only during a checkpoint, it is not as recent as the information that the
onstat -l option displays. For more details on using these options to display
reserved page information, see the IBM Informix Dynamic Server Administrator's
Reference.
You can view the checkpoint reserved pages with the oncheck -pr command.
Figure 15-2 shows sample output for one of the logical-log files.
...
Log file number 1
Unique identifier 7
Log contains last checkpoint Page 0, byte 272
Log file flags 0x3 Log file in use
Current log file
Physical location 0x1004ef
Log size 750 (p)
Number pages used 1
Date/Time file filled 01/29/2001 14:48:32
...
If the DYNAMIC_LOGS parameter is set to 1 and the next active log file contains
records from an open transaction, the database server prompts you to add a log
file manually and sets off an alarm. After you add the log file, the database server
resumes processing the transaction.
If the DYNAMIC_LOGS parameter is set to 0 and the logical log runs out of space
during a long transaction rollback, the database server can hang. (The long
transaction prevents the first logical-log file from becoming free and available for
reuse.) To fix the problem, set DYNAMIC_LOGS to 2 and restart the database
server. Then the long transaction should be able to complete.
If the logical log is low on space, the database server adds as many log files as
needed to complete the transaction. The number of log files is limited by:
v The maximum number of log files supported
v The amount of disk space for the log files
v The amount of free contiguous space in the root chunk
If the database server stops adding new log files because it is out of disk space, it
writes an error message and sets off an alarm. Add a dbspace or chunk to an
existing dbspace. Then the database server automatically resumes processing the
transaction.
The reserve pages in the root chunk store information about each log file. The
extents that contain this information expand as more log files are added. The root
chunk requires two extents of 1.4 megabytes each to track 32,767 log files, the
maximum number supported.
If during reversion, the chunk reserve page extent is allocated from a non-root
chunk, the server attempts to put it back in the root chunk. If not enough space is
available in the root chunk, the reversion fails. A message containing the required
space displays in the online log. The required space needs to be freed from the root
chunk before trying the reversion again.
If you do not want to use this search order to allocate the new log file, you must
set the DYNAMIC_LOGS parameter to 1 and execute onparams -a -i with the
For more information on using onparams to add a logical-log file, see the IBM
Informix Administrator's Reference.
For information on using onlog to display the logical-log files and unique ID
numbers, see “Displaying Logical-Log Records” on page 15-14.
Tip: If the root dbspace has never been backed up, you can drop a used log file
immediately.
The following procedure provides an example of how to move six logical-log files
from the root dbspace to another dbspace, dbspace_1.
Warning: You cannot move logical and physical log files in dbspaces that have
non-default page sizes.
Configuration
Parameter Minimum Value Default Value Maximum Value
DYNAMIC_LOGS 0 or 1 2 2
LOGBUFF 2 * page size 32 KB LOGSIZE value
LOGFILES 3 files 6 files 32,767 files
LOGSIZE 1500 KB on UNIX 2000 KB See the IBM Informix
Administrator's Reference
500 KB on Windows
LTXEHWM LTXHWM value 90% 100%
LTXHWM 1% 80% 100%
Important: The change to LOGFILES does not take effect until you reinitialize or
restart the disk space.
You can include the onparams command to add log files in your alarm script for
event class ID 27, log file required. Your script can also execute the onstat -d
command to check for adequate space and execute the onparams a -i command
with the location that has enough space. You must use the -i option to add the
new log right after the current log file.
Table 15-2 shows the actions that the database server takes for each setting of the
DYNAMIC_LOGS configuration parameter.
Table 15-2. DYNAMIC_LOGS Settings
DYNAMIC_
LOGS Meaning Event Alarm Wait to Add Log Dynamic Log Add
2 (default) Allows automatic allocation of new log Yes (26, 28) No Yes
files to prevent open transactions from
hanging the system.
1 Allows manual addition of new log files. Yes (27) Yes No
0 Does not allocate log files but issues the No No No
following message about open
transactions:
If you decrease your high-watermark values, you increase the likelihood of long
transactions. To compensate, allocate additional log space. For information on
LTXHWM and LTXEHWM, see the chapter on configuration parameters in the IBM
Informix Administrator's Reference.
For example, the database server has ten logical logs and LTXHWM is set to 98. A
transaction begins in log file 1 and update activity fills logs 1 through 9. The
database server dynamically adds log file 11 after log file 10. As long as the
transaction does not complete, this process continues until the database server has
added 40 log files. When the database server adds the fiftieth log, the transaction
has caught up to the high-watermark and the database server rolls it back.
Warning: If you set both LTXHWM and LTXEHWM to 100, long transactions are
never stopped. Therefore, you should set LTXHWM to below 100 for
normal database server operations. Set LTXHWM to 100 to run
scheduled transactions of unknown length. Set LTXEHWM to 100 if you
never want to block other users while a long transaction is rolling back
and you have ample disk space.
If the log files are too small, the database server might run out of log space while
rolling back a long transaction. In this case, the database server cannot block fast
enough to add a new log file before the last one fills. If the last log file fills, the
system will hang and display an error message. To fix the problem, shut down and
restart the database server. For details, see “Recovering from a Long Transaction
Hang” on page 15-16.
If you cannot add more disk space to the database server, end the transaction.
When the database server comes up in fast-recovery mode, the transaction is rolled
back. Then perform the following steps:
In This Chapter
This chapter covers the three procedures that the database server uses to achieve
data consistency:
v Physical logging
v Checkpoints
v Fast recovery
The physical log is a set of disk pages where the database server stores an
unmodified copy of the page called a before-image. Physical logging is the process of
storing a before-image of a page that the database server is going to change. A
checkpoint refers to a point when the database server synchronizes the pages on
disk with the pages in the shared-memory buffers. Fast recovery is an automatic
procedure that restores the database server to a consistent state after it goes offline
under uncontrolled conditions.
These procedures ensure that multiple, logically related writes are recorded as a
unit, and that data in shared memory is periodically made consistent with data on
disk.
For the tasks to manage and monitor the physical log and checkpoints, see
Chapter 17, “Managing the Physical Log,” on page 17-1.
Critical Sections
A critical section is a section of code (or machine instructions) that must be
performed as a single unit. A critical section ensures the integrity of a thread by
allowing it to execute a series of instructions before it is swapped out.
Physical Logging
Physical logging is the process of storing the pages that the database server is going
to change before the changed pages are actually recorded on disk. Before the
database server modifies certain pages in the shared-memory buffer pool, it stores
before-images of the pages in the physical-log buffer in shared memory.
The database server maintains the before-image page in the physical-log buffer in
shared memory for those pages until one or more page cleaners flush the pages to
disk. The unmodified pages are available in case the database server fails or the
backup procedure needs them to provide an accurate snapshot of the database
server data. Fast recovery and database server backups use these snapshots.
The database server empties the physical log at each checkpoint (except in the
special circumstances explained in “Configuring the Size of the Physical Log” on
page 16-5). For more information on checkpoints, see “Checkpoints” on page 16-7.
The database server stores the before-images in the physical log only until the next
checkpoint. To control the amount of data that the database server logs, you can
tune the checkpoint interval configuration parameter CKPTINTVL.
Important: The database server no longer logs the before-images for fuzzy
operations in the physical log. It still tracks these updates in the logical
log. For a definition of fuzzy operations, see “Fuzzy Operations” on
page 16-8.
When the fast recovery completes, the database server logs the following message:
Physical recovery complete: number pages examined, number pages restored.
If the number of pages examined is much larger than the number of pages restored,
increase the size of the buffer pool to reduce the number of duplicate
before-images. For more information, see the messages appendix in the IBM
Informix Administrator's Reference.
Overhead pages also include blobspace free-map pages and blobspace bit-map
pages. Blobspace blobpages are not logged in the physical log. For further
information about blobspace logging, see “Logging Blobspaces and Simple Large
Objects” on page 14-6.
The physical log is located in the dbspace specified by the ONCONFIG parameter
PHYSDBS. (For information on PHYSDBS, see the chapter on configuration
parameters in the IBM Informix Administrator's Reference.) Change PHYSDBS only if
you decide to move the physical-log file from the root dbspace. (See “Changing the
Physical-Log Location and Size” on page 17-1.)
Because the physical log is critical, you should mirror the dbspace that contains the
physical log.
This formula is based on how much physical logging space the database server
needs in a worst-case scenario. This scenario takes place when a checkpoint occurs
because the log becomes 75 percent full. This size might be too small or large for
your actual workload or configuration.
If you are using simple large objects in a dbspace in a database without logging,
substitute the size of the most-frequently occurring simple large object in the
dbspace for the maximum log pages per critical section.
For more information on monitoring and tuning the physical log, refer to the
chapter on configuration effects on I/O utilization in your IBM Informix Dynamic
Server Performance Guide.
Fuzzy checkpoints keep the physical log from filling up too quickly when
applications are doing intensive updates. (See “Fuzzy Checkpoint” on page 16-7.)
However, the physical log could still become full, as the following sections
describe.
When the database server processes these simple large objects, each portion of the
simple large object that the database server stores on disk can be logged separately,
allowing the thread to exit the critical sections of code between each portion.
The database server then initiates a shutdown. For the suggested corrective action,
refer to this message in your message log.
The database server performs physical logging through six steps that are shown in
the table below.
Checkpoints
The database server performs two types of checkpoints: full checkpoints (also
known as sync checkpoints) and fuzzy checkpoints. The term checkpoint refers to
the point in the database server operation when the pages on disk are
synchronized with the pages in the shared-memory buffer pool. The default
checkpoint type is fuzzy.
The database server generates at least one checkpoint for each span of the
logical-log space to guarantee that it has a checkpoint at which to begin fast
recovery.
Although the database server performs checkpoints automatically, you can initiate
one manually or control how often the database server checks to see if a
checkpoint is needed. You can specify the checkpoint interval in the CKPTINTVL
configuration parameter.
For more information about CKPTINTVL and BUFFERPOOL, see the chapter on
configuration parameters in the IBM Informix Administrator's Reference. For
information on monitoring and tuning checkpoint parameters, see your IBM
Informix Dynamic Server Performance Guide.
Full Checkpoint
In a full checkpoint, the database server flushes all modified pages in the
shared-memory buffer pool to disk. When a full checkpoint completes, all physical
operations are complete, the MLRU queue is empty, and the database server is said
to be physically consistent.
Fuzzy Checkpoint
In a fuzzy checkpoint, the database server does not flush the modified pages in the
shared-memory buffer pool to disk for certain types of operations, called fuzzy
Fuzzy Operations
The following commonly used operations are fuzzy for built-in data types:
v Inserts
v Updates
v Deletes
The database server flushes all the modified data pages for nonfuzzy operations to
disk during a fuzzy checkpoint in the same way as for a full checkpoint.
Important: Fuzzy checkpoints are disabled for the primary and secondary servers
in a High-Availability Data Replication pair.
The database server skips a full checkpoint if all data is physically consistent when
the checkpoint interval expires. It skips a fuzzy checkpoint only if no pages have
been dirtied since the last checkpoint.
The database server performs a full checkpoint to prevent problems with fast
recovery of old log records.
For a list of situations in which you should initiate a full checkpoint, see the
following section.
Shared memory
F F
F
F
Storage space
Figure 16-1. Selectively Writing Modified Pages from Shared Memory to Disk
In a full checkpoint, the database server flushes all modified pages in the
shared-memory buffer pool to disk.
Important: Because the logical log contains records of fuzzy operations not yet
written to disk, you must back up the logical logs regularly.
For information on ON–Bar or ontape, see the IBM Informix Backup and Restore
Guide.
Fast Recovery
Fast recovery is an automatic, fault-tolerant feature that the database server
executes every time that it moves from offline to quiescent, single-user, or online
mode. You do not need to take any administrative actions for fast recovery; it is an
automatic feature.
The fast-recovery process checks if, the last time that the database server went
offline, it did so in uncontrolled conditions. If so, fast recovery returns the database
server to a state of physical and logical consistency.
If the fast-recovery process finds that the database server came offline in a
controlled manner, the fast-recovery process terminates, and the database server
moves to online mode.
The database server removes the plog_extend.servernum file when the first
checkpoint is performed during a fast recovery.
Shared memory
Figure 16-2. Writing All Remaining Before-Images in the Physical Log Back to Disk
Logical log
Figure 16-3. Rolling Forward the Logical-Log Records Written Since the Most Recent
Checkpoint
Logical log
Dbspace
Uncommitted changes
rolled back
Disk A
Shared memory
Nonfuzzy pages
Figure 16-5. Writing Nonfuzzy Before-Images in the Physical Log Back to Disk
Pages on which fuzzy operations occurred are not physically consistent because the
database server does not physically log the before-images. If the most recent
checkpoint was a fuzzy checkpoint, the changed pages for fuzzy operations were
not flushed to disk. The dbspace disk still contains the before-image of each page.
To undo changes to these pages prior to the fuzzy checkpoint, the database server
uses the logical log, as the next step describes.
Logical log
Figure 16-6. Locating the Oldest Update Record in the Logical Log
The LSN cannot be further back in the log than one logical-log file and two
checkpoints. At each fuzzy checkpoint, the database server writes pages with time
stamps earlier than the oldest LSN and moves forward the LSN.
You cannot free the logical log that contains the oldest update record until after the
changes are recorded on disk. The database server automatically performs a full
checkpoint to prevent problems with fast recovery of very old log records.
Chapter 16. Physical Logging, Checkpoints, and Fast Recovery 16-15
Applying the Log Records for Fuzzy Operations
In the second step, the database server processes the log records for fuzzy
operations that occurred following the oldest update and before the last
checkpoint. The log records that represent changes to data must be on disk before
the changed data replaces the previous version on disk.
Log records for fuzzy operations are selectively redone, depending on whether the
update has already been applied to the page. If the time stamp in the logical-log
record is newer than the time stamp in the disk page, the database server applies
the record. Otherwise, the database server skips that record.
Figure 16-7 illustrates how the database server processes fuzzy records only prior
to checkpoint.
Logical log
Dbspace
Changes not flushed to Records after the
disk since the oldest oldest update
update was applied
Logical log
Dbspace
Records after the
Changes since the oldest update
fuzzy checkpoint
rolled forward
Figure 16-8. Rolling Forward the Logical-Log Records Written Since the Most Recent Fuzzy
Checkpoint
Logical log
Dbspace
Uncommitted changes
rolled back
You can use either parameter or both when using fuzzy checkpoints. The default
value for both parameters is 0 (off).
The extra physical logging that occurs when the database server uses the
FAST_RESTART_PHYSLOG parameter affects runtime performance. If you do not
want to sacrifice runtime performance, use the FAST_RESTART_CKPT_FUZZYLOG
parameter to reduce some recovery time. FAST_RESTART_CKPT_FUZZYLOG,
which needs less buffer pool space than the FAST_RESTART_PHYSLOG, needs up
to 20 percent of the physical log size and it needs extra buffer pool size. When
configuring the buffer pool before starting fast recovery, the number of unflushed
dirty buffer pages are written to physical log at checkpoint time can help you
determine how much more buffer pool space you should consider.
Thus, if you want better performance during fast recovery and have a bigger
buffer pool configuration, always turn on FAST_RESTART_CKPT_FUZZYLOG.
This does not affect database server runtime performance. If you are willing to
sacrifice some runtime performance for better fast recovery performance, you can
also turn on FAST_RESTART_PHYSLOG.
FAST_RESTART_PHYSLOG takes effect when you restart the database server. If the
database server fails before the next checkpoint performs, maximum fast-recovery
performance does not occur because the database server did not log all of the
fuzzy updates in the checkpoint intervals.
In This Chapter
This chapter describes the following procedures:
v Changing the location and size of the physical log
v Monitoring the physical log, physical-log buffers, and logical-log buffers
v Monitoring and forcing checkpoints
See Chapter 16, “Physical Logging, Checkpoints, and Fast Recovery,” on page 16-1
for background information.
UNIX Only
v Using ON–Monitor
End of UNIX Only
To activate the changes to the size or location of the physical log as soon as you
make them, shut down and restart the database server. The onparams utility
automatically shuts down and restarts the database server.
Create a level-0 backup immediately after you restart the database server. This
storage-space backup is critical for database server recovery.
You can move the physical-log file to try to improve performance. When the
database server initializes disk space, it places the disk pages allocated for the
Note: You cannot add logical or physical logs to dbspaces that have non-default
page sizes.
For advice on where to place the physical log, see “Specifying the Location of the
Physical Log” on page 16-4. For advice on sizing the physical log, see “Size and
Location of the Physical Log” on page 16-4. To obtain information about the
physical log, see “Monitoring Physical and Logical-Logging Activity” on page 17-3.
If this error occurs, resize the physical log, or choose another dbspace with
adequate contiguous space and then shut down and restart the database server.
The changes do not take effect until you shut down and restart the database server.
Then create a level-0 backup immediately to ensure that all recovery mechanisms
are available.
The command shown above, with the -y option, changes the value of the
parameter in shared memory so that the change takes effect immediately.
After you shut down and restart the database server, create a level-0 backup to
ensure that all recovery mechanisms are available.
For information on using the onparams utility to modify the physical log, see the
IBM Informix Administrator's Reference.
Then, create a level-0 backup immediately to ensure that all recovery mechanisms
are available.
Monitor physical-log and logical-log buffers to determine if they are the optimal
size for the current level of processing. The important statistic to monitor is the
pages-per-disk-write statistic. For more information on tuning the physical-log and
logical-log buffers, see your IBM Informix Performance Guide.
To monitor the physical-log file, physical-log buffers, and logical-log buffers, use
the following commands.
The second line displays the following information about the physical
log:
v The page number of the first page in the physical-log file
(phybegin)
v The size of the physical-log file in pages (physize)
v The current position in the log where the next write occurs,
specified as a page number (physpos)
v The number of pages in the log that have been used (phyused)
v The percentage of the total physical-log pages that have been used
(%used)
Note: For more information on and an example of onstat -l output, see the IBM
Informix Administrator's Reference
In This Chapter
This chapter describes the database server mirroring feature. For instructions on
how to perform mirroring tasks, refer to Chapter 19, “Using Mirroring,” on page
19-1
Mirroring
Mirroring is a strategy that pairs a primary chunk of one defined dbspace,
blobspace, or sbspace with an equal-sized mirror chunk.
Writes
Figure 18-1. Writing Data to Both the Primary Chunk and the Mirror Chunk
Mirroring is not supported on disks that are managed over a network. The same
database server instance must manage all the chunks of a mirrored set.
© Copyright IBM Corp. 1996, 2005 18-1
Benefits of Mirroring
If media failure occurs, mirroring provides the database server administrator with
a means of recovering data without having to take the database server offline. This
feature results in greater reliability and less system downtime. Furthermore,
applications can continue to read from and write to a database whose primary
chunks are on the affected media, provided that the chunks that mirror this data
are located on separate media.
Any critical database should be located in a mirrored dbspace. Above all, the root
dbspace, which contains the database server reserved pages, should be mirrored.
Costs of Mirroring
Disk-space costs as well as performance costs are associated with mirroring. The
disk-space cost is due to the additional space required for storing the mirror data.
The performance cost results from having to perform writes to both the primary
and mirror chunks. The use of multiple virtual processors for disk writes reduces
this performance cost. The use of split reads, whereby the database server reads
data from either the primary chunk or the mirror chunk, depending on the location
of the data within the chunk, actually causes performance to improve for read-only
data. For more information on how the database server performs reads and writes
for mirror chunks, see “Actions During Processing” on page 18-5.
When a mirror chunk suffers media failure, the database server reads exclusively
from the chunk that is still online until you bring the down chunk back online. On
the other hand, when an mirrored chunk goes down, the database server cannot
access the data stored on that chunk. If the chunk contains logical-log files, the
physical log, or the root dbspace, the database server goes offline immediately. If
the chunk does not contain logical-log files, the physical log, or the root dbspace,
the database server can continue to operate, but threads cannot read from or write
to the down chunk. If an unmirrored chunk goes down, you must restore it by
recovering the dbspace from a backup.
Data to Mirror
Ideally, you should mirror all of your data. If disk space is an issue, however, you
might not be able to do so. In this case, select certain critical chunks to mirror.
Critical chunks always include the chunks that are part of the root dbspace, the
chunk that stores the logical-log files, and the chunk that stores the physical logs. If
any one of these critical chunks fail, the database server goes offline immediately.
If some chunks hold data that is critical to your business, give these chunks high
priority for mirroring.
Also give priority for mirroring to chunks that store frequently used data. This
action ensures that the activities of many users would not be halted if one widely
used chunk goes down.
Hardware Mirroring
Another solution is to use hardware mirroring such as RAID (redundant array of
inexpensive disks). An advantage of this type of hardware mirroring is that it
requires less disk space than database server mirroring does to store the same
amount of data to prevent media failure.
Some hardware mirroring systems support hot swapping. You can swap a bad disk
while keeping the database server online. Reducing I/O activity before performing
a hot swap is recommended.
Important: If problems occur with the database server while using hardware
mirroring, refer to the operating-system or disk documentation or
technical support for assistance.
Mirroring Process
This section describes the mirroring process in greater detail. For instructions on
how to perform mirroring operations such as creating mirror chunks, starting
mirroring, changing the status of mirror chunks, and so forth, see Chapter 19,
“Using Mirroring,” on page 19-1.
The recovery procedure that marks the beginning of mirroring is delayed if you
start to mirror chunks within a dbspace that contains a logical-log file. Mirroring
for dbspaces that contain a logical-log file does not begin until you create a level-0
backup of the root dbspace. The delay ensures that the database server can use the
mirrored logical-log files if the primary chunk that contains these logical-log files
becomes unavailable during a dbspace restore.
The level-0 backup copies the updated database server configuration information,
including information about the new mirror chunk, from the root dbspace reserved
pages to the backup. If you perform a data restore, the updated configuration
information at the beginning of the backup directs the database server to look for
the mirrored copies of the logical-log files if the primary chunk becomes
unavailable. If this new storage-space backup information does not exist, the
database server is unable to take advantage of the mirrored log files.
For similar reasons, you cannot mirror a dbspace that contains a logical-log file
while a dbspace backup is being created. The new information that must appear in
the first block of the dbspace backup tape cannot be copied there after the backup
has begun.
For more information on creating mirror chunks, refer to Chapter 19, “Using
Mirroring,” on page 19-1.
You must perform a level-0 backup of the root dbspace before mirroring starts.
For descriptions of these chunk status flags, refer to the description of the onstat -d
option in the IBM Informix Administrator's Reference. For information on how to
display these status flags, refer to “Monitoring Disk Usage” on page 11-32.
Recovery
When the database server recovers a mirror chunk, it performs the same recovery
procedure that it uses when mirroring begins. The mirror-recovery process consists
of copying the data from the existing online chunk onto the new, repaired chunk
until the two are identical.
When you initiate recovery, the database server puts the down chunk in recovery
mode and copies the information from the online chunk to the recovery chunk.
When the recovery is complete, the chunk automatically receives online status. You
perform the same steps whether you are recovering the primary chunk of a
mirrored pair or recovering the mirror chunk.
Data on this half of the chunk is Data on this half of the chunk is
read from the primary chunk. read from the mirrored chunk.
Figure 18-2. Split Read Reducing the Maximum Distance Over Which the Disk Head Must
Travel
If the database server detects that a primary (or mirror) chunk device has failed,
reads and writes continue for the one chunk that remains online. This statement is
true even if the administrator intentionally brings down one of the chunks.
After the administrator recovers the down chunk and returns it to online status,
reads are again split between the primary and mirror chunks, and writes are made
to both chunks.
Chunk Recovery
The database server uses asynchronous I/O to minimize the time required for
recovering a chunk. The read from the chunk that is online can overlap with the
write to the down chunk, instead of the two processes occurring serially. That is,
Create a level-0 backup of the root dbspace after you end mirroring to ensure that
the reserved pages with the updated mirror-chunk information are copied to the
backup. This action prevents the restore procedure from assuming that mirrored
data is still available.
For information on these structures, refer to the section on the structure of a mirror
chunk in the disk structures and storage chapter of the IBM Informix Administrator's
Reference.
If the primary chunk goes down and the mirror chunk becomes the primary
chunk, disk-space allocation reports then accurately describe the fullness of the
new primary chunk.
In This Chapter
This chapter describes the various mirroring tasks that are required to use the
database server mirroring feature. It provides an overview of the steps required for
mirroring data.
Enable mirroring when you initialize the database server if you plan to create a
mirror for the root dbspace as part of initialization; otherwise, leave mirroring
disabled. If you later decide to mirror a storage space, you can change the value of
the MIRROR configuration parameter.
To enable mirroring for the database server, you must set the MIRROR parameter
in ONCONFIG to 1. The default value of MIRROR is 0, indicating that mirroring
is disabled.
Do not set the MIRROR parameter to 1 if you are not using mirroring.
To change the value of MIRROR, you can edit the ONCONFIG file with a text
editor or ISA while the database server is in online mode. After you change the
ONCONFIG file, take the database server offline and then to quiescent for the
change to take effect.
After the last of these screens, a prompt appears to confirm that you want to
continue (to initialize the database server disk space and destroy all existing data).
Respond N (no) to this prompt.
Warning: If you respond Y (yes) at this prompt, you lose all your existing data.
Take the database server offline and then to quiescent mode for the change to take
effect.
UNIX commands that you can use for relinking are shown in the following
examples.
The original setup consists of a primary root chunk and a mirror root chunk,
which are linked to the actual raw disk devices, as follows:
ln -l
lrwxrwxrwx 1 informix 10 May 3 13:38 /dev/root@->/dev/rxy0h
lrwxrwxrwx 1 informix 10 May 3 13:40 /dev/mirror_root@->/dev/rsd2b
Assume that the disk on which the raw device /dev/rsd2b resides has gone down.
You can use the rm command to remove the corresponding symbolic link, as
follows:
rm /dev/mirror_root
Now you can relink the mirror chunk pathname to a raw disk device, on a disk
that is running, and proceed to recover the chunk, as follows:
ln -s /dev/rab0a /dev/mirror_root
Using Mirroring
Mirroring starts when you create a mirror chunk for each primary chunk in a
dbspace, blobspace, or sbspace.
When you create a mirror chunk, the database server copies data from the primary
chunk to the mirror chunk. When this process is complete, the database server
begins mirroring data. If the primary chunk contains logical-log files, the database
server does not copy the data immediately after you create the mirror chunk but
waits until you perform a level-0 backup. For an explanation of this behavior see
“Creation of a Mirror Chunk” on page 18-4.
Important: You must always start mirroring for an entire dbspace, blobspace, or
sbspace. The database server does not permit you to select particular
chunks in a dbspace, blobspace, or sbspace to mirror. You must create
mirror chunks for every chunk in the space.
You start mirroring a storage space when you perform the following operations:
v Create a mirrored root dbspace during system initialization
Each of these operations requires you to create mirror chunks for the existing
chunks in the storage space.
To specify the root mirror pathname and offset, set the values of MIRRORPATH
and MIRROROFFSET in the ONCONFIG file before you bring up the database
server.
If you do not provide a mirror pathname and offset, but you do want to start
mirroring the root dbspace, you must change the mirroring status of the root
dbspace after the database server is initialized.
You can take down or restore a chunk only if it is part of a mirrored pair. You can
take down either the primary chunk or the mirror chunk, as long as the other
chunk in the pair is online.
Managing Mirroring
You can use the onspaces utility to manage mirroring. On UNIX, you can also use
ON–Monitor to manage mirroring. For a full description of the onspaces syntax,
see information on the onspaces utility in the IBM Informix Administrator's
Reference.
In this line, /ix/9.3/sp1 is the primary path, 0 is the primary offset, /ix/9.3/sp1mir is
the mirror path, and 0 is the mirror offset.
To select the dbspace that you want to mirror, move the cursor down the list to the
correct dbspace and press CTRL-B. The Mirror option then displays a screen for
each chunk in the dbspace. You can enter a mirror pathname and offset in this
screen. After you enter information for each chunk, press ESC to exit the option.
The database server recovers the new mirror chunks, meaning it copies data from
the primary to the mirror chunk. If the chunk contains logical-log files, recovery is
postponed until after you create a level-0 backup.
Another way to start mirroring is to select Index by Utility > onspaces > -m.
Taking down a chunk is not the same as ending mirroring. You end mirroring for a
complete dbspace, which causes the database server to drop all the mirror chunks
for that dbspace.
Ending Mirroring
When you end mirroring for a dbspace, blobspace, or sbspace, the database server
immediately releases the mirror chunks of that space. These chunks are
immediately available for reassignment to other storage spaces.
Only users informix and root on UNIX or members of the Informix-Admin group
on Windows can end mirroring.
You cannot end mirroring if any of the primary chunks in the dbspace are down.
The system can be in online mode when you end mirroring.
Another way to end mirroring is to select Index by Utility > onspaces > -r.
In This Chapter
This chapter contains general information on High-Availability Data Replication
(HDR), which is available with the standard version of Dynamic Server. HDR does
not work with the IBM Informix Dynamic Server Express Edition.
Tip: If you want to use asynchronous data replication, see the IBM Informix
Dynamic Server Enterprise Replication Guide.
HDR Modes
The following table shows HDR modes.
HDR replicates all built-in and extended data types. User-defined types (UDTs)
must be logged and reside in a single database server. Data types with out-of-row
data are replicated if the data is stored in an sbspace or in a different table on the
same database server. For data stored in an sbspace to be replicated, the sbspace
must be logged.
HDR does not replicate data stored in operating system files or persistent external
files or memory objects associated with user-defined routines.
These advantages do not come without a cost. Data replication obviously requires
more storage, and updating replicated data can take more processing time than
updating a single object.
During normal operation, clients can connect to the primary database server and
use it as they would an ordinary database server. Clients can also use the
secondary database server during normal operation, but only to read data. The
secondary database server does not permit updates from client applications.
Read-only clients
Client Client
Primary Secondary
Client Client
If one of the database servers in an HDR pair fails, as Figure 20-2 shows, you can
redirect the clients that use that database server to the other database server in the
pair.
Client
Client
Primary Secondary
Client
Client
Figure 20-2. Database Servers in an HDR Pair and Clients After a Failure
If a primary database server fails, you can change the secondary database server to
a standard database server so that it can accept updates.
On the other hand, HDR duplicates on an entirely separate database server all the
data that a database server manages (not just specified dbspaces). Because HDR
involves two separate database servers, it protects the data that these database
servers manage, not just against disk failures, but against all types of database
server failures, including a computer failure or the catastrophic failure of an entire
site.
Database server
Disks
Computer
When you combine HDR and Enterprise Replication, only the primary HDR server
is connected to the Enterprise Replication system. The secondary HDR server does
not participate in Enterprise Replication unless the primary HDR server fails.
For more information, see IBM Informix Dynamic Server Enterprise Replication Guide.
To replicate data:
1. Install user-defined types, user-defined routines, and DataBlade modules on
both database servers, and then register them on the primary database server
only.
2. To make the bulk of the data managed by the two database servers the same,
create a level-0 backup of all the storage spaces on the primary database server,
and restore all the storage spaces from that backup on the secondary database
server in the data-replication pair.
The secondary database server that you restored from a storage-space backup
in the previous step then reads all the logical-log records generated since that
backup from the primary database server.
The database server reads the logical-log records first from any backed-up
logical-log files that are no longer on disk and then from any logical-log files
on disk.
For detailed instructions on performing the preceding steps, refer to “Starting HDR
for the First Time” on page 21-6. The IBM Informix Backup and Restore Guide
discusses how to start replication using ON–Bar.
You must perform the initial HDR with a storage-space backup. You cannot use
data-migration utilities such as onload and onunload to replicate data because the
physical page layout of tables on each database server must be identical in order
for HDR to work.
When HDR is working, the primary database server is online and accepts updates
and queries just as a standard database server does. The secondary database server
is in logical-recovery mode and cannot accept SQL statements that result in writes
to disk (except for sorting and temporary tables).
Important: The database server cannot replicate updates to databases that do not
use transaction logging.
The secondary database server receives the logical-log records from the primary
database server into a shared-memory reception buffer (which the database server
automatically adjusts to an appropriate size for the amount of data being sent).
The secondary database server then applies the logical-log records through logical
recovery.
HDR Buffers
The HDR buffers are part of the virtual shared memory that the primary database
server manages. The HDR buffers hold logical-log records before the primary
database server sends them to the secondary database server. The HDR buffers are
the same size as the logical-log buffers. Figure 20-4 shows this concept.
Primary Secondary
Logical-log Recovery
buffer buffer
Disk Disk
Figure 20-4. How Logical-Log Records Are Sent from the Primary Database Server to the
Secondary Database Server
Synchronous Updating
If you set DRINTERVAL to -1, HDR occurs synchronously. As soon as the primary
database server writes the logical-log buffer contents to the HDR buffer, it sends
those records from the HDR buffer to the secondary database server. The
logical-log buffer flush on the primary database server completes only after the
primary database server receives acknowledgment from the secondary database
server that the records were received.
Asynchronous Updating
If you set DRINTERVAL to any value other than -1, data replication occurs
asynchronously. The primary database server flushes the logical-log buffer after it
copies the logical-log buffer contents to the HDR buffer. Independent of that action,
the primary database server sends the contents of the HDR buffer across the
network when one of the following conditions occurs:
v The HDR buffer becomes full.
v The time interval, specified by the DRINTERVAL configuration parameter on the
primary database server, has elapsed since the last time that records were sent to
the secondary database server.
Records for
transaction Secondary
committed on switched to
primary but Records in standard
rolled back on primary logical
secondary log after recovery
Records in
lost-and-found
file after recovery
If the lost-and-found file appears on the computer that is running the primary
database server after it restarts data replication, a transaction has been lost. The
database server cannot reapply the transaction records in the lost-and-found file
because conflicting updates might have occurred while the secondary database
server was acting as a standard database server.
Client
Primary Secondary
sqlexec
drsecapply
drprsend drsecrcv
logrecvr
drprping drsecping
The remaining threads that the database server starts for HDR are the drprping
and drsecping threads, which are responsible for sending and receiving the
messages that indicate if the two database servers are connected.
Tip: Synchronize the time on the operating systems of both database servers in the
pair and set DRTIMEOUT on both servers to the same value.
HDR Failures
This section discusses the causes and consequences of an HDR failure, as well as
the administrator’s options for managing failure and restarting data replication.
To redirect clients that use the secondary database server to the primary database
server, use any of the methods explained in “Redirection and Connectivity for
Data-Replication Clients” on page 20-14. If you redirect these clients, the primary
database server might require an additional temporary dbspace for temporary
tables and sorting.
You do not need to change the type of the primary database server to standard.
To restart data replication after a failure of the secondary database server, follow
the steps in “Restarting If the Secondary Database Server Fails” on page 21-20.
Because the secondary database server becomes a standard database server, you
must be sure that either:
v The secondary database server has enough logical-log disk space to allow
processing to continue without backing up logical-log files.
v The logical-log files are backed up.
The automatic switchover changes only the type of the database server. It does not
redirect client applications to the secondary database server. For information on
redirecting clients, see “Redirection and Connectivity for Data-Replication Clients”
on page 20-14.
Actions that Occur After Automatic Switchover: When you succeed in bringing
the original primary database server back online, the HDR connection is
automatically established.
v If DRAUTO is set to RETAIN_TYPE, the secondary-turned-standard database
server goes through a graceful shutdown (to ensure that all clients that might
potentially write to the database server are not connected) and then switches
back to a secondary database server.
v If DRAUTO is set to REVERSE_TYPE, the secondary-turned-standard database
server switches directly to the primary type. No shutdown occurs. Any
applications connected to this database server can stay connected. The original
primary database server is switched to a secondary database server.
Consider what might happen if the primary database server does not actually fail
but appears to the secondary database server to fail. For example, if the secondary
database server does not receive responses when it signals (pings) the primary
database server because of a slow or unstable network, the secondary server
assumes that the primary database server failed and switches automatically to the
standard type. If the primary database server also does not receive responses when
it signals the secondary database server, it assumes that the secondary database
server failed and turns off data replication but remains in online mode. Now the
primary database server and the secondary database server (switched to the
standard type) are both in online mode.
If clients can update the data on both database servers independently, the database
servers in the pair reach a state in which each database server has the logical-log
records that are needed by the other. In this situation, you must start again and
perform initial data replication with a level-0 dbspace backup of one entire
database server, as described in “Starting HDR for the First Time” on page 21-6.
Therefore, if your network is not entirely stable, you might not want to use
automatic switchover.
After a failure of one of the database servers in a pair, you might want to redirect
the clients that use the failed database server. (You might not want clients to be
redirected. For example, if you anticipate that the database servers will be
functioning again in a short time, redirecting clients might not be appropriate.)
The database server does not have a transparent mechanism for directing client
requests to different database servers in a replication pair, but you can automate
this action from within the application, as described in “Handling Redirection
Within an Application” on page 20-19. Some of the client connectivity drivers
included in the IBM Informix Client Software Developer's Kit have specific
mechanisms for automating redirection. For details, see the IBM Informix Client
Software Developer's Kit documentation.
The mechanism that you employ determines which CONNECT syntax you can use
in your application. The following sections describe each of the three redirection
mechanisms.
If one of the database servers in a replication pair is unusable, applications that use
that database server need not reset their INFORMIXSERVER environment variable
if their DBPATH environment variable is set to the other database server in the
pair. Their INFORMIXSERVER environment variable should always contain the
For example, if applications normally use a database server called cliff_ol, and the
database server paired with cliff_ol in a replication pair is called beach_ol, the
environment variables for those applications would be as follows:
INFORMIXSERVER cliff_ol
DBPATH //beach_ol
Because the DBPATH environment variable is read only (if needed) when an
application issues a CONNECT statement, applications must restart in order for
redirection to occur.
An application can contain code that tests whether a connection has failed and, if
so, attempts to reconnect. If an application has this code, you do not need to
restart it.
You can use the CONNECT TO database statement with this method of redirection.
For this method to work, you cannot use any of the following statements:
v CONNECT TO DEFAULT
v CONNECT TO database@dbserver
v CONNECT TO @dbserver
The reason for this restriction is that an application does not use DBPATH if a
CONNECT statement specifies a database server. For more information about
DBPATH, refer to the IBM Informix Guide to SQL: Reference.
If your applications do not include such code, users who are running clients must
quit and restart all applications.
Applications can use the following connectivity statements to support this method
of redirection:
v CONNECT TO database@dbserver
v CONNECT TO @dbserver
Applications can also use the following connectivity statements, provided that the
INFORMIXSERVER environment variable always remains set to the same
database server name and the DBPATH environment variable is not set:
v CONNECT TO DEFAULT
v CONNECT TO database
For more information, refer to “Configuring HDR Connectivity” on page 21-5 and
Chapter 3, “Client/Server Communications,” on page 3-1.
Figure 20-7 on page 20-17 shows how connectivity values might be modified to
redirect clients.
Client
Client Client
Client
cliff beach
cliff_ol beach_ol
Client
Client Client
Client
cliff beach
/etc/hosts
beach
cliff_ol beach_ol
/etc/services
ol_bc
Figure 20-7. Connectivity Values Before and After a Failure of the cliff_ol Database Server
You also must ensure that the following statements are true on the client computer
before that client can reconnect to the other database server.
1. The /etc/hosts file on UNIX or hosts file on Windows has an entry for the
hostname of the computer that is running the database server to which you are
redirecting clients.
2. The /etc/services file on UNIX or services file on Windows has an entry for the
servicename of the database server to which you are redirecting clients.
If your applications contain code that tests if a connection has failed and issues a
reconnect statement if necessary, redirection is handled automatically. The user has
no responsibilities. If your applications do not include such code, users who are
running clients must quit and restart all applications.
If one of the database servers in a replication pair is unusable, applications that use
that database server can reset their INFORMIXSERVER environment variable to
the other database server in the pair to access the same data.
To support this method of redirection, you can use the following connectivity
statements:
v CONNECT TO DEFAULT
v CONNECT TO database
#define SLEEPTIME 15
#define MAXTRIES 10
main()
{
int connected = 0;
int tries;
for (tries = 0;tries < MAXTRIES && connected == 0;tries++)
{
EXEC SQL CONNECT TO "superstores";
if (strcmp(SQLSTATE,"00000"))
{
if ([Link].sqlwarn6 != ’W’)
{
notify_admin();
if (tries < MAXTRIES - 1)
sleep(SLEEPTIME);
}
else connected =1;
}
}
return ((tries == MAXTRIES)? -1:0);
}
This example assumes the DBPATH redirection mechanism and uses a form of the
CONNECT statement that supports the DBPATH redirection method. If you used
the connectivity information to redirect, you might have a different connection
statement, as follows:
EXEC SQL CONNECT TO "superstores@cliff_ol";
The mechanism used is as follows. When the secondary database server receives a
logical-log record that necessitates a corresponding index build, it sends a message
back to the primary database server to request a physical copy of the index. The
primary database server has a lock on the table that is being updated. The owner
of the lock is a dr_btsend thread. The application thread that is executing is free to
continue processing. The dr_btsend thread cannot release the lock, however, until
the secondary database server acknowledges receipt of the index. If the application
tries to access the table while it is locked, this attempt fails, unless the application
has set the lock mode to wait.
If applications do not have lock mode set to WAIT, some unexpected errors might
occur. For example, many SQL statements cause updates to the catalog table
indexes. The following sequence of SQL statements fails if the lock mode of the
application is not set to WAIT:
These SQL statements would fail because the CREATE DATABASE statement
creates indexes on the systables catalog table and, therefore, places a lock on the
table until the indexes are copied over to the secondary database server.
Meanwhile, the CREATE TABLE statement tries to insert a row into the systables
catalog table. The insert fails, however, because the table is locked.
This application would fail because both the CREATE DATABASE and CREATE
TABLE statements cause updates to the systables catalog table index.
To prevent clients that are using the secondary database server from issuing
updating statements, you can take either of the following actions:
v Write client applications that do not issue updating statements.
v Make all updating statements conditional.
To make statements that perform an update conditional, make sure that client
applications test slqwarn6 of the sqlwarn field in the ESQL/C sqlca structure (and
equivalent values for other SQL APIs). The database server sets slqwarn6 to W
when it runs as a secondary database server.
For example, if a client connected to the secondary database server reads a row,
nothing prevents a user on the primary database server from updating that row,
even if the client connected to the secondary database server has issued a SET
ISOLATION TO REPEATABLE READ statement. The update is reflected on the
secondary database server as the logical-log records for the committed transaction
are processed. Thus, all queries on the secondary database server are essentially
dirty with respect to changes that occur on the primary database server, even
Important: All queries on the secondary database server are dirty reads. Do not
run queries on the secondary database server while log records that
contain data definition language (DDL) statements are being replicated
and applied on the secondary database server.
In This Chapter
This chapter describes how to plan, configure, start, and monitor High-Availability
Data Replication (HDR) for Dynamic Server, and how to restore data after a media
failure. If you plan to use HDR, read this entire chapter first. If you plan to use
IBM Informix Enterprise Replication, see the IBM Informix Dynamic Server Enterprise
Replication Guide.
HDR is available with the standard version of Dynamic Server. HDR does not
work with the IBM Informix Dynamic Server Express Edition.
This section describes the following configuration considerations for HDR database
server pairs:
v Database Server Version
v Storage Space and Chunk Configuration
v Mirroring
v Physical-Log Configuration
v Dbspace and Logical-Log Tape Backup Devices
v Logical-Log Configuration
UNIX Only
You should use symbolic links for the chunk pathnames, as explained in
“Allocating Raw Disk Space on UNIX” on page 11-5.
Important: If you do not use symbolic links for chunk pathnames, you cannot
easily change the pathname of a chunk. For more information, see
“Renaming Chunks” on page 21-10.
End of UNIX Only
The following ONCONFIG parameters must have the same value on each database
server:
v ROOTNAME
v ROOTOFFSET
v ROOTPATH
v ROOTSIZE
Mirroring
You do not have to set the MIRROR parameter to the same value on the two
database servers; you can enable mirroring on one database server and disable
mirroring on the other. However, if you specify a mirror chunk for the root chunk
of the primary database server, you must also specify a mirror chunk for the root
chunk on the secondary database server. Therefore, the following ONCONFIG
parameters must be set to the same value on both database servers:
v MIRROROFFSET
v MIRRORPATH
Physical-Log Configuration
The physical log should be identical on both database servers. The following
ONCONFIG parameters must have the same value on each database server:
v PHYSDBS
v PHYSFILE
If you use ON–Bar, set the ON–Bar configuration parameters to the same value on
both database servers. For information on the ON–Bar parameters, see the IBM
Informix Backup and Restore Guide.
If you use ontape, the tape size and tape block size for the storage-space and
logical-log backup devices should be identical. The following ONCONFIG
parameters must have the same value on each database server:
v LTAPEBLK
v LTAPESIZE
v TAPEBLK
v TAPESIZE
To use a tape to its full physical capacity, set LTAPESIZE and TAPESIZE to 0.
Logical-Log Configuration
All log records are replicated to the secondary server. You must configure the same
number of logical-log files and the same logical-log size for both database servers.
The following ONCONFIG parameters must have the same value on each database
server:
v LOGFILES
v LOGSIZE
v DYNAMIC_LOGS
The database server logs the addition of logical-log files. Logical-log files added
dynamically on the primary server are automatically replicated on the secondary
server. Although the DYNAMIC_LOGS value on the secondary server has no
effect, keep DYNAMIC_LOGS in sync with the value on the primary server, in case
their roles switch.
Important: Set the nettype field of the sqlhosts file or registry and the NETTYPE
configuration parameter to a network protocol such as ontlitcp,
onsoctcp, or ontlispx so that the database servers on two different
For information on how to redirect clients and change connectivity information, see
“Redirection and Connectivity for Data-Replication Clients” on page 20-14.
Suppose you want to start HDR on two database servers, ServerA and ServerB.
The procedure for starting HDR, using ServerA as the primary database server
and ServerB as the secondary database server, is described in the following steps.
Table 21-1 on page 21-7 lists the commands required to perform each step and the
messages sent to the message log. You can use ontape or ON–Bar to perform the
backup and restore. You must use the same utility throughout the procedure.
Important: If you use ON–Bar to perform the backup and restore, ontape is
required on both database servers. You cannot remove ontape from
database servers participating in HDR.
If desired, you can also set up HDR using standard ON–Bar or ontape commands
for external backup and restore.
To start HDR:
1. Install user-defined types, user-defined routines, and DataBlade modules on
both database servers, and then register them on ServerA only.
2. Create a level-0 backup of ServerA.
3. Perform a physical restore of ServerB from the level-0 backup that you created
in step 1. Do not perform a logical restore.
If you are using:
v ON–Bar, use the onbar -r -p command to perform a physical restore.
v ON–Bar and performing an external restore, use the onbar -r -p -e command
to perform the physical restore.
v ontape, use the ontape -p option. You cannot use the ontape -r option
because it performs both a physical and a logical restore.
v ontape and performing an external restore, use the ontape -p -e command to
perform the physical restore.
4. Use the onmode -d command to set the type of ServerA to primary and to
indicate the name of the associated secondary database server (in this case
ServerB).
When you issue an onmode -d command, the database server attempts to
establish a connection with the other database server in the HDR pair and to
start HDR operation. The attempt to establish a connection succeeds only if the
other database server in the pair is already set to the correct type.
At this point, ServerB is not online and is not set to type secondary, so the
HDR connection is not established.
5. Use the onmode -d command to set the type of ServerB to secondary and
indicate the associated primary database server.
ServerB tries to establish an HDR connection with the primary database server
(ServerA) and start operation. The connection should be successfully
established.
Important: You must complete steps 3 and 5 together. If you need to shut
down and restart the secondary database server after step 3, you
must redo step 3.
6. If logical-log records that were written to the primary database server are no
longer on the primary disk, the secondary database server prompts you to
recover these files from tape backups.
If the secondary database server must read the backed-up logical-log files over
the network, set the tape device parameters on the secondary database server
to a device on the computer that is running the primary database server or to a
device at the same location as the primary database server.
After you recover all the logical-log files on tape, the logical restore completes
using the logical-log files on the primary database server disk.
Table 21-1. Steps to Start HDR for the First Time
Step On the Primary On the Secondary
1. Install UDRs, UDTs, and DataBlade modules. Install UDRs, UDTs, and DataBlade modules.
ontape -s -L 0
ON–Bar command
onbar -b -L 0
ontape -p or ontape -r -p -e
ON–Bar command
onbar -r -p or onbar -r -p -e
ontape -l
ON–Bar command
onbar -r -l
Messages to message log Messages to message log
Important: When you use the STDIO value, ontape does not operate the same way
it does when you backup to a device.
See the IBM Informix Backup and Restore Guide for details about using the STDIO
value.
If the configuration parameter does not need to have the same value on each
database server in the replication pair, you can change the value on the primary or
secondary database server individually.
You must use the same backup and restore tool on both database servers.
The block size and tape size used (for both storage-space backups and logical-log
backups) must be identical on the primary and secondary database servers.
You can use ontape to set the tape size to 0 to automatically use the full physical
capacity of a tape.
The directory pathname or the actual file for chunks must exist before you create
them. Make sure the pathnames (and offsets, if applicable) exist on the secondary
database server before you create a chunk on the primary database server, or else
the database server turns off data replication.
Renaming Chunks
If you use symbolic links for chunk pathnames, you can rename chunks while
HDR is operating. For instructions on renaming chunks, see the IBM Informix
Backup and Restore Guide.
If you do not use symbolic links for chunk pathnames, you must take both
database servers offline while renaming the chunks, for the time that it take to
complete a cold restore of the database server.
To ensure that the new chunk status is flushed to the reserved pages on the
secondary database server, force a checkpoint on the primary database server and
verify that a checkpoint also completes on the secondary database server. The new
chunk status is now retained even if the secondary database server is restarted.
If the primary chunk on the secondary database server is down, you can recover
the primary chunk from the mirror chunk.
After you complete these steps, the primary chunk will be online when you restart
the secondary database server.
Do not set the MIRROR configuration parameter to 1 unless you are using
mirroring.
You can perform disk-layout operations from the primary database server only.
Thus, you can add or drop a mirror chunk only from the primary database server.
A mirror chunk that you add to or drop from the primary database server is added
to or dropped from the secondary database server as well. You must perform
mirror recovery for the newly added mirror chunk on the secondary database
server. For more information, see “Recovering a Mirror Chunk” on page 19-6.
When you drop a chunk from the primary database server, Dynamic Server
automatically drops the corresponding chunk on the secondary database server.
This applies to both primary and mirror chunks.
When you turn mirroring off for a dbspace on the primary database server,
Dynamic Server does not turn mirroring off for the corresponding dbspace on the
secondary database server. To turn off mirroring for a dbspace on the secondary
database server independent of the primary server, use onspaces -r. For more
information about turning off mirroring, see “Ending Mirroring” on page 19-7.
For information on changing the size and location of the physical log, refer to
Chapter 17, “Managing the Physical Log,” on page 17-1.
If you add a logical-log file to the primary database server, this file is available for
use and flagged F as soon as you perform the level-0 backup. The new logical-log
file on the secondary database server is still flagged A. However, this condition
does not prevent the secondary database server from writing to the file.
To enable the secondary database server to automatically replicate the index, either:
v Set onmode -d idxauto to on.
v Set the value of the DRIDXAUTO configuration parameter to 1.
Sometimes, you might want to replicate an index manually, for example, when you
want to postpone index repair because the table is locked. If you want to be able to
manually replicate an index on the HDR secondary server, turn off the automatic
replication feature.
For example:
In the case of a fragmented index with one corrupt fragment, the onmode -d
idxauto option only transfers the single affected fragment, whereas the onmode -d
index option transfers the whole index.
Note: When turning the automatic index replication feature on or off, you can use
either the onmode command or the DRIDXAUTO configuration parameter.
If you use the onmode command, you do not need to stop and restart the
database server. When you use the DRIDXAUTO parameter, the database
server is restarted with the setting you specify. The onmode command does
not change the DRIDXAUTO value. If you use the onmode command, you
must manually change the value of DRIDXAUTO.
The [Link] file produced by the secondary server contains information about
any replicated index.
Table 21-2 summarizes the effects of changing the mode of the primary database
server.
Table 21-3 summarizes the effects of changing the mode of the secondary database
server.
Table 21-3. Mode Changes on the Secondary Database Server
On the Secondary On the Primary To Restart HDR
Read-only offline Primary displays: Treat it as you would a failure of the secondary.
DR: Receive error. Follow the procedures in “Restarting If the
(onmode -k) Secondary Database Server Fails” on page 21-20.
HDR is turned off.
Note: Single-user mode operates the same way on an HDR secondary database
server as it does on the primary database server.
You can change the database server type from secondary to standard only if HDR
is turned off on the secondary database server. HDR is turned off when the data
replication connection to the primary database server breaks or data replication
fails on the secondary database server. When you take the standard database
server offline and bring it back online, it does not attempt to connect to the other
database server in the replication pair.
The following example shows a header for a database server that is the primary
database server in a replication pair, and in online mode:
IBM Informix Dynamic
Server Version 9.30.UC1 -- online(Prim) -- Up 45:08:57
This example shows a database server that is the secondary database server in a
replication pair, and in read-only mode.
IBM Informix Dynamic Server Version 9.30.UC1 -- Read-Only (Sec) -- Up 45:08:57
The following example shows a header for a database server that is not involved
in HDR. The type for this database server is standard.
IBM Informix Dynamic Server Version 9.30.UC1 -- online -- Up 20:10:57
onstat -g dri
To obtain full HDR monitoring information, execute the onstat -g dri option. The
following fields are displayed:
v The database server type (primary, secondary, or standard)
v The HDR state (on or off)
v The paired database server
v The last HDR checkpoint
v The values of the HDR configuration parameters
For an example of onstat -g dri output, see the IBM Informix Administrator's
Reference.
oncheck -pr
If your database server is running HDR, the reserved pages PAGE_1ARCH and
PAGE_2ARCH store the checkpoint information that HDR uses to synchronize the
Archive Level 0
Real Time Archive Began 01/11/95 16:54:07
Time Stamp Archive Began 11913
Logical Log Unique Id 3
Logical Log Position b018
Figure 21-1. oncheck -pr PAGE_1ARCH Output for Database Server Running HDR
onmode -s
onmode -d secondary prim_name
2. ON–Bar command
onbar -r -p
ontape command
ontape -p
3. onmode command
ontape -l
ontape -l
ON–Bar command
onbar -r -l
If you want to read the logical-log records over the network, set
the logical-log tape device to a device on the computer that is
running the secondary database server.
4. If you are prompted to recover logical-log records from tape,
perform this step.
ontape command
ontape -l
ON–Bar command
onbar -r -l
ontape command
% ontape -l
ON–Bar command
onbar -r -l
In This Chapter
Informix database servers are designed to detect database server malfunctions or
problems caused by hardware or operating-system errors. It detects problems by
performing assertions in many of its critical functions. An assertion is a consistency
check that verifies that the contents of a page, structure, or other entity match what
would otherwise be assumed.
When one of these checks finds that the contents are not what they should be, the
database server reports an assertion failure and writes text that describes the check
that failed in the database server message log. The database server also collects
further diagnostics information in a separate file that might be useful to IBM
Informix Technical Support staff.
Verifying Consistency
Because of the time needed for this check and the possible contention that the
check can cause, schedule this check for times when activity is at its lowest. You
should perform this check just before you create a level-0 backup.
Run the commands shown in Table 22-1 as part of the consistency check.
Table 22-1. Checking Data Consistency
Type of Validation Command
System catalog tables oncheck -cc
Data oncheck -cD dbname
Extents oncheck -ce
Indexes oncheck -cI dbname
Reserved pages oncheck -cr
Logical logs and reserved pages oncheck -cR
Metadata and smart large objects oncheck -cs
You can run each of these commands while the database server is in online mode.
For information about how each command locks objects as it checks them and which
users can perform validations, see oncheck in the IBM Informix Administrator's
Reference.
In most cases, if one or more of these validation procedures detects an error, the
solution is to restore the database from a dbspace backup. However, the source of
the error might also be your hardware or operating system.
Each database contains its own system catalog, which contains information about
the database tables, columns, indexes, views, constraints, stored procedures, and
privileges.
If a warning appears when validation completes, its only purpose is to alert you
that no records of a specific type were found. These warnings do not indicate any
problem with your data, your system catalog, or even your database design. This
warning indicates only that no synonym exists for any table; that is, the system
catalog contains no records in the table syssyntable. For example, the following
warning might appear if you validate system catalog tables for a database that has
no synonyms defined for any table:
WARNING: No syssyntable records found.
If data-page validation detects errors, try to unload the data from the specified
table, drop the table, re-create the table, and reload the data. For information about
loading and unloading data, see the IBM Informix Migration Guide. If this procedure
does not succeed, perform a data restore from a storage-space backup.
Validating Extents
To validate extents in every database, use the oncheck -ce command.
Extents must not overlap. If this command detects errors, perform a data restore
from a storage-space backup.
Validating Indexes
To validate indexes on each of the tables in the database, use the oncheck -cI
command.
If this command detects errors, drop and re-create the affected index.
Reserved pages are pages that reside at the beginning of the initial chunk of the
root dbspace. These pages contain the primary database server overhead
information. If this command detects errors, perform a data restore from
storage-space backup.
This command might provide warnings. In most cases, these warnings call your
attention to situations of which you are already aware.
Validating Metadata
Execute oncheck -cs for each database to validate metadata for all smart large
objects in a database. If necessary, restore the data from a dbspace backup.
UNIX Only
v [Link]
v [Link]
v /pathname/core
End of UNIX Only
In all cases, xxx is a hexadecimal number common to all files associated with the
assertion failures of a single thread. The files [Link], [Link], and [Link] are
in the directory that the ONCONFIG parameter DUMPDIR specifies.
The file [Link] contains a copy of the assertion-failure message that was sent to the
message log, as well as the contents of the current, relevant structures and data
buffers.
The file [Link] contains a complete copy of the database server shared
memory at the time of the assertion failure, but only if the ONCONFIG parameter
DUMPSHMEM is set to 1.
UNIX Only
On UNIX, [Link] contains a core dump of the database server virtual process on
which the thread was running at the time, but only if the ONCONFIG parameter
DUMPGCORE is set to 1 and your operating system supports the gcore utility. The
core file contains a core dump of the database server virtual process on which the
thread was running at the time, but only if the ONCONFIG parameter
DUMPCORE is set to 1. The pathname for the core file is the directory from which
the database server was last invoked.
End of UNIX Only
In many cases, the database server stops immediately when an assertion fails.
However, when failures appear to be specific to a table or smaller entity, the
database server continues to run.
When an assertion fails because of inconsistencies on a data page that the database
server accesses on behalf of a user, an error is also sent to the application process.
The SQL error depends on the operation in progress. However, the ISAM error is
almost always either -105 or -172, as follows:
-105 ISAM error: bad isam file format
-172 ISAM error: Unexpected internal error
If you check indexes while the database server is in online mode, oncheck detects
the corruption but does not prompt you for repairs. If corruption exists, you can
drop and re-create the indexes using SQL statements while you are in online mode
(the database server locks the table and index). If you run oncheck -cI in quiescent
mode and corruption is detected, you are prompted to confirm whether the utility
should attempt to repair the corruption.
If a chunk is down, the onstat -d display shows the chunk status as PD- for a
primary chunk and MD- for a mirror chunk. For an example of onstat -d output,
see the IBM Informix Administrator's Reference.
If the down chunk is mirrored, the database server continues to operate using the
mirror chunk. Use operating-system utilities to determine what is wrong with the
down chunk and correct the problem. You must then direct the database server to
restore mirror chunk data.
If the down chunk is not mirrored and contains logical-log files, the physical log,
or the root dbspace, the database server immediately initiates a stop action.
Otherwise, the database server can continue to operate but cannot write to or read
from the down chunk or any other chunks in the dbspace of that chunk. You must
take steps to determine why the I/O error occurred, correct the problem, and
restore the dbspace from a backup.
If you take the database server to offline mode when a chunk is marked as down
(D), you can restart the database server, provided that the chunk marked as down
does not contain critical data (logical-log files, the physical log, or the root
dbspace).
To determine the cause of the problem that triggered the assertion failure, it is
critically important that you not destroy diagnostic information until IBM Informix
Technical Support indicates that you can do so. The [Link] file often contains
information that they need to resolve the problem.
UNIX Only
v DUMPDIR
v DUMPSHMEM
v DUMPCNT
v DUMPCORE
v DUMPGCORE
End of UNIX Only
For more information about the configuration parameters, see the IBM Informix
Administrator's Reference.
Tip: A core dump is an image of a process in memory at the time that the assertion
failed. On some systems, core dumps include a copy of shared memory. Core
dumps are useful only if this is the case.
A disabling I/O error is nondestructive when the error does not threaten the
integrity of your data. Nondestructive errors occur when someone accidentally
disconnects a cable, you somehow erase the symbolic link that you set up to point
to a chunk, or a disk controller becomes damaged.
Before the database server considers an I/O error to be disabling, the error must
meet two criteria. First, the error must occur when the database server attempts to
perform an operation on a chunk that has at least one of the following
characteristics:
v The chunk has no mirror.
v The primary or mirror companion of the chunk under question is offline.
Second, the error must occur when the database server attempts unsuccessfully to
perform one of the following operations:
v Seek, read, or write on a chunk
v Open a chunk
v Verify that chunk information on the first used page is valid
The database server performs this verification as a sanity check immediately
after it opens a chunk.
You can prevent the database server from marking a dbspace as down while you
investigate disabling I/O errors. If you find that the problem is trivial, such as a
loose cable, you can bring the database server offline and then online again
without restoring the affected dbspace from backup. If you find that the problem is
more serious, such as a damaged disk, you can use onmode -O to mark the
affected dbspace as down and continue processing.
ONDBSPACEDOWN
Setting Result Action
0 Dbspace {space_name} is Restore dbspace {space_name}.
disabled.
Blobspace {space_name} is Restore blobspace {space_name}.
disabled.
1 The database server must stop. Shut down and restart the
database server.
2 The database server blocks at Use onmode -k to shut down, or
next checkpoint. use onmode -O to override.
For more information about interpreting messages that the database server sends
to the message log, see the chapter about message-log messages in the IBM
Informix Administrator's Reference.
If you want the database server to use event alarms to notify you about disabling
I/O errors, write a script that the database server executes when it detects a
disabling I/O error. For information about how to set up this executable file that
you write, see the appendix on event alarms and the chapter on configuration
parameters in the IBM Informix Administrator's Reference.
The database server cannot take any action to identify the bad cylinder, track, or
sector location because the only information available is the byte displacement
within the chunk where the I/O operation was attempted.
If the database server detects an I/O error on a chunk that is not mirrored, it
marks the chunk as down. If the down chunk contains logical-log files, the
physical log, or the root dbspace, the database server immediately initiates a stop
action. Otherwise, the database server can continue to operate, but applications
cannot access the down chunk until its dbspace is restored.
In This Chapter
A two-phase commit protocol ensures that transactions are uniformly committed or
rolled back across multiple database servers. You can use Informix database servers
with IBM Informix Enterprise Gateway products or transaction managers to
manipulate data in non-Informix databases. Distributed queries across Informix
database servers support two-phase commit.
The heterogeneous commit protocol ensures that updates to one or more Informix
databases and one non-Informix database in a single transaction are uniformly
committed or rolled back.
This chapter contains information on the use of the two-phase commit protocol.
For information on recovering manually from a failed two-phase commit
transaction, see Chapter 24, “Recovering Manually from Failed Two-Phase
Commit,” on page 24-1.
Transaction Managers
Transaction managers support two-phase commit and roll back. For example, if
your database is Informix, your accounting system is Oracle, and your remittance
system is Sybase, you can use a transaction manager to communicate between the
different databases. You also can use transaction managers to ensure data
consistency between Informix or non-Informix databases by using distributed
transactions instead of Enterprise Replication or High-Availability Data Replication.
TP/XA is a library of functions that lets the database server act as a resource
manager in the X/Open DTP environment. Install the TP/XA library as part of
IBM Informix ESQL/C to enable communication between a third-party transaction
manager and the database server. The X/Open environment supports large-scale,
high-performance OLTP applications. For more information, see the IBM Informix
TP/XA Programmer's Manual.
3 The transaction manager invokes support routines for each XA-compliant, external
3 data source that participates in a distributed transaction at a particular
3 transactional event, such as prepare, commit, or rollback. This interaction conforms
3 to X/Open XA interface standards.
3 Transaction support for XA-compliant, external data sources, which are also called
3 resource managers, enables you to:
3 v Create XA-compliant, external data source types and instances of XA-compliant,
3 external data sources.
3 v Create or modify a user-defined routine (UDR), virtual table interface, or virtual
3 index interface to enable XA-compliant data sources to provide data access
3 mechanisms for external data from XA-compliant data sources.
3 The MQ DataBlade Module is an example of a set of UDRs that provide this
3 type of external data access.
3 v Register XA-compliant, external data sources with Dynamic Server.
3 v Unregister XA-compliant, external data sources.
3 v Use multiple XA-compliant, external data sources within the same global
3 transaction.
3 You can use the following DDL statements, which are extensions to SQL statements
3 to manage XA data source types and data sources:
3
3 Statement Description
3 CREATE XADATASOURCE TYPE Creates a type of XA-compliant, external data source
3 CREATE XADATASOURCE Creates an instance of an XA-compliant, external
3 data source
3 DROP XADATASOURCE Deletes an instance of an XA-compliant, external
3 data source
3 DROP XADATASOURCE TYPE Deletes a type of XA-compliant, external data source
3
3 For more information on these statements, see the IBM Informix Guide to SQL:
3 Syntax.
3 After you create an external XA-compliant data source, you can register the data
3 source to a current transaction and you can unregister the data source using the
3 mi_xa_register_xadatasource() or ax_reg() and mi_xa_unregister_xadatasource() or
3 ax_unreg() functions. In a distributed environment, you must register a data source
3 at the local, coordinator server. Registration is transient, lasting only for the
3 duration of the transaction. For more information on using these functions, see the
3 IBM Informix DataBlade API Function Reference and the IBM Informix DataBlade API
3 Programmer's Guide.
3 The IBM Informix MQ DataBlade provides external data access mechanisms for XA
3 data sources. For information on this DataBlade Module, see the IBM Informix
3 Built-In DataBlade Modules User's Guide.
Windows Only
The MTS/XA Transaction Manager, which operates only on Windows, supports the
tightly-coupled mode. MTS tightly-coupled transaction support on the database
server includes:
v Support for application programs with two tiers (a business-logic layer and a
data-access layer).
v Connection pooling and session pooling.
If any database server is unable to commit its portion of the transaction, all
database servers participating in the transaction must be prevented from
committing their work.
For example, suppose three database servers that have the names australia, italy,
and france, are connected, as shown in Figure 23-1.
italy
france australia
If you execute the commands shown in Figure 23-2, the result is one update and
two inserts at three different database servers.
CONNECT TO stores_demo@italy
BEGIN WORK
UPDATE stores_demo:manufact SET manu_code = ’SHM’ WHERE manu_name = ’Shimara’
INSERT INTO stores_demo@france:manufact VALUES (’SHM’, ’Shimara’, ’30’)
INSERT INTO stores_demo@australia:manufact VALUES (’SHM’, ’Shimara’, ’30’)
COMMIT WORK
Precommit Phase
During the precommit phase, the coordinator and participants perform the
following dialog:
1. Coordinator. The coordinator directs each participant database server to
prepare to commit the transaction.
2. Participants. Every participant notifies the coordinator whether it can commit
its transaction branch.
3. Coordinator. The coordinator, based on the response from each participant,
decides whether to commit or roll back the transaction. It decides to commit
only if all participants indicate that they can commit their transaction branches.
Postdecision Phase
During the postdecision phase, the coordinator and participants perform the
following dialog:
1. Coordinator: The coordinator writes the commit record or rollback record to
the coordinator’s logical log and then directs each participant database server
to either commit or roll back the transaction.
2. Participants: If the coordinator issued a commit message, the participants
commit the transaction by writing the commit record to the logical log and then
sending a message to the coordinator acknowledging that the transaction was
committed. If the coordinator issued a rollback message, the participants roll
back the transaction but do not send an acknowledgment to the coordinator.
3. Coordinator: If the coordinator issued a message to commit the transaction, it
waits to receive acknowledgment from each participant before it ends the
global transaction. If the coordinator issued a message to roll back the
transaction, it does not wait for acknowledgments from the participants.
Important: A slow network cannot, and should not, trigger automatic recovery.
None of the recovery mechanisms described here go into effect unless a
coordinator system fails, a network fails, or the administrator
terminates the coordinating thread.
Presumed-End Optimization
Presumed-end optimization is a term that describes how the two-phase commit
protocol handles the rollback of a transaction.
Independent Actions
An independent action in the context of two-phase commit is an action that occurs
independently of the two-phase commit protocol. Independent actions might or
might not be in opposition to the actions that the two-phase commit protocol
specifies. If the action is in opposition to the two-phase commit protocol, the action
results in an error or a heuristic decision. Heuristic decisions can result in an
inconsistent database and require manual two-phase commit recovery. Manual
recovery is an extremely complicated administrative procedure that you should try
to avoid. (For a discussion of the manual-recovery process, see Chapter 24,
“Recovering Manually from Failed Two-Phase Commit,” on page 24-1.)
If the action is not in opposition to the two-phase protocol, the transaction should
either commit or roll back normally. If the action ends the global transaction
prematurely, an error condition results. Ending the global transaction at the
coordinator is not considered a heuristic decision. If the action is in opposition to
the two-phase commit protocol, a heuristic decision results. All these situations are
discussed in the sections that follow.
This action is not considered a heuristic decision because it does not interfere with
the two-phase protocol; it is either acceptable, or it interferes with participant
recovery and causes an error.
The action is acceptable any time that all participants are able to commit the
transaction without difficulty. In this case, your action to end the transaction
forcibly is superfluous. The indication that you executed onmode -Z reaches the
coordinator only when the coordinator is preparing to terminate the transaction.
When both conditions are true, the net result is a global transaction that is
inconsistently implemented (committed by one or more database servers and rolled
back by another). The database becomes inconsistent.
After a heuristic rollback or end transaction occurs, you might have to perform
manual recovery, a complex and time-consuming process. You need to understand
heuristic decisions fully in order to avoid them. Always be wary of executing
onmode -z or onmode -Z within the context of two-phase commit.
In either case, if the piece of work has already sent a can commit message to its
coordinator, the action is considered a heuristic decision.
Under two-phase commit, the logical-log files that contain records associated with
the piece of work are considered open until an ENDTRANS logical-log record is
written. This type of transaction differs from a transaction involving a single
database server where a rollback actually closes the transaction.
The logical log might continue to fill until the exclusive high-watermark is reached
(LTXEHWM). If this happens, all user threads are suspended except those that are
currently rolling back or currently committing. In the two-phase commit scenario,
the open transaction prevents you from backing up the logical-log files and freeing
space in the logical log. Under these specific circumstances, the logical log can fill
completely. If this happens, the participant database server shuts down, and you
must perform a data restore.
In this situation, examine the logical log at each participant database server site
and determine whether your database system is consistent. (See “Determining If a
Transaction Was Implemented Inconsistently” on page 24-1.)
If the coordinator contacts the participant and directs it to end the transaction in a
reasonable period of time, no problem develops. The serious problem arises if the
heuristic rollback occurs at a participant database server and subsequently the
coordinator fails, preventing the coordinator from directing the participant to end
the transaction.
You must decide whether to end the transaction and protect your system against
the possibility of filling the logical log, despite all the problems associated with
executing onmode -Z, or to wait and see if communication with the coordinator
can be reestablished in time to end the transaction before the logical log fills.
The address parameter is obtained from onstat -x output. For more information on
the onstat -x option, see the IBM Informix Administrator's Reference.
Two records are written in the logical log to document the action. The records are
type ROLLBACK and ENDTRANS, or if the transaction was already heuristically
rolled back, ENDTRANS only. The following message is written to the participant
database server message log:
The coordinator receives an error message from the participant where the onmode
-Z occurred, in response to its COMMIT instruction. The coordinator queries the
participant database server, which no longer has information about the transaction.
The lack of a transaction-table entry at the participant database server indicates
that the transaction committed. The coordinator assumes that the acknowledgment
message was sent from the participant, but somehow it was not received. Because
the coordinator does not know that this participant’s piece of work did not commit,
it does not generate messages indicating that the global transaction was
inconsistently implemented. Only the administrator who executed the onmode -Z
command is aware of the inconsistent implementation.
For example, in the output, an H flag in the flags field identifies a heuristic
rollback, the G flag identifies a global transaction, the L flag indicates
loosely-coupled mode, and the T flag indicates tightly-coupled mode.
The curlog and logposit fields provide the exact position of a logical-log record. If
a transaction is not rolling back, curlog and logposit describe the position of the
most recently written log record. When a transaction is rolling back, these fields
describe the position of the most recently “undone” log record. As the transaction
rolls back, the curlog and logposit values decrease. In a long transaction, the rate
at which the logposit and beginlg values converge can help you estimate how
much longer the rollback is going to take.
For more information on and an example of onstat -x output, see the IBM Informix
Administrator's Reference.
You also can use the onstat -u and onstat -k commands to track transactions and
the locks that they hold. For details, see the monitoring transactions section in your
IBM Informix Performance Guide. For a description of the fields that onstat -x
displays, see the IBM Informix Administrator's Reference.
For information about these logical-log records, see the chapter on interpreting the
logical log in the IBM Informix Administrator's Reference.
This section examines the sequence of logical-log records that are written during
the following database server scenarios:
v A transaction is committed.
v A piece of work is heuristically rolled back.
v A piece of work is heuristically ended.
Coordinator:
C Writes log record: BEGPREP.
Sends message: precommit.
All participants:
P1 P2 P3 Write log record: TABLOCKS.
Write and flush log record: PREPARE.
Send message: can commit.
Coordinator:
C Writes log record: COMMIT.
Flushes logical-log buffer.
Sends message: commit
All participants:
P1 P2 P3 Writes log record: COMMIT.
Flushes logical-log buffer.
Send message: committed.
Coordinator:
C Writes log record: ENDTRANS.
End protocol
Some of the logical-log records must be flushed from the logical-log buffer
immediately; for others, flushing is not critical.
The participants in Figure 23-3 on page 23-16 must immediately flush both the
PREPARE and the COMMIT logical-log records. Flushing the PREPARE record
ensures that, if the participant’s host computer fails, fast recovery is able to
determine that this participant is part of a global transaction. As part of recovery,
the participant might query the coordinator to learn the final disposition of this
transaction.
Flushing the participant’s COMMIT record ensures that, if the participant’s host
computer fails, the participant has a record of what action it took regarding the
transaction. To understand why this information is crucial, consider the situation in
which a participant crashes after the PREPARE record is written but before the
COMMIT record flushes. After fast recovery, the PREPARE record is restored, but
Coordinator:
C Writes log record: BEGPREP.
Sends message: precommit.
All Participants:
P1 P2 P3 Write log record: TABLOCKS.
Write log record: PREPARE.
Flush logical log.
Send message: commit ok.
Within P1 participant’s environment:
The database server detects long
transaction condition. Rollback starts.
Writes log record: HEURTX.
Writes log record: ROLLBACK.
Message written in message log.
Coordinator:
C Writes log record: COMMIT.
Flushes log record.
Sends message: commit.
P1 P2 P3 Participant 1:
Sends message: Transaction heuristically rolled back. Cannot commit.
Participants 2 and 3:
Write and flush log record: COMMIT.
Send message: committed.
Coordinator:
C Writes message in message log (-698).
Sends message to Participant 1: end-transaction.
Participant 1:
P1 P2 P3 Writes log record: ENDTRANS.
Sends message: Transaction ended.
Coordinator:
C Writes log record: ENDTRANS.
Returns error message to user: Error -698.
End protocol
Coordinator:
C Writes log record: BEGPREP.
Sends message: precommit.
All participants:
P1 P2 P3 Write log record: TABLOCKS.
Write and flush log record: PREPARE.
Send message: can commit.
P1 participant’s environment:
Transaction is killed.
Writes log record: ROLLBACK.
Writes log record: ENDTRANS.
Message is written in the database server message log.
Coordinator:
C Writes log record: COMMIT.
Flushes logical-log buffer.
Sends message: commit.
Participant 1:
P1 P2 P3
Returns error message.
Participants 2 and 3:
Write log record: COMMIT.
Flush logical-log buffer.
Send message: committed.
Coordinator:
C Receives error message from P1.
Establishes new connection to P1 and sends TX Inquire message to P1.
Participant 1:
P1 P2 P3 Sends transaction status unknown message back to the coordinator.
Coordinator:
C Assumes unknown status means committed.
Writes log record: ENDTRANS.
End protocol
Although both parameters specify time-out periods, the two are independent. For
more information on these configuration parameters, see the IBM Informix
Administrator's Reference.
TXTIMEOUT is specified in seconds. The default value is 300 (five minutes). The
optimal value for this parameter varies, depending on your specific environment
and application. Before you modify this parameter, read the discussion “How the
Two-Phase Commit Protocol Handles Failures” on page 23-7.
The database server uses heterogeneous commit protocol when the following
criteria are met:
v Heterogeneous commit is enabled. (That is, the HETERO_COMMIT
configuration parameter is set to 1.)
v The coordinator of the commit is a Version 7.2 or later IBM Informix Dynamic
Server.
v The non-Informix participant communicates with the Informix database server
through an Informix gateway.
v At most, one non-Informix participant performs an update within a single
transaction.
Database server
Database server
Figure 23-6. Configuration That Requires Heterogeneous Commit for Distributed Transactions
The following table lists the gateways and corresponding database servers that can
participate in a transaction in which the database server uses the heterogeneous
commit protocol.
Table 23-1. Gateways and corresponding database servers/heterogeneous commit
transaction
Gateway Database Servers
IBM Informix Enterprise Gateway with DRDA IBM DB2, OS/400, SQL/DS
IBM Informix Enterprise Gateway for EDA/SQL EDA/SQL
IBM Informix Enterprise Gateway Manager Any database server with ODBC
connectivity
The following sections explain the modification to the precommit phase and the
gateway commit phase. For a detailed explanation of the postdecision phases, see
“Postdecision Phase” on page 23-7.
Precommit Phase
The coordinator directs each update participant (except the gateway participant) to
prepare to commit the transaction.
If the updates satisfy all deferred constraints, all participants (except the gateway
participant) return messages to the coordinator indicating that they can commit
their piece of work.
Coordinator
C
Sends a commit message to the gateway participant.
Gateway
Gateway Participant:
GP Commits the work. Returns message: committed.
Gateway
Coordinator
C Receives gateway committed message.
If the gateway fails to commit the transaction, the coordinator rolls back the entire
transaction, as Figure 23-7 illustrates.
If the coordinator fails after it writes the commit log record, the entire transaction
is committed successfully upon recovery, as is the case with two-phase commit.
If the coordinator fails after it sends the commit message to the gateway but before
it writes the commit log record, the remote Informix database server sites in the
transaction are stopped upon recovery. This can result in inconsistencies if the
gateway received the commit message and committed the transaction.
Participant Failure
Whenever a participant in a distributed transaction that uses the heterogeneous
protocol fails, the coordinator sends the following error message:
-441 Possible inconsistent data at the target DBMS name due to an
aborted commit.
In addition, the database server sends the following message to the message log:
Data source accessed using gateway name might be in an inconsistent state.
The recovery procedure that the database server follows when a participant fails is
identical to the procedure that is followed in two-phase commit. For more
information on this procedure, see “Participant Failure” on page 23-24.
If you receive this error message, rewrite the offending application so that it
updates at most one gateway participant in a single distributed transaction.
When such a failure occurs, the coordinator returns the following message:
-441 Possible inconsistent data at the target DBMS name due to
an aborted commit.
After the database server sends this message, it rolls back all update sites that are
participating in the transaction, with the possible exception of the work done at the
site of the gateway participant. The gateway participant might have committed its
updates if the failure occurred after the gateway participant processed the commit
message. If the gateway participant committed the updates, you must manually
rollback these updates.
In This Chapter
Distributed transactions follow the two-phase commit protocol. Certain actions
occur independently of the two-phase commit protocol and cause the transaction
to be inconsistently implemented. (See “Independent Actions” on page 23-8.) In
these situations, it might be necessary to recover manually from the transaction.
Heuristic Rollback
You can determine the specific database server participants affected by a heuristic
decision to roll back a transaction in the following ways:
v Examine the return code from the COMMIT WORK statement in the application.
The following message indicates that one of the participants performed a
heuristic rollback:
-698 Inconsistent transaction. Number and names of servers rolled back.
v Examine the messages in the database server message-log file.
If a database inconsistency is possible because of a heuristic decision at a
participating database server, the following message appears in the database
server message-log file of the coordinator:
Mixed transaction result. (pid=nn user=user_id)
This message is written whenever error -698 is returned. Associated with this
message is a list of the participant database servers where the transaction was
rolled back. This is the complete list. The list that appears with the -698 error
message could be truncated if a large number of participants rolled back the
transaction.
v Examine the logical log for each participant.
If at least one participant rolls back its piece of work and one participant
commits its piece of work, the transaction is implemented incorrectly.
Before you proceed, consider the transaction that caused the error. Are the pieces
of data that were updated and rolled back dependent on one another? Multiple
updates might be included in a single transaction for reasons other than
maintaining data integrity. For example, three possible reasons are as follows:
v Reduced transaction overhead
v Simplified coding
Verify also that every participant database server that is assumed to have
committed the transaction actually modified data. A read-only database server
might be listed as a participant that committed a transaction.
If an inconsistent transaction does not lead to a violation of data integrity, you can
quit the procedure at this point.
After you follow this procedure, you know what all the participants for the
transaction were, which pieces of work were assigned to each participant, and
whether each piece of work was rolled back or committed. From this information,
you can determine if the independent action affected data integrity.
The first 32 bytes of the GTRID are identical for the BEGPREP record on the
coordinator and the PREPARE records on participants, which are part of the same
global transaction. For example, compare the GTRID for the PREPARE record in
Figure 24-2 with that of the BEGPREP record in Figure 24-1.
You can leave the database in its inconsistent state if the transaction does not
significantly affect database data. You might encounter this situation if the
application that is performing the transaction can continue as it is, and you decide
that the price (in time and effort) of returning the database to a consistent state by
either removing the effects or reapplying the transaction is too high.
You do not have to reach this decision immediately. You can use the methods
described in the following paragraphs to determine what data the transaction was
updating and which records are affected.
As you make your decision, consider that no automatic process or utility can
perform a rollback of a committed transaction or can commit part of a transaction
The following excerpt is taken from the logical log at the current database server:
addr len type xid id link
.....
17018 16 CKPOINT 0 0 13018 0
1 2 1 1802c nhowe
The following excerpt is taken from the logical log at the database server apex:
addr len type xid id link
.....
16018 20 BEGIN 2 1 0 08/27/91
10:57:07 3483 pault
First, you would try to match the transactions in the current database server log
with the transactions in the apex database server log. The BEGPREP and PREPARE
log records each contain the GTRID. You can extract the GTRID by using onlog -l
and looking at the data portion of the BEGPREP and PREPARE log records. The
GTRID is offset 22 bytes into the data portion and is 68 bytes long. A more simple,
though less precise, approach is to look at the time of the COMMIT or ROLLBACK
records. The times should be close, although there is a slight delay because of the
time taken to transmit the commit (or rollback) message from the coordinator to
the participant. (This second approach lacks precision because concurrent
transactions could commit at the same time although concurrent transactions from
one coordinator would probably not commit at the same time.)
In this example, the time stamps on the COMMIT and ROLLBACK records in the
different logs are close. No other active transactions introduce the possibility of
another concurrent commit or rollback. In this case, an insert (HINSERT) of
assigned rowid 102 hex (258 decimal) was committed on the current database
server. Therefore, the compensating transaction is as follows:
DELETE FROM t WHERE rowid = 258
Each line starts with a dotted decimal number; for example, 3 or 3.1 or 3.1.1. To
hear these numbers correctly, make sure that your screen reader is set to read
punctuation. All syntax elements that have the same dotted decimal number (for
example, all syntax elements that have the number 3.1) are mutually exclusive
alternatives. If you hear the lines 3.1 USERID and 3.1 SYSTEMID, your syntax can
include either USERID or SYSTEMID, but not both.
The dotted decimal numbering level denotes the level of nesting. For example, if a
syntax element with dotted decimal number 3 is followed by a series of syntax
elements with dotted decimal number 3.1, all the syntax elements numbered 3.1
are subordinate to the syntax element numbered 3.
Certain words and symbols are used next to the dotted decimal numbers to add
information about the syntax elements. Occasionally, these words and symbols
might occur at the beginning of the element itself. For ease of identification, if the
word or symbol is a part of the syntax element, the word or symbol is preceded by
the backslash (\) character. The * symbol can be used next to a dotted decimal
number to indicate that the syntax element repeats. For example, syntax element
*FILE with dotted decimal number 3 is read as 3 \* FILE. Format 3* FILE
indicates that syntax element FILE repeats. Format 3* \* FILE indicates that
syntax element * FILE repeats.
The following words and symbols are used next to the dotted decimal numbers:
? Specifies an optional syntax element. A dotted decimal number followed
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
All statements regarding IBM’s future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
All IBM prices shown are IBM’s suggested retail prices, are current and are subject
to change without notice. Dealer prices may vary.
This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
If you are viewing this information softcopy, the photographs and color
illustrations may not appear.
Trademarks
AIX; DB2; DB2 Universal Database; Distributed Relational Database Architecture;
NUMA-Q; OS/2, OS/390, and OS/400; IBM Informix®; C-ISAM®;
Foundation.2000™; IBM Informix ® 4GL; IBM Informix®DataBlade®Module; Client
SDK™; Cloudscape™; Cloudsync™; IBM Informix®Connect; IBM Informix®Driver
for JDBC; Dynamic Connect™; IBM Informix®Dynamic Scalable
Architecture™(DSA); IBM Informix®Dynamic Server™; IBM Informix®Enterprise
Gateway Manager (Enterprise Gateway Manager); IBM Informix®Extended Parallel
Server™; [Link] Services™; J/Foundation™; MaxConnect™; Object Translator™;
Red Brick™; IBM Informix® SE; IBM Informix® SQL; InformiXML™; RedBack®;
SystemBuilder™; U2™; UniData®; UniVerse®; wintegrate®are trademarks or
registered trademarks of International Business Machines Corporation.
Java and all Java-based trademarks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and other countries.
Windows, Windows NT, and Excel are either registered trademarks or trademarks
of Microsoft Corporation in the United States and/or other countries.
UNIX is a registered trademark in the United States and other countries licensed
exclusively through X/Open Company Limited.
Other company, product, and service names used in this publication may be
trademarks or service marks of others.
Notices B-3
B-4 IBM Informix Dynamic Server Administrator’s Guide
Index
Special characters ALL keyword
DATASKIP 11-31
/etc/hosts file 20-17 ALLOCATE COLLECTION statement 12-5
/etc/services file 20-17 ALLOCATE DESCRIPTOR statement 12-5
/userva=xxxx switch 1-4 ALLOCATE ROW statement 12-5
.informix file 1-8 Allocating disk space
.rhosts file 3-12 cooked file space 11-4
(*), asterisk extent 10-8
See also Wildcard. initial chunk 11-6
wildcard in hostname field 3-26 metadata 11-23
$INFORMIXDIR mirrored data 19-2
permissions 5-2 overview 1-6
procedure 11-3
sbspaces 10-19
Numerics shared memory 1-4
32-bit platform UNIX
and buffer pool 11-14 cooked files 11-4
32-bit system support 1-4 raw files 11-5
64-bit addressing Windows
buffer pool 8-11 logical drive 11-6
database server support 1-4 NTFS files 11-6
defined 8-32 physical drive 11-7
maximum number of buffers 8-11 ALRM_ALL_EVENTS configuration parameter 2-9
memory use 8-32 ALTER ACCESS_METHOD statement 12-4
64-bit platform ALTER FRAGMENT statement 12-4
and buffer pool 11-14 ALTER FUNCTION statement 12-4
ALTER INDEX statement 12-4
ALTER PROCEDURE statement 12-4
A ALTER ROUTINE statement 12-4
ALTER SEQUENCE statement 12-4
Accessibility xxxi ALTER TABLE statement 12-4
dotted decimal format of syntax diagrams A-1 changing table type 10-24, 10-25
syntax diagrams, reading in a screen reader A-1 connecting to clients 3-29
Adding logging 12-4
virtual processors 6-10 ANSI-compliant database
ADM. changing logging mode 13-3
See Administration virtual processor class. ondblog utility 13-3
Administration virtual processor class 6-11 ontape utility 13-4
Administrative tasks ANSI-compliant transaction logging.
assigning storage 10-9 See Logging.
consistency checking 22-2 Apache server 4-9
routine tasks 1-17 Application
ADT. client.
See Audit virtual processor. See Client application.
ADTERR configuration parameter 2-10 archecker utility
ADTMODE configuration parameter 2-10, 6-26 overview 1-17
ADTPATH configuration parameter 2-10 Assertion failure
ADTSIZE configuration parameter 2-10 data corruption 22-5
Advanced Encryption Standard 5-9, 5-14 defined 22-1
Advanced User Rights 1-24 determining cause 22-6
AES. during consistency checking 22-3
See Advanced Encryption Standard. during processing of user request 22-4
AFF_NPROCS configuration parameter 7-2 message log format 22-3
AFF_SPROC configuration parameter 6-13, 7-2 Assertion failure file
Aggregate [Link] 22-4
parallel processing 6-6 [Link] 22-4
AIO list 22-4
virtual processors 6-20 [Link] 22-4
ALARMPROGRAM configuration parameter 1-21, 2-9 Asterisk (*)
Aliases. See also Wildcard.
See DBSERVERALIASES. wildcard in hostname field 3-26
Index X-3
Chunks (continued) Client/server (continued)
name, when allocated as raw device 10-4 configuration example (continued)
recovering a down chunk 19-4 using IPX/SPX 3-33
saving status on secondary server 21-11 CLOB data type.
specifying metadata area 11-24 See Smart large object.
supporting a large 1-16 CLOSE DATABASE statement 12-4
supporting large 1-16 CLOSE statement 12-5
table, defined 8-16 Code, sample, conventions for xxvii
write Command-line conventions
checkpoints 8-28 how to read xxvi
monitoring 9-11 sample diagram xxvi
Cipher Commit
AES 5-12, 5-14 heterogeneous 23-20, 23-22
Blowfish 5-14 Commit protocol
defined 5-8 heterogeneous 23-2
DES 5-12, 5-14 two-phase 23-2, 23-5
in encryption 5-14 COMMIT statement 12-4, 12-5
supported types 5-12, 5-14 Communication configuration file.
Cipher tab 5-17 See ONCONFIG configuration file.
CKPTINTVL configuration parameter Communication Support Module 5-9
defined 2-5 [Link] entry 5-12, 5-19
initiating checkpoints 16-9 configuration file 3-8, 5-10
Classes network security 3-8
virtual processor 6-3 sqlhosts option field 3-22
CLASSPATH environment variable 1-7, 1-9 Communication support services
CLEANERS configuration parameter 2-6 defined 3-8
purpose 8-16 message confidentiality and integrity 3-8
Client application Communications
attaching to shared memory 8-6 client to database server.
beginning a session 8-18 See Connectivity.
configuring connectivity 1-9, 1-15, 3-8 shared memory
configuring environment 1-8 defined 8-20
configuring stack size 8-18 how client attaches 8-6
connecting to a host 3-13 size 8-20
connecting to primary or secondary server 20-3 Communications Support Module
connection type field 3-16 virtual processor 6-25
connections supported 3-5 Compliance
defined 3-2 with industry standards xxxiii
global transaction 23-2 [Link] file 5-10
host name field 3-18 building SMI tables 5-12
local-loopback connection 3-7 entry for network data encryption 5-19
multiplexed connections 3-4 entry for password encryption 5-12
network security files 3-11 location 5-10
ONCONFIG environment variable 1-7 Concurrency
options field 3-20 control 8-20
reacting to HDR failure 20-11 Confidentiality of communication messages 3-8
redirecting in data replication 20-12, 20-14 Configuration
remote hosts 3-11 database server environment 1-2
shared-memory connection 3-6 estimating required disk space 10-33
specifying a dbservername 3-29 J/Foundation 1-13
sqlhosts entries 3-13, 3-15, 3-26 monitoring 2-11
using data replication 20-3 multiple ports 3-10
wildcard addressing 3-28 planning for the database server 1-3
Windows network domains 3-3 requirements 1-2
CLIENT_LOCALE environment variable 1-8 using Server Setup 1-12
Client/server Windows 1-4
configuration Configuration file
listen and poll threads 6-22 avoid modifying [Link] 1-11
local loopback 3-7 connectivity 3-8
shared memory 3-6 network 1-10
configuration example [Link] 1-11
local loopback 3-32 Configuration parameters
multiple connection types 3-34 See also Individual parameter names.
multiple database servers 3-35 ADTERR 2-10
multiple residency 3-35 ADTMODE 2-10
network connection 3-33 ADTPATH 2-10
shared memory 3-31 ADTSIZE 2-10
Index X-5
Connectivity CPU virtual processor (continued)
ASF 3-4 DataBlade modules 6-13
configuration parameters 3-29 defined 6-12
files, defined 3-8 how many 6-12
hosts file 3-10 multiprocessor computer 6-13
services file 3-10 poll threads 6-21, 6-22
sqlhosts file 1-10 restrictions 6-16
Windows 1-10 single-processor computer 6-13
Consistency checking threads 6-2
corruption of data 22-5 types of threads run by 6-12
data and overhead 22-2 user-defined routine 6-13
extents 22-3 CREATE ACCESS_METHOD statement 12-4
index corruption 22-5 CREATE AGGREGATE statement 12-4
indexes 22-3 CREATE CAST statement 12-4
logical logs 22-3 CREATE DATABASE statement 10-9, 12-4
monitoring for data inconsistency 22-3 CREATE DISTINCT TYPE statement 12-4
overview 1-18, 22-1 CREATE EXTERNAL TABLE statement 12-4
periodic tasks 22-2 CREATE FUNCTION FROM statement 12-4
sbspaces 10-19 CREATE FUNCTION statement 6-16, 12-4
system catalog tables 22-2 CREATE INDEX statement 12-4
validating metadata 22-3 CREATE OPAQUE TYPE statement 12-4
Console CREATE OPCLASS statement 12-4
messages 1-23 CREATE PROCEDURE FROM statement 12-4
CONSOLE configuration parameter 1-23, 2-5 CREATE PROCEDURE statement 12-4
Constraints CREATE ROLE statement 5-6, 12-4
checking, deferred 12-2 CREATE ROUTINE FROM statement 12-4
Contact information xxxiii CREATE ROUTINE statement 12-4
Contention. CREATE ROW TYPE statement 12-4
See Disk contention. CREATE SCHEMA statement 12-4
Context switching CREATE SEQUENCE statement 12-4
defined 6-8 CREATE SYNONYM statement 12-4
how functions when OS controls 6-6 CREATE TABLE statement 12-4
OS versus multithreaded 6-6 connecting to clients 3-29
Contiguous fragmenting
space for physical log 17-2 with partitions 11-18
Control structures IN dbspace option 10-9
defined 6-8 logging 12-4
queues 6-10 specifying sbspaces in a PUT clause 10-14
session control block 6-8 CREATE Temporary TABLE statement 12-4
stacks 6-9 CREATE TRIGGER statement 12-4
thread control block 6-8 CREATE VIEW statement 12-4
Conventions CREATE XADATASOURCE statement 12-4
command-line xxvi CREATE XADATASOURCE TYPE statement 12-4
documentation xxiii Creating
sample-code xxvii blobspaces 11-20
syntax diagrams xxiv dbspaces 11-8
syntax notation xxiv sbspaces 11-22
typographical xxiv smart large objects 10-14, 11-23
Conversion, during initialization 4-5 tables with CLOB or BLOB data types 10-19
Cooked file space temporary dbspaces 11-15
allocating 11-4 Critical dbspaces
compared with raw space 10-4 mirroring 10-34, 10-37
defined 1-6, 10-4 storage 10-9
for static data 10-4 Critical section of code
Coordinating database server 23-6 checkpoints 16-10
Core dump defined 16-2
See also DUMPCNT; DUMPDIR; DUMPGCORE; cron
DUMPSHMEM. utility 1-23
contents of [Link] 22-4 CSM.
when useful 22-7 See Communication Support Module.
core file 22-4 curlog field 23-14
Corruption, resolving I/O errors 22-5
CPU virtual processor
adding and dropping in online mode 6-14, 6-17
AFF_SPROC configuration parameter 6-13
D
Data
AFFNPROCS configuration parameter 6-13
estimating disk space for 10-33
binding 6-7
transmission encryption 5-9
Index X-7
DATASKIP configuration parameter (continued) DDL.
defined 11-29 See Data definition language.
DB_LIBRARY_PATH configuration parameter 2-10, 5-32 DEADLOCK_TIMEOUT configuration parameter 2-8, 23-20
DB_LOCALE environment variable 1-8 two-phase commit protocol 23-19
DBCREATE_PERMISSION configuration parameter 2-10, 5-6 DEALLOCATE COLLECTION statement 12-5
DBLANG environment variable 1-8 DEALLOCATE DESCRIPTOR statement 12-5
dbload utility 11-44 DEALLOCATE ROW statement 12-5
DBPATH environment variable Decision-support query
dbserver group 3-24 See also Parallel database query.
use in automatic redirection 20-14 DS_MAX_QUERIES configuration parameter 2-7
Dbserver group 3-22 DECLARE statement 12-5
DBSERVERALIASES configuration parameter 1-7, 2-2 DEF_TABLE_LOCKMODE configuration parameter 2-6, 8-13
defined 3-30 DEFAULT keyword
example 3-30 with SET DATASKIP 11-30
multiple connection types 3-34 Default locale xviii
sqlhosts file 3-16 Defaults
DBSERVERNAME configuration parameter 1-7, 2-2 configuration file 1-11, 4-4
associated protocol 6-21 role
defined 3-29 creating 5-6
sqlhosts file 3-16 granting privileges 5-6
syntax rules 3-16 using 5-6
virtual processor for poll thread 6-21 Deferred checking of constraints 12-2
[Link] file 1-9, 1-12 DELETE statements 12-4
dbspaces Deleting
adding log files 15-11
chunk 11-16 RAW tables 10-24
ISA, with 11-8 smart-large-object data 11-27, 11-28
mirrored chunk 19-6 STANDARD tables 10-24
backing up 11-8, 11-9 Denial-of-service flood attacks 5-7
creating 11-8, 11-11 Dependencies, software xviii
initial dbspace 10-11 DES.
temporary 11-15 See Data Encryption Standard.
using onspaces 11-9 DES3.
creating initial dbspace 1-16 See Triple Data Encryption Standard.
defined 10-9 DESCRIBE statement 12-5
dropping Device
chunk 11-25 character-special 10-4
ON-Monitor utility 11-28 NFS 10-3
onspaces 11-28 when offsets are needed 11-4
overview 11-27 Diagnostic information
link between logical and physical units of storage 10-9 collecting 22-6
mirroring if logical-log files included 18-4 disk space restraints 22-7
monitoring simple large objects 11-38 parameters to set 22-6
names 11-7 Diagnostic messages.
non-default page sizes in HDR environment 21-4 See Message log.
page size, specifying 11-12 Dictionary cache 8-19
purpose of 10-9 DIRECTIVES configuration parameter 2-9
renaming 11-17 Directories
restrictions, adding logs 15-10 NFS 10-3
restrictions, moving logs 15-12 Dirty buffer, defined 8-26
root 10-11 Dirty Read isolation level 20-21
root dbspace defined 10-11 Disabilities, visual
shared-memory table 8-16 reading syntax diagrams A-1
smart large objects 10-8 Disabling I/O error
specifying page size when creating 11-11 destructive versus nondestructive 22-7
table monitoring with
defined 8-16 event alarms 22-8
dropping 11-27 message log 22-8
metadata 8-16 when they occur 22-7
temporary 10-11 DISCONNECT statement 12-5
DBSPACETEMP configuration parameter 2-3, 10-26, 11-16 Disk allocation 1-6
defining temporary tables 10-34 Disk configuration 1-3
load balancing 10-34 Disk contention
DBSPACETEMP environment variable 10-26, 11-16 reducing 10-33
DD_HASHMAX configuration parameter 2-5 Disk I/O
DD_HASHSIZE configuration parameter 2-5 buffers 11-14
errors during processing 22-5
Index X-9
E Error messages xxx
for server utilities security check 5-3
Editing I/O errors on a chunk 22-5
ONCONFIG file 1-12 two-phase commit protocol 23-15
sqlhosts information ESQL/C
UNIX 1-10 accessing smart large objects 10-13, 10-19
Email ESQLMF environment variable 1-8
notification of event alarms 2-9 Event alarm
en_us.8859-1 locale xviii defined 1-21, 2-9
ENCCSM dynamically added logs 15-14, 15-15
Communication Support Modules, encryption 5-10 Event Viewer, Windows NT 1-24
ENCCSM_CIPHERS encryption parameter 5-16 Examples
ENCCSM_MAC encryption parameter 5-16 /etc/services file entry 3-9
ENCCSM_MACFILES encryption parameter 5-16 DBSERVERALIASES configuration parameter 3-30
ENCCSM_SWITCH encryption parameter 5-16 how page cleaning begins 8-24
ENCRYPT function 5-19 IPX/SPX connection 3-33
Encrypt virtual processor 6-26 local-loopback connection 3-32
Encrypting multiple connection types 3-34
column data 5-21 shared-memory connection 3-31
Encryption TCP/IP connection 3-33
column-level 5-19, 5-21 Exclusive lock
data transmissions 5-9 buffer 8-21
defined 5-8 EXECUTE FUNCTION statement 12-4
modes 5-9 EXECUTE IMMEDIATE statement 12-4
of data in a column 5-19, 5-21 EXECUTE PROCEDURE statement 12-4
of network data transmissions 5-10 EXECUTE statement 12-4
of passwords 5-9 EXT_DIRECTIVES configuration parameter 2-9
options in Dynamic Server 5-9 Extended data types
virtual processors 6-26 HDR replication 20-3
End-of-group option 3-22 Extension virtual processor.
Enterprise Replication 5-31 See User-defined virtual processor.
database logging 12-2 Extents
HDR, using with 20-5 allocating 10-8
RAW tables 10-24 defined 10-8
sbspaces 10-13 how database server allocates 10-9
specifying sbspaces 10-13 key concepts concerning 10-8
STANDARD tables 10-24 monitoring 11-36
TEMP tables 10-24 monitoring with sysextents 11-36
using database server groups 3-23 purpose 10-8
Environment relationship to chunk 10-8
configuration file 1-8 sbspaces 10-7, 10-16
control application 1-9 size for sbspaces 10-7, 10-15
Environment variables xxiv size for tblspace tblspace 11-10
.profile or .login file 1-8 size, initial 10-8, 10-16, 11-10
CLASSPATH 1-7, 1-9 size, next-extent 10-8, 10-16, 11-10
client applications 1-7 structure 10-8, 10-16
CLIENT_LOCALE 1-8 validating 22-3
DB_LOCALE 1-8 External backup
[Link] file 1-9 and restore
DBSPACETEMP 11-16 using when setting up HDR 21-6
environment-configuration file 1-8 External modules
[Link] and .informix files 1-8 security for loading 5-32
INFORMIXCONCSMCFG 5-10 External routines
INFORMIXDIR 1-7, 1-15 security for 5-32
INFORMIXSERVER 1-7 External space.
INFORMIXSHMBASE 8-6 See Extspace.
INFORMIXSQLHOSTS 1-10, 3-13 EXTSHMADD configuration parameter 2-5, 8-14
JVPHOME 1-7, 1-9 Extspace
LD_LIBRARY_PATH 1-9 creating 11-29
ONCONFIG 1-7, 2-11 dropping with onspaces 11-29
PATH 1-8, 1-15
required 1-7
sample setup file 1-9
SERVER_LOCALE 1-8 F
setting 1-7 Fast recovery 4-5, 4-8, 12-2
TERM 1-8 alternative options for fuzzy operations 16-17
TERMCAP 1-8 cleanup phase 15-10
TERMINFO 1-8 defined 1-19, 16-11
Index X-11
GLS8BITFSYS environment variable 1-8 High-Availability Data Replication (continued)
GRANT DEFAULT ROLE statement 5-7 DRTIMEOUT configuration parameter 20-11
GRANT ROLE statement 5-6 Enterprise Replication 20-5
GRANT statement 12-4 hardware and operating-system requirements 21-2
when granting privileges to DataBlade users 5-32 hdrmkpri and hdrmksec scripts 21-15
Group how it works 20-6
bargroup 1-6 how updates are replicated 20-6
database server 3-22, 3-23, 3-25, 5-5 initial replication 20-6
parallel processing of 6-6 lost-and-found transactions 20-8
GTRID 24-3 manual switchover 20-12, 20-13
monitoring status 21-15
performing DDL operations 20-22
H planning for 21-2
possible failures 20-10
Hardware mirroring 18-3
restarting after a corrupt index is detected 21-18
Hash table 8-16
restarting after failure 20-13, 21-18, 21-20
HDR.
restoring system after media failure 21-16, 21-17
See High-Availability Data Replication.
role of
hdrmkpri script 21-15
log records 20-6
hdrmksec script 21-15
primary database server 20-3
Heaps 8-18
secondary database server 20-3
Help xxxi
temporary dbspaces 20-22
HETERO_COMMIT configuration parameter 2-8, 23-21
setting
Heterogeneous commit 23-20, 23-21, 23-22, 23-25
database server type 21-14
Heuristic decision
setting up 21-2
independent action 23-9
starting 21-6
types of 23-10
synchronization 20-10
Heuristic end-transaction
synchronous updating 20-7
defined 23-12
types of data replicated 20-3
determining effects on transaction 24-2
UDRs, installing with 20-6
illustration and log records 23-18
UDTs, installing with 20-6
messages returned by 23-14
High-Performance Loader 10-24, 10-25
results of 23-14
HKEY_LOCAL_MACHINE registry 1-10
when necessary 23-13
host name field
Heuristic rollback
defined 3-18
defined 23-10
IPX/SPX 3-18
illustration and log records 23-17
multiple network interface cards 6-25
indications that rollback occurred 24-2
shared memory 3-18, 3-20
long transaction 23-14
syntax rules 3-18
monitoring, onstat -x 23-14
using IP addresses 3-25
results of 23-11
wildcard addressing 3-26
High-Availability Data Replication
Hostname
See also Data replication.
changing 1-25
actions to take if
hosts file 1-10, 3-9, 3-10
primary 20-12
[Link] file 3-11
secondary fails 20-12
Hot site backup.
administration 21-9
See Data replication.
advantages 20-3
Hot swap 18-3
asynchronous updating 20-8
HPL.
changing database server mode 21-13
See High-Performance Loader.
changing database server type 21-15
chunk status on secondary 21-11
client redirection
comparison of methods 20-20 I
DBPATH 20-14 I/O.
handling within an application 20-19 See Disk I/O.
INFORMIXSERVER 20-18 IBM Informix Client Software Developer’s Kit 23-2
sqlhosts file 20-15 IBM Informix ODBC Driver 23-2
configuring connectivity 21-3, 21-5 IBM Informix Server Administrator
data requirements 21-3 adding chunks 11-16, 11-23
DataBlade modules, installing with 20-6 adding mirrored chunks 19-6
defined 20-3 changing database server modes 4-9
description 20-2 changing operating modes 4-9
designing clients to use configuring sqlhosts 1-10
primary database server 20-20 creating
secondary database server 20-21 dbspaces 1-16, 11-8
detecting failures 20-11 sbspaces 11-23
DRINTERVAL configuration parameter 20-7, 20-8 creating dbspaces 1-16
Index X-13
[Link] utility 1-24 Light appends (continued)
STANDARD tables 10-24
Light scans 8-17
J Lightweight I/O 8-11, 10-17
Lightweight processes 6-2
J/Foundation
Limits
configuring 1-13
chunk number 11-8
environment variables 1-9
chunk size 11-7
JDBC installation directory 1-7
CPU VPs 6-12
setting CLASSPATH 1-7
JVPs 6-17
JAR file 1-13
user-defined VPs 6-15
Java configuration parameters 1-13
Links
Java Development Kit
creating 11-5
[Link] file 1-7
LIO virtual processors 6-18
Java virtual processor 6-17
Listen threads
JDBC Driver 1-7
adding 6-24
JDK.
defined 6-22
See Java Development Kit.
multiple interface cards 6-25
Join
LISTEN_TIMEOUT configuration parameter 1-10, 2-10, 5-7
parallel processing 6-6
Listener threads 5-7
JVP properties file 1-13
LO_CREATE_LOG flag 10-21
JVPHOME environment variable 1-7, 1-9
LO_CREATE_NOLOG flag 10-21
LO_CREATE_TEMP flag 10-21, 11-25
LO_LOG flag 14-8
K LO_NOLOG flag 14-8
KAIO thread 6-17, 6-19 Load balancing
Keep-alive option 3-24 done by virtual processors 6-6
Kernel asynchronous I/O performance goal 10-33
defined 6-19 using DBSPACETEMP 10-34
nonlogging disk I/O 6-17 LOAD statement 11-44, 12-4
Kernel parameters Loading data
modifying 1-4 express mode 10-24, 10-25
Key value methods 11-44
shared memory 8-7 utilities 11-44
Keywords Local loopback
in syntax diagrams xxvii connection 3-7, 6-21
example 3-32
restriction 3-7
L Locales xviii
default xviii
Large-chunk mode 1-5
Lock table
Latch
configuration 8-13
See also Mutex.
contents of 8-13
monitoring statistics 9-8
defined 8-13
wait queue 6-11
LOCK TABLE statement 12-5
lchwaits field 9-8
Locking
LD_LIBRARY_PATH environment variable 1-9
Dirty Read isolation level 20-21
LDAP Authentication Support on Windows 5-25
sbspaces 10-17
LDAP module
smart large objects 10-13
application development 5-27
Locks
authentication 5-27
defined 8-20
client APIs 5-27, 5-30
dynamic allocation 8-13
compatibility issues 5-30
initial number 8-13
configuring 5-26
onstat -k 23-14
configuring Dynamic Server 5-26
types 8-21
distributed transactions 5-29
wait queue 6-11
distributes transactions 5-27
LOCKS configuration parameter 2-6
with data replication 5-27
Log position 23-14
LDAP server 5-25
LOGBUFF configuration parameter 2-3, 15-13
Level-0 backup
logical log buffers 8-12
checking consistency 22-5
smart large objects 8-31
Levels, backup
LOGFILES configuration parameter 2-3, 15-13
defined 1-17
editing ONCONFIG value 15-13
sbspaces 15-4
setting logical-log size 15-3
Licensed users, maximum allowed 4-3, 4-7
Logging
Light appends
See also Database logging status.
physical logging 11-27
activity that is always logged 12-3
RAW tables 10-24
Index X-15
Logical log file (continued) Manual recovery
switching to activate blobspaces 14-6 deciding if action needed 24-4
temporary 15-7 determining if data inconsistent 24-2
unique ID number 14-2 example 24-5
using SMI tables 15-7 obtaining information from logical-log files 24-3
Logical recovery, data replication 20-7 procedure to determine if necessary 24-1
Logical units of storage use of GTRID 24-3
list of 10-2 Mapping, bad sector 22-9
Logical volume manager MAX_INCOMPLETE_CONNECTIONS configuration
defined 10-37, 18-3 parameter 1-10, 2-10, 5-7
Logical volume or unit storage space MAX_PDQPRIORTY configuration parameter 2-7
defined 1-16 MaxConnect
Logical-log file. defined 3-35
See Logical log file. imc protocol subfield 3-17
Logid 14-2 imcadmin command 3-36
logposit field 23-14 installation 3-36
LOGSIZE configuration parameter 2-3, 15-13 monitoring 3-36
adding log files 15-10 onsocimc protocol 3-18
changing 15-13 ontliimc protocol 3-18
increasing log size 15-12 packet aggregation 3-36
logical-log size 15-2 Maximum
Long transaction chunk size 11-7
consequences 14-6 number of chunks 11-8
defined 14-5 number of storage spaces 11-8
heuristic rollback 23-14 user connections 4-3, 4-7
preventing 1-18 Media failure
two-phase commit 23-8, 23-11, 23-13 detecting 18-5
Loosely-coupled mode 23-4 recovering from 18-2
LRU queues Memory
buffer pool management 8-22 See also Shared memory.
configuring multiple 8-23 64-bit platforms 8-32
defined 8-21 adding a segment 9-7
FLRU queues 8-22 Message log
MLRU queues 8-22 data corruption 22-5
pages in least-recent order 8-22 defined 1-21
specifying information 8-21 during initialization 4-6
LRU write dynamically added logs 15-15
defined 8-28 metadata usage 11-43
monitoring 9-11 physical recovery 16-3
performing 8-28 viewing messages 1-21
triggering 8-28 Metadata
lru_max_dirty value 8-22, 8-24, 8-25, 11-14 allocating 11-23
example of use 8-24 calculating area 10-19, 11-23
lru_min_dirty value 8-22, 8-25, 11-14 chunks 11-24
in page cleaning 8-25 creating 10-16
lrus value 11-14 dbspace table 8-16
LTAPEBLK configuration parameter 2-4, 21-5 defined 8-31, 10-14
LTAPEDEV configuration parameter dropping sbspace chunks 11-27
Configuration parameters logging 16-4
LTAPEDEV 2-4 moving space from reserved area 11-43
LTAPESIZE configuration parameter 2-4, 21-5 sbspace logging 14-7
LTXEHWM configuration parameter 2-3, 23-10 sizing 10-16, 11-23
defined 15-13 temporary sbspace 10-19
preventing long transactions 15-16 validating 22-3
role in heuristic rollback 23-10 mi_lo_copy() function 10-20
LTXHWM configuration parameter 2-3 mi_lo_specset_flags() function 10-20, 11-25
defined 15-13 Microsoft Transaction Server 23-2
preventing long transactions 15-16 Mirror chunk
role in heuristic rollback 23-11 adding 19-6
LVM. changing status of 19-4
See Logical volume manager. creating 19-3
disk reads 18-5
disk writes 18-5
M recovering 18-4, 18-5, 19-4
structure 18-6
MAC key files 5-14
MIRROR configuration parameter 2-2
Mac tab 5-18
changing 19-2
Machine notes xxix
Index X-17
Multiplexed connection 3-4 NIS servers, effect on /etc/hosts and /etc/services 3-9
Multiprocessor computer Non-default page size
MULTIPROCESSOR configuration parameter 6-13 creating a buffer pool for 11-12
processor affinity 6-7 for a dbspace 11-11
MULTIPROCESSOR configuration parameter 2-7, 6-13, 7-2 in HDR environment 21-4
Multithreaded processes Nonfuzzy operations
defined 6-3 defined 16-8
OS resources 6-6 flushing buffer pool 16-8
Mutex flushing buffers 16-10
defined 6-12, 8-20, 8-21 Nonlogging database
synchronization 6-12 RAW tables 10-24
using 8-21 SQL statements
never logged 12-4
table types supported 10-23
N Nonlogging tables 10-23
Nonyielding virtual processor 6-16
Name
[Link] 1-25
storage spaces 11-7
NTFS files 10-3
Named-pipe connection
converting 1-6
defined 3-5, 3-7
Null file
platforms supported 3-5
creating 11-6
netrc file
NUMCPUVPS configuration parameter 6-13
defined 3-12
sqlhosts security options 3-24
NETTYPE configuration parameter 2-7, 3-30, 7-2
multiple network addresses 6-25 O
multiplexed connection 3-4 ODBC Driver 23-2
poll threads 6-21 OFF_RECVRY_THREADS configuration parameter 2-8, 20-10
purpose 3-30 Offline mode
role in specifying a protocol 6-21 defined 4-8
VP class entry 6-21 Offset
nettype field prevent overwriting partition information 10-5, 11-3
format 3-16 purpose 10-5
summary of values 3-18 subdividing partitions 11-3
syntax 3-16 when needed 11-3
using interface type 3-33 Oldest update, freeing logical-log file 14-3
NetWare file server 3-18 OLTP applications.
Network See Parallel database query.
configuration files 1-10 ON_RECVRY_THREADS configuration parameter 2-8
data encryption 5-19 ON-Bar utility
interface cards setting up 1-17
using 6-25 ON-Monitor utility
security files 1-10 adding
Network communication chunk 11-17
implementing 6-22 logical-log file 15-11
types 6-20 mirror chunks 19-6
using IPX/SPX 3-18, 3-20, 3-33 changing database server modes 4-10
using TCP/IP 3-18, 3-19 copying the configuration 2-11
Network data transmissions creating blobspaces 11-21
encryption of 5-10 creating dbspaces 11-9
Network Information Service 3-9 dropping a logical-log file 15-12
Network protocol dropping storage spaces 11-27, 11-28
defined 3-2 monitoring database server 1-22
Network protocols 6-21 recovering a chunk 19-7
Network security setting parameters
.netrc file 3-12 shared memory 9-6
files 3-11 virtual processors 7-3
[Link] 3-11 starting mirroring 19-5
Network virtual processors taking a chunk down 19-6
defined 6-20 oncfg_servername.servernum file 4-6
how many 6-22 oncheck utility
poll threads 6-21 -cc option 22-2
Network-protocol driver -cD option 22-3
defined 3-2 -ce option 22-2
New Technology File System 1-6 -cI option 22-2, 22-3
Next-extent -cr option 22-2
size 10-8 -cR option 22-2
NFS-mounted directory 10-3 -cs option 11-40, 11-42, 22-3
Index X-19
onstat utility (continued) Optical Subsystem memory cache (continued)
-g ath option 7-5 session ID for user 11-37
-g cac option 9-6 size 11-37
-g glo option 7-5 user ID of client 3-21, 11-37
-g imc 3-36 Optical virtual processor 6-26
-g ioq option 7-5 Options field
-g rea option 7-6 buffer-size option 3-21
-g seg option 9-3 connection-redirection 3-22
-g smb c option 11-40, 11-44 CSM option 3-22
-g sql option 13-5 end-of-group 3-22
-g ssc options 9-6 group option 3-24
-g stm option 13-5 identifier option 3-24
-k option 23-14 keep-alive option 3-24
-l option 15-10 overview 3-20
-m option 1-22 security option 3-24
-p option 9-8 syntax rules 3-20
-s option 9-8 OUTPUT statement
-u option 6-3, 16-4, 23-14 logging 12-5
-x option 13-5, 23-14
CPU virtual processors 6-3
displaying
messages 1-22
P
Packet aggregation 3-36
monitoring
Page
blobspace 11-33
defined 10-5
buffer use 9-9, 9-10, 9-11
determining database server page size 11-21
buffer-pool 9-11
least-recently used 8-22
chunk status 11-33
most-recently used 8-23
configuration 2-11
relationship to chunk 10-5
data replication 21-15
specifying size for a standard or temporary dbspace 11-11
database server profile 9-8
PAGE_CONFIG reserved page 2-11, 4-5
fragment load 11-34
PAGE_PZERO reserved page 4-5
latches 9-8
Page-cleaner table
logical-log buffer 15-6, 17-3
defined 8-16
logical-log files 15-10, 17-4
number of entries 8-16
physical log 17-4
Page-cleaner threads
shared memory 9-8
alerted during foreground write 8-27
SQL statement cache 9-6
defined 8-26
SQL statements 13-5
flushing buffer pool 8-26
transactions 7-5
flushing of regular buffers 8-26
virtual processors 7-5
monitoring 8-16
overview 1-23
role in chunk write 8-28
profiling user activity 23-14
Pagermail
temporary sbspace flags 11-25
notification of event alarms 2-9
tracking
PAM.
global transaction 23-14
See Pluggable Authentication Module.
locks 23-14
Parallel database queries
updating blobpage statistics 11-33
Decision-support query
ontape utility
See DS_MAX_QUERIES configuration parameter.
alternative backup method 21-9
DS_MAX_QUERIES configuration parameter 2-7
backing up logical-log files 14-6
DS_NONPDQ_QUERY_MEM configuration
modifying database logging status 13-3
parameter 2-7, 8-14
setting up 1-17
DS_TOTAL_MEMORY configuration parameter 2-7, 8-14
ontliimc protocol 3-18
MAX_PDQPRIORTY configuration parameter 2-7
OPCACHEMAX configuration parameter 2-11, 11-37
Parallel processing
configuring memory 11-37
virtual processors 6-6
OPEN statement 12-5
Participant database server 23-6
Operating system
automatic recovery 23-7
32-bit and 64-bit versions 9-2
Partitions
parameters 9-2
creating and using 11-18
tools 1-23
creating in a fragmented table or index 11-19
Operating-system files.
creating in a previously defined table or index 11-19
See Cooked file space.
mentioning in ALTER FRAGMENT statement 11-19
OPTCOMPIND configuration parameter 2-7
Password Communication Support Module 5-12
Optical Subsystem memory cache
Password encryption 5-9
allocation 11-38
CSM configuration file 5-10, 5-12
kilobytes of TEXT and BYTE data written 11-37
database server initialization 5-11
number of objects written 2-11, 11-37, 11-38
Index X-21
Processes Recovery (continued)
attaching to shared memory 8-6 mode
comparison to threads 6-6 defined 4-8
DSA versus dual process architecture 6-7 parallel processing 6-6
Processor affinity RAW tables 10-24
defined 6-14 STANDARD tables 10-24
using 6-14 two-phase commit protocol 23-5
Profile Redundant array of inexpensive disks 18-3
statistics 9-8 Referential constraint 10-24, 12-2
Program counter and thread data 8-18 Registry
Protocol changing the hostname 1-25
specifying 6-21 defining multiple network addresses 6-25
PSWDCSM. Regular buffers
See Password encryption. events that prompt flushing 8-26
PUT statement 12-4 Release Notes xxix
Remote
client 3-11
Q hosts and clients 3-11
RENAME COLUMN statement 12-4
Query plans 8-19
RENAME DATABASE statement 12-4
Queues
RENAME INDEX statement 12-4
defined 6-10
RENAME SEQUENCE statement 12-4
disk I/O 6-17
RENAME TABLE statement 12-4
ready 6-11
Renaming
sleep 6-11
database server instance 1-13
wait 6-11
dbspace 11-17
Quiescent mode 4-8
Replication servers.
See Data replication.
Requirements
R configuration 1-11
R-tree index Reserved area
logging 16-4 defined 10-14
RA_PAGES configuration parameter 2-6, 8-25 monitoring size 11-40, 11-44
RA_THRESHOLD configuration parameter 2-6, 8-25 moving space to metadata area 11-43
RAID. Reserved pages
See Redundant array of inexpensive disks. chunk status for secondary 21-11
Raw disk devices 1-5 validating 22-3
Raw disk space Residency.
allocating on UNIX 10-4, 11-5 See Multiple residency.
allocating on Windows 10-3 RESIDENT configuration parameter 2-6
character-special interface 10-4 during initialization 4-6
defined 10-4 setting with onmode 9-7
RAW table 1-18 Resident shared memory
altering 13-5 defined 4-4, 8-9, 8-10
backing up 10-25 internal tables 8-15
backup and restore 10-25 Resource manager 23-2
fast recovery 10-25 Resource managers 23-3
overview 10-24 Resource planning 1-3
properties 8-25 Restore
restore 10-26 RAW tables 10-24
Read-ahead STANDARD tables 10-24
defined 8-25 table types 10-26
RA_PAGES configuration parameter 8-25 Revectoring table 11-4
RA_THRESHOLD configuration parameter 8-25 REVOKE DEFAULT ROLE statement 5-7
when used 8-25 REVOKE FRAGMENT statement 12-4
Read-only mode REVOKE statement 12-4
defined 4-8 when granting privileges to DataBlade users 5-32
Ready queue Role
defined 6-10 creating 5-7
moving a thread 6-11, 20-7 default 5-6
Reception buffer 20-7 defined 5-7
Recommendations Roll back
allocation of disk space 10-5 fast recovery 16-13, 16-16
consistency checking 22-2 heuristic, monitoring 23-14
mirroring the physical log 16-4 RAW tables 10-24
Recovery smart large objects 10-21
from media failure 18-2 SQL statements logged 12-4
Index X-23
Session (continued) Shared memory (continued)
locks 8-13 monitoring
primary thread 8-18 ISA 9-5
shared memory 8-18 onstat utility 9-8
shared-memory pool 8-14 mutex 8-21
sqlexec threads 6-3 nonresident portion 9-4
threads 8-18 operating-system segments 8-4
UDR cache 8-20 overview 1-19
Session control block 6-8 page-cleaner table 8-16
defined 8-18 performance options 8-2, 9-6
shared memory 8-18 physical-log buffer 8-12
SET ... statement 12-5 pools 8-14
SET DATASKIP statement 11-29, 11-30 portions 8-3
SET ENCRYPTION PASSWORD statement 5-19 purpose 8-2
SET ROLE DEFAULT statement 5-7 resident portion
SET statement 5-6 creating 4-4
[Link] file 1-9 defined 8-10
Setnet32 utility 1-10 ISA 9-5
Setting up ON-Monitor utility 9-6
environment variables 1-9 text editor 9-5
ON-Bar utility 1-17 segment identifier 8-7
ontape utility 1-17 semaphore guidelines 9-3
Share lock SERVERNUM configuration parameter 8-7
defined 8-21 session control block 8-18
Shared data 8-2 setting up 9-7
Shared memory SHMADD configuration parameter 8-14
allocating 1-4, 4-4, 8-14 SHMBASE configuration parameter 2-5, 8-7
attaching 8-6 SHMTOTAL configuration parameter 2-5, 8-5
attaching additional segments 8-7, 8-8, 9-5 SHMVIRTSIZE configuration parameter 2-5, 8-14
attaching utilities 8-6 size
blobpages 8-29 displayed by onstat 8-4
buffer 11-14 virtual portion 8-14
buffer allocation 8-10 smart large objects 8-31, 10-18
buffer hash table 8-16 sorting 8-19
buffer locks 8-21 SQL statement cache 2-6, 8-4, 8-19, 9-6
buffer pool 8-10, 16-6 stacks 8-18
buffer table 8-15 STACKSIZE configuration parameter 8-18
changing residency with onmode 9-7 synchronizing buffer flushing 8-26
checkpoint 16-7 tables 8-15
chunk table 8-16 tblspace table 8-16
communications 3-18, 3-20, 8-20 thread control block 8-18
configuration 8-4, 8-14, 9-2 thread data 8-18
configuration parameters 2-6 thread isolation and buffer locks 8-21
connection 6-21 transaction table 8-17
contents 8-20 user table 8-17
copying to a file 9-8 user-defined routine cache 8-20
critical sections 16-2 virtual portion 8-13, 8-15, 9-6, 9-8
data-distribution cache 8-19 ISA 9-5
data-replication buffer 20-7 Shared-memory connection
dbspace table 8-16 example 3-31
defined 8-2 how a client attaches 8-6
dictionary cache 8-19, 9-5 message buffers 8-20
effect of operating-system parameters 9-2 servicename field 3-19
first segment 8-7 virtual processor 6-21
global pool 8-20 SHMADD configuration parameter 2-5, 8-14
header 8-8, 8-10 SHMBASE configuration parameter
heaps 8-18 attaching first shared-memory segment 8-7
identifier 8-7 defined 2-5, 8-7
initializing 4-1, 4-3 setting higher 9-3
initializing or restarting 4-4 shmem file
internal tables 8-15 assertion failures 22-4
interprocess communication 8-2 shmkey
key value 8-7 attaching additional segments 8-8
logical-log buffer 8-11 defined 8-7
lower-boundary address problem 8-8 SHMTOTAL configuration parameter 2-5, 8-5
mirror chunk table 8-16 SHMVIRTSIZE configuration parameter 2-5, 8-14
Index X-25
SQL statements (continued) Statistics.
monitoring 13-5 See onstat utility.
new features xxii Status
not logged 12-4 log file
parsing and optimizing 9-6 added 15-5, 15-6, 15-11
REVOKE DEFAULT ROLE 5-7 backed up 15-6, 15-11
SET ROLE 5-6 checkpoint 15-12
SET ROLE DEFAULT 5-7 current 15-5
UPDATE STATISTICS 8-19 deleted 15-6, 15-11, 15-12
using temporary disk space 10-26 free 15-5, 15-12
sqlexec thread used 2-6, 15-5, 15-11
client application 6-22 STDIO value 21-9
role in client/server connection 6-22 STMT_CACHE configuration parameter 2-6, 9-6
user thread 6-3 STMT_CACHE_HITS configuration parameter 2-6, 9-6
sqlhosts file STMT_CACHE_NOLIMIT configuration parameter 2-6, 9-6
connection type field 3-16 STMT_CACHE_NUMPOOL configuration parameter 2-6, 9-6
CSM option 3-20 STMT_CACHE_SIZE configuration parameter 2-6, 9-6
dbservername field 3-16, 3-23 Storage characteristics
defined 3-22 hierarchy 10-17
defining multiple network addresses 6-25 onspaces -ch 10-15, 11-24
editing with ISA 1-10 onspaces -Df 11-22
end of group option 3-22 sbspaces 10-16
entries for multiple interface cards 6-25 smart large objects 10-16, 11-24
group option 3-24 storage spaces 1-17
host name field 3-18 Storage devices
identifier option 3-22 setup 1-17
keep-alive option 3-24 Storage manager
local-loopback example 3-32 ISM 1-17
multiple connection types example 3-33 role in ON-Bar system 1-17
multiplexed connection 3-4 Storage spaces
network connection example 3-33 backup schedule 1-17
options field 3-19 ending mirroring 19-7
security options 3-24 starting mirroring 19-4
service name field 3-19, 6-22 storing NTFS partitions 1-6
shared-memory example 3-31 Storage statistics
specifying network poll threads 6-21 blobspaces 11-22
sqlhosts registry Stored procedure.
defined 3-14 See SPL routine.
INFORMIXSQLHOSTS environment variable 3-14 Stored-procedure cache.
location 3-14 See UDR cache.
on Windows 1-10 stores_demo database xix
Stack Stream-pipe connection
and thread control block 6-10 advantages and disadvantages 3-7
defined 6-9, 8-18 servicename field 3-19
INFORMIXSTACKSIZE environment variable 8-18 Structured Query Language
pointer 6-10 See SQL statements.
size 2-6, 8-18 superstores_demo database xix
STACKSIZE configuration parameter 8-18 Swapping memory 8-9
thread 8-18 Switch tab 5-19
STACKSIZE configuration parameter 2-6 Switching
changing the stack size 8-18 between threads 6-10
defined 8-18 next log file 15-4
STAGEBLOB configuration parameter 2-11 Sync checkpoint.
Standard database server 20-3 See Checkpoint.
STANDARD table Syntax diagrams
allowed in logging database 1-18 conventions for xxiv
backup 10-25 keywords in xxvii
fast recovery 10-25 reading in a screen reader A-1
properties 10-24 variables in xxvii
restore 10-25, 10-26 Syntax segment xxvi
Starting the database server sysdistrib table 1-23, 8-19
automatically 1-15 syslogs table 15-7
initializing disk space 1-14 sysmaster database
with oninit 4-1 See also SMI table
starts dbservername command 1-14 creation 4-6
Startup script 1-14 SMI tables 1-23
sysprofile table 9-9
Index X-27
Threads (continued) Two-phase commit protocol (continued)
control block 6-8 automatic recovery (continued)
defined 6-3 participant recovery 23-7
heaps 8-18 configuration parameters 23-19
how virtual processors service 6-19 contrast with heterogeneous commit 23-20
internal 6-3, 6-12 coordinator recovery 23-5
kernel asynchronous I/O 6-19 DEADLOCK_TIMEOUT 23-20
migrating 6-10 defined 23-5
mirroring 6-3 distributed queries 1-20
multiple concurrent 6-8 errors messages 23-15
onmode 6-3 flushing logical log records 23-16
page cleaner 6-2, 6-3, 8-16 global transaction ended prematurely 24-1
primary session 8-18 global transaction identifier 24-3
recovery 6-3 heuristic decisions
relationship to a process 6-3, 6-12 heuristic end-transaction 23-12
scheduling and synchronizing 6-8 heuristic rollback 23-10
session 6-10, 8-18 types 23-8
sleeping 6-11 independent action 23-8
stacks 8-18 defined 23-8
switching between 6-8 errors 23-9
user 6-3, 8-18 initiating 23-8
waking up 6-9 results 23-9
yielding 6-8 logical-log records 23-10
Tightly-coupled mode 23-6 messages 23-6
TLI. overview 1-20
See Transport-layer interface. participant activity 23-6
TOC Notes xxix participant recovery 23-7
TP/XA 1-21, 8-17, 23-2 postdecision phase 23-7
Transaction branch 23-6 precommit phase 23-7
Transaction logging presumed-end optimization 23-7, 23-8
See also Logging. role of current server 23-6
buffered 12-5 TXTIMEOUT configuration parameter 23-20
defined 12-3, 12-5 when used 23-5
Enterprise Replication 10-13 TXTIMEOUT configuration parameter 2-8, 23-13, 23-20
unbuffered 12-5 defined 23-20
when to use 12-5 onmode -Z 23-13
Transaction manager two-phase commit protocol 23-19
MTS/XA 23-2 Types of buffer writes 8-27
purpose 23-2 Typographical conventions xxiv
TP/XA 1-21, 23-2
Transaction table
defined 8-17
tracking with onstat 8-17
U
UDR cache 8-20
Transactions
Unbuffered disk access
global
compared to buffered 10-4
defined 23-2, 23-6
data storage 10-4
determining if implemented consistently 24-1
Unbuffered logging
identification number, GTRID 24-3
flushing the logical-log buffer 8-29
tracking 13-5, 23-14
Unbuffered transaction logging.
loosely coupled 23-4
See Logging.
mixed result 23-12
Units of storage 10-2
monitoring 13-5, 23-6, 23-14
UNIX devices
RAW tables 10-24
displaying links to a pathname 1-6, 11-5
tightly coupled 23-4
ownership, permissions on
Transport-layer interface
character-special 11-5
in nettype field 3-17
cooked files 11-5
Triple Data Encryption Standard 5-9
UNIX operating system
Trusted
link command 1-6, 11-5
clients 3-3
modifying kernel 1-4
database server 3-3
setting environment variables 1-8
domain 3-3
shutdown script 1-14
Windows domains 3-3
startup script 1-14
Trusted domain 23-7
UNLOAD statement 12-4
Two-phase commit protocol
UNLOCK TABLE statement 12-5
automatic recovery 23-7
UNSECURE_ONSTAT configuration parameter 2-10, 5-33
administrator’s role 23-7
UPDATE statements 12-4
coordinator recovery 23-7
UPDATE STATISTICS statement 2-3, 8-19, 10-24
Index X-29
W
Wait queue
buffer locks 8-21
defined 6-11
Waking up threads 6-11
Warning messages
for server utilities security check 5-3
Warnings
files on NIS systems 3-9
oncheck -cc output 22-2
WHENEVER statement 12-5
Wildcard addressing
client application 3-26
example 3-28
hostname field 3-28
Windows
allocating raw disk space 11-6
automatic startup 1-14
configuring memory 1-4
converting to NTFS 1-6
Environment Variables control application 1-9
Event Viewer 1-24
ixpasswd utility 1-24
ixsu utility 1-24
larger shared memory 1-4
maximum address space 1-4
ntchname utility 1-25
setting environment variables 1-9
setting up connectivity 1-10
shared memory issues 9-3
Windows convert utility 1-6
Windows Instance Manager 1-12, 4-2
Windows Internet Name Service 3-10, 3-26
Windows Performance Monitor 1-24
Write types
chunk write 8-28
foreground write 8-27
LRU write 8-28
X
X/Open
DTP environment 8-17, 12-7
XA interface standards 23-3
XA data-source types 23-3
XA-compliant external data sources 23-3
Y
Yielding threads
conditions 6-8
defined 6-10
predetermined point 6-9
ready queue 6-10
switching between 6-8
Printed in USA
G251-2267-02
Spine information:
IBM Informix Version 10.0 IBM Informix Dynamic Server Administrator’s Guide