Data Archiving Process
To ensure best performance of the database, Softrip includes a tool to delete old data. This process deletes Reservation, Product, and Accounting data based on their relevant dates. This process removes old data, ensuring that the main production database only includes data that is relevant to daily operation of the system. All archived records are copied to an “Archive” database before they are deleted from the main production database.
Inputs
The archiving process is a stored procedure named proc_ArchiveAllData
. This stored procedure should be run on the main production database.
@Server
: The database server that hosts the archive database (e.g.MSSQL-ARCHIVE
). Archived records will be copied to this database before they are deleted from the main production database.@DBName
: The database name for the archive database (e.g.SoftripNetArchive
). Archived records will be copied to this database before they are deleted from the main production database.@ResCutoffDate
: The last departure date for which to keep reservation data.@ProdCutoffDate
: The last product date for which to keep Product data.@MrkCutoffDate
: The last date for which to keep CRM/Marketing data.@AccCutoffDate
: The last date for which to keep Accounting data.
Process
Input Validation
Make sure there's no outstanding contingent liability in the period we last closed, for bookings in the archived period.
Process stops here if we have outstanding contingent liability.
Copy Data to the Archive Database
Reservation Data
Copy Credit Card information (
ResCCards
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation documents (
ResDocs
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation history (
ResHhistory
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation services/itinerary (
ResItinerary
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation memos (
ResMemos
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation queue records (
ResQueues
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation vouchers (
ResVouchers
) for reservations that departed before the@ResCutoffDate
to the archive databaseCopy reservation services/itinerary (
ResItinerary
) for reservations that departed before the@ResCutoffDate
to the archive database
Product Data
Copy product upgrades (
ProductUpgrades
) for records that end before the@ProdCutoffDate
to the archive databaseCopy pricing profiles (
PricingProfiles
) for records that end before the@ProdCutoffDate
to the archive databaseCopy air allowance history (
ProdAirAllowHistory
) for records whose departure date is before the@ProdCutoffDate
to the archive databaseCopy product design (
ProdutDesign
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product detail/services (
ProductDetail
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product detail exceptions (
ProductDetailException
) for records whose departure date is before the@ProdCutoffDate
to the archive databaseCopy product events (
ProductEvents
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product guide assignments (
ProductGuides
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product history (
ProductHistory
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product prices (
ProductPrices
) for records that end before the@ProdCutoffDate
to the archive databaseCopy product shop history (
ProductShopHistory
) for records whose departure is before the@ProdCutoffDate
to the archive databaseCopy products (
Product
) for records that end before the@ProdCutoffDate
to the archive databaseCopy inventory (
Inventory
) records whose Inventory Date (IDate
) is before the@ProdCutoffDate
to the archive databaseCopy services (
SupplierServices
) records that end before the@ProdCutoffDate
to the archive databaseCopy rates (
SupplierRates
) records that end before the@ProdCutoffDate
to the archive databaseCopy supplier promotions (
SupplierPromo
) records that end before the@ProdCutoffDate
to the archive databaseCopy supplier promotion details (
SupplierPromoDetail
) records that end before the@ProdCutoffDate
to the archive databaseCopy CMS data (
CMSData
) records whose active date range ends before the@ProdCutoffDate
to the archive databaseCopy CMS items (
CMSItem
) records whose active date range ends before the@ProdCutoffDate
to the archive databaseCopy CMS parent-child relationships (
CmsParentChild
) records whose CMS Items (or parent CMS Items) have an active date range ends before the@ProdCutoffDate
to the archive database
CRM/Marketing Data
Copy conversions (
MrkConversion
) records that occurred before the@MrkCutoffDate
to the archive databaseCopy ad hits (
MrkHitLog
) records that occurred before the@MrkCutoffDate
to the archive databaseCopy completed lead imports (
MrkLeadImportDone
) records that were imported before the@MrkCutoffDate
to the archive database
Accounting Data
Copy transaction detail (
AccTransDetail
) records whose transaction date is before the@AccCutoffDate
to the archive databaseCopy transactions (
AccTrans
) records whose transaction date is before the@AccCutoffDate
to the archive databaseCopy month end (
AccMonthEnd
) records whose transaction date is before the@AccCutoffDate
to the archive database
Delete Archived Data
All records that were copied to the archive database are deleted from the main production database.
Reservation Data
Delete Credit Card information (
ResCCards
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation documents (
ResDocs
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation history (
ResHhistory
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation services/itinerary (
ResItinerary
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation memos (
ResMemos
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation queue records (
ResQueues
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation vouchers (
ResVouchers
) for reservations that departed before the@ResCutoffDate
from the main production databaseDelete reservation services/itinerary (
ResItinerary
) for reservations that departed before the@ResCutoffDate
from the main production databaseUpdate
ResGeneral
records for archived reservations to mark them as “Archived” (Archived = 'Y'
)
Product Data
Delete product upgrades (
ProductUpgrades
) for records that end before the@ProdCutoffDate
from the main production databaseDelete pricing profiles (
PricingProfiles
) for records that end before the@ProdCutoffDate
from the main production databaseDelete air allowance history (
ProdAirAllowHistory
) for records whose departure date is before the@ProdCutoffDate
from the main production databaseDelete product design (
ProdutDesign
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product detail/services (
ProductDetail
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product detail exceptions (
ProductDetailException
) for records whose departure date is before the@ProdCutoffDate
from the main production databaseDelete product events (
ProductEvents
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product guide assignments (
ProductGuides
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product history (
ProductHistory
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product prices (
ProductPrices
) for records that end before the@ProdCutoffDate
from the main production databaseDelete product shop history (
ProductShopHistory
) for records whose departure is before the@ProdCutoffDate
from the main production databaseDelete products (
Product
) for records that end before the@ProdCutoffDate
from the main production databaseDelete inventory (
Inventory
) records whose Inventory Date (IDate
) is before the@ProdCutoffDate
from the main production databaseDelete services (
SupplierServices
) records that end before the@ProdCutoffDate
from the main production databaseDelete rates (
SupplierRates
) records that end before the@ProdCutoffDate
from the main production databaseDelete supplier promotions (
SupplierPromo
) records that end before the@ProdCutoffDate
from the main production databaseDelete supplier promotion details (
SupplierPromoDetail
) records that end before the@ProdCutoffDate
from the main production databaseDelete CMS data (
CMSData
) records whose active date range ends before the@ProdCutoffDate
from the main production databaseDelete CMS items (
CMSItem
) records whose active date range ends before the@ProdCutoffDate
from the main production databaseDelete CMS parent-child relationships (
CmsParentChild
) records whose CMS Items (or parent CMS Items) have an active date range ends before the@ProdCutoffDate
from the main production database
CRM/Marketing Data
Delete conversions (
MrkConversion
) records that occurred before the@MrkCutoffDate
from the main production databaseDelete ad hits (
MrkHitLog
) records that occurred before the@MrkCutoffDate
from the main production databaseDelete completed lead imports (
MrkLeadImportDone
) records that were imported before the@MrkCutoffDate
from the main production database
Accounting Data
Delete transaction detail (
AccTransDetail
) records whose transaction date is before the@AccCutoffDate
from the main production databaseDelete transactions (
AccTrans
) records whose transaction date is before the@AccCutoffDate
from the main production databaseDelete month end (
AccMonthEnd
) records whose transaction date is before the@AccCutoffDate
from the main production database
Notes
The archive process can take a VERY long time, especially if it is run for a large date range (for example, running it for the first time with cutoff dates that include many years of data). While this process is running, your Softrip applications may run into timeout errors and other errors or performance issues.
Once the archive process has completed, we recommend that SQL maintenance tasks are run:
Back up and truncate the main production database’s SQL transaction log file
Rebuild all table indexes on the main production database