Technical FAQs

Ask a Question

Side by Side IONE 6.0.1 to PME 8.0 Upgrade - 'FIX_IONMaintenance_Users.sql' query fails

Issue
During the Side by Side IONE 6.0.1 to PME 8.0 Upgrade, the 'Re-sync the database users with the SQL server logins' step requires that the 'FIX_IONMaintenance_Users.sql' query be executed in order to update the IONMaintenance user. This script deletes the IONMaintenance user in all four Power Monitoring Expert databases and the IONMaintenance user from Security > Users. The script then recreates the IONMaintenance user and associates it with the new server name, computer, and login. The new user is set with the correct memberships (db_ddladmin, db_backupoperater, and Maintenance). 

When attempting to execute the query within SQL Server 2008 R2, SQL server management studio will return:

Incorrect syntax near 'ADD'.  Expecting WITH

Product Line
StruxureWare Power Monitoring Expert Base, Data Center Edition

Environment
Power Monitoring Expert 8.x, SQL Server 2008 R2 Standard/Express

Cause
The FIX_IONMaintenance_Users.sql script was developed for SQL Server 2012 or later.

Resolution
**Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.

The 'ALTER ROLE' function in the 'FIX_IONMaintenance_Users.sql' script is required to be to modified to reflect the syntax below:

sp_addrolemember [ @rolename = ] 'role', [ @membername = ] 'security_account'

** The 'sp_addrolemember' function was removed from subsequent versions of SQL Server. Only use this SQL transaction in SQL Server 2008 R2.

Example:

ALTER ROLE [db_backupoperator] ADD MEMBER [IONMaintenance]

to the following:

exec sp_addrolemember @rolename = 'db_backupoperator', @membername = 'IONMaintenance'


 
Was this helpful?
What can we do to improve the information ?