NonStop Servlets for JSP System Administrator's Guide
Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) System Administrator’s Guide—525644-001
3-35
Creating a NonStop SQL Database to Store the
Persistent Session Data
To support the persistent session database scalability, you need to 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-27.
Example 3-28 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 are =TheFirstSessionPartition
and =TheSecondSessionPartition values. You will need to replace these two
values by 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-29 shows
how to add the same two partitions (shown above in bold) using the ALTER TABLE
command in the NonStop SQL Command Interpreter (SQLCI).
Example 3-27. 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,
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-28. 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,
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;