Showing posts with label dropped. Show all posts
Showing posts with label dropped. Show all posts

Monday, March 26, 2012

Oh No This Is A Disaster

Ok, this is really bad.

A table has been accidentally DROPPED from our SQL Database...

We have the transaction log from the very day that this table was created...

However, as we are all C++ programmers (and not DB people!) we are not sure how to do this!

Could anyone explain how to recreate a table from a transaction log, perhaps up to a specific date - or point us to a resource on the web.

Thanks for any advice you can give. (Head now under the table, hiding from the management :mad:

Mark.Could you maybe restore from those old transaction logs (do you mean you have transaction log backups from the time the table was created)?
Notice that all tables, SPs etc will be restored then from the old times.|||Hi - thanks for the reply - In actual fact, the transaction log is complete - it has never been backed up...

In effect, I think what we need to do is replay the transaction log up until a certain point, BEFORE the table was accidentally dropped, thus, in effect 'rebuilding' the database (or maybe we can filter the transaction log for just one table?) from scratch.

We don't mind if we lose some data, say, up until the nearest check point before the accident, we can then manually re-enter the data...

Our current line of thinking is that we first need to backup the t/log (it will be a full backup since it's never been backed up) and then restore
it up until a certain point - however this is a programming shop and we're not really sure of the process/syntax required to do this - we just treat the server as a black box and pump data in/out with SQL Statements!!!

We're sinking fast!

The SQL server is SQL Server 7 - WE have just stopped the server and literally copied the disk files - just in case - we would like to take those files to a second box, so that we can work on it without causing any more damage(!) - Is there a method to do this?

Thanks again for any assistance you can offer.

Mark.|||Hi Mark,
I know that you can do a partial restore in SQl Server 2000 to a named mark in the transactional log but do not think this option is available to you with version 7. I just went searching on-line and found no evidence to counter my suspicions... Since you have never done a back-up of the transactional log, it is pretty useless to you. When is the last back-up you made for your database?

Wednesday, March 21, 2012

odd TEXT type field problem

Hi,
There is a db with 200GB, with ~160 GB data in it. Most of the data was a
TEXT type field in a table. That field has been dropped and added back with
default NULL but it appears I still have ~160 GB of data.
How is that possible?
updatestats would help?
The table in question has a two field composite clustered index, but not on
the TEXT type field.
The truth is the whole thing is very fragmented. Defragmenting the clustered
index would place exclusive lock on the table?
Your help would be appreciated,
JanosYou can try running DBCC CLEANTABLE on the table that had the TEXT column.
Look up syntax in BOL.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Janos Horanszky" <kob_uki@.hotmail.com> wrote in message
news:emmBIbZEFHA.3368@.TK2MSFTNGP10.phx.gbl...
> Hi,
> There is a db with 200GB, with ~160 GB data in it. Most of the data was a
> TEXT type field in a table. That field has been dropped and added back
with
> default NULL but it appears I still have ~160 GB of data.
> How is that possible?
> updatestats would help?
> The table in question has a two field composite clustered index, but not
on
> the TEXT type field.
> The truth is the whole thing is very fragmented. Defragmenting the
clustered
> index would place exclusive lock on the table?
> Your help would be appreciated,
> Janos
>|||I appreciate Adam, I will try it on our test environment, I let you know
asap.
Janos
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:eDFFq6dEFHA.1012@.TK2MSFTNGP14.phx.gbl...
> You can try running DBCC CLEANTABLE on the table that had the TEXT column.
> Look up syntax in BOL.
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
> "Janos Horanszky" <kob_uki@.hotmail.com> wrote in message
> news:emmBIbZEFHA.3368@.TK2MSFTNGP10.phx.gbl...
> with
> on
> clustered
>