Wednesday, March 7, 2012

Restore a remote backup

I want to restore a huge database into my workstation.
The size of the backup file is more than 6 GB and I don't have enough
space on my HD for both the database and the backup file.
So I put the file in a shared folder on a pc connected through a switch
to my pc.

My wkst uses w2k pro sp4, the other PC win xp home SP1. MSDE 2000.
The share is visible and RW for the administrator of my wkst.
The 2 pc are in the same workgroup and are not part of a domain.

I tried to restore using this code:

RESTORE DATABASE Mydb
FROM DISK='\\unc\path\tofile.bak'
WITH ...

and get the error 3201 and in the log:
"BackupDiskFile::OpenMedia: the backup peripheral
'\\unc\path\tofile.bak' could not open. Error in O.S. = 5(Access
Denied.). " (I'm translating form italian)

I read that the problem can arise from the fact that the restoration is
executed by a sql server "user" that has not the same permissions as the
administrator. I tried to assign to the SQLSERVERAGENT service the user
administrator with no avail.

And executing:

xp_cmdshell 'dir \\unc\path\tofile.bak'

gives the error "access denied".

Is there a solution to this problem?
Otherwise how can I restore a database whose backup has almost the same
size as the free space on the disk?

thank you

maxx

--

NOSPAM: Rimuovere i trattini dallo username!
Cut hyphens from my username!emmexx <emme-x-x@.tiscalinet.it> wrote in message news:<bqkcd5$23356c$1@.ID-97197.news.uni-berlin.de>...
> I want to restore a huge database into my workstation.
> The size of the backup file is more than 6 GB and I don't have enough
> space on my HD for both the database and the backup file.
> So I put the file in a shared folder on a pc connected through a switch
> to my pc.
> My wkst uses w2k pro sp4, the other PC win xp home SP1. MSDE 2000.
> The share is visible and RW for the administrator of my wkst.
> The 2 pc are in the same workgroup and are not part of a domain.
> I tried to restore using this code:
> RESTORE DATABASE Mydb
> FROM DISK='\\unc\path\tofile.bak'
> WITH ...
> and get the error 3201 and in the log:
> "BackupDiskFile::OpenMedia: the backup peripheral
> '\\unc\path\tofile.bak' could not open. Error in O.S. = 5(Access
> Denied.). " (I'm translating form italian)
> I read that the problem can arise from the fact that the restoration is
> executed by a sql server "user" that has not the same permissions as the
> administrator. I tried to assign to the SQLSERVERAGENT service the user
> administrator with no avail.
> And executing:
> xp_cmdshell 'dir \\unc\path\tofile.bak'
> gives the error "access denied".
> Is there a solution to this problem?
> Otherwise how can I restore a database whose backup has almost the same
> size as the free space on the disk?
> thank you
> maxx

The SQL Server service account must have access to the network share,
so it must be a 'real' account, not LocalSystem. Since you have a
workgroup, you would need to create an account on both PCs with the
same name and password - this should allow you to access the share.

Simon|||Il 04/12/2003 14.04, Simon Hayes scrisse:
> emmexx <emme-x-x@.tiscalinet.it> wrote in message news:<bqkcd5$23356c$1@.ID-97197.news.uni-berlin.de>...
>
> The SQL Server service account must have access to the network share,
> so it must be a 'real' account, not LocalSystem. Since you have a
> workgroup, you would need to create an account on both PCs with the
> same name and password - this should allow you to access the share.

Already tried this but it did not work.
Anyway a shared folder on xp Home seems to be accessible by any remote
account.
XP Home seems a little bit weird about users...

Thank you
maxx

--

NOSPAM: Rimuovere i trattini dallo username!
Cut hyphens from my username!

No comments:

Post a Comment