Wednesday, March 21, 2012

recover with .mdf

a backup was not made and then the log file was deleted. Is there any way to
recover this.Please check this link for a solution of this problem:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=57354
"cheilig" wrote:
> a backup was not made and then the log file was deleted. Is there any way to
> recover this.|||sp_attach_single_file_db would not work, neither would sp_attach_db. Would
get device activation errors or invalid path for the log file
I have gotten the database up in emergency mode by recreating the database,
then replacing the new mdf file with the older one. I can BCP the data out of
the database, but no items are visible in the database under emergency mode.
So at this point I'm left with running a script that gets the schema for the
tables and recreating them. After which i can input the bcp file.
Does anyone know of a script that will automatically generate the database,
such as the one that is generated from EM.
"Absar Ahmad" wrote:
> Following command can be of help to you. Check details in the BOL:
> sp_attach_single_file_db
> "cheilig" wrote:
> > a backup was not made and then the log file was deleted. Is there any way to
> > recover this.|||> Does anyone know of a script that will automatically generate the database,
> such as the one that is generated from EM.
You could try any of the DMO options listed here
http://www.karaszi.com/SQLServer/info_generate_script.asp. I don't know whether it is EM or DMO that
stop you when db is in emergency mode. If it is EM, it might work.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"cheilig" <cheilig@.discussions.microsoft.com> wrote in message
news:9C64349A-5B30-490B-B0C2-4B2F6E320EE8@.microsoft.com...
> sp_attach_single_file_db would not work, neither would sp_attach_db. Would
> get device activation errors or invalid path for the log file
> I have gotten the database up in emergency mode by recreating the database,
> then replacing the new mdf file with the older one. I can BCP the data out of
> the database, but no items are visible in the database under emergency mode.
> So at this point I'm left with running a script that gets the schema for the
> tables and recreating them. After which i can input the bcp file.
> Does anyone know of a script that will automatically generate the database,
> such as the one that is generated from EM.
>
> "Absar Ahmad" wrote:
>> Following command can be of help to you. Check details in the BOL:
>> sp_attach_single_file_db
>> "cheilig" wrote:
>> > a backup was not made and then the log file was deleted. Is there any way to
>> > recover this.|||Following command can be of help to you. Check details in the BOL:
sp_attach_single_file_db
"cheilig" wrote:
> a backup was not made and then the log file was deleted. Is there any way to
> recover this.

No comments:

Post a Comment