Database troubleshooting


This topic provides information on how to analyze and troubleshoot problems that you might experience when using BMC TrueSight Report Engine with Oracle or SQL Server database:

Data collection stops

When using Microsoft SQL Server database, if you give the sysadmin role to a Report Engine database user, you may encounter data collection failures.

To resolve this issue, remove the sysadmin role from the Report Engine database user and restart the Report Engine service. For more information, see the KA423826 Knowledge Article.

Database troubleshooting queries

  • To check Oracle scheduled jobs, ensure that no job is broken, and the next scheduled run is showing correct value where some jobs are scheduled for hourly run and some jobs are for once-a-day run by running the following query:

    select to_char(next_date,'dd-mm-yyyy hh24:mi:ss')||', '||broken||', '|| what from user_jobs order by next_Date;
  • To check data collection, run the following query which will display date, time, number of data points collected for that hour, number of distinct devices, and number of distinct attributes from the previous day:

    select reuniv.rpt_to_char(reuniv.rpt_trunc(TIMERECORDED,'HH24'),'dd-Mon-yyyy hh24:mi:ss'),count(*), count(distinct MOTYPEID), count(distinct ATTRIBUTEID) from stats_data where timerecorded> reuniv.rpt_trunc(reuniv.rpt_sysdate()-1,'DD') group by reuniv.rpt_trunc(TIMERECORDED,'HH24') order by reuniv.rpt_trunc(TIMERECORDED,'HH24');
  • If you don't receive the daily_data and hourly_data in the database, check whether SQL Server Agent service or Oracle Scheduled job is running according to the database you are using. 
  • The following query displays data from Hourly data table. If the number of devices and attributes are less than the above query, then it shows that the hourly summarization job is not working.

    select reuniv.rpt_to_char(TIMERECORDED,'dd-mm-yyyy hh24:mi:ss'),count(*), count(distinct MOTYPEID), count(distinct ATTRIBUTEID) from hourly_data where timerecorded> reuniv.rpt_trunc(reuniv.rpt_sysdate()-1,'DD') group by TIMERECORDED order by TIMERECORDED;
  • The following query displays data from Daily data table. If the number of devices and attributes are less than the above query, then it shows that the daily summarization job is not working.

    select reuniv.rpt_to_char(TIMERECORDED,'dd-mm-yyyy'),count(*), count(distinct MOTYPEID), count(distinct ATTRIBUTEID) from daily_data where timerecorded> reuniv.rpt_trunc(reuniv.rpt_sysdate()-10,'DD') group by TIMERECORDED order by TIMERECORDED;
  • The following query lists all the attributes from which the report engine is collecting data. If you do not see attributes for which you want to collect data, then add them to BMC TrueSight Infrastructure Management Server under external report attribute set. 

    select reuniv.rpt_concat(reuniv.rpt_concat(ATTRIBUTESETNAME,','), ATTRIBUTENAME) from externalreportattributeset order by ATTRIBUTESETNAME, ATTRIBUTENAME;
  • To be able to get data in the reports in Oracle connection, perform the following steps:
    • Login to the RE Database using the reuniv DB user credentials.
    • Execute following command where redbuser is the RE Database user

      exec create_synonym_reuniv(‘redbuser’);
  • To get the errors related to Oracle jobs, run the get_re_log_table_message.sql script available at %BMC_PROACTIVENET_REPORTENGINE_HOME%\ReportEngine\schema\developer\oracle.
  • To get the error details related to the SQL Server job, run the following query and export the output in SQL Server Studio

    select err_time ,err_msg from re_log with (nolock) order by id

Database jobs

Following are the various jobs scheduled in the Report Engine Database. You can use following schedules in case of any issues in job scheduling.

 

Database Edition

Type of job

Job Name (In SQL server, the job names are similar except it has the database and login name in the job title and names has _ instead of .)

Scheduled Time

Standard Edition and Enterprise Edition

Every hour

update_dst_offset;

14:00

Standard Edition and Enterprise Edition

Daily once

pr_analyze_config_tables;

0:00

Standard Edition and Enterprise Edition

Daily once

RE_DAILY_JOB;

21:30

Standard Edition and Enterprise Edition

Every hour

RE_HOURLY_JOB;

14:00

Standard Edition and Enterprise Edition

Daily once

pk_purgedata.pr_purge_data;

00:15 in Oracle and 22:00 in SQL Server

Enterprise Edition

Daily once

pk_updateSummaryTables_EE.FIND_NEW_DATA_IN_TABLE('HOURLY_DATA');

5:00

Standard Edition

Daily once

pk_updateSummaryTables.PR_HOURLYTODAILY;

06:00 in Oracle. 00:15 in SQL Server

Enterprise Edition

Daily once

pr_scheduled_Add_partitions;

0:15

Standard Edition and Enterprise Edition

Every hour

pk_updateSummaryTables.PR_STATSTOHOURLY;

14:00

Standard Edition and Enterprise Edition

Daily once

pk_create_thresholds.pr_call_CREATE_ALL_THRESHOLDS;

5:00

Standard Edition and Enterprise Edition

Every hour

MV_REFRESH_VW_CONFIGDATA; ( Applicable to Only Oracle)

14:00

Standard Edition and Enterprise Edition

Daily once

pk_updateSummaryTables.MV_CREATEANDREFRESH; ( Applicable to Only Oracle)

0:00

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC TrueSight Reporting 9.6