There is a post in Microsoft Technet that explains how we can change the database connection in the AOS Configuration (Microsoft Dynamics AX 2012 Server Configuration tool).

However, once I did that I found that my AOS services couldn’t start (the AOS Service status was ‘Starting’ but he never did it and I had to restart the server to stop it).
I found the following error message checking the Event Log of the AOS server:


[Microsoft][SQL Server Native Client 10.0][SQL Server]The EXECUTE permission was denied on the object ‘XU_GetSchemaVersion’, database ‘myAX2012DB’, schema ‘dbo’.. The SQL statement was: “{ ? = CALL [dbo].[XU_GetSchemaVersion](?, ?) }”


The “Troubleshoot problems operating the Application Object Server” Microsoft Technet post didn’t solve my problem:


Searching on the Internet I found another one that finally solved my problem: (in French)

This post explains that the problem is fixed after executing the command:

USE [myAX2012DB]
GRANT EXECUTE TO [domainaosserviceaccount]

Please, note that this command can be quite dangerous: it allows to execute each of the existing procedures and also the future procedures that can be added to the database.

In our case, it shouldn’t cause problems because AOS must be able to run any query that it can get.

Thanks to my colleague Rubén Garrigós, who explained me what the SQL Sentence does exactly and warned me about its potential damage.