<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Malek's Moorish tales</title>
    <link>http://kemmou.com/</link>
    <description>the new 1001 nights mantra : blog or die</description>
    <language>en-us</language>
    <copyright>Malek Kemmou</copyright>
    <lastBuildDate>Fri, 24 Sep 2004 20:28:53 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>blog@kemmou.com</managingEditor>
    <webMaster>blog@kemmou.com</webMaster>
    <item>
      <trackback:ping>http://kemmou.com/Trackback.aspx?guid=b799c6f8-efda-465b-a7ae-a8de0b0d1682</trackback:ping>
      <pingback:server>http://kemmou.com/pingback.aspx</pingback:server>
      <pingback:target>http://kemmou.com/PermaLink,guid,b799c6f8-efda-465b-a7ae-a8de0b0d1682.aspx</pingback:target>
      <dc:creator />
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
         Today, I had a call (on IM) from a friend in deep trouble. As usual,
      it was their fault completely... They did not make any backups for their DataBase
      !!! and sure enough, they didn't relize what they were doing until disaster happened...
      Looks like they didn't make it a requirement during a test phase (foolishness!) and
      didn't make any new requirement when going to production !!!
   </p>
        <p dir="ltr">
         Anyway, the DataBase guy claims that all of a sudden the DataBase (on
      SQL Server 2000) wasn't there anymore. the .mdf and .ldf files where still there...
      he tried to attach the database, but it wouldn't work (they wheren't properly detached)...
      So they called on my friend, who had built the solution for them. She didn't have
      any database recovery skills (neither do I for that matter), and she pinged me. I
      tried the usual recovery techniques, like starting from an old database and try to
      recover from the transaction log, but it didn't work (transaction log corrupt). Then
      we tried the sp_attach_single_file_db with only the mdf file, but it kept asking for
      the ldf file. I googled a bit, and stumbled on DBCC Rebuild_Log. At that point, our
      problem was not to have consistant data, but to have any data at all, so we were ready
      to try desperate moves... However, before doing the trick, we needed the DataBase
      to be attached (even if it is in a suspect state). So what we did is create a
      new DB with the same name and file locations, stop the SQL Server, and replaced the
      mdf of the new empty database with the mdf from the broken database, and restarted
      SQL Server. The DataBase showed as suspect. then We executed a DBCC Rebuild_Log. Restarted
      SQL Server, and the DataBase showed up. After checking consistancy and the data, it
      looked like everything was there... 
   </p>
        <p dir="ltr">
          Well, I hope they learned the lesson, and that the first thing
      they would be doing tomorrow morning is creating a Disaster Recovery plan and testing
      it correctly...
   </p>
        <p dir="ltr">
          I am quite happy I could help on a disaster recovery on SQL server...
      never thought that could ever happen.
   </p>
        <br />
        <hr />
   This weblog is sponsored by <a href="http://www.newtelligence.com">newtelligence AG</a>. 
</body>
      <title>God Bless DBCC Rebuild_Log ... It made somebody's day, and mine...</title>
      <guid>http://kemmou.com/PermaLink,guid,b799c6f8-efda-465b-a7ae-a8de0b0d1682.aspx</guid>
      <link>http://kemmou.com/PermaLink,guid,b799c6f8-efda-465b-a7ae-a8de0b0d1682.aspx</link>
      <pubDate>Fri, 24 Sep 2004 20:28:53 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   &amp;nbsp;&amp;nbsp; Today, I had a call (on IM) from a friend in deep trouble. As usual,
   it was their fault completely... They did not make any backups for their DataBase
   !!! and sure enough, they didn't relize what they were doing until disaster happened...
   Looks like they didn't make it a requirement during a test phase (foolishness!) and
   didn't make any new requirement when going to production !!!
&lt;/p&gt;
&lt;p dir=ltr&gt;
   &amp;nbsp;&amp;nbsp; Anyway, the DataBase guy claims that all of a sudden the DataBase (on
   SQL Server 2000) wasn't there anymore. the .mdf and .ldf files where still there...
   he tried to attach the database, but it wouldn't work (they wheren't properly detached)...
   So they called on my friend, who had built the solution for them. She didn't have
   any database recovery skills (neither do I for that matter), and she pinged me. I
   tried the usual recovery techniques, like starting from an old database and try to
   recover from the transaction log, but it didn't work (transaction log corrupt). Then
   we tried the sp_attach_single_file_db with only the mdf file, but it kept asking for
   the ldf file. I googled a bit, and stumbled on DBCC Rebuild_Log. At that point, our
   problem was not to have consistant data, but to have any data at all, so we were ready
   to try desperate moves... However, before doing the trick, we needed the DataBase
   to be attached (even if it is in a suspect state). So what&amp;nbsp;we did is create a
   new DB with the same name and file locations, stop the SQL Server, and replaced the
   mdf of the new empty database with the mdf from the broken database, and restarted
   SQL Server. The DataBase showed as suspect. then We executed a DBCC Rebuild_Log. Restarted
   SQL Server, and the DataBase showed up. After checking consistancy and the data, it
   looked like everything was there... 
&lt;/p&gt;
&lt;p dir=ltr&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; Well, I hope they learned the lesson, and that the first thing
   they would be doing tomorrow morning is creating a Disaster Recovery plan and testing
   it correctly...
&lt;/p&gt;
&lt;p dir=ltr&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; I am quite happy I could help on a disaster recovery on SQL server...
   never thought that could ever happen.
&lt;/p&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.newtelligence.com"&gt;newtelligence AG&lt;/a&gt;. </description>
      <category>main;other technical topics</category>
    </item>
  </channel>
</rss>