Where Are Detached Databases Kept?

Mar 9, 2008



I had to detach a databse for a project. I am now having trouble trying to find this database. It is no longer listed in the Sql Server management studio with the other databases that haven't been detached.

Is the database moved to some other folder when it is detached? Where is this database now?

thanks

View 19 Replies


ADVERTISEMENT

Copying Detached Databases Over The Network With T-SQL

Jul 25, 2006

I have a T-SQL script which deataches and attaches the database. Now here is what I want to do:
I
want to create a SQL Server Job and schedule it to run at a particular
time of the month to Detach all the databases on my local machine and
*Copy all the deatched databases over a network machine* and then
Attach those Database.

All this should be done in T-SQL. I
already have the T-SQLs for Attaching and Detaching. All I need is to
know the T-SQL (example) which will copy the *Detached Databases* from
mu local computer to my Network Computer. How do I achieve that?

Thanks

View 7 Replies View Related

HELP... Need To MDF Only, But It Was Not Detached

May 18, 2001

Today we turned off SQL Server 7, copied the MDF file (a five-month, 245MB project) to the network, reformatted and installed Windows 2000 SBS with SQL Server 2000.

Lo and behold, SQL Server 2000 refuses to attach the MDF file, claiming it cannot find the accompanying LDF (no longer in existence). Using sp_attach_single_file_db did not help, nor did creating a database of the same name on the server, detaching it, and trying to swap the old MDF file for it.

Please help... if I have to get out a hex editor to get this database attached, I'm ready, but nothing I've tried works so far, and this is very important data--I can't believe the log file is THAT important, especially after committing anything left while shutting down the service.

View 1 Replies View Related

Why Can I Not See My Detached Database?

Mar 5, 2008

I feel that I have done something stupid here.I used SSMSE to detach my database so that I could create a copy - no problem here.But then in SSMSE I right-clicked Databases, chose attach and expected to see my original database. But there are no databases shown in the attach window!I have tried to find the original database in SSMSE but nothing I do allows me to see it. However, Windows Explorer shows me that the files are still where they were when I detached them.Please help - this is driving me crazy.ThanksChris

 

View 2 Replies View Related

After Reboot, Some Db Were Detached, Some Not.

Aug 22, 2007

After reboot, some db were detached, some not.
How come?

View 3 Replies View Related

Detached - Now Cannot Attach!

Mar 5, 2008

I feel that I have done something stupid here.

I used SSMSE to detach my database so that I could create a copy - no problem here.

But then in SSMSE I right-clicked Databases, chose attach and expected to see my original database. But there are no databases shown in the attach window!

I have tried to find the original database in SSMSE but nothing I do allows me to see it. However, Windows Explorer shows me that the files are still where they were when I detached them.

Please help - this is driving me crazy.

Thanks

Chris

View 1 Replies View Related

Using Detached Database...

Nov 1, 2006

Hello,

I currently have an application that uses a Access/JET database for a desktop application. The application is single-user and outside of a few corrupt MDBs occasionally, the setup is working fine.

I am thinking about switching out from using the Access database to using a SQL Server Express detached database. I'm not sure if this is a "proper" usage of a detached database, but I've verified that I can access and query a detached one...

Is this something that is recommended? Are there any performance issues associated with it (I believe the detached would be faster than the JET database.) What kind of maintainence would be needed for the SQL Server file? (I currently have a "Repair and Compact" option for the Access file...anything along those lines needed?) Is there anything else I should be aware of?

Thank in advance!

View 4 Replies View Related

How To Attach The Detached Database

Oct 1, 2007

Dear All,
i've detached my database. how to attache thesame again?

Vinod
Even you learn 1%, Learn it with 100% confidence.

View 10 Replies View Related

Attached Vs Detached Database

Nov 11, 2007

Hello all,
I'm using SQL 2005 Express edition. I'm currently connecting to the database file directrly (from ASP.NET) and that db file is not attached to the server.
My question is this:
What is the difference ? Will the performance improve if the db is attached and I connect to it throught the server ? I'm really not sure what the difference is.
Thanks

View 5 Replies View Related

Manage Detached Mdf File

Oct 13, 2006

I want to manage my sql express .mdf database file (e.g. set Roles) but I seem to only be working with a temporary instance of my database when I attach to .sqlexpress and manage in SQL Server Management Studio Express (SSMSE). The Role I set is gone when I detach and re-attach.

If I try to manage my file in Visual Studio under Server Explorer, I do not see the "Roles" folder to modify roles.

Any help is appreciated.

View 3 Replies View Related

Detached Vs Attached Database Files

Nov 11, 2007

Hello all,
I'm using SQL 2005 Express edition. I'm currently connecting to the database file directrly (from ASP.NET) and that db file is not attached to the server.
My question is this:
What is the difference ? Will the performance improve if the db is attached and I connect to it throught the server ? I'm really not sure what the difference is.
Thanks

View 3 Replies View Related

Detached NAS Mdf/ndf Files Locked And Won't Reattach

Oct 22, 2007



Hi



I have a database consisting of multiple files on a remote server.

Both servers have the same user (bob) which is in the administrator group.

The directory that the mdf/ndf files exist on is shared as "nas" with full rights given to the user bob.

They are both in the same workgroup.

SQL server is running as this user (not ideal I know but server and services will be locked down later)



The script I used to create the database uses the following line to enable remote database files:



-- Enable the use of network drive for DB files

DBCC TRACEON(1807)

GO



I used SSMS to detatch the database and then modified my create script by removing database sizes and adding "FOR ATTACH" at the end. (I have also tried using sp_attach_db but no use)



So the script looks like this:



CREATE DATABASE [dbname] ON PRIMARY

( NAME = N'DBName', FILENAME = N'\123.45.67.89asDBName_FG.mdf' , MAXSIZE = UNLIMITED, FILEGROWTH = 10GB ),

-- Filegroups for the Alerts Table and Indexes.

FILEGROUP [FG_DBFile2]

( NAME = N'DBFile2_FG', FILENAME = N'\123.45.67.89asDBFile2_FG.ndf' , MAXSIZE = UNLIMITED, FILEGROWTH = 5GB ),

FILEGROUP [FG_AlertsIndexes]

( NAME = N'DBFile3_FG', FILENAME = N'\123.45.67.89asDBFile3_FG.ndf' , MAXSIZE = UNLIMITED, FILEGROWTH = 5GB )



LOG ON

( NAME = N'DBName_log', FILENAME = N'\123.45.67.89asDBName_log.ldf' ,MAXSIZE = 13GB , FILEGROWTH = 0%)

FOR ATTACH

GO



When I run the script I get the following error:



DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Msg 5120, Level 16, State 101, Line 5

Unable to open the physical file "\123.45.67.89asDBName_FG.mdf". Operating system error 5: "5(error not found)".



I know the permissions are ok as I can map a drive without being prompted.

SQL server is running as the user bob which is the same user I log onto the server as.



I am running Windows 2003 Server R2 Standard Edition on server with SQL Server 2005 SP2.

The NAS box is running SQL Server R2 Storage Edition.



One thing I noticed was that the mdf/ndf files on the NAS box are locked as if SQL is still using them, i.e. I cannot rename them, move them, alter any properties etc. I just get "Access Denied".



I've tried rebooting both servers but still no luck. I've also tried stopping SQL server then renaming the files, but again "Access Denied".



I know there has been a problem in the past detaching and attaching db files on a NAS, but the Hotfix is included in SP2, which I am using.



I hope I have included enough info but if I've missed anything, it can be provided.

(Event Log basically replicates what the error message says.)



Any help or ideas would be greatly appreciated.



Thanks



Steve


View 2 Replies View Related

Physical Files Can Not Be Deleted After Database Detached

Oct 10, 2007

I have detached the database via sp_detach_db in a job, (I was trying to use a job to detach the database, then make copies of the mdf file, then attach the databases as different copies, somehow the job failed due to file locked) I tried to delete the physical files, but they were still locked. I tried several times, two of them I was able to delete the mdf files, but not the ldf file. The other one both mdf file and ldf file can not be deleted. I was not able to see the database via Management studio.

Can anyone help?

Thanks

View 3 Replies View Related

How Do I Recover Database From A Detached Backup Device?

Nov 29, 2007

I ran into a problem today where I had to pull a backup file from an older tape. The file was originally is a backup that was stored in a device like :

EXEC sp_addumpdevice
'disk', --type
'c2000_BackupDevice', --logical name
'\UNCPathackupFile.bak' --physical location


I put the file from the tape on a File Server and then tried to create a new backup device pointing to the file. That's easy enough, but when I try to restore from it I get an device error saying it's offline.

How can I get that device attached to my server and then extract the backup files stored inside it?

Please advise b/c this is an interesting problem I hadn't anticipated and it argues that I should change my backup strategy .

Thanks for any advice/experience you can provide,

alex8675

View 2 Replies View Related

Transact SQL :: Moving MDF And NDF Files After Database Is Detached

Aug 19, 2015

I am using SQL 2012 SE. I am trying to move .mdf and .ndf files after a database is detached. Here is my code that is just to copy the mdf file. I am testing it against this file now and if it worked then I would do the move ldf file the same way.

EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
DECLARE @cmd nvarchar(4000)

[Code] ...

The only message is I see while the query is executing is :Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.

If I manually copy over the file it takes 30 seconds since the file is only 2GB and the script takes 45 minutes and still executing.

View 7 Replies View Related

User Instance Db File Not Get Detached After Connection Has Been Closed

Aug 21, 2007

Hi experts,
I have sql express installed on my machine and i'm using visual studio to create database files. After i've build a connection to my database file thru Server Explorer (choose Add attach files) i opened Management Studio Express and  found that the new database has been attached to sqlexpress database engine----technically speaking it's under the user instance which i use to run my visual studio. right?? that's totally fine.My question is, after i'v closed the connection in visual studio, that attached database file still exist.I want it to be detached immediately after i've closed the connection in visual studio.How can i do that?
 I've searched through internet and was told that sp_config can solve this problem by setting the user instance time out. I ran sp_config against my database but did not find that item. Could anybody give me some directions? thanks in advance.

View 2 Replies View Related

Cannot Connect To Sql Express Via ASP.NET After I Attached And Detached My Db To Sql Management Studio

Jun 6, 2006

Hello everybody,

I have an ASP.NET 2.0 website running on a windows server 2003 - sql express management studio installed. Today I had to make some changes in my database, add some columns, and so on...

So I put the app_offline.htm into the root of the web application, so the IIS unloaded the application domain, attached it in the sql management studio, made the changes I had to do and detached the db. Ok - then I removed the app_offline.html from the root of the application and looked at my internet explorer telling me that the user NT_network... cannot login...

What did I do wrong? I attached it, detached it, and at once something went wrong...

I tried everything, at least I copied the whole application to another directory and.... It worked fine again!

So, can anybody help me, I don`t know what I did wrong or rather how to make changes in my sql express for the future, not having trouble with any security issues...

regards

Simon

View 5 Replies View Related

Linking Tables From Different Databases Or Querying From Multiple Databases

Dec 10, 2007

Dear Readers,Is it possible, like in Access, to link to tables in other SQL databases that are on the same server? I have a query that I originally had in Access that queered from multiply databases. It did this by having those other tables in the other databases linked to the database that had the query. 
 

View 3 Replies View Related

Service Broker Not Working For Restored Databases (SQL 2000 Databases Restored On 2005)

Jan 24, 2006

I just restored my SQL server 2000 database on the SQL server 2005. after this i ran the Service broker sample ("Hello World") on this database by changing the AdventureWorks name to the new database name. The "setup.sql" runs fine. When i run the "SendMessage.sql" i was not getting any rows in the output (The message was not getting inserted into the queue). I checked the Service broker is enabled on this databased using the query "select is_broker_enabled from sys.databases where name = 'newdbname' " It was 1. I even tried the ALTER DATABASE SET ENABLE_BROKER. but it didnt work.

When i tried the sample on a newly created database it worked fine.

Is there any solution to make the restored database to work for service broker.

Thanks

Prashanth

View 3 Replies View Related

Copying Databases Between Databases

Feb 8, 2000

hi from France !!!

i would like how to duplicate a database to another server with all datas, constraints, keys, indexes...
should i use sp_attach_db, dts, backup/restore, sql scripts... ???

thanks to all, nico

View 1 Replies View Related

Connect From Databases In 1st Instance To Databases In 2nd Instance

Mar 13, 2007

This is the scenario. Is it possible to create views or something (like Oracle DB Links) in a database in Instance 1 which can show data from another database in 2nd Instance ?


I want to do this to create reports.

View 2 Replies View Related

Two Databases

Sep 24, 2006

I have created a site which now has two databases. Firstly is the ASPNETDB.MDF which I beleives get set to manage the security, logon/Roles that I have on my site. The second dataabase "MyDatabase" is one that I have created for all my data withing the site. I would like to combine this to one Database for simplicity and cost. Now I can't see the  ASPNETDB.MDF when I use SQL Manager 2005 and I can't see how to change the set up of ASP.Net Configuration if I was to just use mydatabase. Any suggestions

View 1 Replies View Related

Two Databases?

Sep 25, 2006

Hi, I have my site set up, but have had difficulty using the data gathered by the aspnet.mdf. I wanted to use the email and username columns from the membership table to send newsletters automatically from the database(but that's a whole other post)I also have my own databse, which will be populated by information gathered from the website, so is currently empty. I'd like to take this opportunity to say that i don't think there's enough information given on how to populate a blank database from a website application. Most tuorials etc are concentrated on retrieving and displaying data, which is all well and good, once you actually have data to play with!I don't need two databases, so can I add tables to the aspnet.mdf ? But then what about relationships etc? I won't damage the current relationships by adding new ones? On the other hand can i copy the aspnet.mdf into my own database, and then assign the relevant permissions to that db? Any help would be greatly appreciated-in language for newbies please! I am relatively new to .asp.net/Visual Basic/ and SQL. It's a steep learning curve!Also....I have used create user wizard, login, password recovery etc within my site, the data is inserted into the correct db tables-without using an sql datasource for some reason...? is that right?I have also created a wizard to collect some more data (because i couldn't work out how to insert the data from the extra steps in create user wizard, into my own database)  but when i click submit the data is not inserting into the specified table - (yes the connection string is fine, insert and update has been selected from the advance tab in connections wizard). Would this/could this be because i have assigned a 'finishbutton url'? should i use a Response.Redirect("blahblah.aspx") instead? 

View 4 Replies View Related

Databases

Nov 16, 2004

I am very new to asp.net, but am having trouble trying to link the asp.net page that i have created to an sql database that has been set up on a local system. Am actually trying to use the sql control to extract info from the database. Would appreciate any ideas.

View 1 Replies View Related

Two Databases

Jul 13, 2001

Dear friends,

There are two databases in SQL Server and I have to designed the view or store procedure joing tables from two databases. How ? It will be kind, if you give me answer with detail example.

Best regards!
manoj

View 1 Replies View Related

Use 1 Or 2 Databases?

Jul 16, 2000

Hello,

I’m using VB6 as the client and MS SQL Server 7 as the database. The company I’m consulting for has a proven track record for marketing and getting millions of customers. The parent company would like to create two new companies selling the same product; with 1 million customers per company. How many records can MS SQL Server 7 handle? I’ve been told it can handle 4 terabytes. What does 4 terabytes translate into records? I have already set up an application for company #1. Should I put company #2 in the same MS SQL Server database? Or should I put company #2 in a different database? My VB Application and SQL Server database were designed to handle multiple companies selling the same product. For performance sake; would it be better to separate the databases? Any suggestions? Is anyone currently using MS SQL Server with 2 or more million records?

Thanks,
Denise

View 2 Replies View Related

Max. # Of Databases In SQL 7

Aug 3, 2000

I am presenting using MS SQL 6.5 and have used up all my (VDEVNO) device numbers (1-255). Will I have this problem when I migrate to SQL 7? I understand SQL 7 does not use a device when creating databases, so what
is the maximum number of databases I can create in SQL 7?

Thanks in advance.

View 4 Replies View Related

SQL Databases From A CD

Apr 9, 2005

Gusy im currently making and app that runs from a cd rom yet it uses databases made in sql and i already made the part for ataching the database from the cd but i haven't been able to do 2 things:
1. Can i actually attach my database from a cd without any need for the computer
2. does anyone has the code for detaching a database in Sql in c#
thanks ahead

View 6 Replies View Related

2 Databases

Jul 30, 2004

How can you make two databases communicate with each other?? they both reside in sql server 2000. How would I go about doing that. Access 2000 is the interface

View 3 Replies View Related

From 6.5 Databases To 7.0

May 21, 2004

Hello,

Is it possible to restore a 6.5 database to a 7.0? I backup the entire 6.5 database to a BAK file then tried to restore it to SQL 7.0 but it didn't work. SQL 7.0 states that the disk device is not a valid Microsoft Tape Format backup set.

We have an application that was developped long long time ago by a old team and I don't want to upgrade the server. I tried to build a second 6.5 server (new hardware) but I couldn't restore the database as SQL 6.5 states that the server is in single user mode. I don't know how to switch to multi users mode. The database I want to restore is not in DBO or single user mode.

Any help will be appreciated.
Thanks.

Toan.

View 1 Replies View Related

100 Databases

Mar 16, 2006

Hello,
Can someone show me the TSQL I need to write in order to create 100 SQL databases in one go.
I want them to be called DB1, DB2, DB3, DB4...etc etc

I know how to create one database;
---------------------------------------------------
USE MASTER
GO
CREATE DATABASE DB1
ON PRIMARY
(
NAME = DB1_dat,
FILENAME = 'C:Program FilesMicrosoft SQL ServerMSSQLDataDB1.mdf',
SIZE=4,
MAXSIZE=10,
FILEGROWTH=1
)
-------------------------
But I don't want to do this 100 times,

Thanks in advance
ICW

View 20 Replies View Related

Databases

Feb 10, 2007

i really want to know,there are how types of databases?how many types of servers?how many types of inernet based languages?

View 2 Replies View Related

Looking For SQL Databases For

Jul 20, 2005

Hello,I am currently looking for databases that contain available prescriptionmedications and diagnosis codes (i.e. ICD9 medical diagnosis codes) thathave been created using SQL.Anybody know of companies that have these commerically available?Thanks,Eric

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved