Wednesday, March 26, 2008

General Troubleshooting

Okay...something is acting weird. A field does not display correctly, the app stops working correctly, a workflow says its doing one thing but it looks like it's doing something else. What do you do to troubleshoot the problem? Here are some suggestions:

  1. Look for a pattern. Can you recreate what just happened?
  2. Look in the server.log (and output.log for Weblogic). Do you see any strange error messages? (I will post a future blog entry for troubleshooting log messages)
  3. If the problem appears to be with workflows, turn on workflow logging and look at every workflow that fires. Many workflows call other workflows, so this could take a few iterations.
  4. Are the issues related to performance? If you have access to a DBA, ask them to help identify the long running SQL queries and run and explain plan. Look at my posting about analyzing long running SQL queries.
  5. If the issues are related to specific records in the database, use TOAD (or a similar tool) to compare good records with bad records in both the T_BONAME table and IBS_SPEC table. Are there any inconsistencies between good and bad records?
  6. Are objects stuck in a "bad" state? Use TOAD to be sure the sys_objectstate in the T_BONAME table and object_state in the IBS_SPEC table - be sure these match. These field can be updated to put the object into a valid state.
  7. Are fields not getting filled out by workflow as expected? Check the field length of the desination fields to be sure you're not trying to push 150 characters into a 100 character field
At some point in the future I will expand on this topic.....

Monday, March 17, 2008

Object Name Exists Error Message

If you see an error message in the application that reads "Record can not be saved as another Record with the same name exists within the Business Object" and you can't find another record with the same name in the application, you may want to run the following SQL query to see if you have any records in the database where the spec_name field is null in the IBS_SPEC table. The query below will show a count of these records with the biggest offenders at the top of the list.

select count(*), type_name from IBS_SPEC
where spec_name is null
group by type_name
order by count(*) desc

Fixing Objects Stuck in the Wrong State

This post was removed at TRIRIGA's request.  Please email me if you need additional information.  

Friday, March 14, 2008

Search For Orphan Associations

The script below will run for a very long time but should ultimately come back with all the BOs that have "orphans" in IBS_SPEC_ASSIGNMENTS and total distinct orphan count for each.

SELECT ist.NAME "BO Name", ist.spec_template_id "BO ID",
COUNT (1) "Orphan Count"
FROM (SELECT DISTINCT spec_id, spec_template_id
FROM (SELECT isa1.spec_id, isa1.spec_template_id
FROM ibs_spec_assignments isa1
WHERE NOT EXISTS (
SELECT 1
FROM ibs_spec ibs1
WHERE ibs1.spec_id =
isa1.spec_id)
UNION ALL
SELECT isa2.ass_spec_id, isa2.ass_spec_template_id
FROM ibs_spec_assignments isa2
WHERE NOT EXISTS (
SELECT 1
FROM ibs_spec ibs2
WHERE ibs2.spec_id =
isa2.ass_spec_id))) orphans
INNER JOIN
ibs_spec_type ist ON ist.spec_template_id = orphans.spec_template_id
GROUP BY ist.NAME, ist.spec_template_id
ORDER BY 3 DESC;

Momentum Migration Fails on Validation

If the "heartbeat" from the upgrade conversion stops during
the validation phase (server.log file)
indicates "Validating row 18000/400000" or similar) then this
is the script to run as user TRIRIGA on the database:

UPDATE ENVIRONMENT_PROPERTIES SET VALUE = 'false' WHERE
ENVIRONMENT = 'SYSTEM' AND PROPERTY = 'LOCK';
COMMIT;

Then, if necessary, kill the java processes on app server (killall -KILL
java) and restart Jboss/weblogic instance; it will skip the
validation step and go on.

Tuesday, March 4, 2008

Monitoring System Workflows

Workflows generated by the system, such as ones triggered by scheduled events, can be difficult to monitor in the Administrator Console since they do not have a user name associated with them. If you run the following SQL against the tririga schema, these events will now show that they are owned by "Crazy User" and can be viewed in any of the Workflow Event Queue Statistics options.

INSERT INTO user_credentials
(user_id, company_id, user_account, admin_console_permissions)
VALUES
(0, 208133, 'Crazy User', 0);