RESTORE DATABASE upperbridge
FROM DISK = C:\...........
WITH REPLACE
gets the error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could not be
obtained because the database is in use.
This is on my test SQL Server 2000 on my intranet with no other users. Both
Enterprise Manager and Query Analyser are not running.
Please advise.Run sp_who or sp_who2 and see who is connected to it.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Roger Withnell" <rogerREMOVE@.THISFIRSTupperbridge.co.uk> wrote in message
news:c9g2ap$s9f$1@.hercules.btinternet.com...
RESTORE DATABASE upperbridge
FROM DISK = C:\...........
WITH REPLACE
gets the error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could not be
obtained because the database is in use.
This is on my test SQL Server 2000 on my intranet with no other users. Both
Enterprise Manager and Query Analyser are not running.
Please advise.|||Seems like someone has a connection to the database. Make sure that the connection from where you do the
restore isn't in the database. Check who is in the database using sp_who or sp_who2.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Roger Withnell" <rogerREMOVE@.THISFIRSTupperbridge.co.uk> wrote in message
news:c9g2ap$s9f$1@.hercules.btinternet.com...
> RESTORE DATABASE upperbridge
> FROM DISK = C:\...........
> WITH REPLACE
> gets the error
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could not be
> obtained because the database is in use.
> This is on my test SQL Server 2000 on my intranet with no other users. Both
> Enterprise Manager and Query Analyser are not running.
> Please advise.
>
>|||Are you sure that the QA session you're using to restore the database isn't
the one that's using the database? Use sp_who2 to see who's using it.
"Roger Withnell" <rogerREMOVE@.THISFIRSTupperbridge.co.uk> wrote in message
news:c9g2ap$s9f$1@.hercules.btinternet.com...
RESTORE DATABASE upperbridge
FROM DISK = C:\...........
WITH REPLACE
gets the error
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could not be
obtained because the database is in use.
This is on my test SQL Server 2000 on my intranet with no other users. Both
Enterprise Manager and Query Analyser are not running.
Please advise.|||Hi Roger,
Execute the below script from master to restore the database (Execute all
the lines in a together from query analyzer - Replace dbname , filename ,
directory and
logical name based on ur requirement)
use master
go
alter database <dbname> set single_user with rollback immediate
go
restore database <dbname> from disk = 'C:\filename.bak' with recovery,
move 'logical_mdf_name' to 'c:\mssql\data\filename.mdf',
move 'logical_ldf_name' to 'c:\mssql\data\filename.ldf'
Thanks
Hari
MCDBA
"Roger Withnell" <rogerREMOVE@.THISFIRSTupperbridge.co.uk> wrote in message
news:c9g2ap$s9f$1@.hercules.btinternet.com...
> RESTORE DATABASE upperbridge
> FROM DISK = C:\...........
> WITH REPLACE
> gets the error
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Exclusive access could not
be
> obtained because the database is in use.
> This is on my test SQL Server 2000 on my intranet with no other users.
Both
> Enterprise Manager and Query Analyser are not running.
> Please advise.
>
>
No comments:
Post a Comment