Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Archiving Farm Database

  • Last UpdatedJun 06, 2024
  • 2 minute read

Note:
- Do not execute step 1 and step 2, if you have already executed while archiving Repository database and continue with step 3.
- If you want to archive only Farm database and do not want to archive the Repository database, then follow the archiving procedure from step 1.

  1. Execute the AWTRepositoryArchivingScript.sql script in the Repository database.

  2. Execute the proc_SKInsertIntoSKDeleteTable procedure in the Repository database. Refer the execution scripts given in Archiving Repository Database.

  3. Execute the proc_SKInsertIntoFarmTemptable procedure on the Repository database.

    Note: Execute above procedure if the SQL Server system has restarted after step 2.

  4. Execute the AWTFarmArchivingScript.sql script in the Farm database.

    The following tables and procedures are created on executing the above steps.

    Tables and Procedures

    Description

    SKDeleteTableFarm

    Table to store the ExecutionID and other details of the records to be deleted from the Farm database (Production database).

    proc_SKDeleteFrom
    ProductionFarm

    Procedure to delete the Farm database records, and to update the ‘Isdeleted’ field of the SKDeleteTable table to 1, only if the delete was successful. The procedure will delete workflow records with InternalStatus "FN" or "AB".

    proc_SKDeleteFrom
    ArchivedFarm

    Procedure to delete workflow records, which have InternalStatus other than "FN" or "AB", from the Archived database.

    Note: Ensure that this procedure is executed only in the Archived database.

    proc_SKDelete
    InBatches

    Procedure to delete all records of a table in batches, where the size of each batch size is 50000 records.

5. Backup the Farm database.

6. Restore the above backup to new database. This can be the archived Farm database.

7. Execute the proc_SKDeleteFromProductionFarm procedure in Production Farm database.

8. Execute the proc_SKDeleteFromArchivedFarm procedure in Archived Farm database.

TitleResults for “How to create a CRG?”Also Available in