Analyze on Progress OpenEdge
This page is only for customers who store Analyze data in a Progress OpenEdge database. It explains who changes the Analyze tables there, and which SQL your database administrator runs before you update the ConnectPlaza® Agent.
1. Who changes the Analyze tables
On the other SQL databases, such as MariaDB, MySQL and Microsoft SQL Server, the agent adds new Analyze columns itself when Hibernate Database Generation (connectplaza.analyze.jdbc.hbm2dll) is update, the default.
On Progress OpenEdge, since 5.3.1, the agent does not change the Analyze tables. Your database administrator may have changed the database for speed, and an update must not undo that. With update the agent only checks the Analyze tables. When a column is missing, Analyze does not start, and the agent log names the column:
Schema-validation: missing column [bo_agent] in table [ema_bo]
Your database administrator then adds the column with the SQL below, and you restart the agent.
To let the agent add new columns itself, as on the other databases, set Progress: let the agent change the schema (connectplaza.analyze.jdbc.progress.schemaupdate) to true. This works only together with Hibernate Database Generation update.
| Field | Description |
|---|---|
Progress: let the agent change the schema |
The default. The agent only checks the tables. Your database administrator adds new columns before each update. |
Progress: let the agent change the schema |
With Hibernate Database Generation |
|
A new, empty Progress database has no Analyze tables yet, so with the default the agent cannot start Analyze. For the first start, type A new database also needs the indexes in Add the indexes for reading messages and Business Entities. Add them after the first start. |
2. Before you update to 5.3.1
Your database administrator runs this SQL before you start the 5.3.1 agent, with a database user that may change the Analyze tables.
-
Check which columns exist and Add the missing columns: needed, unless Hibernate Database Generation is
updateand you set Progress: let the agent change the schema totrue. Then the agent adds the columns itself. -
Add the indexes for reading messages and Business Entities: always needed. The agent never creates these indexes.
-
Add the index for the agent filter (optional): only when you use the agent filter.
The statements assume the default table prefix ema. With another prefix, change ema_bo and ema_boattr in all statements, for example to abc_bo and abc_boattr. Do not change emamsgprtprop: it has no prefix.
The statements work in the schema of the database user who runs them. When the JDBC URL of the agent sets defaultSchema, for example defaultSchema=PUB, run them as a user whose default schema is that schema, and change OWNER = USER in the first statement to OWNER = 'PUB' (your schema name, in quotes).
2.1. Check which columns exist
-- Shows the new columns that your tables already have.
-- A column that is NOT in the result is missing: add it in the next section.
-- If all seven columns are in the result, skip the next section.
SELECT TBL, COL FROM SYSPROGRESS.SYSCOLUMNS
WHERE OWNER = USER
AND TBL IN ('ema_bo', 'ema_boattr')
AND COL IN ('bo_agent', 'boa_type', 'boa_doublevalue', 'boa_longvalue',
'boa_decimalvalue', 'boa_booleanvalue', 'boa_datetimevalue');
Tables created before 5.3.0 have none of these seven columns, because the agent could not add columns on Progress before 5.3.1.
2.2. Add the missing columns
Run only the statements for the columns that the check did not show.
-- 5.3.0: the type of a Business Entity attribute. Existing attributes are text, so they get 'Text'.
ALTER TABLE ema_boattr ADD COLUMN boa_type VARCHAR(255) DEFAULT 'Text' NOT NULL;
-- 5.3.0: the value of a Business Entity attribute of type Double.
ALTER TABLE ema_boattr ADD COLUMN boa_doublevalue FLOAT;
-- 5.3.0: the value of a Business Entity attribute of type Long.
ALTER TABLE ema_boattr ADD COLUMN boa_longvalue NUMERIC(32,0);
-- 5.3.0: the value of a Business Entity attribute of type Decimal.
ALTER TABLE ema_boattr ADD COLUMN boa_decimalvalue NUMERIC(16,6);
-- 5.3.0: the value of a Business Entity attribute of type DateTime.
ALTER TABLE ema_boattr ADD COLUMN boa_datetimevalue TIMESTAMP;
-- 5.3.0: the value of a Business Entity attribute of type Boolean.
ALTER TABLE ema_boattr ADD COLUMN boa_booleanvalue BIT;
-- 5.3.1: the agent that wrote a Business Entity. Needed also when you do not use the agent filter.
ALTER TABLE ema_bo ADD COLUMN bo_agent VARCHAR(200);
COMMIT;
2.3. Add the indexes for reading messages and Business Entities
Progress does not create indexes for foreign keys itself. Without these two indexes, showing a message or a Business Entity reads the whole table. Run them once. On a large database this can take a while, so plan it outside busy hours.
-- Finds the properties of a message part.
CREATE INDEX idxmsgprtpropprt ON emamsgprtprop (msgprtid);
-- Finds the attributes of a Business Entity.
-- Skip this statement when ema_boattr already has the index idxboa_bo_id from an older version.
CREATE INDEX idxboaboid ON ema_boattr (boa_bo_id);
COMMIT;
2.4. Add the index for the agent filter (optional)
Only when several agents share this database and you switch on the agent filter (connectplaza.analyze.agentfilter=true). Run it before you switch the filter on.
-- Finds the Business Entities of one agent.
CREATE INDEX idxboagent ON ema_bo (bo_agent, bo_msgtsm);
COMMIT;