BAM: Regenerating data for non-RTA views

If you have log-shipped or moved your BAM databases to another environment, you might find that the legacy data in your non-rta view vanishes and only recent data is displayed.

This defeats the purpose of having scheduled aggregations to view data over months. However, there is a way to “reset” your cubes.

In the BAMPrimaryImport database, there is a table called ‘bam_Metadata_AnalysisTasks’. This table keeps track of range of records that the cube processed each time it ran. This range is also used to define the view ‘bam_<cubename>_CompletedInstancesWindow’ that is used to populated the staging tables for aggregation.

The trick is to delete all the records from this table in the BAMPrimaryImport database.

Delete from bam_Metadata_AnalysisTasks where CubeName=’<cubename>’

GO

Insert INTO bam_Metadata_AnalysisTasks(CubeName,MinRecordID,MaxRecordID,LastStartTime,LastEndTime)

VALUES (‘<cubename>’,NULL,NULL,NULL,NULL)

Note: Run the above queries for all the cubes in question. DO NOT RUN IN PROD BEFORE TESTING.

After executing the above command, run the corresponding BAM_AN_<cubename> package. After this has completed, browse to the BAM portal and you will see all historical data again.

Cheers.

Advertisements

BAMAlerts – The activation state cache could not be updated.

If you have log shipped or detached/attached the BAMAlerts databases, you will have issues starting the notification service on the BizTalk server for BAM alerts. The reason for this, when these databases are restored, the the ‘Cross-Database Ownership Chaining’ option on the BAMAlertsApplication and BAMAlertsNSMain databases is disabled and greyed out. Greyed out because it can only be enabled via a script.

cross_chaining

To enable these options, run the following command (you need to be sys-admin):

–set chaining for a database

alter database BAMAlertsApplication set DB_CHAINING ON

GO

alter database BAMAlertsNSMain set DB_CHAINING ON

GO

—-

Once done, you should be able to start the BAM alerts notification service on the BizTalk Server.