DB Upgrade Failed. Error Executing SQL statement
Doc ID : KB03569
Last Modified : 2007-07-24
Document Type : Support
Environment- BlackBerry® Enterprise Server software version 4.1
- BlackBerry® Enterprise Server software version 4.0 for IBM® Lotus® Domino®
- BlackBerry® Enterprise Server software version 4.0 for Microsoft® Exchange
- BlackBerry® Enterprise Server software versions 4.0 Service Pack 3 (4.0.3) and 4.1 Service Pack 2 (4.1.2) for Novell® GroupWise®
- BlackBerry® Mobile Data System (BlackBerry MDS)
- Microsoft® SQL Server™
- Microsoft SQL Server Desktop Engine (MSDE)
- SDR39550
- SDR94195
Warning: The procedures in this article may involve modifying databases used by the BlackBerry Enterprise Server. This can cause irreparable damage, resulting in unexpected server behavior or service failure. Back up the databases prior to implementing any changes.
Problem
When installing or upgrading the BlackBerry Enterprise Server, you receive the following error message:
DB Upgrade Failed. Error Executing SQL statement.
Although the installation can continue, the BlackBerry Configuration Database will be created with errors and will not function properly.
Cause
There are several possible causes for this problem.
- Clustering on multiple Microsoft SQL Servers has been setup for failover in the environment.
- The MDSS and MDSS_Dis databases already exist.
- Mixed-mode authentication is not enabled.
- The account used to install the BlackBerry Enterprise Server software is not assigned the System Administrator role.
- A duplicate job exists if Microsoft SQL Server configurations are set up in the BlackBerry Server Configuration tool.
- The DefaultData and DefaultLog registry value paths are blank or do not exist.
- The BlackBerry Enterprise Server could not create a backup file of the BlackBerry Configuration Database prior to upgrading the schema.
- The transaction log for the BlackBerry Configuration Database is full.
- The BlackBerry Enterprise Server administration account does not have the necessary permissions on the SQL server to upgrade the database.
Resolution
Complete the appropriate resolution for the cause.
Cause 1 (IBM Lotus Domino only)
Clustering on multiple Microsoft SQL Servers has been set up for failover in the environment. The BlackBerry Enterprise Server installation program is trying to create a similar clustered index in the SyncUserState table during the BlackBerry Configuration Database schema update.
If you upgrade and restart the BlackBerry Enterprise Server, you may receive an error message while setting up Microsoft SQL Server configurations in the BlackBerry Server Configuration panel.
In this case, the
DB_InstallV<date_time>.log file under C:\Program Files\Research In Motion\BlackBerry Enterprise Server\ConfigUtil\db displays the following entries:
[10000] (12/09 16:11:42):{0x1468} SQL Error Message fromCBESDBInstaller::ExecuteSql.executeDirect: SQLSTATE: 42000 Native error:
1902 Message: Cannot create more than one clustered index on table 'SyncUserState'. Drop the existing clustered index 'SyncUserState6' before creating another.
Resolution
Contact the Microsoft SQL Server database administrator to delete the clustered index as stated in the
DB_InstallV<date_time>.log file.
Once this index is deleted, close the BlackBerry Enterprise Server add-in task in the IBM Lotus Domino console and configure the BlackBerry Configuration Database again in the BlackBerry Server Configuration Panel.
- Go to the BlackBerry Server Configuration panel.
- Click the Database Connectivity tab.
- Click the Change Database button.
- Re-type the Microsoft SQL Server and BlackBerry Configuration Database name and complete the configurations.
- Restart the BlackBerry Enterprise Server add-in task.
Cause 2
The MDSS and MDSS_Dis databases already exist.
Resolution
Delete the existing BlackBerry Configuration Databases from the MSDE or Microsoft SQL Server (depending on the environment), and then continue the installation process. This should create the BlackBerry Configuration Database.
Cause 3
Mixed-mode authentication is not enabled.
Resolution
Complete the following steps:
- Enable mixed-mode authentication. For more information, search for article 325022 in the Microsoft Support Knowledge Base.
- Delete the existing BlackBerry Configuration Databases from the MSDE or Microsoft SQL Server (depending on your environment), and then continue the installation process. This should create the BlackBerry Configuration Database.
Cause 4
The account used to install the BlackBerry Enterprise Server software is not assigned the System Administrator role.
Resolution
Complete the following steps:
- Grant the System Administrator role to the account being used for installation.
- Delete the existing BlackBerry Configuration Databases from the MSDE or Microsoft SQL Server (depending on the environment), and then continue the installation process. This should create the BlackBerry Configuration Database.
Cause 5
A duplicate job starting with RIM (such as RIMPurgeHistoryBESMgmt) exists. The
setup<date>.log file located in <drive>:\Program Files\Research In Motion\BlackBerry Enterprise Server\logs\installer displays the following lines:
SQL Error Message from CBESDBInstaller::ExecuteSql.executeDirect: SQLSTATE: 42000 Native error: 14293 Message: There are two or more jobs named 'RIM<job_name>'. Specify @job_id instead of @job_name to uniquely identify the job
The duplicate job exists because there is a new machine name for the Microsoft SQL Server or MSDE Server.
There are multiple resolutions associated with this cause.
Resolution 1
If you have Microsoft SQL Server Enterprise Manager installed, complete the following steps:
- Open the Microsoft SQL Server Enterprise Manager.
- Expand the BlackBerry Enterprise Server hosting the BlackBerry Configuration Database.
- Go to Management/SQL Server Agent and select Jobs.
- Delete all job instances that begin with RIM.
- Restart the installation process.
If you do not have Microsoft SQL Server Enterprise Manager installed, complete the following steps:
- Connect to the BlackBerry Configuration Database.
- At the command prompt, type one of the following commands:
For Microsoft Windows® Trusted Authentication:osql -S <BlackBerry_Enterprise_Server_name> -E
For Microsoft SQL Server Authentication:osql -S <BlackBerry_Enterprise_Server_name> -U <user_name> -P <password>
- To remove the duplicate job, type the following commands in the specified order:
1> use msdb
2> go
1> select job_id, name from sysjobs
2> where name = 'RIM<job_name>'
3> go
The results of the query are returned as shown below.
1> EXEC sp_delete_job @job_id = '<id string from the above query>'
2> go
- Repeat the following commands from the previous step for each job_id returned in the previous step's query: 1> EXEC sp_delete_job @job_id = '<id string from the above query>'
2> go
- Close the command prompt.
Resolution 2
Change the computer name of the Microsoft SQL Server or MSDE Server back to its original name. For more information, search for article 281642 in the
Microsoft Support Knowledge Base.
Resolution 3
Back up the original BlackBerry Configuration Database and restore it with a different name. Then, perform the BlackBerry Enterprise Server upgrade again.
- Complete steps 1 and 2 in Cause 5, Resolution 1 (when Microsoft SQL Server Enterprise Manager is not installed).
- At the command prompt, type the following commands in the specified order:
1> backup database <database_name> to disk = 'c\<filename>'
2> go
1> restore database <database_name>2 from disk = 'c:\<filename>' with recovery, replace
2> go
- Upgrade the BlackBerry Enterprise Server software version again.
Cause 6
The DefaultData and DefaultLog registry values that correspond to the default data directory and the default log directory exist, but the folder paths in the registry values are blank or do not exist.
Resolution
For more information, search for article 836873 in the
Microsoft Support Knowledge Base.
Cause 7
The BlackBerry Enterprise Server could not create a backup file of the BlackBerry Configuration Database prior to upgrading the schema.
In this case, the
DB_InstallV<date_time>.log file under C:\Program Files\Research In Motion\BlackBerry Enterprise Server\ConfigUtil\db has the following entries:
[10000] (02/26 15:55:20):{0x1784} SQL Error Message from CBESDBInstaller::ExecuteSql.stillEx: SQLSTATE: 42000 Native error: 3202 Message: Write on 'C:\NotesBESMgmt\data\NotesBESMgmtBKUP.bak' failed, status = 112. See the SQL Server error log for more details.
[10000] (02/26 15:55:20):{0x1784} SQL Error Message from CBESDBInstaller::ExecuteSql.stillEx: SQLSTATE: 42000 Native error: 3013 Message: BACKUP DATABASE is terminating abnormally.
[10000] (02/26 15:55:20):{0x1784} Terminating because backup had a problem. See log file for details
Workaround
Back up the BlackBerry Configuration Database manually and clear the
Backup database checkbox during the installation.
The upgrade should finish correctly. It is advisable to create a backup of the BlackBerry Configuration Database prior to any upgrade in case you must return to a previous version.
Cause 8
The BlackBerry Configuration Database transation log is full.
Resolution
Refer to
KB03968 to enlarge or shrink the transaction log for the BlackBerry Configuration Database.
Cause 9
The BlackBerry Enterprise Server administration account does not have the required permissions on the Microsoft SQL Server to upgrade the BlackBerry Configuration Database.
Resolution
Refer to
KB03633 to apply the necessary SQL permissions for the BlackBerry Enterprise Server administration account.