Thursday, February 16, 2012
Attaching Databases
I've obtained a copy of the PRODUCTION database for restoring on the TEST
Environment. By detaching them and copying the underlying files. Not my
preferred approach, but the one I'm stuck with.
When I attach them into the TEST environment. They register to the instance
as READ-ONLY. When I try to take them out of READ-ONLY mode, the error with
5105 Error. Unable to activate device.
The devices are there and the permissions / attributes for the file are OK.
Any ideas?Beverley, one thing to look at... maybe the database you
got the mdf/ndf/ldf files from, was marked read only?
and ALSO thr mdf/ndf/ldf files were marked read only at
the file level (ATTRIB command). Both are done to
improve performance, but you'd need to get BOTH the files
and the database out of read-only status... You can do it
in the Windows Explorer attributes of the file or the DOS
ATTRIB command... Bruce
>--Original Message--
>Hi
>I've obtained a copy of the PRODUCTION database for
restoring on the TEST
>Environment. By detaching them and copying the
underlying files. Not my
>preferred approach, but the one I'm stuck with.
>When I attach them into the TEST environment. They
register to the instance
>as READ-ONLY. When I try to take them out of READ-ONLY
mode, the error with
>5105 Error. Unable to activate device.
>The devices are there and the permissions / attributes
for the file are OK.
>Any ideas?
>.
>
Thursday, February 9, 2012
Attach/restore databases in SQL Server 2000
Hi,
I've got a question regarding attaching/restoring of DBs and wonder if anyone could help me out.
Does SQL Server 2000 provide a functionality to attach/restore DB automatically? ie, some kind of polling service to attach/restore DB that were detached previously?
Thanks
Danny.
No.
And why would it. There could be dozens of experimental, sample, demo, 'old' database files on the computer. It should not ATTACH anything that it is not specifically instructed to attach.
|||why not?
Imagine the scenerio where there are 100 salesman with a laptop each and each laptop running a local version of web portal supported by local MSDE backend (only relevant database will be on the machine).
A WISE script executable will be created for updates of portal and existing database. If there's a new database required, the server should be able to be aware of it an attach it automatically.
Surely there's got to be a way of attaching database to 100 machines automatically.
|||You can write scripts, you can even write stored procedures that automatically execute when the server first starts, and you can use Replication.
But if you find an 'automatic' way to attach databases, please let us know.
|||Will certainly do. "Inside SQL Server 2000" just arrived. I'll consult it instead.
|||SQL Server has no way for automatic / implicit attaching of databases. You will have to use (as Anrie indicated a SP or task to search for files). Why don′t you put that in your installer script ? As from your description, it is running on the machine where the databases reside on.
Jens K. Suessmeyer.
http://www.sqlserver2005.de