Sunday, March 25, 2012

Backing Up DB with Script

Hi,
i am hosting my website's database account with godaddy.com. My website uses
a sql server 2000 database. All good and fine. they have a pretty good
customized web interface to manage sql server expect that this interface doe
s
not have any way of making backups of the database.
I wrote down a custom script which i ran from there web sql query analyser
interface to backup my database to my FTP account but this just does not see
m
to work, although it works perfect on my local machine. I am thinking it
might be becasue when i am running this script to do a backup to my ftp
account, sql server uses some kind of a windows user to write the backup fil
e
in my ftp account but since it does not have permissins over my ftp account,
i think it bombs out. Please let me know if there is any way around this
problem or if my diagnosis of the problem is wrong itself. the script i am
using is
BACKUP DATABASE NORTHWIND TO DISK = ‘D:\websites\myftpaccount\store.bak'
i am pretty sure this is the write physical address of the folder. Also when
i spoke with godady they said that it is possible to do the backups with a
script and said that there might be something wrong with my script, whichi
dont think so.
thanks
Sameer1. What is the error message you are getting?
2. Do you have permissions to backup the database?
3. Also try EXEC master.dbo.xp_cmdshell 'dir "D:\websites\myftpaccount\"'
Thanks
Ravi
"sameer" wrote:

> Hi,
> i am hosting my website's database account with godaddy.com. My website us
es
> a sql server 2000 database. All good and fine. they have a pretty good
> customized web interface to manage sql server expect that this interface d
oes
> not have any way of making backups of the database.
> I wrote down a custom script which i ran from there web sql query analyser
> interface to backup my database to my FTP account but this just does not s
eem
> to work, although it works perfect on my local machine. I am thinking it
> might be becasue when i am running this script to do a backup to my ftp
> account, sql server uses some kind of a windows user to write the backup f
ile
> in my ftp account but since it does not have permissins over my ftp accoun
t,
> i think it bombs out. Please let me know if there is any way around this
> problem or if my diagnosis of the problem is wrong itself. the script i a
m
> using is
> BACKUP DATABASE NORTHWIND TO DISK = ‘D:\websites\myftpaccount\store.bak
'
> i am pretty sure this is the write physical address of the folder. Also wh
en
> i spoke with godady they said that it is possible to do the backups with a
> script and said that there might be something wrong with my script, whichi
> dont think so.
> thanks
> Sameer|||Can you post the exact error message?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"sameer" <sameer@.discussions.microsoft.com> wrote in message
news:99C7BD6E-CD0E-4681-9B29-127A6CBBA77B@.microsoft.com...
Hi,
i am hosting my website's database account with godaddy.com. My website uses
a sql server 2000 database. All good and fine. they have a pretty good
customized web interface to manage sql server expect that this interface
does
not have any way of making backups of the database.
I wrote down a custom script which i ran from there web sql query analyser
interface to backup my database to my FTP account but this just does not
seem
to work, although it works perfect on my local machine. I am thinking it
might be becasue when i am running this script to do a backup to my ftp
account, sql server uses some kind of a windows user to write the backup
file
in my ftp account but since it does not have permissins over my ftp account,
i think it bombs out. Please let me know if there is any way around this
problem or if my diagnosis of the problem is wrong itself. the script i am
using is
BACKUP DATABASE NORTHWIND TO DISK = 'D:\websites\myftpaccount\store.bak'
i am pretty sure this is the write physical address of the folder. Also when
i spoke with godady they said that it is possible to do the backups with a
script and said that there might be something wrong with my script, whichi
dont think so.
thanks
Sameer|||Ravi and Narayana , thanks for reply
Error details are :
Error -2147217900
Cannot open backup device 'D:\websites\test\sameer.bak'. Device error or
device off-line. See the SQL Server error log for more details.
Ravi , i do have permission to backup.
"Narayana Vyas Kondreddi" wrote:

> Can you post the exact error message?
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "sameer" <sameer@.discussions.microsoft.com> wrote in message
> news:99C7BD6E-CD0E-4681-9B29-127A6CBBA77B@.microsoft.com...
> Hi,
> i am hosting my website's database account with godaddy.com. My website us
es
> a sql server 2000 database. All good and fine. they have a pretty good
> customized web interface to manage sql server expect that this interface
> does
> not have any way of making backups of the database.
> I wrote down a custom script which i ran from there web sql query analyser
> interface to backup my database to my FTP account but this just does not
> seem
> to work, although it works perfect on my local machine. I am thinking it
> might be becasue when i am running this script to do a backup to my ftp
> account, sql server uses some kind of a windows user to write the backup
> file
> in my ftp account but since it does not have permissins over my ftp accoun
t,
> i think it bombs out. Please let me know if there is any way around this
> problem or if my diagnosis of the problem is wrong itself. the script i a
m
> using is
> BACKUP DATABASE NORTHWIND TO DISK = 'D:\websites\myftpaccount\store.bak'
> i am pretty sure this is the write physical address of the folder. Also wh
en
> i spoke with godady they said that it is possible to do the backups with a
> script and said that there might be something wrong with my script, whichi
> dont think so.
> thanks
> Sameer
>
>|||Have you tried what Ravi asked? The permission to backup is the permission
of the acct used to start MSSQL service, not your permission. Following his
question will help troubleshooting.
"sameer" <sameer@.discussions.microsoft.com> wrote in message
news:6B27D23B-5060-4DD5-967F-517852CF2925@.microsoft.com...[vbcol=seagreen]
> Ravi and Narayana , thanks for reply
> Error details are :
> Error -2147217900
> Cannot open backup device 'D:\websites\test\sameer.bak'. Device error or
> device off-line. See the SQL Server error log for more details.
> Ravi , i do have permission to backup.
>
> "Narayana Vyas Kondreddi" wrote:
>|||that is what i was thinking initially and had mentioned in my first email.
Also there is no way i can know what windows account the hosting copy uses
for sql server. considering this are the reason why i cannot do my backups,
do yu suggest any other way around this problem that i can still make my
backups. Reason why i still think there is a way is becaseu the hosting
company(godaddy) rep did tell me that other clients do it using scripts.
thanks
"ME" wrote:

> Have you tried what Ravi asked? The permission to backup is the permissio
n
> of the acct used to start MSSQL service, not your permission. Following h
is
> question will help troubleshooting.
>
> "sameer" <sameer@.discussions.microsoft.com> wrote in message
> news:6B27D23B-5060-4DD5-967F-517852CF2925@.microsoft.com...
>
>|||Talk to you hosting company and make them understand how backup in SQL serve
r work. The SQL Server
service account is the one who writes the backup file and need permissions.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"sameer" <sameer@.discussions.microsoft.com> wrote in message
news:6FEDB9A8-F650-4BFE-8596-5B17767C155F@.microsoft.com...[vbcol=seagreen]
> that is what i was thinking initially and had mentioned in my first email.
> Also there is no way i can know what windows account the hosting copy uses
> for sql server. considering this are the reason why i cannot do my backups
,
> do yu suggest any other way around this problem that i can still make my
> backups. Reason why i still think there is a way is becaseu the hosting
> company(godaddy) rep did tell me that other clients do it using scripts.
> thanks
> "ME" wrote:
>|||You also have to make sure that the folder you're backing up to exists. SQL
Server can't create the folder if it doesn't exist though you might get a
different error message if that's the problem (Can't remember it on top of
my head...).
Regards
Steen
sameer wrote:[vbcol=seagreen]
> that is what i was thinking initially and had mentioned in my first
> email. Also there is no way i can know what windows account the
> hosting copy uses for sql server. considering this are the reason why
> i cannot do my backups, do yu suggest any other way around this
> problem that i can still make my backups. Reason why i still think
> there is a way is becaseu the hosting company(godaddy) rep did tell
> me that other clients do it using scripts.
> thanks
> "ME" wrote:
>

No comments:

Post a Comment