SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


space given in DB name and backup failure


space given in DB name and backup failure

Author
Message
Benki Chendu
Benki Chendu
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4990 Visits: 520
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
Andrew G
Andrew G
SSCertifiable
SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)

Group: General Forum Members
Points: 7909 Visits: 2345
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.
ALZDBA
ALZDBA
SSC Guru
SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)

Group: General Forum Members
Points: 70352 Visits: 9210
some may consider the extra space a security feature Crazy


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


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- 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 :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Benki Chendu
Benki Chendu
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4990 Visits: 520
ALZDBA (10/2/2013)
some may consider the extra space a security feature Crazy


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.
ALZDBA
ALZDBA
SSC Guru
SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)SSC Guru (70K reputation)

Group: General Forum Members
Points: 70352 Visits: 9210
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


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- 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 :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Sergiy
Sergiy
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59016 Visits: 12969
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

Steve Jones
Steve Jones
SSC Guru
SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)SSC Guru (328K reputation)

Group: Administrators
Points: 328518 Visits: 20108
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
My Blog: www.voiceofthedba.com
Sergiy
Sergiy
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59016 Visits: 12969
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.
hussaini
hussaini
SSC-Enthusiastic
SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)

Group: General Forum Members
Points: 103 Visits: 30
use double quotes
backup database "Tfs_Products Pipeline Automation" to disk='c:\dump\db\Tfs_Products_Pipeline_AutomationDump1.bak';



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search