Monday, March 12, 2012

Restore backup problem

I'm using Sql 7.0 on a w2k machine. I'm trying to restore a DB from another
server using the following script:
Firsts created a v003 db. then applied:
RESTORE DATABASE v003
FROM DISK = 'C:\MSSQL7DATA\BACKUP\vehiculo_bak.003'
WITH MOVE 'V003_Data' TO 'c:\sql7data\data\V003_Data.MDF',
MOVE 'V003_Log' TO 'c:\sql7data\data\V003_Log.LDF'
but get :
Server: Msg 3234, Level 16, State 2, Line 8
File 'V003_Data' is not a database file for database 'v003'.
Server: Msg 3013, Level 16, State 1, Line 8
Backup or restore operation terminating abnormally.
Any help welcome.
RubénJust applied a small change to the code <replace>:
RESTORE DATABASE V003
FROM DISK = 'C:\MSSQL7DATA\BACKUP\vehiculo_bak.003'
WITH REPLACE, MOVE 'V003_Data' TO 'c:\sql7data\data\V003_Data.MDF',
MOVE 'V003_Log' TO 'c:\sql7data\data\V003_Log.LDF'
And get this message:
Server: Msg 3101, Level 16, State 2, Line 7
Database in use. The system administrator must have exclusive use of the
database to run the restore operation.
Server: Msg 3013, Level 16, State 1, Line 7
Backup or restore operation terminating abnormally.
Even thou I use: sp_dboption 'v003', 'dbo use only', 'true' command.
Any ideas welcome.
"Rubén Valenzuela" <rvalenzuela@.mapfreseguros.cl> wrote in message
news:%23DP%23hOORDHA.2144@.TK2MSFTNGP11.phx.gbl...
> I'm using Sql 7.0 on a w2k machine. I'm trying to restore a DB from
another
> server using the following script:
> Firsts created a v003 db. then applied:
> RESTORE DATABASE v003
> FROM DISK = 'C:\MSSQL7DATA\BACKUP\vehiculo_bak.003'
> WITH MOVE 'V003_Data' TO 'c:\sql7data\data\V003_Data.MDF',
> MOVE 'V003_Log' TO 'c:\sql7data\data\V003_Log.LDF'
> but get :
> Server: Msg 3234, Level 16, State 2, Line 8
> File 'V003_Data' is not a database file for database 'v003'.
> Server: Msg 3013, Level 16, State 1, Line 8
> Backup or restore operation terminating abnormally.
> Any help welcome.
> Rubén
>|||You still have a connection in the db. You can't have anything in there
other than the connection that is running the restore. Use sp_who2 to see
who is still in the db and close those connections. It's probably EM.
--
Andrew J. Kelly
SQL Server MVP
"Rubén Valenzuela" <rvalenzuela@.mapfreseguros.cl> wrote in message
news:OmsTcSORDHA.3880@.tk2msftngp13.phx.gbl...
> Just applied a small change to the code <replace>:
> RESTORE DATABASE V003
> FROM DISK = 'C:\MSSQL7DATA\BACKUP\vehiculo_bak.003'
> WITH REPLACE, MOVE 'V003_Data' TO 'c:\sql7data\data\V003_Data.MDF',
> MOVE 'V003_Log' TO 'c:\sql7data\data\V003_Log.LDF'
> And get this message:
> Server: Msg 3101, Level 16, State 2, Line 7
> Database in use. The system administrator must have exclusive use of the
> database to run the restore operation.
> Server: Msg 3013, Level 16, State 1, Line 7
> Backup or restore operation terminating abnormally.
> Even thou I use: sp_dboption 'v003', 'dbo use only', 'true' command.
> Any ideas welcome.
> "Rubén Valenzuela" <rvalenzuela@.mapfreseguros.cl> wrote in message
> news:%23DP%23hOORDHA.2144@.TK2MSFTNGP11.phx.gbl...
> > I'm using Sql 7.0 on a w2k machine. I'm trying to restore a DB from
> another
> > server using the following script:
> >
> > Firsts created a v003 db. then applied:
> >
> > RESTORE DATABASE v003
> > FROM DISK = 'C:\MSSQL7DATA\BACKUP\vehiculo_bak.003'
> > WITH MOVE 'V003_Data' TO 'c:\sql7data\data\V003_Data.MDF',
> > MOVE 'V003_Log' TO 'c:\sql7data\data\V003_Log.LDF'
> >
> > but get :
> >
> > Server: Msg 3234, Level 16, State 2, Line 8
> > File 'V003_Data' is not a database file for database 'v003'.
> > Server: Msg 3013, Level 16, State 1, Line 8
> > Backup or restore operation terminating abnormally.
> >
> > Any help welcome.
> >
> > Rubén
> >
> >
>

No comments:

Post a Comment