Monday, 18 December 2006

Attaching new database to AOS in Dynamicx AX 4 SP1

We are in the process of upgrading our Dynamics AX application from 3.0 to 4.o. After the upgradation of Application, last week we started the database upgradation in Dev environment. We are using SQL 2000 as our DB for the 3.0 application and we have decided to upgrade to SQL 2005 along with this Dynamics application. So after ruinning the upgrade script in Dynamics AX 3.0 we created a db in SQL 2005 and ran the DB migration application. This went well and when we startetd the AOS after this process, it failed to start and gave following error.

"Object Server 01: Internal Error occurred executing stored procedure when creating session for the AOS. "

After a little investigation we found out that there are two stored procedures(createserversessions, createusersessions) missing from the database that we have created. These are not missing when we use Dynamics AX setup to create the database. So if you are not using the setup to do everthing for you, you have to be prepared to do some stuff yourself. I'm adding some steps here that I went through when I tried to do stuff myself.

In Dynamics AX 4.0 SP1 installation setup, you are asked to enter the account under which want to run the AOS service(not present in Dynamics AX 4.0 installer, so you have to change the account in services to run it properly otherwise you'll receive an error that can be viewed in event viewer).

Once you choose that account in the installer, the installer adds this account in the DB Logins and gives it following access to you DB.

- db_datareader
- db_datawriter
- db_ddladmin
- public

if you change your database after the AOS is installed you have to give the user under which AOS is running the above mentioned rights to your database, and create the procedures (createserversessions, createusersessions). These procedures can be copied from the database that was created by the installer. After you create these procedures give the user, under which AOS is running, Execute permission on these procedures and the AOS should start without any error.


This posting is provided "AS IS" with no warranties. Use code at your own risk.

1 comment:

  1. Hi,
    Nice Blog. can I link to my BLOG?
    http://daxguy.blogspot.com/

    Cheers

    ReplyDelete