Maintaining HVR Capture After Restoring a Sybase ASE Database
Overview
When you restore a Sybase ASE source database from a previously taken database dump, you must perform these steps to ensure the Capture job continues to operate correctly.
Environment
- HVR 6
- Source database: Sybase ASE
Steps
These steps assume you load a database dump from the same database that HVR is configured to capture from.
Take the primary database offline on the Primary Data Server.
Suspend the HVR Capture job:
- Go to the Channel Details page.
- Under the Jobs pane, select the capture job.
- Click Suspend Jobs at the top right of the Jobs pane.
Load the dump into the primary database.
Bring the primary database online, but do not allow user activity yet.
If the database cannot be brought online due to the
ltm truncstate, connect to the Primary Data Server and run:dbcc dbrepair (primary_db, 'ltmignore') go online database primary_db goTruncate the transaction log. Connect to the Primary Data Server:
isql -U username -P password -S primary_data_serverThen run:
dbcc settrunc(ltm, ignore) go dump transaction primary_db with truncate_only go dbcc settrunc(ltm, valid) goActivate the HVR channel:
- Go to the Channel Details page and click Activate Replication.
- In the Activate Replication dialog, under Replication Components, select all options.
- Set Capture Start Moment to No Rewind into DBMS logging stream.
- Click Activate Replication.
Confirm the HVR Capture job is running.
Resume user activity on the primary database.
Take the primary database offline on the Primary Data Server.
Suspend the HVR Capture job using the hvrsuspend command:
hvrsuspend hub channelLoad the dump into the primary database.
Bring the primary database online, but do not allow user activity yet.
If the database cannot be brought online due to the
ltm truncstate, connect to the Primary Data Server and run:dbcc dbrepair (primary_db, 'ltmignore') go online database primary_db goTruncate the transaction log. Connect to the Primary Data Server:
isql -U username -P password -S primary_data_serverThen run:
dbcc settrunc(ltm, ignore) go dump transaction primary_db with truncate_only go dbcc settrunc(ltm, valid) goActivate the HVR channel to regenerate state tables and reset the capture time to the current log position (no rewind) using the hvractivate command:
hvractivate hub channelConfirm the HVR Capture job is running.
Resume user activity on the primary database.
Background
After a database restore, the Sybase ASE transaction log is reset to the restore point. The HVR Capture job holds a log position that references transaction log records that no longer exist in the restored database. Additionally, if the transaction log is not truncated after the restore, the ltm trunc state prevents HVR from resuming capture. Truncating the log and reactivating HVR with the current log position lets capture resume successfully.