VMware Cloud Community
marxk
Contributor
Contributor

Database upgrade failed - Is my database name too long?

I was in the process of performing an upgrade to the latest version of vc. I got to the database upgrade wizard and selected to keep the old data. It did a portion of the upgrade and failed. Below is the line from the log indicating the failure. My database is named 'ITOS_VirtualCenter_WIN' Is this longer than the allowed number of characters? I am also wondering if the SQL server name is causing a problem. It is a SQL cluster with a named instance. 'RICSV103SQL01\RICSV103SQL01'

Is there a workaround?

Error: Failed to execute SQL procedure. Got exception: ERROR [SQL Native Client][SQL Server]The specified @database_name ('ITOS_VirtualCenter_W') does not exist.

Error: Failed to execute command: BEGIN TRANSACTION DECLARE @JobID BINARY(16) DECLARE @ReturnCode INT DECLARE @VARDBNAME VARCHAR(20) SELECT @ReturnCode = 0 IF ((select serverproperty('edition')) = 'Express Edition') GOTO EndSave select @VARDBNAME = db_name(dbid) from master..sysprocesses where spid=@@SPID IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'Stats Rollup') < 1 EXECUTE msdb.dbo.sp_add_category @name = N'Stats Rollup' SELECT @JobID = job_id FROM msdb.dbo.sysjobs WHERE (name = N'Past Day stats rollup') IF (@JobID IS NOT NULL) BEGIN EXECUTE msdb.dbo.sp_delete_job @job_name = N'Past Day stats rollup' SELECT @JobID = NULL END BEGIN EXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_id = @JobID OUTPUT , @job_name = N'Past Day stats rollup', @description = N'This job is to roll up 5 min stats and should run every 30 mins', @category_name = N'Stats Rollup', @enabled = 1, @notify_level_email = 0, @notify_level_page = 0, @notify_level_netsend = 0, @notify_level_eventlog = 2, @delete_level= 0 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID, @step_id = 1, @step_name = N'Past day stats rollup', @command = N'EXECUTE stats_rollup1_proc', @database_name = @VARDBNAME, @server = N'', @subsystem = N'TSQL', @cmdexec_success_code = 0, @flags = 4, @retry_attempts = 0, @retry_interval = 0, @output_file_name = N'', @on_success_step_id = 0, @on_success_action = 3, @on_fail_step_id = 0, @on_fail_action = 2 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID, @step_id = 2, @step_name = N'Delete past day rolled up records', @command = N'exec purge_stat1_proc', @database_name = @VARDBNAME, @server = N'', @subsystem = N'TSQL', @cmdexec_success_code = 0, @flags = 0, @retry_attempts = 0, @retry_interval = 1, @output_file_name = N'', @on_success_step_id = 0, @on_success_action = 1, @on_fail_step_id = 0, @on_fail_action = 2 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback EXECUTE @ReturnCode = msdb.dbo.sp_update_job @job_id = @JobID, @start_step_id = 1 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback EXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID, @name = N'30 min schedule', @enabled = 1, @freq_type = 4, @active_start_time = 10000, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @freq_relative_interval = 0, @freq_recurrence_factor = 0, @active_end_date = 99991231, @active_end_time = 235959 IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback EXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @JobID, @server_name = N'(local)' IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback END COMMIT TRANSACTION GOTO EndSave QuitWithRollback: IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION EndSave:

Error: Aborting upgrade because of an exception. Exception details: ERROR [SQL Native Client][SQL Server]The specified @database_name ('ITOS_VirtualCenter_W') does not exist.

Info: Stopping progress monitor

Info: Cleaning Up Database

Info: Rolling back database from version 4 to version 3

Reply
0 Kudos
30 Replies
marxk
Contributor
Contributor

Alright now I have a bigger problem. The install failed of course because the database upgrade failed but it appears that the virtualcenter server portion was upgraded or somehow modified as now the service can no longer start. So this also means I cannot restart the install because it cannot connect to the virtualcenter server. I see the files in the VPX.cab file but cannot afford to muck this thing up much more than it is. So anyone have any suggestions on how to fix this?

Reply
0 Kudos
mcocat
Enthusiast
Enthusiast

I am having the same problem after a failed upgrade. Uninstall VC 2.5 (it is installed) and reinstall vc 2.0.2 with your restored DB. That should get you back to where you started.

Reply
0 Kudos
esiebert7625
Immortal
Immortal

It may of failed because of permissions, see this technote...

Administrative Credentials are Required for Oracle and SQL Database when Installing or Upgrading VirtualCenter - http://kb.vmware.com/kb/1003052

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

marxk
Contributor
Contributor

I got an error about the permissions when it first started and I did fix it. Is was just when the database upgrade started that the problem happened.

Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

I am also having this exact same problem, I have a call logged with VMWare and have tried the install and then uninstall several times now. Will let you know if I get a resolution.

Also using a clustered SQL database.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

just to mention, the errors in my log files are...

Error: Failed to execute SQL procedure. Got exception: ERROR [SQL Native Client][SQL Server]Error: The new name 'ARG_DATA_OLD' is already in use as a COLUMN name and would cause a duplicate that is not permitted.

Error: Failed to execute command: EXEC sp_rename 'VPX_EVENT_ARG.[ARG_DATA]', 'ARG_DATA_OLD', 'COLUMN'

Error: Aborting upgrade because of an exception. Exception details: ERROR [SQL Native Client][SQL Server]Error: The new name 'ARG_DATA_OLD' is already in use as a COLUMN name and would cause a duplicate that is not permitted.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Had an official answer from VMWare which i am sure will fix the problem....

"Delete the database and start again"

To me, an untrained SQL person, i am thinking i will rename the column ARG_DATA_OLD to something else first and see what happens.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
esiebert7625
Immortal
Immortal

Ha what a lovely solution, just delete the database and start over. VMware support seems to not want to have anything to do with alot of database issues if they aren't sure what to do. They probably aren't dba's but they should at least be able to provide a better solution than that.

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Reply
0 Kudos
esiebert7625
Immortal
Immortal

It looks like in your case it is trying to rename the VPX_EVENT_ARG table to ARG_DATA_OLD and cannot because one already exists. Check and see if that table is there. It must rename it, create a new one and then copy the data from the old to the new as part of the upgrade. If it does exist try and delete it and run the upgrade again. Here's what that table is:

VPX_EVENT_ARG - This corresponds to the VPX_EVENT table and contains event ids, argument types & data and miscellaneous IDs. This table is usually pretty large and contains the text of the events from the VPX_EVENT table. This table has 14 columns and usually has more records then the VPX_EVENT table, 150,000 records will generally use about 20MB of space.

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Reply
0 Kudos
esiebert7625
Immortal
Immortal

Actually it looks like ARG_DATA is a column in the VPX_EVENT_ARG table. So what it must be doing is trying to add a new column called ARG_DATA_OLD as part of the upgrade and that column most already exist. They should check if it exists first and delete the column rather then throw an error and quit.

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Totally agree, i will rename it and give it another go, but im starting to wonder how many of these i may need to rename if they are not even checking and failing at the first hurdle.

Likelyhood is that the _OLD one is from a previous uograde anyway !?

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Forgot to say, amazing website, been a fan for a while now.

Any chance of an RSS feed though so i can keep up with your information ? Couldnt see one on your site ? :smileygrin:

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
esiebert7625
Immortal
Immortal

Thanks!

Yes as a matter of fact I just set one up yesterday, http://vmware-land.com/feed.xml

Still playing with it but it is pretty much ready to go.

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Amazin, thanks

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Amazin, Thanks

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Im no DBA but does the below look about right ?

ALTER TABLE VPX_EVENT_ARG

RENAME COLUMN ARG_DATA_OLD to ARG_DATA_OLDER;

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
esiebert7625
Immortal
Immortal

This should work in Query Analyzer:

EXEC sp_rename

@objname = 'vpx_event_arg.arg_data_old',

@newname = 'arg_data_older',

@objtype = 'COLUMN'

Eric Siebert

VMware Communities User Moderator

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Visit my website:

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

I will give it a go, thanks for all your help

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
alanrenouf
VMware Employee
VMware Employee

got a bit further, now recieved.....

Error: Failed to execute SQL procedure. Got exception: ERROR [SQL Native Client][SQL Server]Cannot drop the view 'VPXV_HIST_STAT', because it does not exist or you do not have permission.

Error: Failed to execute command: drop view VPXV_HIST_STAT

Error: Aborting upgrade because of an exception. Exception details: ERROR [SQL Native Client][SQL Server]Cannot drop the view 'VPXV_HIST_STAT', because it does not exist or you do not have permission.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos