Import AXModelStore Log files

When you import an AXModelStore into AX2012 you will encounter the model database log file growing to many gigabytes. Microsoft’s recommendation is to make the log file for the model store database at least 60GB.

If you are not creating a temporary scheme and just doing a full release, then there are a couple of tricks you can use to reduce this explosion of log file size.

Trick 1: Switch the recovery model from full to simple. Typically I never user full for the model database, as I have backs and AXmodelstore files so can easily rebuild, and since development should not happen on a test or production environment there should be no changes to the database, so no need for a full recovery model.

Trick 2: Pre delete the records from the model database. Using the following SQL script you can pre delete the records that the AXModelStore import routine will delete as part of the import:

TRUNCATE TABLE [dbo].[ElementTypes];
TRUNCATE TABLE [dbo].[ModelElementLabel];
TRUNCATE TABLE [dbo].[ModelOperationHistory];
TRUNCATE TABLE [dbo].[ModelManifest];
TRUNCATE TABLE [dbo].[Sources];
TRUNCATE TABLE [dbo].[LayerVersioning];
TRUNCATE TABLE [dbo].[GlobalFieldIdPool];
TRUNCATE TABLE [dbo].[ModelSecurityPolicyTable];
TRUNCATE TABLE [dbo].[MODELSECPOLRUNTIMEEX];
TRUNCATE TABLE [dbo].[ModelSecurityPermission];
TRUNCATE TABLE [dbo].[ModelSecuritySubRole];

delete from [dbo].[ModelSecurityPolicyConstraint];
delete from [dbo].[ModelSecurityPolicy];
delete from [dbo].[ModelManifestCategory];
delete from [dbo].[ModelElementData];
delete from [dbo].[ModelElement];
delete from [dbo].[Model];
delete from [dbo].[Layer];
delete from [dbo].[ModelGroup];

The results: Typically I find the standard model database requires a log file of 30GB with the recovery model set to simple (Trick 1).  If I pre delete the records from the model database (Trick 2) then this will further reduce the log file maximum size to 10GB.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s