September 25, 2003 at 3:46 am
Hi all,
how can we attach a database with only .MDF file. I tried using sp_attach_single_file_db command but it's not working. plz help. Thanx in advance
September 25, 2003 at 3:49 am
Any errors that you are getting?
He who knows others is learned but the wise one is one who knows himself.
He who knows others is learned but the wise one is one who knows himself.
September 25, 2003 at 6:38 am
Is there log file. If it exists, rename log file and just use attach mdf file by using sp_attach_db. It works, automatically it creates new log file. Be remember log file original name. If MDF is not attached, then try with both files.
madhusudannaidugundapaneni
Madhu
September 26, 2003 at 4:36 am
The log file is missed. i tried with sp_attach_db it is not attaching
September 26, 2003 at 7:53 am
Are there any error messages? In Enterprise Manager,drill down to Management, expand that, expand SQL Server Logs. Double click on the most current log. Also, check the Windows Event Logs.
Next question: was the database DETACHED????
Last questions (for now): are you trying to attach it to the SAME server? Or is this a new or reinstalled server?
-SQLBill
September 29, 2003 at 1:29 am
I want to attach the database in a different sever. First i stopped sql server and copied the mdf file into a cd and tried to attach in a different server. i haven't dettached the database. Databasename is mlm
The Error:
error 1813:Could not opennew database 'mlm'.Create database is aborted.Deviceactivation error.the physicalfile name 'path.....LDF' may be incorrect
September 29, 2003 at 2:35 am
Have you detached the database.
BOL States that:
sp_attach_db should only be executed on databases that were previously detached from the database server using an explicit sp_detach_db operation
He who knows others is learned but the wise one is one who knows himself.
He who knows others is learned but the wise one is one who knows himself.
September 29, 2003 at 2:42 am
The databse is not detached .only copied after stoping the server. now how can i attach the database?
September 29, 2003 at 2:51 am
Restart the SQl server Service.
Issue the sp_detach_db command for the database you want to copy on some other place.
Copy the .mdf and .ldf to the location of your choice and then issue the sp_attach_db command.
Hope this works out.
He who knows others is learned but the wise one is one who knows himself.
He who knows others is learned but the wise one is one who knows himself.
September 29, 2003 at 3:50 am
i don't have the proper .ldf file. the mdf file is only copied to cd.
September 29, 2003 at 5:42 am
since the database does not exists in the new server the attach command will fail...try this create the database on the new server, detach the database and reattach the "copied" database
September 29, 2003 at 7:01 am
I tried that also it's not working.
September 29, 2003 at 7:08 am
swede,
The database does not need to exist on the new server for it to be attached. I have done this several times.
koithodan,
The problem is that you never detached the original database properly. You need to go back to the original database, detach it, copy the .mdf and .ldf files, then copy them from the cd/tape to the proper file and attach them. You CANNOT attach them from the cd/tape, they must be copied to the proper file first.
-SQLBill
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply