Switch to Cloned Database

Before you begin

Disable ProductionDB replication.

Procedure

  1. Access SQL Server Management Studio (SSMS).
  2. Close all the query windows to avoid any conflict with a database lock.
  3. Provide a new name for ProductionDB.
  4. 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.

  5. After creating replication of articles, note down the SQL server RST value in UTC:
    SELECT CURRENT_TIMESTAMP
    GO
  6. Recreate the replication:
  7. Optional: Activate other SQL server-related operations, if any.
  8. Access the AWS DMS console.
  9. Start the ongoing replication task.
  10. Verify whether the capture latency for the site is less than five seconds.
  11. 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.
  12. In the AWS DMS console, verify whether the task is correctly capturing the rows of the Plant Applications production database.

What to do next

  1. Access the AWS DMS console.
  2. Select the data migration task with target S3.
  3. Select Actions, and then select Modify.
  4. 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.

  5. Save the task.
  6. Select Actions, select Start and then Restart.
  7. Verify that data sent to the S3 bucket.