VMware Cloud Community
GlobalChange
Contributor
Contributor

vSphere 4.1 to 5 Upgrade, Database Update Fails.

So I'm trying to update our development VirtualCenter server to 5 and the upgrade fails when it tries to upgrade the database with the error "Exception thrown while executing SQL script". Looking in the VCDatabaseUpgrade.log file I find it's getting stuck on this command:

exec sp_rename 'VPX_LIC_METADATA', 'VPX_LIC_METADATA_OLD';
[10/19/2011 4:18:02 PM] Error: Failed to execute command: exec sp_rename 'VPX_LIC_METADATA', 'VPX_LIC_METADATA_OLD';
[10/19/2011 4:18:02 PM] Got exception: ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]No item by the name of 'VPX_LIC_METADATA' could be found in the current database 'vCenter', given that @itemtype was input as '(null)'.
[10/19/2011 4:18:02 PM] Error while upgrading: ERROR [42000] [Microsoft][SQL Server Native Client 10.0][SQL Server]No item by the name of 'VPX_LIC_METADATA' could be found in the current database 'vCenter', given that @itemtype was input as '(null)'.
[10/19/2011 4:18:02 PM] Info: Exiting Upgrade Wizard
[10/19/2011 4:18:02 PM] Successfully run: alter database [vCenter] set recovery SIMPLE

After restoring the database and looking at it in SQL Explorer I see there is no VPX_LIC_METADATA table, the closest one being VPX_LICENSE.

Anyone have some insight as to why this might be occuring and what I can do to fix it? Let me know if you need any additional info or log files.

Thanks heaps!

0 Kudos
4 Replies
rothb
Enthusiast
Enthusiast

Hello,

according to this KB Article there seems to be something gone wrong with your DB. Try the steps described in the KB Article. I think this will resolve your issue.

Best regards,

Bjoern

GlobalChange
Contributor
Contributor

Hi Bjoern,

Thanks for the link, I followed the instructions but they didn't fix my problem. I'm not sure how it happened but it seems our database is missing several tables that the upgrade process looks for. After removing a couple lines from the database upgrade script (just the ones renaming the non-existant tables) I finally hit on a foreign key dependency error.

I did notice that the first part of the database upgrade script changes the database version number. Figuring that the database might be mislabelled as 4.1 instead of 4.0 (it's database looked similar to our other VirtualCenter servers which are 4.0) I tried changing the database version to see if that worked but unfortunately it didn't. I'm not entirely sure what's happened to our database but it doesn't seem to be upgradable.

I'm installing a new server and adding all the hosts back in manually. It's only our dev environment so no big loss. If I encounter the same problem with our prod servers I'll come back to this dicussion.


Thanks for your help!

- Dave

0 Kudos
seadl
Contributor
Contributor

What database are you running on 4.1.

If it is sql 2005 express than you may have some problems.

MS SQL Server 2005 Express

supported :No

After you upgrade to a database server that is supported by vCenter

Server, you can install or upgrade to vCenter Server.

MS SQL Server 2005

supported:Yes

You can install or upgrade to vCenter Server.

MS SQL Server 2008 Express

supported:No

You can perform a fresh installation of vCenter Server 5.0.

You cannot upgrade because vCenter Server 5.0 is the first release that.

The above is a cutout from the PDF that VMware has for upgade path, if I understood it well.

Hope it helps.

0 Kudos
vmprofessor
Contributor
Contributor

Hi,

I had the same issue and after 26 hours working on it i have found the solution !! first of all i was not as lucky as you because mine was production env.

to solve it find a vSphere 4.1 database that's running and have all the tables. Run SQL Mgmt Studio to connect to DB. Copy missing tables to your problematic DB.

I've copied all VPX_LIC_* to problematic db. (because after i only copied vpx_lic_metdata i received another missing table info)

ps : to get the table right click on it and select ''script table as --> Create to --> new query editor window''

Please let me know if you have any trouble

All the Best

Muharrem

0 Kudos