Showing posts with label existing. Show all posts
Showing posts with label existing. Show all posts

Friday, March 9, 2012

Error when attempting to backup to a second disk file

In SQL Server 2005, via the GUI, I wish to backup a database to an additional disk file (there is already an existing backup disk file for this database), so that I can have more than one backup. I've added the new disk file name, highlighted it, and clicked OK.

I get an immediate error (see below). Note, the 2nd error message is specifying the existing backup disk file, not the new one I'm attempting to create.

"Backup failed for Server 'WCS-DEV-TPA'. (Microsoft.SqlServer.Smo)"

"System.Data.SqlClient.SqlError: The volume on device 'D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\WCS_ADV_Longmont.bak' is not part of a multiple family media set. BACKUP WITH FORMAT can be used to form a new media set. (Microsoft.SqlServer.Smo)"

Does anyone know what causes this and how to correct it?

Try removing all but the new disk file name. Also you can just copy the first backup(s) to another drive.|||

While that would be a good workaround, it won't meet my needs.

(a) The users will need to make multiple backups and retain several older versions in order to be able to restore a specific version if necessary. (b) The users who will be making the backups will not have access to the file system on the computer that will host the backup disk files.

Is there a way to correct this problem so that we can have multiple disk backups via the GUI? (The users in question won't be knowledgeable (or privileged) enough to create SQL scripts to do the backups on this 'ad-hoc' basis.)

|||

From another post:

You can use the UI to create a Maintenance Plan(s) with multiple backups. If these are adhoc backups they'll have to be separately.

Kevin Farlee

Posts 224

Answer Re: Backup error - not part of a multiple family media set
Was this post helpful ?


When you back up to two files, you are creating a stripe set. The restriction is that all backups sent to a media set must have the same number of stripes. That's the meaning of your error.

You need to create a media set with the number of stripes you want to use. You can't add members later.

The method for creating a new media set is to use the WITH FORMAT option on your backup command. This is the equivalent of reformatting a tape for backups. It wipes out any previous data in the file(s), and sets up the headers correctly.

So, if you issue the same command in your script, adding WITH FORMAT for ONE TIME ONLY, the first time you use that media family, you should be good to go. From then on, you can just use it as your script is now.


Microsoft SQL Server Storage Engine PM

|||

[1] This is for use in ad-hoc backups and need to be done by fairly inexperienced users as desired before running application software that will modify the database.

[2] We don't want to backup the database to a multiple disk file set - we want to be able to specify a new disk file to receive the database backup, giving us the capability of seeing multiple versions of the database (based on the backup snapshot in each disk file) and restoring (if necessary) from any one of the backup disk files. Doing this through the GUI is necessary because of this will be done with less privileged and knowledgeable users.

|||

Sorry I can't be of more help.

The only solution I can see is for your users to use the UI to back up to only one "location" at a time. They will just have to use the UI to twice, each time backing up to one location.

|||Does this mean that the problem I'm reporting is a known flaw (bug?) in the SQL Server management GUI? It can't be corrected to allow the specification of several backup disk files?|||

I would just say that the Backup Database dialog only allows for one backup at a time to either a single file or device or a multiple family media set. It has to be used two times for two backups.

You can use the Maintenance Plan UI to create a plan with two backup tasks, to two different folders, that run in series and you can schedule that plan.

The UI for the Maintenance Plan - Backup Database Task is similiar to the Backup Database dialog.:

|||

OK, I see. It looks like we'll have to re-evaluate how the permissions will be allocated to users in consideration of this. Thank you (all of y'all) for your help.

Regards,

Douglas

|||

Help me understand more about what you're trying to accomplish:

Are you trying to get two files, each containing exactly the same backup content?

or are you wanting to have a collection of backups of the same database at different times?

If you want the former, you want to use the MIRROR TO clause in the Backup command. I can't find a button on the GUI for it, but if you set up a backup, and specify two files, then click on the "script" button, you'll get a backup command with two disk files separated by a comma. i.e.

BACKUP DATABASE foo TO DISK = N'C:\somefile.bak', DISK = N'D:\AnotherFile.BAK' WITH FORMAT;

if you replace the comma with 'MIRROR TO', as in

BACKUP DATABASE foo TO DISK = N'C:\somefile.bak' MIRROR TO DISK = N'AnotherFile.BAK' WITH FORMAT;

then hit "GO" you'll get two copies of a backup of database foo instead of a stripe set.

|||We're wanting to "have a collection of backups of the same database at different times".

Sunday, February 26, 2012

Error upon creation of Integration Services

After I aborted my installation of the tools that come with Katmai, I could not create Integration Services project nor add package to an existing project. I get the following error

Constructor on type 'Microsoft.DataTransformationServices.Wizards.EtlProjectWizardInitializer' not found.

I've removed anything that had the word 'Katmai' in Add/REmove programs. I've also reinstalled the 2005 tools. Still no luck. I'm just wondering if anyone here has encountered this error.
I guess the abort did not rollback completely, but then its just my guess.
Did you try re-installing katmai tools and do a complete un-install after that?.|||Hi sir. I did a complete uninstall of Katmai db and tools. I'll try to reinstall it again, maybe it will help. I just repaired my VS2005Pro installation thinking it can solve the problem but still no luck. Sad
|||

[Microsoft follow-up]

Possible katmai bug here guys.

|||

This sounds like one of the known bugs for Katmai.

If this is the same issue that I'm thinking of, it's because the component which handles our project creation is pointing to the Katmai files.

In the registry, the keys under (CLSID, CurVer):

HKEY_CLASSES_ROOT\Microsoft.SqlServer.Management.UI.WizardManager

Should be the same as:

HKEY_CLASSES_ROOT\Microsoft.SqlServer.Management.UI.WizardManager.9

The values should be:

CLSID = {4503861B-5694-45AE-94DD-BC6541316FB7}

CurVer = Microsoft.SqlServer.Management.UI.WizardManager.9

If CurVer is Microsoft.SqlServer.Management.UI.WizardManager.10, then this is the issue that we've seen.

Note, I can't recommend tweaking the registry by hand... but if uninstalling SQL Server and Visual Studio doesn't fix the issue, this might be an alternative.

It's odd that you're still hitting it after uninstalling everything, but I guess aborting the installation might have left you in a bad state. I know that a number of setup related issues have been resolved since the June CTP, and hopefully the issue that put you into this state was one of them. Make sure that when you reinstall, you have no instances of Visual Studio running.

~Matt

|||Moving to the Katmai SSIS forum.|||

There is a workaround to get the SQL Server 2005 tools working when it is installed with Katmai server.

You need to update this file "<drive>:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Business Intelligence Projects\DataTransformationsProject.vsz".

Replace the "Microsoft.SqlServer.Management.UI.WizardManager" with "Microsoft.SqlServer.Management.UI.WizardManager.9". Save the change and restart the SQL Server 2005 tools. You should be able to create the new projects.

|||This weekend, I reinstalled both my VS2005Pro and SQL2005Dev as a final brute force solution. I was hoping that this would also erase in the registry the entry key that points to the non-existing or invalid dll. I noticed that even for the supposed "fresh" install, the layout of my IDE did not change and the problem was still there.

Thanks so much for the replies guys. Feng, I will apply your solution.

|||I applied both solutions here. I don't care which one did it but the important thing is my headache is over. Thank you so much again! More power to you guys!

Error upon creation of Integration Services

After I aborted my installation of the tools that come with Katmai, I could not create Integration Services project nor add package to an existing project. I get the following error

Constructor on type 'Microsoft.DataTransformationServices.Wizards.EtlProjectWizardInitializer' not found.

I've removed anything that had the word 'Katmai' in Add/REmove programs. I've also reinstalled the 2005 tools. Still no luck. I'm just wondering if anyone here has encountered this error.
I guess the abort did not rollback completely, but then its just my guess.
Did you try re-installing katmai tools and do a complete un-install after that?.|||Hi sir. I did a complete uninstall of Katmai db and tools. I'll try to reinstall it again, maybe it will help. I just repaired my VS2005Pro installation thinking it can solve the problem but still no luck. Sad
|||

[Microsoft follow-up]

Possible katmai bug here guys.

|||

This sounds like one of the known bugs for Katmai.

If this is the same issue that I'm thinking of, it's because the component which handles our project creation is pointing to the Katmai files.

In the registry, the keys under (CLSID, CurVer):

HKEY_CLASSES_ROOT\Microsoft.SqlServer.Management.UI.WizardManager

Should be the same as:

HKEY_CLASSES_ROOT\Microsoft.SqlServer.Management.UI.WizardManager.9

The values should be:

CLSID = {4503861B-5694-45AE-94DD-BC6541316FB7}

CurVer = Microsoft.SqlServer.Management.UI.WizardManager.9

If CurVer is Microsoft.SqlServer.Management.UI.WizardManager.10, then this is the issue that we've seen.

Note, I can't recommend tweaking the registry by hand... but if uninstalling SQL Server and Visual Studio doesn't fix the issue, this might be an alternative.

It's odd that you're still hitting it after uninstalling everything, but I guess aborting the installation might have left you in a bad state. I know that a number of setup related issues have been resolved since the June CTP, and hopefully the issue that put you into this state was one of them. Make sure that when you reinstall, you have no instances of Visual Studio running.

~Matt

|||Moving to the Katmai SSIS forum.|||

There is a workaround to get the SQL Server 2005 tools working when it is installed with Katmai server.

You need to update this file "<drive>:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Business Intelligence Projects\DataTransformationsProject.vsz".

Replace the "Microsoft.SqlServer.Management.UI.WizardManager" with "Microsoft.SqlServer.Management.UI.WizardManager.9". Save the change and restart the SQL Server 2005 tools. You should be able to create the new projects.

|||This weekend, I reinstalled both my VS2005Pro and SQL2005Dev as a final brute force solution. I was hoping that this would also erase in the registry the entry key that points to the non-existing or invalid dll. I noticed that even for the supposed "fresh" install, the layout of my IDE did not change and the problem was still there.

Thanks so much for the replies guys. Feng, I will apply your solution.

|||I applied both solutions here. I don't care which one did it but the important thing is my headache is over. Thank you so much again! More power to you guys!

Error updating a DateTime field

Hi, I'm having trouble updating a DateTime field in my SQL database. Here is what I'm trying to do...I retrieve the existing value in the DateTime field (usually a bum date like 1/1/1900 00:00:00:00), then put it in a variable. Later, depending on some conditions, I'll either update the DateTime field to today's date (which works great) or set it back equal to the existing value from the variable (this one messes up and says "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. "). There is a ton more than this but here are the relevant snippets:
<code>
Dim CompDate As DateTime
Dim aComm As SQLCommand
Dim aReader As SQLDataReader
Dim bSQL,bConn As String
bSQL= "SELECT CompleteDate,StatusOfMarkout FROM Tickets WHERE TicketName=" _ & CHR(39) & Trim(Ticket.Text) & CHR(39)
bConn = serverStuff aConn = New SQLConnection(bConn)
aComm = New SQLCommand(bSQL,aConn)
aConn.Open()
result = aComm.ExecuteReader()
'fills controls with data
While result.Read()
CompDate = result("CompleteDate")
PreviousMarkoutStatus.Text = result("StatusOfMarkout")
End While
result.Close()
aConn.Close()
sSqlCmd ="Update OneCallTickets CompleteDate=@.CompleteDate, StatusOfMarkout=@.StatusOfMarkout WHERE TicketFileName=@.TicketFileName"
dim SqlCon as New SqlConnection(serverStuff)
dim SqlCmd as new SqlCommand(sSqlCmd, SqlCon)
If Flag1List.SelectedItem.Value = "No Change" Then
SqlCmd.Parameters.Add(new SqlParameter("@.Flag1", SqlDbType.NVarChar,35))
SqlCmd.Parameters("@.Flag1").Value = PreviousMarkoutStatus.Text
SqlCmd.Parameters.Add(new SqlParameter("@.CompleteDate", SqlDbType.DateTime, 8))
SqlCmd.Parameters("@.CompleteDate").Value = CompDate
Else
SqlCmd.Parameters.Add(new SqlParameter("@.Flag1", SqlDbType.NVarChar,35))
SqlCmd.Parameters("@.Flag1").Value = CurrentStatus.Text
SqlCmd.Parameters.Add(new SqlParameter("@.CompleteDate", SqlDbType.DateTime, 8))
SqlCmd.Parameters("@.CompleteDate").Value = Today()
End If
SqlCon.Open()
SqlCmd.ExecuteNonQuery()
SqlCon.Close()
</code>
Can anybody help me with this? Thanks a bunchIs your CompDate a DateTime or is it a string? #1 make sure it is a DateTime.
You might also try using the Convert function in your procedure to convert the argument to a SQL DateTime and see what happens.|||

Yes, the value I'm reading from the database is 100% a datetime. Could you give me an example of how to convert? Thanks

|||

I think you need the DateDiff function of both VB .NET and SQL Server and also change your data type to SmallDateTime it has less resolution if the seconds are not important. Try the links below for sample code using TimeSpan with DateDiff. Hope this helps.
http://blogs.msdn.com/vbfaq/

http://www.stanford.edu/~bsuter/sql-datecomputations.html

|||Hmm, I guess I don't understand. I read through those links and all I could find was how to calculate the difference between two dates. I couldn't really find an answer in there?|||CONVERT(DATETIME, Your_Date_Field)|||

When I try that here:
SqlCmd.Parameters.Add(new SqlParameter("@.CompleteDate", SqlDbType.DateTime, 8))
SqlCmd.Parameters("@.CompleteDate").Value = CONVERT(DATETIME, CompDate)
I get a Compiler Error Message: BC30684: 'CONVERT' is a type and cannot be used as an expression.
Should I be using it somewhere else?

|||I was assuming you are using a stored procedure to do the work. The CONVERT function is a T_SQL function and should be done inside of a stored procedure or SQL statement.

Sunday, February 19, 2012

Error to manually add subscription to an article

When trying to add an article back to an existing publication thats active
in transactional replication I get the following error
Server: Msg 14100, Level 16, State 1, Procedure sp_addsubscription, Line 240
Specify all articles when subscribing to a publication using concurrent
snapshot processing.
Apparently concurrent snapshot is enabled and when I did issue the
sp_addsubscription and specified the @.article parameter with the table name
, it didnt like it and threw the above error..
It wanted 'all' .. and I was afraid it would do some reinitializing,etc..
Just curious to know why we need that 'all'.. Seems kinda buggy
Interesting. I remember seeing this on Vyas's blog:
http://vyaskn.tripod.com/sqlblog/. He didn't report a solution and I'll also
take a look.
Rgds,
Paul Ibison
|||I just substituted all and it worked. It did take care of just the
respective articles.. Thank God..
With that Im thinking, should we just use all even if we dont have
concurrent snapshot enabled . Will it just take care of just those articles
we want to add manually. I'll try it out and let u know
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23zcnRGXSFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Interesting. I remember seeing this on Vyas's blog:
> http://vyaskn.tripod.com/sqlblog/. He didn't report a solution and I'll
also
> take a look.
> Rgds,
> Paul Ibison
>
>