Hi all
I just try to restore a database on a second server with a nightly batch. I started a job backup the DB into a local drive on destination server.
Now I set up the following job:
RESTORE DATABASE MWP52
FROM DISK = 'D:\backup_mwp\MWP51.bak' WITH
MOVE 'TMWPPRIM_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPPRIM_01.mdf',
MOVE 'TMWPSD_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPSD_01.ndf',
MOVE 'TMWPLD_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLD_01.ndf',
MOVE 'TMWPSI_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPSI_01.ndf',
MOVE 'TMWPLI_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLI_01.ndf',
MOVE 'TMWPUSR_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPUSR_01.ndf',
MOVE 'TMWPMVX_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPMVX_01.ndf',
MOVE 'TMWPTREE_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPTREE_01.ndf',
MOVE 'TMWPLNG_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLNG_01.ndf',
MOVE 'TMWPCODA_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPCODA_01.ndf',
MOVE 'TMWPREPL_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPREPL_01.ndf',
MOVE 'TMWPTRANL_01' TO 'D:\Microsoft SQL Server\MSSQL\Log\TMWPTRANL_01.ldf'
I got the following error:
Exclusive access could not be obtained because the database is in use. [SQLSTATE 42000] (Error 3101)
But there are no open connections to this Database.
I also tried to change the script with setting the database into SINGLE USER at the beginning of the restore
But the problem still persists.
What can I do to solve this ?
regards
appi
I just try to restore a database on a second server with a nightly batch. I started a job backup the DB into a local drive on destination server.
Now I set up the following job:
RESTORE DATABASE MWP52
FROM DISK = 'D:\backup_mwp\MWP51.bak' WITH
MOVE 'TMWPPRIM_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPPRIM_01.mdf',
MOVE 'TMWPSD_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPSD_01.ndf',
MOVE 'TMWPLD_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLD_01.ndf',
MOVE 'TMWPSI_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPSI_01.ndf',
MOVE 'TMWPLI_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLI_01.ndf',
MOVE 'TMWPUSR_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPUSR_01.ndf',
MOVE 'TMWPMVX_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPMVX_01.ndf',
MOVE 'TMWPTREE_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPTREE_01.ndf',
MOVE 'TMWPLNG_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPLNG_01.ndf',
MOVE 'TMWPCODA_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPCODA_01.ndf',
MOVE 'TMWPREPL_01' TO 'D:\Microsoft SQL Server\MSSQL\Data\TMWPREPL_01.ndf',
MOVE 'TMWPTRANL_01' TO 'D:\Microsoft SQL Server\MSSQL\Log\TMWPTRANL_01.ldf'
I got the following error:
Exclusive access could not be obtained because the database is in use. [SQLSTATE 42000] (Error 3101)
But there are no open connections to this Database.
I also tried to change the script with setting the database into SINGLE USER at the beginning of the restore
But the problem still persists.
What can I do to solve this ?
regards
appi