Search code examples
oracleplsqlcompareutplsql

Is it possible to compare a set of DB tables before and after running a utplsql procedures?


Is it possible to compare a set of DB tables before and after running a utplsql to see what's changed.

I have a couple of utplsql test packages, ut_package1 and ut_package2.

ut_plackage1 was running fine for quite sometime, and started seeing some failures after adding ut_package2.

ut_package2 tests are running fine, but caused some failures in ut_package1.

I want to compare the DB data before and after running ut_package2, to see the changes that are causing failures in ut_package1.

Also please share if there's a better way which can help me find the RCA.

Thanks.

Made sure that there's no common data that is being used by both utplsql packages. Also made sure that data cleanup is happening in ut_package2. But still seeing some failures in ut_package1.


Solution

  • It is possible to get a view of how the data in a table looked before a certain time interval.

    e.g.

    select * from my_table as of timestamp systimestamp - interval '1' hour
    

    With the operators minus intersect etc. it is relatively easy to check what has changed in the period.

    Search for "oracle flashback" for further information.