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".
|
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... |
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...