Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

UnDo Delete

5 posts in General Discussion Last posting was on 2008-01-02 15:28:26.0Z
Chris H Posted on 2007-12-27 23:25:28.0Z
From: "Chris H" <humme.chris@royalmaster.com>
Newsgroups: ianywhere.public.general
Subject: UnDo Delete
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
NNTP-Posting-Host: ool-4351790c.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-4351790c.dyn.optonline.net
Message-ID: <47743468$1@forums-1-dub>
Date: 27 Dec 2007 15:25:28 -0800
X-Trace: forums-1-dub 1198797928 67.81.121.12 (27 Dec 2007 15:25:28 -0800)
X-Original-Trace: 27 Dec 2007 15:25:28 -0800, ool-4351790c.dyn.optonline.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6653
Article PK: 4902

Is it possible to undo a delete? Is seems like I should be able to do a
ROLLBACK or something! Isn't that what the log file is for?



Thanks In Advance

Chris


Mark Culp Posted on 2007-12-28 02:21:34.0Z
Message-ID: <47745DAD.C117A075@iAnywhere.com>
From: Mark Culp <reply_to_newsgroups_only_please_nospam_mark.culp@iAnywhere.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: UnDo Delete
References: <47743468$1@forums-1-dub>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-concord-021.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-021.sybase.com
Date: 27 Dec 2007 18:21:34 -0800
X-Trace: forums-1-dub 1198808494 158.159.8.21 (27 Dec 2007 18:21:34 -0800)
X-Original-Trace: 27 Dec 2007 18:21:34 -0800, vpn-concord-021.sybase.com
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6654
Article PK: 4903

If the transaction that contained the DELETE has not been COMMITted,
then a ROLLBACK will undo the delete....
But once the transaction has been committed, the delete is made permanent
in the database... that is, after all, what COMMIT is suppose to do.

If you need to recover the data that has been deleted, you can use the
transaction log to do this...

To do this, use dbtran to get a .sql file of all of the transactions
that have occurred, then either

1) edit the sql file to remove the delete statement, then apply
the sql file to a backup of your database, or

2) process the sql file to determine the data that has been deleted
(not necessarily an easy task), and re-add the deleted data.

I'd recommend you attempt #1 first, provided that you have a backup.

Chris H wrote:
>
> Is it possible to undo a delete? Is seems like I should be able to do a
> ROLLBACK or something! Isn't that what the log file is for?
>
> Thanks In Advance
>
> Chris


Chris H Posted on 2007-12-28 15:43:26.0Z
From: "Chris H" <humme.chris@royalmaster.com>
Newsgroups: ianywhere.public.general
References: <47743468$1@forums-1-dub> <47745DAD.C117A075@iAnywhere.com>
Subject: Re: UnDo Delete
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: ool-4351790c.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-4351790c.dyn.optonline.net
Message-ID: <4775199e$1@forums-1-dub>
Date: 28 Dec 2007 07:43:26 -0800
X-Trace: forums-1-dub 1198856606 67.81.121.12 (28 Dec 2007 07:43:26 -0800)
X-Original-Trace: 28 Dec 2007 07:43:26 -0800, ool-4351790c.dyn.optonline.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6655
Article PK: 4905

I used the SQL Central Traslate Log File wizard to translate the log file to
an SQL file.

My question is how does a sequence like below tell me the value of the data
deleted?

What am I missing?



--DELETE-1001-0000465788

DELETE FROM DBA.wire_graph_points

WHERE profile_name='000 A '

AND graph_date_time='2007-06-14 15:20:57.0'

AND point_group_no=162

go

--COMMIT-1001-0000465824



Thanks Again

Chris



"Mark Culp" <reply_to_newsgroups_only_please_nospam_mark.culp@iAnywhere.com>

wrote in message news:47745DAD.C117A075@iAnywhere.com...
> If the transaction that contained the DELETE has not been COMMITted,
> then a ROLLBACK will undo the delete....
> But once the transaction has been committed, the delete is made permanent
> in the database... that is, after all, what COMMIT is suppose to do.
>
> If you need to recover the data that has been deleted, you can use the
> transaction log to do this...
>
> To do this, use dbtran to get a .sql file of all of the transactions
> that have occurred, then either
>
> 1) edit the sql file to remove the delete statement, then apply
> the sql file to a backup of your database, or
>
> 2) process the sql file to determine the data that has been deleted
> (not necessarily an easy task), and re-add the deleted data.
>
> I'd recommend you attempt #1 first, provided that you have a backup.
>
> Chris H wrote:
>>
>> Is it possible to undo a delete? Is seems like I should be able to do a
>> ROLLBACK or something! Isn't that what the log file is for?
>>
>> Thanks In Advance
>>
>> Chris


Rob Waywell Posted on 2008-01-02 14:25:55.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <47743468$1@forums-1-dub> <47745DAD.C117A075@iAnywhere.com> <4775199e$1@forums-1-dub>
Subject: Re: UnDo Delete
Lines: 107
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: rwaywell-xp2.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-xp2.sybase.com
Message-ID: <477b9ef3$1@forums-1-dub>
Date: 2 Jan 2008 06:25:55 -0800
X-Trace: forums-1-dub 1199283955 10.25.98.235 (2 Jan 2008 06:25:55 -0800)
X-Original-Trace: 2 Jan 2008 06:25:55 -0800, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6657
Article PK: 4906


> My question is how does a sequence like below tell me the value of the
> data deleted?
>

As long as a table has a primary key, the transaction log does not
record the full record image for a DELETE. The purpose of the transaction
log is to be able to restore the database to the same end point. For a
DELETE, the only information require to re-delete the record during a
database recovery is the primary key of that record. This is in contrast to
the Rollback Log which is a temporary, connection specific, in-memory, undo
log that only persists for the duration of the transaction. When a
transaction is completed through either a COMMIT or a ROLLBACK, then the
rollback log for that transaction is freed.

As Mark outlined, what you really need to do is to revert to a backup
copy of your database and recover from there.

Do you have a backup of the database from before the problem delete?

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

"Chris H" <humme.chris@royalmaster.com> wrote in message
news:4775199e$1@forums-1-dub...
>
>
> I used the SQL Central Traslate Log File wizard to translate the log file
> to an SQL file.
>
> My question is how does a sequence like below tell me the value of the
> data deleted?
>
> What am I missing?
>
>
>
> --DELETE-1001-0000465788
>
> DELETE FROM DBA.wire_graph_points
>
> WHERE profile_name='000 A '
>
> AND graph_date_time='2007-06-14 15:20:57.0'
>
> AND point_group_no=162
>
> go
>
> --COMMIT-1001-0000465824
>
>
>
> Thanks Again
>
> Chris
>
>
>
> "Mark Culp"
> <reply_to_newsgroups_only_please_nospam_mark.culp@iAnywhere.com> wrote in
> message news:47745DAD.C117A075@iAnywhere.com...
>> If the transaction that contained the DELETE has not been COMMITted,
>> then a ROLLBACK will undo the delete....
>> But once the transaction has been committed, the delete is made permanent
>> in the database... that is, after all, what COMMIT is suppose to do.
>>
>> If you need to recover the data that has been deleted, you can use the
>> transaction log to do this...
>>
>> To do this, use dbtran to get a .sql file of all of the transactions
>> that have occurred, then either
>>
>> 1) edit the sql file to remove the delete statement, then apply
>> the sql file to a backup of your database, or
>>
>> 2) process the sql file to determine the data that has been deleted
>> (not necessarily an easy task), and re-add the deleted data.
>>
>> I'd recommend you attempt #1 first, provided that you have a backup.
>>
>> Chris H wrote:
>>>
>>> Is it possible to undo a delete? Is seems like I should be able to do a
>>> ROLLBACK or something! Isn't that what the log file is for?
>>>
>>> Thanks In Advance
>>>
>>> Chris
>
>


David Fishburn Posted on 2008-01-02 15:28:26.0Z
Newsgroups: ianywhere.public.general
Subject: Re: UnDo Delete
From: David Fishburn <fishburn_spam@off.ianywhere.com>
References: <47743468$1@forums-1-dub>
Organization: iAnywhere Solutions
Message-ID: <Xns9A196A541E79Dfishburnsybasecom@127.0.0.1>
User-Agent: Xnews/2005.10.18 Hamster/2.1.0.0
NNTP-Posting-Host: wireless-wat-1.sybase.com
X-Original-NNTP-Posting-Host: wireless-wat-1.sybase.com
Date: 2 Jan 2008 07:28:26 -0800
X-Trace: forums-1-dub 1199287706 10.25.109.130 (2 Jan 2008 07:28:26 -0800)
X-Original-Trace: 2 Jan 2008 07:28:26 -0800, wireless-wat-1.sybase.com
Lines: 39
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6659
Article PK: 4908

"Chris H" <humme.chris@royalmaster.com> wrote in news:47743468$1@forums-1-
dub
of ianywhere.public.general:

CH> Is it possible to undo a delete? Is seems like I should be able to do a
CH> ROLLBACK or something! Isn't that what the log file is for?

The transaction log file is used for a number of reasons, performance,
recoverability and so on.

It is not used for what you have described above, since after COMMITing
the transaction you have indicated you want this to be permanent. The
other suggestions would allow you to do what you need, as long as you
have a backup of the database BEFORE the delete was made.

If you have that, you can recover all changes made to the database
EXCEPT the delete.

--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng10 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/

Developer Community / Whitepapers
http://www.ianywhere.com/developer

Case-Express - to report bugs
http://case-express.sybase.com

CodeXchange - Free samples
http://ianywhere.codexchange.sybase.com/servlets/ProjectDocumentList