1. Luca Arena
  2. PowerBuilder
  3. Wednesday, 6 January 2021 08:11 AM UTC

Hi all.

A customer of mine, yesterday, performed a bad processing with our PB application on a Sybase SQL Anywhere 10 database and unintentionally deleted a lot of data in various tables. He has no backup of the db (not to mention) but the database has the complete log since creation.

I tried to recover the data acting like this:

  1. transform the log into SQL with dbtran;
  2. edit the obtained SQL file (9GB) and remove all yesterday's operations (checkpoint dates can help me);
  3. create a brand new db with dbinit and execute the modified SQL file on it, obtaining the "restored" db.

I was able to carry out the first two steps without problems; at the third, however, the execution stops me because the SQL file contains strange statements such as:

load into table DBA.pbcattbl from '\\\\. \\ pipe \\ 2792-ASANP_table \ ...

Seems it's trying to import data from a "pipe" which obviously does not exist, blocking everything.

Do you know how to overcome this problem? Are there any alternative solutions to recover customer data?

Thank you so much,
Luca

Accepted Answer
Chris Keating Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 16:14 PM UTC
  2. PowerBuilder
  3. # Permalink

When using LOAD TABLE, "inserts are not recorded in the transaction log file unless WITH ROW LOGGING clause is specified, so the inserted rows may not be recovered in the event of a failure depending upon the logging type. The original file is required if you must recover the rows and WITH FILE NAME LOGGING is used."  

Comment
  1. Luca Arena
  2. Thursday, 7 January 2021 17:45 PM UTC
Thank you Chris!



I guess the LOAD TABLE statements have been generated by DBUNLOAD some years ago when I upgraded the db by using DBUNLOAD -ac (infact there's no real filename in the statement, but a "pipe"). I didn't know that SQL Anywhere does not log the "real" INSERT statements but just the LOAD TABLE statements, which are totally useless since of course I don't have the old db anymore.

My customer has been lucky since I found an old backup of the same database and was able to apply the remainder of the log on it... but if I had to recover it just from the log it would have been impossible.



Best,

Luca
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 6 January 2021 15:31 PM UTC
  2. PowerBuilder
  3. # 1

Hi Luca;

  Your question might be better answered in the SQLAnyWhere forum.

  However, the table in question is one of the PowerBuilder system catalog tables that carries the "Extended Attributes" for any DB Table entity. These are used by the PB IDE and also at production runtime when the dynamic DataWindow features are used.

Regards ... Chris

Comment
  1. Luca Arena
  2. Wednesday, 6 January 2021 16:03 PM UTC
Thank you Chris, you're right, I will post my question in the SQLAnyWhere forum too.



I know about the PB catalog tables, I've been a PB dev for more than 20 years ;-)

The SQL I got out from my customer's log has many LOAD INTO TABLE xxxx statements, more or less one for each table of the db (not just the pbcat* ones).

Anyway our company's framework also uses the pbcat* tables at runtime to perform some actions, so I need to keep them also.



Any more suggestions?

Thanks, Luca
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 6 January 2021 19:00 PM UTC
Hopefully, the SA support forum will have some suggestions for you. Fingers crossed.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.