Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello, In may database (SQL Anywhere 8) the data get corrupted by some SQL statments. There is no backup. So I translated the LOG-file, removed the corrupt SQL-Statments and then run the editet script in Interactive SQL against an new database.Everything seems fine, only one problem. There are some triggers in the database to save information who last modifed datarecords and at what time. Also there are constraints in the database which set the curret User and current time in new records. All this information is changed to the dbo user (the actually connectet user) and current time. In the Script the information who is logged in and at what time is present. But it is commented out. Is there a way to restore this infomation?

Thank you for your help

Karl Baumann

This question is marked "community wiki".

asked 22 Feb '12, 03:33

Karl's gravatar image

Karl
1112
accept rate: 0%

FWIW, I would recommend to not ask a "communitiy wiki" question. A "communitiy wiki" question won't give you reputation points in case you get votes, and these are useful to get more things done here, cf. the forum FAQ...

(22 Feb '12, 04:23) Volker Barth

You may be able to use DBTRAN with the "-t option" to create a SQL script which contains the actions carried out by triggers (or use the -z option which includes them also, but just as comments).

However, I'm not sure if running the script that was created with the -t option will work if the triggers are still in place - simply as the actual triggers might still overwrite the log contents. IMHO, that will depend on the trigger's code.

In that case, disabling the triggers altogether by starting the database engine with the -gf option may help.

Note: The links point to v12.0.1 docs but the relevant options work with v8, as well.


For further advice, it would be helpful to see parts of the statements - and the missing values based on triggers or default values - at least for some sample tables and triggers...

permanent link

answered 22 Feb '12, 04:19

Volker%20Barth's gravatar image

Volker Barth
40.2k361549822
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×13

question asked: 22 Feb '12, 03:33

question was seen: 1,772 times

last updated: 22 Feb '12, 04:23