Records being restored from the deleted schema are not automatically removed from the deleted schema after restoration. It is important to remove data from the deleted schema once it has been restored to the regular schema for data exchange purposes as well as future retrieval purposes. If there are multiple instances of the data within the deleted schema, the script run in Part 1 to recover the deleted data will fail as it will encounter multiple records when it is expecting one.


Solution:

1. Log into SQLPlus as biotics_user. 

2. Create a spool file before running the script, for qc purposes.

3. After running the script, at the prompt enter: set serverout on - this will enable you to see the output in later steps.
4. You can either clean one table at a time or clean ALL tables, which is recommended. If you do it for one table, it is necessary to repeat the procedure for ALL child tables (ie. EO_SPECIMEN, EO_SURVEY, etc). The deleted schema doesn't have the integrity constraints that the regular schema does, so it will happily exist with broken links, but it won't be good for data exchange.

To clean ALL tables (RECOMMENDED), enter: exec clean_all_del;


To clean one table in the deleted schema at a time, enter: exec clean_del('eo'); The name of the REGULAR SCHEMA table you want to clean up goes in the quotes, case doesn't matter. Remember, if you run the procedure for one table, it is necessary to repeat the procedure for ALL child tables (ie. EO_SPECIMEN, EO_SURVEY, etc). The deleted schema doesn't have the integrity constraints that the regular schema does, so it will happily exist with broken links, but it won't be good for data exchange.