Saturday, February 25, 2012

missing ldf file

Hello
I have been given an sql database but its just the .mdf file
the .ldf file is not recoverable
Im unable to attach this as the server needs the ldf file which is thinks is
mapped to a t: drive but this doesnt exist
is there anyway i can get this attached to an sql server as i dont have the
ldf file
thank you for any comments
Martin
"Martin Palmer" <MartinPalmer@.discussions.microsoft.com> wrote in message
news:D252C85C-B7C0-4C8D-BBA5-4E0892AE2480@.microsoft.com...
> Hello
> I have been given an sql database but its just the .mdf file
> the .ldf file is not recoverable
> Im unable to attach this as the server needs the ldf file which is thinks
> is
> mapped to a t: drive but this doesnt exist
> is there anyway i can get this attached to an sql server as i dont have
> the
> ldf file
I assume you have tried sp_attach_single_file_db?
If that doesn't work, the answer is:
"Maybe".
MS Customer Service has a procedure they can walk you through that MIGHT
work.
As I am not MS, I won't provide it here. (Though if you google sometimes
you can provide it.)
> thank you for any comments
> Martin
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
|||hello i forgot to add this is sql server 2000
any help would be mostly appriciated
regards
"Martin Palmer" wrote:

> Hello
> I have been given an sql database but its just the .mdf file
> the .ldf file is not recoverable
> Im unable to attach this as the server needs the ldf file which is thinks is
> mapped to a t: drive but this doesnt exist
> is there anyway i can get this attached to an sql server as i dont have the
> ldf file
> thank you for any comments
> Martin
|||Attach database may not work in below situations:-
1. If the database is not detached using sp_detach_db or using enterprise
manager.
2. sp_attach_single_file_db will fail incase if you have multiple LDF files
associated.
Since the database attach failed you could try below steps:-
1. Create a new database with same MDF and LDF name
2. stop sql server and delete the new MDF file and copy the old MDF file
3. Start SQL Server and see the status. If the database is suspect do the
below steps:-
Setting the database status to emergency mode tells SQL Server to skip
automatic recovery and lets you access the data. To get your data, use this
script:
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768 where name = "BadDbName"
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
Create a new empty database and you might be able to use bulk copy program
(bcp), simple SELECT commands, or use DTS to extract your data /objects from
problematic database to new database.
Note:
In both the above approch the data integrity will be lost. So it is
recommended to contact Microsoft PSS or restore from a good backup file.
Thanks
Hari
"Martin Palmer" <MartinPalmer@.discussions.microsoft.com> wrote in message
news:D252C85C-B7C0-4C8D-BBA5-4E0892AE2480@.microsoft.com...
> Hello
> I have been given an sql database but its just the .mdf file
> the .ldf file is not recoverable
> Im unable to attach this as the server needs the ldf file which is thinks
> is
> mapped to a t: drive but this doesnt exist
> is there anyway i can get this attached to an sql server as i dont have
> the
> ldf file
> thank you for any comments
> Martin

No comments:

Post a Comment