Switch to Cloned Database
Before you begin
Procedure
- Access SQL Server Management Studio (SSMS).
- Close all the query windows to avoid any conflict with a database lock.
- Provide a new name for ProductionDB.
-
Rename CloneDB to the previous name of ProductionDB.
Proficy Manufacturing Data Cloud (Proficy MDC) is now configured to use CloneDB as the current Plant Applications database.Note:If an error message appears, stating that the database could not be exclusively locked to perform the operation, run the following SQL script to rename the database:
ALTER DATABASE [<production database>] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE [<production database>] MODIFY NAME = [<production database>_BACKUP] ALTER DATABASE [<production database>_BACKUP] SET MULTI_USER
Note SQL server Replication Start Time (*RST) in UTC after creating the replication of articles through the SQL script.
-
After creating replication of articles, note down the SQL server RST value in
UTC:
SELECT CURRENT_TIMESTAMP GO
-
Recreate the replication:
- Copy the replication_script file that you created while disabling ProductionDB replication.
- Run the script in the SSMS query window.
- Optional: Activate other SQL server-related operations, if any.
- Access the AWS DMS console.
- Start the ongoing replication task.
- Verify whether the capture latency for the site is less than five seconds.
- Restart all Service Oriented Architecture and Plant Applications services.The downtime of Plant Applications services is complete. The services are now connected to the new ProductionDB, and all operations are resumed.
- In the AWS DMS console, verify whether the task is correctly capturing the rows of the Plant Applications production database.
What to do next
- Access the AWS DMS console.
- Select the data migration task with target S3.
- Select Actions, and then select Modify.
- Under custom CDC start point for source transactions:
- Specify a custom start time (UTC).
- Specify the RST noted in Step 5 in UTC.
Note:If the RST is not accurate, you may receive the following error message:Capture job was unable to locate transaction log sequence number which corresponds to AWS DMS CDC start time YYYY-MM-DD HH:MM:SS.
If that happens, adjust the timestamp slightly, and try again.
- Save the task.
- Select Actions, select Start and then Restart.
- Verify that data sent to the S3 bucket.