Thursday, May 21, 2015

Cannot open the datafile file axapden-us.alt

Faced following error after restoring Dynamics AX databases from one AOS server to other.

Cannot open the datafile "C:\Program Files\Microsoft DynamicsAX\60\Server\DAX2012R3\bin\Application\appl\Standard\axapden-us.alt"
Error code from the openrating system: errno = 13.
Look in file 'errno.h' or in the operating system documentation for an explanation. 

It was the account permssion issue. 
Make sure AOS service account must have added into Dynamics AX databases with full permissions (at least db_owner). This AOS service account manages the files located at above mentioned path in error.

In my Case;
Source AOS service was running with domain user account (DOMAIN\AOSService) and Destination AOS service was running under Network Service account. When I restored AX databases from source to destination it overwrite all user accounts in destination database, which means it deleted Network Service account.  
I had two options EITHER to add Network Service account which already has all the permissions as AX was installed from this account as mentioned above OR I have to provide full permissions to the domain user account (DOMAIN\AOSService) in destination Dynamics AX databases.