6.6.3 Database settings
This section describes table creation and environment setup required for using the database session failover functionality.
- Important note
-
When creating a table, if you make any changes in the template file that are not described here, the operations of the database session failover functionality are not guaranteed.
- Organization of this subsection
(1) Permissions required for connecting to a database
You must have permissions to operate database tables. Also, the conditions must be met. This subsection describes permissions and conditions required for operating tables of each database. Here, a user connected to a database is called a user connected to database.
-
In HiRDB
Here, it is assumed that the user connected to a database performs all operations related to tables used in the database session failover functionality. The user connected to database must have the following permissions and satisfy the following conditions:
-
User must own the schema.
-
User must have CONNECT permissions.
-
In the schema of the user connected to a database, create tables, indexes, and stored procedures used in the database session failover functionality.
For details on creating database tables, see 6.6.3(2) Creating database tables. For details on deleting database tables, see 6.8 Deleting database tables.
-
-
In Oracle
Here, it is assumed that the database administrator creates or deletes database tables used in the database session failover functionality, and that the user connected to a database of the database session failover functionality performs other usual database operations. The user connected to a database must have the following permissions and satisfy the following conditions:
-
User must have CREATE SESSION system permissions.
-
In the schema of the user connected to a database, create tables, indexes, and stored procedures used in the database session failover functionality.
For details on creating database tables, see 6.6.3(2) Creating database tables. For details on deleting database tables, see 6.8 Deleting database tables.
-
(2) Creating database tables
With the database session failover functionality, you must create three types of tables in a database. The following table describes tables to be created and reference location of creation procedure.
Table name |
Physical name in the database |
Reference location of creation procedure |
---|---|---|
Application information table |
SFO_APPLICATION_ID_APP_INFO |
|
Session information storage table |
SFO_APPLICATION_ID_SESSIONS |
|
Blank record information table |
SFO_APPLICATION_ID_REC_INFO |
Template files for creating database tables, which are used in the database session failover functionality, are stored in the following locations:
- In Windows:
-
Application-Server-installation-directory\CC\sfo\sql\
- In UNIX:
-
/opt/Cosminexus/CC/sfo/sql/
There are two types of template files for table creation for each database used. The following table describes mapping of databases to be used, files, and types of tables to be created.
Database to be used |
Template file |
Types of table to be created |
||
---|---|---|---|---|
Application information table |
Session information storage table |
Blank record information table |
||
HiRDB |
hirdb_create_apptbl.sql |
Y |
-- |
|
hirdb_create_sessiontbl.sql |
-- |
Y |
||
Oracle |
oracle_create_apptbl.sql |
Y |
-- |
|
oracle_create_sessiontbl.sql |
-- |
Y |
The following subsections describe details on template files for each used database.
Register the creator of the table in the user set in DB Connector.
(3) Creating Application information table
Application information table stores settings related to the database session failover functionality set in a Web application.
The procedures for creating the application information table are as follows:
-
Copy the template file to any location.
A template file is provided as an SQL file used for creating a table. The storage locations of template files for each database used are:
-
Storage location of template files when using HiRDB
In Windows: Application-Server-installation-directory\CC\sfo\sql\hirdb_create_apptbl.sql
In UNIX: /opt/Cosminexus/CC/sfo/sql/hirdb_create_apptbl.sql
-
Storage location of template files when using Oracle
In Windows: Application-Server-installation-directory\CC\sfo\sql\oracle_create_apptbl.sql
In UNIX: /opt/Cosminexus/CC/sfo/sql/oracle_create_apptbl.sql
-
-
Edit the template file.
Edit the template file in accordance with the preference information of a Web application and create an SQL file used for creating a table.
The following table describes change locations and change contents in a template file.
Table 6‒44: Change locations and change contents in a template file Change location
Change target
Change contents
HiRDB
Oracle
-
First line
-
Fifth line
-
First line
-
Fifth line
APPLICATION_ID
Change the application identifier of the application to be used.
None
-
First line
-
Fifth line
SCHEMA_NAME
Change the schema name of user connected to database.
Sixth line
Sixth line
HTTP_SESSION_NO
Change the number of global session information stored in the database.
-
-
Execute the created SQL file for table creation.
For executing the SQL file, use SQL Executer when using HiRDB and SQL*Plus when using Oracle.
(4) Creating session information storage tables and blank record information tables
Session information storage table stores global session information. The blank record information table manages the unused records in the session information storage table. The session information storage table and blank record information table are concurrently created by executing one SQL file for table creation.
The procedures for creating the session information storage table and blank record information table is as follows:
-
Copy the template file to any location.
A template file is provided as an SQL file used for creating a table. The storage locations for template files for each database used are:
-
Storage location of template files when using HiRDB:
In Windows: Application-Server-installation-directory\CC\sfo\sql\hirdb_create_sessiontbl.sql
In UNIX: /opt/Cosminexus/CC/sfo/sql/hirdb_create_sessiontbl.sql
-
Storage location of template files when using Oracle
In Windows: Application-Server-installation-directory\CC\sfo\sql\oracle_create_sessiontbl.sql
In UNIX: /opt/Cosminexus/CC/sfo/sql/oracle_create_sessiontbl.sql
-
-
Edit the template file.
Edit the template file in accordance with the preference information of a Web application and create an SQL file used for creating a table.
The following table describes change locations and change contents for each database used in a template file.
Table 6‒45: Change locations and change contents in a template file Change location
Change target
Change contents
HiRDB
Oracle
-
First line
-
13th line
-
18th line
-
19th line
-
23rd line
-
48th line
-
50th line
-
57th line
-
60th line
-
74th line
-
First line
-
13th line
-
18th line
-
19th line
-
23rd line
-
49th line
-
51st line
-
58th line
-
61st line
-
74th line
APPLICATION_ID
Change the application identifier of the application to be used.
None
-
First line
-
13th line
-
18th line
-
19th line
-
23rd line
-
49th line
-
51st line
-
58th line
-
60th line
-
74th line
SCHEMA_NAME
Change the schema name of user connected to database.
Seventh line
None
ATTRIBUTE_DATA_SIZE_MAX
Change the maximum size (units: bytes) of HTTP session attribute information.
74th line
74th line
HTTP_SESSION_NO
Change the amount of global session information stored in the database.
-
-
Execute the created SQL file for table creation.
For executing the SQL file, use SQL Executer when using HiRDB and SQL*Plus when using Oracle.
(5) Environment settings of database
If you want to use the database session failover functionality, set a timeout in database (for HiRDB, UAP processing time monitoring functionality).
If the database session failover functionality is enabled, table records of the database that are targeted for operation during functionality processing, are exclusively controlled. As a result, when problems such as a failure on a J2EE server host occur, records targeted for operation might remain in exclusion state. In this case, creation of new HTTP sessions or connection between J2EE servers and database might fail.
If you set a timeout, such situations are detected, the transaction is rolled back, and you return to the state before records are exclusively controlled when a timeout occurs. Therefore, there is no impact on the system.
For preventing malfunctioning, set a timeout value for the database that is greater than the timeout value set in DB Connector. For details on database settings and procedure, see the HiRDB UAP Development Guide when using HiRDB and Oracle manuals when using Oracle.
The following table describes the processing in which records are exclusively controlled, tables targeted for operation in the processing, impact on the system when a failure occurs on a J2EE server during a processing, and the messages are output.
Sr. No. |
Processing that exclusively controls records |
Table targeted for operation |
Impact on the system when a failure occurs |
Output message |
---|---|---|---|---|
1 |
Negotiation processing when starting a Web application |
Application information table |
Because application negotiation fails, the Web application that uses the database session failover functionality fails to start. |
Not output |
2 |
Processing of creating global session information |
Blank record information table |
The system can only create a total of 90% of the HTTP sessions. After this, HTTP session creation or deletion processing might fail. |
|
3 |
Processing of deleting global session information |
Blank record information table |
The system can only create a total of 90% of the HTTP sessions. After this, HTTP session creation or deletion processing might fail. |
|
4 |
Processing of updating global session information |
Session information storage table |
The number of HTTP sessions that you can create in the system reduces by one. After this, if you receive a request that operates the reduced HTTP session, HTTP session acquisition fails. |
|
5 |
Processing of monitoring validity of global session information |
Application information table |
Validity of global session information in the database is not monitored. |
|