Cleaning up the migration-center database manually by deleting the history of the scanners or importers can be tedious task depending on the number of scanner/importer runs. Thetask can be greatly facilitated by run ning a stored procedure on the database level.
First, install the stored procedure in the migration-center database:
Run the attached script (del_job_history_oracle.sql) in SqlPlus or SQL Developer connected as user FMEMC.
Run the attached script (del_job_history_postgres.sql) in pgAdmin connected as user FMEMC.
Second, run the script with the appropriate scanner/importer ID:
For deleting all runs of a scanner or importer, run the following command in SqlPlus or SQL Developer connected as FMEMC user (replace 1000 with your scanner/importer id):
-- Oracle
exec del_adaptor_history(1000);-- Postgres
call del_adaptor_history(1000);
-- After running the procedure manually trigger a VACUUM on fmemc.source_objects to reclaim storage and update statistics.
-- This is useful because deleting many rows can leave dead tuples which may slow down queries and affect planner decisions.
-- You can run it with the following line:
vacuum analyze fmemc.source_objects;
IMPORTANT NOTES:
The stored procedure will delete the complete history of the specified scanner or importer. So please use it with great care!
We strongly recommend to create a backup of the migration-center database before you execute this stored procedure!
Deleting a scanner history will delete all scanned objects that have been scanned by the specified scanner. The migset where those objects have been selected, will just be emptied but not deleted.
Comments
0 comments
Please sign in to leave a comment.