SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL server 2005 administration (restoring mdf file without ldf)


SQL server 2005 administration (restoring mdf file without ldf)

Author
Message
John Esraelo-498130
John Esraelo-498130
SSC Eights!
SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)

Group: General Forum Members
Points: 843 Visits: 1030
Here is the situation:
> C drive containing the SQL server 2005 is gone
> D drive for data is available
> E drive for logs is GONE
> no backup of mdf nor the ldf file

current dondition:
> a new sql needs to be rebuilt
> the MDF files need to be restored

All the attach various commands are not the options because the DBs where shutdown ungracefully.
So, here is the Q.
How, to restore an MDF file on the new sql server without the original ldf file.
thx

BY THE WAY
I don't think there is such a command as DBCC REBUILD_LOG in 2005...just to make sure we are on the same page.


JohnE

Cheers,
John Esraelo
SanjayAttray
SanjayAttray
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4437 Visits: 1619
sp_attach_single_file_db @dbname= 'dbname' ,@physname= 'physical_name'


but, make sure database got only one .mdf file or say datafile. This command doesnot work with multiple data files.

SQL DBA.
John Esraelo-498130
John Esraelo-498130
SSC Eights!
SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)SSC Eights! (843 reputation)

Group: General Forum Members
Points: 843 Visits: 1030
Hi,
thank you for the quick reply.
I don't think this would work since:
> new sql server and master or msdb have not clue about the mdf
> the mdf was ungracefully shutdown without explicit "detach" information

RUN:
sp_attach_single_file_db @dbname = 'tool' , @physname = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Tool.mdf'

RESULT:
File activation failure. The physical file name "E:\Tool_log.ldf" may be incorrect.
The log cannot be rebuilt because the database was not cleanly shut down.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'tool'. CREATE DATABASE is aborted.


JohnE

Cheers,
John Esraelo
naga.rohitkumar
naga.rohitkumar
SSC Eights!
SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)

Group: General Forum Members
Points: 860 Visits: 1378
1. What about restoring the old backup from tape or server will u tried this ? may be it v'l work !
2. Dont u have a dr for the server which shutdown ungracefully.! if u have any Dr(disaster recovery ) server u can restore from that ihope so.

Thanks
Naga.Rohitkumar
GilaMonster
GilaMonster
SSC Guru
SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)SSC Guru (89K reputation)

Group: General Forum Members
Points: 89287 Visits: 45284
Option 1: Restore from backup.
Option 2: Restore from backup.
Option 3: http://sqlinthewild.co.za/index.php/2009/06/09/deleting-the-transaction-log/ and then spend some time examining the DB for consistency errors (in data, not structure) and fixing them

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search