NonStop Servlets for JavaServer Pages (5.0) System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-002
3-50
Creating a NonStop SQL Database to Store the
Persistent Session Data
To support the persistent session database scalability, partition the session data. This
can be done either by adding the partitions at the NonStop SQL table creation time or
on-the-fly by using the ALTER TABLE command in the NonStop SQL Command
Interpreter (SQLCI). Partitioning can be done by adding the partition option to the
CREATE TABLE command, as shown in Example 3-32.
Example 3-33 shows how to add two partitions based on the value of the session_id
key. The two partitions (in addition to the main table) are indicated by the two
parameters passed to the partition option. These parameters are
=TheFirstSessionPartition and =TheSecondSessionPartition values.
Replace these two values with Guardian locations of the form $Volume.SubVolume.
These two subvolumes (disks) should be TMF-audited data volumes.
Alternatively, if you have already created the NonStop SQL table, you can use the
ALTER TABLE command to create or add partitions on-the-fly. Example 3-34 shows
how to add the same two partitions (shown in Example 3-31) using the ALTER TABLE
command in the NonStop SQL Command Interpreter (SQLCI).
Example 3-32. SQL Script for Configuring Persistent Sessions
sqlci> create catalog =TheT1222SessionCatalog secure "OOOO";
sqlci> create table =TheT1222SessionCatalog.SessData (
session_id VARCHAR(48) NO DEFAULT NOT NULL,
process_name VARCHAR(8) NO DEFAULT NOT NULL,
rec_number INTEGER UNSIGNED NO DEFAULT NOT NULL,
app_name VARCHAR(255) NO DEFAULT NOT NULL,
session_data VARCHAR(3712) CHARACTER SET ISO88591,
valid SMALLINT UNSIGNED NO DEFAULT,
maxinactiveinterval INTEGER NO DEFAULT,
lastaccessed LARGEINT NO DEFAULT
primary key (session_id, process_name, rec_number) )
organization key sequenced
audit
catalog =TheT1222SessionCatalog;
Example 3-33. Adding Extra Partitions to Support Persistent Sessions
sqlci> create table =TheT1222SessionCatalog.SessData (
session_id VARCHAR(128) NO DEFAULT NOT NULL,
process_name VARCHAR(8) NO DEFAULT NOT NULL,
rec_number INTEGER UNSIGNED NO DEFAULT NOT NULL,
app_name VARCHAR(255) NO DEFAULT NOT NULL,
session_data VARCHAR(3712) CHARACTER SET ISO88591,
valid SMALLINT UNSIGNED NO DEFAULT,
maxinactiveinterval INTEGER NO DEFAULT,
lastaccessed LARGEINT NO DEFAULT
primary key (session_id, process_name, rec_number) )
partition (=TheFirstSessionPartition.SessData FIRST KEY “5”
catalog =TheT1222SessionCatalog,
=TheSecondSessionPartition.SessData FIRST KEY “A”
catalog =TheT1222SessionCatalog)
organization key sequenced
audit
catalog =TheT1222SessionCatalog;