November 9, 2011 at 6:19 am
I am struck with the similar problem....
The scenario is something like this :
I have two instances of sql server 2008 r2 on the same server as dv and qa. Important point to be noted here is my databases on both instances has 3 mdf files ie., 1 Primary mdf file and 2 secondary files with extension .ndf and a log file each.
I took backup of a database from dv and tried to restore it to qa, when i tried to restore it with the command given below
RESTORE DATABASE [MyDB_3QA]
FROM DISK = '\\sbi092\public\Backup\MyDB\MyDB_3Test\MyDB_3Test_DB_20111109.11.47.49_Part1of1.bak' WITH RECOVERY,
REPLACE,
MOVE 'MyDB_3QA1_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA1_Data.mdf',
MOVE 'MyDB_3QA_log'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA_log.ldf',
MOVE 'MyDB_3QA2_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA2_Data.ndf',
MOVE 'MyDB_3QA3_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA3_Data.ndf'
It is throwing an error something like
The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on dv file path
Another important thing to notice here is when I follow the same process to backup and restore a database with less than 3 data files it is working fine....
Can anyone figure out the problem and suggest me solution if any.
November 9, 2011 at 6:29 am
Similar Issue and RESTART option rocks 😀
November 9, 2011 at 6:46 am
Maddy...! (11/9/2011)
I am struck with the similar problem....The scenario is something like this :
I have two instances of sql server 2008 r2 on the same server as dv and qa. Important point to be noted here is my databases on both instances has 3 mdf files ie., 1 Primary mdf file and 2 secondary files with extension .ndf and a log file each.
I took backup of a database from dv and tried to restore it to qa, when i tried to restore it with the command given below
RESTORE DATABASE [MyDB_3QA]
FROM DISK = '\\sbi092\public\Backup\MyDB\MyDB_3Test\MyDB_3Test_DB_20111109.11.47.49_Part1of1.bak' WITH RECOVERY,
REPLACE,
MOVE 'MyDB_3QA1_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA1_Data.mdf',
MOVE 'MyDB_3QA_log'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA_log.ldf',
MOVE 'MyDB_3QA2_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA2_Data.ndf',
MOVE 'MyDB_3QA3_Data'TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.ODSQL02_QA\MSSQL\DATA\MyDB_3QA3_Data.ndf'
It is throwing an error something like
The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on dv file path
Another important thing to notice here is when I follow the same process to backup and restore a database with less than 3 data files it is working fine....
Can anyone figure out the problem and suggest me solution if any.
If my understanding is correct you were unable to restore because the database is in use.
Use sp_who2
to check whether the database is in use.
Rather than restarting try killing the process usin kill SPID;
.
If you can kill the process, you should be able to restore.
Please correct me If I am wrong!!!!!!!!!!!!!!!!!!!!!
November 9, 2011 at 6:50 am
There are no processes running and the database is not in use i m sure about it.. as a second check i verified too...
November 9, 2011 at 6:55 am
Go to the folder and see if the files already exists. Try deleting the db (assuming you can), then manually check that nothing is left of it before trying the next restore.
Reboot can't fix that one.
November 9, 2011 at 7:00 am
Incorrectly configured antivirus perhaps? It's the main cause of problems like this.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 9, 2011 at 7:03 am
I have tried resotring to the qa envirnment with qa file paths and in the error it is showing the location of the dv environment file paths....
and I deleted the complete database and tried restoring it but no luck...
November 9, 2011 at 7:04 am
Maddy...! (11/9/2011)
I have tried resotring to the qa envirnment with qa file paths and in the error it is showing the location of the dv environment file paths....and I deleted the complete database and tried restoring it but no luck...
We need more info than no luck!
Still the same error message?
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply