Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

space given in DB name and backup failure Expand / Collapse
Author
Message
Posted Wednesday, October 2, 2013 3:19 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 10:52 AM
Points: 202, Visits: 354
There seems to be an extra space in the database name given when it was created.
The backup job is failing with the following error message:

BACKUP failed to complete the command BACKUP DATABASE [safe_PreTMS ] TO DISK = N'S:\Full\safe_PreTMS \safe_PreTMS _db_201310021607.BAK' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

Please observe the space in the above command. When I remove the space and run the backup, it happens without any issue.
I am unable to remove the space in the DB name as well.

Can someone help me fix this issue
Post #1500939
Posted Wednesday, October 2, 2013 10:14 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:54 PM
Points: 1,193, Visits: 1,666
You can rename the database to something other than the original name, then rename again to the original name without the space, eg.
USE [master]
sp_renamedb 'safe_PreTMS ', 'blah'
GO
sp_renamedb 'blah', 'safe_PreTMS'
GO

Obviously check to ensure your application is updated to refer to the new name and redo the backup job.
Post #1500979
Posted Wednesday, October 2, 2013 11:59 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:27 AM
Points: 7,004, Visits: 8,449
some may consider the extra space a security feature


Simplest way is to modify the job step command and remove the space.


If you cannot rename the database (which may need application modification):

If you generate the statements on the fly, replace all special chars with e.g. "_" in the part where that script determines the file path / name


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #1500993
Posted Thursday, October 3, 2013 8:28 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 10:52 AM
Points: 202, Visits: 354
ALZDBA (10/2/2013)
some may consider the extra space a security feature


Simplest way is to modify the job step command and remove the space.


If you cannot rename the database (which may need application modification):

If you generate the statements on the fly, replace all special chars with e.g. "_" in the part where that script determines the file path / name

The maintenance plan runs for all database backups. Its a generic job.
Do you have any more inputs.
Post #1501219
Posted Thursday, October 3, 2013 11:53 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:27 AM
Points: 7,004, Visits: 8,449
I haven't used the builtin maintenance plan since early sql2000.

I use sql server backup devices. http://technet.microsoft.com/en-us/library/aa173665(v=SQL.80).aspx
Maybe that's a path you may want to investigate to overcome this issue.


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #1501426
Posted Tuesday, October 22, 2013 8:00 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, August 18, 2014 9:16 PM
Points: 4,576, Visits: 8,347
Benki Chendu (10/3/2013)

The maintenance plan runs for all database backups. Its a generic job.
Do you have any more inputs.


Try to use double quotes around the file names:

BACKUP DATABASE [safe_PreTMS ] TO DISK = N'"S:\Full\safe_PreTMS \safe_PreTMS _db_201310021607.BAK"' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


Or like this:

BACKUP DATABASE [safe_PreTMS ] TO DISK = N'S:\Full\"safe_PreTMS \safe_PreTMS _db_201310021607.BAK"' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
Post #1507443
Posted Tuesday, October 22, 2013 9:49 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 6:37 PM
Points: 33,189, Visits: 15,329
I like Sergiy's advice.






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1507458
Posted Wednesday, October 23, 2013 4:03 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, August 18, 2014 9:16 PM
Points: 4,576, Visits: 8,347
Steve Jones - SSC Editor (10/22/2013)
I like Sergiy's advice.


I better like this:
generate the statements on the fly, replace all special chars with e.g. "_" in the part where that script determines the file path / name


Definitely less problems with generating/managing/using the file all the way.
Post #1507841
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse