Optimizing the model store

This is included here as the task should be considered as part of the general performance-related tasks. You need to optimize the model store as changes are made to the model store (install a model, import model store, or apply a hotfix).This routine performs a set of database optimization tasks on the Model store database (including re-index and database shrink). These could (and should), therefore, be automated as part of your SQL maintenance plan.

For releases prior to R2, the model store was included in the main database. You should, therefore, not run this task prior to R2 on large databases.

Getting ready

To optimize the model store, you should prepare by carrying out the following steps:

  1. Ensure that you have Dynamics AX 2012 Management Shell installed on the computer that you wish to use. This is installed from the AX 2012 installation media.
  2. Drain users from all AX Servers in the target environment.
  3. Shut down all AX Servers for the environment into which you are importing. Refer to Chapter 4, Setting up and Managing the Application Object Server, for more details on this.
  4. Ensure that your Windows Account has the following rights for SQL Server:
    • In the SQL Server instance hosting the AX databases: Securityadmin or a higher-privileged user
    • On the AX databases: db_owner
  5. Ensure that your Windows Account has administrative permissions on the local computer.
  6. Ensure that your Windows Account is mapped to a user in AX that has system administrator rights.
  7. You should ensure that you know the following pieces of information:
    • SQL Server name that hosts the AX databases
    • AX model store database (ends in _model)

In this example, the following information is used:

SQL Server

Zeus

Database name

MicrosoftDynamicsAXR2_model

How to do it...

The following steps are performed within Microsoft Dynamics AX 2012 Management Shell, which is the PowerShell with preloaded AX PowerShell commands:

  1. Open Management Shell.
    • For Windows 8 or Windows Server 2012, search for Management shell, and click on the result, Microsoft AX 2012 Management Shell
    • For Windows 7 or Windows Server 2008, open Administration Tools from the Windows Start menu, and open Microsoft AX 2012 Management Shell
  2. To optimize the model store, enter the following command:
    Optimize-AXModelStore –server Zeus –database MicrosoftDynamicsAXR2_model
  3. The preceding command will return the following message:
    Reorganizing ModelStore. You can continue with other tasks.
    

    This will take some time to complete.

  4. Once complete, the system returns the cursor, but no message will be displayed.
  5. You can now start the AX services.

How it works...

The optimize command issues re-index and DBCC Shrink Database commands to SQL Server for the model store database (ends with _Model). This will improve the general AX performance and responsiveness.

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.59.0