We recently received some incidents from customers having problems to finish their database upgrade on SQL Server.


An essential part of upgrading SQL Server is running the Database Upgrade Completion, part of the SAP Tools for MS SQL Server, which is delivered within SWPM. It will perform many SAP specific tasks and will also increase the database compatibility level.

During the execution, the error was always the same, in sapinst_dev.log:

Errors when executing sql command: [Microsoft][ODBC SQL Server Driver]Associated statement is not prepared

[Microsoft][ODBC SQL Server Driver][SQL Server]The server principal ‘DOMAIN\sidadm’ already exists.

SOLUTION: If this message is displayed as a warning, you can ignore it. If this is an error, contact SAP support.

Well, the error is actually coherent but somehow strange. Firstly, one of the Database Upgrade Completion tasks is to adjust/modify the accounts <sapsid>adm (or simply <sid>adm or sidadm) and also SAPService<SID>. So, the first workaround was to try with another domain account, in the first case, with a Domain Administrator user. It simply worked!

Since we had already a few cases about this, we released a SAP Knowledge Base Article #2344768 explaining the scenario and the workaround, stating that the investigation for the root cause was still on the way.

The most challenging aspect was that it did not occur in every scenario. In other situations, a simply error was logged:


WARNING    2016-07-19 10:05:16.532 (DOMAINTEST\sidadm) [iaxmbcom.cpp:127] id=dbmodmssql.odbcdll.sql CMssLogger::logMessage

Errors when executing sql command: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not drop login ‘DOMAINTEST\sidadm’ as the user is currently logged in.

SOLUTION: If this message is displayed as a warning, you can ignore it. If this is an error, contact SAP support.


But it didn’t prevent the Upgrade Completion to complete.

I remembered then about the Installation Guide for SAP NetWeaver for SQL Server. It is very specific to not use the <sapsid>adm account for installations, which for the same reason I never used it for a system copy (which in concept, also does a target installation).

Well, turns out, this is also true for running the SAP Tools for MS SQL Server! It wasn’t clear before, but now it is documented in SAP Note 683447 too!

So I have updated the SAP Knowledge Base Article 2344768 stating that the root cause has been determined and now its solution is a final solution. You can still read a preview of this KBA without logging into SAP One Launchpad, but for the full content you have to be logged on.

Recommended readings and resources:

SAP Notes and KBAs:

Number Description
683447 SAP Tools for MS SQL Server
2344768 Database Upgrade Completion fails with “Server Principal Already Exists”
1890950 Generic Installation Options
1609770 Tracing database queries executed by sapinst, SWPM or SAP Tools for SQL Server

Additional spaces:

Database

Software Logistics

SAP NetWeaver Administrator

SAP NetWeaver Technology Platform

About SAP NW on SQL Server PS blog:

SAP NW on SQL Server PS blog is a non-periodic blog about SAP NetWeaver based products on SQL Server, maintained by the Product Support engineers which work on BC-DB-MSS and BW-SYS-DB-MSS components.

About the author:

Luis Darui is a Support Engineer at SAP Product Support, MCP with SQL Server. He works for SAP since 2014, with Databases and Operating systems.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Joshua Lacroix

    Finally! Coming from Oracle where I always used sidadm, by old habbit, I hit this issue and then switch over to domain\administrator

    but this clears it up! thanks!

    (0) 

Leave a Reply