on 03-30-2015 2:24 PM
Hi All,
When I do a full load and use 'delete table table before loading' option if my job , if my job fails abruptly is it possible to automatically rollback in BODS ?
Can anyone please explain me what exactly happens?
Or is there a particular mechanism I have to use during full loads to restore my previous data in target as before at the point of failure ?
Please help me with the solution.
Thanks,
Deepa
If you check delete table table before loading, your table will be truncated before the data flow starts. A SQL truncate cannot be rolled back. If your job fails, you cannot recover your original data.
As a workaround, include a script to saveguard your table before starting the dataflow. Use a try-catch structure to intercept any errors. If your data flow runs successfully, drop the copy of the table; if it runs into an error, put the original contents back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In many databases truncate table is a DDL statement that cannot be rolled back. Check http://blogs.lessthandot.com/index.php/datamgmt/dbadmin/mssqlserveradmin/truncate-rollback-differenc... for a difference in behaviour between MS SQL Server and Oracle.
Hi Arun,
I agree with you... It works in SQL Server.
drop table ##TEMP
/** Create a temporary table **/
select * into ##TEMP from TEST1
/**Insert a Value in Table**/
insert into ##TEMP values(1)
select * from ##TEMP
/**Begin a Transaction**/
begin tran T1
truncate table ##TEMP
/** Rollback the transaction**/
rollback tran T1
select * from ##TEMP
Hope this helps Deepa
Rgeards
Arun Sasi
Hi Dirk,
Its also possible to rollback in Oracle only if the transaction contains marked savepoints, ROLLBACK TO SAVEPOINT [name] can be used to rollback the transaction upto the specified savepoint only. As a result, all the data changes upto the specified savepoint will be discarded.
I am sure it will be possible in other databases as well until you specify a transaction...
Regards
Arun Sasi
Do you mean, we can not rollback the data in BODS ?
Then Is there any alternative way to restore the data that was there before the job run, If the job fails abruptly during the full load ?
Or I should store the backup of the target data and rerun the job to load the backup table\file data in to the target?
Here HANA is our target system.
It's not a problem of DS, it's a feature of the underlying database. In HANA you cannot.
But no worries, I have given you a workaround already:
As a workaround, include a script to saveguard your table before starting the dataflow. Use a try-catch structure to intercept any errors. If your data flow runs successfully, drop the copy of the table; if it runs into an error, put the original contents back.
Thanks All. I have got the solution. Thread can be closed.
Thanks,
Deepa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the target table option, turn on the transaction control option. Set the value to zero.
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepa,
Check this, page 182 you will find a very detailed explanation
http://help.sap.com/businessobject/product_guides/sbods42/en/ds_42_reference_en.pdf
Arun
Arun's suggestion makes sense. If we set transaction order to 0 , then truncate data before loading will be disabled. Only downside of this arrangement is that DS will keep all the data in memory before single commit. This might not work when a dataflow needs to process large amount of data.
I am sorry to say but that does not make sense at all. When you set Include in transaction to Yes, Delete data from table before loading is automatically disabled. That means that the original wanted behaviour of the data flow is lost, isn't it?
What happens when you do a full load, have the option set and your job succeeds? Because the truncate has not been executed (you disabled it), the original data is stil there; And that's not according to plan .
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.