Showing posts with label logfile. Show all posts
Showing posts with label logfile. Show all posts

Thursday, March 29, 2012

Deleting records in the logfile

I have a database that is used to store a lot of data. We load the data on a
daily basis, several thousand records per day. The Log file is not needed,
so whats the best way to delete the records in it and reduce the size

Thanks

Derrick"Derrick King" <derrick.king@.bradford.gov.uk> wrote in message
news:c1l7ag$ejl$1@.newsreaderm1.core.theplanet.net. ..
> I have a database that is used to store a lot of data. We load the data on
a
> daily basis, several thousand records per day. The Log file is not needed,
> so whats the best way to delete the records in it and reduce the size
> Thanks
> Derrick

You don't mention which version of MSSQL you have, but assuming it's 2000,
then see "Recovery Models" in Books Online. If you don't need transaction
log backups, the easiest solution is probably to set the database to Simple
recovery mode, which will automatically recover log space if possible.

If that's not acceptable, then you can consider transaction log backups (if
you don't already do that), which will truncate the log. Truncating the log
frees up log space but does not make it physically smaller, so you may also
need to use DBCC SHRINKFILE - see "Shrinking Databases".

Simon

Friday, March 9, 2012

deleted mdf file want to restore from logfile?

I have deleted my mdf file by accident en need to restore the db from a logfile
the size of the logfile is 54gb.
I am totally desparate this was critical data, I tried to get the data from
the subscription server but this file is totally messed up , so I bought a
app to recover the data but it only managed bits and pieces.
My only hope now is to restore the data from the logfile but I have no idea
how or where to start. Would appriciate any helpDo you have full backup and transaction files up to the time that the
mdf was deleted or just the ldf? If not, I'm afraid you're going to
be out of luck.
On Sep 25, 9:00 am, jules <ju...@.discussions.microsoft.com> wrote:
> I have deleted my mdf file by accident en need to restore the db from a logfile
> the size of the logfile is 54gb.
> I am totally desparate this was critical data, I tried to get the data from
> the subscription server but this file is totally messed up , so I bought a
> app to recover the data but it only managed bits and pieces.
> My only hope now is to restore the data from the logfile but I have no idea
> how or where to start. Would appriciate any help|||In article <0A70FE38-9F46-4EBC-BFE3-9ABA3D9D1985@.microsoft.com>,
jules@.discussions.microsoft.com says...
> I have deleted my mdf file by accident en need to restore the db from a logfile
> the size of the logfile is 54gb.
> I am totally desparate this was critical data, I tried to get the data from
> the subscription server but this file is totally messed up , so I bought a
> app to recover the data but it only managed bits and pieces.
> My only hope now is to restore the data from the logfile but I have no idea
> how or where to start. Would appriciate any help
>
Might investigate Lumigent Logreader -- can restore data from a log
file. There may be other products as well
--
Graham (Pete) Berry
PeteBerry@.Caltech.edu|||Get in touch with Brian Lockwood at ApexSQL. They have done this type of
disaster recovery before, although I am not sure recovery is possible
without the database file as well as the log file. apexsql.com
"jules" <jules@.discussions.microsoft.com> wrote in message
news:0A70FE38-9F46-4EBC-BFE3-9ABA3D9D1985@.microsoft.com...
>I have deleted my mdf file by accident en need to restore the db from a
>logfile
> the size of the logfile is 54gb.
> I am totally desparate this was critical data, I tried to get the data
> from
> the subscription server but this file is totally messed up , so I bought a
> app to recover the data but it only managed bits and pieces.
> My only hope now is to restore the data from the logfile but I have no
> idea
> how or where to start. Would appriciate any help

Deleted logfile

Hi,
I have detach my sql database and deleted the transaction logfile.
Now i cannot attach the database bak to SQL.
The logfile is completly gone.
How can i reattach this database (don't want to use the backup)
Can u help me
regards
Steven
Hi
Look at sp_attach_single_file_db stored procedure.
For more details please refer to BOL
"Tjina" <stjinaton@.nagico.com> wrote in message
news:OPJz1f2uEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>
|||As far as I know with SQL2K you can re-attach the database without the log
file. SQL Server should notify you that the log file was not found and will
ask you if you want a new log file to be created.
Sasan Saidi, MSc in CS
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Tjina" wrote:

> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>
>
|||Have you tried using sp_attach_single_file_db? You can find more
information on using this in books online.
-Sue
On Tue, 26 Oct 2004 10:27:41 -0400, "Tjina" <stjinaton@.nagico.com>
wrote:

>Hi,
>I have detach my sql database and deleted the transaction logfile.
>Now i cannot attach the database bak to SQL.
>The logfile is completly gone.
>How can i reattach this database (don't want to use the backup)
>Can u help me
>regards
>Steven
>
|||> As far as I know with SQL2K you can re-attach the database without the log
> file.
Not in all cases...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sasan Saidi" <SasanSaidi@.discussions.microsoft.com> wrote in message
news:942597C9-6CED-4A33-8A27-9F73475A4D0C@.microsoft.com...[vbcol=seagreen]
> As far as I know with SQL2K you can re-attach the database without the log
> file. SQL Server should notify you that the log file was not found and will
> ask you if you want a new log file to be created.
> --
> Sasan Saidi, MSc in CS
> "I saw it work in a cartoon once so I am pretty sure I can do it."
>
> "Tjina" wrote:

Deleted logfile

Hi,
I have detach my sql database and deleted the transaction logfile.
Now i cannot attach the database bak to SQL.
The logfile is completly gone.
How can i reattach this database (don't want to use the backup)
Can u help me
regards
StevenHi
Look at sp_attach_single_file_db stored procedure.
For more details please refer to BOL
"Tjina" <stjinaton@.nagico.com> wrote in message
news:OPJz1f2uEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>|||As far as I know with SQL2K you can re-attach the database without the log
file. SQL Server should notify you that the log file was not found and will
ask you if you want a new log file to be created.
--
Sasan Saidi, MSc in CS
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Tjina" wrote:
> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>
>|||Have you tried using sp_attach_single_file_db? You can find more
information on using this in books online.
-Sue
On Tue, 26 Oct 2004 10:27:41 -0400, "Tjina" <stjinaton@.nagico.com>
wrote:
>Hi,
>I have detach my sql database and deleted the transaction logfile.
>Now i cannot attach the database bak to SQL.
>The logfile is completly gone.
>How can i reattach this database (don't want to use the backup)
>Can u help me
>regards
>Steven
>|||> As far as I know with SQL2K you can re-attach the database without the log
> file.
Not in all cases...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sasan Saidi" <SasanSaidi@.discussions.microsoft.com> wrote in message
news:942597C9-6CED-4A33-8A27-9F73475A4D0C@.microsoft.com...
> As far as I know with SQL2K you can re-attach the database without the log
> file. SQL Server should notify you that the log file was not found and will
> ask you if you want a new log file to be created.
> --
> Sasan Saidi, MSc in CS
> "I saw it work in a cartoon once so I am pretty sure I can do it."
>
> "Tjina" wrote:
>> Hi,
>> I have detach my sql database and deleted the transaction logfile.
>> Now i cannot attach the database bak to SQL.
>> The logfile is completly gone.
>> How can i reattach this database (don't want to use the backup)
>> Can u help me
>> regards
>> Steven
>>

Deleted logfile

Hi,
I have detach my sql database and deleted the transaction logfile.
Now i cannot attach the database bak to SQL.
The logfile is completly gone.
How can i reattach this database (don't want to use the backup)
Can u help me
regards
StevenHi
Look at sp_attach_single_file_db stored procedure.
For more details please refer to BOL
"Tjina" <stjinaton@.nagico.com> wrote in message
news:OPJz1f2uEHA.612@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>|||As far as I know with SQL2K you can re-attach the database without the log
file. SQL Server should notify you that the log file was not found and will
ask you if you want a new log file to be created.
Sasan Saidi, MSc in CS
"I saw it work in a cartoon once so I am pretty sure I can do it."
"Tjina" wrote:

> Hi,
> I have detach my sql database and deleted the transaction logfile.
> Now i cannot attach the database bak to SQL.
> The logfile is completly gone.
> How can i reattach this database (don't want to use the backup)
> Can u help me
> regards
> Steven
>
>|||Have you tried using sp_attach_single_file_db? You can find more
information on using this in books online.
-Sue
On Tue, 26 Oct 2004 10:27:41 -0400, "Tjina" <stjinaton@.nagico.com>
wrote:

>Hi,
>I have detach my sql database and deleted the transaction logfile.
>Now i cannot attach the database bak to SQL.
>The logfile is completly gone.
>How can i reattach this database (don't want to use the backup)
>Can u help me
>regards
>Steven
>|||> As far as I know with SQL2K you can re-attach the database without the log
> file.
Not in all cases...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sasan Saidi" <SasanSaidi@.discussions.microsoft.com> wrote in message
news:942597C9-6CED-4A33-8A27-9F73475A4D0C@.microsoft.com...[vbcol=seagreen]
> As far as I know with SQL2K you can re-attach the database without the log
> file. SQL Server should notify you that the log file was not found and wil
l
> ask you if you want a new log file to be created.
> --
> Sasan Saidi, MSc in CS
> "I saw it work in a cartoon once so I am pretty sure I can do it."
>
> "Tjina" wrote:
>