VMware Cloud Community
MikeZirbes
Contributor
Contributor

Need help with database upgrade from 4.0 to 4.1 - SQL question

I am not an SQL expert so I need some basic help with the following pre upgrade procedures.

From KB1026688

1.Download the appropriate script for your environment. The scripts are attached to this article (located in the Attachments section at the bottom of this article).

2.Unzip the scripts.

3.Run the scripts on vCenter Server 4.0 database.

How do I actually run the script against my database and how am I notified of the results?

I believe this note applies to my environment but I do not know how to configure the script to run.

Note: The SQL query must be run with fully qualified database table names. If you have multiple database instances, there may be a need to qualify the tables with the db-instance name and the db-owner name.

4.If no results are returned, you can continue with the upgrade

Thanks for your help

Tags (3)
0 Kudos
6 Replies
Dave_Mishchenko
Immortal
Immortal

Moved to the vCenter Server forum.




Dave

VMware Communities User Moderator

Now available - vSphere Quick Start Guide

Do you have a system or PCI card working with VMDirectPath? Submit your specs to the Unofficial VMDirectPath HCL.

0 Kudos
pcerda
Virtuoso
Virtuoso

Hi,

You have to use the Microsoft SQL Server Management Studio in order to run a SQL Query. You have to create a new SQL query and paste the script that you have downloaded.

You have to run this query pointing to the vCenter Database




Regards / Saludos

-


Patricio Cerda !http://www.images.wisestamp.com/linkedin.png!

VMware VCP-410

Join to Virtualizacion en Español group in Likedin

See My Blog

See My Linkedin Profile

-


Si encuentras que esta o cualquier otra respuesta ha sido de utilidad, vótalas. Gracias.

If you find this or any other answer useful please consider awarding points by marking the answer helpful or correct. Thank you.

Regards / Saludos - Patricio Cerda - vExpert 2011 / 2012 / 2013
0 Kudos
Aberdean
Contributor
Contributor

Sounds like I was doing everything right when I tried the first time.

How do I know I am pointing to the database?

In SQL Server Mgmt Studio I have highlighted my database.

R-Click abd selected "New Query"

Dragged the "getInconsistentVMInfo_mssql.sql" into the window.

The query then contains the Query command listed below. Do I need to modify it in some way?

I click Execute and the Query runs in about 2 sec and does not seem to return any feedback.

The Results Tab says "Query Executed Successfully"

The Messages Tab shows: "(0 row(s) affected)"

Does thsis mean I have no problems with the database?

Thanks again for your assistence.

Query Command:"/* Query for : */

/* a. missing VMs with missing virtual controllers */

/* b. incompatible shares level */

/* c. VMs with non-existent parent file backing IDs */

/* d. VM backing with VMs incorrect device-key */

/* e. VM with snapshot having non-existent parent file backing IDs */

/* f. VM with snapshots that have backing with VMs incorrect device-key */

SELECT T1.ID, T1.NAME FROM VPX_VM_CONFIG_INFO T1 WHERE (T1.ID IN (SELECT T2.ID FROM VPX_VIRTUAL_DEVICE T2 WHERE T2.DEVICE_INFO_LABEL LIKE 'SCSI controller%' AND NOT EXISTS (SELECT 1 FROM VPX_VIRTUAL_SCSICONTROLLER WHERE VDEVICE_ID = T2.VDEVICE_ID)) OR (T1.ID IN (SELECT T2.ID FROM VPX_VIRTUAL_DEVICE T2 WHERE T2.VPX_TYPE LIKE 'vim.vm.device.Virtual%Controller' AND NOT EXISTS(SELECT 1 FROM VPX_VIRTUAL_CONTROLLER WHERE VDEVICE_ID=T2.VDEVICE_ID)))OR ((SELECT ISNUMERIC(CPU_ALLOCATION_SHARES_LEVEL) FROM VPX_VM_CONFIG_INFO WHERE ID=T1.ID) = 1) OR ((SELECT ISNUMERIC(MEM_ALLOCATION_SHARES_LEVEL) FROM VPX_VM_CONFIG_INFO WHERE ID=T1.ID) = 1) OR (T1.ID IN (SELECT DISTINCT(VM_ID) FROM VPX_VDEVICE_FILE_BACKING WHERE FILE_BACKING_PARENT_ID NOT IN (SELECT BACKING_ID FROM VPX_VDEVICE_BACKING_REL))) OR (T1.ID IN (SELECT DISTINCT(VM_ID) FROM VPX_VDEVICE_FILE_BACKING AS T2 WHERE UPDATE_KEY != (SELECT DEVICE_KEY FROM VPX_VIRTUAL_DEVICE WHERE VDEVICE_ID = (SELECT VDEVICE_ID FROM VPX_VDEVICE_BACKING_REL WHERE BACKING_ID = T2.BACKING_ID)))) OR (T1.ID IN (SELECT DISTINCT(VM_ID) FROM VPX_SNAPSHOT WHERE ID IN (SELECT SNAPSHOT_ID FROM VPX_SN_VDEVICE_FILE_BACKING WHERE FILE_BACKING_PARENT_ID NOT IN (SELECT BACKING_ID FROM VPX_SN_VDEVICE_BACKING_REL)))) OR (T1.ID IN (SELECT DISTINCT(VM_ID) FROM VPX_SNAPSHOT WHERE ID IN ( SELECT SNAPSHOT_ID FROM VPX_SN_VDEVICE_FILE_BACKING AS T3 WHERE UPDATE_KEY != (SELECT DEVICE_KEY FROM VPX_SN_VIRTUAL_DEVICE WHERE VDEVICE_ID = (SELECT VDEVICE_ID FROM VPX_SN_VDEVICE_BACKING_REL WHERE BACKING_ID = T3.BACKING_ID))))) );

0 Kudos
pcerda
Virtuoso
Virtuoso

Hi, you did it right

If you don't get any result when you run the query, then you don't have any problem with the database. You can continue with the upgrade process.

good luck!




Regards / Saludos

-


Patricio Cerda !http://www.images.wisestamp.com/linkedin.png!

VMware VCP-410

Join to Virtualizacion en Español group in Likedin

See My Blog

See My Linkedin Profile

-


Si encuentras que esta o cualquier otra respuesta ha sido de utilidad, vótalas. Gracias.

If you find this or any other answer useful please consider awarding points by marking the answer helpful or correct. Thank you.

Regards / Saludos - Patricio Cerda - vExpert 2011 / 2012 / 2013
0 Kudos
MikeZirbes
Contributor
Contributor

Thanks for the repley.

Well that elimates the variable of my knowledge in reagrds to applying the updates. My first attempt at updating to 4.1 was performed just as layed out in this thread. After applying the updates my VirtualCenter Server service failed to start. So I had to roll back.

That said I must have some other problem with the update.

Thanks for your help.

0 Kudos
MikeZirbes
Contributor
Contributor

Turns out the credentials for the servies would not work. I set the services to local system and I am up and running.

0 Kudos