Friday, March 9, 2012
Deleted logfile
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
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
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:
>
Friday, February 17, 2012
Delete or detach a Suspect database
there a way around that (don't want to shut down production). The suspect
db is just an empty db that is not needed. I need to create another db with
the same name.
Thanks.rdraider (rdraider@.sbcglobal.net) writes:
Quote:
Originally Posted by
Everything I read about sp_resetstatus says you must restart SQL after.
Is there a way around that (don't want to shut down production). The
suspect db is just an empty db that is not needed. I need to create
another db with the same name.
I may be missing something, but what about DROP DATABASE? I made a quick
test on SQL 2000 where I created a database, stopped SQL Server, deleted
the log file to make the database suspect, and restarted SQL Server.
DROP DATABASE worked just fine.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||No queries would work since this database did not exist in
Master.sysdatabases. Not sure why. Attempting to detach from Enterprise
Manager produced an error. Then I simply closed and reopened EM and it was
gone! Odd.
"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns99B1EF3C598D6Yazorman@.127.0.0.1...
Quote:
Originally Posted by
rdraider (rdraider@.sbcglobal.net) writes:
Quote:
Originally Posted by
>Everything I read about sp_resetstatus says you must restart SQL after.
>Is there a way around that (don't want to shut down production). The
>suspect db is just an empty db that is not needed. I need to create
>another db with the same name.
>
I may be missing something, but what about DROP DATABASE? I made a quick
test on SQL 2000 where I created a database, stopped SQL Server, deleted
the log file to make the database suspect, and restarted SQL Server.
DROP DATABASE worked just fine.
>
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||rdraider (rdraider@.sbcglobal.net) writes:
Quote:
Originally Posted by
No queries would work since this database did not exist in
Master.sysdatabases. Not sure why. Attempting to detach from Enterprise
Manager produced an error. Then I simply closed and reopened EM and it was
gone! Odd.
The last thing you should believe is a graphical tool. But they usually
offer a Refresh option to handle such situations.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx