Wednesday, March 21, 2012

Restore database fails only when source is read from another machine ( server)

When executing this from Query Analyzer on server1, where the target is
located,
restore database restoretest
from disk = 'd:\backups\dottietest.bak'
with move 'vam_system_data' to 'd:\vamdata\sample\vamsystemdata.mdf',
move 'vam_user_data' to 'd:\vamdata\sample\vamuserdata.ndf',
move 'vam_log' to 'd:\vamdata\sample\vamlog.ldf',
stats=10,
REPLACE
.. it succeeds if " .. from disk = 'd:\backups\dottietest.bak' "
but fails with " .. from disk = 'K:\backups\dottietest.bak' "
It fails when K: is used, i.e. the drive mapping to another win2k server's
D: drive, whereas it succeeds when the *.BAK file is on the local D; drive.
The sql server log shows:
"BackupDiskFile::OpenMedia: Backup device 'k:\backups\dottietest.bak' failed
to open. Operating system error = 5(Access is denied.)."
I can open all other files like XLS, etc from this server on K:.
The dottietest.BAK file was created by another SQL server, which is not on
server1.
Which permission am I missing?
Please help.
TIAYou can't use a mapped drive, so you'll have to use the UNC path instead -
that will do the trick....
Regards
Steen
PKuhne wrote:
> When executing this from Query Analyzer on server1, where the target
> is located,
> restore database restoretest
> from disk = 'd:\backups\dottietest.bak'
> with move 'vam_system_data' to 'd:\vamdata\sample\vamsystemdata.mdf',
> move 'vam_user_data' to 'd:\vamdata\sample\vamuserdata.ndf',
> move 'vam_log' to 'd:\vamdata\sample\vamlog.ldf',
> stats=10,
> REPLACE
> .. it succeeds if " .. from disk = 'd:\backups\dottietest.bak' "
> but fails with " .. from disk = 'K:\backups\dottietest.bak' "
> It fails when K: is used, i.e. the drive mapping to another win2k
> server's D: drive, whereas it succeeds when the *.BAK file is on the
> local D; drive. The sql server log shows:
> "BackupDiskFile::OpenMedia: Backup device 'k:\backups\dottietest.bak'
> failed to open. Operating system error = 5(Access is denied.)."
> I can open all other files like XLS, etc from this server on K:.
> The dottietest.BAK file was created by another SQL server, which is
> not on server1.
> Which permission am I missing?
> Please help.
> TIA

No comments:

Post a Comment