473,805 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attaching and Detaching a Database

Q1.)In SQL Server 2000, is it always possible to use copies of the
data and transaction log files of a database from one server to
reattach to a new database on another server, or even to the same
server, without first detaching from the existing database?
Books Online says that detaching a database closes the data and log
files cleanly. I read some where that some times, it is possible to
attach without detaching, if the data and log file are in stable
state.
This is what I tried - Tried to copy Northwind.mdf and ldf files using
windows explorer and it gave an error message that the files are in
use. I shutdown the server and now I could easily copy them. After
that I renamed these files and successfully attached them as a new
database.
Q2.)Is it possible to do the same with large production databases?

Q3.) Please explain what goes on during detaching /attaching process.

Thanks in advance

Ravi
Jul 20 '05 #1
1 3246
Q1:
No. It will actually work in many cases, but not always.

Q2:
See Q1

Q3:
SQL Server does all cached writes and probably come synchronization with the
transaction log records. AFAIK, MS has not documented the internals of
this.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Ravi" <ar*******@hotm ail.com> wrote in message
news:92******** *************** ***@posting.goo gle.com...
Q1.)In SQL Server 2000, is it always possible to use copies of the
data and transaction log files of a database from one server to
reattach to a new database on another server, or even to the same
server, without first detaching from the existing database?
Books Online says that detaching a database closes the data and log
files cleanly. I read some where that some times, it is possible to
attach without detaching, if the data and log file are in stable
state.
This is what I tried - Tried to copy Northwind.mdf and ldf files using
windows explorer and it gave an error message that the files are in
use. I shutdown the server and now I could easily copy them. After
that I renamed these files and successfully attached them as a new
database.
Q2.)Is it possible to do the same with large production databases?

Q3.) Please explain what goes on during detaching /attaching process.

Thanks in advance

Ravi

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3232
by: Andrey Mosienko | last post by:
We are using PostgreSQL about two years beginning from version 7.0. I have one question about starting postmaster: Is there way to detach it from the controlling terminal under FreeBSD? My situation: I start postmaster manually: su pgsql -c "/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/pgsql.log start" Log:
3
15533
by: Rob Davis | last post by:
I am familiar with VBA and the manual method of attaching/linking external data tables (File, Get External Data etc). I am also familiar with opening tables which exist in the current Access file, in VBA and reading / writing records. What I want to do is attach external data tables in VBA ... can anyone please help? I suppose I could do it with SendKeys, but that's clumsy. =============================
3
2092
by: Sean Malloy | last post by:
Hi, I'm new to windows forms development. I'm just wondering what the best practise is to deatching events. I have an external object which is passed into a dialog form. The dialog wires up a couple of EventHandlers. to listen for events on the object. Now I have a suspicion that even when I dispose of the form, it is still
2
1418
by: Loane Sharp | last post by:
Hi there Please help! I'm at my wits' end... I am using the System.Data.SQLClient namespace in an ASP.NET web application to connect to a local instance of SQL Server 2005 Express. Using "AttachDBFileName" in the connection string to attach to the database, I can connect to the database if the ASPNET account is explicitly (a) granted database access and (b) given "SELECT" permission, presumably
4
5248
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. ...
4
6554
by: Mark | last post by:
I know that you can format url's withing an Access database but can you physically attach Word, Excel or pdf files within one? I need to attach backup documents into a database I am creating. Any suggestions for a workaround or alternative solution? Thanks Mark
0
1351
by: mca47378 | last post by:
Hi, I attached my database on different machine. Everything seems to be okay as of now, but I dont see my database diagrams here, which I had created and saved on the previous machine in this database. Can anyone please suggest me cuase. Thank you, Mithalesh
4
5155
by: jay123987 | last post by:
Morning / Afternoon / Goodday All, I was hoping someone can help me in understanding the best way to attach files to a access 2003 form. I have a database which is used to log phone calls and emails frm customers. When a customer emails and we make a record of this in the database using a form,we then need to attach the email to the record created in the database. I have been searching the net and found many methods but none of them are...
0
1501
by: semomaniz | last post by:
I am trying to create an application that allows users to search the database for customers profiles.Visual Studio allows to attach a sql database to the web project, how efficient/reliable is it to attach a sql database to the web project to create an application that will be handling my scenario. Is is a good idea to attach the sql database within the project or is it a good practice to have a separate database in a sql server and have the...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.